/* ============================================================
   Scheduler — Design System
   Navy #263F8C · Red #F22233 · Amber #F2A516 · Public Sans.
   Color signals status: navy=structure/selection, green=going,
   amber=waitlist/attention, red=full/danger. Tokens drive the theme.
   ============================================================ */
:root {
  --bg:           #eef1f6;
  --bg-sunken:    #e2e6ee;
  --surface:      #ffffff;
  --surface-2:    #f7f8fb;

  --ink:          #14181f;
  --ink-2:        #3c4654;
  --ink-3:        #66707e;
  --ink-4:        #95a0af;

  --border:       #e2e6ee;
  --border-2:     #d4dae6;

  --primary:      #263F8C;
  --primary-700:  #1d3170;
  --primary-300:  #8c9bd0;
  --primary-soft: #e7ebf6;
  --on-primary:   #ffffff;

  --accent:       #1f7a4d;
  --accent-700:   #14613b;
  --accent-soft:  #e7f4ed;

  --danger:       #F22233;
  --danger-soft:  #fdeced;
  --warn:         #F2A516;
  --warn-soft:    #fdf3df;
  --warn-ink:     #b9760a;
  --success:      #1f7a4d;
  --success-soft: #e7f4ed;

  --amber:        #F2A516;
  --brand-red:    #F22233;

  /* Navy sidebar (gradient applied in staff.css) */
  --nav-bg:       #182a60;
  --nav-bg-2:     #14224d;
  --nav-ink:      #dfe5f5;
  --nav-ink-2:    #c5cdea;
  --nav-line:     rgba(255,255,255,.10);
  --nav-active:   rgba(255,255,255,.13);

  --r-sm: 7px; --r: 11px; --r-lg: 16px; --r-xl: 22px; --r-pill: 999px;

  --sh-1: 0 1px 2px rgba(20,34,77,.06), 0 1px 1px rgba(20,34,77,.04);
  --sh-2: 0 2px 8px rgba(20,34,77,.08), 0 1px 2px rgba(20,34,77,.05);
  --sh-3: 0 10px 30px rgba(20,34,77,.14), 0 2px 8px rgba(20,34,77,.08);
  --sh-pop: 0 18px 48px rgba(16,26,60,.22);

  --font: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --maxw: 1160px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--primary-700); }
button { font-family: inherit; }
::selection { background: var(--primary-soft); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---- type ---- */
.h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; margin: 0; }
.h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.15; margin: 0; }
.h3 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; margin: 0; }
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.tnum { font-variant-numeric: tabular-nums; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 17px; min-height: 42px; font-size: 14.5px; font-weight: 600;
  border-radius: var(--r); cursor: pointer; letter-spacing: -0.01em;
  border: 1px solid transparent;
  transition: transform .12s ease, filter .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.04); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.sm { padding: 7px 13px; min-height: 34px; font-size: 13.5px; gap: 6px; }
.btn.lg { padding: 13px 22px; min-height: 50px; font-size: 16px; gap: 8px; }
.btn.full { width: 100%; }
.btn.primary { background: var(--primary); color: var(--on-primary); box-shadow: var(--sh-1); }
.btn.accent  { background: var(--accent); color: oklch(0.99 0.01 178); box-shadow: var(--sh-1); }
.btn.dark    { background: var(--ink); color: var(--surface); }
.btn.outline { background: var(--surface); color: var(--ink); border-color: var(--border-2); }
.btn.ghost   { background: transparent; color: var(--ink-2); }
.btn.soft    { background: var(--primary-soft); color: var(--primary-700); }
.btn.danger  { background: var(--danger-soft); color: var(--danger); }

/* ---- badges ---- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px;
  border-radius: var(--r-pill); font-size: 12.5px; font-weight: 600;
  letter-spacing: -0.005em; white-space: nowrap;
  background: var(--bg-sunken); color: var(--ink-2);
}
.badge.sm { padding: 3px 8px; font-size: 11.5px; }
.badge.primary { background: var(--primary-soft); color: var(--primary-700); }
.badge.accent  { background: var(--accent-soft); color: var(--accent-700); }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.danger  { background: var(--danger-soft); color: var(--danger); }
.badge.warn    { background: var(--warn-soft); color: var(--warn-ink); }

/* ---- card ---- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 20px; box-shadow: var(--sh-1);
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.card.hover:hover { box-shadow: var(--sh-3); transform: translateY(-2px); border-color: var(--border-2); }
.card.clickable { cursor: pointer; }

/* ---- segmented ---- */
.seg { display: inline-flex; padding: 4px; gap: 2px; background: var(--bg-sunken);
  border-radius: var(--r); border: 1px solid var(--border); }
.seg button {
  border: none; cursor: pointer; border-radius: calc(var(--r) - 3px);
  padding: 8px 16px; font-size: 14px; font-weight: 600; letter-spacing: -0.01em;
  background: transparent; color: var(--ink-2); transition: all .15s ease;
}
.seg button.active { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }
.seg.sm button { padding: 6px 12px; font-size: 13px; }

/* ---- inputs ---- */
.field { display: block; }
.field > .label { font-size: 13.5px; font-weight: 600; margin-bottom: 7px; color: var(--ink); }
.field > .hint { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }
.input {
  display: flex; align-items: center; gap: 9px; padding: 0 13px;
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: var(--r); height: 44px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input input, .input select {
  border: none; outline: none; background: transparent; width: 100%;
  font-family: inherit; font-size: 14.5px; color: var(--ink);
}
.input .ico { color: var(--ink-3); flex: none; display: flex; }

/* ---- avatar ---- */
.avatar {
  border-radius: 50%; display: grid; place-items: center; font-weight: 700;
  letter-spacing: -0.02em; flex: none;
}

/* ---- icons ---- */
.icon { display: inline-flex; vertical-align: middle; }

/* ---- capacity bar ---- */
.capbar { height: 8px; border-radius: var(--r-pill); background: var(--bg-sunken); overflow: hidden; }
.capbar > span { display: block; height: 100%; border-radius: var(--r-pill); background: var(--accent); transition: width .3s ease; }
.capbar.full > span { background: var(--warn); }

/* ---- status chip (per session) ---- */
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px;
  border-radius: var(--r-pill); font-size: 12px; font-weight: 700; white-space: nowrap;
}
.chip.going    { background: var(--success-soft); color: var(--success); }
.chip.waitlist { background: var(--warn-soft); color: var(--warn-ink); }
.chip.full     { background: var(--bg-sunken); color: var(--ink-3); }
.chip.open     { background: var(--primary-soft); color: var(--primary-700); }

/* ---- toast ---- */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(8px);
  background: var(--ink); color: var(--surface); padding: 12px 18px; border-radius: var(--r);
  box-shadow: var(--sh-pop); font-weight: 600; font-size: 14px; z-index: 200;
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); }

/* ---- slide-over panel + scrim ---- */
.scrim {
  position: fixed; inset: 0; background: oklch(0.2 0.03 258 / 0.42); z-index: 150;
  opacity: 0; transition: opacity .28s ease;
}
.scrim.show { opacity: 1; }
.panel {
  position: fixed; top: 0; right: 0; height: 100%; width: min(440px, 92vw);
  background: var(--surface); box-shadow: var(--sh-pop); z-index: 151;
  display: flex; flex-direction: column; transform: translateX(100%);
  transition: transform .28s cubic-bezier(0.2,0.7,0.2,1);
}
.panel.show { transform: translateX(0); }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 20px 22px; border-bottom: 1px solid var(--border); }
.panel-body { padding: 20px 22px; overflow-y: auto; flex: 1; align-content: start; }
.panel-foot { padding: 16px 22px; border-top: 1px solid var(--border); }
.iconbtn {
  border: 1px solid var(--border-2); background: var(--surface); color: var(--ink-2);
  width: 36px; height: 36px; border-radius: var(--r-sm); cursor: pointer;
  display: grid; place-items: center; flex: none;
}
.iconbtn:hover { background: var(--bg-sunken); }

/* ---- animations ---- */
@keyframes oh-fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes oh-fade { from { opacity: 0; } to { opacity: 1; } }
.anim-up { animation: oh-fade-up 0.45s cubic-bezier(0.2,0.7,0.2,1) both; }
.anim-fade { animation: oh-fade 0.4s ease forwards; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.001ms !important; } }

/* ---- helpers ---- */
.row { display: flex; align-items: center; gap: 10px; }
.col { display: flex; flex-direction: column; }
.wrap-pad { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.spacer { flex: 1 1 auto; }
.stack > * + * { margin-top: var(--gap, 12px); }
