:root {
    /* Brand — ZeroBit.tech palette (navy + azure, mist background) */
    --brand-navy: #0B1F3A;
    --brand-azure: #2563EB;
    --brand-azure-light: #4C8DFF;
    --brand-mist: #F4F6FA;

    /* Primary palette */
    --primary: var(--brand-azure);
    --primary-hover: #1D4ED8;
    --primary-light: #E0EAFD;
    --primary-dark: #1E40AF;
    --gradient-primary: linear-gradient(135deg, var(--brand-azure), var(--brand-navy));

    /* Status colors */
    --success: #10B981;
    --success-light: #D1FAE5;
    --success-dark: #047857;

    --danger: #DC2626;
    --danger-light: #FEE2E2;
    --danger-dark: #B91C1C;

    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --warning-dark: #B45309;

    --info: #06B6D4;
    --info-light: #CFFAFE;
    --info-dark: #0E7490;

    /* Neutrals — cool slate ramp that ends in brand navy */
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #5B6B82;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1E293B;
    --gray-900: var(--brand-navy);

    /* Backgrounds */
    --bg-primary: #FFFFFF;
    --bg-secondary: var(--brand-mist);
    --bg-tertiary: var(--gray-100);

    /* Text */
    --text-primary: var(--gray-900);
    --text-secondary: var(--gray-600);
    --text-muted: var(--gray-500);
    --text-inverse: #FFFFFF;

    /* Borders */
    --border-color: var(--gray-200);
    --border-color-dark: var(--gray-300);

    /* Border radius */
    --radius-sm: 4px;
    --radius: 12px;
    --radius-card: 14px;
    --radius-hero: 16px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-pill: 20px;
    --radius-squircle: 10px;
    --radius-full: 9999px;

    /* Shadows (2 levels + FAB) */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-elevated: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-fab: 0 4px 14px rgba(37, 99, 235, 0.35);

    /* Typography Scale */
    --font-display: 800;
    --font-heading: 700;
    --font-subheading: 700;
    --font-body: 600;
    --font-caption: 500;
    --font-micro: 600;

    /* Dark Surface */
    --surface-dark: linear-gradient(135deg, #163057, var(--brand-navy));
    --surface-dark-text: #FFFFFF;
    --surface-dark-muted: #A9B8CF;
    --surface-dark-icon-bg: rgba(76, 141, 255, 0.18);

    /* Softer Borders */
    --border-list: #EDF1F7;

    /* Transitions */
    --transition-fast: 100ms ease-in-out;
    --transition: 150ms ease-in-out;
    --transition-slow: 300ms ease-in-out;

    /* Z-index layers */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --z-toast: 1080;
    --z-bottom-nav: 1025;
    --z-offline-banner: 1090;

    /* Mobile touch targets */
    --touch-target-min: 44px;
    --touch-target-input: 48px;
    --touch-target-list: 56px;

    /* Mobile layout */
    --bottom-nav-height: 64px;
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-top: env(safe-area-inset-top, 0px);

    /* Type scale */
    --text-2xs: 11px;
    --text-xs:  12px;
    --text-sm:  13px;
    --text-base: 14px;
    --text-md:  15px;
    --text-lg:  16px;
    --text-xl:  18px;
    --text-2xl: 22px;
    --text-3xl: 28px;

    /* Line heights */
    --line-tight: 1.2;
    --line-normal: 1.45;
    --line-relaxed: 1.6;

    /* Spacing scale — 4px base step (every value is a multiple of 4) */
    --space-0: 0;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
}

/* Dark mode — deep-navy palette derived from the ZeroBit brand. Activated by either
   [data-theme="dark"] (explicit user preference) or [data-resolved-theme="dark"]
   (user chose 'system' and OS prefers dark). */
[data-theme="dark"], [data-resolved-theme="dark"] {
    --bg-primary: #0A1A30;
    --bg-secondary: #071324;
    --bg-tertiary: #12274A;
    --bg-list: #0A1A30;
    --bg-elevated: #10233F;
    --bg-muted: #1B3358;

    --text-primary: #E8EEF7;
    --text-secondary: #A3B3CB;
    --text-muted: #8494AE;
    --text-inverse: #0A1A30;

    --primary: var(--brand-azure-light);
    --primary-hover: #74A6FF;
    --primary-light: rgba(76, 141, 255, 0.16);
    --primary-dark: #2F74F0;
    --gradient-primary: linear-gradient(135deg, var(--brand-azure-light), var(--brand-azure));

    --success: #3fb950;
    --success-light: rgba(63, 185, 80, 0.15);
    --success-dark: #2ea043;

    --danger: #f85149;
    --danger-light: rgba(248, 81, 73, 0.15);
    --danger-dark: #ff7b72;

    --warning: #d29922;
    --warning-light: rgba(210, 153, 34, 0.15);
    --warning-dark: #e3b341;

    --info: #39c5cf;
    --info-light: rgba(57, 197, 207, 0.15);
    --info-dark: #56d4dd;

    --border-color: #1F3A63;
    --border-color-dark: #2C4C7C;
    --border-list: #15294A;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.5);
    --shadow-elevated: 0 4px 16px rgba(0, 0, 0, 0.6);

    --surface-dark: linear-gradient(135deg, #12274A, #0A1A30);
    --surface-dark-icon-bg: rgba(76, 141, 255, 0.2);
}
