/* ─── Lumi Accounting Portal — Styles ───────────────────── */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --success: #16a34a;
    --success-light: #dcfce7;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --error: #dc2626;
    --error-light: #fee2e2;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --radius: 8px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--gray-800);
    background: var(--gray-50);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ─── Login ─────────────────────────────────────────────── */

.login-page {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: #fff;
    border-radius: 12px;
    padding: 40px 32px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    width: 160px;
    height: auto;
    margin-bottom: 16px;
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.login-header p {
    color: var(--gray-500);
    font-size: 0.9rem;
}

.login-form .form-group {
    margin-bottom: 20px;
}

/* ─── Navbar ────────────────────────────────────────────── */

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 56px;
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

.nav-brand a {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-logo {
    height: 28px;
    width: auto;
    vertical-align: middle;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-user {
    font-size: 0.85rem;
    color: var(--gray-500);
}

.nav-link {
    font-size: 0.85rem;
    color: var(--gray-600);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: var(--radius);
    transition: background 0.15s;
}

.nav-link:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

/* ─── Container & Layout ────────────────────────────────── */

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 24px 64px;
}

.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.page-header p {
    color: var(--gray-500);
    font-size: 0.95rem;
}

.back-link {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--primary);
    text-decoration: none;
    margin-bottom: 8px;
}

.back-link:hover { text-decoration: underline; }

.section {
    margin-top: 48px;
}

.section h2 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--gray-800);
}

/* ─── Cards ─────────────────────────────────────────────── */

.card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.card h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--gray-800);
}

/* ─── Tool Grid (Dashboard) ─────────────────────────────── */

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.tool-card {
    display: block;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 28px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-shadow: var(--shadow-sm);
}

.tool-card-active:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.tool-card-disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.tool-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 1.25rem;
    font-weight: 700;
    border-radius: 10px;
    margin-bottom: 16px;
}

.tool-card-disabled .tool-icon {
    background: var(--gray-100);
    color: var(--gray-400);
}

.tool-card h2 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.tool-card p {
    font-size: 0.9rem;
    color: var(--gray-500);
    margin-bottom: 16px;
}

.tool-status {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.status-active {
    background: var(--success-light);
    color: var(--success);
}

.status-coming {
    background: var(--gray-100);
    color: var(--gray-400);
}

/* ─── Forms ─────────────────────────────────────────────── */

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-input, .form-select {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.95rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    background: #fff;
    color: var(--gray-800);
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}

.form-input:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--gray-400);
    margin-top: 4px;
}

.form-row { margin-bottom: 20px; }

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

input[type="number"] {
    -moz-appearance: textfield;
}

/* ─── File Drop ─────────────────────────────────────────── */

.file-drop {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.file-drop:hover, .file-drop-active {
    border-color: var(--primary);
    background: var(--primary-light);
}

.file-drop-has-file {
    border-color: var(--success);
    background: var(--success-light);
}

.file-drop-text {
    color: var(--gray-500);
    font-size: 0.9rem;
}

.file-drop-name {
    font-weight: 600;
    color: var(--gray-800);
    margin-top: 8px;
    font-size: 0.9rem;
}

/* ─── Buttons ───────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--gray-200);
}

.btn-full { width: 100%; }

.btn-group {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.link-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: inherit;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

/* ─── Alerts ────────────────────────────────────────────── */

.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    line-height: 1.5;
}

.alert-error {
    background: var(--error-light);
    color: var(--error);
    border: 1px solid #fca5a5;
}

.alert-warning {
    background: var(--warning-light);
    color: #92400e;
    border: 1px solid #fcd34d;
}

.alert-warning strong {
    display: block;
    margin-bottom: 4px;
}

/* ─── Tables ────────────────────────────────────────────── */

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th {
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-500);
    padding: 10px 12px;
    border-bottom: 2px solid var(--gray-200);
}

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}

.data-table tbody tr:hover {
    background: var(--gray-50);
}

.total-row td {
    border-top: 2px solid var(--gray-300);
    border-bottom: none;
    padding-top: 12px;
    font-weight: 600;
    color: var(--gray-900);
}

.text-right { text-align: right; }
.text-muted { color: var(--gray-400); }
.text-success { color: var(--success); font-weight: 600; }

/* ─── JE Summary ────────────────────────────────────────── */

.je-summary {
    margin-bottom: 24px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 12px;
}

.summary-item {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 14px 16px;
}

.summary-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.summary-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-900);
}

.summary-memo {
    font-size: 0.85rem;
    color: var(--gray-600);
    background: var(--gray-50);
    padding: 10px 16px;
    border-radius: var(--radius);
}

/* ─── Success Box ───────────────────────────────────────── */

.success-box {
    text-align: center;
    padding: 20px 0;
}

.success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: var(--success-light);
    color: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
}

.success-box h2 {
    margin-bottom: 8px;
}

.success-box p {
    color: var(--gray-600);
    margin-bottom: 8px;
}

.success-box .btn-group {
    justify-content: center;
}

/* ─── Badges ────────────────────────────────────────────── */

.badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-revenue {
    background: var(--primary-light);
    color: var(--primary);
}

.badge-payroll {
    background: #fce7f3;
    color: #be185d;
}

/* ─── Coverage Map ──────────────────────────────────────── */

.coverage-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.coverage-section h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--gray-200);
}

.coverage-table th,
.coverage-table td {
    font-size: 0.85rem;
    padding: 8px 10px;
}

.coverage-table tr.cov-row-warning td {
    background: var(--warning-light);
}

.cov-pill {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    margin-right: 6px;
    margin-bottom: 4px;
    line-height: 1.4;
    white-space: nowrap;
}

.cov-pill-confirmed   { background: var(--success-light); color: var(--success); }
.cov-pill-generated   { background: var(--primary-light); color: var(--primary); }
.cov-pill-historical  { background: #ede9fe;             color: #6d28d9; }
.cov-pill-missing     { background: var(--warning-light); color: var(--warning); }
.cov-pill-mismatch    { background: #fef3c7;             color: #92400e; }
.cov-pill-awaiting    { background: #fef3c7;             color: #78350f; border: 1px dashed #d97706; }

/* ─── Reconciliation table (MGP vs QBO side-by-side) ──────────────── */
.recon-table th { background: #f8fafc; }
.recon-table td { vertical-align: top; }

.recon-row.recon-in_sync td { background: #f0fdf4; }
.recon-row.recon-mismatch td { background: #fffbeb; }
.recon-row.recon-missing_qbo_and_portal td { background: #fef2f2; }
.recon-row.recon-portal_only td { background: var(--primary-light); }
.recon-row.recon-qbo-only td { background: #f5f3ff; }

.recon-je-hint {
    display: inline-block;
    margin-top: 2px;
    font-size: 0.75rem;
    color: var(--gray-500);
    font-weight: 400;
}

.recon-diff-zero { color: var(--success); font-weight: 600; }
.recon-diff-bad  { color: #b45309;        font-weight: 600; }

.recon-extras {
    margin-top: 6px;
    padding: 6px 8px;
    background: rgba(0, 0, 0, 0.03);
    border-left: 2px solid var(--gray-300);
    font-size: 0.75rem;
    color: var(--gray-600);
    line-height: 1.4;
}

.recon-portal-note {
    margin-top: 4px;
    font-size: 0.75rem;
    color: var(--gray-500);
    font-style: italic;
}

.recon-actions {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
}

/* ─── How-To banner on dashboard ──────────────────────────── */
.howto-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    margin: 0 0 24px 0;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}
.howto-banner:hover { background: #dbeafe; }
.howto-banner-icon {
    flex: 0 0 44px;
    height: 44px;
    border-radius: 50%;
    background: #2563eb;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
}
.howto-banner-text { display: flex; flex-direction: column; gap: 2px; }
.howto-banner-text strong { font-size: 1rem; color: #1e293b; }
.howto-banner-text span { font-size: 0.9rem; color: #2563eb; }

.recon-tag-qbo-only {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    background: #ede9fe;
    color: #6d28d9;
    font-size: 0.7rem;
    border-radius: 3px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.btn-link {
    display: inline-block;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 2px 6px;
    margin-left: 4px;
    border-radius: 4px;
}

.btn-link:hover { background: var(--gray-100); }

.btn-link-primary { color: var(--primary); }
.btn-link-muted   { color: var(--gray-500); font-weight: 500; }

@media (max-width: 720px) {
    .coverage-grid { grid-template-columns: 1fr; }
}

/* ─── Reconcile page (May 6 2026 redesign) ──────────────────────────── */

.container-wide { max-width: 1280px; }

.status-card {
    border-top: 4px solid var(--primary);
}

.status-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
}

.status-header h2 { margin-bottom: 0; }

.status-snapshots {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.snap {
    display: flex;
    flex-direction: column;
    padding: 8px 14px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background: var(--gray-50);
    min-width: 240px;
}

.snap-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-500);
}

.snap-detail {
    font-size: 0.85rem;
    color: var(--gray-700);
    margin-top: 2px;
}

.snap-detail.snap-empty { color: var(--gray-400); font-style: italic; }
.snap-detail.snap-loaded { color: var(--success); font-weight: 600; }

.recon-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    margin: 16px 0 20px;
    padding: 10px 12px;
    background: var(--gray-50);
    border-radius: var(--radius);
    font-size: 0.85rem;
}

.status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.status-section h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--gray-200);
}

@media (max-width: 1024px) {
    .status-grid { grid-template-columns: 1fr; }
}

/* recon row colour states */
.recon-row.recon-in_sync td { background: #f0fdf4; }
.recon-row.recon-mismatch td { background: #fffbeb; }
.recon-row.recon-missing_qbo td { background: #fef2f2; }
.recon-row.recon-missing_both td { background: #fef2f2; }
.recon-row.recon-portal_only td { background: var(--primary-light); }
.recon-row.recon-qbo_only td { background: #f5f3ff; }
.recon-row.recon-accepted_variance td { background: #ede9fe; }

.recon-row { cursor: pointer; transition: filter 0.15s; }
.recon-row:hover { filter: brightness(0.97); }
.recon-row td.no-click { cursor: default; }

/* ─── Quarter group header + month/run toggles ──────────────────────── */

.quarter-header td.quarter-cell {
    padding: 10px 14px;
    font-size: 0.9rem;
    cursor: pointer;
    user-select: none;
}

.quarter-header.collapsed.done td.quarter-cell { background: var(--success-light); color: #14532d; }
.quarter-header.collapsed.open-needed td.quarter-cell { background: var(--warning-light); color: #92400e; }
.quarter-header.collapsed.awaiting-mgp td.quarter-cell { background: #fef3c7; color: #78350f; }
.quarter-header.open td.quarter-cell { background: var(--gray-100); color: var(--gray-700); border-bottom: 2px solid var(--gray-300); }
.quarter-header.open.awaiting-mgp td.quarter-cell { background: #fffbeb; border-bottom-color: #fde68a; }

.quarter-header td.quarter-cell:hover { filter: brightness(0.97); }

.quarter-toggle {
    display: inline-block;
    width: 14px;
    margin-right: 6px;
    color: inherit;
    opacity: 0.6;
    font-size: 0.85em;
}

.quarter-meta {
    margin-left: 10px;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.65;
    font-weight: 500;
}

.quarter-status {
    margin-left: 10px;
    font-size: 0.78rem;
    font-weight: 600;
}

.quarter-status-done { color: var(--success); }
.quarter-status-needs { color: #b45309; }
.quarter-status-awaiting { color: #b45309; font-style: italic; }

/* Month toggle (payroll month rows expand to show pay dates) */
.month-toggle {
    display: inline-block;
    width: 14px;
    margin-right: 6px;
    color: var(--gray-500);
    font-size: 0.85em;
}

.recon-row.recon-month td:first-child { padding-left: 14px; }

/* Pay-date sub-rows */
.recon-row.recon-subrow td {
    font-size: 0.85rem;
    background: var(--gray-50);
    color: var(--gray-700);
    border-top: 1px dashed var(--gray-200);
}
.recon-row.recon-subrow td.recon-subcell {
    padding-left: 38px;
    color: var(--gray-600);
}
.recon-row.recon-subrow.recon-mismatch td { background: #fffbeb; }
.recon-row.recon-subrow.recon-missing_qbo td { background: #fef2f2; }
.recon-row.recon-subrow.recon-missing_both td { background: #fef2f2; }
.recon-row.recon-subrow.recon-portal_only td { background: var(--primary-light); }
.recon-row.recon-subrow.recon-accepted_variance td { background: #ede9fe; }

/* Mini-badges next to the period label (extras / portal / decision hints) */
.recon-mini-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: 0.7rem;
    font-weight: 500;
    border-radius: 3px;
    letter-spacing: 0.02em;
    vertical-align: middle;
}
.recon-mini-badge-portal   { background: var(--primary-light); color: var(--primary); }
.recon-mini-badge-decision { background: #ede9fe;             color: #6d28d9; }

.recon-je-hint {
    display: block;
    font-size: 0.72rem;
    color: var(--gray-500);
    font-weight: 400;
    margin-top: 2px;
}

/* ─── MGP-missing banner (shown when no MGP file uploaded yet) ───── */

.mgp-missing-banner {
    margin: 4px 0 16px;
    padding: 14px 18px;
    border: 1px solid #fb923c;
    background: #fff7ed;
    color: #7c2d12;
    border-radius: var(--radius);
    font-size: 0.9rem;
    line-height: 1.5;
}

.mgp-missing-banner strong { color: #9a3412; }

/* ─── Changes banner (top of status card) ──────────────────────────── */

#changes-banner {
    margin: 4px 0 16px;
    padding: 14px 18px;
    border: 1px solid #fcd34d;
    background: var(--warning-light);
    color: #92400e;
    border-radius: var(--radius);
    font-size: 0.88rem;
}

#changes-banner h4 {
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #92400e;
}

.change-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-top: 1px dashed rgba(146, 64, 14, 0.25);
}

.change-item:first-child { border-top: 0; }

.change-item .change-detail { flex: 1 1 auto; }
.change-item .change-actions { flex: 0 0 auto; }

.change-item code {
    background: rgba(255, 255, 255, 0.55);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.8rem;
}

/* ─── Drill-down Modal ─────────────────────────────────────────────── */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow-y: auto;
}

.modal-card {
    width: 100%;
    max-width: 1100px;
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

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

.modal-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0 8px;
}

.modal-close:hover { color: var(--gray-800); }

.modal-summary {
    padding: 14px 28px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.9rem;
    line-height: 1.6;
}

.modal-summary .ms-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.modal-summary .ms-cell {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 10px 12px;
}

.modal-summary .ms-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-500);
    font-weight: 700;
}

.modal-summary .ms-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-top: 4px;
}

.modal-summary .ms-value.ms-diff-bad   { color: #b45309; }
.modal-summary .ms-value.ms-diff-zero  { color: var(--success); }

.modal-tabs {
    display: flex;
    gap: 0;
    padding: 0 16px;
    border-bottom: 1px solid var(--gray-200);
    overflow-x: auto;
}

.modal-tab {
    background: none;
    border: none;
    padding: 12px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-500);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
}

.modal-tab:hover { color: var(--gray-700); }
.modal-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 20px 28px;
}

.modal-body table { width: 100%; }

.modal-body .compare-table th { background: #f8fafc; }
.modal-body .compare-table tr.same-true td { background: #f0fdf4; }
.modal-body .compare-table tr.mgp-only td { background: var(--warning-light); }
.modal-body .compare-table tr.qbo-only td { background: #ede9fe; }

.modal-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 28px;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
    flex-wrap: wrap;
}

.modal-footer .btn { margin: 0; }

@media (max-width: 720px) {
    .modal-card { max-width: 100%; max-height: 100%; border-radius: 0; }
    .modal-summary .ms-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ─── No-data state ────────────────────────────────────────────────── */

.empty-state {
    padding: 32px 20px;
    text-align: center;
    color: var(--gray-500);
    background: var(--gray-50);
    border-radius: var(--radius);
    margin: 8px 0;
}

.empty-state strong { color: var(--gray-700); display: block; margin-bottom: 4px; }

/* ─── Hidden ────────────────────────────────────────────── */

.hidden { display: none !important; }

/* ─── Responsive ────────────────────────────────────────── */

@media (max-width: 640px) {
    .container { padding: 20px 16px 48px; }
    .form-row-2col { grid-template-columns: 1fr; }
    .summary-grid { grid-template-columns: repeat(2, 1fr); }
    .tool-grid { grid-template-columns: 1fr; }
    .navbar { padding: 0 16px; }
}
