/* ============================================================
   MSDBRS base styles — Civic Editorial palette
   paper #FAF7F1 · ink #16181D · navy #143F6B · deep navy #0F2E52
   orange #C2652A · yellow #C99A2E · red #A93A26 · hairline #E3DDD1
   ============================================================ */

/* Base Styles */
.drop-indicator {
  position: absolute;
  background: #143F6B;
  width: 2px;
  height: 20px;
  z-index: 3000;
}

.chart-card {
  cursor: move;
  transition: 0.2s;
}
.chart-card.opacity-50 {
  opacity: 0.5;
}

.signup-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 30px;
    background-color: #fff;
    border: 1px solid #E3DDD1;
    text-align: center;
}

.signup-container h2 {
    margin-bottom: 20px;
}

.signup-container p {
    color: #57534A;
    margin-bottom: 20px;
}

.signup-form .form-group {
    margin-bottom: 15px;
    text-align: left;
}

.signup-form input {
    width: 100%;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #E3DDD1;
    box-sizing: border-box;
}

.signup-form button {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    border: none;
    border-radius: 3px;
    background-color: #143F6B;
    color: #F5F1E9;
    font-size: 16px;
    cursor: pointer;
}

.signup-form button:hover {
    background-color: #0F2E52;
}

.login-link {
    margin-top: 15px;
    font-size: 14px;
}

.login-link a {
    color: #C2652A;
    text-decoration: none;
}

.login-link a:hover {
    text-decoration: underline;
}
.strength-meter {
    margin-top: 5px;
    font-weight: bold;
    font-size: 14px;
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    flex: 1;
    padding-right: 40px; /* leave space for the icon */
}

.toggle-password {
    position: absolute;
    right: 10px;
    cursor: pointer;
    font-size: 18px;
    user-select: none;
    color: #57534A;
    transition: color 0.2s;
}

.toggle-password:hover {
    color: #16181D;
}

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
    background-color: #FFFFFF;
    margin: 0;
    padding: 0;
    color: #16181D;
}

h2, h3 {
    color: #16181D;
    margin-top: 20px;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Dropdowns (topbar bell + profile) */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropbtn {
    background: transparent;
    color: #57534A;
    text-decoration: none;
    font-size: 14.5px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0;
}

.dropbtn:hover {
    color: #16181D;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: #fff;
    min-width: 180px;
    box-shadow: 0 8px 16px rgba(22,24,29,0.12);
    border: 1px solid #E3DDD1;
    z-index: 2000;
    overflow: hidden;
}

.dropdown-content a,
.dropdown-content p {
    color: #16181D;
    padding: 10px 15px;
    text-decoration: none;
    display: block;
    font-size: 14px;
    border-bottom: 1px solid #EDE8DE;
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover {
    background-color: #FAF7F1;
    color: #C2652A;
}

/* Show dropdown on hover */
.dropdown:hover .dropdown-content {
    display: block;
}

/* Tabs */
ul.tabs {
    list-style: none;
    display: flex;
    padding: 0;
    margin: 20px 0 10px 0;
    border-bottom: 1px solid #E3DDD1;
}

ul.tabs li {
    margin-right: 10px;
}

ul.tabs li a {
    display: block;
    padding: 10px 15px;
    background-color: transparent;
    color: #57534A;
    text-decoration: none;
}

ul.tabs li a.active {
    color: #16181D;
    border-bottom: 2px solid #C2652A;
    font-weight: bold;
}

/* Excel Handsontable container */
#hot {
    margin-top: 10px;
    border: 1px solid #E3DDD1;
}

/* Word editor */
#word_editor {
    border: 1px solid #E3DDD1;
    padding: 10px;
    min-height: 400px;
    background-color: #fff;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Search input */
input[type="text"] {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #E3DDD1;
    margin-bottom: 10px;
    width: 250px;
}

/* Buttons */
button {
    padding: 8px 15px;
    border: none;
    border-radius: 3px;
    background-color: #143F6B;
    color: #F5F1E9;
    cursor: pointer;
    margin-top: 10px;
}

button:hover {
    background-color: #0F2E52;
}

/* Search Highlight */
mark, .search_highlight {
    background-color: #F3E3AF;
}

/* Word diff highlight */
#word_editor mark {
    background-color: #F3E3AF;
    font-weight: bold;
}

/* PDF iframe */
iframe {
    border: 1px solid #E3DDD1;
}

/* Tables for Excel comparison */
table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 20px;
}

table th, table td {
    border: 1px solid #E3DDD1;
    padding: 5px;
    text-align: left;
}

table td {
    background-color: #fff;
}

table td.diff {
    background-color: rgba(169,58,38,0.15);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        width: 95%;
        padding: 10px;
    }

    input[type="text"] {
        width: 100%;
    }

    ul.tabs {
        flex-wrap: wrap;
    }

    ul.tabs li {
        margin-bottom: 5px;
    }
}

.summary-box {
    background: #FAF7F1;
    padding: 15px;
    border-left: 4px solid #C99A2E;
    font-style: italic;
    margin: 10px 0;
    white-space: pre-wrap;
}

.diff-box {
    overflow-x: auto;
    margin-top: 20px;
    border: 1px solid #E3DDD1;
    background: #fff;
    padding: 10px;
}

.diff-box table {
    border-collapse: collapse;
    width: 100%;
    font-size: 14px;
}

.diff-box td, .diff-box th {
    padding: 4px 8px;
    border: 1px solid #EDE8DE;
    vertical-align: top;
}

.diff-box .diff_add {
    background-color: #e6ffe6; /* green */
}

.diff-box .diff_chg {
    background-color: #ffffcc; /* yellow */
}

.diff-box .diff_sub {
    background-color: #ffe6e6; /* red */
}
.diff-box details {
    margin-bottom: 10px;
    border: 1px solid #EDE8DE;
    background: #FAF7F1;
    padding: 5px;
}

.diff-box summary {
    cursor: pointer;
    font-weight: bold;
    margin-bottom: 5px;
}

.diff-controls {
    margin: 10px 0;
    display: flex;
    gap: 10px;
}

.diff-controls button {
    padding: 5px 10px;
    border: none;
    border-radius: 3px;
    background: #143F6B;
    color: #F5F1E9;
    cursor: pointer;
}

.diff-controls button:hover {
    background: #0F2E52;
}

/* Layout */
.layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar (colors themed in partials/_sidebar.html — 1c/1d) */
.sidebar {
    width: 248px;
    background: #0F2E52;
    color: #B9C3CF;
    display: flex;
    flex-direction: column;
    transition: width 0.3s, left 0.3s;
}

.sidebar.collapsed {
    width: 70px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 20px;
}

/* Sidebar Navigation */
.sidebar-nav {
    display: flex;
    flex-direction: column;
}

.sidebar-nav a {
    color: #B9C3CF;
    padding: 9px 12px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.3s;
}

.sidebar-nav a:hover {
    background: rgba(237,232,222,0.08);
}

/* Collapsed Sidebar */
.sidebar.collapsed .sidebar-nav a span {
    display: none;
}

.sidebar.collapsed h3 {
    display: none;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 20px;
    background: #FFFFFF;
    transition: margin-left 0.3s;
}

.main-content.expanded {
    margin-left: -180px; /* adjust when sidebar collapsed */
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -248px;
        top: 0;
        height: 100%;
        z-index: 1000;
    }

    .sidebar.show {
        left: 0;
    }

    .main-content {
        margin-left: 0;
    }
}

/* Top bar — layout only; colors come from partials/_header.html */
.topnav {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topnav-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topnav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.top-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
}

/* Centered Search Bar */
.topnav-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.search-form {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 4px;
    overflow: hidden;
    width: 100%;
    max-width: 400px;
    border: 1px solid #E3DDD1;
}

.search-form input {
    border: none;
    padding: 8px 12px;
    outline: none;
    flex: 1;
    font-size: 14px;
}

.search-form button {
    background: #143F6B;
    border: none;
    color: #F5F1E9;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
}

.search-form button:hover {
    background: #0F2E52;
}

button.danger {
    background: #A93A26;
    color: #FAF7F1;
    border: none;
    padding: 10px 15px;
    border-radius: 3px;
    cursor: pointer;
    margin-top: 10px;
}

button.danger:hover {
    background: #8C2F1F;
}

@media (max-width: 768px) {
    .topnav-center {
        display: none; /* Hide on mobile to save space */
    }
    .dropdown-content {
        right: 10px;
        min-width: 160px;
    }
}

.footer {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    background: #0F2E52;
    color: #9FB0C4;
    z-index: 100;
    border-top: 1px solid rgba(237,232,222,0.12);
}

/* File type color mapping */
.icon-pdf {
    color: #A93A26;
}
.icon-doc,
.icon-docx {
    color: #143F6B;
}
.icon-xls,
.icon-xlsx {
    color: #1d6f42;
}
.icon-ppt,
.icon-pptx {
    color: #C2652A;
}
.icon-txt {
    color: #6E6960;
}
.icon-default {
    color: #6E6960;
}
