/* ═══════════════════════════════════════════════════════════
   Hybrid Monitor — Design System v3
   Refined dashboard design with disciplined color language.
   Every color earns its place. Restraint is the design.
   ═══════════════════════════════════════════════════════════ */

/* ── CSS Variables ─────────────────────────────────────── */
:root {
    /* ═══ TIER 1: PRIMITIVE SCALES ═══ */

    /* Teal (Brand/Accent) */
    --color-teal-50: #f0fdfa; --color-teal-100: #ccfbf1; --color-teal-200: #99f6e4;
    --color-teal-300: #5eead4; --color-teal-400: #2dd4bf; --color-teal-500: #14b8a6;
    --color-teal-600: #0d9488; --color-teal-700: #0f766e; --color-teal-800: #115e59;
    --color-teal-900: #134e4a; --color-teal-950: #042f2e;

    /* Green (Success) */
    --color-green-50: #f0fdf4; --color-green-100: #dcfce7; --color-green-200: #bbf7d0;
    --color-green-400: #4ade80; --color-green-500: #22c55e; --color-green-600: #16a34a;
    --color-green-800: #166534; --color-green-900: #14532d; --color-green-950: #052e16;

    /* Red (Danger) */
    --color-red-50: #fef2f2; --color-red-100: #fee2e2; --color-red-200: #fecaca;
    --color-red-400: #f87171; --color-red-500: #ef4444; --color-red-600: #dc2626;
    --color-red-800: #991b1b; --color-red-900: #7f1d1d; --color-red-950: #450a0a;

    /* Amber (Warning) */
    --color-amber-50: #fffbeb; --color-amber-100: #fef3c7; --color-amber-200: #fde68a;
    --color-amber-400: #fbbf24; --color-amber-500: #f59e0b; --color-amber-600: #d97706;
    --color-amber-800: #92400e; --color-amber-900: #78350f; --color-amber-950: #451a03;

    /* Blue (Info) */
    --color-blue-50: #eff6ff; --color-blue-100: #dbeafe; --color-blue-200: #bfdbfe;
    --color-blue-400: #60a5fa; --color-blue-500: #3b82f6; --color-blue-600: #2563eb;
    --color-blue-800: #1e40af; --color-blue-900: #1e3a8a; --color-blue-950: #172554;

    /* Zinc (Neutral) */
    --color-zinc-50: #fafafa; --color-zinc-100: #f4f4f5; --color-zinc-200: #e4e4e7;
    --color-zinc-300: #d4d4d8; --color-zinc-400: #a1a1aa; --color-zinc-500: #71717a;
    --color-zinc-600: #52525b; --color-zinc-700: #3f3f46; --color-zinc-800: #27272a;
    --color-zinc-900: #18181b; --color-zinc-950: #09090b;

    /* ═══ TIER 2: SEMANTIC TOKENS ═══ */

    --sidebar-bg: #111111;
    --sidebar-hover: rgba(255, 255, 255, 0.06);
    --sidebar-active: rgba(48, 213, 200, 0.1);
    --sidebar-text: #8e8e93;
    --sidebar-text-active: #f5f5f7;
    --sidebar-accent: #30d5c8;
    --font-ui: "Inter", "Avenir Next", "Segoe UI", system-ui, sans-serif;
    --sidebar-width: 272px;
    --header-height: 64px;
    --card-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.03),
        0 1px 2px rgba(0, 0, 0, 0.04),
        0 3px 6px rgba(0, 0, 0, 0.03);
    --card-shadow-hover:
        0 0 0 1px rgba(0, 0, 0, 0.03),
        0 2px 4px rgba(0, 0, 0, 0.05),
        0 8px 16px rgba(0, 0, 0, 0.06);
    --card-shadow-active:
        0 0 0 1px rgba(0, 0, 0, 0.04),
        0 1px 2px rgba(0, 0, 0, 0.06);
    --card-border: #e5e5e5;
    --card-radius: 12px;
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --surface-bg: var(--color-zinc-50);
    --surface-elevated: #ffffff;
    --surface-muted: #f5f5f5;
    --text-primary: #1a1a1a;
    --text-secondary: #404040;
    --text-muted: #737373;
    --border-default: #e5e5e5;
    --focus-ring: var(--color-teal-700);
    --accent-primary: var(--color-teal-700);
    --accent-primary-strong: var(--color-teal-800);
    --accent-info: #1e6b8a;
    --accent-warning: var(--color-amber-800);
    --accent-danger: var(--color-red-800);
    --accent-neutral: #525252;
    --tone-info-bg: #f0f9ff;
    --tone-info-border: #bae6fd;
    --tone-info-text: #0c5370;
    --tone-success-bg: var(--color-green-50);
    --tone-success-border: var(--color-green-200);
    --tone-success-text: var(--color-green-800);
    --tone-warning-bg: #fefce8;
    --tone-warning-border: #fef08a;
    --tone-warning-text: #854d0e;
    --tone-danger-bg: var(--color-red-50);
    --tone-danger-border: var(--color-red-200);
    --tone-danger-text: var(--color-red-800);
    --tone-neutral-bg: var(--color-zinc-50);
    --tone-neutral-border: #e5e5e5;
    --tone-neutral-text: #404040;
    --info-subtle: var(--color-blue-50);
    --info-default: var(--color-blue-600);
    --info-emphasis: var(--color-blue-800);
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --chart-grid: #f5f5f5;
    --chart-text: #737373;
    --chart-track: #f5f5f5;
    --chart-tooltip-bg: #1c1c1e;
    --chart-tooltip-text: #f5f5f7;
    --chart-success: var(--color-green-800);
    --chart-danger: var(--color-red-800);
    --chart-warning: var(--color-amber-800);
    --chart-info: var(--color-teal-700);
    --chart-neutral: #525252;
    --chart-series-1: var(--color-teal-700);
    --chart-series-2: #1e6b8a;
    --chart-series-3: var(--color-green-800);
    --chart-series-4: var(--color-amber-800);
    --chart-series-5: #525252;
    --chart-series-6: var(--color-teal-600);
    --chart-series-7: #9a3412;
    --chart-series-8: #5b21b6;
    --chart-series-9: #9f1239;
    --chart-series-10: #374151;
}

/* ═══ TIER 2b: CHART SERIES (Okabe-Ito, colorblind-safe) ═══ */
:root {
    --chart-1: #0072B2; --chart-2: #E69F00; --chart-3: #009E73;
    --chart-4: #D55E00; --chart-5: #56B4E9; --chart-6: #CC79A7;
    --chart-7: #DDB310; --chart-8: #525252;
}

[data-theme="dark"] {
    --chart-1: #4A9FD4; --chart-2: #E69F00; --chart-3: #2EC4A0;
    --chart-4: #E8783A; --chart-5: #56B4E9; --chart-6: #CC79A7;
    --chart-7: #DDB310; --chart-8: #B0B0B0;
}

/* ── Base & Typography ─────────────────────────────────── */
html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 1rem);
}

body {
    font-family: var(--font-ui);
    line-height: 1.5;
    letter-spacing: -0.011em;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    background: var(--surface-bg);
    color: var(--text-primary);
}

/* ── Semantic Color Refinement Layer ────────────────────────
   Overrides Tailwind defaults with a disciplined, muted palette.
   ONE shade per semantic meaning. No rainbow. No "AI slop."
   ──────────────────────────────────────────────────────── */

/* Success / Positive — deep forest green, not neon emerald */
.text-emerald-600, .text-emerald-700, .text-green-600, .text-green-700 { color: #166534; }
.text-emerald-500, .text-green-500 { color: #15803d; }
.bg-emerald-100 { background-color: #dcfce7; }
.bg-emerald-50 { background-color: #f0fdf4; }
.border-emerald-200, .border-emerald-300 { border-color: #bbf7d0; }

/* Danger / Critical — deep crimson, not bright red */
.text-red-600, .text-red-700 { color: #991b1b; }
.text-red-500 { color: #b91c1c; }
.bg-red-100 { background-color: #fee2e2; }
.bg-red-50 { background-color: #fef2f2; }
.border-red-200, .border-red-300 { border-color: #fecaca; }

/* Warning — warm earth tone, not garish amber */
.text-amber-600, .text-amber-700, .text-orange-600, .text-orange-700 { color: #92400e; }
.text-amber-500, .text-orange-500 { color: #b45309; }
.bg-amber-100 { background-color: #fef3c7; }
.bg-amber-50 { background-color: #fefce8; }
.border-amber-200, .border-amber-300 { border-color: #fde68a; }

/* Info / Accent — deep teal, the brand anchor */
.text-teal-600, .text-teal-700, .text-cyan-600, .text-cyan-700 { color: #0f766e; }

/* Neutral accents — true gray, not blue-gray */
.text-indigo-600, .text-indigo-700 { color: #4338ca; }
.text-indigo-500 { color: #4f46e5; }
.text-purple-600, .text-purple-700 { color: #6d28d9; }

/* Badge refinement — softer backgrounds, deeper text */
.bg-emerald-100.text-emerald-700 { color: #166534; }
.bg-red-100.text-red-700 { color: #991b1b; }
.bg-amber-100.text-amber-700 { color: #92400e; }
.bg-blue-100.text-blue-700 { color: #1e40af; }
.bg-indigo-100.text-indigo-700 { color: #3730a3; }

/* Card accent stripes — muted */
.card-accent-teal { border-left-color: #0f766e; }
.card-accent-green { border-left-color: #166534; }
.card-accent-amber { border-left-color: #92400e; }
.card-accent-red { border-left-color: #991b1b; }
.card-accent-blue { border-left-color: #1e6b8a; }

/* ── Typography Scale ──────────────────────────────────────
   Canonical sizes for every semantic purpose. ONE size each.
   Use these classes OR the equivalent Tailwind in templates.
   ──────────────────────────────────────────────────────── */

/* Metric values — the big numbers */
.metric-value {
    font-size: 2rem;              /* 32px, up from 24px */
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.025em;     /* tighter for premium feel */
    color: var(--text-primary);
}

/* Compact variant for smaller cards */
.metric-value-sm {
    font-size: 1.5rem;            /* 24px */
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

/* Metric labels — small uppercase above values */
.metric-label {
    font-size: 0.6875rem;     /* 11px — the ONE true label size */
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

/* Section titles — dashboard section headers */
.section-title {
    font-size: 0.8125rem;     /* 13px */
    font-weight: 650;
    color: var(--text-secondary);
}

/* Section subtitles */
.section-subtitle {
    font-size: 0.6875rem;     /* 11px */
    color: var(--text-muted);
}

/* Badge / pill — consistent sizing */
.badge {
    font-size: 0.6875rem;     /* 11px */
    font-weight: 500;
    padding: 0.125rem 0.5rem; /* py-0.5 px-2 */
    border-radius: 9999px;
    line-height: 1.4;
}

/* Table headers */
.th-label {
    font-size: 0.75rem;       /* text-xs */
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

/* Table body cells */
.td-value {
    font-size: 0.8125rem;     /* 13px */
    color: var(--text-secondary);
}

/* Numeric values in tables — monospace, right-aligned */
.td-number {
    font-size: 0.8125rem;
    font-family: var(--font-ui);
    font-variant-numeric: tabular-nums;
    text-align: right;
    color: var(--text-primary);
}

/* Tabular numerals for all data contexts */
.metric-value,
.metric-value-sm,
.td-number,
.kpi-value,
[data-numeric],
.font-mono {
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum' 1, 'kern' 1;
}

/* Card subtitle / supporting text */
.card-meta {
    font-size: 0.5625rem;     /* 9px */
    color: var(--text-muted);
}

/* ── Selection highlight ─────────────────────────────────── */
::selection {
    background: rgba(15, 118, 110, 0.14);
    color: #1a1a1a;
}

/* ── Focus-visible for keyboard navigation ───────────────── */
:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
    border-radius: 6px;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.92);
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

/* ── Sidebar ───────────────────────────────────────────── */
#sidebar {
    background: var(--sidebar-bg);
    background-image: linear-gradient(180deg, #111111 0%, #161616 100%);
    width: var(--sidebar-width);
}

#sidebar .sidebar-logo {
    filter: brightness(0) invert(1);
    opacity: 0.95;
    transition: opacity var(--transition-fast);
}

#sidebar .sidebar-logo:hover {
    opacity: 1;
}

#sidebar .nav-section-label {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6e6e73;
    padding: 0.75rem 1rem 0.375rem;
    font-weight: 700;
}

#sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.6rem 1rem;
    margin: 0.125rem 0.5rem;
    border-radius: 8px;
    min-height: 2.25rem;
    font-size: 0.84rem;
    color: var(--sidebar-text);
    transition: background-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
    text-decoration: none;
    position: relative;
}

#sidebar .nav-link:hover {
    background: var(--sidebar-hover);
    color: #d1d1d6;
}

#sidebar .nav-link.active {
    background: var(--sidebar-active);
    color: var(--sidebar-text-active);
    font-weight: 600;
}

#sidebar .nav-link.active::before {
    content: '';
    position: absolute;
    left: -0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--sidebar-accent);
    border-radius: 0 3px 3px 0;
}

#sidebar .nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.6;
}

#sidebar .nav-link.active .nav-icon {
    opacity: 1;
}

#sidebar .nav-link:hover .nav-icon {
    opacity: 0.85;
}

/* Sub-links (indented secondary navigation) */
#sidebar .nav-sub-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.9rem 0.45rem 2.5rem;
    margin: 0 0.5rem;
    border-radius: 6px;
    min-height: 2rem;
    font-size: 0.78rem;
    color: var(--sidebar-text);
    opacity: 0.9;
    transition: all var(--transition-fast);
    text-decoration: none;
    position: relative;
}

#sidebar .nav-sub-link:hover {
    background: var(--sidebar-hover);
    color: #d1d1d6;
    opacity: 1;
}

#sidebar .nav-sub-link.active {
    background: var(--sidebar-active);
    color: var(--sidebar-text-active);
    font-weight: 500;
    opacity: 1;
}

#sidebar .nav-sub-link .nav-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.75;
}

#sidebar .nav-sub-link.active .nav-icon {
    opacity: 1;
}

#sidebar .nav-disclosure {
    margin: 0.125rem 0.5rem;
}

#sidebar .nav-disclosure summary {
    list-style: none;
}

#sidebar .nav-disclosure summary::-webkit-details-marker {
    display: none;
}

#sidebar .nav-disclosure-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    border-radius: 8px;
    min-height: 2rem;
    padding: 0.4rem 0.75rem 0.4rem 1.15rem;
    color: #6e6e73;
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

#sidebar .nav-disclosure-summary:hover {
    background: var(--sidebar-hover);
    color: #d1d1d6;
}

#sidebar .nav-disclosure[open] .nav-disclosure-summary {
    color: #d1d1d6;
}

#sidebar .nav-disclosure-icon {
    width: 0.95rem;
    height: 0.95rem;
    opacity: 0.8;
    transition: transform var(--transition-fast);
}

#sidebar .nav-disclosure[open] .nav-disclosure-icon {
    transform: rotate(180deg);
}

/* ── Sidebar Scrollbar ─────────────────────────────────── */
#sidebar::-webkit-scrollbar {
    width: 4px;
}

#sidebar::-webkit-scrollbar-track {
    background: transparent;
}

#sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

#sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.18);
}

/* ── Header ────────────────────────────────────────────── */
.app-header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid #e2e8f0;
}

.app-header-row {
    height: var(--header-height);
}

.app-header-filters {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 1rem 0.625rem;
    border-bottom: 1px solid #e2e8f0;
}

.app-header-filters:not(:has(*)) {
    display: none;
}

.app-header-filters::-webkit-scrollbar {
    display: none;
}

.app-header-filters .filter-bar {
    flex-wrap: nowrap;
    width: max-content;
}

/* ── HTMX Loading Indicator ────────────────────────────── */
.htmx-indicator {
    opacity: 0;
    transition: opacity 200ms ease-in;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    opacity: 1;
}

#htmx-loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 9999;
    background: linear-gradient(90deg, #0f766e, #0ea5a4, #d97706, #0f766e);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s ease-in-out infinite;
    opacity: 0;
    transition: opacity 200ms;
}

.htmx-request #htmx-loading-bar {
    opacity: 1;
}

/* Optimistic dimming: fade stale content while HTMX request is in-flight */
.htmx-request .section-body {
    opacity: 0.4;
    transition: opacity 150ms ease;
}
.htmx-request #main-content {
    pointer-events: none;
}

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

/* ── Skeleton Loading ─────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg,
        var(--surface-muted) 25%,
        var(--surface-elevated) 50%,
        var(--surface-muted) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: var(--card-radius, 12px);
}

.skeleton-stat {
    height: 120px;
    border-radius: var(--card-radius, 12px);
}

.skeleton-chart {
    height: 300px;
    border-radius: var(--card-radius, 12px);
}

.skeleton-row {
    height: 44px;
    border-radius: 6px;
    margin-bottom: 4px;
}

.skeleton-text {
    height: 14px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.skeleton-text-short { width: 40%; }
.skeleton-text-medium { width: 65%; }
.skeleton-text-long { width: 85%; }

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

@media (prefers-reduced-motion: reduce) {
    .skeleton { animation: none; }
}

/* HTMX swap transitions */
.htmx-swapping > * {
    opacity: 0;
    transition: opacity 150ms ease-out;
}

.htmx-added {
    opacity: 0;
}

.htmx-settling > * {
    opacity: 1;
    transition: opacity 200ms ease-in;
}

/* During request: subtle dimming (non-button elements) */
.htmx-request:not(button):not(.btn) {
    opacity: 0.7;
    transition: opacity 200ms linear;
    pointer-events: none;
}

/* ── Dashboard Sections (collapsible) ─────────────────── */
.dashboard-section {
    margin-bottom: 2rem;
}

.dashboard-section > summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
}

.dashboard-section > summary::-webkit-details-marker {
    display: none;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 1rem;
}

.section-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    flex-shrink: 0;
}

.section-icon svg {
    width: 16px;
    height: 16px;
}

.section-title {
    font-size: 0.8125rem;
    font-weight: 650;
    color: #1e293b;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.section-subtitle {
    font-size: 0.6875rem;
    color: #94a3b8;
    margin-top: 0.1875rem;
    font-weight: 400;
    line-height: 1.4;
}

.section-toggle {
    width: 20px;
    height: 20px;
    color: #94a3b8;
    transition: transform var(--transition-fast), color var(--transition-fast);
    flex-shrink: 0;
}

.dashboard-section[open] > summary .section-toggle {
    transform: rotate(180deg);
}

.dashboard-section > summary:hover .section-toggle {
    color: #64748b;
}

.section-body {
    animation: fadeInUp 0.2s ease-out both;
}

/* ── Action Board UI ───────────────────────────────────── */
.action-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.action-toolbar__link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.75rem;
    border-radius: 0.625rem;
    border: 1px solid #d9e4ef;
    background: #ffffff;
    color: #334155;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1;
    transition: border-color var(--transition-fast), background-color var(--transition-fast), color var(--transition-fast);
}

.action-toolbar__link:hover {
    border-color: #c0d2e6;
    background: #f8fbff;
    color: #0f172a;
}

.action-toolbar__link--danger {
    border-color: #fecaca;
    background: #fff7f7;
    color: #b91c1c;
}

.action-toolbar__link--warning {
    border-color: #fcd8b0;
    background: #fff8ef;
    color: #b45309;
}

.action-toolbar__link--info {
    border-color: #bfdbfe;
    background: #f1f7ff;
    color: #1d4ed8;
}

.action-kpi-card {
    position: relative;
    display: block;
    border: 1px solid #d9e4ef;
    border-radius: 0.875rem;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    padding: 0.875rem 0.95rem;
    transition: box-shadow var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.action-kpi-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    border-radius: 0.875rem 0 0 0.875rem;
    background: #0f766e;
}

.action-kpi-card:hover {
    border-color: #c2d3e6;
    box-shadow: 0 10px 18px -16px rgba(15, 23, 42, 0.38);
    transform: translateY(-1px);
}

.action-kpi-card--info::before {
    background: #1d4ed8;
}

.action-kpi-card--success::before {
    background: #059669;
}

.action-kpi-card--warning::before {
    background: #b45309;
}

.action-kpi-card--danger::before {
    background: #dc2626;
}

.action-kpi-card--neutral::before {
    background: #64748b;
}

.action-kpi-card__label {
    font-size: 0.6875rem;
    font-weight: 640;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
}

.action-kpi-card__value {
    margin-top: 0.375rem;
    font-size: 1.375rem;
    line-height: 1.1;
    font-weight: 720;
    letter-spacing: -0.015em;
    color: #0f172a;
}

.action-kpi-card__meta {
    margin-top: 0.25rem;
    font-size: 0.6875rem;
    color: #64748b;
    line-height: 1.35;
}

.action-kpi-card__cta {
    margin-top: 0.5rem;
    font-size: 0.6875rem;
    font-weight: 620;
    color: #0f766e;
    opacity: 0.92;
}

.action-kpi-card--danger .action-kpi-card__value {
    color: #b91c1c;
}

.action-kpi-card--warning .action-kpi-card__value {
    color: #b45309;
}

.action-kpi-card--success .action-kpi-card__value {
    color: #047857;
}

.action-kpi-card--info .action-kpi-card__value {
    color: #1d4ed8;
}

.action-kpi-card--neutral .action-kpi-card__value {
    color: #334155;
}

/* ── Workflow Guide Header ─────────────────────────────── */
.guide-header-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

#guide-search.guide-header-search {
    width: min(18rem, 74vw);
}

@media (min-width: 640px) {
    .guide-header-tools {
        flex-wrap: nowrap;
    }

    #guide-search.guide-header-search {
        width: 18rem;
    }
}

/* ── Workflow Guide UX ─────────────────────────────────── */
.guide-page {
    --ios-surface: rgba(255, 255, 255, 0.82);
    --ios-surface-strong: rgba(255, 255, 255, 0.94);
    --ios-border: rgba(148, 163, 184, 0.24);
    --ios-shadow: 0 24px 44px -34px rgba(15, 23, 42, 0.42), 0 10px 24px -18px rgba(15, 23, 42, 0.22);
    font-family: Inter, system-ui, -apple-system, sans-serif;
    color: #0f172a;
}

.guide-page .ios-card {
    position: relative;
    border: 1px solid var(--ios-border);
    border-radius: 20px;
    background: var(--ios-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--ios-shadow);
}

.guide-page .ios-onboarding {
    padding: 0.6rem;
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.1), transparent 42%),
        radial-gradient(circle at bottom left, rgba(15, 23, 42, 0.05), transparent 45%),
        var(--ios-surface-strong);
}

.guide-page .ios-onboarding-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    padding: 0.45rem 0.55rem 0.9rem;
}

.guide-page .ios-brand-block {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.guide-page .ios-brand-mark {
    width: 1.7rem;
    height: 1.7rem;
    opacity: 0.92;
}

.guide-page .ios-brand-kicker {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #475569;
    font-weight: 700;
}

.guide-page .ios-brand-note {
    margin-top: 0.08rem;
    font-size: 0.8rem;
    line-height: 1.4;
    color: #64748b;
}

.guide-page .ios-kpi-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.guide-page .ios-kpi-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(255, 255, 255, 0.88);
    padding: 0.28rem 0.62rem;
    font-size: 0.72rem;
    color: #334155;
    font-weight: 600;
}

.guide-page .ios-onboarding-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
}

.guide-page .ios-step {
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(255, 255, 255, 0.72);
    padding: 1rem 1.05rem;
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.guide-page .ios-step:hover {
    transform: translateY(-1px);
    border-color: rgba(59, 130, 246, 0.32);
    box-shadow: 0 14px 28px -24px rgba(15, 23, 42, 0.55);
}

.guide-page .ios-step-kicker {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    font-weight: 700;
}

.guide-page .ios-step-title {
    margin-top: 0.3rem;
    font-size: 1rem;
    line-height: 1.35;
    letter-spacing: -0.01em;
    color: #0f172a;
    font-weight: 650;
}

.guide-page .ios-step-copy {
    margin-top: 0.45rem;
    font-size: 0.84rem;
    line-height: 1.45;
    color: #334155;
}

.guide-page .ios-step-more {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed rgba(148, 163, 184, 0.35);
}

.guide-page .ios-step-more > summary {
    list-style: none;
    cursor: pointer;
    font-size: 0.74rem;
    color: #1d4ed8;
    font-weight: 600;
}

.guide-page .ios-step-more > summary::-webkit-details-marker {
    display: none;
}

.guide-page .ios-step-more > p {
    margin-top: 0.42rem;
    font-size: 0.74rem;
    line-height: 1.45;
    color: #64748b;
}

.guide-page .ios-side-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    font-weight: 700;
}

.guide-page .guide-nav-link {
    display: block;
    font-size: 0.84rem;
    color: #334155;
    padding: 0.48rem 0.58rem;
    border-radius: 10px;
    transition: background-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
    line-height: 1.35;
}

.guide-page .guide-nav-link:hover {
    background: rgba(59, 130, 246, 0.09);
    color: #0f172a;
    transform: translateX(1px);
}

.guide-page .ios-segment-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 14px;
    padding: 0.38rem;
    background: rgba(255, 255, 255, 0.74);
}

.guide-page .guide-filter-btn {
    font-size: 0.75rem;
    font-weight: 650;
    color: #475569;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 9999px;
    padding: 0.35rem 0.72rem;
    min-height: 2rem;
    transition: all var(--transition-fast);
}

.guide-page .guide-filter-btn:hover {
    border-color: rgba(148, 163, 184, 0.32);
    background: rgba(248, 250, 252, 0.95);
}

.guide-page .guide-filter-btn.is-active {
    background: #0f172a;
    border-color: #0f172a;
    color: #ffffff;
}

.guide-page .guide-check-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.78rem;
    color: #334155;
    line-height: 1.35;
    cursor: pointer;
}

.guide-page .guide-check-row input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: #1d4ed8;
}

.guide-page .guide-filter-help {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    line-height: 1.4;
    color: #64748b;
}

.guide-page .guide-density-btn {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 0.8rem;
    padding: 0.55rem 0.62rem;
    font-size: 0.76rem;
    color: #334155;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.82);
    transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.guide-page .guide-density-btn:hover {
    border-color: rgba(59, 130, 246, 0.38);
    background: rgba(239, 246, 255, 0.65);
}

.guide-page .guide-density-btn[aria-pressed="true"] {
    background: #0f172a;
    border-color: #0f172a;
    color: #ffffff;
}

.guide-page .guide-unlock-status {
    font-size: 0.76rem;
    font-weight: 600;
    color: #334155;
}

.guide-page .guide-helper-copy {
    font-size: 0.8rem;
    line-height: 1.45;
    color: #64748b;
}

.guide-page .guide-unlock-btn {
    width: 100%;
    border: 1px solid rgba(29, 78, 216, 0.25);
    border-radius: 0.8rem;
    background: rgba(239, 246, 255, 0.9);
    color: #1e3a8a;
    font-size: 0.76rem;
    font-weight: 650;
    padding: 0.56rem 0.62rem;
    transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.guide-page .guide-unlock-btn:hover {
    border-color: rgba(29, 78, 216, 0.45);
    background: rgba(219, 234, 254, 0.95);
}

.guide-page .guide-action-link {
    display: block;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 14px;
    padding: 0.7rem 0.78rem;
    font-size: 0.8rem;
    font-weight: 640;
    color: #0f172a;
    transition: border-color var(--transition-fast), background-color var(--transition-fast), transform var(--transition-fast);
}

.guide-page .guide-action-link:hover {
    border-color: rgba(59, 130, 246, 0.35);
    background: rgba(248, 251, 255, 0.95);
    transform: translateY(-1px);
}

.guide-page .guide-action-link span {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.73rem;
    color: #64748b;
    font-weight: 450;
}

.guide-page .ios-section {
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 20px;
    padding: 0.95rem 1rem 1rem;
    background: var(--ios-surface);
    box-shadow: var(--ios-shadow);
}

.guide-page .section-title {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.3;
}

.guide-page .section-subtitle {
    font-size: 0.81rem;
    line-height: 1.4;
}

.guide-page .guide-section-hint {
    margin: -0.25rem 0 0.9rem;
    font-size: 0.8rem;
    color: #475569;
    line-height: 1.5;
}

.guide-page .guide-inline-more {
    margin: -0.1rem 0 0.9rem;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.7);
    padding: 0.5rem 0.7rem;
}

.guide-page .guide-inline-more > summary {
    list-style: none;
    cursor: pointer;
    font-size: 0.78rem;
    color: #1d4ed8;
    font-weight: 600;
}

.guide-page .guide-inline-more > summary::-webkit-details-marker {
    display: none;
}

.guide-page .guide-inline-more .guide-section-hint {
    margin: 0.45rem 0 0;
}

.guide-page .guide-reveal-section {
    position: relative;
    transition: opacity 220ms ease, transform 220ms ease;
}

.guide-page .guide-reveal-section.is-locked {
    opacity: 0.5;
    transform: translateY(8px);
    filter: saturate(0.85);
    pointer-events: none;
}

.guide-page .guide-reveal-section.is-locked::after {
    content: "Scroll to unlock";
    position: absolute;
    inset: 0.9rem;
    border-radius: 14px;
    border: 1px dashed rgba(148, 163, 184, 0.45);
    background: rgba(248, 250, 252, 0.8);
    color: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.74rem;
    font-weight: 600;
}

.guide-page .guide-drilldown-panel {
    margin-top: 1rem;
    border: 1px solid rgba(29, 78, 216, 0.2);
    border-radius: 14px;
    background: linear-gradient(150deg, rgba(239, 246, 255, 0.85), rgba(255, 255, 255, 0.95));
    padding: 0.8rem 0.9rem;
}

.guide-page .guide-drilldown-kicker {
    font-size: 0.64rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #1d4ed8;
    font-weight: 700;
}

.guide-page .guide-drilldown-title {
    margin-top: 0.28rem;
    font-size: 0.92rem;
    color: #0f172a;
    font-weight: 700;
}

.guide-page .guide-drilldown-copy {
    margin-top: 0.28rem;
    font-size: 0.79rem;
    color: #334155;
    line-height: 1.45;
}

.guide-page .guide-drilldown-meta {
    margin-top: 0.22rem;
    font-size: 0.75rem;
    color: #475569;
}

.guide-page .guide-drilldown-link {
    display: inline-flex;
    align-items: center;
    margin-top: 0.45rem;
    font-size: 0.78rem;
    font-weight: 650;
    color: #1d4ed8;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.guide-page .workflow-card {
    overflow: visible;
}

.guide-page .workflow-item > summary {
    list-style: none;
    cursor: pointer;
}

.guide-page .workflow-item > summary::-webkit-details-marker {
    display: none;
}

.guide-page .workflow-item-summary {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1rem 0.95rem;
}

.guide-page .workflow-item-quick {
    margin-top: 0.4rem;
    font-size: 0.78rem;
    line-height: 1.4;
    color: #64748b;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.guide-page .workflow-item-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.guide-page .workflow-item-toggle {
    width: 1rem;
    height: 1rem;
    color: #94a3b8;
    transition: transform var(--transition-fast), color var(--transition-fast);
}

.guide-page .workflow-item[open] .workflow-item-toggle {
    transform: rotate(180deg);
    color: #64748b;
}

.guide-page .workflow-item-body {
    border-top: 1px solid rgba(226, 232, 240, 0.7);
    padding: 0.92rem 1rem 1rem;
}

.guide-page .ios-chip-soft {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    background: rgba(14, 165, 233, 0.12);
    color: #0369a1;
    font-size: 0.68rem;
    padding: 0.2rem 0.48rem;
    font-weight: 600;
}

.guide-page .ios-mini-card {
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.76);
    padding: 0.74rem 0.8rem;
}

.guide-page .ios-mini-card-warning {
    border-color: rgba(245, 158, 11, 0.28);
    background: rgba(255, 251, 235, 0.8);
}

.guide-page .ios-mini-title {
    font-size: 0.82rem;
    line-height: 1.35;
    color: #0f172a;
    font-weight: 650;
}

.guide-page .ios-mini-copy {
    margin-top: 0.3rem;
    font-size: 0.78rem;
    line-height: 1.45;
    color: #475569;
}

.guide-page .ios-mini-hint {
    margin-top: 0.42rem;
    font-size: 0.74rem;
    color: #64748b;
}

.guide-page .ios-mini-more {
    margin-top: 0.52rem;
}

.guide-page .ios-mini-more > summary {
    list-style: none;
    cursor: pointer;
    font-size: 0.74rem;
    color: #1d4ed8;
    font-weight: 600;
}

.guide-page .ios-mini-more > summary::-webkit-details-marker {
    display: none;
}

.guide-page .ios-mini-more > p {
    margin-top: 0.36rem;
    font-size: 0.76rem;
    line-height: 1.45;
    color: #475569;
}

.guide-page .ios-mini-code {
    margin-top: 0.32rem;
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(248, 250, 252, 0.88);
    color: #334155;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.68rem;
    padding: 0.18rem 0.46rem;
}

.guide-page .ios-step-more > summary:focus-visible,
.guide-page .guide-inline-more > summary:focus-visible,
.guide-page .ios-mini-more > summary:focus-visible {
    outline: 2px solid rgba(59, 130, 246, 0.45);
    outline-offset: 2px;
    border-radius: 6px;
}

.guide-page a:focus-visible,
.guide-page button:focus-visible,
.guide-page input:focus-visible,
.guide-page summary:focus-visible {
    outline: 2px solid rgba(37, 99, 235, 0.55);
    outline-offset: 2px;
    border-radius: 6px;
}

.guide-page .ios-signal-row {
    display: grid;
    grid-template-columns: 4.5rem 1fr;
    gap: 0.4rem;
}

.guide-page .ios-signal-row dt {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    font-weight: 650;
}

.guide-page .ios-signal-row dd {
    margin: 0;
    font-size: 0.75rem;
    color: #334155;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.guide-page .ios-link-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.95rem;
}

.guide-page .ios-link-row a {
    font-size: 0.75rem;
    color: #334155;
    font-weight: 600;
}

.guide-page .ios-link-row a:hover {
    color: #0f172a;
}

.guide-page .ios-table-wrap {
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.8);
}

.guide-page .guide-flow-card {
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.82);
    padding: 0.72rem 0.78rem;
}

.guide-page .guide-flow-card > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
}

.guide-page .guide-flow-card > summary::-webkit-details-marker {
    display: none;
}

.guide-page .guide-flow-title {
    font-size: 0.82rem;
    color: #0f172a;
    font-weight: 650;
    line-height: 1.35;
}

.guide-page .guide-flow-count {
    font-size: 0.72rem;
    color: #475569;
    border-radius: 9999px;
    border: 1px solid rgba(148, 163, 184, 0.32);
    padding: 0.18rem 0.52rem;
    background: rgba(248, 250, 252, 0.94);
}

.guide-page .guide-flow-steps {
    margin-top: 0.64rem;
    padding-left: 1.15rem;
    display: grid;
    gap: 0.45rem;
}

.guide-page .guide-flow-steps li {
    font-size: 0.76rem;
    color: #334155;
    line-height: 1.45;
}

.guide-page .guide-faq-item {
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.84);
    padding: 0.1rem 0.78rem 0.2rem;
}

.guide-page .guide-faq-summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    padding: 0.56rem 0;
    font-size: 0.82rem;
    color: #0f172a;
    font-weight: 620;
}

.guide-page .guide-faq-summary::-webkit-details-marker {
    display: none;
}

.guide-page .guide-faq-toggle {
    width: 1rem;
    height: 1rem;
    color: #64748b;
    flex-shrink: 0;
    transition: transform var(--transition-fast), color var(--transition-fast);
}

.guide-page .guide-faq-item[open] .guide-faq-toggle {
    transform: rotate(180deg);
    color: #334155;
}

.guide-page .guide-faq-body {
    border-top: 1px solid rgba(226, 232, 240, 0.9);
    margin-top: 0.1rem;
    padding-top: 0.52rem;
    padding-bottom: 0.45rem;
    display: grid;
    gap: 0.36rem;
}

.guide-page .guide-faq-body p {
    font-size: 0.77rem;
    color: #334155;
    line-height: 1.45;
}

.guide-page .guide-empty-reset {
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 0.7rem;
    background: rgba(255, 255, 255, 0.9);
    color: #334155;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    transition: border-color var(--transition-fast), background-color var(--transition-fast), color var(--transition-fast);
}

.guide-page .guide-empty-reset:hover {
    border-color: rgba(59, 130, 246, 0.4);
    background: rgba(239, 246, 255, 0.72);
    color: #1e3a8a;
}

.guide-page .ios-hover-wrap {
    position: relative;
}

.guide-page .ios-info-dot {
    width: 1.55rem;
    height: 1.55rem;
    border-radius: 9999px;
    border: 1px solid rgba(148, 163, 184, 0.32);
    background: rgba(248, 250, 252, 0.98);
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
}

.guide-page .ios-info-dot:hover {
    border-color: rgba(59, 130, 246, 0.4);
    color: #1d4ed8;
}

.guide-page .ios-hover-peek {
    position: absolute;
    top: 1.65rem;
    right: 0;
    width: min(320px, 68vw);
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 20px 30px -20px rgba(15, 23, 42, 0.55);
    padding: 0.72rem 0.78rem;
    z-index: 20;
    opacity: 0;
    transform: translateY(6px);
    pointer-events: none;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.guide-page .ios-hover-wrap:hover .ios-hover-peek,
.guide-page .ios-hover-wrap:focus-within .ios-hover-peek {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.guide-page .ios-hover-title {
    font-size: 0.71rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    font-weight: 700;
}

.guide-page .ios-hover-copy {
    margin-top: 0.3rem;
    font-size: 0.76rem;
    line-height: 1.45;
    color: #334155;
}

.guide-page .ios-hover-meta {
    margin-top: 0.32rem;
    font-size: 0.72rem;
    color: #475569;
}

.guide-page .ios-hover-meta span {
    font-weight: 650;
    color: #334155;
}

.guide-page.guide-compact .workflow-item-summary {
    padding: 0.74rem 0.82rem 0.68rem;
}

.guide-page.guide-compact .workflow-item-body {
    padding: 0.74rem 0.82rem 0.78rem;
}

.guide-page.guide-compact .ios-mini-card {
    padding: 0.6rem 0.68rem;
}

.guide-page.guide-compact .ios-mini-copy,
.guide-page.guide-compact .ios-mini-hint {
    font-size: 0.68rem;
}

.guide-page .guide-focus-pulse {
    animation: guide-focus-pulse 850ms ease-out;
}

@keyframes guide-focus-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.42);
        transform: translateY(0);
    }
    100% {
        box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
        transform: translateY(-1px);
    }
}

@media (max-width: 1200px) {
    .guide-page .ios-onboarding-grid {
        grid-template-columns: 1fr;
    }

    .guide-page .ios-onboarding-head {
        padding-bottom: 0.6rem;
    }

    .guide-page .guide-reveal-section.is-locked::after {
        inset: 0.75rem;
    }
}

@media (max-width: 768px) {
    .guide-header-tools {
        justify-content: flex-start;
    }

    #guide-search.guide-header-search {
        width: min(17.5rem, 72vw);
    }

    .guide-page .ios-onboarding {
        padding: 0.75rem;
    }

    .guide-page .ios-onboarding-head {
        padding: 0.35rem 0.35rem 0.7rem;
        align-items: flex-start;
        gap: 0.65rem;
    }

    .guide-page .ios-kpi-pill {
        font-size: 0.75rem;
        padding: 0.32rem 0.64rem;
    }

    .guide-page .ios-step {
        padding: 0.92rem 0.95rem;
    }

    .guide-page .ios-step-copy {
        font-size: 0.86rem;
    }

    .guide-page .section-title {
        font-size: 1rem;
    }

    .guide-page .section-subtitle {
        font-size: 0.86rem;
    }

    .guide-page .guide-nav-link {
        font-size: 0.88rem;
        padding: 0.56rem 0.62rem;
    }

    .guide-page .guide-filter-btn {
        font-size: 0.78rem;
        min-height: 2.25rem;
        padding: 0.42rem 0.78rem;
    }

    .guide-page .guide-check-row {
        font-size: 0.84rem;
    }

    .guide-page .guide-density-btn,
    .guide-page .guide-unlock-btn {
        font-size: 0.8rem;
        min-height: 2.25rem;
    }

    .guide-page .guide-action-link {
        font-size: 0.84rem;
        padding: 0.8rem 0.84rem;
    }

    .guide-page .guide-action-link span {
        font-size: 0.76rem;
    }

    .guide-page .workflow-item-summary {
        flex-direction: column;
        gap: 0.7rem;
        padding: 0.92rem 0.92rem 0.84rem;
    }

    .guide-page .workflow-item-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .guide-page .workflow-item-quick {
        font-size: 0.82rem;
        -webkit-line-clamp: 3;
    }

    .guide-page .workflow-item-body {
        padding: 0.86rem 0.92rem 0.96rem;
    }

    .guide-page .ios-mini-card {
        padding: 0.82rem 0.88rem;
    }

    .guide-page .ios-mini-title {
        font-size: 0.86rem;
    }

    .guide-page .ios-mini-copy {
        font-size: 0.8rem;
    }

    .guide-page .ios-link-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .guide-page .ios-link-row a {
        font-size: 0.8rem;
        display: inline-flex;
        padding: 0.2rem 0;
    }

    .guide-page .guide-drilldown-panel {
        padding: 0.88rem 0.94rem;
    }

    .guide-page .guide-drilldown-title {
        font-size: 0.95rem;
    }

    .guide-page .guide-drilldown-copy {
        font-size: 0.8rem;
    }

    .guide-page .guide-drilldown-meta {
        font-size: 0.78rem;
    }

    .guide-page .ios-hover-peek {
        position: fixed;
        right: 0.9rem;
        left: 0.9rem;
        top: auto;
        bottom: 1rem;
        width: auto;
    }

    .guide-page .guide-faq-summary {
        align-items: flex-start;
        padding: 0.66rem 0;
    }

    .guide-page .guide-empty-reset {
        width: 100%;
        max-width: 13rem;
    }

    .guide-page .guide-reveal-section.is-locked::after {
        font-size: 0.72rem;
    }
}

/* ── Page Intro ────────────────────────────────────────── */
.page-intro {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid var(--card-border);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
}

.page-intro__eyebrow {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    font-weight: 600;
    margin-bottom: var(--space-2);
}

.page-intro__title {
    font-size: 1.5rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: #0f172a;
    font-weight: 700;
}

.page-intro__summary {
    margin-top: var(--space-3);
    max-width: 70ch;
    color: #334155;
    font-size: 0.9375rem;
    line-height: 1.6;
}

.page-intro__hint {
    margin-top: var(--space-4);
    font-size: 0.75rem;
    color: #64748b;
}

.page-intro__details {
    margin-top: var(--space-3);
}

.page-intro__details > summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 620;
    color: var(--accent-primary);
    user-select: none;
}

.page-intro__details > summary::-webkit-details-marker {
    display: none;
}

.page-intro__details > summary::after {
    content: '';
    width: 0.6rem;
    height: 0.6rem;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translateY(-1px);
    transition: transform var(--transition-fast);
}

.page-intro__details[open] > summary::after {
    transform: rotate(225deg) translateY(-1px);
}

.page-intro__details .page-intro__summary {
    margin-top: var(--space-2);
}

.page-intro__details .page-intro__hint {
    margin-top: var(--space-2);
}

/* ── Guidance Callouts ─────────────────────────────────── */
.help-callout {
    border: 1px solid var(--tone-neutral-border);
    background: var(--tone-neutral-bg);
    border-radius: 10px;
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.help-callout--info {
    border-color: var(--tone-info-border);
    background: var(--tone-info-bg);
    color: var(--tone-info-text);
}

.help-callout--success {
    border-color: var(--tone-success-border);
    background: var(--tone-success-bg);
    color: var(--tone-success-text);
}

.help-callout--warning {
    border-color: var(--tone-warning-border);
    background: var(--tone-warning-bg);
    color: var(--tone-warning-text);
}

.help-callout--danger {
    border-color: var(--tone-danger-border);
    background: var(--tone-danger-bg);
    color: var(--tone-danger-text);
}

.help-callout__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
}

.help-callout__title {
    font-size: 0.8125rem;
    font-weight: 700;
    color: inherit;
    letter-spacing: -0.01em;
}

.help-callout__badge {
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: rgba(15, 23, 42, 0.06);
    color: inherit;
    border-radius: 9999px;
    padding: 0.2rem 0.5rem;
    font-weight: 600;
}

.help-callout__body {
    font-size: 0.8125rem;
    line-height: 1.55;
    color: inherit;
}

.help-callout__link {
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    color: inherit;
}

.help-callout__link:hover {
    opacity: 0.9;
}

.help-callout__footnote {
    font-size: 0.6875rem;
    opacity: 0.9;
}

/* ── Cards ─────────────────────────────────────────────── */
.dash-card {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition:
        box-shadow var(--transition-fast) cubic-bezier(0.4, 0, 0.2, 1),
        border-color var(--transition-fast) cubic-bezier(0.4, 0, 0.2, 1),
        transform var(--transition-fast) cubic-bezier(0.4, 0, 0.2, 1);
}

.dash-card:hover {
    box-shadow: var(--card-shadow-hover);
}

/* Clickable cards get subtle lift */
a.dash-card:hover,
.dash-card[hx-get]:hover {
    transform: translateY(-1px);
}

a.dash-card:active,
.dash-card[hx-get]:active {
    transform: translateY(0) scale(0.995);
    transition-duration: 80ms;
}

.dash-card-link {
    transition:
        box-shadow var(--transition-fast) cubic-bezier(0.4, 0, 0.2, 1),
        border-color var(--transition-fast) cubic-bezier(0.4, 0, 0.2, 1),
        transform var(--transition-fast) cubic-bezier(0.4, 0, 0.2, 1);
}

.dash-card-link:hover {
    box-shadow: var(--card-shadow-hover);
    border-color: #bfdbfe;
    transform: translateY(-1px);
}

.dash-card-link:active {
    transform: translateY(0) scale(0.995);
    box-shadow: var(--card-shadow);
    transition-duration: 80ms;
}

/* Button press feedback */
button, .btn, [type="submit"], [role="button"] {
    transition:
        background-color var(--transition-fast) cubic-bezier(0.4, 0, 0.2, 1),
        color var(--transition-fast) cubic-bezier(0.4, 0, 0.2, 1),
        transform 80ms cubic-bezier(0.4, 0, 0.2, 1);
}

button:active, .btn:active, [type="submit"]:active {
    transform: scale(0.97);
}

/* Card accent borders */
.card-accent-blue { border-left: 3px solid var(--accent-info); }
.card-accent-green { border-left: 3px solid #059669; }
.card-accent-red { border-left: 3px solid var(--accent-danger); }
.card-accent-warning { border-left: 3px solid var(--accent-warning); }
.card-accent-purple { border-left: 3px solid #6366f1; }
.card-accent-gray { border-left: 3px solid #64748b; }
.card-accent-teal { border-left: 3px solid var(--accent-primary); }
.card-accent-amber { border-left: 3px solid #c2410c; }
.card-accent-slate { border-left: 3px solid var(--accent-neutral); }
.card-accent-rose { border-left: 3px solid #be123c; }

/* Stat card value typography
 * Type scale (consistent across all components):
 *   Labels/metas:  0.6875rem (11px)
 *   Small body:    0.75rem   (12px)
 *   Body/titles:   0.8125rem (13px)
 *   Stat values:   1.5rem    (24px, Tailwind text-2xl)
 *   Page title:    1.5rem    (24px)
 */
.stat-value {
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.025em;
    font-feature-settings: "tnum";
}

/* ── Clickable stat card drill-down buttons ──────────── */
.stat-drill-btn {
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    width: 100%;
    transition: transform 0.15s ease, filter 0.15s ease;
}
.stat-drill-btn:hover {
    transform: translateY(-2px);
}
.stat-drill-btn:hover .dash-card {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08), 0 0 0 2px rgba(99,102,241,0.15);
}
.stat-drill-btn:active {
    transform: translateY(0);
}

#stat-drilldown:not(:empty) {
    animation: fadeSlideDown 0.25s ease;
}
#stat-drilldown > :not(.htmx-indicator) {
    background: #fff;
    border: 1px solid #dbe5f0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    padding: 1rem 1.25rem;
}
@keyframes fadeSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Metric Info Toggles ─────────────────────────────── */
.metric-info-toggle:hover svg { color: #6366f1; }
.metric-info-text { animation: fadeSlideDown 0.2s ease; }

/* ── Executive Summary Interactive ───────────────────── */
.exec-sentence {
    cursor: pointer;
    border-radius: 4px;
    padding: 1px 2px;
    margin: 0 -2px;
    transition: background 0.15s ease, color 0.15s ease;
}
.exec-sentence:hover {
    background: rgba(99,102,241,0.08);
    color: #4338ca;
}
.exec-sentence::after {
    content: '';
    display: inline-block;
    width: 3px;
    height: 3px;
    background: #c7d2fe;
    border-radius: 50%;
    margin-left: 4px;
    vertical-align: middle;
}
.exec-sentence:last-child::after { display: none; }

/* ── Chart Containers ──────────────────────────────────── */
.chart-panel {
    background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
    border: 1px solid #dbe5f0;
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    padding: 1.125rem 1.25rem;
    transition: box-shadow var(--transition-normal), border-color var(--transition-fast);
}

.chart-panel:hover {
    box-shadow: var(--card-shadow-hover);
    border-color: #c7d6e6;
}

.chart-panel-title {
    font-size: 0.8125rem;
    font-weight: 650;
    letter-spacing: -0.01em;
    color: #1e293b;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-panel-subtitle {
    font-size: 0.6875rem;
    color: #64748b;
    margin-top: -0.25rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.chart-panel-note {
    margin-top: 0.625rem;
    font-size: 0.6875rem;
    line-height: 1.4;
    color: #64748b;
}

.chart-panel-note + .chart-panel-note {
    margin-top: 0.25rem;
}

.chart-panel-title::before {
    content: '';
    width: 3px;
    height: 16px;
    background: var(--accent-primary);
    border-radius: 2px;
    flex-shrink: 0;
}

/* ── Drilldown Detail Views ───────────────────────────── */
.drilldown-shell {
    --drill-primary: #0f766e;
    --drill-primary-strong: #115e59;
    --drill-warm: #b45309;
    --drill-neutral: #475569;
}

.drilldown-shell .drilldown-hero {
    background: #fcfffe;
    border-color: #d2e8e3;
    box-shadow: 0 6px 18px rgba(15, 118, 110, 0.05);
}

.drilldown-shell .drilldown-hero--warning {
    background: #fffcf3;
    border-color: #f5ddb4;
    box-shadow: 0 6px 18px rgba(180, 83, 9, 0.05);
}

.drilldown-shell .drill-kicker {
    color: #0f766e;
}

.drilldown-shell .drill-meta {
    color: #334155;
}

.drilldown-shell nav[aria-label="Breadcrumb"] a:hover {
    color: #0f766e;
}

.drill-status {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.24rem 0.62rem;
    border-radius: 9999px;
    border: 1px solid transparent;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
}

.drill-status--ok {
    background: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
}

.drill-status--live {
    background: #fffbeb;
    color: #b45309;
    border-color: #fde68a;
}

.drill-status--issue {
    background: #fff1f2;
    color: #be123c;
    border-color: #fecdd3;
}

.drill-status--neutral {
    background: #f1f5f9;
    color: #475569;
    border-color: #dbe3ec;
}

.drill-action-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 0.5rem;
    border: 1px solid #0f766e;
    background: #0f766e;
    color: #ffffff;
    transition: background-color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.drill-action-primary:hover {
    background: #115e59;
    border-color: #115e59;
}

.drill-action-primary:active {
    transform: translateY(0.5px);
}

.drill-action-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 0.5rem;
    border: 1px solid #cbd5e1;
    color: #334155;
    background: #ffffff;
    transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.drill-action-secondary:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}

.drill-link {
    color: #0f766e;
    font-weight: 600;
    text-decoration: none;
}

.drill-link:hover {
    color: #115e59;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.drill-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 0.42rem;
    border: 1px solid #dbe3ec;
    background: #f8fafc;
    color: #475569;
}

.drill-chip--total {
    border-color: #a7f3d0;
    background: #ecfdf5;
    color: #047857;
}

.drilldown-shell .chart-panel-title::before {
    background: linear-gradient(180deg, #0f766e 0%, #b45309 100%);
}

.chart-container {
    position: relative;
    width: 100%;
    min-height: 260px;
}

/* ── Data Tables ───────────────────────────────────────── */
.data-table {
    width: 100%;
    font-size: 0.8125rem;
}

.data-table thead th {
    font-weight: 600;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #56627a;
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid #d9e3ef;
    white-space: nowrap;
    position: sticky;
    top: 0;
    background: #f8fafc;
    z-index: 1;
}

.data-table tbody td {
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid #edf2f7;
    color: #334155;
    font-size: 0.8125rem;
}

.data-table tbody tr {
    transition: background-color var(--transition-fast);
}

.data-table tbody tr:hover {
    background-color: #f5f9fd;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Clickable table rows */
.data-table tbody tr.cursor-pointer:hover {
    background-color: #e9fbf5;
}

.data-table tbody tr.cursor-pointer:active {
    background-color: #d8f5ea;
}

/* Sortable table headers */
.data-table thead th.sortable {
    cursor: pointer;
    user-select: none;
}

.data-table thead th.sortable:hover {
    color: #1e293b;
    background: #f1f6fb;
}

/* ── Gauge Cards ───────────────────────────────────────── */
.gauge-wrapper {
    position: relative;
    display: inline-block;
    overflow: hidden;
}

/* ── Filter Bar Pills ──────────────────────────────────── */
.filter-pill {
    min-height: 1.84rem;
    padding: 0.3rem 0.72rem;
    border-radius: 9999px;
    font-size: 0.69rem;
    font-weight: 560;
    transition: background-color var(--transition-fast),
        color var(--transition-fast),
        border-color var(--transition-fast),
        box-shadow var(--transition-fast),
        transform var(--transition-fast);
    border: 1px solid #d6e0ec;
    background: #ffffff;
    white-space: nowrap;
    cursor: pointer;
    outline: none;
}

.filter-pill-inactive {
    background: #ffffff;
    color: #334155;
    border-color: #d6e0ec;
}

.filter-pill-inactive:hover {
    background: #f6f9fc;
    color: #1f2937;
    border-color: #c4d2e2;
}

.filter-pill-active {
    background: linear-gradient(180deg, var(--accent-primary) 0%, var(--accent-primary-strong) 100%);
    color: #ffffff;
    border-color: var(--accent-primary-strong);
    box-shadow: 0 0 0 1px rgba(15, 118, 110, 0.18), 0 4px 8px rgba(15, 118, 110, 0.18);
    font-weight: 600;
}

.filter-pill-active:hover {
    background: linear-gradient(180deg, #0d6b64 0%, #114f4b 100%);
}

.filter-pill:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

/* Range label tooltip on pill */
.filter-pill-active .range-label {
    font-weight: 400;
    opacity: 0.85;
    margin-left: 0.25rem;
}

/* ── Fiscal Period Dropdown ───────────────────────────── */
.fiscal-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #334155;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.1s;
}
.fiscal-menu-item:hover {
    background: #f1f5f9;
    color: #0f172a;
}
.fiscal-menu-active {
    background: #f0fdf4;
    color: var(--accent-primary);
    font-weight: 600;
}
.fiscal-menu-hint {
    font-size: 0.625rem;
    font-weight: 400;
    color: #94a3b8;
    margin-left: 0.5rem;
}
[data-theme="dark"] .fiscal-menu-item { color: #a1a1a6; }
[data-theme="dark"] .fiscal-menu-item:hover { background: #2c2c2e; color: #f5f5f7; }
[data-theme="dark"] .fiscal-menu-active { background: #1a2a1f; color: #34d399; }
[data-theme="dark"] .fiscal-menu-hint { color: #6e6e73; }
[data-theme="dark"] [data-fiscal-menu] { background: #1c1c1e; border-color: #38383a; }

/* ── Custom Date Range Picker ──────────────────────────── */
.custom-range-picker {
    min-width: min(19rem, calc(100vw - 2rem));
    border: 1px solid var(--border-default);
    border-radius: 0.75rem;
    background: var(--surface-elevated);
    box-shadow: 0 18px 40px -28px rgba(15, 23, 42, 0.4);
    padding: 0.75rem;
    align-items: flex-end;
    gap: 0.5rem;
}

.custom-range-picker:not(.hidden) {
    display: flex;
}

.custom-range-field {
    flex: 1;
    min-width: 6.5rem;
}

.custom-range-label {
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
}

.custom-range-input {
    width: 100%;
    border: 1px solid #cdd8e6;
    border-radius: 0.5rem;
    background: var(--surface-elevated);
    color: var(--text-primary);
    font-size: 0.75rem;
    padding: 0.42rem 0.56rem;
}

.custom-range-input:hover {
    border-color: #aebfd3;
}

.custom-range-input:focus {
    border-color: var(--focus-ring);
    box-shadow: 0 0 0 2px rgba(3, 105, 161, 0.14);
    outline: none;
}

.custom-range-apply {
    min-height: 1.84rem;
    padding: 0.36rem 0.72rem;
    border-radius: 0.5rem;
    border: 1px solid var(--accent-primary);
    background: var(--accent-primary);
    color: #ffffff;
    font-size: 0.74rem;
    font-weight: 620;
    transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.custom-range-apply:hover {
    background: var(--accent-primary-strong);
    border-color: var(--accent-primary-strong);
}

.custom-range-backdrop {
    position: fixed;
    inset: 0;
    z-index: 125;
    background: rgba(15, 23, 42, 0.38);
    backdrop-filter: blur(1.5px);
    -webkit-backdrop-filter: blur(1.5px);
}

/* ── Workspace Preset Buttons ────────────────────────── */
.preset-btn {
    padding: 0.375rem 0.875rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
    white-space: nowrap;
    cursor: pointer;
    background: #f1f5f9;
    color: #64748b;
}

.preset-btn:hover,
.preset-btn-inactive:hover {
    background: #e2e8f0;
    color: #334155;
}

.preset-btn-active {
    background: var(--accent-primary);
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(15, 118, 110, 0.34);
}

/* ── Tab Buttons ─────────────────────────────────────── */
.tab-btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
    cursor: pointer;
    background: none;
    color: #64748b;
}

.tab-btn:hover {
    color: #334155;
    border-bottom-color: #cbd5e1;
}

.tab-btn-active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.tab-btn[aria-selected="true"] {
    color: var(--accent-primary);
}

.tab-btn:focus-visible {
    outline-offset: -1px;
}

.tab-btn-inactive {
    color: #64748b;
    border-bottom-color: transparent;
}

/* ── Active Filter Chips ──────────────────────────────── */
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.32rem 0.7rem;
    background: #ecfdf8;
    border: 1px solid #b4ede1;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 560;
    color: #0f5f5c;
    transition: all var(--transition-fast);
}

.filter-chip:hover {
    background: #dbf7ef;
    border-color: #76d9bd;
}

.filter-chip .chip-remove {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: transparent;
    color: #0f766e;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-chip .chip-remove:hover {
    background: var(--accent-primary);
    color: #ffffff;
}

/* ── Active Filter Summary ─────────────────────────────── */
.active-filters-details {
    width: 100%;
    border: 1px solid #dbe3ee;
    border-radius: 0.75rem;
    background: #ffffff;
    padding: 0.35rem 0.5rem;
}

.active-filters-details.filter-state-engaged {
    border-color: #99f6e4;
    background: linear-gradient(180deg, #ffffff 0%, #f0fdfa 100%);
    box-shadow: inset 0 0 0 1px rgba(20, 184, 166, 0.08);
}

.active-filters-details > summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.71rem;
    color: #475569;
    font-weight: 620;
    user-select: none;
}

.active-filters-details.filter-state-engaged > summary {
    color: #0f766e;
}

.active-filters-details > summary::-webkit-details-marker {
    display: none;
}

.active-filters-details > summary::before {
    content: '';
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 9999px;
    background: #f59e0b;
}

.active-filters-details.filter-state-engaged > summary::before {
    background: #0f766e;
}

.active-filters-compact {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.active-filters-compact .filter-chip {
    padding: 0.22rem 0.56rem;
    font-size: 0.66rem;
}

.active-filters-clear {
    font-size: 0.68rem;
    color: #b91c1c;
    font-weight: 620;
    margin-left: auto;
}

.active-filters-clear:hover {
    color: #991b1b;
    text-decoration: underline;
}

/* ── Filter Form Compact ──────────────────────────────── */
.filter-form-compact {
    row-gap: 0.5rem;
    column-gap: 0.5rem;
}

.filter-form-compact .filter-field-active > label {
    color: #0f766e;
    font-weight: 640;
}

.filter-form-compact .filter-field-active > label::after {
    content: "active";
    display: inline-flex;
    align-items: center;
    margin-left: 0.25rem;
    padding: 0 0.28rem;
    border-radius: 9999px;
    background: #ccfbf1;
    color: #0f766e;
    font-size: 0.54rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.3;
    vertical-align: middle;
}

.filter-form-compact .filter-input.is-active-filter {
    border-color: #14b8a6;
    background: #f0fdfa;
    box-shadow: 0 0 0 1px rgba(20, 184, 166, 0.1);
}

.filter-form-compact .filter-input.is-active-filter:hover {
    border-color: #0f766e;
    background: #ecfdf5;
}

.filter-form-compact .filter-input[multiple].is-active-filter {
    background: #f8fffe;
}

.filter-form-compact .filter-input[multiple].is-active-filter option {
    padding: 0.12rem 0.25rem;
}

.filter-form-compact .filter-input[multiple].is-active-filter option:checked {
    color: #ffffff;
    background: linear-gradient(180deg, #0f766e 0%, #115e59 100%);
    font-weight: 620;
}

/* Multi-select: compact and uniform */
.filter-form-compact .filter-input[multiple] {
    min-height: 0;
    height: auto;
    padding: 0.15rem 0.2rem;
    font-size: 0.7rem;
    line-height: 1.3;
}

.filter-form-compact .filter-input[multiple] option {
    padding: 0.15rem 0.3rem;
    border-radius: 0.2rem;
}

.filter-form-compact .filter-input[multiple] option:checked {
    color: #ffffff;
    background: linear-gradient(180deg, #0f766e 0%, #115e59 100%);
    font-weight: 600;
}

/* Filter labels: tighter */
.filter-label {
    display: block;
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.2rem;
    line-height: 1;
}

/* Filter panel wrapper */
.filter-panel {
    border: 1px solid var(--border-default);
    border-radius: var(--card-radius);
    background: var(--surface-elevated);
    box-shadow: var(--card-shadow);
}

.filter-panel-body {
    padding: 0.6rem 0.75rem;
}

/* Filter toggle (collapsible) */
.filter-toggle-summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    font-size: 0.7rem;
    font-weight: 620;
    color: var(--text-muted);
    user-select: none;
    border-bottom: 1px solid transparent;
    transition: all var(--transition-fast);
}

.filter-toggle-summary:hover {
    color: var(--text-secondary);
}

.filter-toggle-summary::-webkit-details-marker {
    display: none;
}

details[open] > .filter-toggle-summary {
    border-bottom-color: var(--border-default);
}

.filter-toggle-icon {
    width: 14px;
    height: 14px;
    color: #94a3b8;
    transition: transform 200ms ease;
}

details[open] > .filter-toggle-summary .filter-toggle-icon {
    transform: rotate(180deg);
}

/* Apply button: compact */
.filter-apply-btn {
    padding: 0.34rem 0.85rem;
    font-size: 0.72rem;
    font-weight: 620;
    border-radius: 0.375rem;
    background: var(--accent-primary);
    color: #ffffff;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.filter-apply-btn:hover {
    background: var(--accent-primary-strong);
}

.filter-apply-btn:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

/* CSV export button: compact */
.filter-export-btn {
    padding: 0.34rem 0.6rem;
    font-size: 0.68rem;
    font-weight: 560;
    border-radius: 0.375rem;
    border: 1px solid var(--border-default);
    background: var(--surface-elevated);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
}

.filter-export-btn:hover {
    background: var(--surface-muted);
    border-color: #cbd5e1;
}

.filter-export-btn svg {
    width: 13px;
    height: 13px;
}

/* ── Slide-over ────────────────────────────────────────── */
#slide-over-panel {
    box-shadow: -20px 0 60px -12px rgba(0, 0, 0, 0.25);
}

/* ── Pagination ────────────────────────────────────────── */
.pagination-btn {
    padding: 0.375rem 0.75rem;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 500;
    border: 1px solid #e2e8f0;
    color: #475569;
    transition: all var(--transition-fast);
}

.pagination-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.pagination-btn-active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #ffffff;
}

.pagination-btn-active:hover {
    background: var(--accent-primary-strong);
    border-color: var(--accent-primary-strong);
}

.drill-row-hover:hover {
    background: #f8fafc;
}

.drill-row-hover:active {
    background: #eef2f7;
}

.drill-quickview {
    border-radius: 0.5rem;
    color: #94a3b8;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.drill-quickview:hover {
    background: #e6fffb;
    color: #0f766e;
}

/* ── Section Headers ───────────────────────────────────── */
.section-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    margin-top: 0.5rem;
}

.section-divider h3 {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    white-space: nowrap;
}

.section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

/* ── Scrollbar (Main Content) ──────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ── Details/Summary ───────────────────────────────────── */
details.dash-card > summary {
    cursor: pointer;
    list-style: none;
}

details.dash-card > summary::-webkit-details-marker {
    display: none;
}

details.dash-card > summary::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 8px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-size: contain;
    transition: transform var(--transition-fast);
    vertical-align: middle;
}

details[open].dash-card > summary::after {
    transform: rotate(180deg);
}

/* ── Stat Value Animations ─────────────────────────────── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeInUp 0.3s ease-out both;
}

/* Staggered card entrance */
.grid > .dash-card:nth-child(1),
.grid > a.dash-card:nth-child(1) { animation-delay: 0ms; }
.grid > .dash-card:nth-child(2),
.grid > a.dash-card:nth-child(2) { animation-delay: 50ms; }
.grid > .dash-card:nth-child(3),
.grid > a.dash-card:nth-child(3) { animation-delay: 100ms; }
.grid > .dash-card:nth-child(4),
.grid > a.dash-card:nth-child(4) { animation-delay: 150ms; }
.grid > .dash-card:nth-child(5),
.grid > a.dash-card:nth-child(5) { animation-delay: 200ms; }

/* ── Progress Bars (driver performance) ────────────────── */
.progress-track {
    height: 6px;
    border-radius: 3px;
    background: #e2e8f0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease-out;
}

/* ── Sales Pipeline Funnel ────────────────────────────── */
.funnel-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.funnel-stage {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    transition: transform var(--transition-fast);
}

.funnel-stage:hover {
    transform: translateX(2px);
}

.funnel-label {
    width: 140px;
    flex-shrink: 0;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #334155;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.funnel-bar-track {
    flex: 1;
    height: 32px;
    border-radius: 6px;
    background: #f1f5f9;
    overflow: hidden;
    position: relative;
}

.funnel-bar {
    height: 100%;
    border-radius: 6px;
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    min-width: 40px;
    transition: width 0.6s ease-out;
}

.funnel-bar-value {
    font-size: 0.75rem;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.funnel-amount {
    width: 100px;
    flex-shrink: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #475569;
    text-align: right;
}

@media (max-width: 768px) {
    .funnel-label {
        width: 80px;
        font-size: 0.6875rem;
    }
    .funnel-amount {
        width: 70px;
        font-size: 0.6875rem;
    }
    .funnel-bar-track {
        height: 26px;
    }
}

/* ── Scroll-to-Top Button ─────────────────────────────── */
.scroll-to-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    color: #64748b;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all var(--transition-normal);
    z-index: 40;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background: #f8fafc;
    color: #3b82f6;
    border-color: #bfdbfe;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.12);
}

/* ── Keyboard Shortcut Hints ──────────────────────────── */
.kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.125rem 0.375rem;
    font-size: 0.625rem;
    font-family: inherit;
    font-weight: 500;
    color: #94a3b8;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    line-height: 1;
    min-width: 1.25rem;
}

/* ── Form Inputs (list page filters) ──────────────────── */
.filter-input {
    width: 100%;
    border-radius: 0.375rem;
    border: 1px solid var(--border-default);
    font-size: 0.75rem;
    padding: 0.34rem 0.5rem;
    background: var(--surface-elevated);
    color: var(--text-primary);
    transition: all var(--transition-fast);
    line-height: 1.4;
}

.filter-input:hover {
    border-color: #cbd5e1;
}

.filter-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.12);
}

.filter-input::placeholder {
    color: #94a3b8;
    font-size: 0.7rem;
}

/* Search input with icon */
.search-input-wrapper {
    position: relative;
}

.search-input-wrapper .search-icon {
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: #94a3b8;
    pointer-events: none;
}

.search-input-wrapper .filter-input {
    padding-left: 1.75rem;
}

/* ── Empty States ─────────────────────────────────────── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    color: #94a3b8;
    text-align: center;
}

.empty-state-card {
    display: flex;
    gap: var(--space-3);
    align-items: flex-start;
    border: 1px solid var(--tone-neutral-border);
    background: #ffffff;
    border-radius: 10px;
    padding: var(--space-4);
}

.empty-state-card__icon {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    background: #f1f5f9;
    flex-shrink: 0;
}

.empty-state-card__icon svg {
    width: 1rem;
    height: 1rem;
}

.empty-state-card__title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #1e293b;
}

.empty-state-card__message {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #64748b;
}

.empty-state-card__action {
    margin-top: 0.5rem;
    display: inline-flex;
    font-size: 0.75rem;
    font-weight: 600;
    color: #1d4ed8;
}

.empty-state-card__action:hover {
    text-decoration: underline;
}

.empty-state-card--warning {
    border-color: var(--tone-warning-border);
    background: var(--tone-warning-bg);
}

.empty-state-card--danger {
    border-color: var(--tone-danger-border);
    background: var(--tone-danger-bg);
}

.empty-state-card--success {
    border-color: var(--tone-success-border);
    background: var(--tone-success-bg);
}

.empty-state svg {
    width: 2.5rem;
    height: 2.5rem;
    margin-bottom: 0.75rem;
    color: #cbd5e1;
}

/* ── Badge / Status Pills ─────────────────────────────── */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.15rem 0.55rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge__dot {
    width: 0.38rem;
    height: 0.38rem;
    border-radius: 9999px;
    background: currentColor;
}

.status-badge--success {
    background: var(--tone-success-bg);
    color: var(--tone-success-text);
    border: 1px solid var(--tone-success-border);
}

.status-badge--warning {
    background: var(--tone-warning-bg);
    color: var(--tone-warning-text);
    border: 1px solid var(--tone-warning-border);
}

.status-badge--danger {
    background: var(--tone-danger-bg);
    color: var(--tone-danger-text);
    border: 1px solid var(--tone-danger-border);
}

.status-badge--info {
    background: var(--tone-info-bg);
    color: var(--tone-info-text);
    border: 1px solid var(--tone-info-border);
}

.status-badge--neutral {
    background: var(--tone-neutral-bg);
    color: #475569;
    border: 1px solid var(--tone-neutral-border);
}

.status-badge--muted {
    opacity: 0.8;
}

/* ── Tooltip ──────────────────────────────────────────── */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    padding: 0.375rem 0.625rem;
    background: var(--chart-tooltip-bg);
    color: var(--chart-tooltip-text);
    font-size: 0.6875rem;
    font-weight: 500;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    pointer-events: none;
    z-index: 50;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-8px);
}

/* ── Mobile Improvements ───────────────────────────────── */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 272px;
        --header-height: 48px;
    }

    html {
        scroll-padding-top: calc(var(--header-height) + 3rem);
    }

    /* Header: compact title row + scrollable filter strip below */
    .app-header-row {
        height: var(--header-height);
    }

    #main-content {
        padding: 1rem;
    }

    .chart-panel {
        padding: 0.875rem;
    }

    .page-intro {
        padding: 1rem;
    }

    .page-intro__title {
        font-size: 1.25rem;
    }

    /* Mobile filter pills: touch-friendly tap targets */
    .filter-pill {
        min-height: 2.25rem;
        padding: 0.42rem 0.85rem;
        font-size: 0.75rem;
    }

    .preset-btn,
    .pagination-btn,
    .filter-chip,
    .tab-btn,
    .custom-range-apply {
        min-height: 2.25rem;
    }

    .active-filters-details {
        padding: 0.45rem 0.5rem;
    }

    .active-filters-compact .filter-chip {
        min-height: 2rem;
    }

    .filter-form-compact .filter-input[multiple] {
        min-height: 0;
    }

    .custom-range-picker {
        position: fixed !important;
        left: 0.75rem;
        right: 0.75rem;
        bottom: 0.75rem;
        top: auto;
        margin-top: 0;
        min-width: 0;
        width: auto;
        max-width: none;
        border-radius: 0.9rem;
        padding: 0.95rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        z-index: 140;
    }

    .custom-range-field {
        min-width: 0;
    }

    .custom-range-apply {
        width: 100%;
    }

    .scroll-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 36px;
        height: 36px;
    }

    /* Stack filter form items on mobile */
    .chart-panel form .flex-1 {
        min-width: 100% !important;
    }

    /* Section headers: more compact on mobile */
    .section-header {
        padding-bottom: 0.625rem;
        margin-bottom: 0.75rem;
    }

    .section-title {
        font-size: 0.8125rem;
    }

    .section-subtitle {
        font-size: 0.625rem;
    }

    .section-icon {
        width: 1.75rem;
        height: 1.75rem;
    }

    .section-icon svg {
        width: 0.875rem;
        height: 0.875rem;
    }

    /* Charts: shorter on mobile to avoid excessive scrolling */
    .chart-container {
        min-height: 220px;
    }

    .chart-panel-title {
        font-size: 0.75rem;
        margin-bottom: 0.625rem;
    }

    .chart-panel-title::before {
        height: 14px;
    }

    /* Tables: tighter on mobile */
    .data-table {
        font-size: 0.75rem;
    }

    .data-table thead th {
        font-size: 0.625rem;
        padding: 0.5rem 0.625rem;
    }

    .data-table tbody td {
        padding: 0.5rem 0.625rem;
        font-size: 0.75rem;
    }

    /* Stat cards: tighter on mobile */
    .dash-card {
        padding: 0.875rem;
    }

    /* Action KPI cards on mobile */
    .action-kpi-card {
        padding: 0.75rem 0.875rem;
    }

    .action-kpi-card__value {
        font-size: 1.125rem;
    }
}

body.dashboard-filter-overlay-open {
    overflow: hidden;
    touch-action: none;
}

/* ── Large Screen ─────────────────────────────────────── */
@media (min-width: 1536px) {
    .chart-container {
        min-height: 320px;
    }
}

/* ── Print ─────────────────────────────────────────────── */
@media print {
    #sidebar, .app-header, #htmx-loading-bar, .filter-bar, .scroll-to-top {
        display: none !important;
    }
    main {
        margin: 0 !important;
    }
    .chart-panel, .dash-card {
        box-shadow: none !important;
        border: 1px solid #d1d5db !important;
        break-inside: avoid;
    }
}

/* ── Info Buttons (contextual help) ──────────────────── */
.info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    color: #94a3b8;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    vertical-align: middle;
    padding: 0;
}

.info-btn:hover {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.08);
}

.info-btn:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 1px;
}

.metric-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #64748b;
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 1;
    margin-left: 0.35rem;
    cursor: help;
    vertical-align: middle;
    transition: border-color var(--transition-fast), color var(--transition-fast), background-color var(--transition-fast);
    padding: 0;
}

.metric-info-btn:hover {
    border-color: #94a3b8;
    color: #0f172a;
    background: #f8fafc;
}

/* Context hint banners (dismissible section tips) */
.context-hint {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    font-size: 0.75rem;
    color: #0369a1;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.context-hint-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    color: #0ea5e9;
    margin-top: 1px;
}

.context-hint-dismiss {
    flex-shrink: 0;
    margin-left: auto;
    color: #7dd3fc;
    cursor: pointer;
    padding: 0;
    background: none;
    border: none;
    transition: color var(--transition-fast);
}

.context-hint-dismiss:hover {
    color: #0284c7;
}

/* Metric context note (compact semantic/source hint) */
/* Inline help note (forms) */
.inline-help-note {
    margin-top: 0.5rem;
    min-height: 1.75rem;
    padding: 0.42rem 0.56rem;
    border: 1px solid #dbe5f2;
    border-radius: 0.5rem;
    background: #f8fbff;
    color: #475569;
    font-size: 0.6875rem;
    line-height: 1.35;
}

.inline-help-note:empty {
    display: none;
}

/* ── Command Palette ──────────────────────────────────── */
.cmd-result-item {
    color: #334155;
}

.cmd-result-item:hover {
    background: #f8fafc;
}

.cmd-result-item[aria-selected="true"],
.cmd-result-item.bg-brand-50 {
    background: #eff6ff;
    color: #1d4ed8;
}

/* ── Toast Notifications ─────────────────────────────── */
#toast-container > div {
    pointer-events: auto;
    max-width: 360px;
}

@keyframes toast-slide-in {
    from { opacity: 0; transform: translateX(100%); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ── Chat FAB ────────────────────────────────────────── */
.chat-fab-btn {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: #3b82f6;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
}

.chat-fab-btn:hover {
    background: #2563eb;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
    transform: translateY(-2px);
}

.chat-fab-btn:active {
    transform: translateY(0);
}

/* ── Header Control Cluster ───────────────────────────── */
.header-actions {
    row-gap: 0.5rem;
}

.header-actions .filter-bar {
    margin-right: 0.125rem;
}

/* ── Theme Toggle ─────────────────────────────────────── */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.125rem;
    padding: 0.125rem;
    border: 1px solid var(--border-default);
    border-radius: 9999px;
    background: var(--surface-elevated);
    box-shadow: var(--card-shadow);
}

.theme-toggle__btn {
    border: 0;
    border-radius: 9999px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1;
    padding: 0.35rem 0.65rem;
    cursor: pointer;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.theme-toggle__btn:hover {
    background: var(--surface-muted);
    color: var(--text-secondary);
}

.theme-toggle__btn.is-active {
    background: #dbeafe;
    color: #1d4ed8;
}

.theme-toggle__btn:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 1px;
}

/* ── Saved Views Menu ─────────────────────────────────── */
.saved-views {
    position: relative;
}

.saved-views__toggle {
    border: 1px solid var(--border-default);
    border-radius: 0.6rem;
    background: var(--surface-elevated);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    padding: 0.5rem 0.7rem;
    transition: border-color var(--transition-fast), color var(--transition-fast), background-color var(--transition-fast);
}

.saved-views__toggle:hover {
    border-color: #93c5fd;
    color: #1d4ed8;
    background: #eff6ff;
}

.saved-views__panel {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    width: min(24rem, calc(100vw - 1.5rem));
    background: var(--surface-elevated);
    border: 1px solid var(--border-default);
    border-radius: 0.8rem;
    box-shadow: 0 18px 36px -24px rgba(15, 23, 42, 0.5);
    padding: 0.75rem;
    z-index: 45;
}

.saved-views__header {
    margin-bottom: 0.6rem;
}

.saved-views__title {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-primary);
}

.saved-views__subtitle {
    margin-top: 0.15rem;
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.saved-views__create {
    display: grid;
    gap: 0.45rem;
}

.saved-views__input {
    width: 100%;
    border: 1px solid var(--border-default);
    border-radius: 0.5rem;
    background: var(--surface-elevated);
    color: var(--text-primary);
    font-size: 0.75rem;
    padding: 0.48rem 0.58rem;
}

.saved-views__input::placeholder {
    color: var(--text-muted);
}

.saved-views__default-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.6875rem;
    color: var(--text-secondary);
}

.saved-views__save-btn {
    border: 0;
    border-radius: 0.55rem;
    background: #2563eb;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.52rem 0.62rem;
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.saved-views__save-btn:hover {
    background: #1d4ed8;
}

.saved-views__status {
    min-height: 1rem;
    margin-top: 0.5rem;
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.saved-views__status.is-success {
    color: var(--tone-success-text);
}

.saved-views__status.is-danger {
    color: var(--tone-danger-text);
}

.saved-views__status.is-info {
    color: var(--tone-info-text);
}

.saved-views__list {
    margin-top: 0.35rem;
    max-height: 15rem;
    overflow: auto;
    padding-right: 0.2rem;
}

.saved-views__item {
    border: 1px solid var(--border-default);
    border-radius: 0.65rem;
    padding: 0.55rem 0.6rem;
    background: var(--surface-elevated);
}

.saved-views__item + .saved-views__item {
    margin-top: 0.45rem;
}

.saved-views__item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.saved-views__item-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.saved-views__badge {
    border-radius: 9999px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.16rem 0.4rem;
}

.saved-views__item-actions {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.saved-views__action-btn {
    border: 1px solid var(--border-default);
    border-radius: 0.45rem;
    background: var(--surface-elevated);
    color: var(--text-secondary);
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.26rem 0.5rem;
    cursor: pointer;
    transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.saved-views__action-btn:hover {
    background: var(--surface-muted);
    border-color: #cbd5e1;
}

.saved-views__action-btn.danger {
    color: #b91c1c;
    border-color: #fecaca;
    background: #fef2f2;
}

.saved-views__action-btn.danger:hover {
    background: #fee2e2;
}

.saved-views__empty {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 0.35rem 0.1rem;
}

/* ── Theme: Dark Mode ─────────────────────────────────── */
[data-theme="dark"] {
    /* Surfaces — neutral charcoal, zero blue tint */
    --surface-bg: #111111;
    --surface-elevated: #1c1c1e;
    --surface-muted: #2c2c2e;

    /* Text — warm neutrals */
    --text-primary: #f5f5f7;
    --text-secondary: #a1a1a6;
    --text-muted: #6e6e73;

    /* Borders — subtle, neutral */
    --border-default: #38383a;
    --card-border: #38383a;
    --card-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.04),
        0 1px 3px rgba(0, 0, 0, 0.3);
    --card-shadow-hover:
        0 0 0 1px rgba(255, 255, 255, 0.06),
        0 4px 12px rgba(0, 0, 0, 0.4);
    --card-shadow-active:
        0 0 0 1px rgba(255, 255, 255, 0.04),
        0 1px 2px rgba(0, 0, 0, 0.4);

    /* Focus */
    --focus-ring: #64d2ff;

    /* Accents — vibrant but not garish */
    --accent-primary: #30d5c8;
    --accent-primary-strong: #26a69e;
    --accent-info: #64d2ff;
    --accent-warning: #ffd60a;
    --accent-danger: #ff453a;
    --accent-neutral: #a1a1a6;

    /* Tones — subtle tinted backgrounds */
    --tone-info-bg: rgba(100, 210, 255, 0.06);
    --tone-info-border: rgba(100, 210, 255, 0.15);
    --tone-info-text: #7dd3fc;
    --tone-success-bg: rgba(48, 213, 200, 0.06);
    --tone-success-border: rgba(48, 213, 200, 0.15);
    --tone-success-text: #5eead4;
    --tone-warning-bg: rgba(255, 214, 10, 0.06);
    --tone-warning-border: rgba(255, 214, 10, 0.15);
    --tone-warning-text: #fde68a;
    --tone-danger-bg: rgba(255, 69, 58, 0.06);
    --tone-danger-border: rgba(255, 69, 58, 0.15);
    --tone-danger-text: #fca5a5;
    --tone-neutral-bg: rgba(161, 161, 166, 0.06);
    --tone-neutral-border: rgba(161, 161, 166, 0.12);
    --tone-neutral-text: #a1a1a6;

    /* Charts — desaturated, sophisticated palette */
    --chart-grid: #2c2c2e;
    --chart-text: #a1a1a6;
    --chart-track: #2c2c2e;
    --chart-tooltip-bg: #1c1c1e;
    --chart-tooltip-text: #f5f5f7;
    --chart-success: #30d5c8;
    --chart-danger: #ff453a;
    --chart-warning: #ffd60a;
    --chart-info: #64d2ff;
    --chart-neutral: #8e8e93;

    /* Chart series — refined, distinguishable on dark backgrounds */
    --chart-series-1: #30d5c8;
    --chart-series-2: #64d2ff;
    --chart-series-3: #32d74b;
    --chart-series-4: #ffd60a;
    --chart-series-5: #a1a1a6;
    --chart-series-6: #5ac8fa;
    --chart-series-7: #ff453a;
    --chart-series-8: #bf5af2;
    --chart-series-9: #ff9f0a;
    --chart-series-10: #ac8e68;
}

[data-theme="dark"] :focus-visible {
    box-shadow: 0 0 0 2px rgba(17, 17, 17, 0.92);
}

[data-theme="dark"] body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--surface-bg);
    color: var(--text-primary);
}

[data-theme="dark"] .metric-value,
[data-theme="dark"] .metric-value-sm {
    font-weight: 650;
}

[data-theme="dark"] .metric-label {
    letter-spacing: 0.06em;
}

[data-theme="dark"] .app-header {
    background: rgba(17, 17, 17, 0.92);
    border-bottom-color: var(--border-default);
}

[data-theme="dark"] .app-header-filters {
    border-bottom-color: var(--border-default);
}

[data-theme="dark"] #mobile-menu-btn {
    background: var(--surface-elevated);
    border-color: var(--border-default);
}

[data-theme="dark"] .page-intro {
    background: linear-gradient(145deg, rgba(28, 28, 30, 0.95), rgba(20, 20, 22, 0.92));
}

[data-theme="dark"] .page-intro__eyebrow {
    color: var(--text-muted);
}

[data-theme="dark"] .page-intro__title {
    color: var(--text-primary);
}

[data-theme="dark"] .page-intro__summary {
    color: var(--text-secondary);
}

[data-theme="dark"] .page-intro__hint {
    color: var(--text-muted);
}

[data-theme="dark"] .page-intro__details > summary {
    color: #30d5c8;
}

[data-theme="dark"] .section-header {
    border-bottom-color: var(--border-default);
}

[data-theme="dark"] .section-title {
    color: var(--text-primary);
}

[data-theme="dark"] .section-subtitle {
    color: var(--text-muted);
}

[data-theme="dark"] .dash-card,
[data-theme="dark"] .chart-panel,
[data-theme="dark"] .empty-state-card,
[data-theme="dark"] .pagination-btn,
[data-theme="dark"] .filter-input,
[data-theme="dark"] .saved-views__panel,
[data-theme="dark"] .saved-views__item {
    background: var(--surface-elevated);
    border-color: var(--border-default);
}

[data-theme="dark"] .chart-panel {
    background: linear-gradient(180deg, rgba(28, 28, 30, 0.98) 0%, rgba(24, 24, 26, 0.98) 100%);
}

[data-theme="dark"] .filter-pill-inactive,
[data-theme="dark"] .preset-btn,
[data-theme="dark"] .filter-chip,
[data-theme="dark"] .context-hint,
[data-theme="dark"] .kbd {
    background: var(--surface-muted);
    border-color: var(--border-default);
    color: var(--text-secondary);
}

[data-theme="dark"] .inline-help-note {
    background: #252528;
    border-color: #48484a;
    color: #a1a1a6;
}

[data-theme="dark"] .action-toolbar__link {
    border-color: #38383a;
    background: #1c1c1e;
    color: #a1a1a6;
}

[data-theme="dark"] .action-toolbar__link:hover {
    border-color: #48484a;
    background: #2c2c2e;
    color: #f5f5f7;
}

[data-theme="dark"] .action-toolbar__link--danger {
    border-color: #442726;
    background: #2a1c1c;
    color: #fecaca;
}

[data-theme="dark"] .action-toolbar__link--warning {
    border-color: #4a3a1f;
    background: #2a2518;
    color: #fbd38d;
}

[data-theme="dark"] .action-toolbar__link--info {
    border-color: #2e3a4f;
    background: #2c2c2e;
    color: #bfdbfe;
}

[data-theme="dark"] .action-kpi-card {
    border-color: #38383a;
    background: linear-gradient(180deg, #1c1c1e 0%, #1a1a1c 100%);
}

[data-theme="dark"] .action-kpi-card:hover {
    border-color: #48484a;
    box-shadow: 0 10px 18px -16px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .action-kpi-card__label {
    color: #8e8e93;
}

[data-theme="dark"] .action-kpi-card__value {
    color: #f5f5f7;
}

[data-theme="dark"] .action-kpi-card__meta {
    color: #8e8e93;
}

[data-theme="dark"] .action-kpi-card__cta {
    color: #30d5c8;
}

[data-theme="dark"] .metric-info-btn {
    border-color: #48484a;
    background: #252528;
    color: #8e8e93;
}

[data-theme="dark"] .metric-info-btn:hover {
    border-color: #6e6e73;
    color: #f5f5f7;
    background: #2c2c2e;
}

[data-theme="dark"] .filter-pill-inactive:hover {
    background: #3a3a3c;
    border-color: #48484a;
    color: #d1d1d6;
}

[data-theme="dark"] .filter-pill-active {
    background: linear-gradient(180deg, var(--accent-primary) 0%, var(--accent-primary-strong) 100%);
    border-color: var(--accent-primary);
    color: #f8fbff;
    box-shadow: 0 0 0 1px rgba(48, 213, 200, 0.32), 0 6px 14px rgba(38, 166, 158, 0.35);
}

[data-theme="dark"] .filter-pill:focus-visible {
    outline-color: var(--focus-ring);
}

[data-theme="dark"] .active-filters-details {
    border-color: #38383a;
    background: #1c1c1e;
}

[data-theme="dark"] .active-filters-details.filter-state-engaged {
    border-color: #26a69e;
    background: linear-gradient(180deg, #1a2a28 0%, #1c1c1e 100%);
    box-shadow: inset 0 0 0 1px rgba(48, 213, 200, 0.18);
}

[data-theme="dark"] .active-filters-details > summary {
    color: #8e8e93;
}

[data-theme="dark"] .active-filters-details.filter-state-engaged > summary {
    color: #30d5c8;
}

[data-theme="dark"] .active-filters-clear {
    color: #ff6b6b;
}

[data-theme="dark"] .active-filters-clear:hover {
    color: #ff8a8a;
}

[data-theme="dark"] .preset-btn-active {
    background: var(--accent-primary-strong);
    color: #f8fbff;
    box-shadow: 0 0 0 1px rgba(48, 213, 200, 0.28), 0 5px 12px rgba(38, 166, 158, 0.35);
}

[data-theme="dark"] .drilldown-shell .drilldown-hero {
    background: #252528;
    border-color: #48484a;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.24);
}

[data-theme="dark"] .drilldown-shell .drilldown-hero--warning {
    background: #2a2518;
    border-color: #5a4a2a;
}

[data-theme="dark"] .drilldown-shell .drill-kicker {
    color: #30d5c8;
}

[data-theme="dark"] .drilldown-shell .drill-meta {
    color: #a1a1a6;
}

[data-theme="dark"] .drilldown-shell nav[aria-label="Breadcrumb"] a:hover {
    color: #30d5c8;
}

[data-theme="dark"] .drill-status--ok {
    background: rgba(16, 185, 129, 0.18);
    color: #6ee7b7;
    border-color: rgba(110, 231, 183, 0.35);
}

[data-theme="dark"] .drill-status--live {
    background: rgba(245, 158, 11, 0.18);
    color: #fcd34d;
    border-color: rgba(252, 211, 77, 0.34);
}

[data-theme="dark"] .drill-status--issue {
    background: rgba(255, 69, 58, 0.12);
    color: #ff6b6b;
    border-color: rgba(255, 107, 107, 0.32);
}

[data-theme="dark"] .drill-status--neutral {
    background: rgba(142, 142, 147, 0.15);
    color: #a1a1a6;
    border-color: rgba(161, 161, 166, 0.3);
}

[data-theme="dark"] .drill-action-primary {
    background: var(--accent-primary-strong);
    border-color: var(--accent-primary);
    color: #f8fbff;
}

[data-theme="dark"] .drill-action-primary:hover {
    background: #0b5f5a;
    border-color: var(--accent-primary);
}

[data-theme="dark"] .drill-action-secondary {
    border-color: #38383a;
    background: #252528;
    color: #a1a1a6;
}

[data-theme="dark"] .drill-action-secondary:hover {
    background: #2c2c2e;
    border-color: #48484a;
    color: #f5f5f7;
}

[data-theme="dark"] .drill-link {
    color: #30d5c8;
}

[data-theme="dark"] .drill-link:hover {
    color: #99f6e4;
}

[data-theme="dark"] .drill-chip {
    background: #2c2c2e;
    border-color: #38383a;
    color: #a1a1a6;
}

[data-theme="dark"] .drill-chip--total {
    background: rgba(16, 185, 129, 0.16);
    border-color: rgba(110, 231, 183, 0.34);
    color: #6ee7b7;
}

[data-theme="dark"] .filter-chip .chip-remove {
    color: #30d5c8;
}

[data-theme="dark"] .tab-btn {
    color: var(--text-muted);
}

[data-theme="dark"] .tab-btn:hover {
    color: var(--text-secondary);
    border-bottom-color: #48484a;
}

[data-theme="dark"] .tab-btn-active,
[data-theme="dark"] .tab-btn[aria-selected="true"] {
    color: #30d5c8;
    border-bottom-color: #30d5c8;
}

[data-theme="dark"] .data-table thead th {
    background: var(--surface-elevated);
    border-bottom-color: var(--border-default);
    color: var(--text-muted);
}

[data-theme="dark"] .data-table tbody td {
    color: var(--text-secondary);
    border-bottom-color: #2c2c2e;
}

[data-theme="dark"] .data-table tbody tr:hover,
[data-theme="dark"] .cmd-result-item:hover {
    background: #2c2c2e;
}

[data-theme="dark"] .data-table tbody tr.cursor-pointer:hover {
    background: #2c2c2e;
}

[data-theme="dark"] .empty-state,
[data-theme="dark"] .empty-state svg {
    color: var(--text-muted);
}

[data-theme="dark"] .scroll-to-top {
    background: var(--surface-elevated);
    border-color: var(--border-default);
    color: var(--text-muted);
}

[data-theme="dark"] .scroll-to-top:hover {
    background: var(--surface-muted);
    color: #64d2ff;
}

[data-theme="dark"] .theme-toggle,
[data-theme="dark"] .saved-views__toggle {
    background: var(--surface-elevated);
    border-color: var(--border-default);
}

[data-theme="dark"] .theme-toggle__btn.is-active {
    background: rgba(100, 210, 255, 0.18);
    color: #64d2ff;
}

[data-theme="dark"] .saved-views__toggle:hover {
    background: rgba(100, 210, 255, 0.12);
    border-color: #64d2ff;
    color: #64d2ff;
}

[data-theme="dark"] .saved-views__badge {
    border-color: #64d2ff;
    background: rgba(100, 210, 255, 0.15);
    color: #64d2ff;
}

[data-theme="dark"] .saved-views__action-btn.danger {
    border-color: #442726;
    background: rgba(255, 69, 58, 0.12);
    color: #fca5a5;
}

[data-theme="dark"] .saved-views__action-btn.danger:hover {
    background: rgba(255, 69, 58, 0.2);
}

[data-theme="dark"] .chart-panel-title {
    color: var(--text-primary);
}

[data-theme="dark"] .chart-panel-subtitle,
[data-theme="dark"] .chart-panel-note {
    color: var(--text-muted);
}

[data-theme="dark"] .pagination-btn {
    color: var(--text-secondary);
}

[data-theme="dark"] .pagination-btn-active {
    background: var(--accent-primary-strong);
    border-color: var(--accent-primary);
    color: #f8fbff;
}

[data-theme="dark"] .pagination-btn-active:hover {
    background: #0b5f5a;
    border-color: var(--accent-primary);
}

[data-theme="dark"] .drill-row-hover:hover {
    background: #2c2c2e;
}

[data-theme="dark"] .drill-row-hover:active {
    background: #3a3a3c;
}

[data-theme="dark"] .drill-quickview {
    color: #6e6e73;
}

[data-theme="dark"] .drill-quickview:hover {
    background: #2c2c2e;
    color: #30d5c8;
}

[data-theme="dark"] .filter-input::placeholder {
    color: var(--text-muted);
}

[data-theme="dark"] .custom-range-picker {
    border-color: #38383a;
    background: #1c1c1e;
    box-shadow: 0 20px 44px -28px rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .custom-range-label {
    color: #8e8e93;
}

[data-theme="dark"] .custom-range-input {
    border-color: #38383a;
    background: #252528;
    color: #f5f5f7;
}

[data-theme="dark"] .custom-range-input:hover {
    border-color: #48484a;
}

[data-theme="dark"] .filter-form-compact .filter-field-active > label {
    color: #30d5c8;
}

[data-theme="dark"] .filter-form-compact .filter-field-active > label::after {
    border-color: #30d5c8;
    background: rgba(48, 213, 200, 0.15);
    color: #30d5c8;
}

[data-theme="dark"] .filter-form-compact .filter-input.is-active-filter {
    border-color: #30d5c8;
    background: #1a2a28;
    color: #f5f5f7;
    box-shadow: 0 0 0 2px rgba(48, 213, 200, 0.18);
}

[data-theme="dark"] .filter-form-compact .filter-input.is-active-filter:hover {
    border-color: #30d5c8;
    background: #222a28;
}

[data-theme="dark"] .filter-form-compact .filter-input[multiple].is-active-filter option {
    background: #1c1c1e;
    color: #a1a1a6;
}

[data-theme="dark"] .filter-form-compact .filter-input[multiple].is-active-filter option:checked {
    color: #06201d;
    background: linear-gradient(180deg, #30d5c8 0%, #26a69e 100%);
}

[data-theme="dark"] .custom-range-input:focus {
    border-color: #30d5c8;
    box-shadow: 0 0 0 2px rgba(48, 213, 200, 0.22);
}

[data-theme="dark"] .custom-range-apply {
    border-color: #30d5c8;
    background: #26a69e;
}

[data-theme="dark"] .custom-range-apply:hover {
    border-color: #30d5c8;
    background: #1f8a82;
}

[data-theme="dark"] .custom-range-backdrop {
    background: rgba(0, 0, 0, 0.58);
}

/* Tailwind utility overrides used heavily across templates */
[data-theme="dark"] .bg-white {
    background-color: var(--surface-elevated) !important;
}

[data-theme="dark"] .bg-surface-50 {
    background-color: var(--surface-bg) !important;
}

[data-theme="dark"] .bg-surface-100,
[data-theme="dark"] .bg-slate-50,
[data-theme="dark"] .bg-slate-100 {
    background-color: var(--surface-muted) !important;
}

[data-theme="dark"] .bg-surface-200,
[data-theme="dark"] .bg-slate-200 {
    background-color: #38383a !important;
}

[data-theme="dark"] .bg-blue-50 {
    background-color: rgba(100, 210, 255, 0.06) !important;
}

[data-theme="dark"] .bg-emerald-50 {
    background-color: rgba(48, 213, 200, 0.06) !important;
}

[data-theme="dark"] .bg-red-50 {
    background-color: rgba(255, 69, 58, 0.06) !important;
}

[data-theme="dark"] .bg-amber-50 {
    background-color: rgba(255, 214, 10, 0.06) !important;
}

[data-theme="dark"] .bg-purple-50 {
    background-color: rgba(191, 90, 242, 0.06) !important;
}

[data-theme="dark"] .text-slate-900,
[data-theme="dark"] .text-slate-800,
[data-theme="dark"] .text-slate-700 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .text-slate-600,
[data-theme="dark"] .text-slate-500 {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .text-slate-400,
[data-theme="dark"] .text-slate-300 {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .text-brand-600,
[data-theme="dark"] .text-brand-700 {
    color: #64d2ff !important;
}

[data-theme="dark"] .border-slate-100,
[data-theme="dark"] .border-slate-200,
[data-theme="dark"] .border-surface-200 {
    border-color: var(--border-default) !important;
}

[data-theme="dark"] .border-slate-300 {
    border-color: #48484a !important;
}

[data-theme="dark"] .border-blue-200 {
    border-color: rgba(100, 210, 255, 0.3) !important;
}

[data-theme="dark"] .border-emerald-200 {
    border-color: rgba(48, 213, 200, 0.3) !important;
}

[data-theme="dark"] .border-red-200 {
    border-color: rgba(255, 69, 58, 0.3) !important;
}

[data-theme="dark"] .border-amber-200 {
    border-color: rgba(255, 214, 10, 0.3) !important;
}

[data-theme="dark"] .hover\:bg-slate-50:hover {
    background-color: #2c2c2e !important;
}

[data-theme="dark"] .hover\:bg-slate-100:hover {
    background-color: #38383a !important;
}

[data-theme="dark"] .hover\:bg-blue-50:hover {
    background-color: rgba(100, 210, 255, 0.1) !important;
}

[data-theme="dark"] .hover\:bg-blue-100:hover {
    background-color: rgba(100, 210, 255, 0.15) !important;
}

[data-theme="dark"] .hover\:text-blue-700:hover,
[data-theme="dark"] .hover\:text-brand-700:hover {
    color: #64d2ff !important;
}

@media (max-width: 1024px) {
    .header-actions {
        justify-content: flex-end;
    }
}

@media (max-width: 768px) {
    .saved-views__panel {
        right: 0;
        left: auto;
        width: min(23rem, calc(100vw - 1rem));
    }
}

/* ── Reduced Motion ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html {
        scroll-behavior: auto;
    }
}
