/* ================================================================
   SteadyVerify — Base Design System v3 (Stripe-inspired)
   Shared by ALL layouts. Import order: base → layout-specific
   
   ✦ Colors preserved from v2 — only typography, spacing,
     shadows, radii, and animation refinements applied.
   ✦ Stripe design ethos: generous whitespace, typography-first,
     subtle layered depth, refined rounded forms, smooth motion.
   ================================================================ */

/* ── Fonts ────────────────────────────────────────────────────────
   Stripe uses a custom cut of Inter. We approximate it with:
   • Inter (UI body, forms, labels, buttons, tables)
   • Inter Display via optical-sizing for headings
   • Plus Jakarta Sans for accent/hero moments
   Using Google Fonts with refined weight set + display swap.
   ─────────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,300;14..32,400;14..32,500;14..32,600;14..32,700;14..32,800;14..32,900&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* ── Reset ────────────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ── Selection (Stripe-style brand-tinted) ────────────────────── */
::selection {
    background: rgba(21, 96, 189, 0.18);
    color: var(--text);
}

img, svg {
    display: block;
    max-width: 100%;
    image-rendering: auto;
}

picture, video, canvas {
    display: block;
    max-width: 100%;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--dur-fast) var(--ease);
}

/* ================================================================
   DESIGN TOKENS (colors preserved from v2)
   ================================================================ */

/* ── Light Mode ───────────────────────────────────────────────── */
:root {
    /* Branding — UNCHANGED */
    --bwv-brand: #1560BD;
    --bwv-brand-dark: #0E4B9B;
    --bwv-brand-light: #3B7FD5;
    --bwv-brand-50: rgba(21, 96, 189, 0.05);
    --bwv-brand-100: rgba(21, 96, 189, 0.1);
    --bwv-brand-200: rgba(21, 96, 189, 0.2);

    --bwv-accent: #FF6600;
    --bwv-accent-dark: #E65C00;
    --bwv-accent-light: #FF8533;
    --bwv-accent-50: rgba(255, 102, 0, 0.05);

    /* Semantic — UNCHANGED */
    --success: #10B981;
    --success-bg: #ECFDF5;
    --success-border: #A7F3D0;
    --warning: #F59E0B;
    --warning-bg: #FFFBEB;
    --warning-border: #FDE68A;
    --danger: #EF4444;
    --danger-bg: #FEF2F2;
    --danger-border: #FECACA;
    --info: #3B82F6;
    --info-bg: #EFF6FF;
    --info-border: #BFDBFE;

    /* Surface — UNCHANGED */
    --bg: #F8FAFC;
    --bg-2: #F1F5F9;
    --surface: #FFFFFF;
    --surface-2: #F8FAFC;
    --surface-3: #F1F5F9;

    /* Border — UNCHANGED */
    --border: #E2E8F0;
    --border-2: #CBD5E1;

    /* Text — UNCHANGED */
    --text: #0F172A;
    --text-2: #1E293B;
    --text-muted: #64748B;
    --text-light: #94A3B8;
    --text-xlight: #CBD5E1;

    /* ── Radius (Stripe-refined: slightly larger, cohesive scale) ── */
    --r-xs: 4px;
    --r-sm: 8px;
    --r: 12px;
    --r-md: 16px;
    --r-lg: 20px;
    --r-xl: 24px;
    --r-2xl: 32px;
    --r-full: 9999px;

    /* ── Shadow (Stripe layered depth) ──────────────────────────── */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.04);
    --shadow-md: 0 2px 6px rgba(0,0,0,0.05), 0 8px 24px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.05), 0 16px 40px rgba(0,0,0,0.07);
    --shadow-xl: 0 8px 24px rgba(0,0,0,0.06), 0 32px 64px rgba(0,0,0,0.08);

    /* Brand-tinted shadow for primary buttons/cards */
    --shadow-brand: 0 1px 3px rgba(21,96,189,0.12), 0 4px 16px rgba(21,96,189,0.1);

    /* ── Animation (Stripe: smooth cubic-bezier curves) ─────────── */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --ease-in: cubic-bezier(0.4, 0, 1, 1);
    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --dur-fast: 150ms;
    --dur: 200ms;
    --dur-slow: 300ms;
    --dur-glacial: 500ms;

    /* Sidebar widths */
    --sidebar-w: 272px;
    --admin-sidebar-w: 256px;

    /* Stripe-style spacing scale */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;
}

/* ── Dark Mode Tokens ──────────────────────────────────────────── */
[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0F172A;
    --bg-2: #1E293B;
    --surface: #1E293B;
    --surface-2: #293548;
    --surface-3: #334155;
    --border: #334155;
    --border-2: #475569;
    --text: #F1F5F9;
    --text-2: #E2E8F0;
    --text-muted: #94A3B8;
    --text-light: #64748B;
    --text-xlight: #475569;
    --bwv-brand-50: rgba(21, 96, 189, 0.15);
    --bwv-brand-100: rgba(21, 96, 189, 0.25);
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.35);
    --shadow: 0 1px 3px rgba(0,0,0,0.2), 0 4px 12px rgba(0,0,0,0.15);
    --shadow-md: 0 2px 6px rgba(0,0,0,0.2), 0 12px 28px rgba(0,0,0,0.2);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.2), 0 20px 48px rgba(0,0,0,0.25);
    --shadow-brand: 0 1px 3px rgba(59,127,213,0.15), 0 4px 16px rgba(59,127,213,0.12);
}

[data-theme="dark"] .form-control,
[data-theme="dark"] select,
[data-theme="dark"] input,
[data-theme="dark"] textarea {
    color: var(--text);
    background: var(--surface);
    border-color: var(--border);
}

[data-theme="dark"] select option {
    background: var(--surface-2);
    color: var(--text);
}

/* ================================================================
   TYPOGRAPHY — Stripe's hierarchy: large light headings,
   tight letter-spacing, generous line-height.
   ================================================================ */

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.15;
    color: var(--text);
    letter-spacing: -0.025em;
    text-wrap: balance;
}

h1 { font-size: 2.25rem; font-weight: 800; letter-spacing: -0.04em; }
h2 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.03em; }
h3 { font-size: 1.35rem; font-weight: 650; letter-spacing: -0.025em; }
h4 { font-size: 1.1rem; font-weight: 600; letter-spacing: -0.02em; }
h5 { font-size: 1rem; font-weight: 600; letter-spacing: -0.015em; }
h6 { font-size: 0.875rem; font-weight: 600; letter-spacing: -0.01em; }

p {
    color: var(--text-2);
    line-height: 1.7;
}

small, .text-small {
    font-size: 0.8125rem;
    line-height: 1.5;
}

/* Display-style heading (Stripe hero treatment) */
.display-heading {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 1.05;
    text-wrap: balance;
}

.display-subheading {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    font-weight: 400;
    letter-spacing: -0.01em;
    color: var(--text-muted);
    line-height: 1.6;
    text-wrap: balance;
}

/* Section labels (Stripe's small uppercase labels) */
.section-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

/* ================================================================
   CARDS — Stripe: subtle layered shadow, generous padding,
   pillowy border-radius, barely-there border.
   ================================================================ */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--space-6);
    transition: box-shadow var(--dur-slow) var(--ease),
                border-color var(--dur-slow) var(--ease),
                transform var(--dur-slow) var(--ease);
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-2);
    transform: translateY(-1px);
}

.card-flush {
    padding: 0;
}

.card-sm {
    padding: var(--space-4);
    border-radius: var(--r-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: 0 0 var(--space-4) 0;
    margin-bottom: var(--space-4);
    border-bottom: 1px solid var(--border);
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    letter-spacing: -0.015em;
}

.card-body {
    /* natural flow — inherits card padding */
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-3);
    margin-top: var(--space-5);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border);
}

/* Card with accent top border (Stripe detail) */
.card-accent-top {
    border-top: 3px solid var(--bwv-brand);
}

/* ================================================================
   TABLES — Stripe: clean rows, subtle hover, uppercase headers.
   ================================================================ */

.table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

.table th {
    padding: 10px 16px;
    text-align: left;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table th:first-child { border-radius: var(--r-sm) 0 0 0; }
.table th:last-child  { border-radius: 0 var(--r-sm) 0 0; }

.table td {
    padding: 14px 16px;
    font-size: 0.875rem;
    color: var(--text-2);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    line-height: 1.4;
}

.table tr:last-child td { border-bottom: none; }

.table tbody tr { transition: background var(--dur-fast) var(--ease); }

.table tbody tr:hover td { background: var(--surface-2); }

/* Compact table variant */
.table-compact th { padding: 8px 12px; }
.table-compact td { padding: 10px 12px; font-size: 0.8125rem; }

/* ================================================================
   BADGES — Pill-shaped, subtle, Stripe-style.
   ================================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--r-full);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    white-space: nowrap;
    line-height: 1.4;
}

.badge-success  { background: var(--success-bg);  color: #065F46; border: 1px solid var(--success-border); }
.badge-warning  { background: var(--warning-bg);  color: #92400E; border: 1px solid var(--warning-border); }
.badge-danger   { background: var(--danger-bg);   color: #991B1B; border: 1px solid var(--danger-border); }
.badge-info     { background: var(--info-bg);     color: var(--bwv-brand); border: 1px solid var(--info-border); }
.badge-secondary{ background: var(--surface-3);   color: var(--text-muted); border: 1px solid var(--border); }
.badge-brand    { background: var(--bwv-brand-50);color: var(--bwv-brand); border: 1px solid var(--bwv-brand-100); }

/* ================================================================
   BUTTONS — Stripe pill shape, subtle depth, refined hover.
   ================================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 20px;
    border-radius: var(--r-full);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all var(--dur) var(--ease);
    white-space: nowrap;
    line-height: 1;
    text-decoration: none !important;
    user-select: none;
    position: relative;
    letter-spacing: -0.01em;
}

.btn:focus-visible {
    outline: 2px solid var(--bwv-brand);
    outline-offset: 3px;
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
    filter: grayscale(0.3);
}

/* Primary */
.btn-brand {
    background: var(--bwv-brand);
    color: #fff;
    box-shadow: var(--shadow-brand);
}

.btn-brand:hover {
    background: var(--bwv-brand-dark);
    box-shadow: 0 2px 6px rgba(21,96,189,0.25), 0 8px 20px rgba(21,96,189,0.15);
    transform: translateY(-1px);
    color: #fff;
}

.btn-brand:active {
    transform: translateY(0);
    box-shadow: var(--shadow-xs);
}

/* Danger */
.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #DC2626;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239,68,68,0.3);
}

.btn-danger:active { background: #B91C1C; transform: translateY(0); }

/* Accent */
.btn-accent {
    background: var(--bwv-accent);
    color: #fff;
    box-shadow: 0 1px 3px rgba(255,102,0,0.25);
}

.btn-accent:hover {
    background: var(--bwv-accent-dark);
    box-shadow: 0 4px 14px rgba(255,102,0,0.35);
    transform: translateY(-1px);
    color: #fff;
}

.btn-accent:active { transform: translateY(0); }

/* Success */
.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover {
    background: #059669;
    color: #fff;
    transform: translateY(-1px);
}

.btn-success:active { background: #047857; transform: translateY(0); }

/* Outline */
.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border-2);
    color: var(--text-2);
}

.btn-outline:hover {
    border-color: var(--bwv-brand);
    color: var(--bwv-brand);
    background: var(--bwv-brand-50);
    transform: translateY(-1px);
}

.btn-outline:active {
    background: var(--bwv-brand-100);
    transform: translateY(0);
}

/* Ghost */
.btn-ghost {
    background: transparent;
    border: none;
    color: var(--text-muted);
}

.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-ghost:active { background: var(--surface-3); }

/* ── Button Sizes ──────────────────────────────────────────────── */
.btn-xs  { padding: 4px 10px; font-size: 0.6875rem; border-radius: var(--r-full); }
.btn-sm  { padding: 7px 14px; font-size: 0.75rem;  border-radius: var(--r-full); }
.btn-lg  { padding: 13px 28px; font-size: 1rem;    border-radius: var(--r-full); }
.btn-xl  { padding: 16px 36px; font-size: 1.1rem;  border-radius: var(--r-full); letter-spacing: -0.02em; }

.btn-icon {
    padding: 9px;
    width: 38px;
    height: 38px;
}

.btn-icon.btn-sm { width: 32px; height: 32px; padding: 6px; }
.btn-icon.btn-xs { width: 26px; height: 26px; padding: 4px; }

/* ── Button group ──────────────────────────────────────────────── */
.btn-group {
    display: inline-flex;
    gap: 1px;
    border-radius: var(--r-full);
    overflow: hidden;
    border: 1px solid var(--border);
}

.btn-group .btn {
    border-radius: 0;
    border: none;
}

.btn-group .btn:first-child { border-radius: var(--r-full) 0 0 var(--r-full); }
.btn-group .btn:last-child  { border-radius: 0 var(--r-full) var(--r-full) 0; }

/* ================================================================
   FORMS — Stripe: airy, clean inputs with signature blue focus ring.
   ================================================================ */

.form-group {
    margin-bottom: var(--space-5);
}

.form-group:last-child { margin-bottom: 0; }

.form-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

.form-control {
    width: 100%;
    padding: 11px 15px;
    border: 1.5px solid var(--border);
    border-radius: var(--r);
    font-size: 0.875rem;
    color: var(--text);
    background: var(--surface);
    outline: none;
    transition: all var(--dur) var(--ease);
    line-height: 1.5;
    caret-color: var(--bwv-brand);
}

.form-control::placeholder {
    color: var(--text-light);
    opacity: 0.65;
}

.form-control:hover { border-color: var(--border-2); }

.form-control:focus {
    border-color: var(--bwv-brand);
    box-shadow: 0 0 0 3px rgba(21,96,189,0.12), 0 1px 2px rgba(0,0,0,0.04);
    background: var(--surface);
}

.form-control.is-invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
}

select.form-control {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748B' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* ── Input Group ───────────────────────────────────────────────── */
.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .input-addon {
    display: flex;
    align-items: center;
    padding: 0 15px;
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
}

.input-group .input-addon:first-child {
    border-right: none;
    border-radius: var(--r) 0 0 var(--r);
}

.input-group .input-addon:last-child {
    border-left: none;
    border-radius: 0 var(--r) var(--r) 0;
}

.input-group .form-control:not(:first-child) { border-radius: 0 var(--r) var(--r) 0; }
.input-group .form-control:not(:last-child)  { border-radius: var(--r) 0 0 var(--r); }

.form-hint {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 5px;
    line-height: 1.5;
}

.invalid-feedback {
    font-size: 0.75rem;
    color: var(--danger);
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ── Checkbox / Radio (Stripe-style clean toggles) ─────────────── */
.checkbox-label, .radio-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--text-2);
    cursor: pointer;
    user-select: none;
}

/* ================================================================
   ALERTS — Stripe: clear, concise, with left border accent.
   ================================================================ */

.alert {
    padding: 14px 18px;
    border-radius: var(--r-md);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: var(--space-5);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid transparent;
    border-left: 4px solid transparent;
    line-height: 1.5;
}

.alert-success { background: var(--success-bg);  color: #065F46; border-color: var(--success-border); border-left-color: var(--success); }
.alert-danger  { background: var(--danger-bg);   color: #991B1B; border-color: var(--danger-border);  border-left-color: var(--danger); }
.alert-warning { background: var(--warning-bg);  color: #7C2D12; border-color: var(--warning-border); border-left-color: var(--warning); }
.alert-info    { background: var(--info-bg);     color: #1E3A8A; border-color: var(--info-border);    border-left-color: var(--info); }

/* ================================================================
   STAT CARDS — Stripe metric cards: clean, bold numbers.
   ================================================================ */

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--space-6);
    transition: all var(--dur-slow) var(--ease);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--border-2);
}

.stat-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--r);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.stat-card-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.stat-card-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.04em;
    line-height: 1;
}

.stat-card-delta {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-light);
    margin-top: 8px;
}

.stat-card-delta.up   { color: var(--success); }
.stat-card-delta.down { color: var(--danger); }

/* ================================================================
   PAGINATION — Stripe: clean dots/pills.
   ================================================================ */

.pagination {
    display: flex;
    gap: 4px;
    list-style: none;
    align-items: center;
}

.pagination .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--surface);
    transition: all var(--dur-fast) var(--ease);
    text-decoration: none;
}

.pagination .page-item.active .page-link {
    background: var(--bwv-brand);
    border-color: var(--bwv-brand);
    color: #fff;
    font-weight: 600;
}

.pagination .page-item.disabled .page-link {
    opacity: 0.35;
    cursor: default;
}

.pagination .page-link:hover:not(.disabled) {
    border-color: var(--bwv-brand);
    color: var(--bwv-brand);
    background: var(--bwv-brand-50);
}

/* ================================================================
   GRID HELPERS — Stripe's generous gap scale.
   ================================================================ */

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-6); }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-5); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-5); }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-5);
    margin-bottom: var(--space-6);
}

/* ================================================================
   SCROLLBAR — Stripe minimal.
   ================================================================ */

html {
    scrollbar-width: thin;
    scrollbar-color: var(--border-2) transparent;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-light); }
::-webkit-scrollbar-corner { background: transparent; }

/* ================================================================
   TRANSITIONS — Smooth dark mode toggle.
   ================================================================ */

body, .card, .sidebar, .topbar,
input, select, textarea, .btn, .stat-card {
    transition: background var(--dur-slow) var(--ease),
                border-color var(--dur-slow) var(--ease),
                color var(--dur-slow) var(--ease);
}

/* ================================================================
   REDUCED MOTION
   ================================================================ */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ================================================================
   ANIMATIONS
   ================================================================ */

@keyframes bwv-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes bwv-fade-in-up {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes bwv-scale-in {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes bwv-slide-in-right {
    from { opacity: 0; transform: translateX(16px); }
    to   { opacity: 1; transform: translateX(0); }
}

.animate-fade-in       { animation: bwv-fade-in 0.5s var(--ease-out) both; }
.animate-fade-in-up    { animation: bwv-fade-in-up 0.5s var(--ease-out) both; }
.animate-scale-in      { animation: bwv-scale-in 0.3s var(--ease-out) both; }
.animate-slide-in-right{ animation: bwv-slide-in-right 0.35s var(--ease-out) both; }

/* Stagger children (add to parent) */
.stagger-children > * {
    opacity: 0;
    animation: bwv-fade-in-up 0.5s var(--ease-out) forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0ms; }
.stagger-children > *:nth-child(2) { animation-delay: 60ms; }
.stagger-children > *:nth-child(3) { animation-delay: 120ms; }
.stagger-children > *:nth-child(4) { animation-delay: 180ms; }
.stagger-children > *:nth-child(5) { animation-delay: 240ms; }
.stagger-children > *:nth-child(6) { animation-delay: 300ms; }
.stagger-children > *:nth-child(7) { animation-delay: 360ms; }
.stagger-children > *:nth-child(8) { animation-delay: 420ms; }

/* ================================================================
   SKELETON LOADING (Stripe-style shimmer)
   ================================================================ */

.skeleton {
    background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%);
    background-size: 200% 100%;
    animation: bwv-shimmer 1.5s ease-in-out infinite;
    border-radius: var(--r-sm);
}

@keyframes bwv-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ================================================================
   DIVIDER
   ================================================================ */

.divider {
    width: 100%;
    height: 1px;
    background: var(--border);
    margin: var(--space-6) 0;
}

.divider-light {
    background: var(--surface-3);
}

/* ================================================================
   UTILITY CLASSES
   ================================================================ */

.text-brand   { color: var(--bwv-brand); }
.text-muted   { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }

.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }

.mono {
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.9em;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Visually Hidden (screen-reader only) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* ── Spacing Utilities (Stripe scale) ─────────────────────────── */
.mt-1  { margin-top: var(--space-1); }  .mb-1  { margin-bottom: var(--space-1); }
.mt-2  { margin-top: var(--space-2); }  .mb-2  { margin-bottom: var(--space-2); }
.mt-3  { margin-top: var(--space-3); }  .mb-3  { margin-bottom: var(--space-3); }
.mt-4  { margin-top: var(--space-4); }  .mb-4  { margin-bottom: var(--space-4); }
.mt-5  { margin-top: var(--space-5); }  .mb-5  { margin-bottom: var(--space-5); }
.mt-6  { margin-top: var(--space-6); }  .mb-6  { margin-bottom: var(--space-6); }
.mt-8  { margin-top: var(--space-8); }  .mb-8  { margin-bottom: var(--space-8); }
.mt-10 { margin-top: var(--space-10); } .mb-10 { margin-bottom: var(--space-10); }

.pt-4  { padding-top: var(--space-4); } .pb-4  { padding-bottom: var(--space-4); }
.pt-6  { padding-top: var(--space-6); } .pb-6  { padding-bottom: var(--space-6); }
.pt-8  { padding-top: var(--space-8); } .pb-8  { padding-bottom: var(--space-8); }

/* ================================================================
   RESPONSIVE
   ================================================================ */

@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr !important;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.4rem; }
    h3 { font-size: 1.15rem; }
}

@media (max-width: 500px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .card {
        padding: var(--space-4);
        border-radius: var(--r-md);
    }
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
}
