/* ========================================================================
   BidMaster Design Tokens — Single source of truth
   Calm premium B2B SaaS: deep teal, cyan accents, slate neutrals
   ======================================================================== */

:root {
    /* ── Brand ── */
    --brand: #0f766e;
    --brand-hover: #0d9488;
    --brand-soft: rgba(15, 118, 110, 0.12);
    --brand-light: #ecfdf3;

    /* ── Accent ── */
    --accent: #0ea5e9;
    --accent-soft: rgba(14, 165, 233, 0.12);

    /* ── Semantic ── */
    --success: #16a34a;
    --success-soft: rgba(22, 163, 74, 0.10);
    --danger: #dc2626;
    --danger-soft: rgba(220, 38, 38, 0.10);
    --warning: #f59e0b;
    --warning-soft: rgba(245, 158, 11, 0.10);
    --info: #0ea5e9;
    --info-soft: rgba(14, 165, 233, 0.10);

    /* ── Typography ── */
    --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'SF Mono', Monaco, Consolas, 'Liberation Mono', monospace;

    --text-primary: #0b1220;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;

    /* Type scale (Major Third 1.25) */
    --text-xs: 0.694rem;   /* 11.1px */
    --text-sm: 0.8rem;     /* 12.8px */
    --text-base: 0.875rem; /* 14px */
    --text-md: 0.95rem;    /* 15.2px */
    --text-lg: 1.1rem;     /* 17.6px */
    --text-xl: 1.35rem;    /* 21.6px */
    --text-2xl: 1.6rem;    /* 25.6px */
    --text-3xl: 2rem;      /* 32px */

    --weight-normal: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;
    --weight-extrabold: 800;

    --leading-tight: 1.25;
    --leading-normal: 1.55;
    --leading-relaxed: 1.65;

    /* ── Surfaces ── */
    --bg-primary: #ffffff;
    --bg-secondary: #f6f8fb;
    --bg-tertiary: #eef2f6;
    --bg-hover: rgba(15, 23, 42, 0.04);
    --surface: var(--bg-primary);

    /* ── Borders & Shadows ── */
    --border: rgba(15, 23, 42, 0.10);
    --border-light: rgba(15, 23, 42, 0.08);
    --border-focus: rgba(14, 165, 233, 0.55);

    --shadow-xs: 0 1px 2px rgba(2, 6, 23, 0.04);
    --shadow-sm: 0 1px 4px rgba(2, 6, 23, 0.06);
    --shadow: 0 10px 30px rgba(2, 6, 23, 0.08);
    --shadow-md: 0 4px 16px rgba(2, 6, 23, 0.10);
    --shadow-lg: 0 18px 60px rgba(2, 6, 23, 0.14);
    --focus-ring: 0 0 0 4px rgba(14, 165, 233, 0.18);

    /* ── Spacing scale (4px base) ── */
    --space-0: 0;
    --space-1: 0.25rem;  /* 4px */
    --space-2: 0.5rem;   /* 8px */
    --space-3: 0.75rem;  /* 12px */
    --space-4: 1rem;     /* 16px */
    --space-5: 1.25rem;  /* 20px */
    --space-6: 1.5rem;   /* 24px */
    --space-8: 2rem;     /* 32px */
    --space-10: 2.5rem;  /* 40px */
    --space-12: 3rem;    /* 48px */
    --space-16: 4rem;    /* 64px */

    /* ── Radii ── */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 999px;

    /* ── Layout ── */
    --sidebar-width: 260px;
    --topbar-height: 64px;
    --content-max-width: 1440px;

    /* ── Transitions ── */
    --ease-default: cubic-bezier(0.4, 0, 0.2, 1);
    --duration-fast: 150ms;
    --duration-normal: 250ms;

    /* ── Z-index scale ── */
    --z-base: 1;
    --z-sticky: 10;
    --z-dropdown: 30;
    --z-topbar: 50;
    --z-sidebar: 100;
    --z-overlay: 199;
    --z-modal: 1000;
    --z-toast: 1100;
}

/* ── Dark Theme ── */
[data-theme="dark"] {
    --brand: #14b8a6;
    --brand-hover: #0ea5a5;
    --brand-soft: rgba(20, 184, 166, 0.14);
    --brand-light: #0f172a;

    --success: #22c55e;
    --success-soft: rgba(34, 197, 94, 0.14);
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, 0.14);
    --warning: #fbbf24;
    --warning-soft: rgba(251, 191, 36, 0.14);
    --info: #38bdf8;
    --info-soft: rgba(56, 189, 248, 0.14);

    --text-primary: #e5e7eb;
    --text-secondary: #d1d5db;
    --text-muted: #a1afc4;

    --bg-primary: #0b1220;
    --bg-secondary: #0f172a;
    --bg-tertiary: #111c33;
    --bg-hover: rgba(226, 232, 240, 0.08);

    --border: rgba(226, 232, 240, 0.12);
    --border-light: rgba(226, 232, 240, 0.09);

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.25);
    --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.30);
    --shadow: 0 12px 34px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.30);
    --shadow-lg: 0 22px 70px rgba(0, 0, 0, 0.45);
    --focus-ring: 0 0 0 4px rgba(56, 189, 248, 0.18);
}

/* ── Color Aliases (backward compat) ── */
:root {
    --primary: var(--brand);
    --primary-hover: var(--brand-hover);
    --primary-soft: var(--brand-soft);
    --primary-light: var(--brand-light);
    --text: var(--text-primary);
    --bg: var(--bg-secondary);
}
