/* ══════════════════════════════════════════════
   FarmBot Design Tokens
   Single source of truth for all colors, spacing, radii, shadows
   ══════════════════════════════════════════════ */

:root {
    /* ── Brand ── */
    --color-primary: #3B82F6;
    --color-primary-hover: #2563EB;
    --color-primary-light: #60A5FA;
    --color-primary-bg: rgba(59,130,246,.1);

    --color-secondary: #06B6D4;
    --color-secondary-hover: #0891B2;

    --color-accent: #8B5CF6;

    /* ── Semantic ── */
    --color-success: #10B981;
    --color-success-hover: #059669;
    --color-success-bg: rgba(16,185,129,.1);
    --color-success-text: #059669;

    --color-warning: #F59E0B;
    --color-warning-hover: #D97706;
    --color-warning-bg: rgba(245,158,11,.1);
    --color-warning-text: #D97706;

    --color-danger: #EF4444;
    --color-danger-hover: #DC2626;
    --color-danger-bg: rgba(239,68,68,.1);
    --color-danger-text: #DC2626;

    --color-info: #3B82F6;
    --color-info-bg: rgba(59,130,246,.1);
    --color-info-text: #2563EB;

    --color-muted: #6B7280;
    --color-muted-bg: rgba(107,114,128,.1);

    /* ── Light theme surfaces ── */
    --bg-page: #F1F5F9;
    --bg-card: #FFFFFF;
    --bg-card-hover: #FAFBFF;
    --bg-input: #FFFFFF;
    --bg-sidebar: #FFFFFF;
    --bg-header: rgba(255,255,255,0.92);
    --bg-dropdown: #FFFFFF;
    --bg-modal-backdrop: rgba(0,0,0,.5);
    --bg-hover: #F1F5F9;
    --bg-active: #EFF6FF;
    --bg-table-header: #F8FAFC;
    --bg-table-row-hover: #FAFBFF;

    /* ── Light theme text ── */
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --text-muted: #94A3B8;
    --text-inverse: #FFFFFF;

    /* ── Light theme borders ── */
    --border-default: #E2E8F0;
    --border-light: #F1F5F9;
    --border-strong: #CBD5E1;

    /* ── Spacing scale (4px base) ── */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;

    /* ── Border radius ── */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* ── Shadows ── */
    --shadow-sm: 0 1px 3px rgba(0,0,0,.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,.06);
    --shadow-lg: 0 8px 24px rgba(0,0,0,.08);
    --shadow-xl: 0 16px 48px rgba(0,0,0,.12);
    --shadow-modal: 0 24px 80px rgba(0,0,0,.18);

    /* ── Typography ── */
    --font-sans: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --text-xs: 11px;
    --text-sm: 13px;
    --text-base: 14px;
    --text-lg: 16px;
    --text-xl: 20px;
    --text-2xl: 24px;
    --line-height-tight: 1.2;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.6;

    /* ── Transitions ── */
    --transition-fast: 150ms ease;
    --transition-normal: 200ms ease;
    --transition-slow: 300ms ease;

    /* ── Z-index scale ── */
    --z-dropdown: 40;
    --z-modal-backdrop: 50;
    --z-modal: 51;
    --z-toast: 100;
    --z-command-palette: 200;
}

/* ── Dark theme overrides ── */
html.dark {
    --bg-page: #0a0e17;
    --bg-card: #1A1D28;
    --bg-card-hover: #1F2233;
    --bg-input: #111827;
    --bg-sidebar: #111827;
    --bg-header: rgba(17,24,39,0.92);
    --bg-dropdown: #1a2234;
    --bg-modal-backdrop: rgba(0,0,0,.65);
    --bg-hover: #1a2234;
    --bg-active: rgba(59,130,246,.1);
    --bg-table-header: #111827;
    --bg-table-row-hover: rgba(255,255,255,.015);

    --text-primary: #F1F5F9;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;

    --border-default: #2D3348;
    --border-light: #1F2937;
    --border-strong: #374151;

    --shadow-sm: none;
    --shadow-md: 0 4px 12px rgba(0,0,0,.2);
    --shadow-lg: 0 8px 24px rgba(0,0,0,.3);
    --shadow-xl: 0 16px 48px rgba(0,0,0,.4);
    --shadow-modal: 0 24px 80px rgba(0,0,0,.55);
}
