/* Skynor Clinic — brand: obsidian plum + champagne gold + warm cream */
:root {
  --bg: #FBF7F2;
  --surface: #FFFFFF;
  --surface-2: #F5EEE7;
  --line: #E8DCD3;
  --ink: #2A1A22;
  --muted: #6B5A60;
  --plum: #4A3039;
  --plum-dark: #2A1A22;
  --mauve: #74585F;
  --gold: #B8922A;
  --gold-soft: #F4E9CC;
  --gold-bright: #D4AF37;
  --on-gold: #2A1A22;
  --danger: #B3261E;
  --danger-soft: #FBE9E7;
  --ok: #2E7D4F;
  --ok-soft: #E3F2E8;
  --shadow: 0 1px 2px rgba(42, 26, 34, .06), 0 4px 16px rgba(42, 26, 34, .06);
  --radius: 16px;
  --nav-h: 68px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1A1015;
    --surface: #24161D;
    --surface-2: #2E1D26;
    --line: #3E2A34;
    --ink: #F5ECE6;
    --muted: #B9A6AD;
    --plum: #3A2530;
    --gold: #E5C07B;
    --gold-soft: #3A2E1F;
    --gold-bright: #E5C07B;
    --danger: #F2938C;
    --danger-soft: #3B1C1C;
    --ok: #7FD1A0;
    --ok-soft: #1B3326;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1A1015;
  --surface: #24161D;
  --surface-2: #2E1D26;
  --line: #3E2A34;
  --ink: #F5ECE6;
  --muted: #B9A6AD;
  --plum: #3A2530;
  --gold: #E5C07B;
  --gold-soft: #3A2E1F;
  --gold-bright: #E5C07B;
  --danger: #F2938C;
  --danger-soft: #3B1C1C;
  --ok: #7FD1A0;
  --ok-soft: #1B3326;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 "Inter", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
svg { width: 22px; height: 22px; flex: none; }

/* ---------- Layout ---------- */
.shell { min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  background: var(--plum-dark);
  color: #F5ECE6;
}
.topbar .brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.logo { width: 38px; height: 38px; border-radius: 10px; object-fit: cover; border: 1px solid rgba(229, 192, 123, .5); }
.brand-name { font-family: "Cormorant Garamond", serif; font-size: 22px; letter-spacing: .08em; color: #E5C07B; line-height: 1; }
.brand-sub { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: #CDBBC2; }
.icon-btn {
  display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 10px;
  border-radius: 12px; border: 1px solid rgba(229, 192, 123, .35); background: transparent; color: #E5C07B;
  cursor: pointer; font-weight: 600; font-size: 14px;
}
.sync-dot { width: 9px; height: 9px; border-radius: 50%; background: #7FD1A0; }
.sync-dot.off { background: #F2B84B; }

main { padding: 16px 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); max-width: 1120px; margin: 0 auto; }

.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line);
}
.navlink {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  height: var(--nav-h); font-size: 11.5px; color: var(--muted); font-weight: 500;
}
.navlink.active { color: var(--ink); }
.navlink.active svg { color: var(--gold); }
.navlink.fab span { margin-top: 2px; }
.fab-circle {
  display: grid; place-items: center; width: 54px; height: 54px; margin-top: -26px; border-radius: 50%;
  background: linear-gradient(145deg, #E5C07B, #C9A23A); color: var(--on-gold);
  box-shadow: 0 6px 18px rgba(184, 146, 42, .45); border: 4px solid var(--surface);
}
.fab-circle svg { width: 26px; height: 26px; }
.sidenav { display: none; }

@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 240px 1fr; }
  .topbar { grid-column: 1 / -1; }
  .bottomnav { display: none; }
  .sidenav {
    display: flex; flex-direction: column; gap: 4px; padding: 16px 12px;
    position: sticky; top: 62px; height: calc(100vh - 62px);
    border-right: 1px solid var(--line); background: var(--surface);
  }
  .sidenav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; color: var(--muted); font-weight: 500; }
  .sidenav a:hover { background: var(--surface-2); }
  .sidenav a.active { background: var(--gold-soft); color: var(--ink); }
  .sidenav a.active svg { color: var(--gold); }
  .sidenav .btn { margin-bottom: 10px; }
  .sidenav .foot { margin-top: auto; font-size: 12px; color: var(--muted); padding: 8px 14px; }
  main { padding: 24px 32px 48px; width: 100%; }
}

/* ---------- Building blocks ---------- */
h1 { font-size: 22px; margin: 4px 0 2px; font-weight: 700; }
h2 { font-size: 17px; margin: 0; font-weight: 600; }
.sub { color: var(--muted); font-size: 14px; margin: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.section { margin-top: 22px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; gap: 8px; }
.section-head a { color: var(--gold); font-size: 14px; font-weight: 600; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.grid { display: grid; gap: 12px; }
.grid.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 700px) { .grid.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } .grid.two { grid-template-columns: 1fr 1fr; } }

.stat { padding: 14px 16px; }
.stat .label { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat .label svg { width: 16px; height: 16px; color: var(--gold); }
.stat .value { font-size: 26px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat .hint { font-size: 12px; color: var(--muted); }
.stat.hero { background: linear-gradient(150deg, #4A3039, #2A1A22); color: #F5ECE6; border-color: transparent; }
.stat.hero .label { color: #CDBBC2; }
.stat.hero .label svg { color: #E5C07B; }
.stat.hero .value { color: #E5C07B; }
.stat.hero .hint { color: #CDBBC2; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn.primary { background: linear-gradient(145deg, #E5C07B, #C9A23A); border-color: transparent; color: var(--on-gold); }
.btn.dark { background: var(--plum-dark); color: #E5C07B; border-color: transparent; }
.btn.danger { color: var(--danger); }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn svg { width: 18px; height: 18px; }
.btn.wa { color: #fff; background: #1FA855; border-color: transparent; }
.btn:disabled { opacity: .6; }

.search {
  display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 52px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
}
.search svg { color: var(--muted); }
.search input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 16px; min-width: 0; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.chips.scroll::-webkit-scrollbar { display: none; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); font-size: 14px; cursor: pointer; white-space: nowrap;
}
.chip.on { background: var(--plum-dark); color: #E5C07B; border-color: var(--plum-dark); }
:root[data-theme="dark"] .chip.on { background: var(--gold); color: var(--on-gold); border-color: var(--gold); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip.on { background: var(--gold); color: var(--on-gold); border-color: var(--gold); } }
.chip .n { font-size: 12px; color: var(--muted); }
.chip.on .n { color: inherit; opacity: .8; }

.badge { display: inline-block; white-space: nowrap; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--gold-soft); color: var(--gold); }
:root:not([data-theme="dark"]) .badge { color: #8A6A16; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge { color: var(--gold); } }
.badge.new { background: var(--ok-soft); color: var(--ok); }
.badge.late { background: var(--danger-soft); color: var(--danger); }

/* List rows */
.list { display: flex; flex-direction: column; }
.list.card { padding: 4px 0; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); cursor: pointer; }
.row:first-child { border-top: 0; }
.row:hover { background: var(--surface-2); }
.row .main { flex: 1; min-width: 0; }
.row .title { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.row .title span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .meta { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .end { text-align: right; font-size: 13px; color: var(--muted); flex: none; }
.row .end b { display: block; color: var(--ink); font-size: 15px; }
.avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--gold-soft); color: var(--ink); font-weight: 700; font-size: 15px;
}
.empty { text-align: center; color: var(--muted); padding: 28px 16px; font-size: 14px; }

/* Bars (single series, monthly) */
.bars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; align-items: end; height: 150px; padding-top: 18px; }
.bar-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; position: relative; }
.bar { width: 100%; max-width: 44px; background: var(--gold-bright); opacity: .55; border-radius: 4px 4px 0 0; min-height: 2px; }
.bar-col.cur .bar { opacity: 1; }
.bar-val { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bar-lbl { font-size: 12px; color: var(--muted); }
.bar-col:hover .bar { opacity: .85; }
.bar-col.cur .bar-val { color: var(--gold); }
.split { display: flex; height: 12px; border-radius: 999px; overflow: hidden; gap: 2px; background: var(--surface); margin: 10px 0 8px; }
.split > div { min-width: 4px; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* Forms */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 14px; font-weight: 600; color: var(--muted); }
.field > label em { color: var(--danger); font-style: normal; }
.input, textarea.input, select.input {
  width: 100%; min-height: 50px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); outline: 0; font-size: 16px;
}
textarea.input { min-height: 110px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-card { display: flex; flex-direction: column; gap: 14px; }
.form-card h2 { display: flex; align-items: center; gap: 8px; }
.form-card h2 svg { color: var(--gold); }
.suggest { border: 1px dashed var(--gold); background: var(--gold-soft); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.suggest .row { border: 0; padding: 8px 4px; border-radius: 10px; }
.suggest .avatar { background: var(--surface); }
.save-bar {
  position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 8px); z-index: 5;
  display: flex; gap: 10px; padding-top: 6px;
}
@media (min-width: 900px) { .save-bar { bottom: 16px; } .form-wrap { max-width: 760px; } }

/* Patient profile */
.profile { display: flex; gap: 14px; align-items: center; }
.profile .avatar { width: 60px; height: 60px; font-size: 22px; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.kv div { font-size: 13px; color: var(--muted); }
.kv b { display: block; font-size: 16px; color: var(--ink); font-variant-numeric: tabular-nums; }
@media (min-width: 700px) { .kv { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.info-line { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; font-size: 14px; color: var(--muted); }
.info-line svg { width: 18px; height: 18px; color: var(--gold); margin-top: 2px; }
.note-box { background: var(--danger-soft); color: var(--danger); border-radius: 12px; padding: 10px 12px; font-size: 14px; margin-top: 12px; }

.visit { position: relative; padding-left: 22px; }
.visit::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: -14px; width: 2px; background: var(--line); }
.visit:last-child::before { display: none; }
.visit::after { content: ""; position: absolute; left: 1px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--gold-bright); border: 2px solid var(--surface); }
.visit + .visit { margin-top: 14px; }
.visit .card { padding: 14px; }
.visit-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.visit-head b { font-size: 15px; }
.rx { white-space: pre-wrap; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; margin-top: 8px; font-size: 14.5px; }
.rx-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-top: 10px; }

/* Login */
.login {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(ellipse at top, #5A3A47, #2A1A22 70%);
}
.login-card { width: 100%; max-width: 380px; text-align: center; color: #F5ECE6; }
.login-card .logo { width: 110px; height: 110px; border-radius: 28px; margin-bottom: 14px; }
.login-card h1 { font-family: "Cormorant Garamond", serif; font-size: 34px; letter-spacing: .1em; color: #E5C07B; margin: 0; font-weight: 600; }
.login-card .sub { color: #CDBBC2; margin-bottom: 22px; }
.login-card .input { background: rgba(255, 255, 255, .08); border-color: rgba(229, 192, 123, .3); color: #F5ECE6; text-align: left; }
.login-card .input::placeholder { color: #B9A6AD; }
.login-card .form { gap: 12px; }
.login-card .err { color: #F2938C; font-size: 14px; min-height: 20px; }
.login-card .foot { margin-top: 26px; font-size: 12px; color: #9C8890; }
.lang-switch { display: inline-flex; border: 1px solid rgba(229, 192, 123, .35); border-radius: 999px; padding: 3px; margin-bottom: 18px; }
.lang-switch button { border: 0; background: transparent; color: #CDBBC2; padding: 6px 14px; border-radius: 999px; cursor: pointer; font-size: 14px; }
.lang-switch button.on { background: #E5C07B; color: #2A1A22; font-weight: 600; }

/* Settings */
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line); }
.set-row:first-child { border-top: 0; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 12px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 7px 12px; border-radius: 9px; cursor: pointer; font-size: 14px; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }

#toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  background: var(--plum-dark); color: #E5C07B; padding: 12px 18px; border-radius: 12px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 50; box-shadow: var(--shadow); max-width: calc(100% - 32px);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 900px) { #toast { bottom: 24px; } }

/* ---------- v2 additions ---------- */
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.right { text-align: right; }
.small { font-size: 13px; }
.strong { font-weight: 600; }
.m0 { margin: 0; }
.mt { margin-top: 16px; }
.mt-s { margin-top: 10px; }
.mt-xs { margin-top: 4px; }
.self-start { align-self: flex-start; }
.danger-text { color: var(--danger) !important; }
.back { margin-bottom: 12px; }
.link { border: 0; background: none; color: var(--gold); font-weight: 600; cursor: pointer; padding: 0; font-size: 13px; }
.icon-btn.plain { border-color: var(--line); color: var(--ink); background: var(--surface); }
.sub small, .sub.small { font-size: 13px; }
.page-head h1 .sub { font-size: 16px; }

.demo-pill { font-size: 11px; font-weight: 700; letter-spacing: .1em; color: #2A1A22; background: #E5C07B; padding: 3px 8px; border-radius: 6px; }
.sidenav .side-gap { height: 8px; }
.sidenav a .badge { margin-left: auto; }
.navlink { position: relative; }
.navlink .dot { position: absolute; top: 12px; right: calc(50% - 16px); width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }

.quick { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; scrollbar-width: none; }
.quick::-webkit-scrollbar { display: none; }
.quick .chip svg { width: 16px; height: 16px; color: var(--gold); }
.fu-card { display: block; }
.fu-card:hover { border-color: var(--gold); }
.mt { margin-top: 16px; }

.grid.tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 700px) { .grid.tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; min-height: 104px; position: relative; }
.tile svg { color: var(--gold); width: 26px; height: 26px; }
.tile .badge { position: absolute; top: 12px; right: 12px; }

.time-box { flex: none; width: 66px; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; display: flex; flex-direction: column; }
.time-box small { font-weight: 500; font-size: 12px; color: var(--muted); }
.row.muted { opacity: .55; }
.row-actions { display: flex; gap: 6px; }
.row .end .btn { font-size: 13px; }
@media (max-width: 420px) { .hide-xs { display: none; } .row.appt .end .btn svg { display: none; } }

.badge.st-booked { background: var(--gold-soft); }
.badge.st-arrived { background: #E3ECFB; color: #1E4FA8; }
.badge.st-done { background: var(--ok-soft); color: var(--ok); }
.badge.st-cancelled, .badge.st-noshow { background: var(--surface-2); color: var(--muted); }
:root[data-theme="dark"] .badge.st-arrived { background: #1D2A44; color: #9DBBF2; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge.st-arrived { background: #1D2A44; color: #9DBBF2; } }

.day-nav { display: flex; align-items: center; gap: 10px; }
.day-nav .center { display: flex; flex-direction: column; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 12px; }
.week button {
  display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 0; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 12px; color: var(--muted);
}
.week button b { font-size: 17px; color: var(--ink); }
.week button i { font-style: normal; font-size: 11px; min-height: 14px; color: var(--gold); font-weight: 700; }
.week button.is-today b { color: var(--gold); }
.week button.on { background: var(--plum-dark); border-color: var(--plum-dark); color: #CDBBC2; }
.week button.on b { color: #E5C07B; }
.week button.on i { color: #F5ECE6; }

.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 12px; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 9px 6px; border-radius: 9px; cursor: pointer; color: var(--muted); font-weight: 500; font-size: 14px; }
.tabs button span { font-size: 12px; opacity: .8; }
.tabs button.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }

.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 700px) { .photo-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.photo { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 1; background: var(--surface-2); display: block; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo span { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 6px; font-size: 11px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.65)); }
.photo-x { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; cursor: pointer; }
.photo-x svg { width: 16px; height: 16px; }
.chips.gender { min-height: 50px; align-items: center; }
label.btn { cursor: pointer; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 500; }
.check input { width: 20px; height: 20px; accent-color: var(--gold); }

.card.flush { padding: 0; }
.set-row { color: inherit; }
a.set-row:hover { background: var(--surface-2); }
.set-label { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.set-label svg { color: var(--gold); width: 20px; height: 20px; }
.set-row .sub svg { width: 16px; height: 16px; vertical-align: -3px; }

.tbl { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 14px; }
.tbl td { padding: 8px 4px; border-top: 1px solid var(--line); }
.tbl tr:first-child td { border-top: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl td:not(.num) { color: var(--ink); }
.tbl td.num:nth-child(2) { color: var(--muted); }
.link-row { cursor: pointer; }
.bars.dense { gap: 2px; }
.bars.dense .bar-lbl { font-size: 9px; }
.grid.stats .stat .value.danger-text { font-size: 24px; }

.demo-logins { margin-top: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #CDBBC2; }
.demo-logins button { border: 1px dashed rgba(229, 192, 123, .45); background: rgba(255,255,255,.04); color: #F5ECE6; border-radius: 10px; padding: 8px 12px; cursor: pointer; font-size: 14px; display: flex; gap: 6px; align-items: center; }
.demo-logins button span { margin-left: auto; color: #E5C07B; font-size: 12px; }

/* Prescription sheet */
.rx-sheet { padding: 22px; max-width: 820px; }
.rx-head { display: flex; gap: 14px; align-items: flex-start; padding-bottom: 14px; border-bottom: 2px solid var(--gold-bright); flex-wrap: wrap; }
.rx-logo { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; }
.rx-clinic { font-family: "Cormorant Garamond", serif; font-size: 26px; font-weight: 600; letter-spacing: .04em; color: var(--ink); line-height: 1.1; }
.rx-contact { text-align: right; max-width: 220px; }
.rx-patient { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
@media (min-width: 700px) { .rx-patient { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.rx-patient span, .rx-block span, .rx-bill span { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.rx-block { margin-top: 12px; }
.rx-symbol { font-family: "Cormorant Garamond", serif; font-size: 34px; color: var(--gold); margin-top: 10px; line-height: 1; }
.rx-bill { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--line); }
.rx-bill small { font-weight: 500; color: var(--muted); }
.rx-foot { display: flex; flex-direction: column; align-items: flex-end; margin-top: 36px; font-weight: 600; }
.rx-foot span { font-size: 12px; color: var(--muted); font-weight: 500; border-top: 1px solid var(--line); padding-top: 4px; min-width: 160px; text-align: center; }
.actions-top { margin-bottom: 12px; }

@media print {
  @page { margin: 12mm; }
  body { background: #fff !important; color: #000 !important; }
  .topbar, .sidenav, .bottomnav, .no-print, #toast { display: none !important; }
  .shell { display: block !important; }
  main { padding: 0 !important; max-width: none !important; }
  .rx-sheet { box-shadow: none !important; border: 0 !important; padding: 0 !important; max-width: none; background: #fff !important; }
  .rx-sheet * { color: #000 !important; }
  .rx, .note-box { background: #f6f2ee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rx-head { border-bottom-color: #B8922A !important; }
}
.boot { min-height: 100vh; display: grid; place-items: center; background: #2A1A22; }
.boot img { border-radius: 18px; opacity: .9; }
/* Grid tracks must be allowed to shrink below their content on phones. */
.grid { grid-template-columns: minmax(0, 1fr); }
.grid > * { min-width: 0; }
.rx-head .grow { min-width: 0; flex: 1 1 200px; }
@media (max-width: 600px) {
  .rx-contact { flex-basis: 100%; text-align: left; max-width: none; }
  .rx-sheet { padding: 16px; }
}
.row.appt .meta .badge { margin-right: 4px; }
:root[data-theme="dark"] .week button.on { background: var(--gold); border-color: var(--gold); color: #2A1A22; }
:root[data-theme="dark"] .week button.on b, :root[data-theme="dark"] .week button.on i { color: #2A1A22; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .week button.on { background: var(--gold); border-color: var(--gold); color: #2A1A22; }
  :root:not([data-theme="light"]) .week button.on b, :root:not([data-theme="light"]) .week button.on i { color: #2A1A22; }
}
