/* ═══════════════════════════════════════════════════════════
   EvidenceFix Design System v44.3
   Extended tokens, components, accessibility, dark mode
   ═══════════════════════════════════════════════════════════ */

/* ───────────────────────────────────────────────────────────
   1. EXTENDED DESIGN TOKENS
   ─────────────────────────────────────────────────────────── */
:root {
    /* ── Neutral scale (11 steps) ── */
    --neutral-50:  #f8fafc;
    --neutral-100: #f1f5f9;
    --neutral-200: #e2e8f0;
    --neutral-300: #cbd5e1;
    --neutral-400: #94a3b8;
    --neutral-500: #64748b;
    --neutral-600: #475569;
    --neutral-700: #334155;
    --neutral-800: #1e293b;
    --neutral-900: #0f172a;

    /* ── Primary scale ── */
    --primary-50:  #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --primary-hover: #153356;
    --primary-pressed: #0f2340;

    /* ── Semantic light variants ── */
    --success-50: #f0fdf4;
    --success-100: #dcfce7;
    --warning-50: #fffbeb;
    --warning-100: #fef3c7;
    --danger-50:  #fff1f2;
    --danger-100: #ffe4e6;
    --info-50:    #eff6ff;
    --info-100:   #dbeafe;

    /* ── Surface layers ── */
    --surface-0: #ffffff;
    --surface-1: #f8fafc;
    --surface-2: #f1f5f9;
    --surface-3: #e2e8f0;

    /* ── Typography extensions ── */
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', ui-monospace, monospace;
    --leading-none:    1;
    --leading-tight:   1.25;
    --leading-snug:    1.375;
    --leading-normal:  1.5;
    --leading-relaxed: 1.625;
    --leading-loose:   2;
    --tracking-tight:  -0.025em;
    --tracking-normal: 0em;
    --tracking-wide:   0.025em;
    --tracking-wider:  0.05em;
    --tracking-widest: 0.1em;

    /* ── Extended spacing ── */
    --space-2xs: 0.125rem;
    --space-4xl: 6rem;
    --space-5xl: 8rem;

    /* ── Extended radius ── */
    --radius-xs:   0.125rem;
    --radius-2xl:  1.5rem;
    --radius-full: 9999px;

    /* ── Z-index ladder ── */
    --z-below:   -1;
    --z-base:     0;
    --z-raised:   1;
    --z-dropdown: 100;
    --z-sticky:   200;
    --z-overlay:  300;
    --z-modal:    400;
    --z-toast:    500;
    --z-tooltip:  600;

    /* ── Focus ring ── */
    --focus-ring: 0 0 0 3px rgba(49, 130, 206, 0.35);
    --focus-ring-danger: 0 0 0 3px rgba(229, 62, 62, 0.25);
    --focus-ring-success: 0 0 0 3px rgba(56, 161, 105, 0.25);

    /* ── Motion ── */
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-out:    cubic-bezier(0.0, 0.0, 0.2, 1);
    --ease-in-out: cubic-bezier(0.4, 0.0, 0.2, 1);
    --duration-instant: 80ms;
    --duration-fast:    150ms;
    --duration-normal:  250ms;
    --duration-slow:    400ms;
}

/* ───────────────────────────────────────────────────────────
   2. DARK MODE — PROPER CSS VARIABLE SYSTEM
   ─────────────────────────────────────────────────────────── */
[data-theme="dark"] {
    --color-bg:           #0d1117;
    --color-bg-light:     #161b22;
    --color-bg-dark:      #21262d;
    --color-bg-secondary: #21262d;
    --color-text:         #e6edf3;
    --color-text-light:   #8d96a0;
    --color-text-muted:   #6e7681;
    --color-border:       #30363d;
    --color-border-dark:  #3d444d;

    --surface-0: #0d1117;
    --surface-1: #161b22;
    --surface-2: #21262d;
    --surface-3: #30363d;

    --neutral-50:  #161b22;
    --neutral-100: #21262d;
    --neutral-200: #30363d;
    --shadow-sm:  0 1px 2px rgba(0,0,0,0.3);
    --shadow-md:  0 4px 6px rgba(0,0,0,0.4);
    --shadow-lg:  0 10px 15px rgba(0,0,0,0.4);
    --shadow-xl:  0 20px 25px rgba(0,0,0,0.5);
}

/* ───────────────────────────────────────────────────────────
   3. GLOBAL ACCESSIBILITY — FOCUS STATES
   ─────────────────────────────────────────────────────────── */
*:focus { outline: none; }

*:focus-visible {
    outline: 2px solid var(--color-secondary);
    outline-offset: 2px;
}

.btn:focus-visible {
    outline: 2px solid var(--color-secondary);
    outline-offset: 3px;
    box-shadow: var(--focus-ring);
}

.nav-link:focus-visible,
.dashboard-nav a:focus-visible {
    outline: 2px solid var(--color-secondary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

.form-input:focus-visible {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: var(--focus-ring);
}

/* Skip link visible on focus */
.skip-link:focus {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: var(--z-toast);
    background: var(--color-primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
}

/* ───────────────────────────────────────────────────────────
   4. BUTTON SYSTEM — COMPLETE STATES
   ─────────────────────────────────────────────────────────── */
.btn {
    position: relative;
    overflow: hidden;
    letter-spacing: var(--tracking-wide);
    transition:
        background var(--duration-fast) var(--ease-out),
        border-color var(--duration-fast) var(--ease-out),
        box-shadow var(--duration-fast) var(--ease-out),
        transform var(--duration-instant) var(--ease-out),
        color var(--duration-fast) var(--ease-out);
}

.btn:active:not(:disabled) {
    transform: scale(0.97);
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

/* Primary — pressed state */
.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    color: white;
}
.btn-primary:active:not(:disabled) {
    background: var(--primary-pressed);
}

/* Outline — smooth fill on hover */
.btn-outline {
    transition:
        background var(--duration-fast) var(--ease-out),
        color var(--duration-fast) var(--ease-out),
        border-color var(--duration-fast) var(--ease-out),
        transform var(--duration-instant) var(--ease-out);
}

/* Ghost button */
.btn-ghost {
    background: transparent;
    border: none;
    color: var(--color-text-light);
}
.btn-ghost:hover:not(:disabled) {
    background: var(--surface-2);
    color: var(--color-text);
}

/* Loading state */
.btn--loading {
    pointer-events: none;
    color: transparent !important;
}
.btn--loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: white;
    border-radius: var(--radius-full);
    animation: btn-spin 0.65s linear infinite;
}
.btn-outline.btn--loading::after,
.btn-secondary.btn--loading::after {
    border-color: rgba(0,0,0,0.15);
    border-top-color: var(--color-text);
}

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

/* Button icon left/right */
.btn-icon-left svg  { margin-right: var(--space-xs); }
.btn-icon-right svg { margin-left: var(--space-xs); }

/* ───────────────────────────────────────────────────────────
   5. CARD SYSTEM — UNIFIED VARIANTS
   ─────────────────────────────────────────────────────────── */
.card { background: var(--color-bg); }

.card--elevated {
    border: none;
    box-shadow: var(--shadow-md);
}

.card--interactive {
    cursor: pointer;
    transition:
        transform var(--duration-normal) var(--ease-out),
        box-shadow var(--duration-normal) var(--ease-out);
}
.card--interactive:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}
.card--interactive:active {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.card--flat {
    background: var(--surface-1);
    border: none;
    box-shadow: none;
}

.card--success {
    background: var(--success-50);
    border-color: #a7f3d0;
}
.card--warning {
    background: var(--warning-50);
    border-color: #fde68a;
}
.card--danger {
    background: var(--danger-50);
    border-color: #fecdd3;
}
.card--info {
    background: var(--info-50);
    border-color: #bfdbfe;
}

/* ── Source cards (homepage) ── */
.source-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    transition:
        transform var(--duration-normal) var(--ease-out),
        box-shadow var(--duration-normal) var(--ease-out),
        border-color var(--duration-fast) var(--ease-out);
}
.source-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-secondary);
}
.source-card-icon {
    font-size: 2rem;
    line-height: 1;
}
.source-card-title {
    font-weight: 600;
    font-size: var(--font-size-base);
    color: var(--color-text);
}
.source-card-desc {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    line-height: var(--leading-relaxed);
}

/* ── Feature cards (homepage grid) ── */
.feature-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: box-shadow var(--duration-normal) var(--ease-out);
}
.feature-card:hover {
    box-shadow: var(--shadow-md);
}
.feature-icon-box {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: var(--space-md);
    flex-shrink: 0;
}
.feature-icon-box--blue   { background: var(--info-100); }
.feature-icon-box--green  { background: var(--success-100); }
.feature-icon-box--indigo { background: #e0e7ff; }
.feature-icon-box--cyan   { background: #cffafe; }
.feature-icon-box--orange { background: var(--warning-100); }
.feature-icon-box--purple { background: #f3e8ff; }

/* ───────────────────────────────────────────────────────────
   6. MODAL / DIALOG COMPONENT
   ─────────────────────────────────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: var(--z-modal);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: modal-bg-in var(--duration-normal) var(--ease-out);
    padding: var(--space-md);
}
.modal-overlay.is-open { display: flex; }

.modal-dialog {
    background: var(--color-bg);
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    padding: var(--space-xl);
    max-width: 520px;
    width: 100%;
    position: relative;
    animation: modal-slide-in var(--duration-normal) var(--ease-spring);
    max-height: 90vh;
    overflow-y: auto;
}
.modal-dialog--wide { max-width: 720px; }
.modal-dialog--sm   { max-width: 380px; }

.modal-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-1);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1.125rem;
    color: var(--color-text-muted);
    transition: background var(--duration-fast), color var(--duration-fast);
    line-height: 1;
}
.modal-close:hover {
    background: var(--surface-2);
    color: var(--color-text);
}

.modal-header {
    margin-bottom: var(--space-lg);
    padding-right: var(--space-2xl);
}
.modal-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
    line-height: var(--leading-tight);
}
.modal-subtitle {
    margin-top: var(--space-xs);
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}
.modal-body { margin-bottom: var(--space-lg); }
.modal-footer {
    display: flex;
    gap: var(--space-sm);
    justify-content: flex-end;
    padding-top: var(--space-lg);
    border-top: 1px solid var(--color-border);
}

@keyframes modal-bg-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes modal-slide-in {
    from { opacity: 0; transform: translateY(24px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ───────────────────────────────────────────────────────────
   7. TOAST NOTIFICATION SYSTEM
   ─────────────────────────────────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    max-width: 380px;
    width: calc(100% - 2 * var(--space-xl));
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--neutral-800);
    color: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    font-size: var(--font-size-sm);
    font-weight: 500;
    pointer-events: all;
    opacity: 0;
    transform: translateY(12px) scale(0.95);
    transition:
        opacity var(--duration-normal) var(--ease-out),
        transform var(--duration-normal) var(--ease-spring);
    cursor: pointer;
}
.toast.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.toast.is-hiding {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
    pointer-events: none;
}

.toast__icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}
.toast__content { flex: 1; line-height: var(--leading-snug); }
.toast__title { font-weight: 600; }
.toast__msg { opacity: 0.8; margin-top: 2px; }

.toast--success { background: #052e16; border-left: 3px solid var(--color-success); }
.toast--success .toast__icon { color: var(--color-success); }
.toast--error   { background: #450a0a; border-left: 3px solid var(--color-danger); }
.toast--error   .toast__icon { color: var(--color-danger); }
.toast--warning { background: #422006; border-left: 3px solid var(--color-warning); }
.toast--warning .toast__icon { color: var(--color-warning); }
.toast--info    { background: #03224c; border-left: 3px solid var(--color-secondary); }
.toast--info    .toast__icon { color: var(--color-secondary); }

@media (max-width: 480px) {
    .toast-container {
        bottom: var(--space-md);
        right: var(--space-md);
        width: calc(100% - 2 * var(--space-md));
    }
}

/* ───────────────────────────────────────────────────────────
   8. SKELETON LOADING STATES
   ─────────────────────────────────────────────────────────── */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--surface-2) 25%,
        var(--surface-1) 50%,
        var(--surface-2) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.6s ease-in-out infinite;
    border-radius: var(--radius-md);
    display: block;
}

.skeleton--text {
    height: 1em;
    margin-bottom: 0.5em;
    border-radius: var(--radius-sm);
}
.skeleton--text-sm {
    height: 0.75em;
    margin-bottom: 0.4em;
    border-radius: var(--radius-sm);
}
.skeleton--title {
    height: 1.5em;
    margin-bottom: 0.75em;
    border-radius: var(--radius-sm);
}
.skeleton--image {
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-lg);
    width: 100%;
}
.skeleton--circle {
    border-radius: var(--radius-full);
}
.skeleton--button {
    height: 40px;
    border-radius: var(--radius-md);
}

@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

[data-theme="dark"] .skeleton {
    background: linear-gradient(
        90deg,
        #21262d 25%,
        #30363d 50%,
        #21262d 75%
    );
    background-size: 200% 100%;
}

/* ───────────────────────────────────────────────────────────
   9. TOOLTIP COMPONENT
   ─────────────────────────────────────────────────────────── */
[data-tooltip] {
    position: relative;
    cursor: help;
}
[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--neutral-800);
    color: white;
    font-size: var(--font-size-xs);
    font-weight: 500;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    max-width: 240px;
    white-space: normal;
    text-align: center;
    line-height: var(--leading-snug);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--duration-fast), transform var(--duration-fast);
    transform: translateX(-50%) translateY(4px);
    z-index: var(--z-tooltip);
}
[data-tooltip]::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--neutral-800);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--duration-fast);
    z-index: var(--z-tooltip);
}
[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ───────────────────────────────────────────────────────────
   10. FORM ENHANCEMENTS
   ─────────────────────────────────────────────────────────── */

/* Input validation states */
.form-input.is-error {
    border-color: var(--color-danger);
    background: var(--danger-50);
}
.form-input.is-error:focus {
    box-shadow: var(--focus-ring-danger);
    border-color: var(--color-danger);
}
.form-input.is-success {
    border-color: var(--color-success);
    background: var(--success-50);
}
.form-input.is-success:focus {
    box-shadow: var(--focus-ring-success);
    border-color: var(--color-success);
}

/* Input wrapper for icon states */
.form-input-wrap {
    position: relative;
}
.form-input-wrap .form-input {
    padding-right: 2.5rem;
}
.form-input-status {
    position: absolute;
    right: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    pointer-events: none;
    transition: opacity var(--duration-fast);
}
.form-input-status--error   { color: var(--color-danger); }
.form-input-status--success { color: var(--color-success); }

/* Password toggle */
.form-input-wrap .password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 0.25rem;
    line-height: 1;
    transition: color var(--duration-fast);
}
.form-input-wrap .password-toggle:hover { color: var(--color-text); }

/* Required label */
.form-label.required::after {
    content: ' *';
    color: var(--color-danger);
    font-weight: 700;
}

/* Custom checkbox */
.checkbox-wrap {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    cursor: pointer;
    user-select: none;
}
.checkbox-wrap input[type="checkbox"] {
    display: none;
}
.checkbox-box {
    width: 18px;
    height: 18px;
    min-width: 18px;
    border: 2px solid var(--color-border-dark);
    border-radius: var(--radius-xs);
    background: var(--color-bg);
    transition:
        border-color var(--duration-fast),
        background var(--duration-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}
.checkbox-wrap input:checked + .checkbox-box {
    background: var(--color-primary);
    border-color: var(--color-primary);
}
.checkbox-wrap input:checked + .checkbox-box::after {
    content: '';
    width: 9px;
    height: 5px;
    border-left: 2px solid white;
    border-bottom: 2px solid white;
    transform: rotate(-45deg) translateY(-1px);
    display: block;
}
.checkbox-wrap input:focus-visible + .checkbox-box {
    outline: 2px solid var(--color-secondary);
    outline-offset: 2px;
}
.checkbox-label {
    font-size: var(--font-size-sm);
    color: var(--color-text-light);
    line-height: var(--leading-relaxed);
}

/* Form section divider */
.form-divider {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin: var(--space-lg) 0;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}
.form-divider::before,
.form-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

/* ───────────────────────────────────────────────────────────
   11. AUTH PAGES — SPLIT-SCREEN REDESIGN
   ─────────────────────────────────────────────────────────── */
.auth-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--color-bg);
}

/* Left panel — branded */
.auth-brand-panel {
    background: linear-gradient(150deg,
        var(--color-primary-dark) 0%,
        var(--color-primary) 50%,
        #2563eb 100%);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: var(--space-2xl);
    position: relative;
    overflow: hidden;
}

/* Decorative circles */
.auth-brand-panel::before {
    content: '';
    position: absolute;
    top: -80px;
    right: -80px;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    pointer-events: none;
}
.auth-brand-panel::after {
    content: '';
    position: absolute;
    bottom: -120px;
    left: -60px;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
    pointer-events: none;
}

.auth-brand-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 700;
    font-size: var(--font-size-xl);
    color: white;
    text-decoration: none;
    position: relative;
    z-index: 1;
}
.auth-brand-logo-icon { font-size: 1.6rem; line-height: 1; }

.auth-brand-center {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--space-2xl) 0;
}
.auth-brand-headline {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 700;
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
    margin-bottom: var(--space-lg);
}
.auth-brand-sub {
    font-size: var(--font-size-base);
    color: rgba(255,255,255,0.75);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-2xl);
}

.auth-brand-bullets {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: var(--space-2xl);
}
.auth-brand-bullet {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
}
.auth-brand-bullet-icon {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    margin-top: 1px;
}
.auth-brand-bullet-text strong {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 600;
    margin-bottom: 2px;
}
.auth-brand-bullet-text span {
    font-size: var(--font-size-xs);
    color: rgba(255,255,255,0.65);
    line-height: var(--leading-snug);
}

.auth-brand-quote {
    position: relative;
    z-index: 1;
    padding: var(--space-lg);
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-lg);
    border-left: 3px solid rgba(255,255,255,0.4);
    backdrop-filter: blur(8px);
}
.auth-brand-quote-text {
    font-size: var(--font-size-sm);
    color: rgba(255,255,255,0.9);
    font-style: italic;
    line-height: var(--leading-relaxed);
    margin: 0 0 var(--space-sm);
}
.auth-brand-quote-author {
    font-size: var(--font-size-xs);
    color: rgba(255,255,255,0.6);
    font-weight: 500;
}

/* Right panel — form */
.auth-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
    background: var(--color-bg);
    overflow-y: auto;
}

.auth-form-box {
    width: 100%;
    max-width: 400px;
}

.auth-form-header {
    margin-bottom: var(--space-xl);
}
.auth-form-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: var(--tracking-tight);
    margin: 0 0 var(--space-xs);
}
.auth-form-subtitle {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}
.auth-form-subtitle a {
    color: var(--color-secondary);
    font-weight: 500;
}

/* Mobile nav link in form panel */
.auth-form-mobile-logo {
    display: none;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 700;
    font-size: var(--font-size-lg);
    color: var(--color-primary);
    text-decoration: none;
    margin-bottom: var(--space-2xl);
}

.auth-form-footer {
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--color-border);
    text-align: center;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}
.auth-form-footer a {
    color: var(--color-secondary);
    font-weight: 600;
}

.auth-remember-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}
.auth-remember-row a {
    font-size: var(--font-size-sm);
    color: var(--color-secondary);
}

/* Password strength meter */
.password-strength {
    height: 4px;
    background: var(--surface-2);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-top: var(--space-xs);
    transition: all var(--duration-normal);
}
.password-strength-bar {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width var(--duration-normal) var(--ease-out), background var(--duration-normal);
    width: 0%;
}
.password-strength--weak   .password-strength-bar { width: 25%; background: var(--color-danger); }
.password-strength--fair   .password-strength-bar { width: 50%; background: var(--color-warning); }
.password-strength--good   .password-strength-bar { width: 75%; background: var(--color-info); }
.password-strength--strong .password-strength-bar { width: 100%; background: var(--color-success); }
.password-strength-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-top: 4px;
}

/* Trust bar at bottom of form */
.auth-trust-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--color-border);
    flex-wrap: wrap;
}
.auth-trust-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}
.auth-trust-item svg { color: var(--color-success); flex-shrink: 0; }

/* ── Auth page responsive ── */
@media (max-width: 900px) {
    .auth-page {
        grid-template-columns: 1fr;
    }
    .auth-brand-panel {
        display: none;
    }
    .auth-form-mobile-logo {
        display: flex;
    }
    .auth-form-panel {
        min-height: 100vh;
        padding: var(--space-xl) var(--space-md);
    }
}

/* ───────────────────────────────────────────────────────────
   12. DASHBOARD SIDEBAR — PILL NAVIGATION
   ─────────────────────────────────────────────────────────── */
.dashboard-sidebar {
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--surface-1);
}

/* Plan card in sidebar */
.sidebar-plan-card {
    background: linear-gradient(135deg,
        var(--color-primary) 0%,
        var(--color-primary-light) 100%);
    border-radius: var(--radius-lg);
    padding: var(--space-md) var(--space-lg);
    margin-bottom: var(--space-lg);
    color: white;
}
.sidebar-plan-card-label {
    font-size: var(--font-size-xs);
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    margin-bottom: 4px;
}
.sidebar-plan-card-name {
    font-weight: 700;
    font-size: var(--font-size-base);
    margin-bottom: var(--space-sm);
}
.sidebar-plan-card-progress-track {
    height: 5px;
    background: rgba(255,255,255,0.2);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 4px;
}
.sidebar-plan-card-progress-fill {
    height: 100%;
    background: rgba(255,255,255,0.85);
    border-radius: var(--radius-full);
    transition: width 0.6s var(--ease-out);
}
.sidebar-plan-card-usage {
    font-size: var(--font-size-xs);
    opacity: 0.8;
}

/* Balance widget */
.sidebar-balance-widget {
    display: flex;
    align-items: baseline;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
}
.sidebar-balance-num {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: var(--tracking-tight);
    line-height: 1;
}
.sidebar-balance-unit {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* Nav section label */
.nav-section-label {
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    color: var(--color-text-muted);
    padding: var(--space-lg) var(--space-sm) var(--space-xs);
    display: block;
}

/* Nav pill links */
.dashboard-nav-v2 {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}
.dashboard-nav-v2 a {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    color: var(--color-text-light);
    font-size: var(--font-size-sm);
    font-weight: 500;
    text-decoration: none;
    transition:
        background var(--duration-fast),
        color var(--duration-fast);
    white-space: nowrap;
}
.dashboard-nav-v2 a:hover {
    background: var(--surface-2);
    color: var(--color-text);
}
.dashboard-nav-v2 a.active {
    background: var(--primary-50);
    color: var(--color-primary);
    font-weight: 600;
}
.dashboard-nav-v2 a.active svg {
    color: var(--color-primary);
    opacity: 1;
}
.dashboard-nav-v2 a svg {
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity var(--duration-fast);
}
.dashboard-nav-v2 a:hover svg {
    opacity: 0.9;
}

/* Nav group separator */
.nav-group-v2 {
    margin-top: var(--space-xs);
    padding-top: var(--space-xs);
}
.nav-group-v2 + .nav-group-v2 {
    border-top: none;
}

/* Sidebar new-capture CTA button */
.sidebar-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    background: var(--color-primary);
    color: white;
    border-radius: var(--radius-md);
    padding: 0.625rem var(--space-md);
    font-size: var(--font-size-sm);
    font-weight: 600;
    text-decoration: none;
    transition: background var(--duration-fast);
    margin-bottom: var(--space-lg);
    letter-spacing: var(--tracking-wide);
}
.sidebar-cta:hover { background: var(--primary-hover); color: white; }

/* ───────────────────────────────────────────────────────────
   13. DASHBOARD STATS — IMPROVED CARDS
   ─────────────────────────────────────────────────────────── */
.stat-card-v2 {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    position: relative;
    overflow: hidden;
    transition: box-shadow var(--duration-normal);
}
.stat-card-v2:hover { box-shadow: var(--shadow-md); }

.stat-card-v2__label {
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    color: var(--color-text-muted);
}
.stat-card-v2__value {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--color-text);
    letter-spacing: var(--tracking-tight);
    line-height: 1;
}
.stat-card-v2__sub {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}
.stat-card-v2__accent {
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    border-radius: var(--radius-xs) 0 0 var(--radius-xs);
}
/* Tinted card variants — clear contrast in light mode */
.stat-card-v2--blue {
    background: #eff6ff;
    border-color: #bfdbfe;
}
.stat-card-v2--blue   .stat-card-v2__accent { background: var(--color-secondary); }
.stat-card-v2--blue   .stat-card-v2__label  { color: #1e40af; }
.stat-card-v2--blue   .stat-card-v2__value  { color: #1d4ed8; }
.stat-card-v2--blue   .stat-card-v2__sub    { color: #2563eb; }

.stat-card-v2--green {
    background: #f0fdf4;
    border-color: #bbf7d0;
}
.stat-card-v2--green  .stat-card-v2__accent { background: var(--color-success); }
.stat-card-v2--green  .stat-card-v2__label  { color: #166534; }
.stat-card-v2--green  .stat-card-v2__value  { color: #16a34a; }
.stat-card-v2--green  .stat-card-v2__sub    { color: #15803d; }

.stat-card-v2--orange {
    background: #fffbeb;
    border-color: #fde68a;
}
.stat-card-v2--orange .stat-card-v2__accent { background: var(--color-accent); }
.stat-card-v2--orange .stat-card-v2__label  { color: #92400e; }
.stat-card-v2--orange .stat-card-v2__value  { color: #b45309; }
.stat-card-v2--orange .stat-card-v2__sub    { color: #d97706; }

.stat-card-v2--primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    border: none;
    color: white;
}
.stat-card-v2--primary .stat-card-v2__label { color: rgba(255,255,255,0.7); }
.stat-card-v2--primary .stat-card-v2__value { color: white; }
.stat-card-v2--primary .stat-card-v2__sub   { color: rgba(255,255,255,0.6); }

/* ───────────────────────────────────────────────────────────
   14. LANDING PAGE — QUICK FIXES
   ─────────────────────────────────────────────────────────── */

/* FAQ arrow rotation */
.faq-item .faq-arrow {
    display: inline-block;
    transition: transform var(--duration-normal) var(--ease-in-out);
    font-style: normal;
}
.faq-item.active .faq-arrow {
    transform: rotate(180deg);
}

/* Star rating component */
.star-rating {
    display: flex;
    gap: 2px;
}
.star-rating svg {
    width: 16px;
    height: 16px;
    fill: #f59e0b;
    stroke: #f59e0b;
}

/* Testimonial card improvements */
.testimonial-card {
    transition: transform var(--duration-normal) var(--ease-out),
                box-shadow var(--duration-normal) var(--ease-out);
}
.testimonial-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}
.testimonial-text {
    line-height: var(--leading-relaxed);
}
.testimonial-avatar {
    font-weight: 700;
    font-size: var(--font-size-sm);
    letter-spacing: var(--tracking-wide);
}

/* Empty state improvements */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-3xl) var(--space-xl);
    text-align: center;
    gap: var(--space-md);
}
.empty-state-icon {
    font-size: 3.5rem;
    line-height: 1;
    margin-bottom: var(--space-sm);
    animation: float 3s ease-in-out infinite;
}
.empty-state-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: var(--tracking-tight);
}
.empty-state-desc {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    max-width: 380px;
    line-height: var(--leading-relaxed);
    margin: 0;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-8px); }
}

/* ───────────────────────────────────────────────────────────
   15. UTILITY CLASSES — EXTENDED
   ─────────────────────────────────────────────────────────── */

/* Typography */
.font-mono { font-family: var(--font-mono); }
.text-xs   { font-size: var(--font-size-xs); }
.leading-relaxed { line-height: var(--leading-relaxed); }
.tracking-wide   { letter-spacing: var(--tracking-wide); }
.tracking-wider  { letter-spacing: var(--tracking-wider); }

/* Spacing */
.mt-xs  { margin-top: var(--space-xs); }
.mt-2xl { margin-top: var(--space-2xl); }
.mt-3xl { margin-top: var(--space-3xl); }
.mb-xs  { margin-bottom: var(--space-xs); }
.gap-xs { gap: var(--space-xs); }
.gap-xl { gap: var(--space-xl); }

/* Display */
.flex-col   { flex-direction: column; }
.items-start { align-items: flex-start; }
.items-end   { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.flex-wrap  { flex-wrap: wrap; }
.flex-1 { flex: 1; }

/* Overflow */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.break-all { word-break: break-all; }

/* Cursor */
.cursor-pointer { cursor: pointer; }

/* Code blocks */
code, .code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--surface-2);
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    color: var(--color-text);
}

/* Hash display */
.hash-display {
    font-family: var(--font-mono);
    font-size: var(--font-size-xs);
    background: var(--surface-1);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    word-break: break-all;
    line-height: var(--leading-relaxed);
    color: var(--color-text-light);
}

/* Copy button */
.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    background: var(--surface-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 3px 8px;
    cursor: pointer;
    transition: background var(--duration-fast), color var(--duration-fast);
}
.copy-btn:hover { background: var(--surface-3); color: var(--color-text); }
.copy-btn.is-copied {
    background: var(--success-50);
    border-color: #a7f3d0;
    color: var(--color-success);
}

/* Section headings hierarchy */
.section-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    letter-spacing: var(--tracking-tight);
    line-height: var(--leading-tight);
}
.section-subtitle {
    line-height: var(--leading-relaxed);
    max-width: 54ch;
}

/* Dividers */
.divider {
    height: 1px;
    background: var(--color-border);
    border: none;
    margin: var(--space-lg) 0;
}

/* ───────────────────────────────────────────────────────────
   16. ANIMATIONS & MICRO-INTERACTIONS
   ─────────────────────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-16px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes pulse-soft {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.6; }
}

.animate-fade-in    { animation: fadeIn var(--duration-normal) var(--ease-out) both; }
.animate-fade-in-up { animation: fadeInUp var(--duration-normal) var(--ease-out) both; }
.animate-scale-in   { animation: scaleIn var(--duration-normal) var(--ease-spring) both; }
.animate-pulse-soft { animation: pulse-soft 2s ease-in-out infinite; }

/* Stagger delays */
.delay-1 { animation-delay: 50ms; }
.delay-2 { animation-delay: 100ms; }
.delay-3 { animation-delay: 150ms; }
.delay-4 { animation-delay: 200ms; }
.delay-5 { animation-delay: 250ms; }

/* ───────────────────────────────────────────────────────────
   17. RESPONSIVE — TABLET BREAKPOINT (missing from main.css)
   ─────────────────────────────────────────────────────────── */
@media (min-width: 769px) and (max-width: 1023px) {
    /* Dashboard sidebar collapses to icons */
    .dashboard-sidebar {
        width: 68px;
        padding: var(--space-md) var(--space-sm);
        overflow: hidden;
    }
    .sidebar-plan-card,
    .sidebar-balance-widget,
    .sidebar-cta { display: none; }
    .nav-section-label { display: none; }
    .dashboard-nav-v2 a span { display: none; }
    .dashboard-nav-v2 a {
        justify-content: center;
        padding: 0.625rem;
    }
    .dashboard-nav-v2 a svg { margin: 0; opacity: 0.7; }

    /* Pricing 2-col */
    .pricing-grid-v14 { grid-template-columns: repeat(2, 1fr) !important; }

    /* Stats 2x2 */
    .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }

    .auth-brand-headline { font-size: 1.75rem; }
    .auth-brand-bullets  { gap: var(--space-sm); }
}

/* ───────────────────────────────────────────────────────────
   18. HERO FORM MOBILE FIX
   ─────────────────────────────────────────────────────────── */
@media (max-width: 520px) {
    .hero-form-row,
    .capture-form .form-row {
        flex-direction: column;
        gap: var(--space-sm);
    }
    .hero-submit-btn,
    .capture-form .btn-submit {
        width: 100%;
        justify-content: center;
    }
}

/* ───────────────────────────────────────────────────────────
   19. DARK MODE COMPONENT OVERRIDES
   ─────────────────────────────────────────────────────────── */
[data-theme="dark"] .card {
    background: var(--color-bg-light);
    border-color: var(--color-border);
}
[data-theme="dark"] .toast {
    background: var(--neutral-800);
    border-color: var(--neutral-700);
}
[data-theme="dark"] code, [data-theme="dark"] .code {
    background: var(--surface-2);
}
[data-theme="dark"] .auth-brand-panel {
    background: linear-gradient(150deg, #030712 0%, #0f172a 50%, #1e3a5f 100%);
}
[data-theme="dark"] .auth-form-panel { background: var(--color-bg); }
[data-theme="dark"] .sidebar-plan-card {
    background: linear-gradient(135deg, #1e3a5f 0%, #1d4ed8 100%);
}
[data-theme="dark"] .stat-card-v2--primary {
    background: linear-gradient(135deg, #1e3a5f 0%, #1d4ed8 100%);
}
[data-theme="dark"] .stat-card-v2--blue {
    background: rgba(30, 64, 175, 0.15);
    border-color: rgba(59, 130, 246, 0.25);
}
[data-theme="dark"] .stat-card-v2--blue .stat-card-v2__label { color: #93c5fd; }
[data-theme="dark"] .stat-card-v2--blue .stat-card-v2__value { color: #60a5fa; }
[data-theme="dark"] .stat-card-v2--blue .stat-card-v2__sub   { color: #93c5fd; }

[data-theme="dark"] .stat-card-v2--green {
    background: rgba(22, 163, 74, 0.1);
    border-color: rgba(34, 197, 94, 0.25);
}
[data-theme="dark"] .stat-card-v2--green .stat-card-v2__label { color: #86efac; }
[data-theme="dark"] .stat-card-v2--green .stat-card-v2__value { color: #4ade80; }
[data-theme="dark"] .stat-card-v2--green .stat-card-v2__sub   { color: #86efac; }

[data-theme="dark"] .stat-card-v2--orange {
    background: rgba(217, 119, 6, 0.1);
    border-color: rgba(245, 158, 11, 0.25);
}
[data-theme="dark"] .stat-card-v2--orange .stat-card-v2__label { color: #fcd34d; }
[data-theme="dark"] .stat-card-v2--orange .stat-card-v2__value { color: #fbbf24; }
[data-theme="dark"] .stat-card-v2--orange .stat-card-v2__sub   { color: #fcd34d; }
[data-theme="dark"] .dashboard-sidebar { background: #161b22; }
[data-theme="dark"] .dashboard-nav-v2 a:hover { background: #21262d; }
[data-theme="dark"] .dashboard-nav-v2 a.active {
    background: #1c2d4a;
    color: #60a5fa;
}
[data-theme="dark"] .skeleton {
    background: linear-gradient(90deg, #21262d 25%, #30363d 50%, #21262d 75%);
    background-size: 200% 100%;
}

/* ───────────────────────────────────────────────────────────
   20. AUTH PAGE — ADDITIONAL COMPONENTS (v44.3)
   ─────────────────────────────────────────────────────────── */

/* Suppress global header/footer on auth pages */
body.auth-body .header,
body.auth-body .footer { display: none; }
body.auth-body .main { padding: 0; }

/* Auth brand structure */
.auth-brand-top { margin-bottom: var(--space-2xl); }
.auth-brand-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 1;
    padding: var(--space-lg) 0;
}

/* Bullets using <li> */
.auth-brand-bullets {
    list-style: none;
    padding: 0;
    margin: var(--space-xl) 0 var(--space-2xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}
.auth-brand-bullets li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    font-size: var(--font-size-sm);
    color: rgba(255,255,255,0.85);
    line-height: var(--leading-relaxed);
}
.auth-brand-bullet-icon {
    font-size: 1.1rem;
    line-height: 1.4;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

/* Stats row in brand panel */
.auth-brand-stats {
    display: flex;
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}
.auth-brand-stat { text-align: center; }
.auth-brand-stat-value {
    font-size: var(--font-size-2xl);
    font-weight: 800;
    color: white;
    line-height: 1;
}
.auth-brand-stat-label {
    font-size: var(--font-size-xs);
    color: rgba(255,255,255,0.6);
    margin-top: 4px;
}

/* Quote extended */
.auth-brand-quote {
    position: relative;
    z-index: 1;
    padding: var(--space-lg);
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-lg);
    border-left: 3px solid rgba(255,255,255,0.35);
    backdrop-filter: blur(8px);
}
.auth-brand-quote p {
    font-size: var(--font-size-sm);
    color: rgba(255,255,255,0.9);
    font-style: italic;
    line-height: var(--leading-relaxed);
    margin: 0 0 var(--space-md);
}
.auth-brand-quote-author {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}
.auth-brand-quote-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: var(--radius-full);
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: white;
}
.auth-brand-quote-name {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: rgba(255,255,255,0.9);
}
.auth-brand-quote-role {
    font-size: var(--font-size-xs);
    color: rgba(255,255,255,0.55);
}

/* Form panel sub-heading */
.auth-form-sub {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin: var(--space-xs) 0 0;
}
.auth-form-footer-link {
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: none;
}
.auth-form-footer-link:hover { text-decoration: underline; }

/* Form label row (label + link on same line) */
.form-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xs);
}
.form-label-row .form-label { margin-bottom: 0; }
.form-label-link {
    font-size: var(--font-size-xs);
    color: var(--color-secondary);
    text-decoration: none;
    font-weight: 500;
}
.form-label-link:hover { text-decoration: underline; }
.form-label-optional {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    font-weight: 400;
    margin-left: var(--space-xs);
}

/* Password toggle inside input */
.input-with-toggle {
    position: relative;
}
.input-with-toggle .form-input {
    padding-right: 2.75rem;
}
.input-toggle-btn {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 0.25rem;
    line-height: 1;
    opacity: 0.6;
    transition: opacity var(--duration-fast), color var(--duration-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}
.input-toggle-btn:hover { opacity: 1; color: var(--color-text); }

/* Password strength (used in register) */
.password-strength {
    margin-top: var(--space-xs);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}
.password-strength-bar {
    flex: 1;
    height: 4px;
    background: var(--surface-3);
    border-radius: var(--radius-full);
    overflow: hidden;
}
.password-strength-fill {
    height: 100%;
    border-radius: var(--radius-full);
    width: 0%;
    transition: width var(--duration-normal) var(--ease-out),
                background var(--duration-normal);
}
.password-strength-label {
    font-size: var(--font-size-xs);
    font-weight: 500;
    min-width: 60px;
    text-align: right;
}

/* Custom checkbox - hidden input */
.checkbox-input { display: none !important; }

/* ───────────────────────────────────────────────────────────
   21. SIDEBAR — USER FOOTER + PLAN CARD V2 (v44.3)
   ─────────────────────────────────────────────────────────── */

.sidebar-plan-badge {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    margin-bottom: var(--space-sm);
}
.sidebar-plan-name-v2 {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: white;
}
.sidebar-balance-row {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    margin: var(--space-sm) 0 var(--space-md);
    flex-wrap: nowrap;
    white-space: nowrap;
}
.sidebar-balance-row .sidebar-balance-value {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: white;
    white-space: nowrap;
}
.sidebar-balance-row .text-xs { color: rgba(255,255,255,0.65); }

/* Override sidebar-progress-wrap in plan card context */
.sidebar-plan-card .sidebar-progress-wrap { margin: var(--space-sm) 0; }
.sidebar-plan-card .sidebar-progress-track {
    height: 5px;
    background: rgba(255,255,255,0.2);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 4px;
}
.sidebar-plan-card .sidebar-progress-fill {
    height: 100%;
    background: rgba(255,255,255,0.85);
    border-radius: var(--radius-full);
    transition: width 0.6s var(--ease-out);
}
.sidebar-plan-card .sidebar-progress-label { color: rgba(255,255,255,0.65); }

/* Sidebar user footer */
.sidebar-user-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    transition: background var(--duration-fast);
}
.sidebar-user-row:hover { background: var(--surface-2); }
.sidebar-user-avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: var(--radius-full);
    background: var(--color-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-sm);
    font-weight: 700;
    letter-spacing: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-logout-link {
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color var(--duration-fast);
}
.sidebar-logout-link:hover { color: var(--color-danger); }

/* Sidebar footer positioning */
.sidebar-footer {
    margin-top: auto;
    padding-top: var(--space-md);
    border-top: 1px solid var(--color-border);
}

/* nav-group labels in new nav */
.dashboard-nav-v2 .nav-group { margin-top: var(--space-xs); }
.dashboard-nav-v2 .nav-group-title {
    display: block;
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    color: var(--color-text-muted);
    padding: var(--space-md) var(--space-sm) var(--space-xs);
}

/* Toast icon / message span selectors */
.toast-icon {
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 1px;
}
.toast-message { flex: 1; line-height: var(--leading-snug); }
.toast-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
    transition: color var(--duration-fast);
}
.toast-close:hover { color: white; }

/* mb-lg / mb-md / mb-xl / mt-md utilities */
.mb-lg  { margin-bottom: var(--space-lg); }
.mb-md  { margin-bottom: var(--space-md); }
.mb-xl  { margin-bottom: var(--space-xl); }
.mt-md  { margin-top:    var(--space-md); }

/* ───────────────────────────────────────────────────────────
   22. PROTOCOLS PAGE
   ─────────────────────────────────────────────────────────── */
.protocols-filter-form {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}
.table-id-link {
    font-size: var(--font-size-xs);
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--color-secondary);
}
.pagination {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--color-border);
}
.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    font-size: var(--font-size-sm);
    color: var(--color-text);
    text-decoration: none;
    transition: background var(--duration-fast), border-color var(--duration-fast);
}
.pagination-btn:hover {
    background: var(--surface-2);
    border-color: var(--color-secondary);
}
.pagination-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}
.pagination-ellipsis {
    color: var(--color-text-muted);
    padding: 0 var(--space-xs);
}

/* ───────────────────────────────────────────────────────────
   23. PROFILE PAGE
   ─────────────────────────────────────────────────────────── */
.profile-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: var(--space-lg);
    align-items: start;
}
@media (max-width: 768px) {
    .profile-layout { grid-template-columns: 1fr; }
}
.profile-avatar-card {
    text-align: center;
    padding: var(--space-xl) !important;
}
.profile-avatar {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    color: white;
    font-size: 1.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-md);
    box-shadow: 0 4px 12px rgba(26,54,93,0.25);
}
.profile-display-name {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--color-text);
}
.profile-stats-row {
    display: flex;
    gap: var(--space-lg);
    justify-content: center;
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--color-border);
}
.profile-mini-stat { text-align: center; }
.profile-mini-stat-val {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
}
.profile-mini-stat-lbl {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    margin-top: 2px;
}
.profile-dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-xs) var(--space-md);
    margin: 0;
}
.profile-dl dt {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    align-self: center;
}
.profile-dl dd {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text);
    margin: 0;
    align-self: center;
}
.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}
@media (max-width: 600px) {
    .form-row-2 { grid-template-columns: 1fr; }
}
.profile-divider {
    height: 1px;
    background: var(--color-border);
    margin: var(--space-xl) 0;
}
.profile-section-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 var(--space-md);
}

/* ───────────────────────────────────────────────────────────
   24. BILLING PAGE
   ─────────────────────────────────────────────────────────── */
.billing-mini-progress {
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.2);
    margin-bottom: 4px;
    overflow: hidden;
}
.billing-mini-progress-fill {
    height: 100%;
    background: rgba(255,255,255,0.8);
    border-radius: 2px;
    transition: width var(--duration-slow);
}
/* For non-primary cards */
.stat-card-v2--orange .billing-mini-progress { background: rgba(146, 64, 14, 0.15); }
.stat-card-v2--orange .billing-mini-progress-fill { background: #b45309; }

.billing-plans-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}
.billing-plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--space-lg);
}
.billing-plan-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    position: relative;
    transition: box-shadow var(--duration-normal), transform var(--duration-normal);
}
.billing-plan-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}
.billing-plan-card--popular {
    border-width: 2px;
}
.billing-plan-card--active {
    border-color: var(--color-success);
    box-shadow: 0 0 0 3px rgba(56,161,105,0.15);
}
.billing-plan-badges {
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
    min-height: 24px;
}
.billing-plan-icon { font-size: 2rem; line-height: 1; }
.billing-plan-name {
    font-size: var(--font-size-lg);
    font-weight: 700;
    margin: 0;
    color: var(--color-text);
}
.billing-plan-desc {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin: 0;
    min-height: 36px;
    line-height: var(--leading-relaxed);
}
.billing-plan-price-wrap {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-top: var(--space-xs);
}
.billing-plan-price {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: var(--tracking-tight);
}
.billing-plan-currency {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--color-text-muted);
}
.billing-plan-period {
    font-size: var(--font-size-sm);
}
.billing-plan-per-item {
    font-size: var(--font-size-sm);
    font-weight: 600;
    margin: 0;
}
.billing-plan-features {
    list-style: none;
    padding: 0;
    margin: var(--space-sm) 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    flex: 1;
}
.billing-plan-features li {
    font-size: var(--font-size-sm);
    color: var(--color-text);
    padding-left: 1.4em;
    position: relative;
}
.billing-plan-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--color-success);
    font-weight: 700;
}
.billing-api-section {
    padding-top: var(--space-lg);
    border-top: 1px solid var(--color-border);
    margin-top: var(--space-md);
}
.billing-api-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}
.billing-api-code {
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    background: var(--surface-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-xs) var(--space-sm);
    color: var(--color-text);
}

/* ───────────────────────────────────────────────────────────
   22. BADGE ALIASES & EXTENSIONS
   ─────────────────────────────────────────────────────────── */
/* badge-primary = alias for badge-info (blue) */
.badge-primary { background: #cce5ff; color: #004085; }
/* badge-outline = bordered, no fill */
.badge-outline {
    background: transparent;
    color: var(--color-text);
    border: 1px solid var(--color-border);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}
[data-theme="dark"] .badge-primary { background: #1a365d; color: #90cdf4; }
[data-theme="dark"] .badge-outline { border-color: var(--color-border); color: var(--color-text-muted); }
