/* The Kaga Institute staff portal. Same fonts and colors as the public site (see design/style-guide). */
:root,
[data-theme='dark'] {
  color-scheme: dark;
  --bg: #080808;
  --side: #050505;
  --panel: #121212;
  --panel-2: #181818;
  --input: #0c0c0c;
  --hover: rgba(255, 255, 255, 0.05);
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.15);
  --text: #f4f1ec;
  --muted: rgba(244, 241, 236, 0.66);
  --faint: rgba(244, 241, 236, 0.46);
  --accent: #ff4f9b; /* pink text on dark, 6.1:1 */
  --pink: #f71278; /* TKI Pink: fills, focus, highlights */
  --btn: #c40d5f; /* white text 5.9:1 */
  --btn-hover: #d4116a;
  --gold: #c9b98a;
  --ok: #4ade80;
  --warn: #fbbf24;
  --danger: #ff8fa3;
  --bar: rgba(244, 241, 236, 0.16);
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8);
  --glow: radial-gradient(70% 60% at 100% 0%, rgba(247, 18, 120, 0.2), transparent 70%);
}
[data-theme='light'] {
  color-scheme: light;
  --bg: #f4f1ec;
  --side: #ffffff;
  --panel: #ffffff;
  --panel-2: #faf8f5;
  --input: #ffffff;
  --hover: rgba(10, 10, 10, 0.045);
  --line: rgba(10, 10, 10, 0.08);
  --line-2: rgba(10, 10, 10, 0.16);
  --text: #0a0a0a;
  --muted: rgba(10, 10, 10, 0.66);
  --faint: rgba(10, 10, 10, 0.5);
  --accent: #c40d5f;
  --gold: #7a6a3f;
  --ok: #15803d;
  --warn: #a16207;
  --danger: #b0123d;
  --bar: rgba(10, 10, 10, 0.12);
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.25);
  --glow: radial-gradient(70% 60% at 100% 0%, rgba(247, 18, 120, 0.1), transparent 70%);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: 'Manrope', system-ui, sans-serif; font-size: 14px; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; }
[hidden] { display: none !important; }
.serif { font-family: 'Instrument Serif', serif; font-style: italic; font-weight: 400; text-transform: none; letter-spacing: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { flex: none; }
:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }
.eyebrow { margin: 0; font-size: 10.5px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }

/* ---------- Sign in ---------- */
.signin { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; background: radial-gradient(55% 50% at 92% 0%, rgba(247, 18, 120, 0.26), transparent 70%), radial-gradient(45% 40% at 0% 100%, rgba(247, 18, 120, 0.12), transparent 70%), var(--bg); }
.signin-card { width: min(460px, 100%); display: flex; flex-direction: column; gap: 22px; }
.signin-card .logo { height: 72px; width: max-content; }
.signin-card h1 { margin: 0; font-size: clamp(48px, 9vw, 72px); font-weight: 800; line-height: 0.88; letter-spacing: -0.05em; text-transform: uppercase; }
.signin-card h1 .serif { color: var(--accent); display: block; padding-bottom: 0.08em; }
.signin-card p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--muted); }
.signin-card .btn { align-self: flex-start; height: 48px; padding: 0 28px; }
.signin-note { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px !important; color: var(--faint) !important; }
.signin-msg { padding: 12px 14px; border-radius: 12px; background: var(--hover); border: 1px solid var(--line-2); font-size: 13px !important; color: var(--text) !important; }

/* Logo: black artwork, shown white on dark */
.logo { filter: none; }
[data-theme='dark'] .logo { filter: invert(1); }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 26px; padding: 24px 16px 18px; background: var(--glow), var(--side); border-right: 1px solid var(--line); z-index: 40; }
.side-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; text-decoration: none; }
.side-brand .logo { height: 46px; }
.side-brand span { font-size: 19px; line-height: 1; color: var(--accent); }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-label { margin: 6px 12px 6px; font-size: 9.5px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--faint); }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: var(--muted); font-weight: 600; text-decoration: none; transition: background 0.2s, color 0.2s; }
.nav a:hover { background: var(--hover); color: var(--text); }
.nav a[aria-current='page'] { background: linear-gradient(90deg, rgba(247, 18, 120, 0.2), rgba(247, 18, 120, 0.03)); color: var(--text); }
.nav a[aria-current='page']::before { content: ''; position: absolute; left: -16px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--pink); }
.nav a[aria-current='page'] .ic { color: var(--accent); }
.nav a.locked { opacity: 0.5; }
.nav .tag { margin-left: auto; font-size: 8.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; padding: 3px 7px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--faint); }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 16px; background: var(--hover); border: 1px solid var(--line); }
.avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; background: linear-gradient(135deg, #f71278, #7a0a3c); }
.who { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.who b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who span { font-size: 11px; color: var(--faint); }
.side-foot .icon-btn { margin-left: auto; width: 34px; height: 34px; }
/* Lux & Grand credit. The logo artwork is white; it turns black on the light theme. */
.side-credit { margin-top: -12px; display: flex; flex-direction: column; gap: 3px; padding: 0 12px; font-size: 10.5px; line-height: 1.45; color: var(--faint); text-decoration: none; }
.side-credit .lg-logo { height: 30px; width: auto; align-self: flex-start; margin-bottom: 6px; opacity: 0.8; transition: opacity 0.2s; }
.side-credit:hover .lg-logo { opacity: 1; }
.side-credit:hover { color: var(--muted); }
.side-credit b { color: var(--muted); font-weight: 700; }
[data-theme='light'] .lg-logo { filter: invert(1); }

.shell { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px; padding: 18px 32px; background: color-mix(in srgb, var(--bg) 84%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
.top-title { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.top-title h1 { margin: 0; font-size: 26px; font-weight: 800; line-height: 1; letter-spacing: -0.035em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-bottom: 0.08em; }
.top-title h1 .serif { color: var(--accent); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.menu-btn { display: none !important; }
.main { flex: 1; padding: 28px 32px 56px; outline: none; }
.view { display: flex; flex-direction: column; gap: 22px; }
.contents { display: contents; }
.hint-text { font-size: 12.5px; color: var(--faint); }
.lead-text { margin: 0; line-height: 1.6; color: var(--muted); }
.kv.spaced { margin-top: 18px; }
.frame-msg { padding: 20px; text-align: center; color: var(--faint); }

/* ---------- Controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent; font-size: 11.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none; white-space: nowrap; cursor: pointer; transition: background 0.2s, color 0.2s, box-shadow 0.2s, border-color 0.2s; }
.btn-pink { background: var(--btn); color: #fff; }
.btn-pink:hover { background: var(--btn-hover); box-shadow: 0 10px 28px -10px rgba(247, 18, 120, 0.75); }
.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { background: var(--hover); border-color: var(--text); }
.btn-danger { background: transparent; border-color: color-mix(in srgb, var(--danger) 45%, transparent); color: var(--danger); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 10.5px; gap: 6px; }
.btn:disabled, .btn[aria-disabled='true'] { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--text); cursor: pointer; transition: background 0.2s; }
.icon-btn:hover { background: var(--hover); }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 9.5px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; }
.chip-sample { color: var(--gold); border: 1px dashed var(--gold); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; background: var(--hover); color: var(--muted); }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 13%, transparent); }
.pill.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 13%, transparent); }
.pill.pink { color: var(--accent); background: rgba(247, 18, 120, 0.12); }

/* ---------- Panels ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 22px; min-width: 0; }
.panel.glow { background: var(--glow), var(--panel); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.panel-head h2 { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.panel-head p { margin: 4px 0 0; font-size: 12.5px; color: var(--faint); }
.grid { display: grid; gap: 18px; }
.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-2 { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { display: flex; flex-direction: column; gap: 10px; position: relative; }
.kpi .label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); }
.kpi .value { font-size: 34px; font-weight: 800; letter-spacing: -0.045em; line-height: 1; overflow-wrap: anywhere; }
.kpi .value.small { font-size: 21px; letter-spacing: -0.03em; line-height: 1.1; text-transform: uppercase; }
.kpi .sub { font-size: 12.5px; color: var(--muted); }
.up { color: var(--ok); font-weight: 700; }
.sample-tag { font-size: 8.5px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); border: 1px dashed color-mix(in srgb, var(--gold) 70%, transparent); padding: 2px 7px; border-radius: 999px; }

.banner { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--panel); font-size: 13px; line-height: 1.5; }
.banner .ic { color: var(--accent); }
.banner.sample { border-style: dashed; border-color: color-mix(in srgb, var(--gold) 60%, transparent); }
.banner.sample .ic { color: var(--gold); }
.banner.lock { background: var(--glow), var(--panel); }
.banner .btn { margin-left: auto; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 -6px; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 9.5px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); padding: 0 12px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--hover); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-user { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.cell-user .avatar { width: 34px; height: 34px; font-size: 11px; }
.cell-user b { display: block; font-size: 13.5px; }
.cell-user span { font-size: 12px; color: var(--faint); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.masked-text { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.toolbar .spacer { flex: 1; }
.search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--input); color: var(--faint); min-width: min(320px, 100%); }
.search input { border: 0; outline: 0; background: transparent; width: 100%; color: var(--text); }

/* Tabs */
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); }
.tabs button { height: 34px; padding: 0 16px; border-radius: 999px; border: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; }
.tabs button[aria-selected='true'] { background: var(--btn); color: #fff; }
.tabs button .n { margin-left: 6px; opacity: 0.7; font-weight: 600; }

/* Chart */
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--faint); font-size: 11px; font-family: 'Manrope', sans-serif; }
.chart .bar { fill: var(--bar); }
.chart .bar.hot { fill: url(#pinkbar); }
.rank { display: flex; flex-direction: column; gap: 14px; }
.rank-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.rank-row .i { font-size: 11px; font-weight: 800; color: var(--accent); }
.rank-row b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-row .track { display: block; width: 100%; margin-top: 7px; height: 6px; border-radius: 99px; background: var(--hover); }
.rank-row .track rect { fill: #f71278; }
.rank-row span { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Specials ---------- */
.sp-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: start; }
.sp-header h3 { margin: 6px 0 8px; font-size: 30px; font-weight: 800; letter-spacing: -0.045em; line-height: 0.92; text-transform: uppercase; white-space: pre-line; }
.sp-header h3 .serif { color: var(--accent); }
.sp-header p { margin: 0; color: var(--muted); font-size: 13px; }
.sp-header .sp-edit { font-size: 18px; color: var(--text); }
/* Hide specials (teaser until the drop) */
.sp-teaser { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, auto); gap: 18px 28px; align-items: end; }
.sp-teaser.is-on { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent), var(--shadow, none); }
.sp-teaser-title { display: flex; align-items: center; gap: 12px; }
.sp-teaser h3 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.sp-teaser p { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; max-width: 640px; }
.sp-teaser .sp-teaser-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--text); }
.sp-teaser-form { display: flex; flex-direction: column; gap: 10px; }
.sp-teaser-form .field { margin: 0; }
.sp-teaser-actions { display: flex; gap: 8px; }
.switch { position: relative; width: 46px; height: 26px; padding: 0; border: 0; border-radius: 99px; background: var(--line-2); cursor: pointer; flex: none; transition: background 0.2s; }
.switch span { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); transition: transform 0.2s var(--ease, ease); }
.switch[aria-checked='true'] { background: var(--accent); }
.switch[aria-checked='true'] span { transform: translateX(20px); }
.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.switch:disabled { opacity: 0.6; cursor: progress; }
@media (max-width: 900px) { .sp-teaser { grid-template-columns: minmax(0, 1fr); } }
.group-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.group-head h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.03em; text-transform: uppercase; }
.group-head .spacer { flex: 1; }
.sp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.sp-item { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; transition: border-color 0.2s, transform 0.3s; }
.sp-item:hover { border-color: var(--line-2); }
.sp-thumb { position: relative; aspect-ratio: 4 / 5; background: #111; color: #fff; overflow: hidden; container-type: inline-size; }
.sp-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: filter 0.3s; }
.sp-thumb .shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0) 24%, rgba(0, 0, 0, 0.12) 38%, rgba(0, 0, 0, 0.74) 56%, rgba(0, 0, 0, 0.92) 72%, rgba(0, 0, 0, 0.96) 100%); }
.sp-thumb .sp-top { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sp-chip { font-size: 8.5px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; padding: 6px 9px; border-radius: 999px; background: rgba(0, 0, 0, 0.4); border: 1px solid #f71278; color: #fff; }
.sp-thumb .pill { backdrop-filter: blur(8px); background: rgba(0, 0, 0, 0.55); }
.sp-thumb .pill.ok { color: #4ade80; }
.sp-thumb .pill.hidden-pill { color: #fbbf24; }
.sp-thumb .sp-bottom { position: absolute; left: 14px; right: 14px; bottom: 14px; display: flex; flex-direction: column; gap: 5px; }
.sp-name { margin: 0; font-size: 12.5cqi; font-weight: 800; line-height: 0.9; letter-spacing: -0.045em; text-transform: uppercase; text-wrap: balance; }
.sp-tag { margin: 0; font-size: 6.6cqi; line-height: 1.1; color: #ff2d8a; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85); }
.sp-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.sp-price strong { font-size: 8.6cqi; font-weight: 800; letter-spacing: -0.03em; }
.sp-usual { font-style: normal; font-size: 4.6cqi; font-weight: 600; color: rgba(255, 255, 255, 0.72); }
s.sp-usual { text-decoration-color: #f71278; text-decoration-thickness: 2px; }
.sp-usual.tbd { color: #ffd166; }
.sp-price span { font-size: 3.2cqi; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255, 255, 255, 0.7); }
.sp-dates { margin: 0; font-size: 3.2cqi; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255, 255, 255, 0.72); }
.sp-item.is-hidden .sp-thumb img { filter: grayscale(0.85) brightness(0.55); }
.sp-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 0; }
.sp-body p { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.sp-warn { display: flex; gap: 8px; align-items: flex-start; color: var(--warn) !important; font-weight: 600; }
.sp-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px 16px 16px; margin-top: auto; }
.empty-state { padding: 48px 20px; text-align: center; color: var(--muted); }

/* ---------- Dialogs (drawer + modal) ---------- */
dialog { overflow: hidden; padding: 0; border: 0; color: var(--text); background: transparent; max-width: none; max-height: none; }
dialog::backdrop { background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
dialog.drawer { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(540px, 100vw); height: 100vh; }
dialog.modal { width: min(560px, calc(100vw - 32px)); margin: auto; }
dialog.modal.wide { width: min(1040px, calc(100vw - 32px)); }
.dlg { height: 100%; display: flex; flex-direction: column; background: var(--glow), var(--panel); border-left: 1px solid var(--line-2); box-shadow: var(--shadow); }
dialog.modal .dlg { height: auto; max-height: calc(100vh - 48px); border: 1px solid var(--line-2); border-radius: 24px; }
dialog.drawer[open] .dlg { animation: slide-in 0.32s cubic-bezier(0.2, 0.8, 0.2, 1); }
dialog.modal[open] .dlg { animation: pop-in 0.25s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } }
@keyframes pop-in { from { transform: translateY(12px) scale(0.98); opacity: 0; } }
.dlg-head { display: flex; align-items: flex-start; gap: 12px; padding: 22px 24px 18px; border-bottom: 1px solid var(--line); }
.dlg-head h2 { margin: 6px 0 0; font-size: 22px; font-weight: 800; letter-spacing: -0.03em; text-transform: uppercase; line-height: 1; }
.dlg-head .icon-btn { margin-left: auto; flex: none; }
.dlg-body { flex: 1; overflow: auto; padding: 22px 24px; display: flex; flex-direction: column; gap: 16px; }
.dlg-body > p { margin: 0; line-height: 1.6; color: var(--muted); }
.dlg-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--line); }
.dlg-foot .note { margin-right: auto; font-size: 12px; color: var(--faint); }
.form-error { margin: 0; padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); font-size: 13px; font-weight: 600; }

.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > span { font-size: 10.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.field input, .field textarea, .field select { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--input); color: var(--text); font-size: 14px; outline: none; transition: border-color 0.2s, box-shadow 0.2s; }
.field textarea { resize: vertical; min-height: 92px; line-height: 1.5; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(247, 18, 120, 0.18); }
.field input:disabled, .field textarea:disabled { opacity: 0.6; }
.field small { font-size: 12px; line-height: 1.45; color: var(--faint); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-section { margin: 6px 0 -4px; font-size: 10px; font-weight: 800; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); }

.roles { display: grid; gap: 8px; }
.role-opt { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border-radius: 14px; border: 1px solid var(--line-2); cursor: pointer; }
.role-opt input { margin: 3px 0 0; accent-color: #f71278; }
.role-opt b { display: block; font-size: 13.5px; }
.role-opt span { font-size: 12px; color: var(--faint); }
.role-opt:has(input:checked) { border-color: var(--pink); background: rgba(247, 18, 120, 0.08); }
.role-opt:has(input:disabled) { cursor: not-allowed; opacity: 0.65; }

/* Patient-data lock */
.lock-opt { position: relative; display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: 16px; border: 1px solid var(--line-2); cursor: pointer; }
.lock-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.lock-box { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--hover); color: var(--muted); transition: background 0.2s, color 0.2s; }
.lock-opt input:checked + .lock-box { background: rgba(247, 18, 120, 0.16); color: var(--accent); }
.lock-opt input:focus-visible + .lock-box { outline: 2px solid var(--pink); outline-offset: 2px; }
.lock-box .when-on, .lock-opt input:checked + .lock-box .when-off { display: none; }
.lock-opt input:checked + .lock-box .when-on { display: block; }
.lock-opt b { display: block; font-size: 14px; margin-bottom: 4px; }
.lock-opt small { display: block; font-size: 12.5px; line-height: 1.5; color: var(--faint); }
.lock-opt .state-on { color: var(--accent); }
.lock-opt .state-off { color: var(--warn); }
.lock-opt .state { font-size: 10px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; margin-left: 6px; }
.lock-opt input:checked ~ div .state-off, .lock-opt input:not(:checked) ~ div .state-on { display: none; }
.lock-opt:has(input:disabled) { cursor: not-allowed; opacity: 0.65; }
.cell-lock { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.cell-lock.on { color: var(--accent); }
.cell-lock.off { color: var(--warn); }

/* Export preview */
.export-grid { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 22px; }
/* Both previews the same height, small enough to see whole. */
.export-slot[data-size='4x5'] { width: min(100%, 48vh); }
.export-slot[data-size='9x16'] { width: min(100%, 34vh); }
.export-slot { display: flex; flex-direction: column; gap: 12px; }
.export-slot .frame { position: relative; border-radius: 16px; overflow: hidden; background: #111; border: 1px solid var(--line-2); display: grid; place-items: center; }
.export-slot .frame.r45 { aspect-ratio: 4 / 5; }
.export-slot .frame.r916 { aspect-ratio: 9 / 16; }
.export-slot .frame img { width: 100%; height: 100%; object-fit: contain; }
.export-slot .frame .spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.15); border-top-color: #f71278; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.export-slot .meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.export-slot .meta b { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; }
.export-slot .meta span { display: block; font-size: 11.5px; color: var(--faint); }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; font-size: 13px; line-height: 1.5; background: color-mix(in srgb, var(--warn) 11%, transparent); color: var(--warn); }
.notice.info { background: var(--hover); color: var(--muted); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 100; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 999px; background: var(--text); color: var(--bg); font-size: 13px; font-weight: 600; box-shadow: var(--shadow); transition: opacity 0.25s, transform 0.25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #b0123d; color: #fff; }

/* Empty / no access */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding: 72px 20px; }
.empty-icon { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: rgba(247, 18, 120, 0.12); color: var(--accent); }
.empty h2 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -0.04em; text-transform: uppercase; line-height: 0.95; }
.empty h2 .serif { color: var(--accent); }
.empty p { margin: 0; max-width: 420px; color: var(--muted); line-height: 1.6; }
.skeleton.tall { height: 280px; }
.skeleton { height: 120px; border-radius: 22px; background: linear-gradient(90deg, var(--panel) 0%, var(--panel-2) 50%, var(--panel) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Sienna + newsletter previews */
.check-list { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.check-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.5; }
.check-list .ic { color: var(--ok); margin-top: 1px; }
.chat { display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 82%; padding: 11px 14px; border-radius: 18px; font-size: 13px; line-height: 1.5; }
.bubble.bot { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.bubble.user { align-self: flex-end; background: var(--btn); color: #fff; border-bottom-right-radius: 6px; }
.toggle { position: relative; width: 46px; height: 26px; border-radius: 99px; background: var(--line-2); flex: none; }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--panel); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); }
.status-row { display: flex; align-items: center; gap: 14px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; font-size: 13px; }
.kv dt { color: var(--faint); }
.kv dd { margin: 0; font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-2, .cols-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; width: min(290px, 86vw); transform: translateX(-100%); transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); box-shadow: var(--shadow); }
  .side.open { transform: none; }
  .menu-btn { display: grid !important; }
  .top { padding: 14px 16px; }
  .top-title h1 { font-size: 21px; }
  .main { padding: 20px 16px 48px; }
  .sp-header { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: minmax(0, 1fr); }
  .row-2 { grid-template-columns: minmax(0, 1fr); }
  .top-title .eyebrow { display: none; }
  .chip-sample { display: none; }
  .tabs { width: 100%; overflow-x: auto; }
}
.scrim { position: fixed; inset: 0; z-index: 35; background: rgba(0, 0, 0, 0.5); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Motion (all of it is off under prefers-reduced-motion, see above) ---------- */
:root { --ease: cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes grow-up { from { transform: scaleY(0); } }
@keyframes grow-x { from { transform: scaleX(0); } }
@keyframes hot-pulse { 0%, 100% { filter: drop-shadow(0 0 0 rgba(247, 18, 120, 0)); } 50% { filter: drop-shadow(0 0 12px rgba(247, 18, 120, 0.75)); } }
@keyframes ring { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }
@keyframes breathe { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
@keyframes bubble-in { from { opacity: 0; transform: translateY(10px) scale(0.96); } }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: 0.35; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes spin-in { from { transform: rotate(-120deg) scale(0.5); opacity: 0; } }
@keyframes bar-in { from { transform: scaleY(0); } }

/* Page enter: cards rise in one after another, table rows fade in. */
.view.enter :is(.kpi, .panel, .banner, .toolbar, .group-head, .sp-item, .sp-header, .empty) { animation: rise 0.6s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms); }
.view.enter tbody tr { animation: fade-in 0.5s ease both; animation-delay: calc(var(--r, 0) * 30ms + 250ms); }

/* Revenue chart: bars grow from the bottom; this month glows; hover shows the amount. */
.chart .bar { transform-box: fill-box; transform-origin: 50% 100%; transition: fill 0.2s; }
.view.enter .chart .bar { animation: grow-up 0.9s var(--ease) both; animation-delay: calc(var(--b, 0) * 55ms + 200ms); }
.chart .bar.hot { animation: hot-pulse 2.6s ease-in-out infinite; }
.chart g:hover .bar:not(.hot) { fill: rgba(247, 18, 120, 0.45); }
.chart .val { opacity: 0; fill: var(--text) !important; font-weight: 700; font-size: 12px !important; transition: opacity 0.2s; }
.chart g:hover .val, .chart .val.hot { opacity: 1; }
.view.enter .chart .val.hot { animation: fade-in 0.4s ease 1.3s both; }

/* Top sellers: bars slide in. */
.rank-row .track rect { transform-box: fill-box; transform-origin: 0 50%; }
.view.enter .rank-row .track rect { animation: grow-x 1.1s var(--ease) both; animation-delay: calc(var(--i, 0) * 80ms + 350ms); }

/* Live: pulsing dot. */
.live-dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--ok); vertical-align: 1px; animation: ring 2s ease-out infinite; }
.sp-thumb .pill.ok .dot { animation: ring 2s ease-out infinite; }

/* The highlighted card breathes. */
.kpi { isolation: isolate; transition: transform 0.35s var(--ease), border-color 0.35s; }
.kpi:hover { transform: translateY(-3px); border-color: rgba(247, 18, 120, 0.35); }
.kpi.glow::before { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: radial-gradient(60% 80% at 100% 0%, rgba(247, 18, 120, 0.28), transparent 70%); animation: breathe 4s ease-in-out infinite; pointer-events: none; }

/* Specials cards lift and zoom like the website. */
.sp-item { transition: border-color 0.2s, transform 0.35s var(--ease), box-shadow 0.35s; }
.sp-item:hover { transform: translateY(-4px); box-shadow: 0 24px 50px -24px rgba(247, 18, 120, 0.5); }
.sp-thumb img { transition: filter 0.3s, transform 1.2s var(--ease); }
.sp-item:hover .sp-thumb img { transform: scale(1.05); }

/* The Sienna sample chat plays out, then shows "typing". */
.chat.play .bubble { animation: bubble-in 0.45s var(--ease) both; animation-delay: calc(var(--i, 0) * 900ms + 400ms); }
.bubble.typing { display: inline-flex; gap: 4px; padding: 13px 14px; }
.bubble.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: typing 1.2s ease-in-out infinite; }
.bubble.typing i:nth-child(2) { animation-delay: 0.15s; }
.bubble.typing i:nth-child(3) { animation-delay: 0.3s; }

/* Small touches */
.nav a[aria-current='page']::before { animation: bar-in 0.4s var(--ease); }
#theme-btn .ic { animation: spin-in 0.5s var(--ease); }
.kpi .value { font-variant-numeric: tabular-nums; }
html.theme-fade, html.theme-fade * { transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease, fill 0.35s ease !important; }

/* ---- Pages (website text) */
dialog.drawer.wide { width: min(760px, 100vw); }
.field.inline { flex-direction: row; }
.field.inline select { height: 40px; padding: 0 36px 0 16px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.pg-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pg-name span { font-size: 12px; color: var(--faint); overflow-wrap: anywhere; }
.pg-meta { font-size: 13px; }
.pg-meta a { color: var(--pink); font-weight: 600; }
.rich { min-height: 70px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--input); color: var(--text); font-size: 14px; line-height: 1.55; outline: none; transition: border-color 0.2s, box-shadow 0.2s; overflow-wrap: anywhere; }
.rich:focus { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(247, 18, 120, 0.18); }
.rich a, .pg-text a { color: var(--pink); text-decoration: underline; }
.field small.over { color: var(--pink); font-weight: 700; }
.pg-history { display: flex; flex-direction: column; gap: 10px; }
.pg-rev { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); }
.pg-rev > div:first-child { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pg-rev span { font-size: 12px; color: var(--faint); }
.pg-rev.current { border-color: var(--pink); }
.pg-diff { display: flex; flex-direction: column; gap: 18px; }
.pg-diff-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.pg-diff-cols > div { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); }
.pg-text { font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
@media (max-width: 640px) { .pg-diff-cols { grid-template-columns: 1fr; } }

/* ---- Requests */
.status-select { height: 34px; padding: 0 30px 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--input); color: var(--text); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.status-select:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px rgba(247, 18, 120, 0.18); }

/* ---- Analytics ---- */
.chart .req-dot { fill: var(--pink); stroke: var(--panel); stroke-width: 2; }
.panel-head.sub-head { margin-top: 26px; }
.stack-form { display: flex; flex-direction: column; gap: 16px; }
.link-out { display: block; padding: 12px 14px; border-radius: 12px; border: 1px dashed var(--line-2); background: var(--input); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; user-select: all; }
.link-tip span { overflow-wrap: anywhere; }
.offer-pill { margin-top: 6px; color: var(--pink); background: color-mix(in srgb, var(--pink) 12%, transparent); white-space: normal; }
.emr-check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; white-space: nowrap; font-size: 12px; color: var(--muted); }
.emr-check input { width: 18px; height: 18px; accent-color: var(--pink); cursor: pointer; }
.emr-check input:checked + span { color: var(--text); font-weight: 600; }

/* ---- Passkey tip (dashboard) and sidebar passkey button ---- */
.passkey-tip { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; padding: 16px 18px; border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.passkey-tip .pk-ic { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.passkey-tip .pk-text { flex: 1; min-width: 0; }
.passkey-tip b { font-size: 14.5px; }
.passkey-tip p { margin: 2px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.passkey-tip .icon-btn { flex: none; width: 34px; height: 34px; }
.side-foot #passkey-btn + #signout-btn { margin-left: 0; }
@media (max-width: 600px) {
  .passkey-tip { flex-wrap: wrap; }
  .passkey-tip .pk-text { flex-basis: calc(100% - 60px); }
}

/* ---- NJ Board compliance export: offer picker ---- */
.bx-groups { display: flex; flex-direction: column; gap: 14px; }
.bx-group { margin: 0; padding: 10px 14px 12px; border: 1px solid var(--line); border-radius: 16px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bx-group legend { padding: 0 6px; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.bx-tools { display: flex; gap: 14px; margin-bottom: 4px; }
.link-btn { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-size: 12px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.bx-item { display: flex; gap: 10px; align-items: flex-start; padding: 7px 6px; border-radius: 10px; cursor: pointer; }
.bx-item:hover { background: var(--hover); }
.bx-item input { flex: none; width: 16px; height: 16px; margin-top: 3px; accent-color: var(--accent); }
.bx-item span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bx-item small { font-size: 12px; color: var(--faint); }

/* Newsletter: ready-made emails */
.nl-email { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 24px; align-items: start; }
.nl-thumb { display: block; border-radius: 18px; overflow: hidden; border: 1px solid var(--line-2); aspect-ratio: 16 / 9; background: #000; }
.nl-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease, ease); }
.nl-thumb:hover img { transform: scale(1.04); }
.nl-body h2 { margin: 6px 0 8px; font-size: 24px; font-weight: 800; letter-spacing: -0.03em; }
.nl-body h2 .serif { color: var(--accent); font-weight: 400; }
.nl-body > p { margin: 0; font-size: 13.5px; line-height: 1.55; }
.nl-actions { margin: 18px 0 10px; }
.nl-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; line-height: 1.55; }
.nl-steps + .hint-text { margin: 14px 0 0; }
.panel code { padding: 1px 6px; border-radius: 6px; background: var(--panel-2); font-size: 12px; }
@media (max-width: 760px) { .nl-email { grid-template-columns: minmax(0, 1fr); } }

.nl-test form { display: grid; gap: 14px; max-width: 640px; }
.nl-subject { display: flex; align-items: stretch; }
.nl-subject input { flex: 1; min-width: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.nl-test-tag { display: inline-flex; align-items: center; padding: 0 12px; border: 1px solid var(--line-2); border-right: 0; border-radius: 12px 0 0 12px; background: var(--panel-2); color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: 0.08em; }

/* Sienna */
.sn-status { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center; }
.sn-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 2px solid #c9b98a; }
.sn-who h2 { margin: 0 0 6px; font-size: 22px; font-weight: 800; }
.sn-who h2 .serif { color: #c9b98a; font-weight: 400; font-size: 18px; }
.sn-who p { margin: 0; font-size: 13px; line-height: 1.5; }
.sn-switch { display: flex; align-items: center; gap: 12px; }
.sn-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.sn-chat { max-height: 420px; overflow-y: auto; padding-right: 4px; }
.sn-chat .bubble { white-space: pre-line; }
.sn-note { display: block; margin-top: 8px; font-size: 11.5px; font-weight: 700; color: var(--accent); }
.sn-test { display: flex; gap: 10px; margin-top: 14px; }
.sn-test input { flex: 1; min-width: 0; height: 42px; padding: 0 16px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--panel-2); color: var(--text); font: inherit; }
.sn-emergency { margin: 16px 0 0; padding: 14px 16px; border-radius: 14px; border: 1px solid color-mix(in srgb, #ff6b6b 50%, transparent); font-size: 13px; line-height: 1.5; }
.sn-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 22px; }
.sn-form .form-error, .sn-form .sn-actions { grid-column: 1 / -1; }
@media (max-width: 1180px) { .sn-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .sn-status { grid-template-columns: auto minmax(0, 1fr); } .sn-switch { grid-column: 1 / -1; } .sn-form { grid-template-columns: minmax(0, 1fr); } .sn-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Gift cards */
.gc-scan form { display: flex; flex-direction: column; gap: 10px; }
.gc-scan .eyebrow { display: inline-flex; align-items: center; gap: 8px; }
.gc-scan-row { display: flex; gap: 12px; }
.gc-scan-row input { flex: 1; min-width: 0; height: 54px; padding: 0 20px; border: 1px solid var(--line-2); border-radius: 16px; background: var(--panel-2); color: var(--text); font: inherit; font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 20px; letter-spacing: .08em; text-transform: uppercase; }
.gc-scan-row input:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.gc-search { display: flex; gap: 8px; }
.gc-search input { height: 36px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--panel-2); color: var(--text); font: inherit; font-size: 13px; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td, tr.clickable:focus td { background: var(--panel-2); }
.gc-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 14px; }
.gc-big { font-size: 40px; font-weight: 800; letter-spacing: -.03em; }
.gc-redeem { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.gc-history { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.gc-history li { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-left: 2px solid var(--accent); background: var(--panel-2); border-radius: 0 10px 10px 0; font-size: 13px; }

/* Gift cards: which practice a card belongs to (separate practices) */
.pill.gc-aesthetics { color: #c9b98a; background: rgba(201, 185, 138, 0.14); }
.pill.gc-dental { color: #7cc4ff; background: rgba(124, 196, 255, 0.13); }
.gc-where { margin: 4px 0 14px; font-size: 13px; color: var(--muted); }
[data-theme='light'] .pill.gc-aesthetics { color: #7a6a3a; background: rgba(150, 128, 70, 0.14); }
[data-theme='light'] .pill.gc-dental { color: #1d6fb8; background: rgba(29, 111, 184, 0.11); }

/* Insiders */
.ins-search { min-width: 240px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: inherit; font: inherit; font-size: 13px; }
.ins-note { margin: 4px 0 12px; }

/* Settings */
.st-grid .panel-head { align-items: flex-start; gap: 16px; }
.st-save { grid-column: 1 / -1; }

/* Requests: Aesthetics (pink) and Dental (blue), each split by status */
.rq-section { --rq: var(--accent, #f71278); --rq-soft: rgba(247, 18, 120, .1); margin-bottom: 22px; border-top: 4px solid var(--rq); }
.rq-dental { --rq: #3b9eff; --rq-soft: rgba(59, 158, 255, .12); }
[data-theme='light'] .rq-dental { --rq: #1d6fd1; --rq-soft: rgba(29, 111, 209, .09); }
.rq-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 14px; margin-bottom: 14px; }
.rq-head h2 { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--rq); }
.rq-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.rq-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--rq); box-shadow: 0 0 12px var(--rq); }
.rq-counts { display: flex; flex-wrap: wrap; gap: 8px; }
.rq-count { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--rq-soft); font-size: 12px; color: var(--muted); }
.rq-count b { font-size: 15px; color: var(--rq); }
.rq-group { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: var(--rq-soft); }
.rq-group .table-wrap { margin-top: 8px; }
.rq-label { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--rq); }
.rq-label + .n, .rq-label .n, .rq-group summary .n { margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: var(--rq); color: #fff; font-size: 11px; letter-spacing: 0; }
.rq-group summary { cursor: pointer; list-style: revert; color: var(--rq); }
.rq-empty { margin: 6px 0 0; font-size: 13px; }
.rq-also { margin-left: 6px; background: var(--rq-soft); color: var(--muted); font-size: 10px; }
.rq-dental .status-select:focus, .rq-dental .btn-ghost:hover { border-color: var(--rq); }

/* Users → Access & alerts */
.acc-list { display: grid; gap: 2px; margin-bottom: 8px; }
.acc-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 12px; border-radius: 10px; }
.acc-row:hover { background: var(--hover); }
.acc-row span b { font-weight: 600; }
.acc-row small { display: block; font-size: 12px; color: var(--muted); }
.acc-row.off { opacity: .45; }
.acc-sub { margin-left: 22px; border-left: 2px solid var(--line); border-radius: 0 10px 10px 0; }
.acc-practices[hidden] { display: none; }

/* Requests: flag, Scheduled (green), Closed (gray), notes */
.rq-flag { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 8px; vertical-align: -6px; border: 1px solid var(--line); border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.rq-flag:hover { color: #ef4444; border-color: #ef4444; }
.rq-flag.on { background: #ef4444; border-color: #ef4444; color: #fff; box-shadow: 0 0 10px rgba(239, 68, 68, .6); }
.rq-flag.on svg { fill: #fff; }
.table tr.rq-flagged td { background: rgba(220, 38, 38, .38); }
.table tr.rq-flagged td:first-child { box-shadow: inset 4px 0 0 #ef4444; }
.rq-g-booked { --rq: #22c55e; --rq-soft: rgba(34, 197, 94, .13); }
.rq-g-booked .table td { background: rgba(34, 197, 94, .08); }
[data-theme='light'] .rq-g-booked { --rq: #15803d; --rq-soft: rgba(21, 128, 61, .09); }
.rq-g-closed { --rq: #8b8b93; --rq-soft: rgba(120, 120, 128, .14); }
[data-theme='light'] .rq-g-closed { --rq: #5b5b63; }
.rq-notes { position: relative; display: inline-flex; align-items: center; gap: 4px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 10px; background: none; color: var(--muted); cursor: pointer; }
.rq-notes:hover { color: var(--text, #fff); border-color: var(--rq, #f71278); }
.rq-notes.has { color: #ffd166; border-color: rgba(255, 209, 102, .6); background: rgba(255, 209, 102, .12); box-shadow: 0 0 12px rgba(255, 209, 102, .25); }
.rq-notes span { font-size: 12px; font-weight: 800; }
[data-theme='light'] .rq-notes.has { color: #a16207; }
.rq-note-list { display: grid; gap: 10px; margin: 0 0 14px; padding: 0; list-style: none; }
.rq-note-list li { padding: 10px 12px; border-radius: 10px; background: var(--hover); }
.rq-note-list p { margin: 0 0 4px; white-space: pre-wrap; }
.rq-svc { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; }

/* Unfinished requests inside the sections */
.table tr.rq-draft td { background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .025) 0 10px, rgba(255, 255, 255, 0) 10px 20px); }
.pill.rq-unfinished { margin-bottom: 4px; background: rgba(255, 209, 102, .16); color: #ffd166; border: 1px dashed rgba(255, 209, 102, .6); }
[data-theme='light'] .pill.rq-unfinished { color: #a16207; }

.rq-ways { display: inline-flex; gap: 6px; }
.rq-way { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--rq-soft, rgba(247, 18, 120, .12)); color: var(--rq, #f71278); }

/* Notes: previews under the count, and editing */
.rq-notes-cell { min-width: 150px; }
.rq-note-peek { display: block; max-width: 190px; margin-top: 6px; padding: 4px 8px; border: 0; border-left: 2px solid rgba(255, 209, 102, .7); border-radius: 0 6px 6px 0; background: rgba(255, 209, 102, .07); color: var(--muted); font: inherit; font-size: 12px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.rq-note-peek:hover { color: var(--text, #fff); background: rgba(255, 209, 102, .16); }
.rq-note-list .link-btn { margin-top: 4px; padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
.rq-note-list .link-btn:hover { color: #f71278; }
.rq-note-edit textarea { width: 100%; }
.rq-note-focus { outline: 2px solid #ffd166; outline-offset: 2px; }

/* Live: count of new requests in the menu */
.nav-count { margin-left: auto; min-width: 20px; padding: 1px 7px; border-radius: 999px; background: #ef4444; color: #fff; font-size: 11px; font-weight: 800; text-align: center; box-shadow: 0 0 10px rgba(239, 68, 68, .55); }
