@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* Color scheme overrides — remaps --blue to the selected scheme color */
body.scheme-green  { --blue: #16a34a; --blue-dark: #15803d; --blue-tint: #f0fdf4; }
body.scheme-orange { --blue: #ea580c; --blue-dark: #c2410c; --blue-tint: #fff7ed; }
body.scheme-purple { --blue: #7c3aed; --blue-dark: #6d28d9; --blue-tint: #f5f3ff; }
body.scheme-red    { --blue: #dc2626; --blue-dark: #b91c1c; --blue-tint: #fef2f2; }
body.scheme-teal   { --blue: #0d9488; --blue-dark: #0f766e; --blue-tint: #f0fdfa; }

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

:root {
    /* BDB brand — indigo primary, green growth, orange reserved for hover/highlights */
    --indigo: #2E2A6A;
    --navy: #1E1A4F;
    --cloud: #F8F9FA;
    --text: #2D3748;
    --blue: #2E2A6A;        /* "primary accent" — scheme-* remaps this per company */
    --blue-dark: #211d52;
    --blue-tint: #edecf6;
    --green: #1C7F36;
    --green-dark: #166b2d;
    --red: #dc2626;
    --red-dark: #b91c1c;
    --orange: #FB5B11;
    --gray-50: #f7f8fa;
    --gray-100: #eef0f4;
    --gray-200: #e3e6ec;
    --gray-300: #d1d5dd;
    --gray-400: #9aa1ad;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #1f2433;
    --radius: 14px;
    --sidebar-width: 240px;
    --easing: cubic-bezier(0.16, 1, 0.3, 1);
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--cloud);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}


/* --- Upload Page (Mobile-First) --- */

.upload-app {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.page-center {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.company-logo {
    max-height: 80px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.capture-header {
    text-align: center;
    padding: 16px 0;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 12px;
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.header-text { text-align: left; }

.capture-header h1 {
    font-size: 16px;
    color: var(--gray-500);
    font-weight: 600;
    margin-top: 2px;
}

.capture-header .company-name {
    font-size: 22px;
    color: var(--blue);
    font-weight: 700;
}

/* --- Capture App Container --- */

.capture-app {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

/* --- Capture Buttons --- */

.btn-capture {
    width: 100%;
    padding: 20px;
    font-size: 20px;
    font-weight: 700;
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s;
}

.btn-capture:hover { background: var(--blue-dark); }

.btn-secondary {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s;
}

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

.btn-record {
    width: 100%;
    padding: 20px;
    font-size: 20px;
    font-weight: 700;
    background: var(--red);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s;
}

.btn-record:hover { background: var(--red-dark); }
.btn-record.recording { background: var(--red-dark); }

/* --- Capture Step Elements --- */

.preview-container {
    width: 100%;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--gray-100);
}

.preview-container img {
    max-width: 100%;
    max-height: 60vh;
    display: block;
    margin: 0 auto;
}

.voice-prompt {
    background: var(--blue-tint);
    border: 1px solid var(--blue);
    border-radius: var(--radius);
    padding: 16px;
    font-size: 15px;
    color: var(--gray-700);
    line-height: 1.6;
    width: 100%;
    text-align: center;
}

.recording-indicator {
    font-size: 16px;
    font-weight: 600;
    color: var(--red);
    display: none;
    align-items: center;
    gap: 8px;
}

.recording-indicator.active {
    display: flex;
}

.recording-dot {
    width: 12px;
    height: 12px;
    background: var(--red);
    border-radius: 50%;
    animation: blink 1s step-start infinite;
    display: inline-block;
}

@keyframes blink { 50% { opacity: 0; } }

.processing-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-700);
    margin-top: 16px;
    text-align: center;
}

/* --- Step Container --- */

.step-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 8px;
}

.step { display: none; width: 100%; }
.step.active { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.step.active form { width: 100%; }

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 40px 20px;
}

/* Drop zone */
.drop-zone {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    margin-bottom: 16px;
}

.drop-zone:hover, .drop-zone.drag-over {
    border-color: var(--blue);
    background: #eff6ff;
}

.drop-zone-content { pointer-events: none; }

.drop-text {
    font-size: 16px;
    font-weight: 600;
    margin-top: 12px;
}

.drop-link {
    color: var(--blue);
    text-decoration: underline;
}

.drop-hint {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* File list */
.file-list { margin-bottom: 16px; }

.file-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--gray-100);
    border-radius: 8px;
    margin-bottom: 6px;
}

.file-icon { flex-shrink: 0; display: flex; }
.file-name { flex: 1; font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size { font-size: 13px; color: var(--gray-500); flex-shrink: 0; }
.file-remove {
    background: none; border: none; cursor: pointer;
    font-size: 20px; color: var(--gray-500); padding: 0 4px;
    line-height: 1;
}
.file-remove:hover { color: var(--red); }

/* Meta section */
.meta-section { margin-bottom: 16px; }

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

.btn-upload {
    width: 100%;
    padding: 16px;
    font-size: 18px;
}

.btn-upload:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
}

/* Status rows (processing) */
.status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    margin-bottom: 8px;
    width: 100%;
    max-width: 400px;
}

.status-file {
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.status-badge {
    font-size: 13px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.status-badge.uploading { background: #dbeafe; color: var(--blue-dark); }
.status-badge.processing { background: #fef3c7; color: var(--orange); }
.status-badge.complete { background: #dcfce7; color: var(--green-dark); }
.status-badge.error { background: #fee2e2; color: var(--red-dark); }

.success-text {
    font-size: 22px;
    font-weight: 700;
    color: var(--green-dark);
    margin-top: 12px;
}

/* Success icon (reused) */
.success-icon {
    width: 80px;
    height: 80px;
    background: var(--green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 40px;
}

/* Spinner */
.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }


/* --- Admin Pages --- */

.admin-layout {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px 40px;
}

.admin-nav {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    padding: 0;
    border-bottom: 1px solid var(--blue);
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.admin-nav a {
    padding: 10px 18px;
    border-radius: 8px 8px 0 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--blue);
    text-decoration: none;
    white-space: nowrap;
    background: var(--blue-tint);
    border: 1px solid var(--blue);
    border-bottom: none;
    box-shadow: 0 -2px 6px rgba(0,0,0,0.06);
    transition: background 0.15s, color 0.15s;
    margin-bottom: -1px;
}

.admin-nav a:hover {
    background: var(--blue);
    color: #fff;
    text-decoration: none;
}

.admin-nav a.active {
    background: var(--blue);
    color: #fff;
    border-color: var(--blue);
    border-bottom: 1px solid var(--blue);
    box-shadow: 0 -3px 8px rgba(0,0,0,0.12);
}

.admin-nav:has(+ .admin-subnav) { margin-bottom: 0; }

.admin-subnav {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 0;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--blue);
}

.admin-subnav a {
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-600);
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}

.admin-subnav a:hover {
    background: var(--gray-100);
    color: var(--gray-800);
    text-decoration: none;
}

.admin-subnav a.active {
    background: var(--blue);
    color: #fff;
}

.admin-nav .spacer { flex: 1; }

.admin-nav .user-info {
    font-size: 13px;
    color: var(--gray-500);
    padding: 6px 8px;
    white-space: nowrap;
}

h2 { font-size: 22px; margin-bottom: 16px; }
h3 { font-size: 18px; }


/* --- Stat Cards --- */

.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
}

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

.stat-alert {
    border-color: var(--orange);
    background: #fff7ed;
}

.stat-alert .stat-value {
    color: var(--orange);
}


/* --- Detail Header --- */

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

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


/* --- Statement Metadata Card (admin) --- */

.meta-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 16px;
}

.meta-card .form-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.meta-card .form-group {
    flex: 1;
    min-width: 140px;
}

.meta-card .form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.meta-card .form-group input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 14px;
}

/* --- Reconciliation Summary --- */

.recon-summary {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    padding: 16px;
    background: var(--gray-100);
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.recon-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.recon-label {
    font-size: 12px;
    color: var(--gray-500);
    font-weight: 600;
    text-transform: uppercase;
}

.recon-value {
    font-size: 16px;
    font-weight: 600;
}


/* --- Tables --- */

.table-wrap { overflow-x: auto; }

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

th, td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--gray-200);
}

th {
    background: var(--gray-100);
    font-weight: 600;
    color: var(--gray-700);
}

tr:hover { background: var(--gray-50); }

.td-desc {
    max-width: 400px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.td-amount { font-family: monospace; white-space: nowrap; }
.amount-positive { color: var(--green-dark); }
.amount-negative { color: var(--red-dark); }

.row-review { background: #fffbeb; }
.row-duplicate { background: #fef2f2; }


/* --- Resizable Column Headers --- */

th.resizable {
    position: relative;
    overflow: visible;
    user-select: none;
}

th.resizable .resize-handle {
    position: absolute;
    top: 0;
    right: -3px;
    width: 6px;
    height: 100%;
    cursor: col-resize;
    z-index: 10;
}

th.resizable .resize-handle::after {
    content: "";
    display: block;
    position: absolute;
    top: 25%;
    left: 2px;
    width: 2px;
    height: 50%;
    background: var(--gray-300);
    border-radius: 1px;
    transition: background 0.15s;
}

th.resizable .resize-handle:hover::after,
th.resizable.resizing .resize-handle::after {
    background: var(--blue);
}

table.resizing {
    cursor: col-resize;
    user-select: none;
}

table.resizing td,
table.resizing th {
    user-select: none;
}


/* --- Badges --- */

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.badge-active { background: #dcfce7; color: var(--green-dark); }
.badge-inactive { background: #fee2e2; color: var(--red-dark); }
.badge-processing { background: #fef3c7; color: var(--orange); }
.badge-parsed { background: #dbeafe; color: var(--blue-dark); }
.badge-review { background: #fef3c7; color: var(--orange); }
.badge-complete { background: #dcfce7; color: var(--green-dark); }
.badge-error { background: #fee2e2; color: var(--red-dark); }
.badge-format { background: var(--gray-100); color: var(--gray-700); }


/* --- Forms --- */

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

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

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

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


/* --- Buttons --- */

.btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: #fff;
    transition: background 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-blue { background: var(--blue); }
.btn-blue:hover { background: var(--blue-dark); }
.btn-red { background: var(--red); }
.btn-red:hover { background: var(--red-dark); }
.btn-green { background: var(--green); }
.btn-green:hover { background: var(--green-dark); }
.btn-sm { padding: 6px 14px; font-size: 13px; }


/* --- Flash Messages --- */

.flash {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.flash-success { background: #dcfce7; color: var(--green-dark); }
.flash-error { background: #fee2e2; color: var(--red-dark); }


/* --- Token URL Display --- */

.token-url {
    font-family: monospace;
    font-size: 13px;
    color: var(--gray-500);
    word-break: break-all;
}


/* --- Browse Navigation --- */

.browse-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.browse-nav a {
    padding: 8px 16px;
    background: var(--gray-100);
    border-radius: 8px;
    text-decoration: none;
    color: var(--gray-700);
    font-weight: 600;
    font-size: 14px;
}

.browse-nav a:hover, .browse-nav a.active {
    background: var(--blue);
    color: #fff;
}


/* --- Login Page --- */

.login-container {
    max-width: 380px;
    margin: 80px auto;
    padding: 32px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.login-container h1 {
    text-align: center;
    margin-bottom: 24px;
    font-size: 24px;
}


/* --- BDB Footer --- */

.bdb-footer {
    text-align: center;
    padding: 24px 16px 16px;
    margin-top: auto;
    border-top: 1px solid var(--gray-200);
}

.bdb-footer img {
    max-height: 90px;
    max-width: 400px;
    object-fit: contain;
    opacity: 0.7;
}


/* --- Filter Bar --- */

.filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 16px;
}

.filter-select {
    width: auto !important;
    min-width: 140px;
    padding: 8px 12px;
    font-size: 13px;
}


/* --- Bulk Action Bar --- */

.bulk-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: #eff6ff;
    border: 1px solid var(--blue);
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--blue-dark);
}

.bulk-bar .form-select {
    padding: 6px 10px;
    font-size: 13px;
    width: auto;
    min-width: 160px;
}


/* --- Category select in table --- */

.category-select {
    padding: 5px 8px;
    font-size: 13px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    background: #fff;
    min-width: 140px;
}


/* --- Editable vendor --- */

.editable-vendor {
    font-weight: 500;
    font-size: 13px;
    white-space: nowrap;
}


/* --- Save vendor button in table --- */

.save-vendor-btn {
    white-space: nowrap;
    padding: 4px 10px !important;
    font-size: 12px !important;
}


/* --- Export page --- */

.export-options {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.export-card {
    flex: 1;
    min-width: 200px;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
}

.export-card h3 {
    margin-bottom: 8px;
}

.export-card p {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 12px;
}


/* --- Reconciliation page --- */

.recon-table-status-ok { color: var(--green-dark); font-weight: 600; }
.recon-table-status-check { color: var(--orange); font-weight: 600; }


/* --- Responsive --- */

@media (max-width: 640px) {
    .admin-layout { padding: 12px; }
    .admin-nav { gap: 8px; }
    .stat-cards { grid-template-columns: repeat(2, 1fr); }
    .detail-header { flex-direction: column; }
    .recon-summary { flex-direction: column; gap: 12px; }
    .filter-bar { flex-direction: column; }
    .filter-select { width: 100% !important; }
    .bulk-bar { flex-wrap: wrap; }
    .export-options { flex-direction: column; }

    /* Upload page mobile fixes */
    .upload-app { padding: 12px; }
    .drop-zone { padding: 24px 12px; }
    .meta-section { width: 100%; }
    .meta-section .form-group { width: 100%; }
    .meta-section .form-group input,
    .meta-section .form-group select {
        width: 100%;
        max-width: 100%;
        font-size: 16px; /* Prevent iOS zoom on focus */
    }
    .form-row { grid-template-columns: 1fr; }
}

/* ===================================================================
   BDB BRAND LAYER — sidebar nav, dark mode, refined components.
   Appended last so it wins the cascade. Bookkeeping rules: indigo/green
   buttons, orange reserved for hover accents + focus.
   =================================================================== */
h1, h2, h3, h4 { font-family: 'Outfit', sans-serif; color: var(--indigo); letter-spacing: -0.01em; }
code, .badge, .sb-user, .stat-card .num { font-family: 'DM Mono', ui-monospace, monospace; }

/* Sidebar shell — applied without touching page templates via :has() */
.admin-layout:has(.sidebar) {
    padding: 26px 34px 26px calc(var(--sidebar-width) + 34px);
    max-width: 1400px;
}
.sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--navy), #17143b);
    display: flex; flex-direction: column; padding: 16px 12px; gap: 3px;
    overflow-y: auto; z-index: 50;
}
.sidebar .sb-brand { font-weight: 800; font-size: 21px; color: #fff; padding: 6px 10px 14px; letter-spacing: -0.02em; }
.sidebar .sb-brand span { color: #56c47a; }
.sidebar a {
    display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px;
    color: rgba(255,255,255,0.78); text-decoration: none; font-size: 14px; font-weight: 500;
    transition: background .2s var(--easing), color .2s;
}
.sidebar a:hover { background: rgba(255,255,255,0.09); color: #fff; }
.sidebar a.active { background: var(--blue); color: #fff; }
.sidebar .sb-section { font-family: 'DM Mono'; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255,255,255,0.4); padding: 14px 12px 4px; }
.sidebar .sb-sub a { padding-left: 26px; font-size: 13px; color: rgba(255,255,255,0.64); }
.sidebar .sb-spacer { flex: 1; min-height: 12px; }
.sidebar .sb-foot { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 10px; margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.sidebar .sb-user { font-size: 12px; color: rgba(255,255,255,0.5); padding: 4px 12px; }
.sb-darktoggle { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.13); color: rgba(255,255,255,0.85); border-radius: 10px; padding: 8px 12px; cursor: pointer; font: 500 13px 'Outfit', sans-serif; text-align: left; transition: background .2s; }
.sb-darktoggle:hover { background: rgba(255,255,255,0.13); }

/* Refined components (light) */
.meta-card, .stat-card { background: #fff; border: 1px solid rgba(46,42,106,0.12); border-radius: var(--radius); box-shadow: 0 4px 16px rgba(46,42,106,0.05); transition: border-color .3s, box-shadow .4s var(--easing), transform .4s var(--easing); }
.stat-card:hover { border-color: rgba(46,42,106,0.28); box-shadow: 0 12px 30px rgba(46,42,106,0.09); transform: translateY(-3px); }
.btn { font-family: 'Outfit', sans-serif; border-radius: 10px; font-weight: 600; transition: background .2s, transform .15s var(--easing), box-shadow .25s; }
.btn:hover { transform: translateY(-1px); }
.btn-blue:hover { box-shadow: 0 8px 20px rgba(46,42,106,0.22); }
.btn-green:hover { box-shadow: 0 8px 20px rgba(28,127,54,0.22); }
.badge { font-family: 'DM Mono', monospace; font-weight: 500; letter-spacing: 0.04em; border-radius: 999px; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

/* Dark mode */
body.dark { background: #14121f; color: #d6d8e3; }
body.dark h1, body.dark h2, body.dark h3, body.dark h4 { color: #e9eaf5; }
body.dark .meta-card, body.dark .stat-card { background: #1d1a2e; border-color: rgba(255,255,255,0.08); box-shadow: none; }
body.dark .data-table th { background: #232038; color: #b9bccb; }
body.dark .data-table td, body.dark .data-table th { border-color: rgba(255,255,255,0.07); }
body.dark input, body.dark select, body.dark textarea { background: #232038; color: #e3e5ef; border-color: rgba(255,255,255,0.13); }
body.dark a { color: #aab1ff; }
body.dark .flash-success { background: rgba(28,127,54,0.18); color: #84dd9c; }
body.dark .flash-error { background: rgba(220,38,38,0.18); color: #ff9d9d; }

/* Responsive: sidebar collapses to a top bar */
@media (max-width: 900px) {
    .admin-layout:has(.sidebar) { padding: 16px; }
    .sidebar { position: static; width: auto; flex-direction: row; flex-wrap: wrap; gap: 4px; padding: 10px; margin-bottom: 16px; border-radius: var(--radius); }
    .sidebar .sb-brand { width: 100%; padding: 4px 8px 8px; font-size: 18px; }
    .sidebar .sb-section, .sidebar .sb-spacer { display: none; }
    .sidebar .sb-sub { display: contents; }
    .sidebar .sb-sub a { padding-left: 12px; }
    .sidebar .sb-foot { border: none; padding: 0; margin: 0; flex-direction: row; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .stat-card, .btn { transition: none !important; transform: none !important; }
}
