/* Kronzen design tokens — Gestor + Planificador
 * Dark: oficina/interior
 * Light (.light): obra / luz solar directa (alto contraste, sin grises lavados)
 */

:root {
  /* Geometry & elevation */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --modal-w-sm: 480px;
  --modal-w-md: 640px;
  --modal-w-lg: 920px;
  --modal-w-xl: 1120px;
  --modal-w-sheet: 1280px;
  --modal-w-content: min(calc(100vw - var(--sidebar-w, 232px) - 72px), var(--modal-w-sheet));
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.18);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.22);

  /* Dark — azul petróleo neutro + esmeralda */
  --bg: #121618;
  --bg2: #181c1f;
  --bg3: #21282c;
  --bg4: #2a3338;
  --tx: #eef1f2;
  --tx2: #c5ced3;
  --tx3: #9aa8b0;
  --bd: #2a3439;
  --bd2: #3a484f;
  --acc: #2eb8a6;
  --acc2: #1a3330;
  --accl: #6dd4c7;
  --on-acc: #ffffff;
  --acc-grad: #2eb8a6;
  --title-color: #eef1f2;
  --title-start: #eef1f2;
  --title-end: #eef1f2;

  /* Semantic — saturados pero legibles en oscuro */
  --green: #3dba8a;
  --gn2: #1a2e28;
  --red: #f07070;
  --rd2: #3a2222;
  --amber: #e0b04a;
  --amb2: #332a18;
  --blue: #5aafc8;
  --bl2: #1a2a32;
  --purple: #a894d4;
  --pur2: #2a2438;
  --orange: #d4986a;
  --or2: #332418;

  /* Empresa / calendario */
  --emp-propia: #2eb8a6;
  --emp-propia2: #1a3330;
  --emp-sub: #c4a84a;
  --emp-sub2: #332a18;
  --auto: #c4905a;
  --auto2: #332418;
  --emp1: #4aafc8;
  --emp2: #c87898;
  --emp3: #5dba82;
  --emp4: #c8a850;
  --emp5: #9888c8;
  --emp6: #4ab8a8;
  --emp7: #c88068;
  --emp8: #7888c8;
  --emp9: #c8a868;
  --emp10: #58b898;

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

  /* Motion */
  --duration-instant: 100ms;
  --duration-fast: 150ms;
  --duration-normal: 200ms;
  --duration-medium: 260ms;
  --duration-slow: 380ms;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-size-xs: 11px;
  --font-size-sm: 12px;
  --font-size-base: 14px;
  --font-size-md: 15px;
  --font-size-lg: 18px;
  --font-size-xl: 22px;
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;

  /* A11y */
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--acc) 28%, transparent);
  --touch-min: 44px;

  --header-blur: saturate(160%) blur(10px);
  --surface-elevated: var(--bg2);
}

/* Light — exterior / sol directo (~7:1 texto secundario, estados saturados) */
.light {
  --shadow-sm: 0 1px 2px rgba(10, 16, 18, 0.08);
  --shadow-md: 0 4px 12px rgba(10, 16, 18, 0.1);

  --bg: #ffffff;
  --bg2: #ffffff;
  --bg3: #f2f5f6;
  --bg4: #e4eaeb;
  --tx: #0a1012;
  --tx2: #1a2328;
  --tx3: #3d4a52;
  --bd: #c5cdd2;
  --bd2: #9aa8b0;

  /* Esmeralda más oscura para contraste sobre blanco */
  --acc: #08756b;
  --acc2: #d8f3ef;
  --accl: #044d47;
  --on-acc: #ffffff;
  --acc-grad: #08756b;
  --title-color: #0a1012;
  --title-start: #0a1012;
  --title-end: #0a1012;

  --green: #047857;
  --gn2: #d1fae5;
  --red: #c81e1e;
  --rd2: #fee2e2;
  --amber: #b45309;
  --amb2: #fef3c7;
  --blue: #0369a1;
  --bl2: #e0f2fe;
  --purple: #6d28d9;
  --pur2: #ede9fe;
  --orange: #c2410c;
  --or2: #ffedd5;

  --emp-propia: #08756b;
  --emp-propia2: #d8f3ef;
  --emp-sub: #92400e;
  --emp-sub2: #fef3c7;
  --auto: #9a3412;
  --auto2: #ffedd5;
  --emp1: #0369a1;
  --emp2: #9d174d;
  --emp3: #166534;
  --emp4: #92400e;
  --emp5: #5b21b6;
  --emp6: #0f766e;
  --emp7: #9a3412;
  --emp8: #1e40af;
  --emp9: #92400e;
  --emp10: #047857;

  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--acc) 35%, transparent);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-instant: 0ms;
    --duration-fast: 0ms;
    --duration-normal: 0ms;
    --duration-medium: 0ms;
    --duration-slow: 0ms;
  }
}
