/* ===== Tokens ===== */
:root {
  --deep: #0E3B43;
  --deep-2: #0A2F35;
  --teal: #0F7A73;
  --teal-hover: #0B665F;
  --mint: #D8F0EC;
  --mint-2: #EDF8F6;
  --bg: #F5F8F8;
  --surface: #FFFFFF;
  --ink: #10282D;
  --muted: #5A7075;
  --line: #DCE5E5;
  --line-strong: #C5D3D3;
  --amber: #B7791F;
  --amber-bg: #FDF3E1;
  --danger: #B93C30;
  --danger-bg: #FBECEA;
  --ok: #1E7A4C;
  --ok-bg: #E4F4EA;
  --blue: #2F7FC1;
  --violet: #6D55C4;
  --focus: 0 0 0 3px rgba(15, 122, 115, .28);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 40, 45, .06), 0 8px 24px -12px rgba(16, 40, 45, .18);
  --font-body: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --font-display: "Readex Pro", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --p-filling: #2F7FC1;
  --p-root_canal: #D58A1C;
  --p-crown: #6D55C4;
  --p-extraction: #C0473B;
  color-scheme: light;
}
[data-theme="dark"] {
  --deep: #0A2328;
  --deep-2: #071A1E;
  --teal: #37B5A9;
  --teal-hover: #4BC7BB;
  --mint: #12332F;
  --mint-2: #0F2A27;
  --bg: #0B181B;
  --surface: #102226;
  --ink: #E2EDED;
  --muted: #92A9AD;
  --line: #1E383D;
  --line-strong: #2B4A50;
  --amber: #E9B35C;
  --amber-bg: #2E2413;
  --danger: #EE7D71;
  --danger-bg: #351A17;
  --ok: #5ECB92;
  --ok-bg: #12301F;
  --focus: 0 0 0 3px rgba(55, 181, 169, .35);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.25; margin: 0; font-weight: 600; letter-spacing: -.01em; }
[lang="ar"] h1, [lang="ar"] h2, [lang="ar"] h3 { letter-spacing: 0; }
p { margin: 0; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
img, svg { display: block; }
.i { flex: none; }
[dir="rtl"] .flip { transform: scaleX(-1); }
[dir="ltr"] .flip-back { transform: scaleX(-1); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.block { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(1160px, 100% - 40px); margin-inline: auto; }
[data-theme="light"] .show-dark, [data-theme="dark"] .show-light { display: none; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 500; font-size: 14.5px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--teal); color: #fff; }
[data-theme="dark"] .btn-primary { color: #04201D; }
.btn-primary:hover { background: var(--teal-hover); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--mint-2); }
.btn-outline { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-outline:hover { border-color: var(--teal); color: var(--teal); }
.btn-lg { min-height: 48px; padding: 0 22px; font-size: 15.5px; border-radius: 12px; }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 13.5px; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  border: 0; background: transparent; cursor: pointer; color: inherit;
}
.icon-btn:hover { background: var(--mint-2); }
.link-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--teal); cursor: pointer; padding: 4px 0; font-size: 13.5px; font-weight: 500; }
.lang-link { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 500; font-size: 14px; padding: 8px 10px; border-radius: 10px; }
.lang-link:hover { background: var(--mint-2); text-decoration: none; }

/* ===== Brand ===== */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-family: var(--font-display); font-weight: 600; font-size: 18px; }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--deep); color: var(--mint); }
[data-theme="dark"] .brand-mark { background: var(--mint); color: var(--teal); }
.brand-light { color: #fff; }
.brand-light .brand-mark { background: rgba(255, 255, 255, .1); color: #BFE9E3; }

/* ===== Forms ===== */
.stack { display: flex; flex-direction: column; gap: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 0; padding: 0; margin: 0; }
.label { font-weight: 500; font-size: 14px; padding: 0; }
.opt { color: var(--muted); font-weight: 400; }
.input {
  width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font: inherit; font-size: 15px; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--muted); opacity: .7; }
.input:hover { border-color: var(--muted); }
.input:focus { outline: none; border-color: var(--teal); box-shadow: var(--focus); }
.input:disabled { background: var(--bg); color: var(--muted); cursor: not-allowed; }
[dir="rtl"] .input[dir="ltr"] { text-align: right; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-size: 5px 5px; background-repeat: no-repeat; background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; padding-inline-end: 36px; }
[dir="rtl"] .select { background-position: 15px 50%, 20px 50%; }
.has-error .input { border-color: var(--danger); }
.error-text { color: var(--danger); font-size: 13px; }
.hint { color: var(--muted); font-size: 13px; }
.input-wrap { position: relative; }
.input-wrap .input { padding-inline-end: 46px; }
.input-icon { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 36px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 8px; }
.input-icon:hover, .input-icon.is-on { color: var(--teal); }
.input-row { display: flex; gap: 10px; }
.grow { flex: 1; }
.strength { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.strength-bar { flex: 1; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.strength-bar i { display: block; height: 100%; width: 0; background: var(--danger); transition: width .25s, background .25s; }
.strength[data-level="1"] i { width: 25%; }
.strength[data-level="2"] i { width: 50%; background: var(--amber); }
.strength[data-level="3"] i { width: 75%; background: var(--teal); }
.strength[data-level="4"] i { width: 100%; background: var(--ok); }
.strength em { font-style: normal; min-width: 52px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--teal); }
.alert { padding: 12px 14px; border-radius: 10px; font-size: 14px; }
.alert-error { background: var(--danger-bg); color: var(--danger); }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch-track { flex: none; width: 42px; height: 24px; border-radius: 12px; background: var(--line-strong); position: relative; transition: background .2s; margin-top: 2px; }
.switch-track i { position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: inset-inline-start .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .switch-track { background: var(--teal); }
.switch input:checked + .switch-track i { inset-inline-start: 21px; }
.switch input:focus-visible + .switch-track { box-shadow: var(--focus); }
.switch input:disabled + .switch-track { opacity: .5; }
.switch-text { display: flex; flex-direction: column; }
.switch-text small { color: var(--muted); font-size: 13px; }

.role-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.role-card { position: relative; cursor: pointer; }
.role-card input { position: absolute; opacity: 0; }
.role-card-body { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 10px; height: 100%; transition: border-color .15s, background .15s; }
.role-card-body small { color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.role-card input:checked + .role-card-body { border-color: var(--teal); background: var(--mint-2); box-shadow: inset 0 0 0 1px var(--teal); }
.role-card input:focus-visible + .role-card-body { box-shadow: var(--focus); }
.role-card input:disabled + .role-card-body { opacity: .6; cursor: not-allowed; }

/* ===== Toasts ===== */
.toasts { position: fixed; z-index: 100; inset-block-end: 20px; inset-inline-end: 20px; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100% - 40px)); }
.toast { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; border-radius: 12px; background: var(--deep); color: #fff; box-shadow: var(--shadow); font-size: 14.5px; animation: toast-in .25s ease-out; }
[dir="rtl"] .toast { padding: 12px 16px 12px 12px; }
.toast span { flex: 1; }
.toast-error { background: var(--danger); }
.toast-close { border: 0; background: none; color: inherit; opacity: .7; cursor: pointer; display: grid; place-items: center; padding: 4px; }
.toast.is-leaving { opacity: 0; transform: translateY(8px); transition: .2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ===== Public site ===== */
.site-body { background: var(--surface); }
.site-header { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-header-row { display: flex; align-items: center; gap: 24px; height: 68px; }
.site-nav { display: flex; gap: 4px; }
.site-nav a { color: var(--muted); font-weight: 500; padding: 8px 12px; border-radius: 8px; }
.site-nav a:hover { color: var(--ink); background: var(--mint-2); text-decoration: none; }
.site-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }

.hero { padding: 64px 0 72px; background: linear-gradient(var(--mint-2), var(--surface) 70%); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.hero-title { font-size: clamp(34px, 4.6vw, 54px); font-weight: 700; line-height: 1.12; color: var(--deep); max-width: 14em; }
[data-theme="dark"] .hero-title { color: var(--ink); }
[lang="ar"] .hero-title { line-height: 1.3; }
.hero-sub { margin-top: 20px; font-size: 18px; color: var(--muted); max-width: 34em; line-height: 1.7; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.hero-note { display: flex; align-items: center; gap: 8px; margin-top: 18px; color: var(--muted); font-size: 14px; }

.chart-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px 20px 20px; box-shadow: var(--shadow); }
.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.chart-caption { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 14px; color: var(--teal); }
.arch { width: 100%; max-width: 380px; margin: 4px auto 0; overflow: visible; }
.arch-static { width: 100%; max-width: 280px; }
.tooth rect { fill: var(--surface); stroke: var(--line-strong); stroke-width: 1.5; transition: fill .15s, stroke .15s; }
.arch .tooth { cursor: pointer; outline: none; }
.arch .tooth:hover rect, .arch .tooth:focus-visible rect { stroke: var(--teal); stroke-width: 2.2; }
.tooth[data-state] rect { stroke: transparent; }
.tooth[data-state="filling"] rect { fill: var(--p-filling); }
.tooth[data-state="root_canal"] rect { fill: var(--p-root_canal); }
.tooth[data-state="crown"] rect { fill: var(--p-crown); }
.tooth[data-state="extraction"] rect { fill: var(--p-extraction); }
.tooth.is-bump rect { animation: bump .3s ease-out; transform-box: fill-box; transform-origin: center; }
@keyframes bump { 50% { transform: scale(1.18); } }
.arch-label { font-size: 11px; fill: var(--muted); font-family: var(--font-body); }
.arch-total-label { font-size: 12px; fill: var(--muted); font-family: var(--font-body); }
.arch-total { font-size: 30px; font-weight: 700; fill: var(--deep); font-family: var(--font-display); }
[data-theme="dark"] .arch-total { fill: var(--ink); }
.arch-static .tooth rect { fill: rgba(255,255,255,.06); stroke: rgba(191, 233, 227, .35); }
.arch-static .tooth[data-state] rect { stroke: transparent; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; justify-content: center; margin-top: 6px; font-size: 13px; color: var(--muted); }
.legend-chip { display: inline-flex; align-items: center; gap: 6px; }
.legend-chip i { width: 10px; height: 10px; border-radius: 3px; background: var(--p-filling); }
.legend-chip[data-proc="root_canal"] i { background: var(--p-root_canal); }
.legend-chip[data-proc="crown"] i { background: var(--p-crown); }
.legend-chip[data-proc="extraction"] i { background: var(--p-extraction); }
.chart-plan { margin-top: 14px; border-top: 1px dashed var(--line-strong); padding-top: 12px; }
.plan-items { list-style: none; margin: 0; padding: 0; max-height: 132px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.plan-items li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; font-size: 14px; }
.plan-items li i { width: 8px; height: 8px; border-radius: 50%; }
.plan-items .plan-price { font-variant-numeric: tabular-nums; color: var(--muted); }
.plan-items .plan-empty { display: block; color: var(--muted); }
.plan-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 10px; font-weight: 500; }
.plan-total strong { font-family: var(--font-display); font-size: 20px; font-variant-numeric: tabular-nums; }
.chart-foot { display: flex; align-items: flex-start; gap: 8px; margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: var(--mint-2); font-size: 13.5px; color: var(--ink); }
.chart-foot .i { margin-top: 3px; color: var(--teal); }
.chart-foot span { flex: 1; }
.demo-tag { font-style: normal; font-size: 11.5px; color: var(--muted); white-space: nowrap; margin-top: 2px; }

.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head h2 { font-size: clamp(26px, 3vw, 36px); color: var(--deep); }
[data-theme="dark"] .section-head h2 { color: var(--ink); }
.section-head p { margin-top: 12px; color: var(--muted); font-size: 17px; }
.features { padding: 88px 0; background: var(--bg); }
.feature-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 32px; align-items: start; }
.feature-lead { background: var(--deep); color: #E3F1EF; border-radius: 20px; padding: 32px; position: sticky; top: 92px; }
.feature-lead h3 { font-size: 24px; margin-top: 18px; color: #fff; }
.feature-lead p { margin-top: 10px; color: #B8D4D0; line-height: 1.7; }
.feature-lead .feature-icon { background: rgba(255,255,255,.1); color: #BFE9E3; }
.feature-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--mint); color: var(--teal); flex: none; }
.wa-mock { margin-top: 28px; padding: 18px; border-radius: 16px; background: #E9E1D6; }
.wa-bubble { background: #fff; color: #1B2B2E; border-radius: 12px; border-start-start-radius: 4px; padding: 12px 14px; font-size: 14px; display: flex; flex-direction: column; gap: 4px; max-width: 290px; box-shadow: 0 1px 1px rgba(0,0,0,.1); }
.wa-bubble b { color: #0F7A73; font-size: 13px; }
.wa-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid #E5E5E5; color: #0B7A6E; font-weight: 600; }
.feature-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 32px; }
.feature { display: flex; gap: 14px; }
.feature h3 { font-size: 17px; }
.feature p { margin-top: 6px; color: var(--muted); font-size: 14.5px; line-height: 1.65; }

.pricing { padding: 88px 0 96px; }
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.plan { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 28px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); }
.plan.is-featured { border: 2px solid var(--teal); box-shadow: var(--shadow); }
.plan-badge { position: absolute; top: -13px; inset-inline-start: 24px; background: var(--teal); color: #fff; font-size: 12.5px; font-weight: 600; padding: 3px 12px; border-radius: 20px; }
[data-theme="dark"] .plan-badge { color: #04201D; }
.plan h3 { font-size: 20px; }
.plan-desc { color: var(--muted); font-size: 14.5px; margin-top: -8px; }
.plan-price { display: flex; align-items: baseline; gap: 8px; }
.plan-price strong { font-family: var(--font-display); font-size: 40px; font-weight: 700; color: var(--deep); line-height: 1; }
[data-theme="dark"] .plan-price strong { color: var(--ink); }
.plan-price span { color: var(--muted); font-size: 14px; }
.plan-features { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.plan-features li { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; }
.plan-features .i { color: var(--teal); margin-top: 4px; }
.site-footer { border-top: 1px solid var(--line); padding: 28px 0; background: var(--surface); }
.site-footer-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }

/* ===== Auth ===== */
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .85fr); min-height: 100vh; }
.auth-main { display: flex; flex-direction: column; padding: 24px clamp(20px, 5vw, 64px) 40px; background: var(--surface); }
.auth-top { display: flex; align-items: center; justify-content: space-between; }
.auth-form { width: 100%; max-width: 440px; margin: auto; padding-block: 40px; }
.auth-title { font-size: 28px; color: var(--deep); }
[data-theme="dark"] .auth-title { color: var(--ink); }
.auth-sub { color: var(--muted); margin: 6px 0 28px; }
.auth-form .alert { margin-bottom: 18px; }
.auth-alt { margin-top: 24px; text-align: center; color: var(--muted); font-size: 14.5px; }
.auth-side { background: var(--deep); color: #E3F1EF; display: flex; align-items: center; justify-content: center; padding: 48px; position: relative; overflow: hidden; }
.auth-side-inner { max-width: 380px; }
.auth-side h2 { font-size: 28px; color: #fff; margin-top: 28px; line-height: 1.35; }
.auth-points { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-direction: column; gap: 16px; }
.auth-points li { display: flex; align-items: center; gap: 12px; color: #C7DEDB; }
.auth-points .i { color: #7FD3C8; }

/* ===== App shell ===== */
.app { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 14px; background: var(--deep); color: #CFE3E0; padding: 18px 14px 14px; overflow-y: auto; z-index: 50; }
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px; }
.sidebar .icon-btn:hover { background: rgba(255, 255, 255, .08); }
.sidebar-close { display: none; }
.clinic-chip { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, .06); }
.clinic-chip-name { color: #fff; font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clinic-chip-role { font-size: 12.5px; color: #8FB7B1; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-group { margin: 14px 12px 4px; font-size: 12px; color: #7FA6A0; font-weight: 500; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 9px; color: #CFE3E0; font-size: 14.5px; font-weight: 500; position: relative; }
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.nav-item.is-active { background: rgba(127, 211, 200, .14); color: #fff; }
.nav-item.is-active::before { content: ""; position: absolute; inset-inline-start: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #7FD3C8; }
[dir="rtl"] .nav-item.is-active::before { border-radius: 3px 0 0 3px; }
.nav-item.is-soon { color: #6F948F; cursor: default; }
.nav-item span { flex: 1; }
.soon { font-style: normal; font-size: 11px; padding: 1px 8px; border-radius: 10px; background: rgba(255, 255, 255, .07); color: #8FB7B1; }
.sidebar-user { display: flex; align-items: center; gap: 6px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .08); }
.me { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; padding: 6px; border-radius: 10px; color: #fff; }
.me:hover { background: rgba(255, 255, 255, .07); text-decoration: none; }
.me-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.me-text b { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-text small { color: #8FB7B1; font-size: 12px; }
.scrim { display: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 28px; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.menu-btn { display: none; }
.search-trigger { display: flex; align-items: center; gap: 10px; width: min(380px, 100%); height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; font-size: 14px; }
.search-trigger span { flex: 1; text-align: start; }
.search-trigger:hover { border-color: var(--line-strong); }
kbd { font-family: inherit; font-size: 11.5px; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--muted); direction: ltr; }
.topbar-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 4px; }
.content { padding: 28px; width: 100%; max-width: 1200px; }

/* ===== App content ===== */
.page-title { font-size: 26px; color: var(--ink); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head .muted { margin-top: 4px; }
.back-link { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.panel.flush { padding: 0; overflow: hidden; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h2, .panel-title { font-size: 17px; }

.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.dash-head .muted { margin-top: 2px; }
.trial-chip { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 14px; border-radius: 12px; background: var(--amber-bg); color: var(--amber); font-size: 14px; font-weight: 500; }
[dir="rtl"] .trial-chip { padding: 8px 14px 8px 8px; }
.trial-chip a { background: var(--surface); color: var(--ink); padding: 4px 10px; border-radius: 8px; font-size: 13px; }
.trial-chip a:hover { text-decoration: none; background: var(--bg); }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 20px; }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 18px 22px; }
.kpi + .kpi { border-inline-start: 1px solid var(--line); }
.kpi-label { font-size: 13.5px; color: var(--muted); font-weight: 500; }
.kpi-value { font-family: var(--font-display); font-size: 32px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi-value.is-empty { color: var(--line-strong); }
.kpi-hint { font-size: 12.5px; color: var(--muted); }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); grid-template-areas: "setup activity" "setup quick"; gap: 20px; align-items: start; }
.setup { grid-area: setup; }
.activity { grid-area: activity; }
.quick { grid-area: quick; }
.ring { width: 52px; height: 52px; flex: none; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 4.5; }
.ring-track { stroke: var(--line); }
.ring-fill { stroke: var(--teal); stroke-linecap: round; transition: stroke-dasharray .6s ease-out; }
.ring text { transform: rotate(90deg); transform-origin: 22px 22px; font-size: 11px; font-weight: 600; fill: var(--ink); font-family: var(--font-body); }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.check-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.check-item:first-child { border-top: 0; }
.check-dot { width: 22px; height: 22px; flex: none; border-radius: 50%; border: 1.5px dashed var(--line-strong); display: grid; place-items: center; color: #fff; }
.check-item.is-done .check-dot { background: var(--teal); border: 0; }
[data-theme="dark"] .check-item.is-done .check-dot { color: #04201D; }
.check-item.is-done .check-text { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.check-item.is-soon .check-text { color: var(--muted); }
.check-text { flex: 1; }
.check-link { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ink); font-weight: 500; }
.check-link:hover { color: var(--teal); text-decoration: none; }
.check-item .soon { background: var(--bg); color: var(--muted); }

.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.feed li { display: flex; gap: 12px; align-items: flex-start; }
.feed p { font-size: 14px; line-height: 1.5; }
.feed time { font-size: 12.5px; color: var(--muted); }
.empty { color: var(--muted); font-size: 14px; padding: 18px; border: 1px dashed var(--line-strong); border-radius: 10px; text-align: center; }
.quick-list { display: flex; flex-direction: column; gap: 4px; }
.quick-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--ink); font-weight: 500; font-size: 14.5px; }
.quick-item .i { color: var(--teal); }
.quick-item:hover { background: var(--mint-2); text-decoration: none; }
.kbd-hint { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

.avatar { --h: 170; width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 600; color: hsl(var(--h) 45% 26%); background: hsl(var(--h) 55% 88%); font-family: var(--font-body); }
[data-theme="dark"] .avatar { color: hsl(var(--h) 55% 85%); background: hsl(var(--h) 30% 24%); }
.avatar.sm { width: 30px; height: 30px; font-size: 11.5px; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }

.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: start; font-weight: 500; font-size: 13px; color: var(--muted); padding: 12px 20px; background: var(--bg); border-bottom: 1px solid var(--line); }
.table td { padding: 14px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.is-muted td { opacity: .6; }
.row-action { text-align: end; }
.person { display: flex; align-items: center; gap: 12px; }
.person div { display: flex; flex-direction: column; min-width: 0; }
.person small { color: var(--muted); font-size: 13px; text-align: start; }
.you { font-size: 11.5px; font-weight: 500; padding: 1px 8px; border-radius: 10px; background: var(--mint); color: var(--teal); margin-inline-start: 4px; }
.pill { display: inline-block; font-size: 12.5px; font-weight: 500; padding: 3px 10px; border-radius: 20px; background: var(--bg); border: 1px solid var(--line); }
.pill-owner { background: var(--deep); color: #fff; border-color: transparent; }
[data-theme="dark"] .pill-owner { background: var(--mint); color: var(--teal); }
.pill-doctor { background: var(--mint); color: var(--teal); border-color: transparent; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.status.is-on::before { background: var(--ok); }

.form-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.side-panel { position: sticky; top: 84px; }
.settings-form { display: flex; flex-direction: column; gap: 20px; max-width: 880px; }
.settings-section .panel-title { margin-bottom: 18px; }
.sticky-actions { position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 30%); }
.profile-head { display: flex; align-items: center; gap: 18px; margin-bottom: 26px; }

.error-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 24px; }
.error-code { font-family: var(--font-display); font-size: 88px; font-weight: 700; color: var(--mint); line-height: 1; margin-top: 24px; -webkit-text-stroke: 2px var(--teal); }
.error-page h1 { font-size: 26px; }
.error-page .btn { margin-top: 10px; }

/* ===== Command palette ===== */
.cmdk { position: fixed; inset: 0; z-index: 90; display: grid; justify-items: center; align-items: start; padding: 12vh 16px 16px; }
.cmdk[hidden] { display: none; }
.cmdk-backdrop { position: absolute; inset: 0; background: rgba(6, 22, 25, .45); backdrop-filter: blur(2px); }
.cmdk-panel { position: relative; width: min(560px, 100%); background: var(--surface); border-radius: 16px; box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .5); border: 1px solid var(--line); overflow: hidden; animation: pop .16s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.cmdk-search { display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.cmdk-search input { flex: 1; height: 56px; border: 0; background: none; font: inherit; font-size: 16px; color: var(--ink); outline: none; }
.cmdk-list { list-style: none; margin: 0; padding: 8px; max-height: 340px; overflow-y: auto; }
.cmdk-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer; font-size: 14.5px; }
.cmdk-list li .i { color: var(--muted); }
.cmdk-list li[aria-selected="true"] { background: var(--mint-2); color: var(--teal); }
.cmdk-list li[aria-selected="true"] .i { color: var(--teal); }
.cmdk-empty { padding: 20px; text-align: center; color: var(--muted); }

/* ===== Responsive ===== */
@media (max-width: 1080px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "setup" "activity" "quick"; }
  .form-layout { grid-template-columns: minmax(0, 1fr); }
  .side-panel { position: static; }
  .feature-layout { grid-template-columns: minmax(0, 1fr); }
  .feature-lead { position: static; }
}
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .plans { grid-template-columns: minmax(0, 1fr); max-width: 460px; margin-inline: auto; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-side { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(3) { border-inline-start: 0; }
  .kpi:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: 280px; transform: translateX(-100%); transition: transform .25s ease; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  [dir="rtl"] .sidebar { transform: translateX(100%); }
  .nav-open .sidebar { transform: none; }
  .nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(6, 22, 25, .45); z-index: 40; }
  .sidebar-close, .menu-btn { display: inline-grid; }
  .topbar { padding: 0 16px; }
  .content { padding: 20px 16px 40px; }
}
@media (max-width: 720px) {
  .site-nav, .hide-sm { display: none; }
  .site-header-row { gap: 12px; }
  .hero { padding: 40px 0 56px; }
  .hero-sub { font-size: 16.5px; }
  .hero-cta .btn { flex: 1; }
  .feature-list { grid-template-columns: minmax(0, 1fr); }
  .features, .pricing { padding: 64px 0; }
  .grid-2, .grid-3, .role-grid { grid-template-columns: minmax(0, 1fr); }
  .search-trigger span, .search-trigger kbd { display: none; }
  .search-trigger { width: 40px; padding: 0; justify-content: center; }
  .lang-link span { display: none; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .table tr:last-child { border-bottom: 0; }
  .table td { padding: 4px 0; border: 0; }
  .table td[data-label]:not(:first-child)::before { content: attr(data-label); display: inline-block; min-width: 110px; color: var(--muted); font-size: 13px; }
  .row-action { text-align: start; padding-top: 8px !important; }
  .kpi { padding: 14px 16px; }
  .kpi-value { font-size: 26px; }
  .page-title { font-size: 22px; }
  .input-row { flex-direction: column; }
  .toasts { inset-inline: 16px; max-width: none; }
}
.form-layout > :only-child { grid-column: 1 / -1; max-width: 760px; }

/* ===== Phase 2: patients & appointments ===== */
:root { --st-scheduled: #5A7075; --st-confirmed: #2F7FC1; --st-arrived: #B7791F; --st-completed: #1E7A4C; --st-cancelled: #8A9A9D; --st-no_show: #B93C30; }
[data-theme="dark"] { --st-scheduled: #92A9AD; --st-confirmed: #6FB0E8; --st-arrived: #E9B35C; --st-completed: #5ECB92; --st-cancelled: #6B8286; --st-no_show: #EE7D71; }
textarea.input { min-height: 0; resize: vertical; line-height: 1.6; }
.input-sm { min-height: 36px; padding: 6px 10px; font-size: 14px; width: auto; }
.select.input-sm { padding-inline-end: 32px; }
.center { text-align: center; justify-content: center; }
.hint-top { margin: -10px 0 16px; }
.prewrap { white-space: pre-wrap; }
.inline-form { display: inline; margin: 0; }
.dash-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.st { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; padding: 3px 10px; border-radius: 20px; white-space: nowrap; color: var(--st, var(--st-scheduled)); background: color-mix(in srgb, var(--st, var(--st-scheduled)) 12%, transparent); }
.st-scheduled { --st: var(--st-scheduled); } .st-confirmed { --st: var(--st-confirmed); } .st-arrived { --st: var(--st-arrived); }
.st-completed { --st: var(--st-completed); } .st-cancelled { --st: var(--st-cancelled); } .st-no_show { --st: var(--st-no_show); }
.status-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }

.alerts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 12px 14px; margin-bottom: 16px; border-radius: 12px; background: var(--danger-bg); color: var(--danger); }
.alerts.is-compact { padding: 8px 10px; margin: 12px 0 0; }
.alert-chip { font-size: 13px; font-weight: 500; padding: 2px 10px; border-radius: 20px; background: var(--surface); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); }
.alert-dot { display: inline-flex; vertical-align: middle; color: var(--danger); }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; background: var(--amber-bg); color: var(--ink); border: 1px solid color-mix(in srgb, var(--amber) 35%, transparent); margin-bottom: 16px; font-size: 14.5px; }
.notice p { margin: 4px 0 10px; }
.notice.is-muted { background: var(--bg); border-color: var(--line); color: var(--muted); }
.notice.is-warn .i { color: var(--amber); margin-top: 3px; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.search-field { position: relative; flex: 1; min-width: 220px; }
.search-field > .i { position: absolute; inset-inline-start: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-field .input { padding-inline-start: 40px; }
.filters .select { width: auto; min-width: 180px; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); gap: 2px; }
.seg a, .seg label span { display: block; padding: 7px 14px; border-radius: 8px; color: var(--muted); font-size: 14px; font-weight: 500; cursor: pointer; }
.seg a:hover { text-decoration: none; color: var(--ink); }
.seg a.is-on, .seg input:checked + span { background: var(--mint); color: var(--teal); }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; }
.seg input:focus-visible + span { box-shadow: var(--focus); }
.seg-input { align-self: flex-start; }
.chips-input { display: flex; flex-wrap: wrap; gap: 8px; }
.chips-input label { position: relative; cursor: pointer; }
.chips-input input { position: absolute; opacity: 0; }
.chips-input span { display: inline-block; padding: 7px 14px; border-radius: 20px; border: 1px solid var(--line-strong); font-size: 14px; transition: .15s; }
.chips-input input:checked + span { background: var(--mint); border-color: var(--teal); color: var(--teal); font-weight: 500; }
.chips-input input:focus-visible + span { box-shadow: var(--focus); }
.row-link:hover td { background: var(--mint-2); }
a.person { color: var(--ink); }
a.person:hover { text-decoration: none; }
a.person:hover b { color: var(--teal); }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; }
.empty-state { text-align: center; padding: 56px 20px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.empty-state h2 { font-size: 19px; margin-top: 14px; }
.empty-state p { max-width: 420px; margin: 8px auto 0; }
.empty-state .form-actions { margin-top: 20px; }
.empty-icon { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--mint); color: var(--teal); }

.patient-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin: 6px 0 16px; }
.patient-id { display: flex; gap: 16px; align-items: flex-start; }
.patient-id .muted { margin-top: 2px; }
.contact-row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.btn.wa:hover { border-color: #1FA855; color: #1A8F48; }
.patient-actions { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-row div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; display: flex; flex-direction: column; }
.stat-row strong { font-family: var(--font-display); font-size: 24px; font-weight: 600; }
.stat-row span { color: var(--muted); font-size: 13px; }
.appt-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; }
.appt-list a { display: grid; grid-template-columns: 130px 1fr auto; gap: 12px; align-items: center; padding: 11px 8px; border-top: 1px solid var(--line); color: var(--ink); border-radius: 8px; }
.appt-list li:first-child a { border-top: 0; }
.appt-list a:hover { background: var(--mint-2); text-decoration: none; }
.appt-when, .appt-what { display: flex; flex-direction: column; line-height: 1.4; }
.appt-when small, .appt-what small { color: var(--muted); font-size: 12.5px; }
.details { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 14px 0 0; font-size: 14.5px; }
.details dt { color: var(--muted); }
.details dd { margin: 0; }

.queue { list-style: none; margin: 0; padding: 0; }
.queue-item { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.queue-item:first-child { border-top: 0; }
.queue-item.is-cancelled, .queue-item.is-no_show { opacity: .55; }
.queue-item.is-arrived { background: linear-gradient(90deg, color-mix(in srgb, var(--st-arrived) 8%, transparent), transparent); border-radius: 8px; }
.queue-time { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 14px; }
.queue-main { display: flex; flex-direction: column; min-width: 0; color: var(--ink); }
.queue-main:hover { text-decoration: none; color: var(--teal); }
.queue-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-main small { color: var(--muted); font-size: 12.5px; }
.queue-act { min-width: 0; }
.dash-grid.is-staff { grid-template-areas: "setup quick"; }
.dash-grid .today { grid-area: setup; }
.dash-grid:not(.is-staff) { grid-template-areas: "setup activity" "checklist activity"; }
.dash-grid:not(.is-staff) .setup { grid-area: checklist; }

.picked { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.picked > div { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.picked small { color: var(--muted); font-size: 13px; text-align: start; }
.picker { position: relative; }
.picker-list { position: absolute; z-index: 10; inset-inline: 0; top: calc(100% + 6px); list-style: none; margin: 0; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); max-height: 300px; overflow-y: auto; }
.picker-list li { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.picker-list li[aria-selected="true"], .picker-list li:hover { background: var(--mint-2); }
.picker-list li small { color: var(--muted); margin-inline-start: auto; font-size: 12.5px; }
.picker-list li.is-empty { cursor: default; color: var(--muted); }
.mode-pane { margin-top: 14px; }
.time-input { max-width: 220px; }
.free-slots { margin-top: 10px; }
.free-slots .label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.slot-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.slot-chips button { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 8px; padding: 6px 10px; font-size: 13.5px; cursor: pointer; font-variant-numeric: tabular-nums; }
.slot-chips button:hover { border-color: var(--teal); color: var(--teal); }
.slot-chips button.is-on { background: var(--teal); color: #fff; border-color: var(--teal); }
.slot-chips p { color: var(--muted); font-size: 13.5px; }

.appt-card .picked { margin-top: 18px; }
.appt-top { display: flex; gap: 16px; align-items: flex-start; }
.appt-info { flex: 1; }
.appt-info p:last-child { margin-top: 4px; }
.appt-date { width: 64px; flex: none; text-align: center; border-radius: 14px; background: var(--deep); color: #fff; padding: 8px 0 10px; display: flex; flex-direction: column; }
[data-theme="dark"] .appt-date { background: var(--mint); color: var(--teal); }
.appt-date strong { font-family: var(--font-display); font-size: 26px; line-height: 1.1; }
.appt-date span { font-size: 12px; opacity: .8; }
.note-box { margin-top: 16px; padding: 12px 14px; border-radius: 10px; background: var(--bg); font-size: 14.5px; }
.note-box p { margin-top: 4px; }
.appt-card .form-actions { margin-top: 18px; }
.status-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.status-actions .inline-form { display: block; }
.btn.is-danger { color: var(--danger); }
.btn.is-danger:hover { border-color: var(--danger); color: var(--danger); }
.wa-btn-solid { background: #1FA855; color: #fff; }
.wa-btn-solid:hover { background: #188C46; }
.side-panel .hint.center { margin-top: 8px; }

.cal-head { align-items: center; }
.cal-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.day-nav { display: flex; align-items: center; gap: 2px; }
.btn.is-current { border-color: var(--teal); color: var(--teal); }
.cal-filter { display: flex; gap: 8px; }
.cal-hint { margin-bottom: 12px; }
.cal { overflow: hidden; }
.cal-scroll { overflow-x: auto; }
.cal-header, .cal-body { display: grid; grid-template-columns: 72px repeat(var(--cols), minmax(180px, 1fr)); min-width: calc(72px + var(--cols) * 180px); }
.cal-header { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 3; }
.cal-col-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-weight: 600; font-size: 14px; border-inline-start: 1px solid var(--line); min-width: 0; }
.cal-col-head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.cal-col-head small { color: var(--muted); font-weight: 500; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0 8px; }
.cal-body { position: relative; }
.cal-gutter { position: relative; }
.cal-hour { position: absolute; inset-inline-end: 10px; transform: translateY(-50%); font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.cal-hour:first-child { transform: none; margin-top: 4px; }
.cal-col { position: relative; border-inline-start: 1px solid var(--line); }
.cal-slot { position: absolute; inset-inline: 0; border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); display: flex; align-items: center; justify-content: center; color: transparent; }
.cal-slot.is-off { background: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--line) 45%, transparent) 6px 7px); }
a.cal-slot:hover { background: var(--mint-2); color: var(--teal); text-decoration: none; }
.cal-appt { position: absolute; inset-inline: 4px; z-index: 2; display: flex; flex-direction: column; gap: 1px; overflow: hidden; padding: 5px 8px; border-radius: 8px; font-size: 12.5px; line-height: 1.35; color: var(--ink); background: color-mix(in srgb, var(--st) 14%, var(--surface)); border-inline-start: 3px solid var(--st); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.cal-appt:hover { text-decoration: none; filter: brightness(.97); z-index: 4; }
.cal-appt b { font-size: 13px; display: flex; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-appt b .i { color: var(--danger); }
.cal-appt small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-appt.st-cancelled, .cal-appt.st-no_show { opacity: .6; }
.cal-appt.st-cancelled b { text-decoration: line-through; }
.cal-now { position: absolute; inset-inline: 72px 0; height: 2px; background: var(--danger); z-index: 3; pointer-events: none; }
.cal-now::before { content: ""; position: absolute; inset-inline-start: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }

@media (max-width: 1080px) {
  .dash-grid.is-staff { grid-template-areas: "setup" "quick"; }
  .dash-grid:not(.is-staff) { grid-template-areas: "setup" "checklist" "activity"; }
}
@media (max-width: 720px) {
  .queue-item { grid-template-columns: 64px minmax(0, 1fr) auto; }
  .queue-act { grid-column: 2 / -1; }
  .appt-list a { grid-template-columns: 1fr auto; }
  .appt-what { grid-column: 1; grid-row: 2; }
  .stat-row div { padding: 10px 12px; }
  .filters .select { flex: 1; }
  .cal-tools { width: 100%; }
  .cal-filter { flex: 1; }
  .cal-filter .input { flex: 1; }
  .patient-actions .btn { flex: 1; }
}
.cmdk-hint { margin-inline-start: auto; color: var(--muted); font-size: 12.5px; }
.cmdk-list li span { flex: 1; }
[hidden] { display: none !important; }
.cal-col-head span { flex: initial; }
.cal-col-head > span:not(.avatar) { flex: 1; }
.panel > .panel-title + p, .panel > .panel-title + .prewrap { margin-top: 10px; }
@media (max-width: 960px) {
  .sidebar { box-shadow: none; }
  .nav-open .sidebar { box-shadow: 0 0 40px rgba(0,0,0,.3); }
}
.dash-grid:not(.is-staff) { grid-template-rows: auto 1fr; }
@media (max-width: 1080px) { .dash-grid:not(.is-staff) { grid-template-rows: none; } }
