/* ============================================================
   SOPLANY — Design System (dark-first, elegant)
   Layout: full-bleed bands with a 1200px inner container; app pages use
   a fixed sidebar + fluid main. Every color is a token.
   ============================================================ */
:root {
  color-scheme: dark;
  /* Surfaces */
  --bg: #0A0C11;
  --bg-2: #0F1218;
  --surface: #141821;
  --surface-2: #1A1F2B;
  --surface-3: #222837;
  --border: rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.16);
  /* Text */
  --fg: #EEF0F5;
  --fg-2: #AEB4C2;
  --fg-3: #737A8A;
  /* Brand */
  --accent: #D9B46A;          /* champagne gold */
  --accent-2: #F0D59A;
  --accent-ink: #1A1405;
  --accent-soft: rgba(217,180,106,0.14);
  --violet: #8B7CF6;          /* secondary brand hue */
  --violet-soft: rgba(139,124,246,0.16);
  /* Semantic */
  --good: #4CC9A2; --good-soft: rgba(76,201,162,0.15);
  --warn: #F2B94B; --warn-soft: rgba(242,185,75,0.15);
  --bad: #F0706A;  --bad-soft: rgba(240,112,106,0.15);
  --info: #6AB8F0; --info-soft: rgba(106,184,240,0.15);
  /* Type */
  --font-display: "Fraunces", "Georgia", serif;
  --font-body: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, monospace;
  /* Shape & motion */
  --r-sm: 8px; --r-md: 12px; --r-lg: 18px; --r-xl: 26px; --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -8px rgba(0,0,0,.5);
  --shadow-2: 0 2px 6px rgba(0,0,0,.45), 0 24px 48px -16px rgba(0,0,0,.6);
  --glow: 0 0 0 1px rgba(217,180,106,.35), 0 0 32px -6px rgba(217,180,106,.45);
  --ease: cubic-bezier(.2,.8,.2,1);
  --ease-spring: cubic-bezier(.34,1.56,.64,1);
  --t-fast: 160ms; --t-med: 280ms; --t-slow: 520ms;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #F6F4EF; --bg-2: #FBFAF7; --surface: #FFFFFF; --surface-2: #F3F1EB; --surface-3: #E9E6DE;
    --border: rgba(20,18,12,0.09); --border-strong: rgba(20,18,12,0.18);
    --fg: #16181F; --fg-2: #4E5464; --fg-3: #80869A;
    --accent: #B48A2E; --accent-2: #8E6A1B; --accent-ink: #FFFFFF; --accent-soft: rgba(180,138,46,0.14);
    --shadow-1: 0 1px 2px rgba(20,18,12,.08), 0 8px 24px -10px rgba(20,18,12,.18);
    --shadow-2: 0 2px 6px rgba(20,18,12,.08), 0 24px 48px -18px rgba(20,18,12,.25);
    --glow: 0 0 0 1px rgba(180,138,46,.35), 0 0 32px -8px rgba(180,138,46,.35);
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #F6F4EF; --bg-2: #FBFAF7; --surface: #FFFFFF; --surface-2: #F3F1EB; --surface-3: #E9E6DE;
  --border: rgba(20,18,12,0.09); --border-strong: rgba(20,18,12,0.18);
  --fg: #16181F; --fg-2: #4E5464; --fg-3: #80869A;
  --accent: #B48A2E; --accent-2: #8E6A1B; --accent-ink: #FFFFFF; --accent-soft: rgba(180,138,46,0.14);
  --shadow-1: 0 1px 2px rgba(20,18,12,.08), 0 8px 24px -10px rgba(20,18,12,.18);
  --shadow-2: 0 2px 6px rgba(20,18,12,.08), 0 24px 48px -18px rgba(20,18,12,.25);
  --glow: 0 0 0 1px rgba(180,138,46,.35), 0 0 32px -8px rgba(180,138,46,.35);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--font-body); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.15; text-wrap: balance; letter-spacing: -0.01em; }
h1 { font-family: var(--font-display); font-weight: 500; font-size: clamp(2.2rem, 5vw, 3.6rem); letter-spacing: -0.02em; }
h2 { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.6rem, 3vw, 2.3rem); }
h3 { font-size: 1.15rem; }
h4 { font-size: 0.95rem; }
p { margin: 0; }
.muted { color: var(--fg-2); }
.dim { color: var(--fg-3); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.tnum { font-variant-numeric: tabular-nums; }
.eyebrow { font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; color: var(--accent); font-weight: 700; }
.display { font-family: var(--font-display); font-weight: 500; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent-soft); }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.container.narrow { max-width: 820px; }
.section { padding-block: clamp(48px, 8vw, 96px); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.min0 { min-width: 0; }
.flex1 { flex: 1 1 0; min-width: 0; }
.center { text-align: center; }
.hide-mobile { display: initial; }
@media (max-width: 760px) { .hide-mobile { display: none !important; } }

/* ---------- Navbar ---------- */
.nav {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
  background: color-mix(in srgb, var(--bg) 78%, transparent); border-bottom: 1px solid var(--border);
}
.nav .container { display: flex; align-items: center; gap: 28px; height: 68px; }
.nav-links { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav-links a { padding: 8px 12px; border-radius: var(--r-sm); color: var(--fg-2); font-weight: 500; transition: color var(--t-fast), background var(--t-fast); }
.nav-links a:hover, .nav-links a.active { color: var(--fg); background: var(--surface-2); }
@media (max-width: 760px) { .nav-links a:not(.btn) { display: none; } }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; letter-spacing: -0.01em; }
.logo svg { width: 32px; height: 32px; }
.logo .wordmark { color: var(--fg); }
.logo .wordmark b { color: var(--accent); font-weight: 600; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--r-pill); font-weight: 600; font-size: .92rem; line-height: 1;
  border: 1px solid transparent; transition: transform var(--t-fast) var(--ease), background var(--t-fast), box-shadow var(--t-med), border-color var(--t-fast), color var(--t-fast);
  white-space: nowrap; user-select: none;
}
.btn:active { transform: translateY(1px) scale(.985); }
.btn-primary { background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: var(--accent-ink); box-shadow: 0 6px 20px -8px var(--accent); }
.btn-primary:hover { box-shadow: var(--glow); transform: translateY(-1px); }
.btn-secondary { background: var(--surface-2); border-color: var(--border-strong); color: var(--fg); }
.btn-secondary:hover { background: var(--surface-3); }
.btn-ghost { color: var(--fg-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--fg); }
.btn-outline { border-color: var(--accent); color: var(--accent); }
.btn-outline:hover { background: var(--accent-soft); }
.btn-danger { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.btn-sm { padding: 7px 13px; font-size: .82rem; }
.btn-lg { padding: 14px 26px; font-size: 1rem; }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: var(--r-md); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------- Cards / surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; }
.card.pad-lg { padding: 28px; }
.card.hover { transition: transform var(--t-med) var(--ease), border-color var(--t-med), box-shadow var(--t-med); }
.card.hover:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: var(--shadow-2); }
.card.glass { background: color-mix(in srgb, var(--surface) 70%, transparent); backdrop-filter: blur(14px); }
.divider { height: 1px; background: var(--border); border: 0; margin: 0; }

/* ---------- Badges / chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--r-pill); font-size: .74rem; font-weight: 700; letter-spacing: .02em; background: var(--surface-2); color: var(--fg-2); border: 1px solid var(--border); }
.badge.gold { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge.violet { background: var(--violet-soft); color: var(--violet); border-color: transparent; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: var(--r-pill); border: 1px solid var(--border); background: var(--surface); font-weight: 500; font-size: .86rem; color: var(--fg-2); transition: all var(--t-fast); cursor: pointer; }
.chip:hover { border-color: var(--border-strong); color: var(--fg); }
.chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; background: var(--violet-soft); color: var(--violet); flex: 0 0 auto; letter-spacing: .02em; }
.avatar.lg { width: 56px; height: 56px; font-size: 1.1rem; }
.avatar.gold { background: var(--accent-soft); color: var(--accent); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-size: .8rem; font-weight: 600; color: var(--fg-2); }
.field .hint { font-size: .76rem; color: var(--fg-3); }
.field .error { font-size: .76rem; color: var(--bad); }
.input, .select, .textarea {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 11px 14px; color: var(--fg); transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast); outline: none;
}
.input::placeholder, .textarea::placeholder { color: var(--fg-3); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-strong); }
.input:focus, .select:focus, .textarea:focus, .input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.invalid, .field.invalid .input { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.textarea { min-height: 110px; resize: vertical; }
.input-wrap { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 0 14px; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.input-wrap .input { border: 0; background: transparent; padding-inline: 0; box-shadow: none; }
.input-wrap .icon { color: var(--fg-3); width: 16px; display: inline-flex; justify-content: center; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--fg-3) 50%), linear-gradient(135deg, var(--fg-3) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 40px; }

/* Searchable select */
.sselect { position: relative; }
.sselect .sselect-menu { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-md); box-shadow: var(--shadow-2); z-index: 60; max-height: 280px; overflow: auto; padding: 6px; opacity: 0; transform: translateY(-6px) scale(.98); pointer-events: none; transition: opacity var(--t-fast), transform var(--t-med) var(--ease); }
.sselect.open .sselect-menu { opacity: 1; transform: none; pointer-events: auto; }
.sselect-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-sm); cursor: pointer; font-size: .92rem; }
.sselect-item:hover, .sselect-item.hl { background: var(--surface-2); }
.sselect-item .sub { margin-left: auto; color: var(--fg-3); font-size: .78rem; }
.sselect-item mark { background: none; color: var(--accent); font-weight: 700; }
.sselect-group { padding: 8px 10px 4px; font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: var(--fg-3); font-weight: 700; }
.sselect-empty { padding: 14px; color: var(--fg-3); text-align: center; font-size: .88rem; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px 4px 10px; background: var(--accent-soft); color: var(--accent); border-radius: var(--r-pill); font-size: .8rem; font-weight: 600; }
.tag button { opacity: .7; line-height: 1; }

/* Switch / checkbox / radio */
.switch { position: relative; width: 42px; height: 24px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border); transition: background var(--t-med); flex: 0 0 auto; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--fg-2); transition: transform var(--t-med) var(--ease-spring), background var(--t-med); }
.switch.on { background: var(--accent); border-color: var(--accent); }
.switch.on::after { transform: translateX(18px); background: var(--accent-ink); }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: .92rem; }
.check input { appearance: none; width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--border-strong); background: var(--surface-2); display: grid; place-content: center; transition: all var(--t-fast); margin: 0; }
.check input[type=radio] { border-radius: 50%; }
.check input::before { content: ""; width: 10px; height: 10px; border-radius: 2px; transform: scale(0); transition: transform var(--t-fast) var(--ease-spring); background: var(--accent-ink); clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%); }
.check input[type=radio]::before { border-radius: 50%; clip-path: none; width: 8px; height: 8px; }
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::before { transform: scale(1); }

/* Range slider */
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 999px; background: linear-gradient(to right, var(--accent) var(--pct, 50%), var(--surface-3) var(--pct, 50%)); outline: none; }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--fg); border: 3px solid var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,.4); cursor: grab; transition: transform var(--t-fast) var(--ease-spring); }
.range::-webkit-slider-thumb:hover { transform: scale(1.15); }
.range::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--fg); border: 3px solid var(--accent); cursor: grab; }

/* Segmented control */
.segmented { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-pill); padding: 3px; position: relative; }
.segmented button { padding: 7px 14px; border-radius: var(--r-pill); font-size: .85rem; font-weight: 600; color: var(--fg-2); transition: color var(--t-fast), background var(--t-med) var(--ease); }
.segmented button.active { background: var(--surface); color: var(--fg); box-shadow: var(--shadow-1); }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); position: relative; overflow-x: auto; }
.tabs button { padding: 12px 16px; color: var(--fg-2); font-weight: 600; font-size: .9rem; position: relative; white-space: nowrap; }
.tabs button::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; background: var(--accent); transform: scaleX(0); transition: transform var(--t-med) var(--ease); border-radius: 2px; }
.tabs button.active { color: var(--fg); }
.tabs button.active::after { transform: scaleX(1); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeUp var(--t-med) var(--ease); }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--fg-3); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }

/* Modal / drawer */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(6px); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; opacity: 0; pointer-events: none; transition: opacity var(--t-med); }
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal { background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-xl); width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; box-shadow: var(--shadow-2); transform: translateY(20px) scale(.97); transition: transform var(--t-slow) var(--ease-spring); }
.modal-backdrop.open .modal { transform: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 24px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--border); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: var(--surface); border-left: 1px solid var(--border-strong); z-index: 101; transform: translateX(100%); transition: transform var(--t-slow) var(--ease); box-shadow: var(--shadow-2); display: flex; flex-direction: column; overflow: auto; }
.drawer.open { transform: none; }

/* Toasts */
.toasts { position: fixed; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); right: calc(20px + env(safe-area-inset-right, 0px)); z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: calc(100% - 40px); }
.toast { display: flex; align-items: center; gap: 12px; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--r-md); padding: 12px 16px; box-shadow: var(--shadow-2); animation: slideIn var(--t-slow) var(--ease-spring); font-size: .9rem; min-width: 260px; }
.toast .ti { width: 28px; height: 28px; border-radius: 8px; display: grid; place-content: center; flex: 0 0 auto; }
.toast.good .ti { background: var(--good-soft); color: var(--good); }
.toast.bad .ti { background: var(--bad-soft); color: var(--bad); }
.toast.info .ti { background: var(--info-soft); color: var(--info); }
.toast.gold .ti { background: var(--accent-soft); color: var(--accent); }
.toast.out { animation: fadeOut var(--t-med) forwards; }

/* Tooltip */
[data-tip] { position: relative; }
[data-tip]::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(4px); background: var(--fg); color: var(--bg); padding: 6px 10px; border-radius: 6px; font-size: .74rem; white-space: nowrap; opacity: 0; pointer-events: none; transition: all var(--t-fast); z-index: 30; font-weight: 600; }
[data-tip]:hover::after { opacity: 1; transform: translateX(-50%); }

/* Progress / skeleton */
.progress { height: 6px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 999px; transition: width var(--t-slow) var(--ease); }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }

/* Rating */
.stars { display: inline-flex; gap: 2px; color: var(--accent); font-size: .85rem; }
.stars .off { color: var(--surface-3); }

/* Steps */
.steps { display: flex; align-items: center; gap: 0; }
.step { display: flex; align-items: center; gap: 10px; color: var(--fg-3); font-size: .85rem; font-weight: 600; }
.step .n { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--border-strong); display: grid; place-content: center; font-size: .78rem; transition: all var(--t-med); }
.step.active { color: var(--fg); }
.step.active .n { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.step.done .n { background: var(--good-soft); border-color: var(--good); color: var(--good); }
.step-line { flex: 1; height: 1px; background: var(--border); margin: 0 12px; min-width: 24px; }

/* Calendar (shared) */
.cal { user-select: none; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--fg-3); padding: 6px 0; font-weight: 700; }
.cal-day { aspect-ratio: 1; display: grid; place-content: center; border-radius: var(--r-md); font-weight: 600; font-size: .9rem; color: var(--fg-2); position: relative; transition: all var(--t-fast); cursor: pointer; }
.cal-day:hover:not(.off):not(.full) { background: var(--surface-2); color: var(--fg); }
.cal-day.off { color: var(--fg-3); opacity: .4; cursor: default; }
.cal-day.full { color: var(--fg-3); text-decoration: line-through; cursor: not-allowed; opacity: .6; }
.cal-day.today::after { content: ""; position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.cal-day.sel { background: var(--accent); color: var(--accent-ink); box-shadow: var(--glow); }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.slot { padding: 10px 6px; text-align: center; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface-2); font-weight: 600; font-size: .9rem; font-variant-numeric: tabular-nums; transition: all var(--t-fast); cursor: pointer; }
.slot:hover { border-color: var(--accent); color: var(--accent); }
.slot.sel { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.slot.busy { opacity: .35; text-decoration: line-through; cursor: not-allowed; }

/* App shell (CRM) */
.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: var(--bg-2); border-right: 1px solid var(--border); padding: 20px 14px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; overflow: auto; }
.sidebar .logo { padding: 6px 10px 18px; }
.sidebar a, .sidebar button.navitem { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-md); color: var(--fg-2); font-weight: 500; font-size: .92rem; transition: all var(--t-fast); width: 100%; text-align: left; }
.sidebar a:hover, .sidebar button.navitem:hover { background: var(--surface-2); color: var(--fg); }
.sidebar a.active, .sidebar button.navitem.active { background: var(--accent-soft); color: var(--accent); }
.sidebar .sb-label { padding: 16px 12px 6px; font-size: .68rem; text-transform: uppercase; letter-spacing: .14em; color: var(--fg-3); font-weight: 700; }
.sidebar .count { margin-left: auto; font-size: .72rem; background: var(--surface-3); padding: 2px 7px; border-radius: 999px; }
.main { min-width: 0; padding: 24px clamp(16px, 3vw, 36px) 48px; }
.topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; flex-wrap: wrap; }
.topbar h2 { font-family: var(--font-body); font-weight: 700; font-size: 1.4rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.stat .k { font-size: .78rem; color: var(--fg-3); font-weight: 600; }
.stat .v { font-size: 1.8rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat .d { font-size: .78rem; font-weight: 600; }
.stat .d.up { color: var(--good); } .stat .d.down { color: var(--bad); }
@media (max-width: 900px) { .app { grid-template-columns: 1fr; } .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--border); } .sidebar .sb-label { display: none; } .sidebar .logo { padding: 6px 10px; width: 100%; } }

/* Footer */
.footer { border-top: 1px solid var(--border); padding-block: 40px; color: var(--fg-3); font-size: .85rem; }
.footer .cols { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 24px; }
.footer h4 { color: var(--fg); margin-bottom: 10px; }
.footer a { display: block; padding: 3px 0; color: var(--fg-2); }
.footer a:hover { color: var(--accent); }
@media (max-width: 760px) { .footer .cols { grid-template-columns: 1fr 1fr; } }

/* ---------- Animations ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; transform: translateY(8px); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 var(--accent-soft); } 50% { box-shadow: 0 0 0 10px transparent; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.reveal { opacity: 1; transform: none; }
.reveal.pending { opacity: 0; transform: translateY(18px); }
.reveal.in { animation: fadeUp .7s var(--ease) both; }
.stagger > * { animation: fadeUp .6s var(--ease) both; }
.stagger > *:nth-child(2) { animation-delay: .07s; } .stagger > *:nth-child(3) { animation-delay: .14s; } .stagger > *:nth-child(4) { animation-delay: .21s; } .stagger > *:nth-child(5) { animation-delay: .28s; } .stagger > *:nth-child(6) { animation-delay: .35s; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* Theme toggle & sub-nav */
.theme-toggle { width: 38px; height: 38px; border-radius: var(--r-md); border: 1px solid var(--border); display: grid; place-content: center; color: var(--fg-2); }
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.subnav { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 0; }
.subnav a { font-size: .8rem; padding: 6px 12px; border-radius: var(--r-pill); border: 1px solid var(--border); color: var(--fg-2); }
.subnav a:hover, .subnav a.active { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

/* Map placeholder */
.map { position: relative; border-radius: var(--r-lg); overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); min-height: 280px; }
.map svg.mapbg { position: absolute; inset: 0; width: 100%; height: 100%; }
.map .pin { position: absolute; transform: translate(-50%, -100%); display: flex; flex-direction: column; align-items: center; cursor: pointer; transition: transform var(--t-fast) var(--ease-spring); }
.map .pin:hover { transform: translate(-50%, -100%) scale(1.12); z-index: 2; }
.map .pin .p { width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--accent); display: grid; place-content: center; box-shadow: 0 6px 14px -4px rgba(0,0,0,.6); }
.map .pin .p > * { transform: rotate(45deg); color: var(--accent-ink); font-size: 12px; }
.map .pin .lbl { margin-top: 6px; background: var(--surface); border: 1px solid var(--border-strong); padding: 3px 8px; border-radius: 6px; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.map .pin.me .p { background: var(--violet); animation: pulse 2s infinite; }

/* Kbd & code */
kbd { font-family: var(--font-mono); font-size: .75rem; background: var(--surface-3); border: 1px solid var(--border-strong); border-bottom-width: 2px; padding: 2px 6px; border-radius: 5px; }
pre.code { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 16px; font-family: var(--font-mono); font-size: .8rem; overflow-x: auto; color: var(--fg-2); line-height: 1.6; margin: 0; }
pre.code .k { color: var(--violet); } pre.code .s { color: var(--good); } pre.code .c { color: var(--fg-3); }
