/* ─────────────────────────────────────────────────────────────────────────
   BizPass Dashboard — Editorial Design System
   ─────────────────────────────────────────────────────────────────────────

   This stylesheet is the source of truth for the new dashboard design
   (cream + Fraunces + olive). It loads AFTER main.css and components.css
   so that Phase-1-migrated components override the older neumorphic
   styling, while non-migrated views still render with the legacy CSS.

   Phase 1 scope: sidebar + top header + shell + shared components
   (Modal, Toast, EmptyState, StatsWidget, ChartWidget) + Settings view.
   Future phases incrementally migrate the other views.

   Dark mode has been removed. The companion `[data-theme="dark"]` block
   in main.css should be deleted as part of this pass.
   ─────────────────────────────────────────────────────────── */

/* ─── Palette + tokens ─────────────────────────────────────── */

:root {
    --bg: #ecebe4;
    --bg-2: #f5f3ed;
    --bg-card: #ffffff;
    --ink: #16170f;
    --ink-2: #3a3b30;
    --muted: #6c6d5e;
    --hairline: rgba(0,0,0,0.08);
    --hairline-strong: rgba(0,0,0,0.14);
    --olive: #7c8062;
    --olive-deep: #585c40;
    --olive-soft: rgba(124,128,98,0.14);
    --olive-tint: rgba(124,128,98,0.06);
    --danger: #b6452e;
    --danger-soft: rgba(182,69,46,0.08);
    --success: #5e7a4a;
    --success-soft: rgba(94,122,74,0.10);

    --sans: "DM Sans", -apple-system, system-ui, sans-serif;
    --serif: "Fraunces", "Times New Roman", serif;
    --mono: "JetBrains Mono", ui-monospace, monospace;

    /* Override legacy main.css color vars so non-migrated views still feel
       on-brand once they read these. Only the most-referenced legacy tokens
       need re-pointing here. */
    --color-bg-main: var(--bg);
    --color-bg-card: var(--bg-card);
    --color-bg-light: var(--bg-2);
    --color-text-primary: var(--ink);
    --color-text-secondary: var(--ink-2);
    --color-text-muted: var(--muted);
    --color-primary: var(--olive-deep);
    --color-primary-light: var(--olive);
    --color-success: var(--success);
    --color-danger: var(--danger);
    --color-gray-50: var(--bg-2);
}

/* ─── Reset + base typography ─────────────────────────────── */

html, body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
    margin: 0;
    padding: 0;
}

body { font-size: 15px; }

h1, h2, h3, h4 {
    font-family: var(--serif);
    color: var(--ink);
    letter-spacing: -0.015em;
    margin: 0;
}

a { color: inherit; text-decoration: none; }
::selection { background: var(--olive); color: #fff; }

/* ─── Loading shell ───────────────────────────────────────── */

.loading-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    color: var(--ink-2);
}

.spinner-large {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 3px solid rgba(124,128,98,0.18);
    border-top-color: var(--olive-deep);
    animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Dashboard layout shell ──────────────────────────────── */

.dashboard-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--ink);
    opacity: 0;
    transition: opacity 320ms ease;
}
.dashboard-layout.visible { opacity: 1; }

/* ─── Top header ──────────────────────────────────────────── */

.top-header {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px clamp(16px, 3vw, 32px);
    background: rgba(236,235,228,0.92);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--hairline);
}
.top-header .header-title {
    font-family: var(--serif); font-weight: 600;
    font-size: 20px; letter-spacing: -0.4px;
    margin: 0;
}

/* Editorial hamburger button — minimal three-line, no neumorphic shadow */
.hamburger-btn {
    width: 40px; height: 40px;
    background: transparent;
    border: 1px solid var(--hairline);
    border-radius: 10px;
    display: grid; place-items: center;
    cursor: pointer;
    transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
    padding: 0;
}
.hamburger-btn:hover { background: rgba(0,0,0,0.04); border-color: var(--hairline-strong); }
.hamburger-btn:active { background: rgba(0,0,0,0.07); }
.hamburger-icon {
    width: 18px; height: 12px; position: relative;
    display: flex; flex-direction: column; justify-content: space-between;
}
.hamburger-icon span {
    display: block; width: 100%; height: 1.8px; border-radius: 1px;
    background: var(--ink);
    transition: transform 220ms ease, opacity 200ms ease;
}
.hamburger-btn.active .hamburger-icon span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.hamburger-btn.active .hamburger-icon span:nth-child(2) { opacity: 0; }
.hamburger-btn.active .hamburger-icon span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* ─── Sidebar ─────────────────────────────────────────────── */

.sidebar-overlay {
    position: fixed; inset: 0; z-index: 60;
    background: rgba(20,22,15,0.32);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    opacity: 0; pointer-events: none;
    transition: opacity 220ms ease;
}
.sidebar-overlay.show { opacity: 1; pointer-events: auto; }

.sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 70;
    width: 280px;
    background: var(--bg-2);
    border-right: 1px solid var(--hairline);
    display: flex; flex-direction: column;
    transform: translateX(-100%);
    transition: transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
    overflow-y: auto;
    padding: 22px 18px;
    gap: 18px;
}
.sidebar.open { transform: translateX(0); }

.sidebar-header {
    display: flex; align-items: center; gap: 10px;
    padding: 4px 6px 14px;
    border-bottom: 1px solid var(--hairline);
}
.sidebar-header h1 {
    font-family: var(--serif); font-weight: 600;
    font-size: 22px; letter-spacing: -0.5px;
    margin: 0;
}
.sidebar-header::before {
    content: "BP";
    display: grid; place-items: center;
    width: 28px; height: 28px;
    border-radius: 7px;
    background: linear-gradient(160deg, #16170f 0%, #2a2c1f 100%);
    color: #d8dabd;
    font-family: var(--sans); font-weight: 700; font-size: 12px;
    letter-spacing: 0.4px;
}

.sidebar-nav {
    display: flex; flex-direction: column; gap: 2px;
    flex: 1;
}

.sidebar-nav .nav-link,
.sidebar-footer .nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    font-family: var(--sans); font-size: 14px; font-weight: 500;
    color: var(--ink-2);
    transition: background 160ms ease, color 160ms ease;
    cursor: pointer;
}
.sidebar-nav .nav-link svg,
.sidebar-footer .nav-link svg {
    width: 18px; height: 18px; flex-shrink: 0;
    stroke-width: 1.8;
    opacity: 0.7;
}
.sidebar-nav .nav-link:hover,
.sidebar-footer .nav-link:hover {
    background: var(--olive-tint);
    color: var(--ink);
}
.sidebar-nav .nav-link:hover svg,
.sidebar-footer .nav-link:hover svg { opacity: 1; }
.sidebar-nav .nav-link.active,
.sidebar-footer .nav-link.active {
    background: var(--olive-soft);
    color: var(--olive-deep);
    font-weight: 600;
}
.sidebar-nav .nav-link.active svg,
.sidebar-footer .nav-link.active svg { opacity: 1; }

.sidebar-footer {
    display: flex; flex-direction: column;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--hairline);
}

/* Subscription widget — restyled but JS hooks (#sidebar-tier-label, etc.) preserved */
#sidebar-subscription-widget {
    background: var(--bg-card) !important;
    border: 1px solid var(--hairline);
    padding: 14px !important;
    border-radius: 14px !important;
    font-size: 13.5px !important;
    margin-bottom: 0 !important;
}
#sidebar-tier-label {
    font-family: var(--mono); font-size: 11px;
    letter-spacing: 1.4px; text-transform: uppercase;
    color: var(--olive-deep) !important; font-weight: 600 !important;
}
#sidebar-tier-badge {
    font-family: var(--mono);
    font-size: 9.5px !important;
    letter-spacing: 1.4px; text-transform: uppercase; font-weight: 600;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--olive-soft) !important;
    color: var(--olive-deep) !important;
    border: none;
}
#sidebar-subscription-cta {
    background: var(--ink) !important;
    color: var(--bg) !important;
    padding: 9px 16px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    border-radius: 999px !important;
    border: none;
    cursor: pointer;
    width: 100%;
    transition: background 180ms ease, transform 120ms ease;
}
#sidebar-subscription-cta:hover { background: #2a2c1f !important; }
#sidebar-subscription-cta:active { transform: scale(0.98); }

.user-info {
    display: flex; align-items: center; gap: 12px;
    padding: 12px;
    border-radius: 12px;
    background: var(--olive-tint);
    margin-top: 8px;
}
.user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--olive-deep);
    color: #f0eedf;
    display: grid; place-items: center;
    font-family: var(--sans); font-weight: 700; font-size: 14px;
    letter-spacing: 0.4px;
    flex-shrink: 0;
}
.user-details { flex: 1; min-width: 0; }
.user-email {
    font-size: 12.5px;
    color: var(--ink-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-signout {
    background: transparent;
    color: var(--ink-2);
    border: 1px solid var(--hairline);
    padding: 10px 14px;
    border-radius: 999px;
    font-family: var(--sans); font-size: 13px; font-weight: 600;
    cursor: pointer;
    transition: background 180ms ease, color 180ms ease, border-color 180ms ease;
}
.btn-signout:hover {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: rgba(182,69,46,0.25);
}

/* Desktop: sidebar always visible */
@media (min-width: 900px) {
    .dashboard-layout { padding-left: 280px; }
    .sidebar {
        transform: translateX(0);
        box-shadow: none;
    }
    .sidebar-overlay { display: none; }
    .hamburger-btn { display: none; }
    .top-header { padding-left: 32px; }
    .top-header .header-title { display: none; }
}

/* ─── Main content ────────────────────────────────────────── */

.main-content {
    flex: 1;
    padding: clamp(20px, 3.5vw, 36px) clamp(16px, 3vw, 40px) 80px;
    max-width: 1240px;
    margin: 0 auto;
    width: 100%;
}

/* ─── Editorial primitives ────────────────────────────────── */

.eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 14px 6px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.7);
    border: 1px solid var(--hairline);
    font-family: var(--mono);
    font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase;
    color: var(--ink-2);
    margin-bottom: 18px;
}
.eyebrow .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--olive);
}

.section-eyebrow {
    font-family: var(--mono);
    font-size: 11.5px; letter-spacing: 2px; text-transform: uppercase;
    color: var(--olive); font-weight: 600;
    margin-bottom: 12px;
    display: inline-block;
}

.section-title {
    font-family: var(--serif); font-weight: 500;
    font-size: clamp(28px, 3.6vw, 42px);
    letter-spacing: -0.025em; line-height: 1.05;
    margin: 0 0 14px;
    color: var(--ink);
}
.section-title em {
    font-style: italic; font-weight: 400; color: var(--olive);
    background: linear-gradient(180deg, rgba(124,128,98,0) 60%, rgba(124,128,98,0.18) 60%);
    padding: 0 4px;
}

.section-sub {
    font-size: 16px; line-height: 1.55;
    color: var(--ink-2);
    margin: 0 0 28px;
    max-width: 620px;
}

/* ─── Editorial cards ─────────────────────────────────────── */

.editorial-card {
    background: var(--bg-card);
    border: 1px solid var(--hairline);
    border-radius: 18px;
    padding: 28px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.editorial-card-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; margin-bottom: 16px;
}
.editorial-card-title {
    font-family: var(--serif); font-weight: 500;
    font-size: 20px; letter-spacing: -0.01em;
    color: var(--ink);
}
.editorial-card-sub {
    color: var(--ink-2); font-size: 14px; line-height: 1.55;
    margin: 4px 0 0;
}

/* ─── Buttons (editorial primitives) ──────────────────────── */

.btn-primary,
button.btn-primary,
.btn-primary[type="button"] {
    background: var(--ink);
    color: var(--bg);
    padding: 12px 22px;
    border-radius: 999px;
    border: none;
    font-family: var(--sans); font-size: 14.5px; font-weight: 600;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    transition: background 200ms ease, transform 120ms ease, opacity 200ms ease;
    text-decoration: none;
}
.btn-primary:hover { background: #2a2c1f; }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-secondary,
button.btn-secondary {
    background: var(--bg-2);
    color: var(--ink);
    padding: 12px 22px;
    border-radius: 999px;
    border: 1px solid var(--hairline);
    font-family: var(--sans); font-size: 14.5px; font-weight: 600;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    transition: background 200ms ease, transform 120ms ease, border-color 200ms ease;
    text-decoration: none;
}
.btn-secondary:hover { background: #ffffff; border-color: var(--hairline-strong); }
.btn-secondary:active { transform: scale(0.98); }

.btn-light {
    background: var(--bg-card);
    color: var(--ink);
    padding: 12px 22px;
    border-radius: 999px;
    border: 1px solid var(--hairline);
    font-family: var(--sans); font-size: 14.5px; font-weight: 600;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 8px;
    text-decoration: none;
    transition: background 180ms ease, border-color 180ms ease;
}
.btn-light:hover { background: #ffffff; border-color: var(--hairline-strong); }

.btn-ghost {
    background: transparent;
    color: var(--ink-2);
    padding: 10px 16px;
    border-radius: 999px;
    border: none;
    font-family: var(--sans); font-size: 14px; font-weight: 500;
    cursor: pointer;
    transition: background 180ms ease, color 180ms ease;
}
.btn-ghost:hover { background: rgba(0,0,0,0.05); color: var(--ink); }

.btn-danger {
    background: var(--danger);
    color: #fff;
    padding: 12px 22px;
    border-radius: 999px;
    border: none;
    font-family: var(--sans); font-size: 14.5px; font-weight: 600;
    cursor: pointer;
    transition: background 200ms ease, transform 120ms ease;
}
.btn-danger:hover { background: #9a3b27; }
.btn-danger:active { transform: scale(0.98); }

/* ─── Form fields ─────────────────────────────────────────── */

.field { margin-bottom: 18px; }
.field label {
    display: block;
    font-size: 13px; font-weight: 600; color: var(--ink);
    margin-bottom: 8px;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="url"],
.field input[type="tel"],
.field textarea,
.field select {
    width: 100%;
    padding: 12px 14px;
    font: inherit; font-size: 15px; color: var(--ink);
    background: var(--bg-2);
    border: 1px solid var(--hairline);
    border-radius: 10px;
    transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
    font-family: var(--sans);
}
.field input:focus,
.field textarea:focus,
.field select:focus {
    outline: none;
    background: var(--bg-card);
    border-color: var(--olive);
    box-shadow: 0 0 0 3px rgba(124,128,98,0.15);
}
.field input::placeholder, .field textarea::placeholder { color: #a4a596; }
.field .hint {
    font-size: 12.5px; color: var(--muted); margin-top: 6px;
    line-height: 1.4;
}

/* ─── Tier tags ───────────────────────────────────────────── */

.tier-tag {
    display: inline-flex; align-items: center;
    padding: 4px 11px;
    border-radius: 999px;
    font-family: var(--mono);
    font-size: 10px; font-weight: 600;
    letter-spacing: 1.6px; text-transform: uppercase;
    white-space: nowrap;
}
.tier-tag.tier-free, .tier-free { background: var(--olive-soft); color: var(--olive-deep); }
.tier-tag.tier-advanced, .tier-advanced { background: var(--olive); color: #f4f3eb; }
.tier-tag.tier-pro, .tier-pro { background: var(--ink); color: var(--bg-2); }

/* Also override the legacy .badge classes so they read editorial */
.badge {
    display: inline-flex; align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-family: var(--mono);
    font-size: 10px; font-weight: 600;
    letter-spacing: 1.6px; text-transform: uppercase;
    white-space: nowrap;
}
.badge.badge-gray { background: var(--olive-soft); color: var(--olive-deep); }
.badge.badge-success { background: var(--success-soft); color: var(--success); }
.badge.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge.badge-primary { background: var(--ink); color: var(--bg-2); }

/* ─── Modal ───────────────────────────────────────────────── */

.modal-overlay {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(20,22,15,0.45);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    animation: overlay-in 200ms ease;
}
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }

.modal-overlay .modal {
    background: var(--bg-card);
    border: 1px solid var(--hairline);
    border-radius: 22px;
    padding: 32px 28px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 24px 60px -20px rgba(20,22,15,0.35);
    position: relative;
    animation: modal-in 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes modal-in {
    from { opacity: 0; transform: translateY(8px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    text-align: center;
    margin-bottom: 18px;
}
.modal-icon {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--olive-soft);
    display: grid; place-items: center;
    font-size: 26px;
    margin: 0 auto 14px;
    color: var(--olive-deep);
}
.modal-title {
    font-family: var(--serif); font-weight: 500;
    font-size: 22px; letter-spacing: -0.015em;
    color: var(--ink);
    margin: 0;
}
.modal-description {
    font-size: 14.5px; line-height: 1.55;
    color: var(--ink-2);
    margin: 8px 0 0;
}

.modal-content {
    margin-bottom: 22px;
    color: var(--ink-2);
    font-size: 14.5px; line-height: 1.55;
}

.modal-actions {
    display: flex; gap: 10px; justify-content: flex-end;
    flex-wrap: wrap;
}
.modal-actions .btn-primary,
.modal-actions .btn-secondary {
    padding: 11px 20px;
}

.modal-close-neo {
    position: absolute;
    top: 14px; right: 14px;
    width: 32px; height: 32px;
    border: 1px solid var(--hairline);
    background: var(--bg-2);
    color: var(--ink-2);
    border-radius: 50%;
    display: grid; place-items: center;
    cursor: pointer;
    transition: background 180ms ease, color 180ms ease;
    box-shadow: none !important;
}
.modal-close-neo:hover {
    background: var(--bg-card);
    color: var(--ink);
}

/* ─── Toast ───────────────────────────────────────────────── */

#toast-container {
    position: fixed;
    bottom: 24px; right: 24px;
    z-index: 1000;
    display: flex; flex-direction: column; gap: 8px;
}

.toast {
    background: var(--ink);
    color: var(--bg);
    padding: 12px 18px;
    border-radius: 12px;
    font-family: var(--sans); font-size: 14px; font-weight: 500;
    box-shadow: 0 12px 30px -8px rgba(20,22,15,0.45);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 220ms ease, transform 220ms ease;
    max-width: 360px;
    line-height: 1.45;
}
.toast.show { opacity: 1; transform: translateY(0); }

.toast.success {
    background: var(--success);
    color: #fff;
}
.toast.error {
    background: var(--danger);
    color: #fff;
}
.toast.warning {
    background: #b88a2e;
    color: #fff;
}
.toast.info {
    background: var(--olive-deep);
    color: #f4f3eb;
}

/* ─── Empty state ─────────────────────────────────────────── */

.empty-state {
    display: flex; flex-direction: column;
    align-items: center; text-align: center;
    padding: 56px 28px;
    background: var(--bg-card);
    border: 1px dashed var(--hairline-strong);
    border-radius: 18px;
    color: var(--ink-2);
}
.empty-state-icon {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: var(--olive-soft);
    color: var(--olive-deep);
    display: grid; place-items: center;
    font-size: 28px;
    margin-bottom: 16px;
}
.empty-state-title {
    font-family: var(--serif); font-weight: 500;
    font-size: 22px; letter-spacing: -0.01em;
    color: var(--ink);
    margin: 0 0 8px;
}
.empty-state-description {
    font-size: 14.5px; line-height: 1.55;
    color: var(--ink-2);
    max-width: 380px;
    margin: 0 0 20px;
}

/* ─── Stats widget ────────────────────────────────────────── */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.stats-widget {
    display: flex; align-items: flex-start; gap: 14px;
    background: var(--bg-card);
    border: 1px solid var(--hairline);
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    transition: transform 180ms ease, box-shadow 180ms ease;
}
.stats-widget:hover {
    transform: translateY(-1px);
    box-shadow: 0 1px 2px rgba(0,0,0,0.03), 0 12px 24px -10px rgba(20,22,15,0.10);
}
.stats-icon {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: var(--olive-soft) !important;
    color: var(--olive-deep) !important;
    display: grid; place-items: center;
    flex-shrink: 0;
}
.stats-icon svg { width: 18px; height: 18px; stroke-width: 1.8; }
.stats-content { flex: 1; min-width: 0; }
.stats-label {
    font-family: var(--mono);
    font-size: 10.5px; font-weight: 600;
    letter-spacing: 1.6px; text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 6px;
}
.stats-value {
    font-family: var(--serif); font-weight: 500;
    font-size: 28px; letter-spacing: -0.02em; line-height: 1;
    color: var(--ink);
}
.stats-trend {
    font-family: var(--sans); font-weight: 600;
    font-size: 12.5px;
    color: var(--olive-deep) !important;
}

/* ─── Chart widget ────────────────────────────────────────── */

.chart-widget {
    background: var(--bg-card);
    border: 1px solid var(--hairline);
    border-radius: 18px;
    padding: 22px 24px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    margin-bottom: 18px;
}
.chart-header { margin-bottom: 12px; }
.chart-title {
    font-family: var(--serif); font-weight: 500;
    font-size: 18px; letter-spacing: -0.01em;
    color: var(--ink);
    margin: 0 0 4px;
}
.chart-description {
    font-size: 13.5px; line-height: 1.5;
    color: var(--ink-2);
    margin: 0;
}
.chart-canvas-container {
    width: 100%;
    background: var(--bg-2);
    border-radius: 12px;
    padding: 12px;
}
.chart-loading,
.chart-error,
.chart-empty {
    color: var(--ink-2) !important;
}
.chart-loading p,
.chart-error p,
.chart-empty p {
    color: var(--ink-2) !important;
    font-family: var(--sans) !important;
}

/* ─── Footer (used by some pages) ─────────────────────────── */

.foot {
    border-top: 1px solid var(--hairline);
    padding: 24px clamp(16px, 3vw, 32px);
    display: flex; justify-content: space-between; align-items: center;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 11px; letter-spacing: 1px; text-transform: uppercase;
    flex-wrap: wrap; gap: 12px;
}

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

@media (max-width: 720px) {
    .main-content { padding: 20px 16px 60px; }
    .stats-grid { grid-template-columns: 1fr; }
    .modal-overlay { padding: 16px; }
    .modal-overlay .modal { padding: 26px 22px; }
    .modal-actions { flex-direction: column-reverse; }
    .modal-actions .btn-primary,
    .modal-actions .btn-secondary { width: 100%; }
}

@media (max-width: 560px) {
    .top-header { padding: 12px 16px; }
    .sidebar { width: 86vw; max-width: 320px; }
}

@media (prefers-reduced-motion: reduce) {
    .dashboard-layout, .toast, .modal-overlay .modal { transition: none; animation: none; }
    .spinner-large { animation-duration: 2s; }
}
