/**
 * GarageOS — Design Tokens
 * ══════════════════════════════════════════════════════════════
 * Formalized design system tokens. Import BEFORE other CSS files.
 * This normalizes the existing visual language without changing it.
 * ══════════════════════════════════════════════════════════════
 */

:root {
  /* ── Spacing Scale ─────────────────────────────────────── */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  24px;
  --space-6:  32px;
  --space-7:  48px;
  --space-8:  64px;

  /* ── Radius ────────────────────────────────────────────── */
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   14px;   /* matches current card radius */
  --radius-xl:   20px;
  --radius-pill: 999px;

  /* ── Shadows ───────────────────────────────────────────── */
  --shadow-xs:  0 1px 2px rgba(0,0,0,.04);
  --shadow-sm:  0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:  0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
  --shadow-lg:  0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.04);
  --shadow-xl:  0 20px 25px -5px rgba(0,0,0,.10), 0 8px 10px -6px rgba(0,0,0,.05);

  /* ── Typography ────────────────────────────────────────── */
  --font-body:  system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-mono:  "SF Mono", "Fira Code", "JetBrains Mono", "Cascadia Code", monospace;

  --text-xs:    11px;
  --text-sm:    12px;
  --text-base:  14px;
  --text-lg:    16px;
  --text-xl:    20px;
  --text-2xl:   24px;
  --text-3xl:   32px;
  --text-4xl:   42px;

  --weight-normal:  400;
  --weight-medium:  500;
  --weight-bold:    700;
  --weight-heavy:   850;
  --weight-black:   950;

  --leading-tight:  1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.65;

  /* ── Transitions ───────────────────────────────────────── */
  --ease-default:  cubic-bezier(0.4, 0, 0.2, 1);
  --ease-in:       cubic-bezier(0.4, 0, 1, 1);
  --ease-out:      cubic-bezier(0, 0, 0.2, 1);
  --ease-bounce:   cubic-bezier(0.34, 1.56, 0.64, 1);

  --duration-fast:   120ms;
  --duration-normal: 200ms;
  --duration-slow:   350ms;

  /* ── Z-Index Scale ─────────────────────────────────────── */
  --z-dropdown:   50;
  --z-sticky:     60;
  --z-overlay:    80;
  --z-modal:      100;
  --z-toast:      120;
  --z-tooltip:    130;

  /* ── Semantic Colors (supplement existing --brand etc.) ── */
  --success:    #22c55e;
  --success-bg: color-mix(in oklab, #22c55e 12%, var(--panel));
  --warning:    #f59e0b;
  --warning-bg: color-mix(in oklab, #f59e0b 12%, var(--panel));
  --info:       #3b82f6;
  --info-bg:    color-mix(in oklab, #3b82f6 12%, var(--panel));
  --danger-bg:  color-mix(in oklab, var(--danger) 12%, var(--panel));

  /* ── Component Tokens ──────────────────────────────────── */
  --card-padding:     var(--space-5);
  --card-radius:      var(--radius-lg);
  --card-border:      1px solid var(--line);
  --card-inner-bg:    var(--panel2);

  --input-height:     40px;
  --input-padding:    0 var(--space-3);
  --input-radius:     var(--radius-md);
  --input-border:     1px solid var(--line);

  --btn-height:       40px;
  --btn-padding:      0 var(--space-4);
  --btn-radius:       var(--radius-md);
  --btn-mini-height:  32px;
  --btn-mini-padding: 0 var(--space-3);

  --topbar-height:    56px;
  --sidebar-width:    220px;
}

/* ── Utility Classes ───────────────────────────────────────── */

/* Status colors for badges and indicators */
.status-ok      { color: var(--success); }
.status-warn    { color: var(--warning); }
.status-bad     { color: var(--danger); }
.status-info    { color: var(--info); }

.bg-success     { background: var(--success-bg); }
.bg-warning     { background: var(--warning-bg); }
.bg-danger      { background: var(--danger-bg); }
.bg-info        { background: var(--info-bg); }

/* Truncate text */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Focus visible (accessibility) */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Smooth scrolling */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* ── Print Tokens ──────────────────────────────────────────── */
@media print {
  :root {
    --shadow-xs: none;
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: none;
    --shadow-xl: none;
  }
}
