/* ============================================================
   Voyage / Lobbyos — Design Tokens
   teal-slate primary, ochre accent, IBM Plex Sans
   ============================================================ */

:root {
  /* ─── Type ──────────────────────────────────────────── */
  --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --font-numeric: 'IBM Plex Sans', sans-serif;

  --fz-xs: 11px;
  --fz-sm: 12.5px;
  --fz-base: 13.5px;
  --fz-md: 15px;
  --fz-lg: 18px;
  --fz-xl: 22px;
  --fz-2xl: 28px;
  --fz-3xl: 36px;

  --lh-tight: 1.2;
  --lh-snug: 1.35;
  --lh-base: 1.5;

  /* ─── Spacing ───────────────────────────────────────── */
  --s-0: 0;
  --s-1: 2px;
  --s-2: 4px;
  --s-3: 6px;
  --s-4: 8px;
  --s-5: 10px;
  --s-6: 12px;
  --s-8: 16px;
  --s-10: 20px;
  --s-12: 24px;
  --s-16: 32px;
  --s-20: 40px;
  --s-24: 48px;
  --s-32: 64px;

  /* ─── Radius ────────────────────────────────────────── */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 10px;
  --r-xl: 14px;
  --r-2xl: 18px;
  --r-full: 999px;

  /* ─── Motion ────────────────────────────────────────── */
  --t-fast: 120ms;
  --t-base: 180ms;
  --t-slow: 240ms;
  --e-out: cubic-bezier(0.22, 1, 0.36, 1);
  --e-inout: cubic-bezier(0.65, 0, 0.35, 1);
  --e-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* ─── Light theme (default) ─────────────────────────── */
  --bg-canvas: #f7f8fa;
  --bg-elevated: #ffffff;
  --bg-subtle: #eef1f4;
  --bg-hover: #f1f4f7;
  --bg-active: #e7ebf0;
  --bg-overlay: rgba(20, 26, 34, 0.32);

  --border: #e4e8ed;
  --border-strong: #d1d6dd;
  --border-focus: #3b6478;
  --divider: #ecf0f3;

  --text: #131820;
  --text-muted: #5b6573;
  --text-faint: #8b94a3;
  --text-on-primary: #ffffff;
  --text-on-accent: #ffffff;

  --primary: #3b6478;
  --primary-hover: #305264;
  --primary-pressed: #284454;
  --primary-soft: #e6edf0;
  --primary-soft-hover: #d6e0e5;
  --primary-fg: #ffffff;
  --primary-tint: #f0f4f6;

  --accent: #b97f3e;
  --accent-hover: #a16c30;
  --accent-soft: #f4e7d3;
  --accent-soft-hover: #ebd9bf;

  --success: #4f8a5e;
  --success-soft: #e1ede2;
  --success-strong: #3d6e4a;

  --danger: #b25149;
  --danger-soft: #f1dad6;
  --danger-strong: #93403a;

  --warning: #c08329;
  --warning-soft: #f5e4c4;

  --info: #4a7a99;
  --info-soft: #e0eaf0;

  /* Booking status (chessboard) */
  --status-confirmed-bg: #cbdbe2;
  --status-confirmed-border: #6f93a1;
  --status-confirmed-fg: #1f3947;
  --status-checked-in-bg: #c7dccc;
  --status-checked-in-border: #6e9c7a;
  --status-checked-in-fg: #244a30;
  --status-checked-out-bg: #dee2e7;
  --status-checked-out-border: #aab2bd;
  --status-checked-out-fg: #4a525d;
  --status-pending-bg: #f3dfba;
  --status-pending-border: #c89943;
  --status-pending-fg: #6a4912;
  --status-cancelled-bg: #ecd3d0;
  --status-cancelled-border: #b88884;
  --status-cancelled-fg: #7a3d39;
  --status-blocked-bg: repeating-linear-gradient(135deg, #e4e8ed, #e4e8ed 4px, #d1d6dd 4px, #d1d6dd 8px);

  /* Shadows (very soft, multi-layer) */
  --shadow-xs: 0 1px 1px rgba(20, 26, 34, 0.04);
  --shadow-sm: 0 1px 2px rgba(20, 26, 34, 0.05), 0 1px 3px rgba(20, 26, 34, 0.03);
  --shadow-md: 0 1px 2px rgba(20, 26, 34, 0.04), 0 4px 8px rgba(20, 26, 34, 0.04), 0 8px 16px rgba(20, 26, 34, 0.04);
  --shadow-lg: 0 1px 2px rgba(20, 26, 34, 0.04), 0 6px 12px rgba(20, 26, 34, 0.05), 0 16px 32px rgba(20, 26, 34, 0.06);
  --shadow-xl: 0 1px 2px rgba(20, 26, 34, 0.04), 0 10px 20px rgba(20, 26, 34, 0.06), 0 24px 48px rgba(20, 26, 34, 0.08);

  --ring-focus: 0 0 0 3px rgba(59, 100, 120, 0.18);

  /* Chart palette (calm) */
  --chart-1: #3b6478;
  --chart-2: #b97f3e;
  --chart-3: #6f93a1;
  --chart-4: #92a86c;
  --chart-5: #a08070;
  --chart-6: #7a8a9a;
}

[data-theme="dark"] {
  --bg-canvas: #0d1217;
  --bg-elevated: #141a21;
  --bg-subtle: #1a2129;
  --bg-hover: #1f2730;
  --bg-active: #252e38;
  --bg-overlay: rgba(0, 0, 0, 0.55);

  --border: #232c36;
  --border-strong: #2f3a46;
  --border-focus: #76a0b2;
  --divider: #1b232b;

  --text: #e8ecf0;
  --text-muted: #98a2ad;
  --text-faint: #6a7380;
  --text-on-primary: #ffffff;
  --text-on-accent: #18120a;

  --primary: #5e8497;
  --primary-hover: #76a0b2;
  --primary-pressed: #8ab4c5;
  --primary-soft: #1d2a32;
  --primary-soft-hover: #243441;
  --primary-fg: #0d1217;
  --primary-tint: #16202a;

  --accent: #d49a60;
  --accent-hover: #e0ad7a;
  --accent-soft: #2a2117;
  --accent-soft-hover: #342a1d;

  --success: #6da777;
  --success-soft: #1a2a1f;
  --success-strong: #8fc198;

  --danger: #c97870;
  --danger-soft: #2c1a18;
  --danger-strong: #d9928a;

  --warning: #d8a356;
  --warning-soft: #2c2014;

  --info: #6a98b8;
  --info-soft: #19242c;

  --status-confirmed-bg: #294049;
  --status-confirmed-border: #6f93a1;
  --status-confirmed-fg: #c1d6df;
  --status-checked-in-bg: #2c4533;
  --status-checked-in-border: #6e9c7a;
  --status-checked-in-fg: #c2dcc9;
  --status-checked-out-bg: #262d36;
  --status-checked-out-border: #5a6573;
  --status-checked-out-fg: #98a2ad;
  --status-pending-bg: #423318;
  --status-pending-border: #c89943;
  --status-pending-fg: #ecd09a;
  --status-cancelled-bg: #3d2522;
  --status-cancelled-border: #b88884;
  --status-cancelled-fg: #e3b7b3;
  --status-blocked-bg: repeating-linear-gradient(135deg, #232c36, #232c36 4px, #2f3a46 4px, #2f3a46 8px);

  --shadow-xs: 0 1px 1px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 8px rgba(0, 0, 0, 0.25), 0 8px 16px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 12px rgba(0, 0, 0, 0.3), 0 16px 32px rgba(0, 0, 0, 0.35);
  --shadow-xl: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 20px rgba(0, 0, 0, 0.35), 0 24px 48px rgba(0, 0, 0, 0.4);

  --ring-focus: 0 0 0 3px rgba(118, 160, 178, 0.28);

  --chart-1: #76a0b2;
  --chart-2: #d49a60;
  --chart-3: #91b3c0;
  --chart-4: #b0c391;
  --chart-5: #b89c8d;
  --chart-6: #98a8b8;
}

/* ─── Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font-sans);
  font-size: var(--fz-base);
  line-height: var(--lh-base);
  color: var(--text);
  background-color: var(--bg-canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01';
}

/* tabular numbers helper */
.num { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; }

/* ─── Scrollbars ─────────────────────────────────────── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border: 2px solid transparent;
  background-clip: padding-box;
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); background-clip: padding-box; border: 2px solid transparent; }

/* ─── Focus ──────────────────────────────────────────── */
:focus-visible { outline: none; box-shadow: var(--ring-focus); border-radius: var(--r-sm); }
button { font-family: inherit; cursor: pointer; }

/* ─── Selection ──────────────────────────────────────── */
::selection { background: var(--primary-soft); color: var(--text); }

/* ─── Shimmer ────────────────────────────────────────── */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--bg-subtle) 0%, var(--bg-hover) 50%, var(--bg-subtle) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
  border-radius: var(--r-sm);
}

/* ─── Slide-in (sidepanel) ───────────────────────────── */
@keyframes slide-in-right {
  from { transform: translateX(16px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-scale-in { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: scale(1); } }

/* ─── Toast ──────────────────────────────────────────── */
@keyframes toast-in {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ─── Layout helpers ─────────────────────────────────── */
.app-root {
  display: grid;
  grid-template-columns: var(--sidebar-w, 232px) 1fr;
  height: 100vh;
  overflow: hidden;
}
.app-root[data-sidebar="collapsed"] { --sidebar-w: 56px; }
