/* ─── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --blue-primary: #34D399;
    --blue-light: #D1FAE5;
    --blue-hover: #059669;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-700: #374151;
    --gray-900: #111827;
    --green-light: #C6EFCE;
    --green-bg: #DCFCE7;
    --amber-light: #FFEB9C;
    --amber-bg: #FEF9C3;
    --red-light: #FCA5A5;
    --white: #FFFFFF;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --radius: 8px;
    --sidebar-width: 240px;
    --sidebar-bg: #1A3C34;
    --sidebar-text: #B5D5CA;
    --sidebar-active: #34D399;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--gray-900);
    background: var(--gray-50);
}

/* ─── Sidebar ─────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    z-index: 200;
    overflow: hidden;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo {
    width: 38px;
    height: 38px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.sidebar-title {
    font-size: 14px;
    font-weight: 700;
    color: #F1F5F9;
    line-height: 1.2;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background: rgba(255,255,255,0.06);
    color: #F1F5F9;
}

.sidebar-link.active {
    background: rgba(59, 130, 246, 0.12);
    color: var(--sidebar-active);
    border-left-color: var(--sidebar-active);
    font-weight: 600;
}

.sidebar-icon {
    width: 20px;
    text-align: center;
    font-size: 15px;
    flex-shrink: 0;
}

.sidebar-divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 8px 16px;
}

/* Collapsible sidebar groups */
.sidebar-group {}

.sidebar-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    color: rgba(203, 213, 225, 0.8);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
    margin-top: 12px;
}

.sidebar-group-header:hover {
    color: var(--gray-300);
}

.sidebar-phase {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(96, 165, 250, 0.25);
    color: #A7F3D0;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.sidebar-group-header .sidebar-group-arrow {
    font-size: 9px;
    transition: transform 0.2s;
    margin-left: auto;
    opacity: 0.5;
}

.sidebar-group.collapsed .sidebar-group-arrow {
    transform: rotate(-90deg);
}

.sidebar-group-items {
    overflow: hidden;
    max-height: 500px;
    transition: max-height 0.25s ease;
}

.sidebar-group.collapsed .sidebar-group-items {
    max-height: 0;
}

.sidebar-group-items .sidebar-link {
    padding-left: 24px;
    font-size: 13px;
    padding-top: 7px;
    padding-bottom: 7px;
}

/* Active group highlight */
.sidebar-group.has-active > .sidebar-group-header {
    color: var(--sidebar-active);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-user {
    margin-bottom: 8px;
}

.sidebar-user-name {
    font-size: 14px;
    font-weight: 600;
    color: #F1F5F9;
}

.sidebar-user-role {
    font-size: 12px;
    color: var(--gray-400);
}

.sidebar-tools {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}
.sidebar-tool-btn {
    flex: 1;
    padding: 8px 0;
    font-size: 18px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    color: #F1F5F9;
    cursor: pointer;
    transition: background 0.15s;
    text-align: center;
}
.sidebar-tool-btn:hover {
    background: rgba(255,255,255,0.2);
}
.sidebar-tool-btn.active {
    background: var(--blue-primary);
    border-color: var(--blue-primary);
}

.sidebar-logout {
    font-size: 13px;
    padding: 6px 0;
    border-left: none !important;
}

/* Sidebar toggle (mobile hamburger) */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 300;
    background: var(--sidebar-bg);
    border: none;
    border-radius: 6px;
    padding: 8px;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
}

.sidebar-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: transform 0.2s;
}

.sidebar-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
.sidebar-toggle.active span:nth-child(2) { opacity: 0; }
.sidebar-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); }

/* ─── Main Content Area ───────────────────────────────────── */
.app-main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.app-main.no-sidebar {
    margin-left: 0;
}

/* ─── Container ────────────────────────────────────────────── */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

/* ─── Page Header ──────────────────────────────────────────── */
.global-back-btn {
    margin-bottom: 8px;
}
.global-back-btn .back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: var(--blue-primary);
    text-decoration: none;
    font-weight: 500;
    padding: 4px 0;
}
.global-back-btn .back-link:hover {
    color: var(--blue-hover);
    text-decoration: underline;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 28px;
}

.page-top-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 12px 24px;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
}

.page-top-actions {
    display: flex;
    gap: 8px;
}

/* ─── Login Page ──────────────────────────────────────────── */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1A3C34 0%, #2D6B55 100%);
}

.login-card {
    background: var(--white);
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
}

.login-logo {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    overflow: hidden;
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.login-subtitle {
    color: var(--gray-500);
    margin-bottom: 24px;
}

.login-error {
    background: #FEE2E2;
    color: #DC2626;
    padding: 10px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 600;
}

.login-field {
    text-align: left;
    margin-bottom: 16px;
}

.login-field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--gray-700);
}

.login-field input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 15px;
}

.login-field input:focus {
    outline: none;
    border-color: var(--blue-primary);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.login-btn {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    margin-top: 8px;
}

/* ─── Buttons ──────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
    background: var(--blue-primary);
    color: var(--white);
}
.btn-primary:hover { background: var(--blue-hover); }

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}
.btn-secondary:hover { background: var(--gray-300); }

.btn-warning {
    background: #F59E0B;
    color: var(--white);
}
.btn-warning:hover { background: #D97706; }

.btn-danger {
    background: #EF4444;
    color: var(--white);
}
.btn-danger:hover { background: #DC2626; }

.btn-large {
    padding: 12px 32px;
    font-size: 16px;
}

.btn-small {
    padding: 4px 12px;
    font-size: 13px;
}

/* ─── Home / Materials List ───────────────────────────────── */
.home-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.home-header h1 { font-size: 28px; }

.job-list {
    display: grid;
    gap: 12px;
}

.job-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s, border-color 0.15s;
}
.job-card:hover {
    border-color: var(--blue-primary);
    box-shadow: var(--shadow-md);
}
.job-card-name {
    font-size: 17px;
    font-weight: 600;
}
.job-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--gray-500);
}

.status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}
.status-needs-bid { background: #D1FAE5; color: #047857; }
.status-takeoff-sent { background: #FEF3C7; color: #92400E; }
.status-bid-complete { background: #E0E7FF; color: #3730A3; }
.status-in-progress { background: var(--amber-bg); color: #92400E; }
.status-complete { background: var(--green-bg); color: #166534; }
.status-approved { background: var(--green-bg); color: #166534; }
.status-draft { background: var(--gray-100); color: var(--gray-700); }
.status-sent { background: #D1FAE5; color: #047857; }
.status-paid { background: var(--green-bg); color: #166534; }
.status-overdue { background: #FEE2E2; color: #DC2626; }
.status-open { background: #D1FAE5; color: #047857; }
.status-assigned { background: #E0E7FF; color: #3730A3; }
.status-resolved { background: var(--green-bg); color: #166534; }
.status-closed { background: var(--gray-100); color: var(--gray-500); }
.status-active { background: var(--green-bg); color: #166534; }
.status-expiring-soon { background: var(--amber-bg); color: #92400E; }
.status-expired { background: #FEE2E2; color: #DC2626; }
.status-claimed { background: #E0E7FF; color: #3730A3; }
.status-denied { background: #FEE2E2; color: #DC2626; }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
    font-size: 16px;
}

/* ─── Modal ────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
}

.modal {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    width: 90%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}
.modal-wide {
    max-width: 1000px;
    max-height: 80vh;
    overflow-y: auto;
}
.modal .form-actions,
.modal .modal-actions {
    position: sticky;
    bottom: -24px;
    background: var(--white);
    padding: 16px 0 0;
    margin: 16px -24px -24px;
    padding: 16px 24px 24px;
    border-top: 1px solid var(--gray-200);
    z-index: 1;
}
.modal h2 { margin-bottom: 16px; }
.modal label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
}
.modal input[type="text"],
.modal input[type="number"],
.modal input[type="password"],
.modal input[type="date"],
.modal input[type="email"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 15px;
    margin-bottom: 16px;
}
.modal input:focus,
.modal textarea:focus,
.modal select:focus {
    outline: none;
    border-color: var(--blue-primary);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}
.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

/* ─── Modal Form Layout ───────────────────────────────────── */
.modal-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}
.modal-field {
    flex: 1;
}
.modal-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
}
.modal-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 15px;
}
.modal-field input:focus {
    outline: none;
    border-color: var(--blue-primary);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}
.modal-field-sm {
    flex: 0 0 100px;
}

/* ─── Email/Proposal Modal ───────────────────────────────── */
.modal-box {
    background: var(--white);
    border-radius: var(--radius);
    padding: 0;
    width: 90%;
    max-width: 560px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}
.modal-box .modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 0;
}
.modal-box .modal-header h3 { margin: 0; font-size: 16px; }
.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    color: var(--gray-400);
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}
.modal-close:hover { color: var(--gray-700); }
.modal-body {
    padding: 20px 24px;
    max-height: 60vh;
    overflow-y: auto;
}
.modal-footer {
    padding: 12px 24px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
.tax-lookup-info {
    display: inline-block;
    margin-top: 24px;
    font-size: 13px;
    color: #16A34A;
    font-weight: 600;
}
.tax-lookup-info.out-of-state {
    color: #D97706;
}

/* ─── Job Page ─────────────────────────────────────────────── */
.job-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.editable-title {
    font-size: 26px;
    cursor: default;
    padding: 2px 6px;
    border-radius: 4px;
    border: 2px solid transparent;
}
.editable-title:hover {
    border-color: var(--gray-300);
    cursor: text;
}
.editable-title:focus {
    outline: none;
    border-color: var(--blue-primary);
    cursor: text;
}
.job-header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}
.status-select {
    padding: 6px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 14px;
    background: var(--white);
}

.job-address-info {
    font-size: 14px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* ─── Tabs ─────────────────────────────────────────────────── */
.tab-bar {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 0;
}

.tab {
    padding: 10px 20px;
    background: none;
    border: none;
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-500);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
}
.tab:hover { color: var(--gray-700); }
.tab.active {
    color: var(--blue-primary);
    border-bottom-color: var(--blue-primary);
}

.tab-content { display: none; padding-top: 16px; }
.tab-content.active { display: block; }

/* ─── Data Table ───────────────────────────────────────────── */
.table-wrapper, .module-table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background: var(--white);
}

/* ─── Materials Job Page: frozen headers, black grid, row highlight ─── */
.job-page .table-scroll-outer {
    max-height: 80vh;
    overflow: auto;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
}
.job-page .table-scroll-outer .table-wrapper {
    border: none;
    border-radius: 0;
    overflow: visible;
}

/* Header rows freeze via sticky th — see .data-table th and entry-table overrides */
/* Entry table: freeze entire thead as a block */
.job-page .entry-table thead {
    position: sticky;
    top: 0;
    z-index: 12;
}
.job-page .entry-table thead th {
    background: #4472C4;
}
/* Frozen column headers need highest z-index (intersection of sticky row + sticky col) */
.job-page .entry-table th.freeze-col-1,
.job-page .entry-table th.freeze-col-2,
.job-page .entry-table th.freeze-col-3,
.job-page .entry-table th.freeze-col-4 {
    z-index: 14;
}

/* Hide number input spinners in materials tables */
.job-page .data-table input[type="number"]::-webkit-outer-spin-button,
.job-page .data-table input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.job-page .data-table input[type="number"] {
    -moz-appearance: textfield;
}

/* Black grid borders on materials tables */
.job-page .data-table th {
    border: 1px solid #000;
}
.job-page .data-table td {
    border: 1px solid #000;
}

/* Highlight active row on hover — bright red */
.job-page .data-table tbody tr:hover td {
    background-color: #FCA5A5 !important;
}
.job-page .data-table tbody tr:hover td.freeze-col-1,
.job-page .data-table tbody tr:hover td.freeze-col-2,
.job-page .data-table tbody tr:hover td.freeze-col-3,
.job-page .data-table tbody tr:hover td.freeze-col-4 {
    background-color: #FCA5A5 !important;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.data-table th {
    background: #4472C4;
    color: var(--white);
    padding: 8px 10px;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    border: 1px solid #3B63A8;
    position: sticky;
    top: 0;
    z-index: 10;
}
.data-table td {
    padding: 4px 6px;
    border: 1px solid var(--gray-200);
    vertical-align: middle;
}

.data-table a.link {
    color: var(--blue-primary);
    text-decoration: none;
    font-weight: 600;
}
.data-table a.link:hover { text-decoration: underline; }

/* Column widths — master list */
.col-line { min-width: 48px; white-space: nowrap; }
.col-stock { min-width: 42px; white-space: nowrap; }
.col-sku { min-width: 110px; white-space: nowrap; }
.col-desc { min-width: 300px; }
.col-num { min-width: 90px; white-space: nowrap; }
.col-pricing { min-width: 54px; white-space: nowrap; }
.col-computed { min-width: 100px; white-space: nowrap; }
.col-summary { min-width: 70px; white-space: nowrap; }
.col-notes { min-width: 110px; }
.col-action { min-width: 30px; }

/* Compact master table */
#masterTable {
    font-size: 12px;
}
#masterTable th {
    padding: 6px 4px;
    font-size: 11px;
}
#masterTable td {
    padding: 2px 3px;
}

/* Editable cells */
.cell-editable {
    background: var(--blue-light);
}
.cell-editable input,
.cell-editable select {
    width: 100%;
    padding: 3px 4px;
    border: 1px solid transparent;
    border-radius: 3px;
    font-size: 12px;
    background: transparent;
}
.cell-editable input:focus,
.cell-editable select:focus {
    outline: none;
    border-color: var(--blue-primary);
    background: var(--white);
}
.cell-editable input[type="number"] {
    text-align: right;
}

/* Computed cells */
.cell-computed {
    background: var(--gray-100);
    text-align: right;
    padding: 3px 5px;
    font-weight: 500;
    font-size: 12px;
    color: var(--gray-700);
    white-space: nowrap;
}

.cell-summary {
    background: var(--green-light);
    text-align: right;
    padding: 3px 5px;
    font-weight: 500;
    font-size: 12px;
    white-space: nowrap;
}

.cell-total-green {
    background: var(--green-light) !important;
    font-weight: 700;
}
.cell-total-amber {
    background: var(--amber-light) !important;
    font-weight: 700;
}
.cell-total-none {
    background: var(--gray-100);
}

.cell-readonly {
    background: var(--gray-100);
    padding: 6px 10px;
    color: var(--gray-700);
}

.cell-entry {
    background: var(--blue-light);
    padding: 0;
    min-width: 80px;
}
.entry-table th:not(.col-line):not(.col-desc):not(.col-num) {
    min-width: 80px;
}

/* Freeze first 4 columns (Line #, Description, Total Ordered, Total) in entry tabs */
.freeze-col-1 { position: sticky; left: 0; z-index: 5; min-width: 48px; max-width: 48px; }
.freeze-col-2 { position: sticky; left: 48px; z-index: 5; min-width: 300px; max-width: 300px; }
.freeze-col-3 { position: sticky; left: 348px; z-index: 5; min-width: 90px; max-width: 90px; }
.freeze-col-4 { position: sticky; left: 438px; z-index: 5; min-width: 60px; max-width: 60px; border-right: 2px solid var(--gray-400); }
td.freeze-col-1, td.freeze-col-2, td.freeze-col-3, td.freeze-col-4 { background: var(--white); }
th.freeze-col-1, th.freeze-col-2, th.freeze-col-3, th.freeze-col-4 { z-index: 12; }
.cell-entry input {
    width: 100%;
    padding: 6px 8px;
    border: none;
    background: transparent;
    font-size: 14px;
    text-align: right;
}
.cell-entry input:focus {
    outline: 2px solid var(--blue-primary);
    outline-offset: -2px;
    background: var(--white);
}

.editable-header { padding: 0; min-width: 240px; }
.date-header-cell { padding: 0; min-width: 80px; }
.date-input {
    width: 100%;
    padding: 4px 6px;
    border: none;
    background: transparent;
    font-size: 12px;
    text-align: center;
    color: var(--white);
    cursor: pointer;
}
.date-input::-webkit-calendar-picker-indicator { filter: invert(1); }
.date-input:focus {
    outline: 2px solid var(--white);
    outline-offset: -2px;
    background: rgba(255,255,255,0.15);
}
.header-input {
    width: 100%;
    padding: 6px 8px;
    border: none;
    background: transparent;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    color: var(--gray-700);
}
.header-input::placeholder {
    color: var(--gray-400);
    font-weight: 400;
}
.header-input:focus {
    outline: 2px solid var(--blue-primary);
    outline-offset: -2px;
    background: var(--white);
}
.col-delete-btn {
    position: absolute;
    top: 1px;
    right: 1px;
    width: 16px;
    height: 16px;
    padding: 0;
    border: none;
    background: var(--gray-300);
    color: white;
    border-radius: 50%;
    font-size: 11px;
    line-height: 16px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 1;
}
th:hover .col-delete-btn {
    opacity: 1;
}
.col-delete-btn:hover {
    background: var(--danger);
}

.col-insert-btn {
    position: absolute;
    top: 1px;
    left: 1px;
    width: 16px;
    height: 16px;
    padding: 0;
    border: none;
    background: var(--gray-300);
    color: white;
    border-radius: 50%;
    font-size: 12px;
    line-height: 14px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 1;
}
th:hover .col-insert-btn {
    opacity: 1;
}
.col-insert-btn:hover {
    background: #34D399;
}

.draggable-col.drag-over {
    background: #D1FAE5 !important;
    box-shadow: inset 0 0 0 2px #34D399;
}

.btn-delete-row {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
    border-radius: 4px;
    line-height: 1;
}
.btn-delete-row:hover {
    color: #EF4444;
    background: #FEE2E2;
}

/* ─── Cost Summary ─────────────────────────────────────────── */
.cost-summary {
    margin-top: 24px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 20px 24px;
    max-width: 400px;
    margin-left: auto;
}
.cost-summary h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--gray-700);
}
.cost-summary-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}
.cost-label {
    font-size: 14px;
    color: var(--gray-500);
}
.cost-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
}
.cost-row-fee {
    color: #D97706;
}
.cost-row-fee .cost-label,
.cost-row-fee .cost-value {
    color: #D97706;
}
.cost-row-total {
    border-top: 2px solid var(--gray-200);
    padding-top: 10px;
    margin-top: 4px;
}
.cost-row-total .cost-label {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
}
.cost-row-total .cost-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--blue-primary);
}

/* ─── Save Bar ─────────────────────────────────────────────── */
.save-bar {
    position: sticky;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    padding: 16px 0;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    margin-top: 16px;
}
.save-bar-total {
    font-size: 16px;
    font-weight: 700;
    color: var(--blue-primary);
    margin-right: auto;
}
.save-status {
    font-size: 14px;
    color: var(--gray-500);
}
.save-status.unsaved {
    color: #D97706;
    font-weight: 600;
}
.save-status.saved {
    color: #16A34A;
    font-weight: 600;
}
.save-status.saving {
    color: var(--gray-500);
}

/* ─── History Page ─────────────────────────────────────────── */
.history-page h1 { margin-bottom: 4px; }
.history-subtitle {
    color: var(--gray-500);
    margin-bottom: 24px;
}

.version-list {
    display: grid;
    gap: 8px;
}
.version-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
}
.version-desc { font-weight: 600; }
.version-date {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 2px;
}
.version-actions {
    display: flex;
    gap: 6px;
}

.preview-table { margin-top: 8px; }
.preview-table td { padding: 6px 10px; }
.preview-table .computed { background: var(--gray-100); font-weight: 500; }

.btn-delete-job {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
    margin-left: 4px;
}
.btn-delete-job:hover {
    color: #EF4444;
    background: #FEE2E2;
}

/* ─── KPI Grid ─────────────────────────────────────────────── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 20px;
    border-left: 4px solid var(--blue-primary);
}

.kpi-value {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--gray-900);
}

.kpi-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
    margin-top: 4px;
}

/* ─── Charts ───────────────────────────────────────────────── */
.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}
.chart-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 20px;
}
.chart-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--gray-700);
}

/* ─── Cards ────────────────────────────────────────────────── */
.card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 20px 24px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.card-header h3 { font-size: 16px; }

.card-body { }

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

/* ─── Article Cards ────────────────────────────────────────── */
.article-card {
    display: block;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 16px 20px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s, border-color 0.15s;
}
.article-card:hover {
    border-color: var(--blue-primary);
    box-shadow: var(--shadow-md);
}
.article-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}
.article-card-header h3 {
    font-size: 16px;
    color: var(--blue-primary);
}
.article-card-tags {
    font-size: 12px;
    color: var(--gray-400);
}
.article-card-date {
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 4px;
}

.article-content {
    white-space: pre-wrap;
    line-height: 1.7;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.article-tags {
    font-size: 13px;
    color: var(--gray-400);
}

.article-footer {
    display: flex;
    gap: 24px;
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 16px;
}

/* ─── Badges ───────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 2px 10px;
    background: var(--gray-100);
    color: var(--gray-700);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* ─── Code Books ───────────────────────────────────────────── */
.codebook-card {
    display: block;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 24px;
    text-decoration: none;
    color: inherit;
    text-align: center;
    transition: box-shadow 0.15s, border-color 0.15s;
}
.codebook-card:hover {
    border-color: var(--blue-primary);
    box-shadow: var(--shadow-md);
}
.codebook-code {
    font-size: 28px;
    font-weight: 800;
    color: var(--blue-primary);
}
.codebook-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    margin-top: 4px;
}
.codebook-edition {
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 2px;
}

/* ─── Code Books Browse Layout ──────────────────────────── */
.codebook-browse-layout {
    display: grid;
    grid-template-columns: 340px 1fr 260px;
    gap: 16px;
    margin-top: 16px;
    height: calc(100vh - 220px);
    min-height: 500px;
}

.codebook-nav-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.section-tree {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow-y: auto;
    flex: 1;
}

.codebook-content-panel {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 24px;
    overflow-y: auto;
}

.content-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--gray-400);
    font-size: 15px;
}

.content-header h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--gray-900);
    line-height: 1.3;
}

.content-breadcrumb {
    font-size: 13px;
    color: var(--gray-400);
    margin-bottom: 8px;
}
.breadcrumb-link {
    color: var(--blue-primary);
    cursor: pointer;
    text-decoration: none;
}
.breadcrumb-link:hover { text-decoration: underline; }

.content-body p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--gray-700);
    margin-bottom: 12px;
}

.content-subsections {
    margin-top: 24px;
    border-top: 1px solid var(--gray-200);
    padding-top: 16px;
}
.content-subsections h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--gray-600);
}

.content-subsection-item {
    padding: 12px;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    font-size: 14px;
}
.content-subsection-item:hover { background: var(--gray-50); border-color: var(--blue-primary); }
.content-subsection-item strong { color: var(--blue-primary); }

.subsection-preview {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 4px;
    line-height: 1.5;
}

/* ─── Tree Node Styles ─────────────────────────────────── */
.tree-node {}
.tree-children {}

.section-item {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    border-bottom: 1px solid var(--gray-100);
    gap: 4px;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 13px;
}
.section-item:hover { background: var(--gray-50); }
.section-item.selected { background: #ECFDF5; border-left: 3px solid var(--blue-primary); }

.section-item.depth-0 { font-weight: 600; font-size: 13px; }
.section-item.depth-1 { font-size: 13px; }
.section-item.depth-2 { font-size: 12px; color: var(--gray-600); }

.tree-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 10px;
    color: var(--gray-400);
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    border-radius: 3px;
}
.tree-toggle:hover { background: var(--gray-200); color: var(--gray-700); }
.tree-toggle-spacer { width: 18px; flex-shrink: 0; }

.section-number {
    font-weight: 700;
    font-size: inherit;
    color: var(--blue-primary);
    white-space: nowrap;
    flex-shrink: 0;
}

.section-title {
    flex: 1;
    font-size: inherit;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.depth-badge {
    font-size: 10px;
    background: var(--gray-100);
    color: var(--gray-500);
    padding: 1px 6px;
    border-radius: 3px;
    white-space: nowrap;
    flex-shrink: 0;
}

.bookmark-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: var(--gray-300);
    padding: 2px 4px;
    border-radius: 4px;
    flex-shrink: 0;
}
.bookmark-btn:hover { color: #F59E0B; }
.bookmark-btn.bookmarked { color: #F59E0B; }

.bookmark-panel {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 12px;
    overflow-y: auto;
}
.bookmark-panel h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 10px;
}

.bookmark-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 12px;
    flex-wrap: wrap;
    cursor: pointer;
}
.bookmark-item:hover { color: var(--blue-primary); }
.bookmark-item:last-child { border-bottom: none; }

.bookmark-remove {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 16px;
    margin-left: auto;
}
.bookmark-remove:hover { color: #EF4444; }

.search-result-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.search-result-item:hover { background: var(--gray-50); border-color: var(--blue-primary); }

/* Old layout compat */
.codebook-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
    margin-top: 16px;
}

/* ─── Section Header ───────────────────────────────────────── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

/* ─── Filter Bar ───────────────────────────────────────────── */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}
.filter-bar select {
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 14px;
    background: var(--white);
}

/* ─── Search Bar ───────────────────────────────────────────── */
.search-bar {
    margin-bottom: 16px;
}

/* ─── Forms ────────────────────────────────────────────────── */
.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    margin-top: 12px;
    color: var(--gray-700);
}

.form-input, .form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 15px;
    background: var(--white);
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--blue-primary);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
}

.form-textarea:focus {
    outline: none;
    border-color: var(--blue-primary);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.form-select-sm {
    padding: 4px 8px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 13px;
    background: var(--white);
}

/* ─── Detail Grid ──────────────────────────────────────────── */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.detail-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-label {
    font-weight: 600;
    font-size: 14px;
    color: var(--gray-500);
    min-width: 100px;
}

/* ─── Warranty Claims ──────────────────────────────────────── */
.claim-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 8px;
}

.claim-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

/* ─── Text utilities ───────────────────────────────────────── */
.text-muted { color: var(--gray-500); font-size: 14px; }
.loading { color: var(--gray-500); padding: 20px; text-align: center; }

/* ─── Analytics (stage sections) ───────────────────────────── */
.stage-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.stage-card {
    padding: 20px;
    border-radius: var(--radius);
    border: 2px solid;
    text-align: center;
}
.stage-card-count {
    font-size: 36px;
    font-weight: 800;
    line-height: 1.1;
}
.stage-card-label {
    font-size: 14px;
    font-weight: 600;
    margin-top: 4px;
}

.grand-totals { margin-bottom: 24px; }
.grand-totals-row {
    display: flex;
    gap: 16px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 16px 24px;
}
.grand-total-item { flex: 1; text-align: center; }
.grand-total-label { display: block; font-size: 13px; color: var(--gray-500); margin-bottom: 4px; }
.grand-total-value { font-size: 18px; font-weight: 700; color: var(--gray-900); }
.grand-total-highlight {
    background: var(--blue-primary);
    margin: -16px -24px -16px 0;
    padding: 16px 24px;
    border-radius: 0 var(--radius) var(--radius) 0;
}
.grand-total-highlight .grand-total-label { color: rgba(255,255,255,0.8); }
.grand-total-highlight .grand-total-value { color: var(--white); }

.stage-section { margin-bottom: 8px; }
.stage-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s;
}
.stage-section-header:hover { opacity: 0.85; }
.stage-chevron { font-size: 12px; transition: transform 0.2s; }
.stage-section.open .stage-chevron { transform: rotate(180deg); }
.stage-section-body { display: none; padding: 12px 0; }
.stage-section.open .stage-section-body { display: block; }
.stage-empty { padding: 16px 20px; color: var(--gray-500); font-size: 14px; }
.analytics-table { font-size: 14px; }
.analytics-job-link { color: var(--blue-primary); text-decoration: none; font-weight: 600; }
.analytics-job-link:hover { text-decoration: underline; }

/* ─── Notifications ────────────────────────────────────────── */
.notif-bell-wrapper {
    position: relative;
    cursor: pointer;
    margin-left: auto;
    padding: 4px;
}

.notif-bell {
    font-size: 20px;
    filter: grayscale(1) brightness(2);
    transition: filter 0.15s;
}

.notif-bell-wrapper:hover .notif-bell {
    filter: none;
}

.notif-badge {
    position: absolute;
    top: -2px;
    right: -4px;
    background: #EF4444;
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.notif-panel {
    position: absolute;
    top: 70px;
    left: 8px;
    right: 8px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    z-index: 300;
    max-height: 400px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.notif-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-900);
    font-size: 14px;
}

.notif-panel-list {
    overflow-y: auto;
    max-height: 340px;
}

.notif-item {
    padding: 10px 16px;
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
    transition: background 0.15s;
}

.notif-item:hover {
    background: var(--gray-50);
}

.notif-item.unread {
    background: #ECFDF5;
    border-left: 3px solid var(--blue-primary);
}

.notif-item.read {
    opacity: 0.7;
}

.notif-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-900);
}

.notif-message {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-time {
    font-size: 11px;
    color: var(--gray-400);
    margin-top: 4px;
}

/* ─── Bid Styles ──────────────────────────────────────────── */
.bid-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.bid-section {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 20px 24px;
}

.bid-section h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gray-100);
}

.bid-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-600);
}

.bid-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.bid-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.bid-field {
    display: flex;
    flex-direction: column;
}

.bid-field .form-label {
    margin-top: 0;
    font-size: 13px;
}

.calc-field {
    background: var(--gray-50) !important;
    font-weight: 600;
    color: var(--blue-primary) !important;
}

.bid-summary-card {
    background: var(--white);
    border: 2px solid var(--blue-primary);
    border-radius: var(--radius);
    padding: 24px 32px;
    max-width: 700px;
}

.bid-summary-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--blue-primary);
    margin-bottom: 16px;
}

.status-submitted { background: #D1FAE5; color: #047857; }
.status-accepted { background: var(--green-bg); color: #166534; }
.status-rejected { background: #FEE2E2; color: #DC2626; }
.status-declined { background: #FEF3C7; color: #92400E; }
.status-lost { background: #F3F4F6; color: #6B7280; }

/* ─── Chat Styles ─────────────────────────────────────────── */
.chat-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 0;
    height: calc(100vh - 48px);
    margin: -24px;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

.chat-sidebar {
    background: var(--gray-50);
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--gray-200);
}

.chat-sidebar-header h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

.chat-session-list {
    flex: 1;
    overflow-y: auto;
}

.chat-session-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
    transition: background 0.15s;
}

.chat-session-item:hover {
    background: var(--gray-100);
}

.chat-session-item.active {
    background: #ECFDF5;
    border-left: 3px solid var(--blue-primary);
}

.chat-session-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-session-date {
    font-size: 11px;
    color: var(--gray-400);
    margin-top: 2px;
}

.chat-main {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-welcome {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}

.chat-welcome h2 {
    font-size: 22px;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.chat-message {
    display: flex;
}

.chat-message.user {
    justify-content: flex-end;
}

.chat-message.assistant {
    justify-content: flex-start;
}

.chat-bubble {
    max-width: 70%;
    padding: 10px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-bubble.user {
    background: var(--blue-primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-bubble.assistant {
    background: var(--gray-100);
    color: var(--gray-900);
    border-bottom-left-radius: 4px;
}

.chat-bubble a.chat-link {
    color: var(--blue-primary);
    text-decoration: underline;
}

.chat-bubble.user a.chat-link {
    color: #A7F3D0;
}

.typing-dots {
    animation: blink 1.4s infinite;
}

@keyframes blink {
    0%, 20% { opacity: 0.2; }
    50% { opacity: 1; }
    100% { opacity: 0.2; }
}

.chat-input-bar {
    display: flex;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
    background: var(--white);
}

.chat-input-bar .form-input {
    flex: 1;
}

/* ─── Responsive ───────────────────────────────────────────── */
@media (max-width: 1024px) {
    .codebook-layout {
        grid-template-columns: 1fr;
    }
    .codebook-browse-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
    .codebook-nav-panel { max-height: 40vh; }
    .codebook-content-panel { min-height: 300px; }
    .bookmark-panel {
        max-height: 300px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: flex;
    }

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

    /* ─── Base Layout ─────────────────────────────────────────── */
    .container { padding: 10px; padding-top: 52px; }
    h1 { font-size: 20px; }
    h2 { font-size: 17px; }
    h3 { font-size: 15px; }
    body { font-size: 15px; -webkit-text-size-adjust: 100%; }

    /* ─── Headers & Flex ──────────────────────────────────────── */
    .job-header { flex-direction: column; align-items: flex-start; gap: 8px; }
    .home-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 8px; }
    .page-header .btn,
    .page-header a.btn { font-size: 13px; padding: 8px 14px; }

    /* ─── Touch-Friendly Targets ──────────────────────────────── */
    .btn, button, .tab, .sidebar-link, select, input[type="text"],
    input[type="number"], input[type="date"], input[type="email"],
    input[type="password"], textarea, .form-select, .form-input {
        min-height: 44px;
        font-size: 16px; /* prevents iOS zoom on focus */
    }
    .btn { padding: 10px 18px; font-size: 14px; }
    .btn-small { min-height: 36px; padding: 6px 12px; font-size: 13px; }

    /* ─── Tabs ────────────────────────────────────────────────── */
    .tab { padding: 10px 14px; font-size: 14px; }
    .tabs, .tab-bar { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; gap: 0; }

    /* ─── Tables ──────────────────────────────────────────────── */
    .data-table { font-size: 13px; }
    .data-table th, .data-table td { padding: 8px 6px; }
    .table-wrapper, .module-table-wrapper {
        -webkit-overflow-scrolling: touch;
        border-radius: 6px;
    }
    /* Card-style table on very narrow screens */
    .data-table.mobile-cards { display: block; }
    .data-table.mobile-cards thead { display: none; }
    .data-table.mobile-cards tbody { display: block; }
    .data-table.mobile-cards tr {
        display: block;
        background: var(--white);
        border: 1px solid var(--gray-200);
        border-radius: 8px;
        padding: 12px;
        margin-bottom: 8px;
    }
    .data-table.mobile-cards td {
        display: flex;
        justify-content: space-between;
        padding: 4px 0;
        border: none;
    }
    .data-table.mobile-cards td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--gray-500);
        font-size: 12px;
        margin-right: 12px;
    }

    /* ─── Grids ───────────────────────────────────────────────── */
    .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .charts-row { grid-template-columns: 1fr; }
    .stage-cards { grid-template-columns: repeat(2, 1fr); }
    .detail-grid { grid-template-columns: 1fr; }
    .cards-grid { grid-template-columns: 1fr; }
    .bid-form-grid { grid-template-columns: 1fr; }
    .bid-row-2col { grid-template-columns: 1fr; }
    .bid-summary-card { max-width: 100%; }
    .grand-totals-row { flex-wrap: wrap; }
    .grand-total-item { flex: 1 1 45%; }
    .grand-total-highlight { margin: 0; border-radius: var(--radius); }
    .form-row { flex-direction: column; gap: 8px; }

    /* ─── Filters ─────────────────────────────────────────────── */
    .filter-bar { flex-wrap: wrap; gap: 8px; }
    .filter-bar select, .filter-bar input { width: 100%; max-width: 100%; }

    /* ─── Chat Widget ─────────────────────────────────────────── */
    .chat-container { grid-template-columns: 1fr; height: calc(100vh - 48px); }
    .chat-sidebar { display: none; }
    .chat-widget { left: 0; right: 0; width: 100%; border-radius: 0; bottom: 0; max-height: 70vh; }

    /* ─── Mobile Modal Fixes ─────────────────────────────────── */
    .modal-overlay {
        padding: 6px;
        align-items: flex-start;
        padding-top: 3vh;
    }
    .modal {
        max-height: 92vh;
        overflow-y: auto;
        max-width: 98%;
        width: 100%;
        padding: 14px;
        border-radius: 12px;
    }
    .modal-header h2 { font-size: 17px; }
    .modal-box {
        max-height: 92vh;
        max-width: 98%;
        display: flex;
        flex-direction: column;
    }
    .modal-box .modal-body {
        flex: 1;
        overflow-y: auto;
    }
    .modal-wide {
        max-height: 92vh;
        max-width: 98%;
    }
    .modal-row {
        flex-direction: column;
        gap: 0;
    }
    .modal-actions,
    .modal-footer {
        position: sticky;
        bottom: 0;
        background: var(--white);
        padding-top: 12px;
        z-index: 1;
    }

    /* ─── Photo Gallery Mobile ────────────────────────────────── */
    .photo-gallery { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important; gap: 8px !important; }
    .photo-card { border-radius: 10px; }
    .photo-card img { height: 140px !important; }
    .photo-card-info { padding: 6px 8px !important; }
    .photo-card-info .photo-caption { font-size: 12px; }
    .photo-card-info .photo-meta { font-size: 11px; }
    .photo-card-btn { width: 32px !important; height: 32px !important; font-size: 16px !important; }
    .album-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important; gap: 8px !important; }
    .album-card img { height: 100px !important; }

    /* ─── Lightbox Mobile ─────────────────────────────────────── */
    .lightbox-close { top: 10px !important; right: 10px !important; font-size: 28px !important; padding: 8px !important; }
    .lightbox-nav { font-size: 32px !important; padding: 12px !important; }
    .lightbox-nav.prev { left: 4px !important; }
    .lightbox-nav.next { right: 4px !important; }
    .lightbox-img { max-width: 96% !important; max-height: 75vh !important; }
    .lightbox-caption { font-size: 13px !important; padding: 8px !important; }

    /* ─── Sidebar auto-close on link click ────────────────────── */
    .sidebar-link { padding: 12px 16px; font-size: 14px; }
}

/* ─── Toast Notifications ──────────────────────────────────── */
@keyframes toast-in {
    from { transform: translate(-50%, -20px); opacity: 0; }
    to   { transform: translate(-50%, 0); opacity: 1; }
}
@keyframes toast-out {
    from { transform: translate(-50%, 0); opacity: 1; }
    to   { transform: translate(-50%, -20px); opacity: 0; }
}

/* ─── Floating Chat Widget ──────────────────────────────────── */

/* ─── Floating Calculator ────────────────────────────────── */
.calc-widget {
    position: fixed;
    bottom: 80px;
    left: 16px;
    width: 240px;
    z-index: 9998;
    border-radius: var(--radius);
    box-shadow: 0 4px 24px rgba(0,0,0,0.25);
    background: var(--white);
    overflow: hidden;
    display: none;
}
.calc-widget.visible {
    display: block;
}
.calc-widget-header {
    background: #1A3C34;
    color: var(--white);
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}
.calc-close-btn {
    background: none;
    border: none;
    color: var(--white);
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    opacity: 0.7;
}
.calc-close-btn:hover { opacity: 1; }
.calc-widget-body { padding: 10px; background: #F1F5F9; }
.calc-display {
    width: 100%;
    padding: 10px 12px;
    font-size: 22px;
    font-weight: 700;
    text-align: right;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    margin-bottom: 8px;
    background: var(--white);
    color: #1A3C34;
}
.calc-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}
.calc-btn {
    padding: 12px 0;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: var(--white);
    color: #1A3C34;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    transition: background 0.1s;
}
.calc-btn:hover { background: #E2E8F0; }
.calc-btn:active { background: #CBD5E1; }
.calc-op { background: #D1FAE5; color: #34D399; }
.calc-op:hover { background: #A7F3D0; }
.calc-fn { background: #F1F5F9; color: #64748B; }
.calc-fn:hover { background: #E2E8F0; }
.calc-eq { background: #34D399; color: var(--white); }
.calc-eq:hover { background: #059669; }
.calc-zero { grid-column: span 2; }

@media (max-width: 768px) {
    .calc-widget { left: 0; right: 0; width: 100%; border-radius: 0; bottom: 60px; }
}

.chat-widget {
    position: fixed;
    bottom: 80px;
    left: 16px;
    width: 380px;
    z-index: 9999;
    border-radius: var(--radius);
    box-shadow: 0 4px 24px rgba(0,0,0,0.25);
    background: var(--white);
    display: none;
    flex-direction: column;
    overflow: hidden;
    height: 500px;
}

.chat-widget.visible {
    display: flex;
}

.chat-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--blue-primary);
    color: white;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
}

.chat-widget-title {
    font-weight: 600;
    font-size: 14px;
}

.chat-widget-toggle {
    font-size: 12px;
    opacity: 0.8;
}

.chat-widget-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.chat-widget-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-widget-welcome {
    text-align: center;
    color: var(--gray-500);
    font-size: 13px;
    padding: 24px 12px;
}

.chat-widget-messages .chat-message {
    display: flex;
}

.chat-widget-messages .chat-message.user {
    justify-content: flex-end;
}

.chat-widget-messages .chat-bubble {
    max-width: 85%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.4;
    word-wrap: break-word;
}

.chat-widget-messages .chat-bubble.user {
    background: var(--blue-primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-widget-messages .chat-bubble.assistant {
    background: var(--gray-100);
    color: var(--gray-900);
    border-bottom-left-radius: 4px;
}

.chat-widget-messages .chat-bubble a.chat-link {
    color: var(--blue-primary);
    text-decoration: underline;
}

.chat-widget-input-bar {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    border-top: 1px solid var(--gray-200);
    flex-shrink: 0;
}

.chat-widget-input-bar .form-input {
    flex: 1;
    font-size: 13px;
    padding: 6px 10px;
}

/* Mic button */
.chat-mic-btn {
    background: var(--gray-100);
    color: var(--gray-600);
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.chat-mic-btn:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}
.chat-mic-btn.listening {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
    animation: mic-pulse 1s ease-in-out infinite;
}
@keyframes mic-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.3); }
    50% { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
}
.chat-mic-btn.unsupported {
    display: none;
}

/* Hide widget on the full chatbot page */
body.page-chatbot .chat-widget {
    display: none;
}

/* ─── Pay Applications (AIA G702/G703) ───────────────────────── */
.pa-section {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 16px;
}
.pa-section-title {
    padding: 12px 16px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    background: var(--gray-50);
    border-radius: var(--radius) var(--radius) 0 0;
}
.pa-section-body { padding: 16px; }
.sov-table .sov-header-row td {
    background: var(--gray-100);
    font-weight: 700;
    padding-top: 10px;
}

/* G702 Summary */
.g702-summary {
    background: var(--white);
    border: 2px solid var(--gray-300);
    border-radius: var(--radius);
    margin-bottom: 20px;
    overflow: hidden;
}
.g702-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--gray-900);
    color: var(--white);
}
.g702-header h2 { font-size: 15px; margin: 0; }
.g702-subtitle { font-size: 12px; opacity: 0.7; }
.g702-header-right { text-align: right; font-size: 13px; }
.g702-info-row {
    display: flex;
    gap: 24px;
    padding: 10px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}
.g702-body {
    display: flex;
    gap: 24px;
    padding: 16px;
}
.g702-lines { flex: 1; }
.g702-line {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 14px;
    border-bottom: 1px solid var(--gray-100);
}
.g702-line span:last-child { font-weight: 600; font-family: monospace; }
.g702-indent { padding-left: 20px; font-size: 13px; }
.g702-highlight {
    background: var(--green-bg);
    padding: 6px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 15px;
}
.g702-co {
    width: 280px;
    flex-shrink: 0;
    border-left: 1px solid var(--gray-200);
    padding-left: 24px;
}
.g702-co h4 { font-size: 13px; margin-bottom: 8px; }

/* G703 Table */
.g703-wrapper { margin-bottom: 24px; }
.g703-table th { font-size: 11px; text-align: center; padding: 4px 6px; }
.g703-table th small { display: block; font-weight: 400; }
.g703-table td { font-size: 13px; padding: 4px 6px; }
.g703-table .cell-money { text-align: right; font-family: monospace; font-size: 12px; white-space: nowrap; }
.g703-table .cell-pct { text-align: center; }
.g703-input {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 12px;
    font-family: monospace;
    text-align: right;
}
.g703-input:focus { border-color: var(--blue-primary); outline: none; box-shadow: 0 0 0 2px rgba(37,99,235,0.15); }
.g703-table .sov-header-row td {
    background: var(--gray-100);
    font-weight: 700;
    padding-top: 8px;
}

@media (max-width: 768px) {
    .g702-body { flex-direction: column; }
    .g702-co { width: 100%; border-left: none; border-top: 1px solid var(--gray-200); padding: 16px 0 0 0; }
    .g702-info-row { flex-direction: column; gap: 8px; }
}

/* ─── Equipment Manuals ──────────────────────────────────────── */
.manual-search-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}
.manual-search-bar .form-input {
    flex: 1;
}
.manual-search-bar .form-select {
    width: 200px;
}

/* ─── Job Schedule ───────────────────────────────────────────── */
.schedule-timeline th,
.schedule-timeline td {
    white-space: nowrap;
}
.schedule-timeline td:first-child {
    white-space: normal;
    min-width: 160px;
}
.schedule-timeline tr[draggable="true"]:hover .drag-handle {
    color: var(--gray-600) !important;
}
.schedule-timeline tr[draggable="true"] {
    transition: opacity 0.15s;
}
.phase-status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.phase-pending, .phase-status-select.phase-pending {
    background: var(--gray-200);
    color: var(--gray-700);
}
.phase-in-progress, .phase-status-select.phase-in-progress {
    background: var(--blue-light);
    color: var(--blue-primary);
}
.phase-complete, .phase-status-select.phase-complete {
    background: var(--green-bg);
    color: #166534;
}
.phase-cancelled, .phase-status-select.phase-cancelled {
    background: var(--red-light);
    color: #991B1B;
}
.phase-status-select {
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 13px;
    cursor: pointer;
}

/* Schedule job cards grid */
.schedule-job-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 8px;
}
.schedule-job-card {
    display: block;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 20px;
    text-decoration: none;
    color: var(--gray-900);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.schedule-job-card:hover {
    border-color: var(--blue-primary);
    box-shadow: var(--shadow-md);
}
.schedule-job-card-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}
.schedule-job-card-status {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 10px;
}
.schedule-progress-bar {
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}
.schedule-progress-fill {
    height: 100%;
    background: #22c55e;
    border-radius: 3px;
    transition: width 0.3s;
}
.schedule-job-card-action {
    font-size: 13px;
    color: var(--blue-primary);
    font-weight: 500;
}
.form-row {
    display: flex;
    gap: 12px;
}
.form-row .form-group {
    flex: 1;
}
.form-group {
    margin-bottom: 16px;
}

/* Loading spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.spinner-sm {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Completion dot indicators for codebook sections */
.completion-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    flex-shrink: 0;
}
.completion-dot.complete {
    background-color: #22C55E;
}
.completion-dot.incomplete {
    background-color: #D1D5DB;
}

/* Status badge for pending content */
.status-pending {
    background: #FEF3C7;
    color: #92400E;
}

/* Manual tag badges */
.manual-tags {
    margin-top: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.tag-badge {
    display: inline-block;
    padding: 1px 8px;
    background: var(--gray-100);
    color: var(--gray-700);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

@media (max-width: 768px) {
    .manual-search-bar {
        flex-direction: column;
    }
    .manual-search-bar .form-select {
        width: 100%;
    }
    .form-row {
        flex-direction: column;
    }
}

/* ─── Drag & Drop Overlay ───────────────────────────────────── */
.drag-drop-overlay {
    position: fixed; inset: 0; z-index: 10000;
    background: rgba(37, 99, 235, 0.12);
    border: 3px dashed var(--blue-primary);
    display: flex; align-items: center; justify-content: center;
    pointer-events: none; opacity: 0;
    transition: opacity 0.2s ease;
}
.drag-drop-overlay.visible { opacity: 1; pointer-events: auto; }
.drag-drop-overlay-content {
    text-align: center; color: var(--blue-primary);
}
.drag-drop-overlay-content svg { margin-bottom: 8px; }
.drag-drop-overlay-content p {
    font-size: 18px; font-weight: 600;
}

/* ─── Drag & Drop Modal ─────────────────────────────────────── */
.drag-drop-modal-backdrop, .dup-modal-backdrop {
    position: fixed; inset: 0; z-index: 10001;
    background: rgba(0,0,0,0.4);
    display: flex; align-items: center; justify-content: center;
}
.drag-drop-modal, .dup-modal {
    background: var(--white); border-radius: var(--radius);
    box-shadow: var(--shadow-md); width: 480px; max-width: 90vw;
    max-height: 80vh; display: flex; flex-direction: column;
}
.drag-drop-modal-header, .dup-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--gray-200);
}
.drag-drop-modal-header h3, .dup-modal-header h3 {
    font-size: 16px; font-weight: 600; color: var(--gray-900);
}
.drag-drop-modal-close {
    background: none; border: none; font-size: 22px;
    cursor: pointer; color: var(--gray-400); line-height: 1;
}
.drag-drop-modal-close:hover { color: var(--gray-700); }
.drag-drop-modal-body, .dup-modal-body {
    padding: 16px 20px; overflow-y: auto; flex: 1;
}
.drag-drop-modal-footer, .dup-modal-footer {
    padding: 12px 20px; border-top: 1px solid var(--gray-200);
    display: flex; justify-content: flex-end; gap: 8px;
}

/* File list in modal */
.dd-file-list { display: flex; flex-direction: column; gap: 4px; }
.dd-file-row {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; background: var(--gray-50);
    border-radius: 6px; font-size: 13px;
    transition: opacity 0.2s;
}
.dd-file-row.deselected { opacity: 0.45; }
.dd-file-cb { flex-shrink: 0; width: 16px; height: 16px; cursor: pointer; }
.dd-file-info { flex: 1; min-width: 0; }
.dd-file-name { font-weight: 500; color: var(--gray-900); word-break: break-all; }
.dd-file-size { color: var(--gray-500); margin-left: 8px; font-size: 12px; }
.dd-file-match { font-size: 11px; color: var(--gray-500); margin-top: 2px; }
.dd-file-badge {
    flex-shrink: 0; padding: 2px 10px; border-radius: 10px;
    font-size: 11px; font-weight: 600; white-space: nowrap;
}
.dd-file-badge.checking { background: var(--gray-200); color: var(--gray-500); }
.dd-file-badge.new-file { background: var(--green-bg); color: #166534; }
.dd-file-badge.exact { background: #FEE2E2; color: #991B1B; }
.dd-file-badge.near { background: var(--amber-bg); color: #92400E; }

/* Bulk actions */
.dd-bulk-actions {
    display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap;
}

/* Progress bar */
.dd-progress {
    margin-top: 12px; display: flex; align-items: center; gap: 10px;
}
.dd-progress-bar {
    flex: 1; height: 6px; background: var(--gray-200);
    border-radius: 3px; overflow: hidden;
}
.dd-progress-bar-inner {
    height: 100%; width: 0%;
    background: var(--blue-primary); border-radius: 3px;
    transition: width 0.3s ease;
}
.dd-progress-text { font-size: 12px; color: var(--gray-500); white-space: nowrap; }

/* ─── Duplicate Warning Modal ───────────────────────────────── */
.dup-message { font-size: 14px; color: var(--gray-700); margin-bottom: 12px; }
.dup-matches { display: flex; flex-direction: column; gap: 6px; }
.dup-match-item {
    padding: 8px 12px; background: var(--amber-bg);
    border-radius: 6px; font-size: 13px; color: var(--gray-900);
}
.dup-match-badge {
    display: inline-block; padding: 2px 8px; border-radius: 10px;
    font-size: 11px; font-weight: 600; margin-right: 6px;
    background: var(--amber-light); color: var(--gray-700);
}

/* ─── Inline Duplicate Warning (inside drop modal) ──────────── */
.dd-dup-warning {
    margin-top: 10px; padding: 10px 14px;
    background: #FEF3C7; border: 1px solid #F59E0B;
    border-radius: var(--radius); font-size: 13px;
}
.dd-dup-header {
    font-weight: 700; color: #92400E; margin-bottom: 6px; font-size: 13px;
}
.dd-dup-item {
    padding: 4px 0; color: var(--gray-700);
}
.dd-dup-badge {
    display: inline-block; padding: 1px 8px; border-radius: 10px;
    font-size: 11px; font-weight: 600; margin-right: 4px;
}
.dd-dup-badge.exact { background: #FCA5A5; color: #991B1B; }
.dd-dup-badge.near { background: var(--amber-light); color: #92400E; }
.dd-dup-hint {
    margin-top: 6px; font-size: 12px; color: var(--gray-500); font-style: italic;
}

/* Destination info */
.dd-dest-info {
    margin-top: 6px; font-size: 12px; color: var(--gray-500);
}

/* ─── Upload Success Toast ──────────────────────────────────── */
.dd-toast {
    position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
    background: var(--gray-900); color: #fff; padding: 12px 24px;
    border-radius: var(--radius); font-size: 14px; z-index: 10002;
    box-shadow: var(--shadow-md); opacity: 0;
    transition: opacity 0.3s ease;
}
.dd-toast.visible { opacity: 1; }
.dd-toast a { color: #A7F3D0; text-decoration: underline; margin-left: 4px; }

/* ─── Gantt Chart ──────────────────────────────────────────── */
.gantt-wrapper {
    position: relative;
    overflow-x: auto;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 24px;
    background: var(--white);
}
.gantt-chart {
    position: relative;
    min-width: 100%;
}
.gantt-arrows {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    overflow: visible;
}
.gantt-header {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
}
.gantt-label-col {
    flex-shrink: 0;
    padding: 0 12px;
    display: flex;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-right: 1px solid var(--gray-200);
    background: var(--gray-50);
}
.gantt-days-header {
    display: flex;
    flex-direction: column;
}
.gantt-months {
    display: flex;
    height: 24px;
}
.gantt-month {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-500);
    text-align: center;
    line-height: 24px;
    border-right: 1px solid var(--gray-200);
    overflow: hidden;
}
.gantt-day-numbers {
    display: flex;
    height: 26px;
}
.gantt-day {
    font-size: 11px;
    text-align: center;
    line-height: 26px;
    color: var(--gray-500);
    border-right: 1px solid var(--gray-100);
}
.gantt-day.weekend {
    background: rgba(0,0,0,0.02);
    color: var(--gray-400);
}
.gantt-body {
    position: relative;
}
.gantt-grid {
    position: absolute;
    top: 0;
}
.gantt-grid-line {
    position: absolute;
    top: 0;
    width: 1px;
    background: var(--gray-100);
}
.gantt-grid-line.weekend {
    background: rgba(0,0,0,0.04);
    width: 36px;
}
.gantt-today {
    position: absolute;
    top: 0;
    width: 2px;
    background: #EF4444;
    z-index: 5;
    opacity: 0.6;
    border-left: 1px dashed #EF4444;
}
.gantt-row {
    display: flex;
    border-bottom: 1px solid var(--gray-100);
}
.gantt-row:hover {
    background: var(--gray-50);
}
.gantt-row .gantt-label-col {
    font-weight: 500;
    font-size: 13px;
    color: var(--gray-900);
}
.gantt-bar-area {
    position: relative;
    flex-shrink: 0;
}
.gantt-bar {
    position: absolute;
    top: 8px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    padding: 0 8px;
    cursor: pointer;
    transition: opacity 0.15s;
    z-index: 2;
    min-width: 20px;
}
.gantt-bar:hover {
    opacity: 0.85;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.gantt-bar-label {
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.gantt-bar.critical {
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.4), 0 0 12px rgba(239, 68, 68, 0.2);
    border-left: 3px solid #DC2626;
}
.gantt-bar-progress {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: rgba(0,0,0,0.15);
    border-radius: 4px 0 0 4px;
    transition: width 0.3s;
    pointer-events: none;
}
/* Percent complete slider */
.pct-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 80px;
    height: 6px;
    border-radius: 3px;
    background: var(--gray-200);
    outline: none;
    cursor: pointer;
    touch-action: none;
}
.pct-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--blue-primary);
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.pct-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--blue-primary);
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
/* Weather risk chips */
.weather-risk-chip {
    display: inline-block;
    background: #FEF3C7;
    border: 1px solid #F59E0B;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 500;
    color: #78350F;
    line-height: 1.3;
}
/* Backwards plan summary card */
.bp-summary-card strong {
    color: var(--blue-primary);
}

/* ─── Feedback Page ────────────────────────────────────────── */
.feedback-category-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}
.feedback-category-badge.bug { background: #FEE2E2; color: #991B1B; }
.feedback-category-badge.feature { background: var(--blue-light); color: var(--blue-primary); }
.feedback-category-badge.improvement { background: #E0E7FF; color: #3730A3; }
.feedback-category-badge.question { background: var(--amber-bg); color: #92400E; }
.feedback-priority-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}
.feedback-priority-badge.low { background: var(--gray-200); color: var(--gray-700); }
.feedback-priority-badge.medium { background: var(--amber-bg); color: #92400E; }
.feedback-priority-badge.high { background: #FEE2E2; color: #991B1B; }
.feedback-status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}
.feedback-status-badge.new { background: var(--blue-light); color: var(--blue-primary); }
.feedback-status-badge.under-review { background: var(--amber-bg); color: #92400E; }
.feedback-status-badge.planned { background: #E0E7FF; color: #3730A3; }
.feedback-status-badge.in-progress { background: #D1FAE5; color: #059669; }
.feedback-status-badge.complete { background: var(--green-bg); color: #166534; }
.feedback-status-badge.wont-fix { background: var(--gray-200); color: var(--gray-700); }
.feedback-upvote-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    background: var(--white);
    cursor: pointer;
    font-size: 13px;
    color: var(--gray-700);
    transition: all 0.15s;
}
.feedback-upvote-btn:hover { border-color: var(--blue-primary); color: var(--blue-primary); }
.feedback-upvote-btn.upvoted { background: var(--blue-light); border-color: var(--blue-primary); color: var(--blue-primary); }
.feedback-detail {
    padding: 16px 20px;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
}
.feedback-response {
    margin-top: 12px;
    padding: 12px;
    background: #E0E7FF;
    border-radius: var(--radius);
    font-size: 14px;
}
.feedback-response-label {
    font-weight: 600;
    color: #3730A3;
    margin-bottom: 4px;
}

/* ─── Team Chat ─── */
.tc-page .container { max-width: 100%; padding: 0; }
.tc-page .chat-widget { display: none !important; }
.tc-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    height: calc(100vh - 80px);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
.tc-sidebar {
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.tc-sidebar-section { padding: 8px 0; }
.tc-sidebar-section + .tc-sidebar-section { border-top: 1px solid #e2e8f0; }
.tc-sidebar-section-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 14px; font-size: 11px; font-weight: 700;
    text-transform: uppercase; color: #64748b; letter-spacing: 0.5px;
}
.tc-sidebar-add {
    background: none; border: 1px solid #cbd5e1; border-radius: 4px;
    width: 22px; height: 22px; font-size: 16px; line-height: 1;
    cursor: pointer; color: #64748b; display: flex; align-items: center; justify-content: center;
}
.tc-sidebar-add:hover { background: #e2e8f0; color: #2D6B55; }
.tc-sidebar-list { padding: 0 6px; }
.tc-sidebar-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 10px; border-radius: 6px; cursor: pointer;
    font-size: 14px; color: #2D6B55; margin-bottom: 1px;
}
.tc-sidebar-item:hover { background: #e2e8f0; }
.tc-sidebar-item.active { background: #3b82f6; color: #fff; }
.tc-sidebar-item.active .tc-unread-badge { background: #fff; color: #3b82f6; }
.tc-sidebar-item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.tc-unread-badge {
    background: #ef4444; color: #fff; font-size: 11px; font-weight: 700;
    min-width: 18px; height: 18px; border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 5px; flex-shrink: 0; margin-left: 6px;
}
.tc-main {
    display: flex; flex-direction: column; min-width: 0; position: relative;
}
.tc-placeholder {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    justify-content: center; color: #94a3b8;
}
.tc-placeholder-icon { font-size: 48px; margin-bottom: 12px; }
.tc-placeholder-text { font-size: 16px; }
.tc-header {
    padding: 12px 18px; border-bottom: 1px solid #e2e8f0;
    display: flex; flex-direction: column; flex-shrink: 0;
}
.tc-header-name { font-size: 16px; font-weight: 700; color: #1e293b; }
.tc-header-desc { font-size: 12px; color: #64748b; margin-top: 2px; }
.tc-messages {
    flex: 1; overflow-y: auto; padding: 16px 18px;
    display: flex; flex-direction: column; gap: 2px;
}
.tc-no-messages {
    flex: 1; display: flex; align-items: center; justify-content: center;
    color: #94a3b8; font-size: 14px;
}
.tc-date-separator {
    text-align: center; margin: 16px 0 8px;
    position: relative; font-size: 12px; color: #64748b;
}
.tc-date-separator span {
    background: #fff; padding: 0 12px; position: relative; z-index: 1;
}
.tc-date-separator::before {
    content: ''; position: absolute; left: 0; right: 0; top: 50%;
    border-top: 1px solid #e2e8f0;
}
.tc-system-message {
    text-align: center; font-size: 12px; color: #94a3b8;
    font-style: italic; padding: 4px 0;
}
.tc-message {
    display: flex; gap: 10px; padding: 6px 0;
}
.tc-message-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: #3b82f6; color: #fff; font-size: 13px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.tc-message-own .tc-message-avatar { background: #10b981; }
.tc-message-body { min-width: 0; flex: 1; }
.tc-message-meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.tc-message-sender { font-weight: 600; font-size: 14px; color: #1e293b; }
.tc-message-time { font-size: 11px; color: #94a3b8; }
.tc-message-text { font-size: 14px; color: #2D6B55; line-height: 1.5; word-break: break-word; }
.tc-message-text a { color: #3b82f6; text-decoration: underline; }
.tc-message-image { margin-top: 6px; }
.tc-message-image img {
    max-width: 360px; max-height: 280px; border-radius: 8px;
    cursor: pointer; border: 1px solid #e2e8f0;
}
.tc-file-link {
    display: inline-block; margin-top: 4px; padding: 6px 12px;
    background: #f1f5f9; border-radius: 6px; font-size: 13px;
    color: #3b82f6; text-decoration: none; border: 1px solid #e2e8f0;
}
.tc-file-link:hover { background: #e2e8f0; }
.tc-input-bar {
    border-top: 1px solid #e2e8f0; padding: 10px 14px; flex-shrink: 0;
}
.tc-input-row { display: flex; gap: 8px; align-items: center; }
.tc-attach-btn {
    background: none; border: none; font-size: 20px; cursor: pointer;
    color: #64748b; padding: 4px; flex-shrink: 0;
}
.tc-attach-btn:hover { color: #3b82f6; }
.tc-input-row .form-input { flex: 1; }
.tc-file-preview {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 10px; margin-bottom: 6px;
    background: #f1f5f9; border-radius: 6px; font-size: 13px;
}
.tc-file-preview-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-file-preview-remove {
    background: none; border: none; font-size: 18px; cursor: pointer;
    color: #ef4444; padding: 0 4px;
}
.tc-sidebar-badge {
    background: #ef4444; color: #fff; font-size: 10px; font-weight: 700;
    min-width: 16px; height: 16px; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 4px; margin-left: 6px; vertical-align: middle;
}
.tc-mobile-back {
    display: none; position: absolute; top: 4px; left: 4px; z-index: 10;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 6px;
    padding: 6px 12px; font-size: 14px; cursor: pointer;
}
@media (max-width: 768px) {
    .tc-container { grid-template-columns: 1fr; }
    .tc-sidebar { display: flex; }
    .tc-sidebar-hidden { display: none !important; }
    .tc-main { display: none; }
    .tc-main-active { display: flex !important; }
    .tc-mobile-back { display: block; }
    .tc-message-image img { max-width: 100%; }
}

/* ─── Submittal Visual Flagging ─── */
@keyframes submittal-pulse-red {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}
@keyframes submittal-pulse-orange {
    0%, 100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(249, 115, 22, 0); }
}
.submittal-needs-action {
    animation: submittal-pulse-orange 2s infinite;
    border-left-color: #F97316 !important;
    background: #FFF7ED !important;
}
tr[data-submittal-rejected] .badge {
    animation: submittal-pulse-red 2s infinite;
}
tr[data-submittal-resubmit] .badge {
    animation: submittal-pulse-orange 2s infinite;
}

/* ─── Print Styles ──────────────────────────────────────────── */
@media print {
    @page { margin: 10mm; }
    body, html { margin: 0 !important; padding: 0 !important; background: #fff !important; min-height: 0 !important; height: auto !important; }
    body > *:not(.app-main) { display: none !important; }
    .sidebar, .page-header, .global-back-btn, .chat-widget, .calc-widget,
    .notif-bell-wrapper, .notif-panel, #chatWidget,
    #emailModal, #followupsSection, #awardSection { display: none !important; }
    .app-main { margin: 0 !important; padding: 0 !important; min-height: 0 !important; }
    .app-main .container { padding: 0 !important; min-height: 0 !important; }
    .bid-form { margin: 0 !important; padding: 0 !important; }
    .bid-form > * { display: none !important; }
    .bid-form > .bid-summary-card {
        display: block !important;
        width: 100% !important; max-width: 100% !important;
        margin: 0 !important; padding: 20px 32px !important;
        border: none !important; box-shadow: none !important;
        font-size: 13px;
    }
    .bid-summary-card * { display: block !important; }
    .bid-summary-card h3 { font-size: 18px; margin-bottom: 12px !important; }
    .bid-summary-card .cost-summary-grid { display: grid !important; gap: 2px !important; font-size: 13px; }
    .bid-summary-card .cost-row { display: flex !important; padding: 3px 0 !important; }
    .bid-summary-card .cost-row-total { font-weight: 700; }
    .bid-summary-card div[style*="border-top"] { border-top: 1px solid #ccc !important; padding-top: 8px !important; margin-top: 8px !important; }
}

/* ─── Global Search Overlay ─────────────────────────────────── */
.global-search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12vh;
}
.global-search-modal {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 600px;
    max-width: 95vw;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.global-search-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
}
.global-search-header svg { flex-shrink: 0; color: var(--gray-400); }
.global-search-header input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    background: transparent;
    color: var(--gray-900);
}
.global-search-header input::placeholder { color: var(--gray-400); }
.gs-kbd {
    font-size: 11px;
    padding: 2px 6px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    color: var(--gray-400);
    background: var(--gray-50);
    font-family: inherit;
}
.global-search-results {
    overflow-y: auto;
    padding: 8px 0;
    flex: 1;
}
.gs-empty, .gs-loading {
    text-align: center;
    padding: 32px 20px;
    color: var(--gray-400);
    font-size: 14px;
}
.gs-group { margin-bottom: 4px; }
.gs-group-header {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-400);
    padding: 8px 20px 4px;
    position: sticky;
    top: 0;
    background: var(--white);
    z-index: 1;
}
.gs-result {
    display: flex;
    align-items: center;
    padding: 8px 20px;
    text-decoration: none;
    color: var(--gray-900);
    cursor: pointer;
    transition: background 0.1s;
}
.gs-result:hover, .gs-result.gs-active {
    background: var(--blue-50, #eff6ff);
}
.gs-result-text { flex: 1; min-width: 0; }
.gs-result-title {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gs-result-subtitle {
    font-size: 12px;
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gs-result mark {
    background: #fef08a;
    color: inherit;
    border-radius: 2px;
    padding: 0 1px;
}
.sidebar-search-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    color: var(--gray-300);
    transition: color 0.15s, background 0.15s;
    display: flex;
    align-items: center;
}
.sidebar-search-btn:hover {
    color: var(--white);
    background: rgba(255,255,255,0.1);
}

/* ─── Job Hub Quick Links ───────────────────────────────────── */
.job-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}
.hub-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 10px;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    background: var(--white);
    text-decoration: none;
    color: var(--gray-700);
    transition: all 0.15s;
    text-align: center;
}
.hub-card:hover {
    border-color: var(--blue-primary);
    box-shadow: 0 2px 8px rgba(59,130,246,0.15);
    transform: translateY(-1px);
}
.hub-card-count {
    font-size: 24px;
    font-weight: 700;
    color: var(--blue-primary);
    line-height: 1;
    margin-bottom: 4px;
}
.hub-card-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
}
.hub-card-status {
    font-size: 11px;
    color: var(--gray-400);
    margin-top: 2px;
}
@media (max-width: 768px) {
    .global-search-overlay { padding-top: 5vh; }
    .global-search-modal { max-height: 85vh; }
    .job-hub-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

/* ─── QuickBooks-Style Top Navigation Bar ─────────────────── */
.topnav {
    display: flex;
    align-items: center;
    background: #1e293b;
    padding: 0 16px;
    height: 38px;
    gap: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    overflow: visible;
}
.topnav-brand {
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 0 14px 0 4px;
    text-decoration: none;
    border-right: 1px solid rgba(255,255,255,0.15);
    margin-right: 4px;
    line-height: 38px;
}
.topnav-brand:hover { color: #A7F3D0; }
.topnav-item {
    position: relative;
}
.topnav-btn {
    background: none;
    border: none;
    color: #cbd5e1;
    font-size: 12.5px;
    font-weight: 600;
    padding: 0 12px;
    line-height: 38px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, color .15s;
}
.topnav-btn:hover,
.topnav-item:hover .topnav-btn,
.topnav-item.active .topnav-btn {
    background: rgba(255,255,255,0.1);
    color: #fff;
}
.topnav-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    min-width: 190px;
    z-index: 200;
    padding: 4px 0;
}
.topnav-item:hover .topnav-dropdown {
    display: block;
}
.topnav-dropdown a {
    display: block;
    padding: 8px 16px;
    color: var(--gray-700);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: background .1s;
}
.topnav-dropdown a:hover {
    background: var(--blue-50, #eff6ff);
    color: var(--blue-primary);
}
/* Adjust main content for topnav */
.has-sidebar .topnav {
    margin: 0;
}
@media (max-width: 900px) {
    .topnav { display: none; }
}
