/* Vetlander clinic app: one light design system (matches vetlander.com). */
:root{
  --navy:#032241;--navy-2:#0b3156;--teal:#00a07e;--teal-ink:#007a61;--teal-soft:#e3f8f2;
  --ink:#0d1b2a;--text:#3d4b5c;--muted:#6a7788;--line:#e3e9f1;--line-2:#d3dce8;
  --bg:#f5f8fc;--panel:#ffffff;--hover:#f0f4f9;
  --red:#c03a2b;--red-soft:#fdecea;--amber:#9a5b00;--amber-soft:#fff4e0;--blue:#1f5fbf;--blue-soft:#e9f1ff;
  --radius:10px;--shadow:0 1px 2px rgba(13,27,42,.06),0 1px 1px rgba(13,27,42,.04);
  --pop:0 12px 40px -12px rgba(3,34,65,.35);
  --font:"Inter","Segoe UI",system-ui,-apple-system,"Helvetica Neue",Arial,sans-serif;
  --side:var(--navy);--btn:var(--navy);--btn-2:var(--navy-2);--btn-teal:#007a61;--btn-teal-2:#00684f;--accent-ink:var(--navy);
  --field:#ffffff;--raised:#fafcfe;--top-bg:rgba(245,248,252,.92);--backdrop:rgba(3,34,65,.35);--mark:#c9f2e6;
  --grid-half:#f1f4f8;--today:#fbfefd;--bar-inv:var(--navy);--toast-bg:#0d1b2a;
  color-scheme:light;
}
/* Dark theme: follows the device unless the user picked Light or Dark (html[data-theme]). */
:root[data-theme=dark]{
  --ink:#e8eef6;--text:#c3cfdc;--muted:#8fa0b5;--line:#22324a;--line-2:#30445e;
  --bg:#0c1622;--panel:#121f31;--hover:#1a2a40;--raised:#15233a;--field:#0f1b2b;--top-bg:rgba(12,22,34,.9);
  --teal:#17b994;--teal-ink:#4fd3ae;--teal-soft:#0e3a33;--btn-teal:#0d8a6c;--btn-teal-2:#10a07e;
  --red:#f28b80;--red-soft:#3b1b19;--amber:#f2b35c;--amber-soft:#3a2a10;--blue:#82b2ff;--blue-soft:#13284a;
  --side:#08121d;--btn:#2b6cb0;--btn-2:#3a7cc4;--accent-ink:#e8eef6;--bar-inv:#5d8fd3;
  --backdrop:rgba(0,0,0,.6);--mark:#1d5b4c;--toast-bg:#2b3d55;--grid-half:#17263a;--today:#10243a;
  --shadow:0 1px 2px rgba(0,0,0,.4);--pop:0 12px 40px -12px rgba(0,0,0,.7);
  color-scheme:dark;
}
*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;background:var(--bg);color:var(--text);font:14px/1.5 var(--font);-webkit-font-smoothing:antialiased}
h1,h2,h3,h4{color:var(--ink);margin:0;letter-spacing:-.01em}
h1{font-size:22px;font-weight:700}h2{font-size:16px;font-weight:650}h3{font-size:14px;font-weight:650}
a{color:var(--blue);text-decoration:none}a:hover{text-decoration:underline}
[hidden]{display:none!important}
.muted{color:var(--muted)}.small{font-size:12.5px}.nowrap{white-space:nowrap}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}

/* ---------- buttons & inputs ---------- */
.btn{display:inline-flex;align-items:center;gap:6px;height:34px;padding:0 14px;border-radius:8px;border:1px solid var(--line-2);
  background:var(--panel);color:var(--ink);font:600 13.5px var(--font);cursor:pointer;white-space:nowrap}
.btn:hover{background:var(--hover);text-decoration:none}
.btn:disabled{opacity:.5;cursor:not-allowed}
.btn.primary{background:var(--btn);border-color:var(--btn);color:#fff}.btn.primary:hover{background:var(--btn-2)}
.btn.teal{background:var(--teal);border-color:var(--teal);color:#fff}.btn.teal:hover{background:var(--btn-teal-2)}
.btn.ghost{border-color:transparent;background:none}.btn.ghost:hover{background:var(--hover)}
.btn.danger{color:var(--red)}
.btn.sm{height:28px;padding:0 10px;font-size:12.5px}
.btn svg{width:16px;height:16px}
input,select,textarea{font:14px var(--font);color:var(--ink);background:var(--field);border:1px solid var(--line-2);border-radius:8px;padding:7px 10px;width:100%}
textarea{resize:vertical;min-height:72px;line-height:1.45}
input:focus,select:focus,textarea:focus,.btn:focus-visible{outline:2px solid rgba(0,160,126,.35);outline-offset:1px;border-color:var(--teal)}
label.field{display:flex;flex-direction:column;gap:4px;font-size:12.5px;font-weight:600;color:var(--text)}
label.check{display:flex;gap:8px;align-items:flex-start;font-size:13.5px}label.check input{width:auto;margin-top:3px}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:12px}.grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
.row{display:flex;gap:8px;align-items:center}.row.end{justify-content:flex-end}.row.between{justify-content:space-between}.wrap{flex-wrap:wrap}
.stack{display:flex;flex-direction:column;gap:12px}

/* ---------- shell ---------- */
.shell{display:grid;grid-template-columns:232px 1fr;min-height:100vh}
.side{background:var(--side);color:#c9d6e6;display:flex;flex-direction:column;position:sticky;top:0;height:100vh}
.brand{display:flex;align-items:center;gap:10px;padding:18px 18px 6px;color:#fff;font-weight:750;font-size:18px;letter-spacing:-.02em}
.brand img{width:30px;height:30px}
.clinic-name{padding:0 18px 16px 58px;font-size:12.5px;color:#9fb3cb;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.nav{display:flex;flex-direction:column;gap:2px;padding:6px 10px;flex:1}
.nav a{display:flex;align-items:center;gap:11px;padding:9px 10px;border-radius:8px;color:#c9d6e6;font-weight:550;font-size:14px}
.nav a svg{width:18px;height:18px;opacity:.85}
.nav a:hover{background:rgba(255,255,255,.07);text-decoration:none;color:#fff}
.nav a.on{background:rgba(0,160,126,.18);color:#fff}.nav a.on svg{opacity:1;color:#43d1ae}
.side-foot{border-top:1px solid rgba(255,255,255,.08);padding:12px 18px;font-size:12.5px}
.side-foot b{display:block;color:#fff;font-weight:600}
.side-foot .links{display:flex;gap:14px;margin-top:8px}.side-foot a{color:#9fb3cb}.side-foot a:hover{color:#fff}
.main{min-width:0;display:flex;flex-direction:column}
.top{position:sticky;top:0;z-index:5;background:var(--top-bg);backdrop-filter:blur(6px);border-bottom:1px solid var(--line);
  display:flex;align-items:center;gap:12px;padding:10px 24px}
.search-btn{flex:1;max-width:520px;display:flex;align-items:center;gap:8px;height:36px;padding:0 12px;border:1px solid var(--line-2);border-radius:8px;
  background:var(--panel);color:var(--muted);font:14px var(--font);cursor:text;text-align:start}
.search-btn svg{width:16px;height:16px}.search-btn kbd{margin-inline-start:auto}
kbd{font:11px var(--font);border:1px solid var(--line-2);border-bottom-width:2px;border-radius:5px;padding:1px 5px;color:var(--muted);background:var(--panel)}
.top .spacer{flex:1}
.chip{display:inline-flex;align-items:center;gap:6px;height:24px;padding:0 9px;border-radius:999px;font-size:12px;font-weight:600;background:var(--hover);color:var(--text)}
.chip.teal{background:var(--teal-soft);color:var(--teal-ink)}.chip.amber{background:var(--amber-soft);color:var(--amber)}
.chip.red{background:var(--red-soft);color:var(--red)}.chip.blue{background:var(--blue-soft);color:var(--blue)}
a.chip:hover{text-decoration:none;filter:brightness(.97)}
.content{padding:24px;max-width:1240px;width:100%}
.page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin-bottom:18px}
.page-head p{margin:4px 0 0;color:var(--muted)}
.banner{display:flex;gap:12px;align-items:center;justify-content:space-between;padding:10px 14px;border-radius:var(--radius);margin-bottom:16px;
  background:var(--amber-soft);color:var(--amber);font-weight:550}
.banner.red{background:var(--red-soft);color:var(--red)}

/* ---------- cards, lists, tables ---------- */
.card{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow)}
.card-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:14px 16px;border-bottom:1px solid var(--line)}
.card-head .count{color:var(--muted);font-weight:500;margin-inline-start:6px}
.card-body{padding:16px}
.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(340px,1fr));gap:16px;align-items:start}
.list{list-style:none;margin:0;padding:0}
.list>li{display:flex;align-items:center;gap:12px;padding:11px 16px;border-bottom:1px solid var(--line)}
.list>li:last-child{border-bottom:0}
.list>li.link{cursor:pointer}.list>li.link:hover{background:var(--hover)}
.list .grow{flex:1;min-width:0}.list .title{color:var(--ink);font-weight:600}.list .sub{color:var(--muted);font-size:12.5px}
.time{font-variant-numeric:tabular-nums;color:var(--ink);font-weight:650;width:52px;flex:none}
.empty{padding:28px 16px;text-align:center;color:var(--muted)}
.empty b{display:block;color:var(--ink);margin-bottom:4px}
table.t{width:100%;border-collapse:collapse}
.t th{text-align:start;font-size:12px;font-weight:600;color:var(--muted);padding:9px 16px;border-bottom:1px solid var(--line);background:var(--raised)}
.t td{padding:11px 16px;border-bottom:1px solid var(--line);color:var(--ink);vertical-align:middle}
.t tr:last-child td{border-bottom:0}
.t tr.link{cursor:pointer}.t tr.link:hover td{background:var(--hover)}
.t td.sub{color:var(--muted)}
.avatar{width:34px;height:34px;border-radius:50%;flex:none;display:grid;place-items:center;font-weight:700;font-size:13px;
  background:var(--teal-soft);color:var(--teal-ink)}
.avatar.lg{width:56px;height:56px;font-size:20px}
.seg{display:inline-flex;background:var(--hover);border-radius:8px;padding:3px}
.seg button{border:0;background:none;padding:5px 14px;border-radius:6px;font:600 13px var(--font);color:var(--muted);cursor:pointer}
.seg button.on{background:var(--panel);color:var(--ink);box-shadow:var(--shadow)}
.toolbar{display:flex;gap:10px;align-items:center;padding:12px 16px;border-bottom:1px solid var(--line)}
.toolbar input[type=search]{max-width:340px}

/* ---------- record (patient / owner) ---------- */
.rec-head{display:flex;gap:16px;align-items:center;padding:18px 20px}
.rec-head .facts{display:flex;flex-wrap:wrap;gap:6px 16px;color:var(--muted);margin-top:4px}
.rec-head .facts b{color:var(--ink);font-weight:600}
.alerts{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}
.tabs{display:flex;gap:2px;padding:0 12px;border-top:1px solid var(--line);overflow-x:auto}
.tabs a{padding:11px 12px;color:var(--muted);font-weight:600;border-bottom:2px solid transparent;white-space:nowrap}
.tabs a:hover{color:var(--ink);text-decoration:none}.tabs a.on{color:var(--ink);border-bottom-color:var(--teal)}
.split{display:grid;grid-template-columns:1fr 340px;gap:16px;align-items:start}
.kv{display:grid;grid-template-columns:120px 1fr;gap:6px 12px;font-size:13.5px}.kv dt{color:var(--muted)}.kv dd{margin:0;color:var(--ink)}
.note{border:1px solid var(--line);border-radius:var(--radius);background:var(--panel)}
.note pre{white-space:pre-wrap;font:13.5px/1.55 var(--font);margin:0;padding:14px 16px;color:var(--ink)}
.soap{display:grid;gap:12px}
.soap label.field span{display:flex;justify-content:space-between}
.photos{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px;padding:16px}
.photos figure{margin:0;border:1px solid var(--line);border-radius:8px;overflow:hidden;background:var(--raised)}
.photos img{width:100%;height:120px;object-fit:cover;display:block}.photos figcaption{padding:6px 8px;font-size:12px;color:var(--muted)}

/* ---------- dialogs, palette, toasts ---------- */
dialog{border:0;border-radius:14px;padding:0;box-shadow:var(--pop);width:min(560px,94vw);color:var(--text)}
dialog::backdrop{background:var(--backdrop)}
dialog .d-head{display:flex;justify-content:space-between;align-items:center;padding:16px 20px;border-bottom:1px solid var(--line)}
dialog .d-body{padding:18px 20px;display:flex;flex-direction:column;gap:12px;max-height:70vh;overflow:auto}
dialog .d-foot{display:flex;justify-content:flex-end;gap:8px;padding:14px 20px;border-top:1px solid var(--line);background:var(--raised);border-radius:0 0 14px 14px}
dialog .err{color:var(--red);font-size:13px;min-height:1em}
dialog.palette{width:min(620px,94vw);margin-top:12vh}
.palette input{border:0;border-bottom:1px solid var(--line);border-radius:14px 14px 0 0;padding:16px 18px;font-size:16px}
.palette input:focus{outline:none}
.palette ul{list-style:none;margin:0;padding:6px;max-height:380px;overflow:auto}
.palette li{display:flex;gap:10px;align-items:center;padding:9px 12px;border-radius:8px;cursor:pointer}
.palette li.sel{background:var(--hover)}.palette li .sub{color:var(--muted);font-size:12.5px;margin-inline-start:auto}
.palette .group{padding:8px 12px 4px;font-size:11.5px;font-weight:650;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;cursor:default}
.toast{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);background:var(--toast-bg);color:#fff;padding:10px 16px;border-radius:8px;
  box-shadow:var(--pop);font-weight:550;z-index:50}
.toast.bad{background:var(--red)}
.menu{position:relative}.menu .pop{position:absolute;inset-inline-end:0;top:40px;background:var(--panel);border:1px solid var(--line);border-radius:10px;box-shadow:var(--pop);
  padding:6px;min-width:200px;z-index:20}
.menu .pop button{display:flex;width:100%;gap:8px;align-items:center;border:0;background:none;padding:8px 10px;border-radius:6px;font:550 13.5px var(--font);color:var(--ink);cursor:pointer;text-align:start}
.menu .pop button:hover{background:var(--hover)}

/* ---------- sign in ---------- */
.auth{min-height:100vh;display:grid;place-items:center;padding:24px;background:linear-gradient(180deg,var(--panel), var(--bg))}
.auth .box{width:min(400px,100%)}
.auth .brand{color:var(--accent-ink);justify-content:center;padding:0 0 20px;font-size:24px}
.auth .card{padding:24px}
.auth h1{font-size:19px;margin-bottom:4px}
.auth form{display:flex;flex-direction:column;gap:12px;margin-top:16px}
.auth .err{color:var(--red);font-size:13px}
.auth .foot{text-align:center;margin-top:16px;color:var(--muted);font-size:13px}

@media (max-width:900px){
  .shell{grid-template-columns:1fr}.side{position:static;height:auto}.nav{flex-direction:row;overflow-x:auto}.side-foot,.clinic-name{display:none}
  .split{grid-template-columns:1fr}.grid2,.grid3{grid-template-columns:1fr}.content{padding:16px}.top{padding:10px 16px}
}
.row.center{justify-content:center;margin-top:12px}
.spacer16{height:16px}
.banners:empty{display:none}.banners{padding-bottom:0}
.shell{background:linear-gradient(to right,var(--side) 232px,var(--bg) 232px)}
@media (min-width:901px){[dir="rtl"] .shell{background:linear-gradient(to left,var(--side) 232px,var(--bg) 232px)}}   /* the sidebar is on the right */
.grow{flex:1;min-width:0}
.kv dd{white-space:pre-line}
.time{width:64px;white-space:nowrap}
.brand img{border-radius:7px}
@media (max-width:900px){.shell{background:var(--bg)}}
.palette li svg{width:18px;height:18px;flex:none;color:var(--muted)}
/* ---------- Copilot ---------- */
.theme-btn{padding:0;width:36px;justify-content:center}.theme-btn svg{width:17px;height:17px}
.copilot-btn{gap:7px}.copilot-btn img{width:18px;height:18px;border-radius:4px}
.copilot{position:fixed;top:0;inset-inline-end:0;bottom:0;width:390px;max-width:100vw;background:var(--panel);border-inline-start:1px solid var(--line);box-shadow:var(--pop);
  z-index:30;display:flex;flex-direction:column}
body.copilot-open .main{margin-inline-end:390px}
.cp-head{display:flex;justify-content:space-between;align-items:center;padding:14px 16px;border-bottom:1px solid var(--line);color:var(--accent-ink);font-size:15px}
.cp-tabs{margin:12px 16px 0;align-self:flex-start}
.cp-body{flex:1;overflow:auto;padding:14px 16px;display:flex;flex-direction:column;gap:12px}
.cp-body .empty{padding:24px 6px}
.cp-foot{margin:0;padding:10px 16px;border-top:1px solid var(--line);font-size:12px;color:var(--muted);background:var(--raised)}
.cp-note{margin:0;color:var(--text);font-size:13px}.cp-ok{margin:0;color:var(--teal-ink);font-weight:600;font-size:13px}
.cp-warn{background:var(--amber-soft);color:var(--amber);border-radius:8px;padding:10px 12px;font-size:13px}.cp-warn p{margin:6px 0 0}
.cp-chat{overflow:hidden;padding-bottom:10px}
.cp-log{flex:1;overflow:auto;display:flex;flex-direction:column;gap:10px;padding-inline-end:2px}
.cp-msg{max-width:92%;padding:9px 12px;border-radius:12px;font-size:13.5px;line-height:1.45;white-space:pre-line}
.cp-msg.cp{background:var(--bg);border:1px solid var(--line);color:var(--ink);align-self:flex-start;border-bottom-left-radius:4px}
.cp-msg.me{background:var(--btn);color:#fff;align-self:flex-end;border-bottom-right-radius:4px}
.cp-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.cp-chips{display:flex;flex-wrap:wrap;gap:6px}
.chip-btn{border:1px solid var(--line-2);background:var(--panel);color:var(--ink);border-radius:999px;padding:5px 11px;font:550 12.5px var(--font);cursor:pointer}
.chip-btn:hover{background:var(--teal-soft);border-color:var(--teal);color:var(--teal-ink)}
.cp-input input{flex:1;min-width:0}
.cp-facts{display:flex;flex-direction:column;gap:4px;font-size:13.5px;background:var(--bg);border:1px solid var(--line);border-radius:8px;padding:10px 12px}
.cp-facts .chip{margin-inline-start:6px}
.cp-result{border:1px solid var(--teal);background:var(--teal-soft);border-radius:10px;padding:12px 14px}.cp-result .big{font-size:24px;font-weight:750;color:var(--ink)}
.tpl-row{align-items:center}
.cp-hit{border:1px solid var(--line);border-radius:8px;padding:10px 12px}.cp-hit a{font-weight:600}
.cp-excerpt{margin:6px 0 0;font-size:13px;white-space:pre-line;color:var(--ink)}
mark{background:var(--mark);color:inherit;border-radius:3px;padding:0 2px}
textarea.filled{background:var(--teal-soft);transition:background .4s}
/* ---------- labs & imaging ---------- */
.lab{padding:14px 16px;border-bottom:1px solid var(--line);display:flex;flex-direction:column;gap:8px}.lab:last-child{border-bottom:0}
.lab .title{color:var(--ink);font-weight:600}.lab .sub{color:var(--muted);font-size:12.5px}.lab p{margin:0}
.lab table.t{border:1px solid var(--line);border-radius:8px;overflow:hidden}
.lab tr.replaced td{color:var(--muted)}.lab tr.replaced b{font-weight:500;text-decoration:line-through}
ul.plain{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}
.photos.tight{padding:0;grid-template-columns:repeat(auto-fill,minmax(130px,1fr))}
@media (max-width:1200px){body.copilot-open .main{margin-inline-end:0}}
.search-btn{min-width:200px}.search-btn .ph{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
@media (max-width:1300px){body.copilot-open .search-btn kbd{display:none}}

/* ---------- calendar ---------- */
.cal-bar{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;padding:12px 16px;border-bottom:1px solid var(--line)}
.cal-title{font-size:15px;margin-inline-start:6px}
.date-pick{width:auto;height:30px;padding:3px 8px;font-size:13px}
.cal-wrap{max-height:calc(100vh - 230px);overflow:auto;position:relative}
.cal{display:grid;grid-template-rows:auto 1fr;min-width:calc(56px + var(--cols) * 150px)}
.cal-head,.cal-body{display:grid;grid-template-columns:56px repeat(var(--cols),minmax(150px,1fr))}
.cal-head{position:sticky;top:0;z-index:3;background:var(--raised);border-bottom:1px solid var(--line)}
.cal-col-head{padding:9px 10px;font-weight:650;color:var(--ink);font-size:13px;border-inline-start:1px solid var(--line);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cal-col-head.today{color:var(--teal-ink)}
.cal-gutter{border-inline-end:1px solid var(--line)}
.cal-hour{height:var(--hour);font-size:11px;color:var(--muted);text-align:end;padding-block:2px 0;padding-inline:0 8px;transform:translateY(-7px)}
.cal-hour:first-child{transform:none}
.cal-col{position:relative;border-inline-start:1px solid var(--line);cursor:copy;
  background-image:linear-gradient(to bottom,var(--line) 1px,transparent 1px),linear-gradient(to bottom,var(--grid-half) 1px,transparent 1px);
  background-size:100% var(--hour),100% calc(var(--hour) / 2);background-position:0 0,0 calc(var(--hour) / 2)}
.cal-col.today{background-color:var(--today)}
.appt{position:absolute;display:flex;flex-direction:column;align-items:flex-start;gap:0;overflow:hidden;text-align:start;cursor:pointer;
  border:0;border-inline-start:3px solid var(--blue);border-radius:6px;background:var(--blue-soft);color:var(--ink);padding:3px 7px;font:12px/1.3 var(--font);box-shadow:var(--shadow)}
.appt:hover{filter:brightness(.97);z-index:2}
/* money due for this booking (deposit or booking fee) */
.appt.owes::after{content:'$';position:absolute;top:3px;inset-inline-end:5px;width:15px;height:15px;border-radius:50%;background:var(--amber);color:#fff;font:700 10px/15px var(--font);text-align:center}
.appt.owes .appt-name,.appt.owes .appt-time{padding-inline-end:14px}
.appt-time{font-weight:650;font-size:11px;color:var(--text)}
.appt-name{font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.appt-reason{color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.appt.st-arrived{border-inline-start-color:var(--teal);background:var(--teal-soft)}
.appt.st-completed{border-inline-start-color:var(--muted);background:var(--hover);color:var(--muted)}
.appt.st-no_show{border-inline-start-color:var(--amber);background:var(--amber-soft)}
.appt.st-cancelled{border-inline-start-color:var(--line-2);background:var(--panel);color:var(--muted);text-decoration:line-through}
.now-line{position:absolute;inset-inline-start:0;inset-inline-end:0;height:2px;background:var(--red);z-index:2;pointer-events:none}
.now-line::before{content:'';position:absolute;inset-inline-start:-4px;top:-3px;width:8px;height:8px;border-radius:50%;background:var(--red)}
.cal-hint{padding:8px 16px;margin:0;border-top:1px solid var(--line)}
.stepper{display:flex;list-style:none;margin:4px 0 0;padding:0;gap:4px;counter-reset:s}
.stepper li{flex:1;font-size:11.5px;font-weight:600;color:var(--muted);padding-top:8px;border-top:3px solid var(--line);counter-increment:s}
.stepper li.on{color:var(--teal-ink);border-top-color:var(--teal)}
.appt-dialog .d-foot{justify-content:flex-start}
.appt.short{justify-content:center}.appt.short .appt-time{margin-inline-end:4px}

/* ---------- billing ---------- */
.tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px;margin-bottom:16px}
.tile{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);padding:14px 16px;box-shadow:var(--shadow)}
.tile-value{font-size:22px;font-weight:700;color:var(--ink);margin-top:2px;font-variant-numeric:tabular-nums}
.tile.warn .tile-value{color:var(--amber)}
select.auto{width:auto}
.t th.num,.t td.num{text-align:end;font-variant-numeric:tabular-nums;white-space:nowrap}
.t td.due,.totals .due{color:var(--red);font-weight:650}
.doc-head{display:flex;justify-content:space-between;gap:24px;flex-wrap:wrap;padding:20px;border-bottom:1px solid var(--line)}
.doc-head h1{margin:2px 0 6px}
.doc-head .kv{grid-template-columns:70px 1fr;min-width:260px}
.totals{display:flex;justify-content:flex-end;padding:14px 16px;border-top:1px solid var(--line)}
.totals dl{display:grid;grid-template-columns:auto 120px;gap:4px 24px;margin:0;font-variant-numeric:tabular-nums}
.totals dt{color:var(--muted);text-align:end}.totals dd{margin:0;text-align:end;color:var(--ink)}
.totals .big{font-weight:700;color:var(--ink);font-size:15px}
.t.lines td{padding:7px 10px}.t.lines input{padding:5px 8px}
.num-in{width:90px;text-align:end}.num-in.bad{border-color:var(--red)}.num-in.sm{width:64px}
.add-bar input{max-width:360px}
/* Boarding: kennels down the side, days across */
.bd-wrap{overflow-x:auto}
.bd-grid{border-collapse:separate;border-spacing:0;width:100%;min-width:900px;table-layout:fixed}
.bd-grid th,.bd-grid td{border-bottom:1px solid var(--line);border-inline-end:1px solid var(--line);padding:4px;height:44px;font-size:12.5px}
.bd-grid thead th{font-weight:600;color:var(--muted);text-align:center;background:var(--raised)}.bd-grid thead th.bd-today{color:var(--teal-ink)}
.bd-grid th.bd-k{width:150px;text-align:start;padding:6px 10px;background:var(--panel);position:sticky;inset-inline-start:0;z-index:1}
.bd-k small{display:block;color:var(--muted);font-weight:400}
.bd-free{cursor:pointer}.bd-free:hover{background:var(--hover)}td.bd-today{background:var(--today)}
.bd-stay{display:block;width:100%;height:34px;border:0;border-radius:8px;padding:0 10px;text-align:start;font:inherit;font-weight:600;cursor:pointer;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;background:var(--teal-soft);color:var(--teal-ink)}
.bd-stay.reserved{background:var(--blue-soft);color:var(--blue)}.bd-stay.late{background:var(--red-soft);color:var(--red)}
/* Dental chart: a tooth map, the patient's right on the left */
.tooth-map{overflow-x:auto;padding-bottom:4px}.tooth-row{display:flex;gap:3px;justify-content:center;min-width:max-content;margin:4px 0}
.tooth-sides{display:flex;justify-content:space-between;max-width:1010px;margin:0 auto}
.tooth{width:42px;height:52px;flex:none;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;border:1px solid var(--line-2);border-radius:8px;background:var(--panel);color:var(--text);font:inherit;padding:0}
button.tooth{cursor:pointer}button.tooth:hover{border-color:var(--teal)}
.tooth b{font-size:11.5px;font-weight:650}.tooth span{font-size:10px;line-height:1;min-height:10px;max-width:40px;overflow:hidden;white-space:nowrap}
.tooth.finding,.tooth-key.finding{background:var(--amber-soft);border-color:var(--amber);color:var(--amber)}
.tooth.done,.tooth-key.done{background:var(--teal-soft);border-color:var(--teal);color:var(--teal-ink)}
.tooth.both{background:linear-gradient(135deg,var(--amber-soft) 50%,var(--teal-soft) 50%);border-color:var(--amber);color:var(--ink)}
.tooth.absent,.tooth-key.absent{background:var(--hover);border-style:dashed;color:var(--muted)}.tooth.absent b{text-decoration:line-through}
.tooth.noted{border-color:var(--blue)}
.tooth-mid{width:14px;flex:none;border-inline-start:2px solid var(--line-2);margin-inline-start:8px}
.tooth-key{display:inline-block;width:14px;height:14px;border:1px solid var(--line-2);border-radius:4px;margin-inline-start:10px}.tooth-key:first-child{margin-inline-start:0}
.tooth-set{border:1px solid var(--line);border-radius:10px;padding:8px 12px;display:grid;grid-template-columns:1fr 1fr;gap:4px 12px}.tooth-set legend{font-weight:600;font-size:12.5px;padding:0 4px}
/* Whiteboard */
.wb-card.wb-late{border-color:var(--red)}.wb-overdue .title{color:var(--red)}
.tile-value.warn{color:var(--amber)}
/* Prescription label: about the size of a dispensing label, always black on white. */
.rx-dialog{max-width:440px}.gap-l{margin-inline-start:8px}
.rx-label{width:3.6in;max-width:100%;margin:0 auto;padding:12px 14px;background:#fff;color:#111;border:1px solid #c9d2dc;border-radius:6px;font-size:12px;line-height:1.35}
.rx-clinic{font-weight:700;font-size:13.5px}.rx-small{font-size:11px;color:#333}.rx-rule{border-top:1px solid #111;margin:6px 0}
.rx-two{display:flex;justify-content:space-between;gap:10px}.rx-pet{font-weight:600;margin-top:4px}
.rx-drug{font-weight:700;font-size:14px;margin-top:4px}.rx-directions{font-size:13px;font-weight:600;margin:6px 0;white-space:pre-wrap}
.rx-foot{font-size:10px;color:#333;border-top:1px solid #999;margin-top:6px;padding-top:4px}
@media print{
  .side,.top,.no-print,.banners,.toast,.copilot-drawer{display:none!important}
  .shell{display:block;background:#fff}.content{padding:0;max-width:none}
  .card{box-shadow:none;border:0}body{background:#fff}
  /* Printing a label: only the label, at the top-left of the page. */
  body.printing-label .shell{display:none!important}
  body.printing-label dialog.rx-dialog{position:static;border:0;box-shadow:none;padding:0;margin:0;max-width:none;width:auto;background:#fff}
  body.printing-label dialog.rx-dialog::backdrop{display:none}
  body.printing-label .rx-dialog .d-body{padding:0}body.printing-label .rx-label{margin:0;border:0;border-radius:0}
}

/* ---------- inventory, reports, settings ---------- */
.pos{color:var(--teal-ink)}.neg{color:var(--red)}
.tiles.pad{padding:16px;margin:0;border-bottom:1px solid var(--line)}
.toolbar.wrap{flex-wrap:wrap}
.legend{display:flex;gap:8px;align-items:center;font-size:12.5px;color:var(--muted);margin-bottom:10px}
.legend .key{width:12px;height:12px;border-radius:3px;display:inline-block;margin-inline-start:10px}.legend .key:first-child{margin-inline-start:0}
.key.inv,.bar.inv{background:var(--bar-inv)}.key.col,.bar.col{background:var(--teal)}
.bars{display:flex;align-items:flex-end;gap:6px;height:200px;padding-bottom:22px;overflow-x:auto}
.bar-col{flex:1;min-width:22px;height:100%;display:flex;flex-direction:column;justify-content:flex-end;position:relative}
.bar-pair{display:flex;align-items:flex-end;gap:2px;height:100%}
.bar{flex:1;border-radius:3px 3px 0 0;min-height:1px}
.bar-label{position:absolute;bottom:-20px;inset-inline-start:0;inset-inline-end:0;text-align:center;font-size:10.5px;color:var(--muted);white-space:nowrap}
.settings{display:grid;grid-template-columns:200px 1fr;gap:20px;align-items:start}
.subnav{display:flex;flex-direction:column;gap:2px;position:sticky;top:76px}
.subnav a{padding:8px 12px;border-radius:8px;color:var(--text);font-weight:550}
.subnav a:hover{background:var(--hover);text-decoration:none}.subnav a.on{background:var(--panel);color:var(--ink);box-shadow:var(--shadow);border:1px solid var(--line)}
.kv.wide{grid-template-columns:140px 1fr}
.sm-select{height:28px;padding:2px 6px;font-size:12.5px}
.muted-row .title{color:var(--muted)}
.settings-import .imp{border:0;margin:0;padding:0}
.settings-import .imp h3{font-size:16px}
.settings-import button{height:34px;padding:0 14px;border-radius:8px;border:1px solid var(--line-2);background:var(--panel);color:var(--ink);font:600 13.5px var(--font);cursor:pointer}
.settings-import button:disabled{opacity:.5}
.settings-import .smallprint{color:var(--muted);font-size:13px}
.settings-import table{width:100%;border-collapse:collapse;font-size:13px}.settings-import th,.settings-import td{border-bottom:1px solid var(--line);padding:6px 8px;text-align:start}
@media (max-width:900px){.settings{grid-template-columns:1fr}.subnav{flex-direction:row;overflow-x:auto;position:static}}
.settings-import .imp-bad{color:var(--red)}
.settings-import .imp-confirm{background:var(--teal-soft);border:1px solid var(--teal);color:var(--ink)}

/* ---------- tablet portrait & phone ---------- */
@media (max-width:900px){
  .side{flex-direction:row;align-items:center;gap:4px;padding:0 6px}
  .brand{padding:10px 8px;font-size:16px}.brand img{width:26px;height:26px}
  .nav{padding:6px 4px;gap:2px;scrollbar-width:none}.nav::-webkit-scrollbar{display:none}
  .nav a{white-space:nowrap;padding:7px 10px;font-size:13px;gap:7px}.nav a svg{width:16px;height:16px}
  .top{flex-wrap:wrap;gap:8px}
  .search-btn{min-width:0;flex:1 1 220px}
  .card{overflow-x:auto}
  .rec-head{flex-wrap:wrap}
  .page-head{flex-wrap:wrap;align-items:center}
  .cal{min-width:calc(56px + var(--cols) * 120px)}
}
@media (max-width:640px){
  .brand span,.brand{font-size:0}.brand img{width:28px;height:28px}
  .search-btn kbd,.top #planChip{display:none}
  .content{padding:12px}
  .tiles{grid-template-columns:1fr 1fr}
  .tile-value{font-size:18px}
  .cards{grid-template-columns:1fr}
  .doc-head{padding:14px}.doc-head .kv{min-width:0}
  .t th,.t td{padding:9px 10px}
  dialog{width:100vw;max-width:100vw;margin:auto 0 0;border-radius:14px 14px 0 0}
  dialog .d-body{max-height:62vh}
  .copilot-btn-label{display:none}
}
.btn.teal{background:var(--btn-teal);border-color:var(--btn-teal)}.btn.teal:hover{background:var(--btn-teal-2)}
.skip{position:absolute;inset-inline-start:8px;top:-60px;z-index:100;background:var(--panel);color:var(--ink);padding:8px 14px;border-radius:8px;box-shadow:var(--pop);font-weight:650}
.skip:focus{top:8px}
main:focus{outline:none}
@media (max-width:900px){
  .shell{grid-template-columns:minmax(0,1fr)}
  .side{min-width:0;max-width:100vw;overflow:hidden}
  .nav{min-width:0;flex:1 1 auto;overflow-x:auto}
  .main{min-width:0;max-width:100vw}
  .split{grid-template-columns:minmax(0,1fr)}
  .list>li{flex-wrap:wrap}
}
@media (max-width:900px){.settings{grid-template-columns:minmax(0,1fr)}.settings>.stack{min-width:0}}
.settings{grid-template-columns:200px minmax(0,1fr)}
.rec-head .row{flex-wrap:wrap}
@media (max-width:900px){.settings{grid-template-columns:minmax(0,1fr)}}
.settings>.stack{min-width:0}.settings .card{overflow-x:auto}
.closed-note{max-width:520px;margin:80px auto;padding:0 20px}.closed-note h1{margin-bottom:12px}
.pre{white-space:pre-wrap;margin:0}

/* Authenticator setup QR code: always dark-on-white so phone cameras can read it in dark mode. */
.qr-setup{display:flex;justify-content:center;margin:10px 0}
.qr-setup svg{background:#fff;padding:8px;border-radius:10px;width:200px;height:200px;max-width:100%}

/* ---------- Languages and right-to-left (Arabic) ----------
   Layout uses logical properties (margin-inline-start, inset-inline-end, text-align:start…), so
   dir="rtl" on <html> mirrors it. Only arrows that point "back/forward" are flipped; clocks,
   checkmarks and charts are not. */
[dir="rtl"] .ic-back{transform:scaleX(-1)}
/* Mixed Arabic and English: each field or line takes its direction from its own first letter,
   so an English name, email or drug name in an Arabic screen still reads left to right. */
[dir="rtl"] :is(input,textarea,.title,.sub,td,pre,.note){unicode-bidi:plaintext}
/* Numbers that must never be reordered: amounts, phone numbers, codes, times. */
[dir="rtl"] :is(.num,.t td.num,.money,kbd,code,input[type=tel],input[type=email],input[type=number],input[inputmode=numeric]){direction:ltr;unicode-bidi:isolate}
[dir="rtl"] :is(input[type=tel],input[type=email],input[type=number],input[inputmode=numeric]){text-align:end}
/* Arabic: system fonts with good Arabic shapes (no web font to download). Every element uses var(--font). */
:root:lang(ar){--font:"Segoe UI","Noto Sans Arabic","Noto Naskh Arabic","Geeza Pro","Arabic UI Text",Tahoma,system-ui,sans-serif}
:lang(ar) :is(h1,h2,h3,b,.btn){letter-spacing:0}
.lang-select{min-width:180px;max-width:100%}
