/* ═══════════════════════════════════════════════════════
   GoFlowOS Financial Dashboard — Premium Design System
   Apple-inspired · Aquatic palette · Glassmorphism
   Ultra-smooth animations · Micro-interactions
   ═══════════════════════════════════════════════════════ */

/* ─── CSS Variables (Depth System) ──────────────────── */
:root {
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;

    /* Aquatic Palette — Dark Mode */
    --surface-bg: #1e3a5f;
    --surface-text: #e0f2fe;
    --surface-border: #2563eb;

    --shallow-bg: #172554;
    --shallow-text: #bae6fd;
    --shallow-border: #1d4ed8;

    --deep-bg: #0f172a;
    --deep-text: #7dd3fc;
    --deep-border: #1e40af;

    --abyss-bg: #020617;
    --abyss-text: #38bdf8;
    --abyss-border: #1e3a8a;

    /* Flow State Colors */
    --laminar: #4ade80;
    --laminar-glow: rgba(74, 222, 128, 0.25);
    --turbulent: #fbbf24;
    --turbulent-glow: rgba(251, 191, 36, 0.25);
    --stagnant: #94a3b8;

    /* Accent gradients */
    --gradient-primary: linear-gradient(135deg, #38bdf8 0%, #4ade80 100%);
    --gradient-warm: linear-gradient(135deg, #fbbf24 0%, #f97316 100%);
    --gradient-danger: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    --gradient-cool: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
    --gradient-ocean: linear-gradient(180deg, #0a0f1e 0%, #0d1b3e 40%, #0f172a 100%);

    /* Glassmorphism */
    --glass-bg: rgba(15, 23, 42, 0.26);
    --glass-bg-hover: rgba(15, 23, 42, 0.34);
    --glass-border: rgba(56, 189, 248, 0.2);
    --glass-border-hover: rgba(56, 189, 248, 0.34);
    --glass-blur: 4px;
    --liquid-lens-blur: 2px;
    --liquid-lens-scale: 1.008;
    --liquid-refract-strong: rgba(125, 211, 252, 0.08);
    --liquid-refract-soft: rgba(125, 211, 252, 0.02);
    --glass-smoke: rgba(2, 8, 23, 0.15);
    --liquid-surface-core: rgba(2, 16, 38, 0.24);
    --liquid-surface-core-hover: rgba(2, 16, 38, 0.3);

    /* Spacing & Sizing */
    --sidebar-width: 260px;
    --header-height: 64px;
    --radius-sm: 14px;
    --radius-md: 18px;
    --radius-lg: 26px;
    --radius-xl: 34px;
    --haptic-press-scale: 0.98;
    --interactive-target-size: 40px;

    /* Apple-like easing */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --motion-fast: 140ms;
    --motion-medium: 180ms;
    --motion-slow: 260ms;
    --focus-ring: 0 0 0 2px rgba(56, 189, 248, 0.34), 0 0 0 5px rgba(56, 189, 248, 0.14);

    /* Shadows */
    --shadow-card:
        0 0 0 1px var(--glass-border),
        0 8px 20px rgba(0, 0, 0, 0.18),
        0 20px 48px rgba(0, 0, 0, 0.24);
    --shadow-card-hover:
        0 0 0 1px var(--glass-border-hover),
        0 10px 24px rgba(0, 0, 0, 0.22),
        0 24px 52px rgba(0, 0, 0, 0.3),
        0 0 26px rgba(56, 189, 248, 0.12);
    --shadow-glow: 0 0 40px rgba(56, 189, 248, 0.08);
    --shadow-deep: 0 24px 80px rgba(0, 0, 0, 0.5);
}

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

html {
    font-size: 14px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    background: var(--abyss-bg);
    color: var(--surface-text);
    overflow-x: hidden;
    min-height: 100vh;
    line-height: 1.5;
    letter-spacing: -0.01em;
}

:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.is-interactive {
    transition: transform var(--motion-fast) var(--ease-out-expo), border-color var(--motion-fast) ease, box-shadow var(--motion-medium) ease, background var(--motion-medium) ease, color var(--motion-fast) ease;
}

.is-elevated {
    box-shadow: var(--shadow-card);
}

/* ─── Liquid Glass (Clear Variant) ─────────────────── */
#sidebar,
#main-header,
.date-filter,
.goflow-modal-content,
.goflow-window,
.table-wrap,
.table-search-shell,
.cmd-palette-modal,
.cmd-search-container,
.cmd-item,
.quick-filter-btn,
.goflow-tabs,
.goflow-tab,
.admin-action-btn,
.admin-module-option,
.theme-toggle-btn,
.flow-card-expand,
.theme-popup,
.mobile-toggle,
.toast {
    isolation: isolate;
}

.date-filter,
.table-search-shell,
.cmd-palette-modal,
.cmd-search-container,
.cmd-item,
.quick-filter-btn,
.goflow-tabs,
.goflow-tab,
.admin-action-btn,
.admin-module-option,
.theme-toggle-btn,
.flow-card-expand,
.mobile-toggle,
.toast {
    position: relative;
    overflow: hidden;
}

#main-header::before,
#sidebar::before,
.date-filter::before,
.goflow-modal-content::before,
.goflow-window::before,
.table-wrap::before,
.table-search-shell::before,
.cmd-palette-modal::before,
.cmd-search-container::before,
.cmd-item::before,
.quick-filter-btn::before,
.goflow-tabs::before,
.goflow-tab::before,
.admin-action-btn::before,
.admin-module-option::before,
.theme-toggle-btn::before,
.flow-card-expand::before,
.theme-popup::before,
.mobile-toggle::before,
.toast::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    pointer-events: none;
    background:
        radial-gradient(150% 130% at 8% -4%, var(--liquid-refract-strong) 0%, var(--liquid-refract-soft) 24%, transparent 52%),
        radial-gradient(120% 120% at 92% 112%, rgba(56, 189, 248, 0.035) 0%, transparent 46%),
        radial-gradient(165% 145% at 50% 50%, rgba(125, 211, 252, 0.038) 0%, rgba(125, 211, 252, 0.01) 36%, transparent 58%, rgba(125, 211, 252, 0.045) 70%, rgba(2, 16, 38, 0.24) 100%),
        linear-gradient(120deg, rgba(186, 230, 253, 0.016) 0%, rgba(186, 230, 253, 0.004) 40%, rgba(56, 189, 248, 0.014) 100%);
    background-position: 1% -1%, 99% 102%, 50% 50%, center;
    background-size: 112% 112%, 110% 110%, 122% 122%, 100% 100%;
    backdrop-filter: blur(var(--liquid-lens-blur)) saturate(112%) contrast(106%);
    -webkit-backdrop-filter: blur(var(--liquid-lens-blur)) saturate(112%) contrast(106%);
    transform: scale(var(--liquid-lens-scale)) translateZ(0);
    transform-origin: center;
    opacity: 0.34;
    box-shadow: inset 0 0 0 999px var(--glass-smoke), inset 0 1px 0 rgba(191, 219, 254, 0.04), inset 0 -1px 0 rgba(2, 10, 24, 0.24);
    z-index: 0;
    transition: transform 0.28s var(--ease-out-expo), opacity 0.28s ease, background-position 0.28s var(--ease-out-expo), background-size 0.28s var(--ease-out-expo);
}

#main-header>*,
#sidebar>*,
.date-filter>*,
.goflow-modal-content>*,
.goflow-window>*,
.table-wrap>*,
.table-search-shell>*,
.cmd-palette-modal>*,
.cmd-search-container>*,
.cmd-item>*,
.goflow-tabs>*,
.goflow-tab>*,
.admin-action-btn>*,
.admin-module-option>*,
.theme-toggle-btn>*,
.flow-card-expand>*,
.theme-popup>*,
.mobile-toggle>*,
.toast>* {
    position: relative;
    z-index: 1;
}

.date-filter:hover::before,
.cmd-search-container:focus-within::before,
.table-search-shell:focus-within::before,
.cmd-item:hover::before,
.quick-filter-btn:hover::before,
.goflow-tab:hover::before,
.admin-action-btn:hover::before,
.flow-card-expand:hover::before {
    transform: scale(1.018);
    opacity: 0.42;
    background-position: -2% 2%, 102% 98%, 50% 50%, center;
    background-size: 114% 114%, 112% 112%, 128% 128%, 100% 100%;
}

/* ─── Themes ────────────────────────────────────────── */

/* 1. Midnight Oceanic (Default) - defined in :root above */

/* 2. Caribenho Sunset */
body[data-theme="caribenho"] {
    --surface-bg: #2d1b2e;
    --surface-text: #fee2e2;
    --surface-border: #db2777;

    --shallow-bg: #4a1d35;
    --shallow-text: #fbcfe8;
    --shallow-border: #be185d;

    --deep-bg: #2e1025;
    --deep-text: #f9a8d4;
    --deep-border: #9d174d;

    --abyss-bg: #1e0917;
    --abyss-text: #ec4899;
    --abyss-border: #831843;

    --laminar: #f43f5e;
    --laminar-glow: rgba(244, 63, 94, 0.25);
    --turbulent: #f59e0b;
    --turbulent-glow: rgba(245, 158, 11, 0.25);
    --stagnant: #cbd5e1;

    --gradient-primary: linear-gradient(135deg, #f43f5e 0%, #fb923c 100%);
    --gradient-warm: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    --gradient-ocean: linear-gradient(180deg, #190812 0%, #301026 40%, #2e1025 100%);
}

body[data-theme="caribenho"] .kpi-card::after,
body[data-theme="caribenho"] .flow-card::before {
    background:
        radial-gradient(155% 135% at 8% -4%, rgba(254, 226, 226, 0.122) 0%, rgba(254, 226, 226, 0.038) 24%, transparent 50%),
        radial-gradient(126% 126% at 92% 112%, rgba(251, 146, 60, 0.104) 0%, rgba(251, 146, 60, 0.03) 16%, transparent 46%),
        radial-gradient(172% 150% at 50% 50%, rgba(244, 63, 94, 0.048) 0%, rgba(244, 63, 94, 0.014) 34%, transparent 54%, rgba(244, 114, 182, 0.072) 68%, rgba(30, 9, 23, 0.3) 100%),
        radial-gradient(170% 170% at 50% 50%, transparent 56%, rgba(251, 146, 60, 0.018) 63%, rgba(244, 63, 94, 0.074) 73%, rgba(30, 9, 23, 0.24) 100%),
        radial-gradient(circle at top left, rgba(244, 114, 182, 0.094) 0%, transparent 60%);
    box-shadow: inset 0 0 0 999px var(--glass-smoke), inset 0 1px 0 rgba(254, 226, 226, 0.08), inset 0 -1px 0 rgba(30, 9, 23, 0.22);
}


/* 5. Crystal Water — Mid-tone aquatic theme */
body[data-theme="crystal"] {
    --surface-bg: #1a3a4a;
    --surface-text: #e0f7fa;
    --surface-border: #07B2D9;

    --shallow-bg: #163545;
    --shallow-text: #b2ebf2;
    --shallow-border: #04C4D9;

    --deep-bg: #0e2a38;
    --deep-text: #50E2F2;
    --deep-border: #07B2D9;

    --abyss-bg: #091e2a;
    --abyss-text: #04D9D9;
    --abyss-border: #07526a;

    --laminar: #04D9D9;
    --laminar-glow: rgba(4, 217, 217, 0.3);
    --turbulent: #fbbf24;
    --turbulent-glow: rgba(251, 191, 36, 0.25);
    --stagnant: #88DFF2;

    --glass-bg: rgba(14, 42, 56, 0.3);
    --glass-bg-hover: rgba(14, 42, 56, 0.4);
    --glass-border: rgba(80, 226, 242, 0.18);
    --glass-border-hover: rgba(80, 226, 242, 0.35);

    --gradient-primary: linear-gradient(135deg, #04D9D9 0%, #88DFF2 100%);
    --gradient-warm: linear-gradient(135deg, #fbbf24 0%, #f97316 100%);
    --gradient-danger: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    --gradient-cool: linear-gradient(135deg, #07B2D9 0%, #04C4D9 100%);
    --gradient-ocean: linear-gradient(180deg, #071520 0%, #0c2838 30%, #0e2a38 100%);

    --shadow-glow: 0 0 40px rgba(4, 217, 217, 0.1);
}

body[data-theme="crystal"]::before {
    background: radial-gradient(ellipse at 25% 30%, rgba(4, 196, 217, 0.06) 0%, transparent 55%),
        radial-gradient(ellipse at 75% 70%, rgba(80, 226, 242, 0.04) 0%, transparent 50%);
}

/* Crystal Water — UI Element Overrides */
body[data-theme="crystal"] #sidebar {
    background:
        linear-gradient(160deg, rgba(80, 226, 242, 0.24) 0%, rgba(80, 226, 242, 0.08) 38%, rgba(9, 30, 42, 0.2) 100%),
        rgba(9, 30, 42, 0.34);
    border-right-color: rgba(80, 226, 242, 0.2);
}

body[data-theme="crystal"] #sidebar::after {
    background: linear-gradient(180deg, transparent 0%, rgba(4, 217, 217, 0.2) 30%, rgba(80, 226, 242, 0.12) 70%, transparent 100%);
}

body[data-theme="crystal"] #main-header {
    background:
        linear-gradient(150deg, rgba(80, 226, 242, 0.2) 0%, rgba(80, 226, 242, 0.06) 46%, rgba(9, 30, 42, 0.16) 100%),
        rgba(9, 30, 42, 0.3);
    border-bottom-color: rgba(80, 226, 242, 0.16);
}

body[data-theme="crystal"] .flow-card,
body[data-theme="crystal"] .kpi-card {
    background: linear-gradient(140deg, rgba(80, 226, 242, 0.18) 0%, rgba(14, 42, 56, 0.22) 54%, rgba(14, 42, 56, 0.3) 100%);
    border-color: rgba(80, 226, 242, 0.2);
    box-shadow: 0 0 0 1px rgba(80, 226, 242, 0.12), 0 10px 24px rgba(0, 0, 0, 0.2), 0 22px 46px rgba(0, 0, 0, 0.24);
}

body[data-theme="crystal"] .flow-card:hover,
body[data-theme="crystal"] .kpi-card:hover {
    border-color: rgba(80, 226, 242, 0.3);
    box-shadow: 0 0 0 1px rgba(80, 226, 242, 0.18), 0 12px 28px rgba(0, 0, 0, 0.24), 0 26px 54px rgba(0, 0, 0, 0.3), 0 0 24px rgba(4, 217, 217, 0.14);
}

body[data-theme="crystal"] .nav-link::before {
    background: var(--gradient-primary);
    box-shadow: 0 0 12px rgba(4, 217, 217, 0.4);
}

body[data-theme="crystal"] .nav-link.active {
    background: rgba(4, 217, 217, 0.1);
}

body[data-theme="crystal"] .nav-link::after {
    background: radial-gradient(ellipse at left center, rgba(4, 217, 217, 0.08) 0%, transparent 70%);
}

body[data-theme="crystal"] .date-filter {
    background:
        linear-gradient(135deg, rgba(80, 226, 242, 0.22) 0%, rgba(80, 226, 242, 0.08) 40%, rgba(9, 30, 42, 0.14) 100%),
        rgba(9, 30, 42, 0.28);
    border-color: rgba(80, 226, 242, 0.24);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(80, 226, 242, 0.18);
}

body[data-theme="crystal"] .filter-apply-btn {
    border-color: rgba(4, 217, 217, 0.3);
    background: rgba(4, 217, 217, 0.1);
    color: #04D9D9;
}

body[data-theme="crystal"] .goflow-modal-content {
    background:
        linear-gradient(155deg, rgba(80, 226, 242, 0.22) 0%, rgba(80, 226, 242, 0.08) 38%, rgba(14, 42, 56, 0.2) 100%),
        rgba(14, 42, 56, 0.32);
    border-color: rgba(80, 226, 242, 0.2);
}

body[data-theme="crystal"] .brand-icon {
    filter: drop-shadow(0 0 8px rgba(4, 217, 217, 0.4));
}

body[data-theme="crystal"] ::selection {
    background: rgba(4, 217, 217, 0.3);
}

/* 6. Singularidade — Mid-tone purple/lilac theme */
body[data-theme="singularidade"] {
    --surface-bg: #2a2050;
    --surface-text: #e8e0f5;
    --surface-border: #6F4BF2;

    --shallow-bg: #231a45;
    --shallow-text: #d4c8f0;
    --shallow-border: #8263F2;

    --deep-bg: #1a1238;
    --deep-text: #9F8FD9;
    --deep-border: #512BD9;

    --abyss-bg: #110d28;
    --abyss-text: #8263F2;
    --abyss-border: #4637A6;

    --laminar: #8263F2;
    --laminar-glow: rgba(130, 99, 242, 0.3);
    --turbulent: #fbbf24;
    --turbulent-glow: rgba(251, 191, 36, 0.25);
    --stagnant: #9F8FD9;

    --glass-bg: rgba(26, 18, 56, 0.3);
    --glass-bg-hover: rgba(26, 18, 56, 0.42);
    --glass-border: rgba(130, 99, 242, 0.18);
    --glass-border-hover: rgba(130, 99, 242, 0.35);

    --gradient-primary: linear-gradient(135deg, #6F4BF2 0%, #9F8FD9 100%);
    --gradient-warm: linear-gradient(135deg, #fbbf24 0%, #f97316 100%);
    --gradient-danger: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    --gradient-cool: linear-gradient(135deg, #512BD9 0%, #8263F2 100%);
    --gradient-ocean: linear-gradient(180deg, #0a0818 0%, #150f30 30%, #1a1238 100%);

    --shadow-glow: 0 0 40px rgba(111, 75, 242, 0.1);
}

body[data-theme="singularidade"]::before {
    background: radial-gradient(ellipse at 20% 25%, rgba(111, 75, 242, 0.07) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 75%, rgba(159, 143, 216, 0.05) 0%, transparent 50%);
}

/* Singularidade — UI Element Overrides */
body[data-theme="singularidade"] #sidebar {
    background:
        linear-gradient(160deg, rgba(159, 143, 216, 0.22) 0%, rgba(159, 143, 216, 0.07) 38%, rgba(17, 13, 40, 0.2) 100%),
        rgba(17, 13, 40, 0.34);
    border-right-color: rgba(130, 99, 242, 0.2);
}

body[data-theme="singularidade"] #sidebar::after {
    background: linear-gradient(180deg, transparent 0%, rgba(111, 75, 242, 0.2) 30%, rgba(159, 143, 216, 0.12) 70%, transparent 100%);
}

body[data-theme="singularidade"] #main-header {
    background:
        linear-gradient(150deg, rgba(159, 143, 216, 0.2) 0%, rgba(159, 143, 216, 0.06) 46%, rgba(17, 13, 40, 0.18) 100%),
        rgba(17, 13, 40, 0.3);
    border-bottom-color: rgba(130, 99, 242, 0.16);
}

body[data-theme="singularidade"] .flow-card,
body[data-theme="singularidade"] .kpi-card {
    background: linear-gradient(140deg, rgba(159, 143, 216, 0.18) 0%, rgba(26, 18, 56, 0.22) 54%, rgba(26, 18, 56, 0.3) 100%);
    border-color: rgba(130, 99, 242, 0.2);
    box-shadow: 0 0 0 1px rgba(130, 99, 242, 0.12), 0 10px 24px rgba(0, 0, 0, 0.2), 0 22px 46px rgba(0, 0, 0, 0.24);
}

body[data-theme="singularidade"] .flow-card:hover,
body[data-theme="singularidade"] .kpi-card:hover {
    border-color: rgba(130, 99, 242, 0.32);
    box-shadow: 0 0 0 1px rgba(130, 99, 242, 0.2), 0 12px 28px rgba(0, 0, 0, 0.24), 0 26px 54px rgba(0, 0, 0, 0.3), 0 0 24px rgba(111, 75, 242, 0.14);
}

body[data-theme="singularidade"] .kpi-card::after,
body[data-theme="singularidade"] .flow-card::before {
    background:
        radial-gradient(155% 135% at 8% -4%, rgba(232, 224, 245, 0.12) 0%, rgba(232, 224, 245, 0.038) 24%, transparent 50%),
        radial-gradient(126% 126% at 92% 112%, rgba(159, 143, 216, 0.1) 0%, rgba(159, 143, 216, 0.028) 16%, transparent 46%),
        radial-gradient(172% 150% at 50% 50%, rgba(130, 99, 242, 0.046) 0%, rgba(130, 99, 242, 0.014) 34%, transparent 54%, rgba(159, 143, 216, 0.07) 68%, rgba(17, 13, 40, 0.3) 100%),
        radial-gradient(170% 170% at 50% 50%, transparent 56%, rgba(159, 143, 216, 0.018) 63%, rgba(130, 99, 242, 0.072) 73%, rgba(17, 13, 40, 0.24) 100%),
        radial-gradient(circle at top left, rgba(130, 99, 242, 0.088) 0%, transparent 60%);
    box-shadow: inset 0 0 0 999px var(--glass-smoke), inset 0 1px 0 rgba(232, 224, 245, 0.08), inset 0 -1px 0 rgba(17, 13, 40, 0.2);
}

body[data-theme="singularidade"] .nav-link::before {
    background: var(--gradient-primary);
    box-shadow: 0 0 12px rgba(111, 75, 242, 0.4);
}

body[data-theme="singularidade"] .nav-link.active {
    background: rgba(111, 75, 242, 0.12);
}

body[data-theme="singularidade"] .nav-link::after {
    background: radial-gradient(ellipse at left center, rgba(111, 75, 242, 0.08) 0%, transparent 70%);
}

body[data-theme="singularidade"] .date-filter {
    background:
        linear-gradient(135deg, rgba(159, 143, 216, 0.22) 0%, rgba(159, 143, 216, 0.08) 40%, rgba(17, 13, 40, 0.16) 100%),
        rgba(17, 13, 40, 0.3);
    border-color: rgba(130, 99, 242, 0.24);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(130, 99, 242, 0.2);
}

body[data-theme="singularidade"] .filter-apply-btn {
    border-color: rgba(130, 99, 242, 0.3);
    background: rgba(130, 99, 242, 0.1);
    color: #8263F2;
}

body[data-theme="singularidade"] .goflow-modal-content {
    background:
        linear-gradient(155deg, rgba(159, 143, 216, 0.22) 0%, rgba(159, 143, 216, 0.08) 38%, rgba(26, 18, 56, 0.22) 100%),
        rgba(26, 18, 56, 0.34);
    border-color: rgba(130, 99, 242, 0.2);
}

body[data-theme="singularidade"] .brand-icon {
    filter: drop-shadow(0 0 8px rgba(111, 75, 242, 0.4));
}

body[data-theme="singularidade"] ::selection {
    background: rgba(111, 75, 242, 0.3);
}

/* ─── GoFlow Window Theme Overrides ─── */
body[data-theme="crystal"] .goflow-window {
    background:
        linear-gradient(155deg, rgba(80, 226, 242, 0.24) 0%, rgba(80, 226, 242, 0.08) 40%, rgba(14, 42, 56, 0.2) 100%),
        rgba(14, 42, 56, 0.34);
    border-color: rgba(80, 226, 242, 0.24);
    box-shadow: 0 14px 34px rgba(2, 8, 23, 0.3), 0 0 0 1px rgba(80, 226, 242, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

body[data-theme="crystal"] .goflow-window.goflow-win-focus {
    box-shadow: 0 18px 44px rgba(2, 8, 23, 0.34), 0 0 0 2px rgba(80, 226, 242, 0.26), 0 0 20px rgba(4, 217, 217, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

body[data-theme="crystal"] .goflow-win-header {
    background:
        linear-gradient(135deg, rgba(80, 226, 242, 0.2) 0%, rgba(80, 226, 242, 0.06) 40%, rgba(9, 30, 42, 0.14) 100%),
        rgba(9, 30, 42, 0.3);
    border-bottom-color: rgba(80, 226, 242, 0.18);
}

body[data-theme="singularidade"] .goflow-window {
    background:
        linear-gradient(155deg, rgba(159, 143, 216, 0.22) 0%, rgba(159, 143, 216, 0.08) 40%, rgba(17, 13, 40, 0.2) 100%),
        rgba(17, 13, 40, 0.36);
    border-color: rgba(130, 99, 242, 0.24);
    box-shadow: 0 14px 34px rgba(2, 8, 23, 0.32), 0 0 0 1px rgba(130, 99, 242, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

body[data-theme="singularidade"] .goflow-window.goflow-win-focus {
    box-shadow: 0 18px 44px rgba(2, 8, 23, 0.34), 0 0 0 2px rgba(130, 99, 242, 0.28), 0 0 20px rgba(111, 75, 242, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

body[data-theme="singularidade"] .goflow-win-header {
    background:
        linear-gradient(135deg, rgba(159, 143, 216, 0.2) 0%, rgba(159, 143, 216, 0.06) 40%, rgba(26, 18, 56, 0.16) 100%),
        rgba(26, 18, 56, 0.32);
    border-bottom-color: rgba(130, 99, 242, 0.2);
}

/* ─── Theme-Specific Loader Overrides ─── */

/* Caribbean Sunset loader */
body[data-theme="caribenho"] .loader-container {
    --loader-cyan: #fb923c;
    --loader-green: #f472b6;
}

body[data-theme="caribenho"] .glassflow-loader-stage::before {
    background:
        radial-gradient(circle at 26% 28%, rgba(251, 146, 60, 0.22) 0%, transparent 62%),
        radial-gradient(circle at 74% 74%, rgba(244, 114, 182, 0.18) 0%, transparent 66%);
}

body[data-theme="caribenho"] .glassflow-river {
    filter: drop-shadow(0 0 18px rgba(244, 114, 182, 0.22));
}

body[data-theme="caribenho"] .core-card-logo {
    color: #ffd1b2;
}

/* Crystal Water loader */
body[data-theme="crystal"] .loader-container {
    --loader-cyan: #04D9D9;
    --loader-green: #50E2F2;
}

body[data-theme="crystal"] .core-card-refraction {
    animation: crystal-prism-glow 2.2s ease-in-out infinite alternate;
}

body[data-theme="crystal"] .ring-a {
    animation: crystal-ripple 3.2s ease-in-out infinite;
}

body[data-theme="crystal"] .ring-b {
    animation: crystal-ripple 3.2s ease-in-out infinite 1.6s;
}

/* Singularidade loader */
body[data-theme="singularidade"] .loader-container {
    --loader-cyan: #8263F2;
    --loader-green: #6F4BF2;
}

body[data-theme="singularidade"] .glassflow-loader-stage {
    animation: singularity-warp 6s ease-in-out infinite;
}

body[data-theme="singularidade"] .glassflow-void {
    animation: voidPulse 5.4s ease-in-out infinite, singularity-accretion 4.6s linear infinite;
}

body[data-theme="singularidade"] .glassflow-river {
    opacity: 0.76;
}

body[data-theme="singularidade"] .core-card-logo {
    color: #b6a8ff;
}

body[data-theme="singularidade"] .flow-bubble {
    border-color: rgba(130, 99, 242, 0.3);
}

@keyframes crystal-prism-glow {
    0% {
        filter: blur(14px) hue-rotate(0deg);
        opacity: 0.7;
    }

    100% {
        filter: blur(18px) hue-rotate(15deg);
        opacity: 1;
    }
}

@keyframes crystal-ripple {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(0.9);
        opacity: 0.44;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.26);
        opacity: 0.82;
    }
}

@keyframes singularity-warp {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.03);
    }
}

@keyframes singularity-accretion {
    0% {
        transform: rotate(0deg) scale(0.96);
    }

    100% {
        transform: rotate(360deg) scale(1.06);
    }
}

@keyframes singularity-core-pulse {

    0%,
    100% {
        transform: scale(1);
        filter: brightness(1);
    }

    50% {
        transform: scale(0.92);
        filter: brightness(1.3);
    }
}

@keyframes singularity-event-horizon {
    0% {
        transform: translateZ(-18px) scale(1);
        opacity: 0.85;
    }

    100% {
        transform: translateZ(-18px) scale(1.15);
        opacity: 1;
    }
}

@keyframes singularity-disk-spin {
    0% {
        transform: translateZ(-60px) rotate(0deg);
    }

    100% {
        transform: translateZ(-60px) rotate(360deg);
    }
}

/* ─── Selection ─────────────────────────────────────── */
::selection {
    background: rgba(56, 189, 248, 0.3);
    color: #fff;
}

/* ─── Scrollbar ─────────────────────────────────────── */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

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

::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.2);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.35);
}

/* ─── Sortable Cards (Drag & Drop) ────────────────────── */
.sortable-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
    margin-bottom: 32px;
}

@media (max-width: 1200px) {
    .sortable-grid {
        grid-template-columns: 1fr;
    }
}

.flow-card.dragging {
    opacity: 0.72;
    border: 1px dashed var(--glass-border) !important;
    transform: scale(0.985) !important;
    box-shadow: 0 18px 42px rgba(2, 6, 23, 0.42);
    cursor: grabbing;
}

.flow-card.drag-source-hidden {
    display: none !important;
}

.flow-card-sort-ghost {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 10050;
    margin: 0;
    pointer-events: none;
    cursor: grabbing;
    opacity: 0.96;
    border: 1px solid rgba(125, 211, 252, 0.34) !important;
    box-shadow:
        0 22px 44px rgba(2, 8, 23, 0.46),
        0 0 0 1px rgba(56, 189, 248, 0.28),
        0 10px 22px rgba(56, 189, 248, 0.12);
    transform-origin: top left;
    will-change: transform;
    animation: none !important;
    transition: none !important;
}

.flow-card-drop-placeholder {
    border-radius: var(--radius-xl);
    border: 1px dashed rgba(56, 189, 248, 0.42);
    background:
        linear-gradient(145deg, rgba(56, 189, 248, 0.08), rgba(56, 189, 248, 0.03)),
        rgba(15, 23, 42, 0.22);
    box-shadow:
        inset 0 0 0 1px rgba(186, 230, 253, 0.12),
        0 0 0 2px rgba(56, 189, 248, 0.1);
    min-height: 120px;
    animation: flowDropPlaceholderPulse 0.9s ease-in-out infinite alternate;
}

@keyframes flowDropPlaceholderPulse {
    from {
        border-color: rgba(56, 189, 248, 0.3);
        box-shadow:
            inset 0 0 0 1px rgba(186, 230, 253, 0.08),
            0 0 0 1px rgba(56, 189, 248, 0.08);
    }

    to {
        border-color: rgba(56, 189, 248, 0.56);
        box-shadow:
            inset 0 0 0 1px rgba(186, 230, 253, 0.18),
            0 0 0 2px rgba(56, 189, 248, 0.18),
            0 10px 20px rgba(2, 8, 23, 0.2);
    }
}

.sortable-grid.drag-active,
.sortable-grid.is-drag-active {
    user-select: none;
}

.drag-sorting-active,
.drag-sorting-active * {
    user-select: none !important;
    -webkit-user-select: none !important;
}

.drag-sorting-active {
    cursor: grabbing;
}

.sortable-grid.drag-active .flow-card:not(.dragging) {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.sortable-grid.drag-active .flow-card:not(.dragging):hover {
    transform: none;
}

.flow-card .drag-handle {
    cursor: grab;
}

.flow-card .drag-handle:active {
    cursor: grabbing;
}

/* ─── Particle Background ──────────────────────────── */
#hydro-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: var(--gradient-ocean);
}

/* Subtle ambient glow overlay */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 20%, rgba(56, 189, 248, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(74, 222, 128, 0.03) 0%, transparent 50%);
    z-index: 0;
    pointer-events: none;
    animation: ambientDrift 20s ease-in-out infinite alternate;
}

@keyframes ambientDrift {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    100% {
        transform: translate(30px, -20px) rotate(3deg);
    }
}

/* ─── Sidebar ───────────────────────────────────────── */
#sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    z-index: 100;
    display: flex;
    flex-direction: column;
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.06) 38%, rgba(8, 15, 35, 0.2) 100%),
        rgba(8, 15, 35, 0.32);
    backdrop-filter: blur(4px) saturate(118%);
    -webkit-backdrop-filter: blur(4px) saturate(118%);
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 14px 0 38px rgba(2, 8, 23, 0.2);
    transition: transform 0.45s var(--ease-out-expo), opacity 0.25s ease;
    overflow: hidden;
    transform: translateX(-100%);
    opacity: 0;
}

#sidebar.visible {
    transform: translateX(0);
    opacity: 1;
}

/* Sidebar shimmer edge */
#sidebar::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(180deg, transparent 0%, rgba(56, 189, 248, 0.15) 30%, rgba(74, 222, 128, 0.1) 70%, transparent 100%);
    animation: shimmerEdge 4s ease-in-out infinite alternate;
}

@keyframes shimmerEdge {
    0% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 20px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.brand-icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    animation: brandPulse 3s ease-in-out infinite;
}

@keyframes brandPulse {

    0%,
    100% {
        filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.3));
    }

    50% {
        filter: drop-shadow(0 0 12px rgba(74, 222, 128, 0.4));
    }
}

.brand-icon svg {
    width: 100%;
    height: 100%;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 1.1rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.brand-subtitle {
    font-size: 0.65rem;
    color: var(--stagnant);
    text-transform: uppercase;
    letter-spacing: 2.5px;
    font-weight: 600;
    opacity: 0.6;
}

.nav-section-label {
    padding: 22px 20px 6px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: var(--stagnant);
    opacity: 0.4;
}

.nav-links {
    list-style: none;
    padding: 0 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    min-height: var(--interactive-target-size);
    border-radius: var(--radius-md);
    color: var(--shallow-text);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: color var(--motion-fast) ease, background var(--motion-medium) var(--ease-out-expo), transform var(--motion-fast) var(--ease-out-expo), box-shadow var(--motion-medium) ease;
    position: relative;
    overflow: hidden;
}

/* Active indicator — glowing left bar */
.nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scaleY(0);
    width: 3px;
    height: 20px;
    background: var(--gradient-primary);
    border-radius: 0 4px 4px 0;
    transition: transform 0.35s var(--ease-spring);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

/* ─── Date Filters & Modals ─── */
.date-filter {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-right: 20px;
    padding: 6px 16px;
    border-radius: 100px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.05) 40%, rgba(15, 23, 42, 0.18) 100%),
        rgba(15, 23, 42, 0.24);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 8px 20px rgba(2, 8, 23, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px) saturate(118%);
    -webkit-backdrop-filter: blur(4px) saturate(118%);
    transition: border-color var(--motion-medium) ease, box-shadow var(--motion-medium) ease, transform var(--motion-fast) var(--ease-out-expo), background var(--motion-medium) ease;
}

.date-filter:hover {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.07) 40%, rgba(15, 23, 42, 0.14) 100%),
        rgba(15, 23, 42, 0.2);
    border-color: rgba(56, 189, 248, 0.36);
    box-shadow: 0 10px 24px rgba(2, 8, 23, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 0 18px rgba(56, 189, 248, 0.12);
    transform: translateY(-1px);
}

.goflow-input.date-input {
    background-color: transparent !important;
    background: none !important;
    border: none !important;
    color: #f8fafc !important;
    /* Forces white text */
    font-family: var(--font-primary);
    font-size: 0.88rem;
    font-weight: 500;
    outline: none !important;
    cursor: pointer;
    color-scheme: dark;
    /* Forces dark mode dropdown and icon */
    padding: 0 !important;
    margin: 0;
    box-shadow: none !important;
    -webkit-appearance: none;
    appearance: none;
}

.goflow-input.date-input::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(2) contrast(2);
    /* Forces white icon */
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.2s;
    margin-left: 8px;
    padding: 0;
}

.goflow-input.date-input::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
    transform: scale(1.1);
}

.date-sep {
    color: var(--stagnant);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-apply-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: var(--interactive-target-size);
    padding: 7px 14px;
    border: 1px solid rgba(74, 222, 128, 0.3);
    border-radius: 100px;
    background: rgba(74, 222, 128, 0.1);
    color: #4ade80;
    font-family: var(--font-primary);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: transform var(--motion-fast) var(--ease-out-expo), border-color var(--motion-fast) ease, background var(--motion-fast) ease, color var(--motion-fast) ease, box-shadow var(--motion-medium) ease;
    white-space: nowrap;
}

.filter-apply-btn:hover {
    background: rgba(74, 222, 128, 0.2);
    border-color: rgba(74, 222, 128, 0.5);
    box-shadow: 0 0 12px rgba(74, 222, 128, 0.15);
    transform: translateY(-1px);
}

.filter-apply-btn:active {
    transform: scale(0.96);
}

.filter-apply-btn:disabled,
.filter-apply-btn.loading {
    opacity: 0.5;
    pointer-events: none;
    cursor: wait;
}

.filter-apply-btn svg {
    flex-shrink: 0;
}

/* Modals */
#goflow-modal-root {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.goflow-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 16, 0.38);
    backdrop-filter: blur(8px) brightness(0.82);
    -webkit-backdrop-filter: blur(8px) brightness(0.82);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: auto;
}

.goflow-modal-content {
    position: relative;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    background:
        linear-gradient(155deg, rgba(186, 230, 253, 0.028) 0%, rgba(56, 189, 248, 0.012) 18%, rgba(2, 8, 23, 0.18) 44%, rgba(2, 8, 23, 0.34) 100%),
        rgba(2, 8, 23, 0.34);
    border: 1px solid rgba(191, 219, 254, 0.1);
    border-radius: var(--radius-xl);
    box-shadow:
        0 28px 56px rgba(2, 8, 23, 0.42),
        0 0 0 1px rgba(15, 23, 42, 0.32),
        inset 0 1px 0 rgba(191, 219, 254, 0.08),
        inset 0 -18px 42px rgba(2, 8, 23, 0.18);
    backdrop-filter: blur(14px) saturate(118%) contrast(118%) brightness(0.56);
    -webkit-backdrop-filter: blur(14px) saturate(118%) contrast(118%) brightness(0.56);
    transform: scale(0.95) translateY(10px);
    opacity: 0;
    transition: transform 0.4s var(--ease-spring), opacity 0.3s ease;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
}

.goflow-modal-open .goflow-modal-overlay {
    opacity: 1;
}

.goflow-modal-open .goflow-modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #f1f5f9;
}

.modal-close {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--stagnant);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    color: var(--surface-text);
}

.nav-link.active::before {
    transform: translateY(-50%) scaleY(1);
}

.nav-link::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-md);
    background: radial-gradient(ellipse at left center, rgba(56, 189, 248, 0.06) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-link:hover {
    color: var(--surface-text);
    transform: translateX(1px);
}

.nav-link:hover::after {
    opacity: 1;
}

.nav-link.active {
    color: #fff;
    background:
        linear-gradient(90deg, rgba(56, 189, 248, 0.18) 0%, rgba(56, 189, 248, 0.06) 66%, transparent 100%),
        rgba(56, 189, 248, 0.06);
    box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.16);
}

.nav-link.active::before {
    transform: translateY(-50%) scaleY(1);
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.5;
    transition: opacity 0.3s ease, transform 0.3s var(--ease-spring);
    position: relative;
    z-index: 1;
}

.nav-link:hover .nav-icon {
    opacity: 0.85;
    transform: scale(1.08);
}

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

.nav-link span {
    position: relative;
    z-index: 1;
}

.nav-link:focus-visible,
.quick-filter-btn:focus-visible,
.goflow-tab:focus-visible,
.filter-apply-btn:focus-visible,
.theme-toggle-btn:focus-visible,
.flow-card-expand:focus-visible,
.cmd-item:focus-visible,
.admin-action-btn:focus-visible,
.goflow-win-btn:focus-visible,
.mobile-toggle:focus-visible,
.upload-zone:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

/* ─── Theme Selector Dropdown ──────────────────────── */
.theme-select-dropdown {
    width: 100%;
    margin-bottom: 8px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--stagnant);
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.7)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
}

.theme-select-dropdown:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.theme-select-dropdown option {
    background: #0f172a;
    color: #fff;
    padding: 10px;
}

.sidebar-footer {
    margin-top: auto;
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.theme-selector-container {
    position: relative;
    width: 100%;
}

#btn-presentation {
    margin-top: 8px;
}

.upload-zone {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1.5px dashed rgba(148, 163, 184, 0.2);
    color: var(--stagnant);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.4s var(--ease-out-expo);
    margin-bottom: 12px;
}

.upload-zone:hover {
    border-color: rgba(74, 222, 128, 0.4);
    background: rgba(74, 222, 128, 0.04);
    color: var(--laminar);
    transform: translateY(-1px);
    animation: organicPulse 2s ease-in-out infinite alternate;
}

@keyframes organicPulse {
    0% {
        box-shadow: 0 0 10px rgba(74, 222, 128, 0.05);
    }

    100% {
        box-shadow: 0 0 24px rgba(74, 222, 128, 0.25);
    }
}

.upload-zone.drag-over {
    border-color: var(--laminar);
    background: rgba(74, 222, 128, 0.08);
    box-shadow: 0 0 30px var(--laminar-glow);
    transform: scale(1.02);
}

.upload-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: transform 0.3s var(--ease-spring);
}

.upload-zone:hover .upload-icon {
    transform: translateY(-2px);
}

.footer-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.68rem;
    color: var(--stagnant);
    opacity: 0.35;
    letter-spacing: 0.3px;
}

.footer-info.footer-meta {
    margin-top: 6px;
}

.flow-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--laminar);
    animation: breathe 3s ease-in-out infinite;
}

@keyframes breathe {

    0%,
    100% {
        box-shadow: 0 0 4px var(--laminar-glow);
        opacity: 0.8;
        transform: scale(1);
    }

    50% {
        box-shadow: 0 0 14px var(--laminar-glow);
        opacity: 1;
        transform: scale(1.15);
    }
}

/* ─── Mobile Toggle ─────────────────────────────────── */
.mobile-toggle {
    display: none;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 200;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 999px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.06) 42%, rgba(8, 15, 35, 0.14) 100%),
        rgba(8, 15, 35, 0.24);
    backdrop-filter: blur(4px);
    color: var(--surface-text);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--glass-border);
    transition: all 0.3s var(--ease-out-expo);
}

.mobile-toggle:active {
    transform: scale(0.92);
}

.mobile-toggle svg {
    width: 20px;
    height: 20px;
}

/* ─── Main Content ──────────────────────────────────── */
#main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    position: relative;
    z-index: 1;
    opacity: 0;
    pointer-events: none;
}

#main-content.visible {
    opacity: 1;
    pointer-events: auto;
}

/* ─── Presentation Mode (Studio) ────────────────────────── */
body.presentation-mode #sidebar {
    animation: none !important;
    transform: translateX(calc(-100% - 24px));
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

body.presentation-mode #main-content {
    margin-left: 0;
    width: 100%;
}

body.presentation-mode .header-right .date-filter {
    display: none !important;
}

body.presentation-mode #main-header {
    justify-content: center;
}

body.presentation-mode .header-left {
    text-align: center;
}

body.presentation-mode .mobile-toggle {
    display: flex !important;
    top: 18px;
    left: 18px;
    background: var(--glass-bg);
    border-color: var(--glass-border-hover);
    box-shadow: var(--shadow-card);
}

/* ─── Header ────────────────────────────────────────── */
#main-header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    padding: 0 32px;
    background:
        linear-gradient(150deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.04) 46%, rgba(2, 6, 23, 0.16) 100%),
        rgba(2, 6, 23, 0.28);
    backdrop-filter: blur(4px) saturate(118%);
    -webkit-backdrop-filter: blur(4px) saturate(118%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 24px rgba(2, 8, 23, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.header-left h1 {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.6px;
    background: linear-gradient(135deg, #fff 0%, #bae6fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-breadcrumb {
    font-size: 0.72rem;
    color: var(--stagnant);
    opacity: 0.5;
    margin-top: 1px;
    letter-spacing: 0.3px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

#header-custos-toggle {
    display: none;
    margin-bottom: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

#header-user-info {
    font-size: 0.85rem;
    color: var(--stagnant);
}

.goflow-btn {
    border: 1px solid transparent;
    border-radius: 10px;
    font-family: var(--font-primary);
    min-height: var(--interactive-target-size);
    padding: 8px 14px;
    cursor: pointer;
    transition: transform var(--motion-fast) var(--ease-out-expo), border-color var(--motion-fast) ease, background var(--motion-fast) ease, color var(--motion-fast) ease, box-shadow var(--motion-medium) ease;
}

.goflow-btn.sm {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 0.78rem;
    border-radius: 8px;
}

.goflow-btn.error {
    border-color: rgba(239, 68, 68, 0.36);
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.goflow-btn:focus-visible {
    box-shadow: var(--focus-ring);
}

.goflow-btn-logout {
    min-height: 34px;
    padding: 6px 12px;
    font-size: 0.8rem;
    background: transparent;
    border-color: var(--glass-border);
    color: #ef4444;
    border-radius: 8px;
}

.goflow-btn-logout:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.34);
}

/* ─── Quick Filters ─────────────────────────────────── */
.quick-filters {
    display: flex;
    gap: 6px;
    margin-right: 12px;
    padding-right: 12px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.quick-filter-btn {
    background:
        linear-gradient(130deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.03) 100%),
        rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: rgba(255, 255, 255, 0.6);
    border-radius: 999px;
    min-height: var(--interactive-target-size);
    padding: 6px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--motion-fast) var(--ease-out-expo), background var(--motion-fast) ease, color var(--motion-fast) ease, border-color var(--motion-fast) ease, box-shadow var(--motion-medium) ease;
}

.quick-filter-btn:hover {
    background:
        linear-gradient(130deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.07) 100%),
        rgba(255, 255, 255, 0.05);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.24);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 4px 12px rgba(2, 8, 23, 0.2);
}

.quick-filter-btn:active {
    transform: scale(0.95);
}

/* ─── GoFlow Tabs (Toggle) ─── */
.goflow-tabs {
    display: flex;
    gap: 4px;
    background:
        linear-gradient(130deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.03) 100%),
        rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    padding: 4px;
    align-items: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 6px 16px rgba(2, 8, 23, 0.16);
}

.goflow-tab {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    border-radius: 999px;
    min-height: var(--interactive-target-size);
    padding: 7px 12px;
    font-size: 0.72rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: transform var(--motion-fast) var(--ease-out-expo), background var(--motion-fast) ease, color var(--motion-fast) ease, box-shadow var(--motion-medium) ease;
    letter-spacing: 0.2px;
}

.goflow-tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.goflow-tab.active {
    background: linear-gradient(130deg, rgba(74, 222, 128, 0.9) 0%, rgba(74, 222, 128, 0.74) 100%);
    color: var(--abyss-bg, #020617);
    box-shadow: 0 0 12px var(--laminar-glow), inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.header-date {
    font-size: 0.82rem;
    color: var(--shallow-text);
    font-weight: 500;
    opacity: 0.7;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px;
    border-radius: 100px;
    background: rgba(74, 222, 128, 0.06);
    border: 1px solid rgba(74, 222, 128, 0.15);
    transition: all 0.3s ease;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    animation: breathe 3s ease-in-out infinite;
}

.status-dot.laminar {
    background: var(--laminar);
}

.status-dot.turbulent {
    background: var(--turbulent);
}

.status-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--laminar);
    letter-spacing: 0.3px;
}

/* ─── Content Area ──────────────────────────────────── */
#content-area {
    padding: 24px 32px 80px;
}

/* ─── Dashboard Sections ────────────────────────────── */
.dashboard-section {
    display: none;
}

.dashboard-section.active {
    display: block;
    animation: sectionReveal 0.6s var(--ease-out-expo) forwards;
}

@keyframes sectionReveal {
    from {
        opacity: 0;
        transform: translateY(24px);
        filter: blur(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

/* ─── KPI Grid ──────────────────────────────────────── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
    margin-bottom: 32px;
}

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

/* ─── KPI Card — Apple-style ────────────────────────── */
.kpi-card {
    position: relative;
    padding: 18px 19px;
    border-radius: var(--radius-xl);
    background:
        linear-gradient(140deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.05) 42%, rgba(15, 23, 42, 0.2) 100%),
        var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition:
        transform var(--motion-medium) var(--ease-out-expo),
        box-shadow var(--motion-medium) ease,
        border-color var(--motion-fast) ease,
        background var(--motion-fast) ease;
    will-change: transform;
    backdrop-filter: blur(2px) saturate(116%) contrast(108%);
    -webkit-backdrop-filter: blur(2px) saturate(116%) contrast(108%);

    /* Reveal Animation Properties */
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUpReveal 0.6s var(--ease-out-expo) forwards;
}

/* Base fade-up animation for cards */
@keyframes fadeUpReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cascade delays for up to 10 elements */
.kpi-card:nth-child(1) {
    animation-delay: 0.1s;
}

.kpi-card:nth-child(2) {
    animation-delay: 0.15s;
}

.kpi-card:nth-child(3) {
    animation-delay: 0.2s;
}

.kpi-card:nth-child(4) {
    animation-delay: 0.25s;
}

.kpi-card:nth-child(5) {
    animation-delay: 0.3s;
}

.kpi-card:nth-child(6) {
    animation-delay: 0.35s;
}

.kpi-card:nth-child(7) {
    animation-delay: 0.4s;
}

.kpi-card:nth-child(8) {
    animation-delay: 0.45s;
}

.kpi-card:nth-child(n+9) {
    animation-delay: 0.5s;
}

/* Top accent line — hidden until hover */
.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s var(--ease-out-expo);
}

/* Inner glow */
.kpi-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-xl);
    background:
        radial-gradient(155% 135% at 8% -4%, rgba(186, 230, 253, 0.135) 0%, rgba(186, 230, 253, 0.046) 24%, transparent 50%),
        radial-gradient(126% 126% at 92% 112%, rgba(125, 211, 252, 0.11) 0%, rgba(125, 211, 252, 0.03) 16%, transparent 46%),
        radial-gradient(172% 150% at 50% 50%, rgba(125, 211, 252, 0.054) 0%, rgba(125, 211, 252, 0.016) 34%, transparent 54%, rgba(125, 211, 252, 0.078) 68%, rgba(2, 16, 38, 0.28) 100%),
        radial-gradient(170% 170% at 50% 50%, transparent 56%, rgba(125, 211, 252, 0.022) 63%, rgba(125, 211, 252, 0.086) 73%, rgba(2, 16, 38, 0.24) 100%),
        radial-gradient(ellipse at top left, rgba(56, 189, 248, 0.07) 0%, transparent 60%);
    opacity: 0.28;
    transform: scale(1.02);
    transition: opacity 0.4s ease, transform 0.4s ease, background-size 0.4s ease;
    pointer-events: none;
    backdrop-filter: blur(4px) saturate(126%) contrast(118%) brightness(0.92);
    -webkit-backdrop-filter: blur(4px) saturate(126%) contrast(118%) brightness(0.92);
    box-shadow: inset 0 0 0 999px var(--glass-smoke), inset 0 1px 0 rgba(191, 219, 254, 0.08), inset 0 -1px 0 rgba(2, 16, 38, 0.2);
    background-size: 114% 114%, 114% 114%, 128% 128%, 130% 130%, 100% 100%;
    z-index: 0;
}

.kpi-card:hover {
    transform: translateY(-2px) scale(1.002);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--glass-border-hover);
}

.kpi-card:hover::before {
    transform: scaleX(1);
}

.kpi-card:hover::after {
    opacity: 0.88;
    transform: scale(1.034);
    background-size: 120% 120%, 118% 118%, 136% 136%, 138% 138%, 102% 102%;
}

.kpi-card .kpi-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    position: relative;
    z-index: 1;
}

.kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    transition: transform 0.28s var(--ease-spring), border-color 0.24s ease, background 0.24s ease;
}

.kpi-card:hover .kpi-icon {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.24);
}

.kpi-icon.blue {
    background: rgba(56, 189, 248, 0.1);
}

.kpi-icon.green {
    background: rgba(74, 222, 128, 0.1);
}

.kpi-icon.amber {
    background: rgba(251, 191, 36, 0.1);
}

.kpi-icon.purple {
    background: rgba(129, 140, 248, 0.1);
}

.kpi-icon.red {
    background: rgba(248, 113, 113, 0.1);
}

.kpi-icon.cyan {
    background: rgba(34, 211, 238, 0.1);
}

.kpi-trend {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 100px;
    letter-spacing: 0.3px;
    transition: transform 0.3s var(--ease-spring);
}

.kpi-card:hover .kpi-trend {
    transform: scale(1.05);
}

.kpi-trend.up {
    background: rgba(74, 222, 128, 0.12);
    color: var(--laminar);
}

.kpi-trend.down {
    background: rgba(248, 113, 113, 0.12);
    color: #f87171;
}

.kpi-trend.stable {
    background: rgba(148, 163, 184, 0.1);
    color: var(--stagnant);
}

.kpi-label {
    font-size: 0.74rem;
    color: var(--stagnant);
    font-weight: 600;
    margin-bottom: 5px;
    position: relative;
    z-index: 1;
    letter-spacing: 0.25px;
}

.kpi-value {
    font-size: clamp(1.42rem, 2vw, 1.86rem);
    font-weight: 800;
    letter-spacing: -0.65px;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1, "lnum" 1;
    position: relative;
    z-index: 1;
    background: linear-gradient(135deg, #fff 30%, var(--shallow-text) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.kpi-sub {
    font-size: 0.72rem;
    color: var(--stagnant);
    margin-top: 4px;
    opacity: 0.78;
    position: relative;
    z-index: 1;
}

/* Flow indicator bar */
.kpi-flow-bar {
    margin-top: 14px;
    height: 3px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.kpi-flow-bar-fill {
    height: 100%;
    border-radius: 10px;
    background: var(--gradient-primary);
    transition: width 1.4s var(--ease-out-expo);
    position: relative;
}

/* Shimmer animation on the flow bar fill */
.kpi-flow-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    animation: shimmer 2.5s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 200%;
    }
}

/* ─── Flow Cards (chart containers) ─────────────────── */
.flow-card {
    background:
        linear-gradient(140deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 42%, rgba(15, 23, 42, 0.2) 100%),
        var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    padding: 20px;
    transition:
        transform var(--motion-medium) var(--ease-out-expo),
        box-shadow var(--motion-medium) ease,
        border-color var(--motion-fast) ease,
        background var(--motion-fast) ease;
    will-change: transform;
    backdrop-filter: blur(2px) saturate(116%) contrast(108%);
    -webkit-backdrop-filter: blur(2px) saturate(116%) contrast(108%);
    position: relative;
    overflow: hidden;

    /* Reveal Animation Properties */
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUpReveal 0.6s var(--ease-out-expo) forwards;
}

/* Cascade delays for up to 10 flow-cards */
.flow-card:nth-child(1) {
    animation-delay: 0.1s;
}

.flow-card:nth-child(2) {
    animation-delay: 0.2s;
}

.flow-card:nth-child(3) {
    animation-delay: 0.3s;
}

.flow-card:nth-child(4) {
    animation-delay: 0.4s;
}

.flow-card:nth-child(5) {
    animation-delay: 0.5s;
}

.flow-card:nth-child(6) {
    animation-delay: 0.6s;
}

.flow-card:nth-child(n+7) {
    animation-delay: 0.7s;
}

/* Subtle inner light */
.flow-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background:
        radial-gradient(155% 135% at 8% -4%, rgba(186, 230, 253, 0.13) 0%, rgba(186, 230, 253, 0.042) 24%, transparent 50%),
        radial-gradient(126% 126% at 92% 112%, rgba(125, 211, 252, 0.102) 0%, rgba(125, 211, 252, 0.028) 16%, transparent 46%),
        radial-gradient(172% 150% at 50% 50%, rgba(125, 211, 252, 0.05) 0%, rgba(125, 211, 252, 0.016) 34%, transparent 54%, rgba(125, 211, 252, 0.072) 68%, rgba(2, 16, 38, 0.28) 100%),
        radial-gradient(170% 170% at 50% 50%, transparent 56%, rgba(125, 211, 252, 0.02) 63%, rgba(125, 211, 252, 0.08) 73%, rgba(2, 16, 38, 0.24) 100%),
        radial-gradient(circle at top left, rgba(56, 189, 248, 0.1) 0%, transparent 60%);
    pointer-events: none;
    border-radius: var(--radius-xl);
    transform: scale(1.018);
    transition: opacity 0.5s ease, transform 0.5s ease, background-size 0.5s ease;
    opacity: 0.44;
    backdrop-filter: blur(4px) saturate(126%) contrast(118%) brightness(0.92);
    -webkit-backdrop-filter: blur(4px) saturate(126%) contrast(118%) brightness(0.92);
    box-shadow: inset 0 0 0 999px var(--glass-smoke), inset 0 1px 0 rgba(191, 219, 254, 0.08), inset 0 -1px 0 rgba(2, 16, 38, 0.2);
    background-size: 114% 114%, 114% 114%, 128% 128%, 130% 130%, 100% 100%;
}

.flow-card:hover {
    border-color: rgba(56, 189, 248, 0.35);
    transform: translateY(-2px) scale(1.002);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28), 0 0 20px rgba(56, 189, 248, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.flow-card:hover::before {
    opacity: 0.92;
    transform: scale(1.032);
    background-size: 120% 120%, 118% 118%, 136% 136%, 138% 138%, 102% 102%;
}

@supports selector(.flow-card:has(.table-wrap:hover)) {

    .flow-card:has(.table-wrap:hover),
    .flow-card:has(.table-wrap:focus-within) {
        transform: none;
        box-shadow: var(--shadow-card);
    }

    .flow-card:has(.table-wrap:hover)::before,
    .flow-card:has(.table-wrap:focus-within)::before {
        opacity: 0.44;
        transform: scale(1.018);
        background-size: 114% 114%, 114% 114%, 128% 128%, 130% 130%, 100% 100%;
    }
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    position: relative;
    z-index: 1;
}

.card-header h3 {
    font-size: 0.96rem;
    font-weight: 600;
    color: var(--surface-text);
    letter-spacing: -0.2px;
    line-height: 1.35;
}

.card-badge {
    font-size: 0.64rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 100px;
    background: rgba(56, 189, 248, 0.08);
    color: var(--abyss-text);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border: 1px solid rgba(56, 189, 248, 0.22);
    opacity: 0.95;
}

/* ─── Charts ────────────────────────────────────────── */
.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}

.charts-row .wide {
    grid-column: span 1;
}

.chart-container {
    position: relative;
    height: 260px;
    z-index: 1;
}

.chart-container.tall {
    height: 340px;
}

.chart-container.square {
    height: 280px;
}

.estoque-focus-row {
    align-items: stretch;
}

.estoque-focus-row .flow-card {
    height: 100%;
}

.estoque-top-card {
    display: flex;
    flex-direction: column;
}

.estoque-top-card .estoque-top-chart {
    height: auto;
    min-height: 280px;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 10px 16px;
}

.estoque-top-frame {
    width: min(100%, 700px);
    height: min(100%, 520px);
    min-height: 320px;
    margin: 0 auto;
    position: relative;
}

.estoque-top-frame canvas {
    width: 100% !important;
    height: 100% !important;
}

.estoque-intelligence-card {
    position: relative;
    z-index: 1;
    min-height: 280px;
}

.estoque-intel-shell {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 100%;
}

.estoque-intel-kpis {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.estoque-intel-kpi {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid rgba(125, 211, 252, 0.2);
    background:
        linear-gradient(148deg, rgba(191, 219, 254, 0.12) 0%, rgba(191, 219, 254, 0.03) 36%, rgba(2, 12, 30, 0.4) 100%),
        rgba(2, 10, 24, 0.42);
    box-shadow: inset 0 1px 0 rgba(191, 219, 254, 0.1), 0 10px 22px rgba(2, 8, 23, 0.28);
    padding: 9px 10px;
}

.estoque-intel-kpi::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(140% 110% at 8% -4%, rgba(186, 230, 253, 0.1) 0%, transparent 62%);
    opacity: 0.7;
    pointer-events: none;
}

.estoque-intel-kpi span {
    display: block;
    position: relative;
    z-index: 1;
    font-size: 0.56rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(186, 230, 253, 0.66);
    margin-bottom: 4px;
}

.estoque-intel-kpi strong {
    display: block;
    position: relative;
    z-index: 1;
    font-size: 0.98rem;
    line-height: 1;
    color: rgba(236, 254, 255, 0.95);
    font-weight: 760;
}

.estoque-intel-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 2px 0;
}

.estoque-intel-bar-item {
    border-radius: 12px;
    border: 1px solid rgba(125, 211, 252, 0.16);
    background:
        linear-gradient(142deg, rgba(191, 219, 254, 0.08) 0%, rgba(191, 219, 254, 0.02) 40%, rgba(2, 12, 30, 0.32) 100%),
        rgba(2, 10, 24, 0.34);
    padding: 7px 9px;
}

.estoque-intel-bar-head {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 7px;
    margin-bottom: 5px;
}

.estoque-intel-rank {
    font-size: 0.55rem;
    font-weight: 700;
    color: rgba(236, 254, 255, 0.84);
    border-radius: 999px;
    border: 1px solid rgba(125, 211, 252, 0.24);
    padding: 2px 6px;
    background: rgba(56, 189, 248, 0.08);
}

.estoque-intel-name {
    font-size: 0.66rem;
    color: rgba(224, 242, 254, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.estoque-intel-share {
    font-size: 0.62rem;
    color: rgba(186, 230, 253, 0.84);
    font-weight: 650;
}

.estoque-intel-track {
    position: relative;
    height: 6px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.7);
    overflow: hidden;
    margin-bottom: 4px;
}

.estoque-intel-fill {
    display: block;
    height: 100%;
    width: var(--fill, 0%);
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.55) 0%, rgba(74, 222, 128, 0.72) 100%);
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.36);
}

.estoque-intel-value {
    text-align: right;
    font-size: 0.6rem;
    color: rgba(191, 219, 254, 0.76);
    letter-spacing: 0.22px;
}

.estoque-intel-foot {
    margin-top: auto;
    border-radius: 12px;
    border: 1px solid rgba(125, 211, 252, 0.14);
    background:
        linear-gradient(140deg, rgba(191, 219, 254, 0.06) 0%, rgba(2, 12, 30, 0.24) 100%),
        rgba(2, 10, 24, 0.34);
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.estoque-intel-foot span {
    font-size: 0.62rem;
    color: rgba(186, 230, 253, 0.74);
}

.estoque-intel-foot strong {
    color: rgba(236, 254, 255, 0.95);
}

.estoque-intel-empty {
    min-height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
    border-radius: 14px;
    border: 1px dashed rgba(125, 211, 252, 0.24);
    background:
        linear-gradient(145deg, rgba(191, 219, 254, 0.06) 0%, rgba(2, 10, 24, 0.24) 100%),
        rgba(2, 10, 24, 0.36);
    color: rgba(186, 230, 253, 0.78);
    padding: 20px;
}

.estoque-intel-empty strong {
    font-size: 0.78rem;
    color: rgba(236, 254, 255, 0.9);
}

.estoque-intel-empty span {
    font-size: 0.68rem;
    max-width: 260px;
}

.chart-card.full-width,
.flow-card.full-width {
    margin-bottom: 14px;
}

/* ─── Data Tables ───────────────────────────────────── */
.table-wrap {
    background:
        linear-gradient(140deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.03) 42%, rgba(15, 23, 42, 0.14) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: 10px 10px 8px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 10px 22px rgba(2, 8, 23, 0.2);
    backdrop-filter: blur(3px) saturate(118%) contrast(108%);
    -webkit-backdrop-filter: blur(3px) saturate(118%) contrast(108%);
    overflow-x: auto;
    max-height: 420px;
    overflow-y: auto;
    position: relative;
    z-index: 1;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 6px;
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1, "lnum" 1;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.data-table thead th {
    position: sticky;
    top: 0;
    background: rgba(2, 10, 24, 0.68);
    color: rgba(224, 242, 254, 0.9);
    -webkit-text-fill-color: currentColor;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.68rem;
    letter-spacing: 0.85px;
    padding: 10px 12px;
    text-align: left;
    border-bottom: none;
    z-index: 5;
}

.data-table tbody tr {
    transition: background var(--motion-fast) ease, box-shadow var(--motion-medium) ease, border-color var(--motion-fast) ease;
    background: rgba(255, 255, 255, 0.03);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 6px 14px rgba(2, 8, 23, 0.16);
}

.data-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.09) 0%, rgba(56, 189, 248, 0.035) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 8px 18px rgba(2, 8, 23, 0.2);
    transform: none;
}

.data-table tbody td {
    padding: 10px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--stagnant);
    transition: color var(--motion-fast) ease, border-color var(--motion-fast) ease, background var(--motion-fast) ease;
}

.data-table tbody td:first-child {
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    border-top-left-radius: 999px;
    border-bottom-left-radius: 999px;
    padding-left: 16px;
}

.data-table tbody td:last-child {
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    border-top-right-radius: 999px;
    border-bottom-right-radius: 999px;
    padding-right: 16px;
}

.data-table tbody tr:hover td {
    color: var(--surface-text);
}

.data-table tbody tr.virtual-spacer,
.data-table tbody tr.virtual-spacer:hover {
    background: transparent !important;
    box-shadow: none !important;
    transform: none !important;
    pointer-events: none;
}

.data-table tbody tr.virtual-spacer td,
.data-table tbody tr.virtual-spacer td:first-child,
.data-table tbody tr.virtual-spacer td:last-child {
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    border-radius: 0 !important;
}

.data-table .number {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: var(--shallow-text);
}

.data-table tbody tr:hover .number {
    color: #fff;
}

.data-table .positive {
    color: var(--laminar);
    font-weight: 600;
}

.data-table .negative {
    color: #f87171;
    font-weight: 600;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    transition: transform 0.2s var(--ease-spring);
}

.badge:hover {
    transform: scale(1.08);
}

.badge.green {
    background: rgba(74, 222, 128, 0.12);
    color: var(--laminar);
    border: 1px solid rgba(74, 222, 128, 0.2);
}

.badge.red {
    background: rgba(248, 113, 113, 0.12);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.badge.amber {
    background: rgba(251, 191, 36, 0.12);
    color: var(--turbulent);
    border: 1px solid rgba(251, 191, 36, 0.2);
}

/* ─── Admin Panel ───────────────────────────────────── */
.admin-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    align-items: end;
}

.admin-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.admin-field>span {
    color: var(--stagnant);
    font-size: 0.75rem;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.admin-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background:
        linear-gradient(140deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.03) 38%, rgba(15, 23, 42, 0.14) 100%),
        var(--glass-bg);
    color: var(--surface-text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.admin-input:focus {
    border-color: var(--glass-border-hover);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.admin-checkbox-line {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    color: var(--stagnant);
    font-size: 0.85rem;
    user-select: none;
}

.admin-checkbox-line input {
    accent-color: var(--laminar);
}

.admin-modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
}

.admin-module-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background:
        linear-gradient(140deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.02) 100%),
        rgba(15, 23, 42, 0.12);
    color: var(--surface-text);
    font-size: 0.78rem;
}

.admin-module-option.is-disabled {
    opacity: 0.55;
}

.admin-module-option input {
    accent-color: var(--laminar);
}

.admin-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.admin-feedback {
    min-height: 18px;
    font-size: 0.78rem;
    color: var(--stagnant);
}

.admin-feedback.is-error {
    color: #f87171;
}

.admin-feedback.is-success {
    color: var(--laminar);
}

.admin-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.admin-action-btn {
    border: 1px solid rgba(255, 255, 255, 0.16);
    background:
        linear-gradient(140deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.03) 100%),
        rgba(15, 23, 42, 0.16);
    color: var(--surface-text);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.admin-action-btn:hover {
    border-color: var(--glass-border-hover);
    background: rgba(56, 189, 248, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 8px 16px rgba(2, 8, 23, 0.2);
}

.admin-action-btn.primary {
    border-color: transparent;
    background: var(--laminar);
    color: #062b29;
}

.admin-action-btn.danger {
    color: #fecaca;
    border-color: rgba(248, 113, 113, 0.3);
    background: rgba(248, 113, 113, 0.1);
}

.admin-action-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.admin-action-btn:disabled:hover {
    border-color: var(--glass-border);
    background: rgba(15, 23, 42, 0.6);
}

.admin-module-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.admin-module-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.66rem;
    border: 1px solid rgba(56, 189, 248, 0.16);
    background: rgba(56, 189, 248, 0.08);
    color: var(--abyss-text);
}

.admin-self-tag {
    color: var(--stagnant);
    font-size: 0.72rem;
    font-weight: 500;
}

.admin-modal-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ─── Checklist ─────────────────────────────────────── */
#checklist-kpis .kpi-card {
    --glass-smoke: rgba(2, 8, 23, 0.45);
    background:
        linear-gradient(0deg, rgba(2, 8, 23, 0.45), rgba(2, 8, 23, 0.45)),
        linear-gradient(140deg, rgba(191, 219, 254, 0.08) 0%, rgba(56, 189, 248, 0.024) 42%, rgba(15, 23, 42, 0.28) 100%),
        var(--glass-bg);
    border-color: rgba(125, 211, 252, 0.12);
    box-shadow:
        0 0 0 1px rgba(125, 211, 252, 0.08),
        0 8px 20px rgba(0, 0, 0, 0.24),
        0 18px 42px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(3px) saturate(112%) contrast(106%) brightness(0.84);
    -webkit-backdrop-filter: blur(3px) saturate(112%) contrast(106%) brightness(0.84);
}

#checklist-kpis .kpi-card:hover {
    box-shadow:
        0 0 0 1px rgba(125, 211, 252, 0.14),
        0 10px 24px rgba(0, 0, 0, 0.28),
        0 22px 48px rgba(0, 0, 0, 0.34);
}

#checklist-kpis .kpi-card:hover::after {
    opacity: 0.62;
}

.checklist-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    z-index: 1;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: all 0.35s var(--ease-out-expo);
    cursor: default;
}

.checklist-item:hover {
    background: rgba(56, 189, 248, 0.04);
    border-color: var(--glass-border);
    transform: translateX(4px);
}

.checklist-check {
    width: 26px;
    height: 26px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 800;
    transition: all 0.3s var(--ease-spring);
}

.checklist-item:hover .checklist-check {
    transform: scale(1.1);
}

.checklist-check.done {
    background: rgba(74, 222, 128, 0.12);
    color: var(--laminar);
    border: 1.5px solid rgba(74, 222, 128, 0.25);
    box-shadow: 0 0 12px rgba(74, 222, 128, 0.1);
}

.checklist-check.pending {
    background: rgba(148, 163, 184, 0.06);
    color: var(--stagnant);
    border: 1.5px solid rgba(148, 163, 184, 0.15);
}

.checklist-info {
    flex: 1;
}

.checklist-day {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--stagnant);
    opacity: 0.5;
    margin-bottom: 2px;
}

.checklist-activity {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--surface-text);
    transition: opacity 0.2s ease;
}

.checklist-item.completed .checklist-activity {
    text-decoration: line-through;
    opacity: 0.4;
}

/* ─── Glass Flow Loader (Post-Filter) ────────────────────── */
.loader-container {
    --loader-cyan: var(--abyss-text, #38bdf8);
    --loader-green: var(--laminar, #4ade80);
    --loader-muted: var(--stagnant, #94a3b8);
    --loader-stage: rgba(2, 6, 23, 0.74);
    --loader-flow-ease: cubic-bezier(0.22, 1, 0.36, 1);

    position: fixed;
    inset: 0;
    z-index: 980;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    padding: 48px 20px;
    overflow: hidden;
    background:
        radial-gradient(55% 46% at 19% 24%, rgba(56, 189, 248, 0.14) 0%, transparent 72%),
        radial-gradient(42% 40% at 82% 78%, rgba(74, 222, 128, 0.08) 0%, transparent 76%),
        linear-gradient(168deg, rgba(2, 10, 24, 0.86) 0%, rgba(1, 7, 21, 0.94) 100%);
    backdrop-filter: blur(16px) saturate(132%) contrast(114%) brightness(0.74);
    -webkit-backdrop-filter: blur(16px) saturate(132%) contrast(114%) brightness(0.74);
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    transition: opacity 0.34s var(--loader-flow-ease), visibility 0.34s ease;
}

.loader-container::before {
    content: '';
    position: absolute;
    inset: -20%;
    pointer-events: none;
    background:
        radial-gradient(circle at 30% 36%, rgba(56, 189, 248, 0.1) 0%, transparent 44%),
        radial-gradient(circle at 68% 64%, rgba(14, 165, 233, 0.08) 0%, transparent 42%);
    filter: blur(44px);
    animation: loaderAmbience 10s ease-in-out infinite alternate;
}

.loader-container::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(120% 70% at 50% 104%, rgba(1, 7, 21, 0.62) 0%, transparent 66%);
    mix-blend-mode: normal;
    opacity: 0.9;
}

.loader-container.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-container.is-exiting {
    opacity: 0.9;
}

.glassflow-loader-stage {
    position: relative;
    width: min(420px, 82vw);
    aspect-ratio: 1 / 1;
    display: grid;
    place-items: center;
    isolation: isolate;
    opacity: 1;
    filter: blur(0);
    transition: opacity 0.32s ease, filter 0.34s ease;
}

.glassflow-loader-stage::before {
    content: '';
    position: absolute;
    inset: 12%;
    border-radius: 42%;
    background:
        radial-gradient(circle at 26% 24%, rgba(56, 189, 248, 0.2) 0%, transparent 58%),
        radial-gradient(circle at 72% 74%, rgba(74, 222, 128, 0.14) 0%, transparent 62%);
    filter: blur(26px);
    opacity: 0.78;
    animation: stageBreath 5.6s ease-in-out infinite;
}

.glassflow-loader-stage::after {
    content: '';
    position: absolute;
    inset: 4%;
    border-radius: 50%;
    background:
        conic-gradient(from 0deg,
            transparent 0deg,
            rgba(56, 189, 248, 0.08) 46deg,
            transparent 90deg,
            rgba(74, 222, 128, 0.06) 132deg,
            transparent 180deg,
            rgba(56, 189, 248, 0.06) 238deg,
            transparent 300deg,
            rgba(125, 211, 252, 0.05) 334deg,
            transparent 360deg);
    filter: blur(2px);
    opacity: 0.62;
    animation: stageSpin 28s linear infinite;
    pointer-events: none;
}

.glassflow-void {
    position: absolute;
    inset: 22%;
    border-radius: 36%;
    background:
        radial-gradient(70% 70% at 50% 50%, rgba(2, 8, 23, 0.9) 0%, rgba(2, 8, 23, 0.32) 60%, transparent 100%);
    filter: blur(0.5px);
    opacity: 0.88;
    z-index: 0;
    animation: voidPulse 6.2s ease-in-out infinite;
}

.glassflow-river {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 228px;
    height: 72px;
    border-radius: 999px;
    background:
        linear-gradient(90deg, transparent 0%, rgba(125, 211, 252, 0.18) 38%, rgba(125, 211, 252, 0.44) 51%, rgba(125, 211, 252, 0.18) 66%, transparent 100%);
    box-shadow: 0 0 28px rgba(56, 189, 248, 0.14);
    filter: blur(0.8px);
    opacity: 0.72;
    z-index: 1;
    animation: riverMerge var(--river-speed, 5.8s) var(--loader-flow-ease) infinite;
}

.river-n {
    --river-from: translate(-50%, -190%) scaleX(0.36);
    --river-mid: translate(-50%, -124%) scaleX(1.08);
    --river-end: translate(-50%, -102%) scaleX(0.42);
    --river-speed: 5.9s;
}

.river-s {
    --river-from: translate(-50%, 90%) scaleX(0.34);
    --river-mid: translate(-50%, 26%) scaleX(1.04);
    --river-end: translate(-50%, 6%) scaleX(0.4);
    --river-speed: 6.2s;
}

.river-e {
    --river-from: translate(90%, -50%) rotate(90deg) scaleX(0.34);
    --river-mid: translate(24%, -50%) rotate(90deg) scaleX(1.06);
    --river-end: translate(4%, -50%) rotate(90deg) scaleX(0.4);
    --river-speed: 5.6s;
}

.river-w {
    --river-from: translate(-190%, -50%) rotate(90deg) scaleX(0.36);
    --river-mid: translate(-124%, -50%) rotate(90deg) scaleX(1.08);
    --river-end: translate(-102%, -50%) rotate(90deg) scaleX(0.42);
    --river-speed: 6.4s;
}

.glassflow-bubble-cloud {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

.flow-bubble {
    position: absolute;
    left: 50%;
    top: 50%;
    width: var(--bubble-size, 18px);
    height: var(--bubble-size, 18px);
    border-radius: 50%;
    border: 1px solid rgba(191, 219, 254, 0.22);
    background:
        linear-gradient(142deg, rgba(191, 219, 254, 0.15) 0%, rgba(191, 219, 254, 0.03) 34%, rgba(2, 8, 23, 0.6) 100%),
        rgba(2, 8, 23, 0.48);
    box-shadow:
        inset 0 1px 0 rgba(191, 219, 254, 0.14),
        inset 0 -1px 0 rgba(2, 10, 24, 0.44),
        0 12px 30px rgba(2, 8, 23, 0.36),
        0 0 16px rgba(56, 189, 248, 0.1);
    backdrop-filter: blur(1.8px) saturate(108%);
    -webkit-backdrop-filter: blur(1.8px) saturate(108%);
    transform: translate(var(--bubble-x), var(--bubble-y)) scale(0.34);
    opacity: 0;
    animation: flowBubbleMerge var(--bubble-speed, 7.4s) var(--loader-flow-ease) infinite;
    animation-delay: var(--bubble-delay, 0s);
}

.flow-bubble::before {
    content: '';
    position: absolute;
    left: 20%;
    top: 18%;
    width: 42%;
    height: 30%;
    border-radius: 999px;
    background: linear-gradient(120deg, rgba(226, 244, 255, 0.55) 0%, rgba(226, 244, 255, 0.04) 100%);
    opacity: 0.45;
}

.fb1 {
    --bubble-size: 24px;
    --bubble-x: -152px;
    --bubble-y: -112px;
    --bubble-mx: -86px;
    --bubble-my: -64px;
    --bubble-ex: -56px;
    --bubble-ey: -44px;
    --bubble-delay: 0.1s;
}

.fb2 {
    --bubble-size: 18px;
    --bubble-x: -18px;
    --bubble-y: -156px;
    --bubble-mx: -10px;
    --bubble-my: -88px;
    --bubble-ex: -6px;
    --bubble-ey: -60px;
    --bubble-delay: 0.4s;
}

.fb3 {
    --bubble-size: 20px;
    --bubble-x: 120px;
    --bubble-y: -130px;
    --bubble-mx: 72px;
    --bubble-my: -74px;
    --bubble-ex: 50px;
    --bubble-ey: -48px;
    --bubble-delay: 0.75s;
}

.fb4 {
    --bubble-size: 14px;
    --bubble-x: 170px;
    --bubble-y: -8px;
    --bubble-mx: 98px;
    --bubble-my: -4px;
    --bubble-ex: 62px;
    --bubble-ey: -2px;
    --bubble-delay: 1.05s;
}

.fb5 {
    --bubble-size: 22px;
    --bubble-x: 136px;
    --bubble-y: 114px;
    --bubble-mx: 82px;
    --bubble-my: 66px;
    --bubble-ex: 56px;
    --bubble-ey: 40px;
    --bubble-delay: 1.35s;
}

.fb6 {
    --bubble-size: 16px;
    --bubble-x: 10px;
    --bubble-y: 170px;
    --bubble-mx: 4px;
    --bubble-my: 96px;
    --bubble-ex: 2px;
    --bubble-ey: 60px;
    --bubble-delay: 1.7s;
}

.fb7 {
    --bubble-size: 23px;
    --bubble-x: -124px;
    --bubble-y: 130px;
    --bubble-mx: -74px;
    --bubble-my: 74px;
    --bubble-ex: -50px;
    --bubble-ey: 46px;
    --bubble-delay: 2.05s;
}

.fb8 {
    --bubble-size: 15px;
    --bubble-x: -172px;
    --bubble-y: 8px;
    --bubble-mx: -98px;
    --bubble-my: 8px;
    --bubble-ex: -62px;
    --bubble-ey: 6px;
    --bubble-delay: 2.35s;
}

.fb9 {
    --bubble-size: 12px;
    --bubble-x: 80px;
    --bubble-y: 162px;
    --bubble-mx: 46px;
    --bubble-my: 88px;
    --bubble-ex: 30px;
    --bubble-ey: 56px;
    --bubble-delay: 2.7s;
}

.fb10 {
    --bubble-size: 11px;
    --bubble-x: -86px;
    --bubble-y: -166px;
    --bubble-mx: -48px;
    --bubble-my: -94px;
    --bubble-ex: -30px;
    --bubble-ey: -60px;
    --bubble-delay: 2.95s;
}

.glassflow-core-card {
    position: relative;
    width: 140px;
    height: 140px;
    border-radius: 38px;
    border: 1px solid rgba(191, 219, 254, 0.24);
    background:
        linear-gradient(156deg, rgba(191, 219, 254, 0.14) 0%, rgba(191, 219, 254, 0.03) 30%, rgba(2, 8, 23, 0.68) 100%),
        rgba(2, 8, 23, 0.78);
    box-shadow:
        inset 0 1px 0 rgba(191, 219, 254, 0.2),
        inset 0 -1px 0 rgba(2, 10, 24, 0.62),
        0 26px 64px rgba(2, 8, 23, 0.52),
        0 0 22px rgba(56, 189, 248, 0.16);
    backdrop-filter: blur(8px) saturate(132%);
    -webkit-backdrop-filter: blur(8px) saturate(132%);
    display: grid;
    place-items: center;
    z-index: 3;
    animation: coreCardFloat 6.4s var(--loader-flow-ease) infinite;
}

.glassflow-core-card::before {
    content: '';
    position: absolute;
    inset: 7px;
    border-radius: 30px;
    border: 1px solid rgba(125, 211, 252, 0.18);
    opacity: 0.58;
}

.core-card-reflection {
    position: absolute;
    left: 11px;
    top: 10px;
    width: 58%;
    height: 28%;
    border-radius: 999px;
    background: linear-gradient(124deg, rgba(226, 244, 255, 0.52) 0%, rgba(226, 244, 255, 0.04) 100%);
    opacity: 0.56;
}

.core-card-refraction {
    position: absolute;
    inset: 24px;
    border-radius: 20px;
    background:
        radial-gradient(58% 52% at 28% 32%, rgba(255, 255, 255, 0.12) 0%, transparent 100%),
        radial-gradient(58% 52% at 76% 70%, rgba(56, 189, 248, 0.18) 0%, transparent 100%);
    opacity: 0.56;
    filter: blur(0.8px);
}

.core-card-logo {
    width: 64px;
    height: 64px;
    color: #95e4ff;
    filter: drop-shadow(0 0 15px rgba(56, 189, 248, 0.36));
    opacity: 0.9;
    animation: logoDrift 6.2s ease-in-out infinite;
}

.core-card-grid {
    position: absolute;
    inset: 12px;
    border-radius: 28px;
    background:
        repeating-linear-gradient(90deg, rgba(125, 211, 252, 0.06) 0 1px, transparent 1px 11px),
        repeating-linear-gradient(0deg, rgba(125, 211, 252, 0.06) 0 1px, transparent 1px 11px);
    opacity: 0.2;
    mix-blend-mode: screen;
    animation: gridPulse 3.8s ease-in-out infinite;
    pointer-events: none;
}

.glassflow-pulse-ring {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 112px;
    height: 112px;
    border-radius: 50%;
    border: 1px solid rgba(125, 211, 252, 0.18);
    transform: translate(-50%, -50%);
    opacity: 0;
    z-index: 2;
}

.ring-a {
    animation: ringPulse 3.6s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

.ring-b {
    animation: ringPulse 3.6s cubic-bezier(0.16, 1, 0.3, 1) infinite 1.8s;
}

.loader-text {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 18px 13px;
    border-radius: 18px;
    border: 1px solid rgba(125, 211, 252, 0.18);
    background:
        linear-gradient(148deg, rgba(191, 219, 254, 0.1) 0%, rgba(191, 219, 254, 0.02) 40%, rgba(2, 8, 23, 0.5) 100%),
        var(--loader-stage);
    box-shadow: 0 18px 46px rgba(2, 8, 23, 0.42), inset 0 1px 0 rgba(191, 219, 254, 0.12);
    backdrop-filter: blur(10px) saturate(124%);
    -webkit-backdrop-filter: blur(10px) saturate(124%);
    min-width: min(560px, 90vw);
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
    transition:
        opacity 0.3s ease,
        transform 0.42s var(--loader-flow-ease),
        filter 0.3s ease;
}

.loading-pulse {
    display: inline-block;
    font-size: 0.94rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2.3px;
    background: linear-gradient(90deg, var(--loader-cyan) 0%, var(--loader-green) 48%, var(--loader-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 240% 100%;
    animation: textFlow 4.1s ease-in-out infinite;
    transition: opacity 0.18s ease, filter 0.18s ease, transform 0.18s ease;
}

.loading-sub {
    font-size: 0.74rem;
    color: rgba(186, 230, 253, 0.7);
    letter-spacing: 0.22px;
    transition: opacity 0.18s ease, filter 0.18s ease, transform 0.18s ease;
}

.loading-pulse.is-swapping,
.loading-sub.is-swapping {
    opacity: 0.3;
    filter: blur(2px);
    transform: translateY(2px);
}

.loading-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    flex-wrap: wrap;
    margin-top: 2px;
}

.loading-step {
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid rgba(125, 211, 252, 0.14);
    background: rgba(2, 8, 23, 0.42);
    color: rgba(186, 230, 253, 0.6);
    font-size: 0.56rem;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.28s var(--ease-out-expo);
}

.loading-step.is-active {
    color: rgba(236, 254, 255, 0.95);
    border-color: rgba(125, 211, 252, 0.4);
    background:
        linear-gradient(140deg, rgba(125, 211, 252, 0.22) 0%, rgba(125, 211, 252, 0.06) 100%),
        rgba(2, 8, 23, 0.5);
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.22), inset 0 1px 0 rgba(191, 219, 254, 0.16);
    transform: translateY(-1px);
}

.loader-container.hidden .glassflow-loader-stage {
    opacity: 0;
    filter: blur(10px);
}

.loader-container.hidden .loader-text {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
    filter: blur(7px);
}

.loader-container.is-exiting .glassflow-loader-stage {
    opacity: 0.42;
    filter: blur(5px);
}

.loader-container.is-exiting .loader-text {
    opacity: 0.46;
    transform: translateY(10px) scale(0.992);
}

@keyframes loaderAmbience {
    from {
        transform: translate3d(-8px, 10px, 0) scale(0.99);
    }

    to {
        transform: translate3d(10px, -12px, 0) scale(1.02);
    }
}

@keyframes stageBreath {

    0%,
    100% {
        transform: scale(0.98);
        opacity: 0.62;
    }

    50% {
        transform: scale(1.03);
        opacity: 0.84;
    }
}

@keyframes stageSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes voidPulse {

    0%,
    100% {
        transform: scale(0.98);
        opacity: 0.76;
    }

    50% {
        transform: scale(1.03);
        opacity: 0.9;
    }
}

@keyframes riverMerge {

    0%,
    100% {
        transform: var(--river-from);
        opacity: 0.04;
    }

    34% {
        opacity: 0.66;
    }

    58% {
        transform: var(--river-mid);
        opacity: 0.52;
    }

    84% {
        transform: var(--river-end);
        opacity: 0.16;
    }
}

@keyframes flowBubbleMerge {
    0% {
        transform: translate(var(--bubble-x), var(--bubble-y)) scale(0.36);
        opacity: 0;
    }

    24% {
        opacity: 0.64;
    }

    68% {
        transform: translate(var(--bubble-mx), var(--bubble-my)) scale(1);
        opacity: 0.56;
    }

    100% {
        transform: translate(var(--bubble-ex), var(--bubble-ey)) scale(0.6);
        opacity: 0;
    }
}

@keyframes coreCardFloat {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-3px) scale(1.008);
    }
}

@keyframes logoDrift {

    0%,
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.3));
    }

    50% {
        transform: scale(1.018);
        filter: drop-shadow(0 0 16px rgba(56, 189, 248, 0.42));
    }
}

@keyframes gridPulse {

    0%,
    100% {
        opacity: 0.12;
    }

    50% {
        opacity: 0.22;
    }
}

@keyframes ringPulse {
    0% {
        transform: translate(-50%, -50%) scale(0.88);
        opacity: 0.6;
    }

    65% {
        opacity: 0.16;
    }

    100% {
        transform: translate(-50%, -50%) scale(2.08);
        opacity: 0;
    }
}

@keyframes textFlow {

    0%,
    100% {
        background-position: 0% 50%;
        opacity: 0.86;
    }

    50% {
        background-position: 100% 50%;
        opacity: 1;
    }
}

@media (max-width: 640px) {
    .glassflow-loader-stage {
        width: min(360px, 92vw);
    }

    .glassflow-core-card {
        width: 128px;
        height: 128px;
        border-radius: 34px;
    }

    .core-card-logo {
        width: 56px;
        height: 56px;
    }

    .loader-text {
        min-width: min(520px, 94vw);
        padding: 12px 12px;
    }

    .loading-pulse {
        font-size: 0.84rem;
        letter-spacing: 1.8px;
        text-align: center;
    }

    .loading-sub {
        font-size: 0.68rem;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {

    .loader-container::before,
    .glassflow-loader-stage::before,
    .glassflow-loader-stage::after,
    .glassflow-void,
    .glassflow-river,
    .flow-bubble,
    .glassflow-core-card,
    .core-card-logo,
    .core-card-grid,
    .glassflow-pulse-ring,
    .loading-pulse {
        animation: none !important;
    }
}

/* ─── Toast Notification ────────────────────────────── */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
    padding: 14px 22px;
    border-radius: 999px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.06) 42%, rgba(8, 15, 35, 0.14) 100%),
        rgba(8, 15, 35, 0.24);
    backdrop-filter: blur(4px) saturate(118%);
    -webkit-backdrop-filter: blur(4px) saturate(118%);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: var(--shadow-deep);
    color: var(--surface-text);
    font-size: 0.82rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastIn 0.5s var(--ease-out-expo), toastOut 0.4s var(--ease-out-expo) 3.2s forwards;
}

.toast.success {
    border-color: rgba(74, 222, 128, 0.25);
}

.toast.error {
    border-color: rgba(248, 113, 113, 0.25);
}

@keyframes toastIn {
    from {
        transform: translateX(120px) scale(0.9);
        opacity: 0;
        filter: blur(4px);
    }

    to {
        transform: translateX(0) scale(1);
        opacity: 1;
        filter: blur(0);
    }
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateX(60px) scale(0.95);
        filter: blur(2px);
        pointer-events: none;
    }
}

/* ─── Responsive ────────────────────────────────────── */
@media (max-width: 1024px) {
    .charts-row {
        grid-template-columns: 1fr;
    }

    .kpi-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }

    .estoque-intelligence-card {
        min-height: 0;
    }

    .estoque-top-card .estoque-top-chart {
        min-height: 320px;
    }

    .estoque-top-frame {
        width: min(100%, 620px);
        min-height: 300px;
    }
}

@media (max-width: 768px) {
    #sidebar {
        transform: translateX(-100%);
    }

    #sidebar.open {
        transform: translateX(0);
        box-shadow: 20px 0 60px rgba(0, 0, 0, 0.5);
    }

    .mobile-toggle {
        display: flex;
    }

    #main-content {
        margin-left: 0;
    }

    #main-header {
        padding: 0 16px 0 68px;
    }

    #content-area {
        padding: 16px 16px 60px;
    }

    .kpi-grid {
        grid-template-columns: 1fr 1fr;
    }

    .section-kpis {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {

    .kpi-grid,
    .section-kpis {
        grid-template-columns: 1fr;
    }

    .header-right {
        display: none;
    }

    #content-area {
        padding: 12px 12px 60px;
    }

    .estoque-intel-kpis {
        grid-template-columns: 1fr;
    }

    .estoque-intel-kpi strong {
        font-size: 0.9rem;
    }
}

/* ═══════════════════════════════════════════════════════
   LANDING SCREEN — Oracle DB Connection
   ═══════════════════════════════════════════════════════ */

.landing-screen {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
}

.landing-content {
    position: relative;
    max-width: 720px;
    width: 100%;
    text-align: center;
    animation: landingReveal 0.9s var(--ease-out-expo) forwards;
}

.landing-content::before {
    content: '';
    position: absolute;
    inset: -120px -40px;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(62% 50% at 22% 18%, rgba(56, 189, 248, 0.16) 0%, transparent 68%),
        radial-gradient(56% 48% at 78% 78%, rgba(14, 165, 233, 0.12) 0%, transparent 70%),
        radial-gradient(120% 100% at 50% 60%, rgba(2, 6, 23, 0.5) 0%, transparent 74%);
    filter: blur(14px);
    animation: landingGlassDrift 12s ease-in-out infinite alternate;
}

@keyframes landingReveal {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.97);
        filter: blur(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes landingGlassDrift {
    from {
        transform: translate3d(-10px, 8px, 0) scale(0.98);
    }

    to {
        transform: translate3d(10px, -10px, 0) scale(1.02);
    }
}

.landing-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 30px;
}

.landing-logo {
    width: 48px;
    height: 48px;
    animation: brandPulse 3s ease-in-out infinite;
}

.landing-title {
    font-size: 1.62rem;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.8px;
    text-align: left;
}

.landing-sub {
    font-size: 0.64rem;
    color: var(--stagnant);
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 700;
    opacity: 0.54;
    text-align: left;
}

.landing-headline {
    font-size: 2.95rem;
    font-weight: 900;
    letter-spacing: -2.2px;
    line-height: 1.05;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #ffffff 18%, #d4f3ff 62%, #38bdf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.landing-headline .accent {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.landing-desc {
    max-width: 620px;
    margin: 0 auto 32px;
    font-size: 0.92rem;
    color: rgba(176, 210, 234, 0.88);
    line-height: 1.62;
    opacity: 0.78;
}

.landing-upload-zone {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 52px 36px 34px;
    margin-bottom: 18px;
    border-radius: 38px;
    border: 1px solid rgba(125, 211, 252, 0.22);
    background:
        linear-gradient(148deg, rgba(186, 230, 253, 0.08) 0%, rgba(186, 230, 253, 0.02) 32%, rgba(2, 12, 30, 0.58) 100%),
        radial-gradient(130% 110% at 4% -18%, rgba(56, 189, 248, 0.1) 0%, transparent 60%),
        radial-gradient(130% 130% at 84% 120%, rgba(14, 165, 233, 0.08) 0%, transparent 52%),
        radial-gradient(150% 120% at 50% 120%, rgba(2, 6, 23, 0.36) 0%, transparent 60%),
        rgba(2, 10, 24, 0.68);
    backdrop-filter: blur(10px) saturate(122%) contrast(108%);
    -webkit-backdrop-filter: blur(10px) saturate(122%) contrast(108%);
    box-shadow:
        inset 0 1px 0 rgba(191, 219, 254, 0.12),
        inset 0 -1px 0 rgba(2, 10, 24, 0.5),
        0 24px 82px rgba(2, 8, 23, 0.46),
        0 0 0 1px rgba(125, 211, 252, 0.06);
    transition: border-color 0.38s ease, transform 0.38s var(--ease-out-expo), box-shadow 0.38s ease;
}

.landing-upload-zone::before {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    pointer-events: none;
    background:
        radial-gradient(118% 88% at 8% -10%, rgba(191, 219, 254, 0.1) 0%, transparent 48%),
        radial-gradient(112% 98% at 90% 120%, rgba(56, 189, 248, 0.1) 0%, transparent 48%),
        radial-gradient(140% 130% at 50% 50%, rgba(15, 23, 42, 0.22) 0%, rgba(15, 23, 42, 0.08) 42%, transparent 64%);
    opacity: 0.56;
}

.landing-upload-zone::after {
    content: '';
    position: absolute;
    inset: -32% -60%;
    pointer-events: none;
    background: linear-gradient(112deg, transparent 30%, rgba(125, 211, 252, 0.18) 47%, rgba(125, 211, 252, 0.03) 59%, transparent 72%);
    animation: liquidScan 6.4s linear infinite;
    opacity: 0.58;
}

.landing-upload-zone:hover {
    transform: translateY(-4px) scale(1.007);
    border-color: rgba(125, 211, 252, 0.36);
    box-shadow:
        inset 0 1px 0 rgba(191, 219, 254, 0.14),
        inset 0 -1px 0 rgba(2, 10, 24, 0.54),
        0 28px 96px rgba(2, 8, 23, 0.52),
        0 0 0 1px rgba(125, 211, 252, 0.12);
}

.landing-upload-zone.drag-over {
    border-color: rgba(74, 222, 128, 0.5);
    box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.3), 0 20px 74px rgba(74, 222, 128, 0.12);
}

.liquid-db-shell {
    cursor: default;
}

.liquid-fume-layer {
    position: absolute;
    inset: -34% -18%;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(42% 34% at 18% 28%, rgba(56, 189, 248, 0.18) 0%, transparent 74%),
        radial-gradient(38% 30% at 78% 62%, rgba(14, 165, 233, 0.16) 0%, transparent 72%),
        radial-gradient(30% 26% at 58% 80%, rgba(2, 6, 23, 0.28) 0%, transparent 70%);
    filter: blur(42px);
    opacity: 0.5;
    animation: fumeOrbit 11s ease-in-out infinite alternate;
}

.landing-upload-zone>* {
    position: relative;
    z-index: 1;
}

.db-connection-animation {
    position: relative;
    width: 196px;
    height: 196px;
    margin: 0 auto 22px;
}

.liquid-loader {
    display: grid;
    place-items: center;
}

.liquid-halo {
    position: absolute;
    inset: 20px;
    border-radius: 34px;
    background:
        radial-gradient(78% 68% at 28% 24%, rgba(56, 189, 248, 0.2) 0%, rgba(56, 189, 248, 0.08) 44%, transparent 76%),
        radial-gradient(72% 64% at 76% 78%, rgba(125, 211, 252, 0.12) 0%, transparent 72%);
    filter: blur(18px);
    animation: haloPulse 3.8s ease-in-out infinite;
}

.liquid-bubble-field {
    position: absolute;
    inset: -8px;
    pointer-events: none;
    z-index: 1;
}

.liquid-bubble {
    position: absolute;
    left: 50%;
    top: 50%;
    width: var(--size, 18px);
    height: var(--size, 18px);
    border-radius: 50%;
    border: 1px solid rgba(191, 219, 254, 0.24);
    background:
        linear-gradient(148deg, rgba(186, 230, 253, 0.14) 0%, rgba(186, 230, 253, 0.03) 34%, rgba(2, 12, 30, 0.5) 100%),
        rgba(2, 12, 30, 0.38);
    box-shadow:
        inset 0 1px 0 rgba(191, 219, 254, 0.14),
        inset 0 -1px 0 rgba(2, 10, 24, 0.34),
        0 14px 26px rgba(2, 8, 23, 0.3),
        0 0 16px rgba(56, 189, 248, 0.12);
    backdrop-filter: blur(2px) saturate(114%);
    -webkit-backdrop-filter: blur(2px) saturate(114%);
    transform: translate(var(--sx), var(--sy)) scale(0.35);
    opacity: 0;
    animation: bubbleAssemble var(--duration, 5.8s) var(--ease-out-expo) infinite;
    animation-delay: var(--delay, 0s);
}

.liquid-bubble::before {
    content: '';
    position: absolute;
    left: 18%;
    top: 16%;
    width: 44%;
    height: 30%;
    border-radius: 999px;
    background: linear-gradient(120deg, rgba(226, 244, 255, 0.52) 0%, rgba(226, 244, 255, 0.04) 100%);
    opacity: 0.42;
}

.b1 {
    --size: 22px;
    --sx: -118px;
    --sy: -82px;
    --mx: -70px;
    --my: -52px;
    --ex: -50px;
    --ey: -36px;
    --delay: 0.05s;
}

.b2 {
    --size: 16px;
    --sx: -8px;
    --sy: -122px;
    --mx: -2px;
    --my: -70px;
    --ex: -4px;
    --ey: -46px;
    --delay: 0.35s;
}

.b3 {
    --size: 24px;
    --sx: 96px;
    --sy: -92px;
    --mx: 60px;
    --my: -56px;
    --ex: 48px;
    --ey: -34px;
    --delay: 0.55s;
}

.b4 {
    --size: 15px;
    --sx: 134px;
    --sy: -6px;
    --mx: 76px;
    --my: -6px;
    --ex: 54px;
    --ey: -8px;
    --delay: 0.9s;
}

.b5 {
    --size: 20px;
    --sx: 108px;
    --sy: 78px;
    --mx: 62px;
    --my: 46px;
    --ex: 50px;
    --ey: 30px;
    --delay: 1.25s;
}

.b6 {
    --size: 14px;
    --sx: 2px;
    --sy: 130px;
    --mx: 0px;
    --my: 76px;
    --ex: 0px;
    --ey: 52px;
    --delay: 1.55s;
}

.b7 {
    --size: 23px;
    --sx: -102px;
    --sy: 92px;
    --mx: -60px;
    --my: 56px;
    --ex: -44px;
    --ey: 36px;
    --delay: 1.85s;
}

.b8 {
    --size: 16px;
    --sx: -130px;
    --sy: 6px;
    --mx: -76px;
    --my: 4px;
    --ex: -52px;
    --ey: 6px;
    --delay: 2.15s;
}

.b9 {
    --size: 12px;
    --sx: 72px;
    --sy: 114px;
    --mx: 42px;
    --my: 66px;
    --ex: 32px;
    --ey: 46px;
    --delay: 2.45s;
}

.liquid-core {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 122px;
    height: 122px;
    border-radius: 34px;
    display: grid;
    place-items: center;
    z-index: 2;
    border: 1px solid rgba(191, 219, 254, 0.3);
    background:
        linear-gradient(152deg, rgba(191, 219, 254, 0.17) 0%, rgba(191, 219, 254, 0.04) 34%, rgba(2, 12, 30, 0.56) 100%),
        rgba(2, 10, 24, 0.66);
    backdrop-filter: blur(7px) saturate(136%);
    -webkit-backdrop-filter: blur(7px) saturate(136%);
    box-shadow:
        inset 0 1px 0 rgba(191, 219, 254, 0.2),
        inset 0 -1px 0 rgba(2, 10, 24, 0.5),
        0 24px 46px rgba(2, 8, 23, 0.42),
        0 0 24px rgba(56, 189, 248, 0.2);
    animation: coreFloat 5.2s var(--ease-smooth) infinite;
}

.liquid-core::before {
    content: '';
    position: absolute;
    inset: 6px;
    border-radius: 27px;
    border: 1px solid rgba(125, 211, 252, 0.18);
    opacity: 0.54;
}

.liquid-card-assembling::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 36px;
    border: 1px solid rgba(125, 211, 252, 0.2);
    opacity: 0.44;
    animation: cardShellPulse 3.4s ease-in-out infinite;
}

.liquid-core-reflection {
    position: absolute;
    left: 10px;
    top: 10px;
    width: 58%;
    height: 30%;
    border-radius: 999px;
    background: linear-gradient(130deg, rgba(226, 244, 255, 0.48) 0%, rgba(226, 244, 255, 0.04) 72%);
    filter: blur(0.2px);
    opacity: 0.54;
}

.liquid-core-refract {
    position: absolute;
    inset: 22px;
    border-radius: 19px;
    background:
        radial-gradient(60% 50% at 24% 28%, rgba(255, 255, 255, 0.12) 0%, transparent 100%),
        radial-gradient(58% 48% at 74% 72%, rgba(56, 189, 248, 0.16) 0%, transparent 100%);
    opacity: 0.52;
    filter: blur(1px);
}

.liquid-core-logo {
    width: 56px;
    height: 56px;
    color: #88dcff;
    filter: drop-shadow(0 0 13px rgba(56, 189, 248, 0.42));
    opacity: 0.9;
    animation: logoPulse 4.2s ease-in-out infinite;
}

.liquid-pulse-ring {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 98px;
    height: 98px;
    border-radius: 50%;
    border: 1px solid rgba(125, 211, 252, 0.26);
    transform: translate(-50%, -50%);
    opacity: 0;
    z-index: 0;
}

.ring-1 {
    animation: pulseRing 2.9s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

.ring-2 {
    animation: pulseRing 2.9s cubic-bezier(0.16, 1, 0.3, 1) infinite 1.45s;
}

.liquid-data-stream {
    position: absolute;
    left: 50%;
    bottom: 2px;
    transform: translateX(-50%);
    width: 100px;
    height: 40px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.liquid-data-stream span {
    width: 8px;
    height: 14px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(186, 230, 253, 0.82) 0%, rgba(56, 189, 248, 0.64) 46%, rgba(56, 189, 248, 0.12) 100%);
    box-shadow: 0 0 9px rgba(56, 189, 248, 0.42), 0 0 14px rgba(125, 211, 252, 0.16);
    animation: dataLift 1.8s linear infinite;
    animation-delay: var(--stream-delay);
}

.upload-text-main {
    margin-bottom: 7px;
    font-size: 1.22rem;
    font-weight: 760;
    color: #ecfeff;
    letter-spacing: -0.3px;
}

.upload-text-sub {
    margin-bottom: 16px;
    font-size: 0.82rem;
    color: rgba(186, 230, 253, 0.7);
    letter-spacing: 0.18px;
}

.upload-text-sub strong {
    color: var(--abyss-text);
}

.upload-badge-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.upload-badge {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(125, 211, 252, 0.16);
    background:
        linear-gradient(140deg, rgba(191, 219, 254, 0.08) 0%, rgba(191, 219, 254, 0.02) 40%, rgba(2, 12, 30, 0.36) 100%),
        rgba(2, 10, 24, 0.44);
    box-shadow: inset 0 1px 0 rgba(191, 219, 254, 0.08), 0 8px 20px rgba(2, 8, 23, 0.32);
    color: rgba(224, 242, 254, 0.82);
    font-size: 0.66rem;
    font-weight: 650;
    letter-spacing: 0.24px;
}

.db-metrics-row {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.db-metric {
    border-radius: 15px;
    border: 1px solid rgba(125, 211, 252, 0.16);
    background:
        linear-gradient(150deg, rgba(191, 219, 254, 0.08) 0%, rgba(191, 219, 254, 0.02) 34%, rgba(2, 12, 30, 0.4) 100%),
        rgba(2, 10, 24, 0.46);
    box-shadow: inset 0 1px 0 rgba(191, 219, 254, 0.08), 0 10px 24px rgba(2, 8, 23, 0.34);
    padding: 10px 12px;
    text-align: left;
    animation: metricBreath 4.2s ease-in-out infinite;
}

.db-metric:nth-child(2) {
    animation-delay: 0.45s;
}

.db-metric:nth-child(3) {
    animation-delay: 0.85s;
}

.db-metric span {
    display: block;
    margin-bottom: 4px;
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(186, 230, 253, 0.6);
}

.db-metric strong {
    display: block;
    font-size: 0.74rem;
    color: rgba(236, 254, 255, 0.95);
    font-weight: 720;
}

.landing-format-info {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 auto;
    padding: 8px 13px;
    border-radius: 999px;
    border: 1px solid rgba(125, 211, 252, 0.14);
    background:
        linear-gradient(145deg, rgba(191, 219, 254, 0.08) 0%, rgba(2, 12, 30, 0.28) 100%),
        rgba(2, 10, 24, 0.38);
    box-shadow: inset 0 1px 0 rgba(191, 219, 254, 0.06), 0 10px 24px rgba(2, 8, 23, 0.3);
    font-size: 0.69rem;
    color: rgba(186, 230, 253, 0.58);
    letter-spacing: 0.18px;
}

.landing-format-info strong {
    color: rgba(224, 242, 254, 0.86);
}

/* File name label */
.file-name-label {
    font-size: 0.68rem;
    color: var(--abyss-text);
    font-weight: 500;
    opacity: 0.7;
    overflow: hidden;
    white-space: nowrap;
    max-width: 180px;
}

.connecting.landing-upload-zone {
    border-color: rgba(125, 211, 252, 0.3);
}

.connecting.landing-upload-zone:hover {
    transform: none;
    border-color: rgba(125, 211, 252, 0.34);
}

/* Text & Badges */
.db-text-pulse {
    animation: db-text-glow 2.3s ease-in-out infinite;
}

.db-text-fade {
    animation: db-sub-fade 3.2s linear infinite;
}

.db-badge-glow {
    animation: db-badge-pulse 2.8s ease-in-out infinite var(--delay);
}

@keyframes liquidScan {
    0% {
        transform: translateX(-32%) rotate(0.3deg);
    }

    100% {
        transform: translateX(28%) rotate(-0.3deg);
    }
}

@keyframes fumeOrbit {
    0% {
        transform: rotate(0deg) scale(0.98);
        opacity: 0.5;
    }

    100% {
        transform: rotate(8deg) scale(1.05);
        opacity: 0.65;
    }
}

@keyframes haloPulse {

    0%,
    100% {
        transform: scale(0.96);
        opacity: 0.56;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.76;
    }
}

@keyframes bubbleAssemble {
    0% {
        transform: translate(var(--sx), var(--sy)) scale(0.18);
        opacity: 0;
    }

    22% {
        opacity: 0.84;
    }

    72% {
        transform: translate(var(--mx), var(--my)) scale(1);
        opacity: 0.78;
    }

    100% {
        transform: translate(var(--ex), var(--ey)) scale(0.16);
        opacity: 0;
    }
}

@keyframes cardShellPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.46;
    }

    50% {
        transform: scale(1.06);
        opacity: 0.78;
    }
}

@keyframes logoPulse {

    0%,
    100% {
        filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.3));
        transform: scale(1);
    }

    50% {
        filter: drop-shadow(0 0 14px rgba(56, 189, 248, 0.46));
        transform: scale(1.028);
    }
}

@keyframes coreFloat {

    0%,
    100% {
        transform: translate(-50%, -50%) translateY(0) scale(1);
    }

    50% {
        transform: translate(-50%, -50%) translateY(-4px) scale(1.012);
    }
}

@keyframes pulseRing {
    0% {
        transform: translate(-50%, -50%) scale(0.82);
        opacity: 0.8;
    }

    100% {
        transform: translate(-50%, -50%) scale(2.65);
        opacity: 0;
    }
}

@keyframes dataLift {
    0% {
        transform: translateY(8px) scaleY(0.7);
        opacity: 0;
    }

    14% {
        opacity: 1;
    }

    70% {
        opacity: 1;
    }

    100% {
        transform: translateY(-16px) scaleY(1.14);
        opacity: 0;
    }
}

@keyframes metricBreath {

    0%,
    100% {
        transform: translateY(0);
        border-color: rgba(125, 211, 252, 0.18);
    }

    50% {
        transform: translateY(-2px);
        border-color: rgba(125, 211, 252, 0.3);
    }
}

@keyframes db-text-glow {

    0%,
    100% {
        text-shadow: 0 0 0 transparent;
    }

    50% {
        text-shadow: 0 0 22px rgba(56, 189, 248, 0.52);
    }
}

@keyframes db-sub-fade {

    0%,
    100% {
        opacity: 0.48;
    }

    50% {
        opacity: 0.9;
    }
}

@keyframes db-badge-pulse {

    0%,
    100% {
        transform: translateY(0);
        border-color: rgba(125, 211, 252, 0.24);
    }

    50% {
        transform: translateY(-2px);
        border-color: rgba(125, 211, 252, 0.42);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 8px 20px rgba(56, 189, 248, 0.18);
    }
}

/* ─── Landing → Dashboard Transitions ───────────────── */
@keyframes fadeOutUp {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateY(-40px) scale(0.96);
        pointer-events: none;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
        pointer-events: auto;
    }
}

/* ─── Responsive Landing ────────────────────────────── */
@media (max-width: 600px) {
    .landing-screen {
        padding: 16px;
    }

    .landing-brand {
        margin-bottom: 24px;
    }

    .landing-headline {
        font-size: 2rem;
        letter-spacing: -1.4px;
    }

    .landing-desc {
        margin-bottom: 24px;
        font-size: 0.85rem;
    }

    .landing-upload-zone {
        padding: 36px 18px 24px;
        border-radius: 28px;
    }

    .db-connection-animation {
        width: 164px;
        height: 164px;
        margin-bottom: 16px;
    }

    .liquid-core {
        width: 96px;
        height: 96px;
        border-radius: 28px;
    }

    .liquid-core-logo {
        width: 44px;
        height: 44px;
    }

    .liquid-bubble-field {
        transform: scale(0.88);
    }

    .upload-text-main {
        font-size: 1.02rem;
    }

    .upload-text-sub {
        margin-bottom: 12px;
        font-size: 0.76rem;
    }

    .upload-badge-row {
        gap: 6px;
    }

    .upload-badge {
        font-size: 0.58rem;
        padding: 4px 8px;
    }

    .db-metrics-row {
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .db-metric {
        text-align: center;
        padding: 9px 10px;
    }

    .landing-format-info {
        padding: 7px 10px;
        font-size: 0.63rem;
    }
}

@media (prefers-reduced-motion: reduce) {

    .landing-content,
    .landing-content::before,
    .landing-upload-zone::after,
    .liquid-fume-layer,
    .liquid-halo,
    .liquid-bubble,
    .liquid-core,
    .liquid-core-logo,
    .liquid-pulse-ring,
    .liquid-data-stream span,
    .db-text-pulse,
    .db-text-fade,
    .db-badge-glow,
    .db-metric {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition: none !important;
    }
}

/* ═══════════════════════════════════════════════════════
   THEME TOGGLE BUTTON
   ═══════════════════════════════════════════════════════ */

.theme-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    color: var(--stagnant);
    font-size: 0.75rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.35s var(--ease-out-expo);
    margin-bottom: 10px;
    letter-spacing: 0.2px;
}

.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--surface-text);
    transform: translateY(-1px);
}

.theme-toggle-btn:active {
    transform: scale(0.97);
}

/* ═══════════════════════════════════════════════════════
   SUNSET THEME — Caribbean Shallow Sea
   Warm sand · Coral · Turquoise · Golden hour
   ═══════════════════════════════════════════════════════ */

[data-theme="sunset"] {
    /* Warm Caribbean Palette */
    --surface-bg: #2d1b0e;
    --surface-text: #fef3e2;
    --surface-border: #d97706;

    --shallow-bg: #1a1006;
    --shallow-text: #fde68a;
    --shallow-border: #b45309;

    --deep-bg: #140c04;
    --deep-text: #fbbf24;
    --deep-border: #92400e;

    --abyss-bg: #0c0703;
    --abyss-text: #f59e0b;
    --abyss-border: #78350f;

    /* Flow State Colors — tropical */
    --laminar: #34d399;
    --laminar-glow: rgba(52, 211, 153, 0.25);
    --turbulent: #fb923c;
    --turbulent-glow: rgba(251, 146, 60, 0.25);
    --stagnant: #d6b088;

    /* Accent gradients — warm sunset */
    --gradient-primary: linear-gradient(135deg, #f59e0b 0%, #ef4444 50%, #ec4899 100%);
    --gradient-warm: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
    --gradient-danger: linear-gradient(135deg, #f87171 0%, #dc2626 100%);
    --gradient-cool: linear-gradient(135deg, #14b8a6 0%, #06b6d4 100%);
    --gradient-ocean: linear-gradient(180deg, #0c0703 0%, #1a1006 30%, #2d1b0e 60%, #140c04 100%);

    /* Glassmorphism — sandy warmth */
    --glass-bg: rgba(26, 16, 6, 0.3);
    --glass-bg-hover: rgba(26, 16, 6, 0.42);
    --glass-border: rgba(245, 158, 11, 0.12);
    --glass-border-hover: rgba(245, 158, 11, 0.25);

    /* Shadows — warm glow */
    --shadow-card:
        0 0 0 1px var(--glass-border),
        0 2px 8px rgba(0, 0, 0, 0.2),
        0 8px 32px rgba(0, 0, 0, 0.25);
    --shadow-card-hover:
        0 0 0 1px var(--glass-border-hover),
        0 4px 12px rgba(0, 0, 0, 0.25),
        0 16px 48px rgba(0, 0, 0, 0.35),
        0 0 48px rgba(245, 158, 11, 0.06);
    --shadow-glow: 0 0 40px rgba(245, 158, 11, 0.08);
    --shadow-deep: 0 24px 80px rgba(0, 0, 0, 0.5);
}

/* Sunset sidebar — warm tones */
[data-theme="sunset"] #sidebar {
    background:
        linear-gradient(160deg, rgba(245, 158, 11, 0.26) 0%, rgba(245, 158, 11, 0.09) 38%, rgba(20, 12, 4, 0.2) 100%),
        rgba(20, 12, 4, 0.34);
    border-right-color: rgba(245, 158, 11, 0.16);
}

[data-theme="sunset"] #sidebar::after {
    background: linear-gradient(180deg, transparent 0%, rgba(245, 158, 11, 0.15) 30%, rgba(239, 68, 68, 0.1) 70%, transparent 100%);
}

/* Sunset header */
[data-theme="sunset"] #main-header {
    background:
        linear-gradient(150deg, rgba(245, 158, 11, 0.2) 0%, rgba(245, 158, 11, 0.06) 46%, rgba(12, 7, 3, 0.16) 100%),
        rgba(12, 7, 3, 0.3);
    border-bottom-color: rgba(245, 158, 11, 0.14);
}

[data-theme="sunset"] .header-left h1 {
    background: linear-gradient(135deg, #fff 0%, #fde68a 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

/* Sunset status */
[data-theme="sunset"] .header-status {
    background: rgba(52, 211, 153, 0.06);
    border-color: rgba(52, 211, 153, 0.15);
}

[data-theme="sunset"] .status-label {
    color: #34d399;
}

/* Sunset KPI cards — warm glow */
[data-theme="sunset"] .kpi-card::before {
    background: var(--gradient-primary);
}

[data-theme="sunset"] .kpi-card::after {
    background:
        radial-gradient(155% 135% at 8% -4%, rgba(254, 243, 226, 0.12) 0%, rgba(254, 243, 226, 0.034) 24%, transparent 50%),
        radial-gradient(126% 126% at 92% 112%, rgba(251, 146, 60, 0.1) 0%, rgba(251, 146, 60, 0.03) 16%, transparent 46%),
        radial-gradient(172% 150% at 50% 50%, rgba(245, 158, 11, 0.048) 0%, rgba(245, 158, 11, 0.014) 34%, transparent 54%, rgba(239, 68, 68, 0.068) 68%, rgba(20, 12, 4, 0.3) 100%),
        radial-gradient(170% 170% at 50% 50%, transparent 56%, rgba(251, 146, 60, 0.018) 63%, rgba(245, 158, 11, 0.074) 73%, rgba(20, 12, 4, 0.24) 100%),
        radial-gradient(ellipse at top left, rgba(245, 158, 11, 0.08) 0%, transparent 60%);
    box-shadow: inset 0 0 0 999px var(--glass-smoke), inset 0 1px 0 rgba(254, 243, 226, 0.08), inset 0 -1px 0 rgba(20, 12, 4, 0.2);
}

[data-theme="sunset"] .flow-card::before {
    background:
        radial-gradient(155% 135% at 8% -4%, rgba(254, 243, 226, 0.114) 0%, rgba(254, 243, 226, 0.032) 24%, transparent 50%),
        radial-gradient(126% 126% at 92% 112%, rgba(251, 146, 60, 0.094) 0%, rgba(251, 146, 60, 0.026) 16%, transparent 46%),
        radial-gradient(172% 150% at 50% 50%, rgba(245, 158, 11, 0.044) 0%, rgba(245, 158, 11, 0.014) 34%, transparent 54%, rgba(239, 68, 68, 0.064) 68%, rgba(20, 12, 4, 0.3) 100%),
        radial-gradient(170% 170% at 50% 50%, transparent 56%, rgba(251, 146, 60, 0.018) 63%, rgba(245, 158, 11, 0.07) 73%, rgba(20, 12, 4, 0.24) 100%),
        radial-gradient(circle at top left, rgba(245, 158, 11, 0.092) 0%, transparent 60%);
    box-shadow: inset 0 0 0 999px var(--glass-smoke), inset 0 1px 0 rgba(254, 243, 226, 0.08), inset 0 -1px 0 rgba(20, 12, 4, 0.2);
}

[data-theme="sunset"] .kpi-value {
    background: linear-gradient(135deg, #fff 30%, #fde68a 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

/* Sunset brand */
[data-theme="sunset"] .brand-name {
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

/* Sunset nav link active */
[data-theme="sunset"] .nav-link::before {
    background: var(--gradient-primary);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

[data-theme="sunset"] .nav-link::after {
    background: radial-gradient(ellipse at left center, rgba(245, 158, 11, 0.06) 0%, transparent 70%);
}

[data-theme="sunset"] .nav-link.active {
    background: rgba(245, 158, 11, 0.08);
}

/* Sunset badges */
[data-theme="sunset"] .card-badge {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.25);
}

/* Sunset upload zone */
[data-theme="sunset"] .upload-zone:hover {
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(245, 158, 11, 0.04);
    color: #f59e0b;
}

[data-theme="sunset"] .landing-upload-zone:hover {
    border-color: rgba(245, 158, 11, 0.4);
    box-shadow: 0 16px 60px rgba(245, 158, 11, 0.08);
}

[data-theme="sunset"] .landing-upload-zone.drag-over {
    border-color: #34d399;
    background: rgba(52, 211, 153, 0.06);
    box-shadow: 0 0 50px rgba(52, 211, 153, 0.15);
}

/* Sunset landing */
[data-theme="sunset"] .landing-headline {
    background: linear-gradient(135deg, #fff 20%, #fde68a 60%, #f59e0b 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

[data-theme="sunset"] .landing-headline .accent {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
}

/* Sunset body ambient */
[data-theme="sunset"] body::before {
    background: radial-gradient(ellipse at 30% 20%, rgba(245, 158, 11, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(239, 68, 68, 0.03) 0%, transparent 50%);
}

/* Sunset scrollbar */
[data-theme="sunset"] ::-webkit-scrollbar-thumb {
    background: rgba(214, 176, 136, 0.2);
}

[data-theme="sunset"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(214, 176, 136, 0.35);
}

/* Sunset selection */
[data-theme="sunset"] ::selection {
    background: rgba(245, 158, 11, 0.3);
    color: #fff;
}

/* Flow bar in sunset */
[data-theme="sunset"] .kpi-flow-bar-fill {
    background: var(--gradient-primary);
}

/* Table highlights */
[data-theme="sunset"] .data-table tbody tr:hover {
    background: rgba(245, 158, 11, 0.04);
}

/* Sunset theme toggle active style */
[data-theme="sunset"] .theme-toggle-btn {
    border-color: rgba(245, 158, 11, 0.15);
    background: rgba(245, 158, 11, 0.06);
}

/* Transition for theme switching */
body,
#sidebar,
#main-content,
#main-header,
.kpi-card,
.flow-card,
.data-table {
    transition: background-color 0.5s ease, border-color 0.3s ease, color 0.3s ease;
}


/* ═══════════════════════════════════════════════════════════════
   GoFlowOS — Floating Windows
   ═══════════════════════════════════════════════════════════════ */
#goflow-window-root {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 900;
}

.goflow-window {
    position: absolute;
    pointer-events: all;
    display: flex;
    flex-direction: column;
    border-radius: 28px;
    background:
        linear-gradient(155deg, rgba(186, 230, 253, 0.024) 0%, rgba(56, 189, 248, 0.012) 16%, rgba(2, 8, 23, 0.18) 40%, rgba(2, 8, 23, 0.38) 100%),
        rgba(2, 8, 23, 0.35);
    backdrop-filter: blur(18px) saturate(120%) contrast(122%) brightness(0.49);
    -webkit-backdrop-filter: blur(18px) saturate(120%) contrast(122%) brightness(0.49);
    border: 1px solid rgba(191, 219, 254, 0.1);
    box-shadow:
        0 24px 58px rgba(2, 8, 23, 0.44),
        0 0 0 1px rgba(15, 23, 42, 0.32),
        inset 0 1px 0 rgba(191, 219, 254, 0.08),
        inset 0 -22px 54px rgba(2, 8, 23, 0.2);
    opacity: 0;
    transform: scale(0.92) translateY(12px);
    transition: opacity 0.25s ease, transform 0.25s ease, box-shadow 0.2s ease, width 0.3s ease-out, height 0.3s ease-out, top 0.3s ease-out, left 0.3s ease-out;
    overflow: hidden;
    min-width: 400px;
    min-height: 300px;
}

.goflow-window.goflow-win-open {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.goflow-window.goflow-win-closing {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
}

.goflow-window.goflow-win-focus {
    box-shadow:
        0 30px 70px rgba(2, 8, 23, 0.5),
        0 0 0 1px rgba(125, 211, 252, 0.18),
        0 0 24px rgba(56, 189, 248, 0.1),
        inset 0 1px 0 rgba(191, 219, 254, 0.1);
}

.goflow-window::before {
    inset: -2px;
    background:
        radial-gradient(170% 170% at 50% 50%, transparent 56%, rgba(125, 211, 252, 0.018) 64%, rgba(2, 8, 23, 0.18) 74%, rgba(2, 8, 23, 0.34) 100%),
        radial-gradient(160% 130% at 7% -2%, rgba(125, 211, 252, 0.1) 0%, rgba(125, 211, 252, 0.02) 14%, transparent 32%),
        radial-gradient(160% 130% at 93% 102%, rgba(56, 189, 248, 0.085) 0%, rgba(56, 189, 248, 0.016) 14%, transparent 34%),
        linear-gradient(135deg, rgba(191, 219, 254, 0.016) 0%, rgba(2, 8, 23, 0.08) 34%, rgba(2, 8, 23, 0.22) 100%);
    background-size: 116% 116%, 118% 118%, 118% 118%, 100% 100%;
    backdrop-filter: blur(12px) saturate(126%) contrast(128%) brightness(0.46);
    -webkit-backdrop-filter: blur(12px) saturate(126%) contrast(128%) brightness(0.46);
    transform: scale(1.018) translateZ(0);
    box-shadow:
        inset 0 0 0 999px var(--glass-smoke),
        inset 0 1px 0 rgba(191, 219, 254, 0.08),
        inset 0 -1px 0 rgba(2, 8, 23, 0.28),
        inset 0 0 28px rgba(2, 8, 23, 0.13);
    opacity: 0.76;
}

.goflow-window.goflow-win-minimized .goflow-win-body {
    display: none;
}

.goflow-window.goflow-win-minimized .goflow-win-resize-handle {
    display: none;
}

.goflow-window.goflow-win-minimized {
    height: auto !important;
    min-height: unset;
}

.goflow-window.goflow-win-maximized {
    transition: all 0.35s var(--ease-out-expo) !important;
    border-radius: 28px;

}

.goflow-win-maximize {
    font-size: 0.65rem;

}

/* ─── Flow Card Expand Button ──────────────────────── */
.flow-card {
    position: relative;

}

.flow-card-expand {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.05) 50%, rgba(15, 23, 42, 0.14) 100%),
        rgba(15, 23, 42, 0.22);
    color: rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s var(--ease-out-expo);
    z-index: 5;
    backdrop-filter: blur(4px);

}

.flow-card:hover .flow-card-expand {
    opacity: 1;

}

.flow-card-expand:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: rgba(56, 189, 248, 0.34);
    color: #38bdf8;
    transform: scale(1.1);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);

}

.flow-card-expand svg {
    width: 14px;
    height: 14px;

}

.goflow-win-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background:
        linear-gradient(0deg, var(--glass-smoke), var(--glass-smoke)),
        linear-gradient(135deg, rgba(191, 219, 254, 0.028) 0%, rgba(56, 189, 248, 0.012) 16%, rgba(2, 8, 23, 0.16) 36%, rgba(2, 8, 23, 0.34) 100%),
        rgba(2, 8, 23, 0.28);
    border-bottom: 1px solid rgba(191, 219, 254, 0.1);
    backdrop-filter: blur(12px) saturate(122%) contrast(116%) brightness(0.48);
    -webkit-backdrop-filter: blur(12px) saturate(122%) contrast(116%) brightness(0.48);
    user-select: none;
    flex-shrink: 0;
}

.goflow-win-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #e2e8f0;
    font-size: 0.9rem;
    font-weight: 600;
}

.goflow-win-icon {
    font-size: 1.1rem;
}

.goflow-win-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.goflow-win-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.15s ease;
}

.goflow-win-close {
    background: #ff5f56;
}

.goflow-win-close:hover {
    background: #e0443e;
    transform: scale(1.1);
}

.goflow-win-minimize {
    background: #ffbd2e;
}

.goflow-win-minimize:hover {
    background: #dea123;
    transform: scale(1.1);
}

.goflow-win-maximize {
    background: #27c93f;
}

.goflow-win-maximize:hover {
    background: #1aab29;
    transform: scale(1.1);
}

.goflow-win-body {
    flex: 1;
    overflow: auto;
    padding: 16px;
}

.goflow-win-content {
    min-height: 100%;
}

.goflow-win-resize-handle {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 20px;
    height: 20px;
    cursor: nwse-resize;
    background: linear-gradient(135deg, transparent 50%, rgba(56, 189, 248, 0.3) 50%);
    border-radius: 0 0 28px 0;
    opacity: 0.5;
    transition: opacity 0.15s;
}

.goflow-win-resize-handle:hover {
    opacity: 1;
}

/* ─── Window inner chart containers ─── */
.goflow-win-content .win-chart-container {
    position: relative;
    height: 300px;
    margin-bottom: 16px;
}

.goflow-win-content .win-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.goflow-win-content .win-stat-card {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 42%, rgba(30, 41, 59, 0.12) 100%),
        rgba(30, 41, 59, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 22px;
    padding: 14px;
    text-align: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 8px 20px rgba(2, 8, 23, 0.2);
}

.goflow-win-content .win-stat-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.goflow-win-content .win-stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #e2e8f0;
    margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   GoFlowOS — Sortable Tables & Search
   ═══════════════════════════════════════════════════════════════ */
.table-search {
    display: flex;
    width: 100%;
    margin-bottom: 20px;
    position: relative;
}

.table-search-shell {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 50px;
    border-radius: 999px;
    padding: 1px 10px 1px 1px;
    background: linear-gradient(130deg, rgba(255, 255, 255, 0.46) 0%, rgba(255, 255, 255, 0.14) 35%, rgba(255, 255, 255, 0.36) 100%);
    box-shadow: 0 12px 28px rgba(2, 8, 23, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.table-search-shell::after {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.04) 40%, rgba(5, 10, 20, 0.12) 100%),
        rgba(5, 10, 20, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.16);
    transition: border-color 0.24s ease, box-shadow 0.24s ease;
    z-index: 0;
}

.table-search-shell:focus-within::after {
    border-color: rgba(56, 189, 248, 0.34);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 0 3px rgba(56, 189, 248, 0.12);
}

.table-search-input {
    position: relative;
    z-index: 1;
    background: transparent;
    border: none;
    flex: 1 1 auto;
    width: auto;
    min-width: 140px;
    height: 48px;
    border-radius: 999px;
    color: #f8fafc;
    padding-inline: 46px 16px;
    font-size: 0.9rem;
    letter-spacing: 0.01em;
}

.table-search-input::placeholder {
    color: rgba(226, 232, 240, 0.64);
}

.table-search-input:focus {
    outline: none;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.78;
    color: rgba(191, 219, 254, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.table-search-controls {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.table-max-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(226, 232, 240, 0.72);
    white-space: nowrap;
}

.table-max-input {
    width: 96px;
    height: 34px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(2, 6, 23, 0.35);
    color: #f8fafc;
    padding: 0 10px;
    font-size: 0.82rem;
}

.table-max-input::placeholder {
    color: rgba(226, 232, 240, 0.58);
}

.table-max-input:focus {
    outline: none;
    border-color: rgba(56, 189, 248, 0.5);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.14);
}

@media (max-width: 880px) {
    .table-search-shell {
        padding-right: 6px;
    }

    .table-max-label {
        display: none;
    }

    .table-max-input {
        width: 78px;
    }
}

th.sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s, background 0.15s;
    position: relative;
}

th.sortable:hover {
    color: var(--cyan, #38bdf8);
    background: rgba(56, 189, 248, 0.06);
}

th.sortable.sort-active {
    color: var(--cyan, #38bdf8);
}

.table-count {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.35);
    text-align: right;
    padding: 6px 4px 0;
}

/* ─── Resizable flow-cards on Painel CEO ─── */
#section-painel .flow-card {
    resize: both;
    overflow: hidden;
    min-width: 300px;
    min-height: 250px;
}

#section-painel .flow-card::-webkit-resizing {
    display: none;
}

/* ─── Clickable flow-cards ─── */
.flow-card.clickable-card {
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.flow-card.clickable-card:hover {
    border-color: rgba(56, 189, 248, 0.25);
    box-shadow: 0 4px 24px rgba(56, 189, 248, 0.08);
}

.card-expand-hint {
    margin-left: auto;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.15);
    transition: color 0.2s, transform 0.2s;
}

.flow-card.clickable-card:hover .card-expand-hint {
    color: var(--cyan, #38bdf8);
    transform: scale(1.2);
}

/* ─── Custom UI Elements (Added via UI Request) ─── */

/* Theme Popup Styles */
.theme-popup {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) scale(0.95);
    width: auto;
    min-width: 220px;
    background:
        linear-gradient(150deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.05) 40%, var(--surface-bg, rgba(20, 20, 30, 0.2)) 100%),
        var(--surface-bg, rgba(20, 20, 30, 0.3));
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 28px;
    padding: 20px;
    box-shadow: 0 14px 34px rgba(2, 8, 23, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.16);
    z-index: 1000;
    backdrop-filter: blur(4px) saturate(118%);
    transform-origin: bottom center;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    perspective: 1000px;
    transition: opacity 0.35s ease, transform 0.35s ease, visibility 0s 0.35s;
}

.theme-popup.visible {
    opacity: 1;
    transform: translateX(-50%) scale(1);
    pointer-events: all;
    visibility: visible;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s 0s;
}

.theme-popup.fading-out {
    opacity: 0;
    transform: translateX(-50%) scale(0.95);
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease, visibility 0s 0.4s;
    visibility: hidden;
}

/* Simplified Theme Radio List */
.theme-radio-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
}

.theme-active-ball {
    position: absolute;
    top: 0;
    left: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    /* 3D styling: internal and external shadows + specular highlight gradient */
    box-shadow:
        inset -2px -2px 6px rgba(0, 0, 0, 0.6),
        inset 2px 2px 6px rgba(255, 255, 255, 0.7),
        0 4px 6px rgba(0, 0, 0, 0.4);
    background-image: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 30%, rgba(0, 0, 0, 0.2) 60%, rgba(0, 0, 0, 0.8) 100%);
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.8s ease;
    pointer-events: none;
    z-index: 2;
}

body[data-theme="midnight"] .theme-active-ball,
body[data-theme="custom"] .theme-active-ball {
    background-color: #38bdf8;
}

body[data-theme="caribenho"] .theme-active-ball {
    background-color: #fb923c;
}

body[data-theme="crystal"] .theme-active-ball {
    background-color: #04D9D9;
}

body[data-theme="singularidade"] .theme-active-ball {
    background-color: #8263F2;
}

.theme-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: var(--abyss-text, #e2e8f0);
    padding: 8px 12px;
    border-radius: 999px;
    position: relative;
    /* 3D transforms */
    transform-style: preserve-3d;
    transform: rotateX(-90deg) translateY(-20px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.theme-popup.visible .theme-option {
    transform: rotateX(0deg) translateY(0);
    opacity: 1;
}

/* Staggered entry */
.theme-popup.visible .theme-option:nth-child(1) {
    transition-delay: 0.05s;
}

.theme-popup.visible .theme-option:nth-child(2) {
    transition-delay: 0.10s;
}

.theme-popup.visible .theme-option:nth-child(3) {
    transition-delay: 0.15s;
}

.theme-popup.visible .theme-option:nth-child(4) {
    transition-delay: 0.20s;
}

.theme-option:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: translateZ(15px) scale(1.03) !important;
    z-index: 10;
}

.theme-option input[type="radio"] {
    display: none;
}

.theme-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    margin-right: 12px;
    position: relative;
    transition: all 0.2s ease;
}

.theme-option input[type="radio"]:checked+.theme-dot {
    border-color: #38bdf8;
}

/* Theme-specific active colors */
body[data-theme="caribenho"] .theme-option input[type="radio"]:checked+.theme-dot {
    border-color: #fb923c;
}

body[data-theme="crystal"] .theme-option input[type="radio"]:checked+.theme-dot {
    border-color: #04D9D9;
}

body[data-theme="singularidade"] .theme-option input[type="radio"]:checked+.theme-dot {
    border-color: #8263F2;
}


/* ─── Priority 2: Haptic Transitions (press feedback) ───────────────────── */
button,
.nav-link,
.kpi-card,
.flow-card,
.data-table tbody tr,
.flow-card-expand,
.goflow-win-btn {
    -webkit-tap-highlight-color: transparent;
}

button:active,
.filter-apply-btn:active,
.theme-toggle-btn:active,
.mobile-toggle:active,
.quick-filter-btn:active,
.goflow-tab:active,
.flow-card-expand:active,
.goflow-win-btn:active,
.nav-link:active,
.kpi-card:active,
.flow-card:not(.dragging):not(.drag-source-hidden):active,
.data-table tbody tr:active {
    transform: scale(var(--haptic-press-scale));
}

/* ─── Priority 3: Global Command Palette (Cmd+K) ───────────────────── */
.cmd-palette-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: rgba(2, 6, 23, 0.04);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    opacity: 0;
    transition: opacity 0.22s ease, backdrop-filter 0.22s ease, background 0.22s ease;
    pointer-events: none;
}

.cmd-palette-backdrop.show {
    opacity: 1;
    background: rgba(2, 6, 23, 0.08);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    pointer-events: all;
}

.cmd-palette-modal {
    width: min(780px, 92vw);
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid transparent;
    background: transparent;
    box-shadow: none;
    transform: translateY(10px) scale(0.985);
    transition:
        transform 0.26s var(--ease-out-expo),
        opacity 0.2s ease,
        padding 0.26s var(--ease-out-expo),
        border-radius 0.26s var(--ease-out-expo),
        border-color 0.26s ease,
        background 0.26s ease,
        box-shadow 0.26s ease;
    opacity: 0;
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
}

.cmd-palette-modal.has-results {
    padding: 10px;
    border-radius: 28px;
    border-color: rgba(255, 255, 255, 0.16);
    background: linear-gradient(165deg, rgba(20, 37, 68, 0.22) 0%, rgba(10, 23, 48, 0.3) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        0 20px 46px rgba(2, 8, 23, 0.28);
    backdrop-filter: blur(4px) saturate(118%);
    -webkit-backdrop-filter: blur(4px) saturate(118%);
}

.cmd-palette-backdrop.show .cmd-palette-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.cmd-search-shell {
    padding: 1px;
    border-radius: 999px;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.14) 35%, rgba(255, 255, 255, 0.5) 100%);
    box-shadow:
        0 10px 24px rgba(2, 8, 23, 0.22),
        0 1px 0 rgba(255, 255, 255, 0.25) inset;
    overflow: hidden;
}

.cmd-search-container {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 24px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.23);
    background:
        linear-gradient(120deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.04) 38%, rgba(11, 23, 48, 0.16) 100%);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.23) inset,
        0 12px 30px rgba(2, 8, 23, 0.22);
    backdrop-filter: blur(4px) saturate(118%);
    -webkit-backdrop-filter: blur(4px) saturate(118%);
    transition:
        border-radius 0.24s ease,
        border-color 0.24s ease,
        box-shadow 0.24s ease;
}

.cmd-palette-modal.has-results .cmd-search-container {
    border-radius: 20px;
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.2) inset,
        0 10px 24px rgba(2, 8, 23, 0.18);
}

.cmd-search-icon {
    width: 26px;
    height: 26px;
    color: rgba(255, 255, 255, 0.85);
    flex-shrink: 0;
}

.cmd-input {
    flex: 1;
    background: transparent;
    border: none;
    color: rgba(248, 250, 252, 0.94);
    font-size: clamp(1.3rem, 2vw, 1.95rem);
    font-weight: 500;
    letter-spacing: -0.02em;
    outline: none;
    padding: 0;
    text-shadow: 0 1px 10px rgba(255, 255, 255, 0.06);
}

.cmd-input::placeholder {
    color: rgba(226, 232, 240, 0.6);
}

.cmd-hint {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(239, 246, 255, 0.82);
    font-size: 0.75rem;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.cmd-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-6px);
    transition:
        max-height 0.24s ease,
        opacity 0.2s ease,
        transform 0.2s ease,
        padding 0.2s ease;
}

.cmd-palette-modal.has-results .cmd-list {
    max-height: 420px;
    padding: 2px 0 0;
    opacity: 1;
    transform: translateY(0);
    overflow-y: auto;
}

.cmd-list::-webkit-scrollbar {
    width: 6px;
}

.cmd-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 10px;
}

.cmd-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 999px;
    margin-bottom: 8px;
    cursor: pointer;
    color: rgba(226, 232, 240, 0.88);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 6px 16px rgba(2, 8, 23, 0.16);
    transition:
        transform 0.2s var(--ease-out-expo),
        border-color 0.24s ease,
        background 0.24s ease,
        box-shadow 0.24s ease;
}

.cmd-item:last-child {
    margin-bottom: 0;
}

.cmd-item-icon {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 4px 12px rgba(2, 8, 23, 0.16);
    transition: transform 0.2s var(--ease-out-expo), background 0.2s ease, border-color 0.2s ease;
}

.cmd-item-content {
    flex: 1;
    min-width: 0;
}

.cmd-item-title {
    color: rgba(248, 250, 252, 0.94);
    font-weight: 500;
    font-size: 1rem;
    letter-spacing: -0.02em;
}

.cmd-item-subtitle {
    font-size: 0.82rem;
    color: rgba(191, 219, 254, 0.65);
    margin-top: 3px;
}

.cmd-item.active,
.cmd-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.14),
        0 8px 20px rgba(2, 8, 23, 0.22);
    transform: translateX(4px);
}

.cmd-item.active .cmd-item-icon,
.cmd-item:hover .cmd-item-icon {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.03);
}

.cmd-item.active .cmd-item-title,
.cmd-item:hover .cmd-item-title {
    color: rgba(255, 255, 255, 0.98);
}

.cmd-item.active .cmd-item-subtitle,
.cmd-item:hover .cmd-item-subtitle {
    color: rgba(224, 242, 254, 0.84);
}

.cmd-empty-state {
    padding: 22px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed rgba(255, 255, 255, 0.14);
    text-align: center;
}

.cmd-empty-title {
    color: rgba(248, 250, 252, 0.9);
    font-size: 0.95rem;
    font-weight: 600;
}

.cmd-empty-subtitle {
    margin-top: 4px;
    color: rgba(191, 219, 254, 0.62);
    font-size: 0.84rem;
}

@media (max-width: 720px) {
    .cmd-palette-backdrop {
        padding: 16px;
    }

    .cmd-palette-modal {
        width: min(96vw, 780px);
    }

    .cmd-search-container {
        padding: 15px 16px;
        gap: 12px;
    }

    .cmd-palette-modal.has-results .cmd-search-container {
        border-radius: 16px;
    }

    .cmd-search-icon {
        width: 22px;
        height: 22px;
    }

    .cmd-input {
        font-size: 1.2rem;
    }

    .cmd-hint {
        display: none;
    }

    .cmd-item {
        padding: 11px 12px;
        border-radius: 999px;
    }

    .cmd-item-icon {
        width: 36px;
        height: 36px;
    }
}

/* Command Palette target spotlight */
.cmd-target-glow {
    position: relative;
    border-color: rgba(56, 189, 248, 0.56) !important;
    box-shadow:
        0 0 0 1px rgba(56, 189, 248, 0.45),
        0 0 0 8px rgba(56, 189, 248, 0.12),
        0 14px 28px rgba(2, 8, 23, 0.3) !important;
    animation: cmd-target-glow-pulse 1.2s var(--ease-out-expo);
    will-change: box-shadow, border-color;
}

.cmd-target-glow::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(120deg, rgba(125, 211, 252, 0.32) 0%, rgba(186, 230, 253, 0.14) 30%, rgba(56, 189, 248, 0.06) 100%);
    opacity: 0.8;
}

@keyframes cmd-target-glow-pulse {
    0% {
        box-shadow:
            0 0 0 1px rgba(56, 189, 248, 0.2),
            0 0 0 0 rgba(56, 189, 248, 0),
            0 10px 20px rgba(2, 8, 23, 0.2);
    }

    40% {
        box-shadow:
            0 0 0 1px rgba(56, 189, 248, 0.56),
            0 0 0 10px rgba(56, 189, 248, 0.16),
            0 16px 30px rgba(2, 8, 23, 0.32);
    }

    100% {
        box-shadow:
            0 0 0 1px rgba(56, 189, 248, 0.4),
            0 0 0 4px rgba(56, 189, 248, 0.08),
            0 12px 24px rgba(2, 8, 23, 0.26);
    }
}

/* ─── Clear Variant Underwater Normalization ───────────────────── */
#sidebar,
body[data-theme] #sidebar,
#main-header,
body[data-theme] #main-header,
.date-filter,
body[data-theme] .date-filter,
.goflow-modal-content,
body[data-theme] .goflow-modal-content,
.goflow-window,
body[data-theme] .goflow-window,
.kpi-card,
body[data-theme] .kpi-card,
.flow-card,
body[data-theme] .flow-card,
.table-wrap,
.table-search-shell,
.cmd-palette-modal.has-results,
.cmd-search-container,
.cmd-item:not(.active):not(:hover),
.quick-filter-btn:not(:hover),
.goflow-tabs,
.goflow-tab:not(.active):not(:hover),
.admin-input,
.admin-action-btn:not(.primary):not(.danger):not(:hover),
.admin-module-option,
.theme-toggle-btn:not(:hover),
.flow-card-expand,
.theme-popup,
.mobile-toggle,
.toast {
    background:
        linear-gradient(0deg, var(--glass-smoke), var(--glass-smoke)),
        linear-gradient(145deg, rgba(186, 230, 253, 0.035) 0%, rgba(125, 211, 252, 0.01) 34%, rgba(2, 16, 38, 0.24) 100%),
        var(--liquid-surface-core);
    border-color: rgba(125, 211, 252, 0.14);
}

.date-filter:hover,
.quick-filter-btn:hover,
.goflow-tab:not(.active):hover,
.admin-action-btn:not(.primary):not(.danger):hover,
.theme-toggle-btn:hover,
.flow-card-expand:hover,
.cmd-item:hover {
    background:
        linear-gradient(0deg, var(--glass-smoke), var(--glass-smoke)),
        linear-gradient(145deg, rgba(186, 230, 253, 0.05) 0%, rgba(125, 211, 252, 0.014) 34%, rgba(2, 16, 38, 0.3) 100%),
        var(--liquid-surface-core-hover);
}

.table-search-shell::after {
    background:
        linear-gradient(145deg, rgba(186, 230, 253, 0.04) 0%, rgba(125, 211, 252, 0.012) 36%, rgba(2, 16, 38, 0.22) 100%),
        rgba(2, 16, 38, 0.22);
    border-color: rgba(125, 211, 252, 0.15);
}

.goflow-modal-content,
body[data-theme] .goflow-modal-content,
.goflow-window,
body[data-theme] .goflow-window {
    background:
        linear-gradient(0deg, var(--glass-smoke), var(--glass-smoke)),
        linear-gradient(155deg, rgba(186, 230, 253, 0.024) 0%, rgba(56, 189, 248, 0.012) 16%, rgba(2, 8, 23, 0.18) 40%, rgba(2, 8, 23, 0.38) 100%),
        rgba(2, 8, 23, 0.35);
    border-color: rgba(191, 219, 254, 0.1);
}

.goflow-window,
body[data-theme] .goflow-window {
    box-shadow:
        0 24px 58px rgba(2, 8, 23, 0.44),
        0 0 0 1px rgba(15, 23, 42, 0.32),
        inset 0 1px 0 rgba(191, 219, 254, 0.08),
        inset 0 -22px 54px rgba(2, 8, 23, 0.2);
}

.goflow-modal-content {
    background:
        linear-gradient(0deg, var(--glass-smoke), var(--glass-smoke)),
        linear-gradient(155deg, rgba(186, 230, 253, 0.028) 0%, rgba(56, 189, 248, 0.012) 18%, rgba(2, 8, 23, 0.18) 44%, rgba(2, 8, 23, 0.34) 100%),
        rgba(2, 8, 23, 0.34);
}

.goflow-window.goflow-win-focus,
body[data-theme] .goflow-window.goflow-win-focus {
    box-shadow:
        0 30px 70px rgba(2, 8, 23, 0.5),
        0 0 0 1px rgba(125, 211, 252, 0.18),
        0 0 24px rgba(56, 189, 248, 0.1),
        inset 0 1px 0 rgba(191, 219, 254, 0.1);
}

.goflow-win-header,
body[data-theme] .goflow-win-header {
    background:
        linear-gradient(0deg, var(--glass-smoke), var(--glass-smoke)),
        linear-gradient(135deg, rgba(191, 219, 254, 0.028) 0%, rgba(56, 189, 248, 0.012) 16%, rgba(2, 8, 23, 0.16) 36%, rgba(2, 8, 23, 0.34) 100%),
        rgba(2, 8, 23, 0.28);
    border-bottom-color: rgba(191, 219, 254, 0.1);
}

.cmd-item-icon {
    background: rgba(125, 211, 252, 0.03);
    border-color: rgba(191, 219, 254, 0.1);
}

/* ─── Toast Notifications (Clear Liquid Glass) ─── */
#toast-container {
    position: fixed;
    z-index: 9999;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    pointer-events: none;
}

.toast-notification {
    pointer-events: auto;
    padding: 14px 22px;
    border-radius: 50px; /* Formato pílula */
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-deep);
    display: flex;
    align-items: center;
    gap: 14px;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    animation: toast-slide-in 0.5s var(--ease-spring) forwards;
}

.toast-notification::before {
    /* Refração de lente clear liquid glass via seletores universais em style.css */
    border-radius: 50px;
}

.toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.4);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

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

.toast-message {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--surface-text);
    letter-spacing: -0.01em;
}

/* Type variations */
.toast-success { border-color: rgba(74, 222, 128, 0.3); }
.toast-success .toast-icon { color: var(--laminar); background: var(--laminar-glow); }

.toast-error { border-color: rgba(239, 68, 68, 0.3); }
.toast-error .toast-icon { color: #f87171; background: rgba(239, 68, 68, 0.15); }

.toast-warning { border-color: rgba(251, 191, 36, 0.3); }
.toast-warning .toast-icon { color: var(--turbulent); background: var(--turbulent-glow); }

.toast-info { border-color: var(--glass-border-hover); }
.toast-info .toast-icon { color: #38bdf8; background: rgba(56, 189, 248, 0.15); }

/* Animations */
@keyframes toast-slide-in {
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.toast-exit {
    animation: toast-fade-out 0.4s var(--ease-out-expo) forwards;
}

@keyframes toast-fade-out {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(10px) scale(0.95); }
}

/* ─── UI/UX Refinement Layer ─────────────────────────────── */
.kpi-card,
.flow-card,
.data-table tbody tr,
.nav-link,
.quick-filter-btn,
.goflow-tab,
.theme-toggle-btn,
.flow-card-expand,
.cmd-item,
.admin-action-btn,
.filter-apply-btn,
.goflow-btn {
    transition-duration: var(--motion-fast), var(--motion-medium), var(--motion-medium), var(--motion-medium), var(--motion-fast), var(--motion-fast);
}

.kpi-card .kpi-value,
.flow-card .card-header h3,
.data-table .number {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1, "lnum" 1;
}

body.cmd-palette-open .kpi-card:hover,
body.cmd-palette-open .flow-card:hover,
body.modal-open .kpi-card:hover,
body.modal-open .flow-card:hover,
.drag-sorting-active .kpi-card:hover,
.drag-sorting-active .flow-card:hover {
    transform: none !important;
}

body.cmd-palette-open .kpi-card,
body.cmd-palette-open .flow-card,
body.modal-open .kpi-card,
body.modal-open .flow-card,
.drag-sorting-active .kpi-card,
.drag-sorting-active .flow-card {
    transition: border-color var(--motion-fast) ease, box-shadow var(--motion-fast) ease, background var(--motion-fast) ease !important;
}

body.cmd-palette-open #main-content,
body.modal-open #main-content {
    overflow: hidden;
}

@media (max-width: 1180px) {
    .header-right {
        gap: 10px;
    }

    .date-filter {
        margin-right: 8px;
        padding: 6px 10px;
        gap: 8px;
    }

    .header-actions {
        gap: 10px;
    }
}

@media (max-width: 960px) {
    #header-user-info {
        display: none;
    }

    .header-date {
        font-size: 0.78rem;
    }
}

@media (max-width: 768px) {
    .header-actions {
        gap: 8px;
    }

    #btn-logout {
        min-height: 32px;
        padding: 5px 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .kpi-card,
    .flow-card,
    .data-table tbody tr,
    .nav-link,
    .quick-filter-btn,
    .goflow-tab,
    .theme-toggle-btn,
    .flow-card-expand,
    .cmd-item,
    .admin-action-btn,
    .filter-apply-btn,
    .goflow-btn {
        transition: none !important;
        transform: none !important;
        animation: none !important;
    }
}

/* ─── Foundation: Inline-Style Migration ─────────────────── */
.executive-insights-grid {
    margin-bottom: 32px;
}

.section-kpis-compact {
    margin-bottom: 16px;
}

.custos-month-filter {
    display: none;
    justify-content: flex-start;
    margin-bottom: 24px;
    border-right: none;
    padding-right: 0;
    gap: 8px;
}

.flow-card-spaced-top {
    margin-top: 24px;
}

.table-head-right {
    text-align: right;
}

.card-header-between {
    justify-content: space-between;
}

.admin-modules-block {
    margin-top: 12px;
}

.admin-modules-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--stagnant);
    margin-bottom: 8px;
}

/* ─── Checklist Editor ───────────────────────────────────── */
.checklist-edit-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--stagnant);
}

.checklist-editor {
    display: none;
    padding: 16px;
}

.checklist-editor-caption {
    color: var(--stagnant);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.checklist-editor-header {
    display: grid;
    grid-template-columns: 100px 1fr 40px;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--stagnant);
    text-transform: uppercase;
}

.checklist-editor-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.checklist-editor-row {
    display: grid;
    grid-template-columns: 100px 1fr 40px;
    gap: 12px;
    align-items: center;
}

.checklist-editor-input {
    padding: 10px;
    border-radius: 6px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--surface-text);
}

.checklist-row-remove {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px dashed rgba(239, 68, 68, 0.4);
    padding: 8px;
    border-radius: 6px;
}

.checklist-add-row-btn {
    background: rgba(56, 189, 248, 0.1);
    color: var(--primary);
    border: 1px dashed var(--primary);
    width: 100%;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 16px;
}

.checklist-editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid var(--glass-border);
    padding-top: 16px;
}

.checklist-cancel-btn {
    background: transparent;
    color: var(--stagnant);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
}

.checklist-save-btn {
    background: var(--laminar);
    color: #062b29;
    font-weight: 700;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
}

.checklist-empty-state {
    color: var(--stagnant);
}

/* ─── Executive Insight Cards ────────────────────────────── */
.exec-card {
    flex: 1;
    min-width: 220px;
}

.exec-card-compact {
    min-width: 220px;
}

.exec-card-wide {
    min-width: 280px;
}

.exec-metric {
    text-align: center;
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.exec-value {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1, "lnum" 1;
    line-height: 1;
}

.exec-value-xl {
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.exec-value-lg {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.exec-pill {
    font-size: 0.85rem;
    font-weight: 650;
    margin-top: 2px;
}

.exec-subtext {
    font-size: 0.72rem;
    color: var(--stagnant);
    margin-top: 4px;
}

.exec-subtext-sm {
    font-size: 0.8rem;
}

.exec-progress {
    width: 100%;
    margin-top: 10px;
    background: rgba(148, 163, 184, 0.16);
    border-radius: 8px;
    overflow: hidden;
    height: 8px;
}

.exec-progress-bar {
    width: var(--exec-progress, 0%);
    height: 100%;
    border-radius: 8px;
    transition: width var(--motion-slow) var(--ease-out-expo);
}

.exec-split {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    gap: 8px;
}

.exec-split-col {
    text-align: center;
    flex: 1;
}

.exec-split-label {
    font-size: 0.65rem;
    color: var(--stagnant);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.exec-split-value {
    font-size: 0.95rem;
    font-weight: 600;
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}

.exec-header-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.exec-alert-badge {
    border: 1px solid transparent;
}

.exec-alert-list {
    padding: 8px 0;
}

.exec-alert-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 0.8rem;
}

.exec-alert-name {
    color: var(--stagnant);
    max-width: 65%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.exec-alert-margin {
    color: #ef4444;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.exec-alert-empty {
    text-align: center;
    padding: 16px;
    color: var(--stagnant);
    font-size: 0.85rem;
}

.exec-alert-more {
    text-align: center;
    padding: 6px;
    font-size: 0.75rem;
    color: var(--stagnant);
}

.exec-tone-good {
    --exec-tone: #4ade80;
    color: var(--exec-tone);
}

.exec-tone-warn {
    --exec-tone: #f59e0b;
    color: var(--exec-tone);
}

.exec-tone-danger {
    --exec-tone: #ef4444;
    color: var(--exec-tone);
}

.exec-tone-info {
    --exec-tone: #38bdf8;
    color: var(--exec-tone);
}

.exec-tone-neutral {
    --exec-tone: #cbd5e1;
    color: var(--exec-tone);
}

.exec-metric[class*="exec-tone-"] .exec-value,
.exec-metric[class*="exec-tone-"] .exec-pill {
    color: var(--exec-tone);
}

.exec-metric.exec-tone-good .exec-value,
.exec-metric.exec-tone-good .exec-pill {
    text-shadow: 0 0 20px rgba(74, 222, 128, 0.35);
}

.exec-metric.exec-tone-warn .exec-value,
.exec-metric.exec-tone-warn .exec-pill {
    text-shadow: 0 0 20px rgba(245, 158, 11, 0.35);
}

.exec-metric.exec-tone-danger .exec-value,
.exec-metric.exec-tone-danger .exec-pill {
    text-shadow: 0 0 20px rgba(239, 68, 68, 0.35);
}

.exec-metric.exec-tone-info .exec-value,
.exec-metric.exec-tone-info .exec-pill {
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.35);
}

.exec-metric.exec-tone-good .exec-progress-bar {
    background: #4ade80;
}

.exec-metric.exec-tone-warn .exec-progress-bar {
    background: #f59e0b;
}

.exec-metric.exec-tone-danger .exec-progress-bar {
    background: #ef4444;
}

.exec-metric.exec-tone-info .exec-progress-bar {
    background: #38bdf8;
}

.exec-alert-badge.exec-tone-good {
    background: rgba(74, 222, 128, 0.16);
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.32);
}

.exec-alert-badge.exec-tone-warn {
    background: rgba(245, 158, 11, 0.16);
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.32);
}

.exec-alert-badge.exec-tone-danger {
    background: rgba(239, 68, 68, 0.16);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.32);
}

/* ─── Manual Cards / Modal ───────────────────────────────── */
.manual-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.manual-parent {
    width: 100%;
    height: 200px;
    perspective: 1400px;
    cursor: pointer;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.manual-card {
    height: 100%;
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.01) 100%);
    backdrop-filter: blur(40px) saturate(140%) brightness(1.1);
    -webkit-backdrop-filter: blur(40px) saturate(140%) brightness(1.1);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow:
        inset 0 1.5px 1px rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1),
        inset 0 10px 40px rgba(255, 255, 255, 0.02),
        0 20px 40px -10px rgba(0, 0, 0, 0.45);
    transition: all 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    transform-style: preserve-3d;
    position: relative;
    overflow: hidden;
}

.manual-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 28px;
    padding: 1.5px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0) 70%, rgba(255, 255, 255, 0.1) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    transition: all 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.manual-card::after {
    content: '';
    position: absolute;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0) 45%,
            rgba(255, 255, 255, 0.08) 50%,
            rgba(255, 255, 255, 0) 55%,
            rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
    z-index: 2;
    transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.manual-content {
    padding: 26px 28px;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    z-index: 10;
}

.manual-icon {
    font-size: 2.3rem;
    margin-bottom: 14px;
    filter: drop-shadow(0 6px 12px rgba(56, 189, 248, 0.25));
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.6s ease;
}

.manual-content .manual-title {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
    font-size: 1.15rem;
    letter-spacing: -0.3px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.manual-content .manual-text {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.86rem;
    margin-top: 8px;
    line-height: 1.45;
    font-weight: 400;
    letter-spacing: -0.1px;
    flex-grow: 1;
    max-width: 90%;
}

.manual-bottom {
    position: absolute;
    bottom: 24px;
    right: 24px;
    z-index: 10;
}

.manual-bottom .view-more {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.06);
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 0.76rem;
    font-weight: 500;
    letter-spacing: -0.2px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.15), 0 2px 6px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.manual-bottom .view-more::after {
    content: '→';
    font-size: 0.9rem;
    transform: translateX(0);
    transition: transform 0.3s ease;
}

.manual-parent:hover {
    z-index: 20;
}

.manual-parent:hover .manual-card,
.manual-parent:focus-within .manual-card {
    transform: translateY(-6px) scale(1.02) rotateX(4deg) rotateY(-2deg);
    box-shadow:
        inset 0 1.5px 2px rgba(255, 255, 255, 0.25),
        inset 0 -1px 2px rgba(0, 0, 0, 0.1),
        inset 0 10px 40px rgba(255, 255, 255, 0.04),
        0 35px 65px -15px rgba(0, 0, 0, 0.7),
        0 0 40px rgba(56, 189, 248, 0.08);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.02) 100%);
}

.manual-parent:hover .manual-card::before,
.manual-parent:focus-within .manual-card::before {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 35%, rgba(255, 255, 255, 0) 65%, rgba(255, 255, 255, 0.2) 100%);
}

.manual-parent:hover .manual-card::after,
.manual-parent:focus-within .manual-card::after {
    transform: translateX(80%) translateY(80%);
}

.manual-parent:hover .manual-icon,
.manual-parent:focus-within .manual-icon {
    transform: scale(1.08) translateY(-4px);
    filter: drop-shadow(0 12px 18px rgba(56, 189, 248, 0.4));
}

.manual-parent:hover .view-more,
.manual-parent:focus-within .view-more {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.25), 0 8px 16px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.18);
}

.manual-parent:hover .view-more::after {
    transform: translateX(4px);
}

.manual-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    background: rgba(10, 15, 30, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    justify-content: center;
    align-items: center;
}

.manual-modal {
    width: min(92vw, 680px);
    max-height: 85vh;
    overflow-y: auto;
    background: var(--card-bg, #0f172a);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(56, 189, 248, 0.1), 0 0 60px rgba(56, 189, 248, 0.04);
    animation: manualModalScaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.manual-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--glass-border, rgba(255, 255, 255, 0.08));
}

.manual-modal-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.manual-modal-icon {
    font-size: 1.6rem;
}

.manual-modal-title {
    margin: 0;
    font-size: 1.15rem;
    color: var(--surface-text, #e2e8f0);
}

.manual-modal-close {
    background: none;
    border: none;
    color: var(--stagnant, #64748b);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color var(--motion-fast) ease, background var(--motion-fast) ease;
}

.manual-modal-close:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.manual-modal-close:focus-visible {
    box-shadow: var(--focus-ring);
}

.manual-modal-body {
    padding: 24px;
    color: var(--surface-text, #cbd5e1);
    font-size: 0.93rem;
    line-height: 1.7;
}

#manual-modal::-webkit-scrollbar {
    width: 6px;
}

#manual-modal::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, 0.2);
    border-radius: 3px;
}

#manual-modal ul {
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#manual-modal li {
    list-style-type: disc;
}

#manual-modal code {
    background: var(--glass-bg, rgba(255, 255, 255, 0.05));
    padding: 3px 7px;
    border-radius: 4px;
    font-size: 0.88em;
}

@keyframes manualModalScaleUp {
    from {
        transform: scale(0.92);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@media (max-width: 900px) {
    .checklist-editor-header,
    .checklist-editor-row {
        grid-template-columns: 84px 1fr 36px;
        gap: 8px;
    }

    .exec-card,
    .exec-card-wide {
        min-width: 100%;
    }
}
