/* GetUcare admin — base styles: a frozen copy of the clinic portal styles (app/app.css), so the admin folder is self-contained and looks the same. */
:root {
  --brand: #0CA2C0;
  --blue: #0A7A96;
  --blue-d: #086A83;
  --ink: #0C243C;
  --ink-2: #3B4A58;
  --muted: #5B6A77;
  --line: #E4E8EC;
  --line-2: #EEF1F4;
  --bg: #F3F5F6;
  --card: #FFFFFF;
  --tint: #E5F4F7;
  --r: 16px;
  --r-sm: 10px;
  --font: "Inter Tight", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --shadow-pop: 0 1px 2px rgba(12,36,60,.05), 0 12px 32px -8px rgba(12,36,60,.18);

  /* status */
  --s-new-fg: #4A5A6A;   --s-new-bg: #EEF1F4;   --s-new-dot: #8794A1;
  --s-conf-fg: #0A6F88;  --s-conf-bg: #E5F4F7;  --s-conf-dot: #0CA2C0;
  --s-prog-fg: #8A5300;  --s-prog-bg: #FFF2D9;  --s-prog-dot: #E39B00;
  --s-done-fg: #1B7A43;  --s-done-bg: #E3F6EA;  --s-done-dot: #2E9E5B;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; color: var(--ink); background: var(--bg); line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
input, select, textarea { font: inherit; color: inherit; }
svg { flex-shrink: 0; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); font-size: .86em; letter-spacing: .01em; }
.muted { color: var(--muted); }

/* ===== Buttons ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px; font-size: 14px; font-weight: 500; white-space: nowrap; border: 1px solid transparent; transition: background .15s, border-color .15s, color .15s; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-d); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #163552; }
.btn-line { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-line:hover { border-color: #CBD3DA; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; }
.btn-block { width: 100%; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: var(--ink-2); transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--bg); color: var(--ink); }

/* ===== Status badge & progress ===== */
.st { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px 0 8px; border-radius: 999px; font-size: 12.5px; font-weight: 500; white-space: nowrap; background: var(--s-new-bg); color: var(--s-new-fg); }
.st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--s-new-dot); }
.st-confirmed { background: var(--s-conf-bg); color: var(--s-conf-fg); } .st-confirmed::before { background: var(--s-conf-dot); }
.st-progress { background: var(--s-prog-bg); color: var(--s-prog-fg); } .st-progress::before { background: var(--s-prog-dot); }
.st-completed { background: var(--s-done-bg); color: var(--s-done-fg); } .st-completed::before { background: var(--s-done-dot); }
.steps { display: inline-flex; gap: 3px; }
.steps i { width: 14px; height: 4px; border-radius: 2px; background: #DCE2E7; }
.steps i.on { background: var(--brand); }
.steps.done i.on { background: var(--s-done-dot); }

/* =====================================================================
   App shell
   ===================================================================== */
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 32px; height: 32px; }
.brand b { display: block; font-size: 17px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.brand small { display: block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.shell { display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; scrollbar-width: none; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 16px; padding: 20px 14px 14px; background: #fff; border-right: 1px solid rgba(12,36,60,.07); }
.side .brand { padding: 0 8px 4px; }
.side-nav { display: grid; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border-radius: 10px; font-size: 14px; color: var(--ink-2); transition: background .15s, color .15s; }
.side-nav a svg { color: #6E7D8A; }
.side-nav a:hover { background: var(--bg); color: var(--ink); }
.side-nav a[aria-current="page"] { background: var(--tint); color: var(--ink); font-weight: 500; }
.side-nav a[aria-current="page"] svg { color: var(--blue); }
.side-nav .cnt { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; font-size: 11.5px; font-weight: 600; background: var(--bg); color: var(--ink-2); }
.side-nav a[aria-current="page"] .cnt { background: #fff; }
.side-label { padding: 0 10px; font-size: 11px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.side-help { margin-top: auto; padding: 14px; border-radius: 14px; background: var(--bg); font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.side-help b { display: block; color: var(--ink); font-weight: 500; font-size: 13.5px; margin-bottom: 2px; }
.side-help a { color: var(--blue); font-weight: 500; }
.avatar { width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; font-size: 12.5px; font-weight: 600; letter-spacing: .02em; }
.me-txt { min-width: 0; flex: 1; line-height: 1.3; }
.me-txt b { display: block; font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-txt small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar, .tabbar { display: none; }
.mainbar { max-width: 1320px; height: 44px; margin: 0 auto 20px; display: flex; align-items: center; gap: 8px; }
.mainbar-l { flex: 1; min-width: 0; font-size: 13.5px; color: var(--muted); }
.mainbar-l .crumbs { margin: 0; }
.acct { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px 0 4px; border-radius: 999px; background: #fff; box-shadow: 0 0 0 1px rgba(12,36,60,.07); }
.acct .avatar { width: 36px; height: 36px; font-size: 12px; }
.acct .me-txt small { font-size: 12px; }
.acct .me-txt b { font-size: 13.5px; }
.round-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: #fff; box-shadow: 0 0 0 1px rgba(12,36,60,.07); color: var(--ink-2); transition: color .15s, box-shadow .15s; }
.round-btn:hover { color: var(--ink); box-shadow: 0 0 0 1px rgba(12,36,60,.16); }
.main { min-width: 0; padding: 20px clamp(20px, 3vw, 40px) 56px; }
.wrap { max-width: 1320px; margin: 0 auto; }

/* ===== Page head ===== */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font-size: clamp(24px, 2.3vw, 30px); font-weight: 500; letter-spacing: -.03em; line-height: 1.15; }
.page-head p { color: var(--ink-2); margin-top: 4px; font-size: 14.5px; }
.eyebrow { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); margin-bottom: 16px; min-width: 0; white-space: nowrap; }
.crumbs a { color: var(--ink-2); }
.crumbs a:hover { color: var(--ink); }

/* ===== Cards ===== */
.card { background: var(--card); border: 0; box-shadow: 0 0 0 1px rgba(12,36,60,.06), 0 1px 2px rgba(12,36,60,.03); border-radius: var(--r); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 12px; }
.card-h h2 { font-size: 15px; font-weight: 500; letter-spacing: -.01em; }
.card-h .link { font-size: 13.5px; color: var(--blue); font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.card-b { padding: 0 20px 20px; }

/* activity feed */
.feed { padding: 4px 20px 20px; display: grid; gap: 0; }
.feed li { position: relative; display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 12px; padding-bottom: 14px; }
.feed li::before { content: ""; position: absolute; left: 6px; top: 16px; bottom: 0; width: 1.5px; background: var(--line-2); }
.feed li:last-child { padding-bottom: 0; } .feed li:last-child::before { display: none; }
.feed .dot { width: 14px; height: 14px; margin-top: 3px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 3.5px var(--dot, var(--s-new-dot)); }
.feed p { font-size: 13.5px; color: var(--ink-2); line-height: 1.45; }
.feed p b { color: var(--ink); font-weight: 500; }
.feed time { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.feed a:hover b { color: var(--blue); }

.help { padding: 20px; background: var(--ink); color: #fff; border: 0; box-shadow: none; position: relative; overflow: hidden; }
.help::after { content: ""; position: absolute; right: -60px; bottom: -80px; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, rgba(12,162,192,.55), rgba(12,162,192,0) 70%); }
.help h2 { font-size: 15px; font-weight: 500; }
.help p { font-size: 13.5px; color: rgba(255,255,255,.72); margin-top: 4px; }
.help-links { display: grid; gap: 6px; margin-top: 16px; position: relative; z-index: 1; }
.help-links a { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px; border-radius: 10px; background: rgba(255,255,255,.08); font-size: 13.5px; transition: background .15s; }
.help-links a:hover { background: rgba(255,255,255,.14); }

/* ===== Requests list ===== */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.search { flex: 1 1 240px; max-width: 340px; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: #fff; transition: border-color .15s; }
.search:focus-within { border-color: var(--blue); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 14px; color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px; border-radius: 12px; background: var(--bg); }
.chips::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 9px; font-size: 13.5px; color: var(--ink-2); white-space: nowrap; }
.chip i { font-style: normal; font-size: 12px; color: var(--muted); }
.chip[aria-pressed="true"] { background: #fff; color: var(--ink); font-weight: 500; box-shadow: 0 1px 2px rgba(12,36,60,.1); }
.select { height: 38px; padding: 0 34px 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%235B6A77' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center; font-size: 14px; -webkit-appearance: none; appearance: none; }
.toolbar .select { margin-left: auto; }

.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.tbl td { padding: 14px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr { cursor: pointer; transition: background .15s; }
.tbl tbody tr:hover { background: #FAFBFC; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .pt { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tbl .pt a { font-weight: 500; }
.tbl .pt a:hover { color: var(--blue); }
.tbl .pt small { display: block; color: var(--muted); }
.tbl .svc { display: flex; align-items: center; gap: 8px; color: var(--ink-2); white-space: nowrap; }
.tbl .svc svg { color: var(--muted); }
.tbl .upd { color: var(--muted); font-size: 13px; white-space: nowrap; }
.tbl-foot { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line-2); font-size: 12.5px; color: var(--muted); }
.empty { padding: 56px 20px; text-align: center; color: var(--ink-2); }
.empty b { display: block; font-size: 16px; font-weight: 500; color: var(--ink); margin-bottom: 4px; }
.empty .btn { margin-top: 16px; }

/* ===== Request detail ===== */
.rq-head { padding: 22px 24px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: start; }
.rq-id { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); padding: 2px 4px 2px 8px; border-radius: 8px; background: var(--bg); }
.rq-id button { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; color: var(--muted); }
.rq-id button:hover { background: #fff; color: var(--ink); }
.rq-head h1 { font-size: clamp(24px, 2.4vw, 30px); font-weight: 500; letter-spacing: -.03em; margin-top: 10px; line-height: 1.15; }
.rq-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; color: var(--ink-2); font-size: 14px; }
.rq-meta span { display: inline-flex; align-items: center; gap: 6px; }
.rq-meta svg { color: var(--muted); }
.rq-head .st { height: 28px; font-size: 13px; padding: 0 12px 0 10px; }

.track { border-top: 1px solid var(--line-2); padding: 22px 24px 24px; }
.track ol { display: grid; grid-template-columns: repeat(4, 1fr); position: relative; }
.track li { position: relative; display: flex; flex-direction: column; gap: 2px; padding-right: 12px; }
.track li::before { content: ""; position: absolute; top: 11px; left: 24px; right: 0; height: 2px; background: var(--line); }
.track li:last-child::before { display: none; }
.track li.done::before { background: var(--brand); }
.track .tk { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #fff; box-shadow: inset 0 0 0 1.5px var(--line); color: #fff; margin-bottom: 8px; position: relative; z-index: 1; }
.track li.done .tk { background: var(--brand); box-shadow: none; }
.track li.now .tk { background: #fff; box-shadow: inset 0 0 0 6px var(--brand), 0 0 0 5px rgba(12,162,192,.16); }
.track.complete li.now .tk { background: var(--s-done-dot); box-shadow: 0 0 0 5px rgba(46,158,91,.16); }
.track b { font-size: 14px; font-weight: 500; }
.track li:not(.done):not(.now) b { color: var(--muted); font-weight: 400; }
.track time { font-size: 12.5px; color: var(--muted); }
.next { display: flex; gap: 12px; align-items: flex-start; margin-top: 20px; padding: 14px 16px; border-radius: 12px; background: var(--tint); color: var(--ink); font-size: 14px; }
.next svg { color: var(--blue); margin-top: 1px; }
.next b { font-weight: 500; }
.next.done { background: var(--s-done-bg); } .next.done svg { color: var(--s-done-fg); }

.rq-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; margin-top: 20px; }
.rq-col { display: grid; gap: 20px; min-width: 0; }
.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); }
.kv dt, .kv dd { padding: 12px 0; border-top: 1px solid var(--line-2); font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { color: var(--ink); overflow-wrap: anywhere; }
.kv dd a { color: var(--blue); }
.kv dd small { color: var(--muted); margin-left: 6px; }
.note-box { padding: 14px 16px; border-radius: 12px; background: var(--bg); font-size: 14.5px; line-height: 1.55; white-space: pre-wrap; }
.note-box + .sub-h { margin-top: 18px; }
.sub-h { font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.stamp { margin-top: 12px; font-size: 12.5px; color: var(--muted); }

/* ===== New request form ===== */
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.fsec { padding: 22px 24px; }
.fsec + .fsec { border-top: 1px solid var(--line-2); }
.fsec-h { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.fsec-h span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; font-size: 12px; font-weight: 600; }
.fsec-h h2 { font-size: 16px; font-weight: 500; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.fields .full { grid-column: 1 / -1; }
.f { display: grid; gap: 6px; }
.f label, .f .lbl { font-size: 13.5px; font-weight: 500; color: var(--ink); }
.f label small, .f .lbl small { font-weight: 400; color: var(--muted); }
.inp { width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 15px; transition: border-color .15s, box-shadow .15s; }
textarea.inp { height: auto; min-height: 104px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.inp:hover { border-color: #CBD3DA; }
.inp:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(10,122,150,.14); }
.inp[aria-invalid="true"] { border-color: #C2463F; }
.err { font-size: 12.5px; color: #B23A33; }
select.inp { -webkit-appearance: none; appearance: none; padding-right: 36px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%235B6A77' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.opt { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr) 20px; gap: 12px; align-items: start; padding: 16px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.opt:hover { border-color: #CBD3DA; }
.opt input { position: absolute; opacity: 0; }
.opt b { display: block; font-weight: 500; font-size: 14.5px; line-height: 1.3; }
.opt small { display: block; font-size: 13px; color: var(--ink-2); margin-top: 4px; line-height: 1.4; }
.opt .radio { width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px #C5CED6; transition: box-shadow .15s; }
.opt:has(input:checked) { border-color: var(--blue); background: #F7FCFD; box-shadow: 0 0 0 1px var(--blue); }
.opt:has(input:checked) .radio { box-shadow: inset 0 0 0 6px var(--blue); }
.opt:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px 24px; border-top: 1px solid var(--line-2); background: #FAFBFC; border-radius: 0 0 var(--r) var(--r); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--ink-2); max-width: 460px; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--blue); flex-shrink: 0; }
.aside-steps { padding: 20px; position: sticky; top: 24px; }
.aside-steps h2 { font-size: 15px; font-weight: 500; margin-bottom: 14px; }
.aside-steps ol { display: grid; gap: 14px; counter-reset: s; }
.aside-steps li { display: grid; grid-template-columns: 24px 1fr; gap: 10px; font-size: 13.5px; color: var(--ink-2); counter-increment: s; }
.aside-steps li::before { content: counter(s); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--tint); color: var(--blue); font-size: 12px; font-weight: 600; }
.aside-steps li b { display: block; color: var(--ink); font-weight: 500; }
.aside-steps .legal { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-2); font-size: 12px; color: var(--muted); }

/* ===== Toast ===== */
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 60; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 14px; box-shadow: var(--shadow-pop); transform: translate(-50%, 16px); opacity: 0; pointer-events: none; transition: transform .25s, opacity .25s; }
.toast.on { transform: translate(-50%, 0); opacity: 1; }
.toast svg { color: #6FD4E6; }

/* view enter */
.view { animation: enter .28s cubic-bezier(.2,.7,.2,1); }
@keyframes enter { from { opacity: 0; } to { opacity: 1; } }

/* ===== Responsive ===== */
@media (max-width: 1180px) {
  .rq-grid { grid-template-columns: minmax(0, 1fr) 300px; }
  .tbl .c-country { display: none; }
}
@media (max-width: 1000px) {
  .rq-grid, .form-grid { grid-template-columns: 1fr; }
  .aside-steps { position: static; }
}
@media (max-width: 900px) {
  .shell { display: block; }
  .side { display: none; }
  .mainbar { height: auto; margin-bottom: 16px; }
  .mainbar .round-btn, .mainbar .acct { display: none; }
  .topbar { display: flex; position: sticky; top: 0; z-index: 40; align-items: center; justify-content: space-between; gap: 12px; height: 60px; padding: 0 16px; background: rgba(255,255,255,.88); -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4); border-bottom: 1px solid var(--line); }
  .topbar .brand img { width: 28px; height: 28px; }
  .topbar .avatar { width: 32px; height: 32px; font-size: 11.5px; }
  .topbar-r { display: flex; align-items: center; gap: 6px; }
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; font-size: 11.5px; color: var(--muted); border-radius: 10px; }
  .tabbar a[aria-current="page"] { color: var(--blue); font-weight: 500; }
  .tabbar .plus { width: 44px; height: 22px; border-radius: 999px; display: grid; place-items: center; background: var(--blue); color: #fff; }
  .tabbar a.new { color: var(--ink); }
  .main { padding: 20px 16px calc(96px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
}
@media (max-width: 760px) {
  /* table → cards */
  .tbl thead { display: none; }
  .tbl, .tbl tbody { display: block; }
  .tbl tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
  .tbl tbody tr:last-child { border-bottom: 0; }
  .tbl td { display: block; padding: 0; border: 0; }
  .tbl .c-pt { grid-column: 1; grid-row: 1; }
  .tbl .c-st { grid-column: 2; grid-row: 1; justify-self: end; }
  .tbl .c-svc { grid-column: 1; grid-row: 2; padding-left: 52px; font-size: 13px; }
  .tbl .c-svc .svc svg { display: none; }
  .tbl .c-upd { grid-column: 2; grid-row: 2; justify-self: end; }
  .tbl .c-prog, .tbl .c-country { display: none; }
  .toolbar { padding: 12px; }
  .search { max-width: none; flex-basis: 100%; }
  .chips { flex: 1 1 100%; }
  .toolbar .select { margin-left: 0; flex: 1; }
  .rq-head { padding: 18px 16px; grid-template-columns: 1fr; }
  .rq-head .st { justify-self: start; grid-row: 1; }
  .track { padding: 18px 16px 18px; }
  .track ol { grid-template-columns: 1fr; gap: 0; }
  .track li { display: grid; grid-template-columns: 24px 1fr; column-gap: 12px; padding: 0 0 16px; }
  .track li:last-child { padding-bottom: 0; }
  .track li::before { top: 24px; bottom: 0; left: 11px; right: auto; width: 2px; height: auto; }
  .track .tk { grid-row: span 2; margin: 0; }
  .card-h { padding: 16px 16px 12px; }
  .card-b { padding: 0 16px 16px; }
  .kv { grid-template-columns: 1fr; }
  .kv dt { padding-bottom: 0; }
  .kv dd { border-top: 0; padding-top: 2px; }
  .fsec { padding: 18px 16px; }
  .fields, .opts { grid-template-columns: 1fr; }
  .form-foot { padding: 16px; }
  .form-foot .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* =====================================================================
   Login
   ===================================================================== */
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); min-height: 100vh; min-height: 100dvh; background: #fff; }
.auth-l { display: flex; flex-direction: column; padding: 28px clamp(20px, 5vw, 64px); }
.auth-l .top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auth-l .back { font-size: 14px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.auth-l .back:hover { color: var(--ink); }
.auth-form { width: 100%; max-width: 400px; margin: auto; padding: 48px 0; display: grid; gap: 18px; }
.auth-form h1 { font-size: clamp(30px, 3.2vw, 40px); font-weight: 400; letter-spacing: -.04em; line-height: 1.05; }
.auth-form > p { color: var(--ink-2); margin-top: -6px; text-wrap: pretty; }
.auth-form .row { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13.5px; }
.auth-form .row a { color: var(--blue); font-weight: 500; }
.auth-form .check { align-items: center; }
.pw { position: relative; }
.pw .inp { padding-right: 48px; }
.pw button { position: absolute; right: 4px; top: 4px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; color: var(--muted); }
.pw button:hover { color: var(--ink); }
.demo-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--tint); font-size: 13px; color: var(--ink-2); }
.demo-note svg { color: var(--blue); margin-top: 1px; }
.auth-form .btn[aria-busy="true"] { opacity: .8; pointer-events: none; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.auth-alt { text-align: center; font-size: 14px; color: var(--ink-2); }
.auth-alt a { color: var(--ink); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }
.auth-foot { font-size: 12px; color: var(--muted); }

.auth-r { position: relative; overflow: hidden; margin: 12px; border-radius: 24px; padding: clamp(28px, 4vw, 56px); color: #fff; display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  background: radial-gradient(90% 70% at 100% 100%, #5FD0E3 0%, rgba(95,208,227,0) 55%), linear-gradient(160deg, #0E93B0, var(--blue) 55%, #08627A); }
.auth-r .motto { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,.75); }
.auth-r h2 { text-wrap: balance; font-size: clamp(28px, 3vw, 42px); font-weight: 400; letter-spacing: -.03em; line-height: 1.08; max-width: 480px; margin-top: 14px; }
.auth-r ul.pts { display: grid; gap: 10px; margin-top: 24px; font-size: 15px; color: rgba(255,255,255,.9); }
.auth-r ul.pts li { display: flex; align-items: center; gap: 10px; }
.auth-r ul.pts svg { color: #BFF0F8; }
.pv { position: relative; z-index: 1; max-width: 440px; padding-bottom: 40px; }
.pv-card { background: #fff; color: var(--ink); border-radius: 18px; padding: 18px 20px 22px; box-shadow: 0 30px 60px -24px rgba(3,36,54,.55), 0 0 0 1px rgba(255,255,255,.4); }
.pv-head { display: grid; grid-template-columns: 40px minmax(0,1fr) auto; gap: 12px; align-items: center; }
.pv-av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #E3EEFB; color: #2B5C8F; font-size: 14px; font-weight: 600; }
.pv-id b { display: block; font-size: 15px; font-weight: 500; letter-spacing: -.01em; }
.pv-id small { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-track { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); margin: 18px 0 4px; padding: 14px 0 0; border-top: 1px solid var(--line-2); font-size: 12px; color: var(--muted); }
.pv-track li { position: relative; display: grid; gap: 7px; justify-items: start; }
.pv-track li::before { content: ""; position: absolute; top: 8px; left: 18px; right: 2px; height: 2px; border-radius: 2px; background: var(--line); }
.pv-track li:last-child::before { display: none; }
.pv-track li.done::before { background: var(--brand); }
.pv-track i { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 1.5px var(--line); background: #fff; color: #fff; position: relative; z-index: 1; }
.pv-track li.done i { background: var(--brand); box-shadow: none; }
.pv-track li.now i { box-shadow: inset 0 0 0 5px var(--brand), 0 0 0 4px rgba(12,162,192,.16); }
.pv-track li.done, .pv-track li.now { color: var(--ink); }
.pv-track li.now { font-weight: 500; }
.pv-kv { display: grid; grid-template-columns: auto minmax(0,1fr); margin-top: 12px; font-size: 13.5px; }
.pv-kv dt, .pv-kv dd { padding: 11px 0; border-top: 1px solid var(--line-2); }
.pv-kv dt { color: var(--muted); padding-right: 16px; }
.pv-kv dd { text-align: right; display: flex; justify-content: flex-end; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-tag { font-size: 12px; padding: 1px 8px; border-radius: 6px; background: var(--tint); color: var(--blue); font-weight: 500; }
.pv-toast { position: absolute; right: -14px; bottom: 0; display: flex; gap: 10px; align-items: center; padding: 10px 16px 10px 10px; border-radius: 14px; background: rgba(12,36,60,.88); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: #fff; box-shadow: 0 18px 40px -16px rgba(3,20,34,.6); max-width: calc(100% - 40px); }
.pv-ok { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: #2FB67C; flex-shrink: 0; }
.pv-toast b { display: block; font-size: 13px; font-weight: 500; }
.pv-toast small { display: block; font-size: 12px; color: rgba(255,255,255,.7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-height: 760px) { .auth-r ul.pts { display: none; } }
.auth-r .glass { position: absolute; right: -70px; top: -70px; width: 280px; height: 280px; border-radius: 42% 58% 60% 40% / 45% 40% 60% 55%; background: conic-gradient(from 210deg, rgba(255,255,255,.55), rgba(160,230,240,.12), rgba(255,255,255,.45), rgba(110,210,230,.18), rgba(255,255,255,.55)); box-shadow: inset 0 0 40px rgba(255,255,255,.5); transform: rotate(-18deg); opacity: .7; }
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-r { display: none; }
  .auth-form { padding: 32px 0; }
}

/* =====================================================================
   v2 — workspace look: KPIs, schedule strip, kanban, onboarding
   ===================================================================== */
.main { background:
  radial-gradient(900px 420px at 88% -12%, rgba(12,162,192,.11), transparent 62%),
  radial-gradient(700px 380px at 8% -8%, rgba(120,140,230,.06), transparent 60%); }
.card { border-radius: 18px; }
.btn-dark .plus-c { width: 26px; height: 26px; margin-left: -10px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.14); }
.tour-again { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 13px; font-weight: 500; color: var(--ink); }
.tour-again:hover { color: var(--blue); }
[data-tour] { scroll-margin: 84px 0 24px; }

/* avatar (initials, hue from name) */
.av { width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 600; letter-spacing: .02em;
  background: hsl(var(--h) 55% 92%); color: hsl(var(--h) 45% 28%); box-shadow: inset 0 0 0 1px hsl(var(--h) 40% 84%); }
.av-lg { width: 52px; height: 52px; font-size: 17px; }

/* overview layout: board + right column */
.ov { display: block; }
.ov-aside { display: grid; gap: 16px; margin-top: 24px; }
.ov .sec-bar { margin-top: 0; }

/* week calendar (UK appointments) */
.cal .card-h { padding-bottom: 10px; }
.cal-nav { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ink-2); }
.cal-nav button { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); }
.cal-nav button:hover:not(:disabled) { background: var(--bg); color: var(--ink); }
.cal-nav button:disabled { opacity: .35; cursor: default; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; padding: 0 12px 12px; border-bottom: 1px solid var(--line-2); }
.wd { display: grid; justify-items: center; gap: 6px; padding: 4px 0; border-radius: 12px; }
.wd small { font-size: 12px; color: var(--muted); }
.wd b { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 13.5px; font-weight: 500; background: var(--bg); transition: background .15s, color .15s; }
.wd:hover b { background: var(--line); }
.wd i { width: 4px; height: 4px; border-radius: 50%; background: transparent; }
.wd.has i { background: var(--brand); }
.wd.today small { color: var(--blue); font-weight: 600; }
.wd[aria-pressed="true"] b { background: var(--ink); color: #fff; }
.visits { padding: 4px 20px 12px; }
.visits li + li { border-top: 1px solid var(--line-2); }
.visits a { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 0; }
.visits a:hover b { color: var(--blue); }
.visits b { display: block; font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.visits small { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.visits time { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.visits-empty { padding: 18px 20px 20px; font-size: 13.5px; color: var(--muted); text-align: center; }

/* section bar */
.sec-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 32px 0 16px; }
.sec-bar h2 { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 500; letter-spacing: -.02em; margin-right: 10px; }
.sec-bar h2 .n { font-size: 12px; font-weight: 600; height: 22px; min-width: 26px; padding: 0 7px; border-radius: 999px; display: grid; place-items: center; background: #fff; color: var(--ink); letter-spacing: 0; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pills::-webkit-scrollbar { display: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px; border: 0; box-shadow: 0 0 0 1px rgba(12,36,60,.08); background: #fff; font-size: 13.5px; color: var(--ink-2); white-space: nowrap; transition: background .15s, color .15s, box-shadow .15s; }
.pill:hover { box-shadow: 0 0 0 1px rgba(12,36,60,.18); color: var(--ink); }
.pill[aria-pressed="true"] { background: var(--ink); box-shadow: none; color: #fff; }
.pill-soon svg { color: #C2463F; }
.pill-soon[aria-pressed="true"] svg { color: #FF9C93; }
.sbox { display: flex; align-items: center; gap: 8px; height: 38px; width: 180px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--muted); transition: border-color .15s, width .2s; }
.sbox:focus-within { border-color: var(--blue); width: 240px; }
.sbox input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 14px; }
.vt { margin-left: auto; display: inline-flex; padding: 3px; border-radius: 999px; background: #fff; box-shadow: 0 0 0 1px rgba(12,36,60,.08); }
.vt button { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 999px; font-size: 13px; color: var(--ink-2); }
.vt button[aria-pressed="true"] { background: var(--tint); color: var(--ink); font-weight: 500; }
.vt button[aria-pressed="true"] svg { color: var(--blue); }

/* kanban */
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: 20px; background: #EAEEF1; min-width: 0; }
.col-h { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 6px 6px 6px 6px; }
.col-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--ic-bg); color: var(--ic-fg); }
.col-t b { display: block; font-size: 14.5px; font-weight: 500; line-height: 1.25; }
.col-t small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-h .n { height: 24px; min-width: 28px; padding: 0 8px; border-radius: 999px; display: grid; place-items: center; background: #fff; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.col-empty { display: grid; place-items: center; min-height: 80px; border-radius: 14px; background: rgba(255,255,255,.5); font-size: 13px; color: var(--muted); }
.kcard { display: grid; gap: 10px; padding: 12px 12px 12px; border-radius: 14px; background: #fff; box-shadow: 0 1px 2px rgba(12,36,60,.05); transition: box-shadow .18s; min-width: 0; }
.kcard:hover { box-shadow: 0 8px 20px -12px rgba(12,36,60,.25); }
.kc-top { display: grid; grid-template-columns: 32px minmax(0, 1fr) 28px; gap: 10px; align-items: center; }
.kc-who { min-width: 0; line-height: 1.25; }
.kc-who b { display: block; font-size: 14.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kc-who small { display: block; font-size: 11.5px; color: var(--muted); }
.kc-go { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); color: var(--ink); transition: background .15s, color .15s; }
.kcard:hover .kc-go { background: var(--ink); border-color: var(--ink); color: #fff; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px; background: var(--bg); font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.tag-imaging { background: var(--tint); color: var(--blue); font-weight: 500; }
.tag-aftercare { background: #FCEFF1; color: #B23A55; font-weight: 500; }
.kc-appt { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 10px; background: var(--bg); font-size: 13px; color: var(--ink-2); }
.kc-appt svg { color: var(--blue); }
.kc-appt b { color: var(--ink); font-weight: 500; }
.kc-foot { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 4px 8px; padding-top: 2px; }
.kc-foot small { font-size: 12.5px; color: var(--muted); white-space: nowrap; padding-top: 1px; }
.trip { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); }
.trip svg { color: var(--muted); }
.trip.soon { color: #B23A33; font-weight: 500; }
.trip.soon svg { color: #C2463F; }

.toolbar-card { margin-bottom: 16px; }
.toolbar-card .toolbar { border-bottom: 0; }
.toolbar .vt { margin-left: 0; }
.tbl .pt .av { width: 36px; height: 36px; }

/* detail head with avatar */
.rq-who { display: flex; gap: 16px; align-items: flex-start; min-width: 0; }
.rq-who .av-lg { margin-top: 2px; }
.rq-who h1 { margin-top: 6px; }

/* new request: scan picker */
.scan-f { margin-top: 18px; }
.tagpick { display: flex; flex-wrap: wrap; gap: 8px; }
.tp { position: relative; cursor: pointer; }
.tp input { position: absolute; opacity: 0; }
.tp span { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 16px 0 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 14px; transition: background .15s, border-color .15s, color .15s; }
.tp span svg { color: transparent; width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px #C5CED6; padding: 2px; }
.tp input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.tp input:checked + span svg { color: var(--ink); background: #fff; box-shadow: none; }
.tp input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ===== Onboarding tour ===== */
html.touring { overflow: hidden; }
.tour { position: fixed; inset: 0; z-index: 100; opacity: 0; transition: opacity .3s; }
.tour.on { opacity: 1; }
.tour-veil { position: absolute; inset: 0; background: rgba(9,28,46,.46); -webkit-backdrop-filter: blur(8px) saturate(.8); backdrop-filter: blur(8px) saturate(.8); transition: clip-path .5s cubic-bezier(.3,.7,.2,1); }
.tour-ring { position: absolute; pointer-events: none; box-shadow: 0 0 0 2px #fff, 0 0 0 8px rgba(12,162,192,.4), 0 0 48px 10px rgba(12,162,192,.35); transition: left .5s cubic-bezier(.3,.7,.2,1), top .5s cubic-bezier(.3,.7,.2,1), width .5s cubic-bezier(.3,.7,.2,1), height .5s cubic-bezier(.3,.7,.2,1), border-radius .5s, opacity .3s; }
.tour-ring::after { content: ""; position: absolute; inset: -2px; border-radius: inherit; box-shadow: 0 0 0 2px rgba(255,255,255,.9); animation: ring 1.8s ease-out infinite; }
@keyframes ring { from { opacity: .9; transform: scale(1); } to { opacity: 0; transform: scale(1.04); } }
.tour-card { position: absolute; width: min(360px, calc(100vw - 32px)); padding: 20px; border-radius: 22px; background: #fff; box-shadow: 0 30px 70px -20px rgba(4,20,40,.55), 0 0 0 1px rgba(12,36,60,.06);
  transition: left .5s cubic-bezier(.3,.7,.2,1), top .5s cubic-bezier(.3,.7,.2,1); }
.tour-cnt { font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); }
.tour-card h3 { font-size: 19px; font-weight: 500; letter-spacing: -.02em; line-height: 1.25; margin-top: 6px; }
.tour-card p:not(.tour-cnt) { font-size: 14px; color: var(--ink-2); margin-top: 8px; }
.tour-bar { display: flex; gap: 4px; margin-top: 16px; }
.tour-bar i { flex: 1; height: 4px; border-radius: 4px; background: var(--line); transition: background .3s; }
.tour-bar i.on { background: var(--brand); }
.tour-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 16px; }
.tour-actions span { display: flex; gap: 6px; }
.tour-actions .btn { height: 38px; }
.tour-skip { font-size: 13.5px; color: var(--muted); padding: 8px 2px; }
.tour-skip:hover { color: var(--ink); }
.tour-card.welcome { width: min(460px, calc(100vw - 32px)); padding: 0; overflow: hidden; }
.tw-hero { position: relative; display: grid; gap: 22px; padding: 26px 26px 22px; color: #fff; overflow: hidden;
  background: radial-gradient(90% 90% at 100% 100%, #5FD0E3 0%, rgba(95,208,227,0) 55%), linear-gradient(150deg, #0E93B0, var(--blue) 55%, #08627A); }
.tw-hero::after { content: ""; position: absolute; right: -50px; top: -60px; width: 200px; height: 200px; border-radius: 42% 58% 60% 40% / 45% 40% 60% 55%; background: conic-gradient(from 210deg, rgba(255,255,255,.5), rgba(160,230,240,.1), rgba(255,255,255,.4), rgba(255,255,255,.5)); opacity: .55; }
.tw-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; position: relative; z-index: 1; }
.tw-flow .st { background: rgba(255,255,255,.95); }
.tw-flow i { color: rgba(255,255,255,.7); display: grid; }
.tw-body { padding: 22px 26px 24px; }
.tw-body h3 { font-size: 22px; }

/* ===== v2 responsive ===== */
#coll { container-type: inline-size; }
@container (max-width: 1000px) { .board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 520px) { .board { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .sbox { flex: 1; width: auto; }
  .sbox:focus-within { width: auto; }
}
@media (max-width: 760px) {
  .sec-bar { margin-top: 24px; }
  .sec-bar h2 { flex: 1 1 auto; }
  .sec-bar .vt { order: 1; }
  .sec-bar .pills { order: 2; }
  .pills { flex: 1 1 100%; }
  .vt { margin-left: 0; }
  .toolbar .vt { flex: 0 0 auto; }
  .rq-who .av-lg { display: none; }
  .tour-card { width: calc(100vw - 32px); }
  .sched-l { grid-auto-columns: 78%; padding: 0 16px 4px; scroll-padding: 0 16px; }
  .sched-empty { padding: 0 16px 4px; }
}
.kc-svc { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); min-width: 0; }
.kc-svc .tag { flex-shrink: 0; }
.kc-svc span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-head.ov-greet { margin-bottom: 28px; }

/* ===== v4: sidebar calendar + coordinator ===== */
.side::-webkit-scrollbar { display: none; }
.cal-t { min-width: 0; }
.cal-t small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.cal-nav { gap: 2px; }
.visits-more { padding: 8px 0 2px; font-size: 12.5px; color: var(--muted); }
.side-cal { flex-shrink: 0; border-radius: 16px; background: var(--bg); }
.side-cal .card-h { padding: 14px 14px 10px; }
.side-cal .week { padding: 0 6px 10px; border-bottom-color: rgba(12,36,60,.07); }
.side-cal .wd b { width: 30px; height: 30px; font-size: 13px; background: #fff; }
.side-cal .wd[aria-pressed="true"] b { background: var(--ink); }
.side-cal .visits { padding: 2px 14px 8px; }
.side-cal .visits li + li { border-top-color: rgba(12,36,60,.07); }
.side-cal .visits-empty { padding: 14px 14px 16px; }
.side-coord { flex-shrink: 0; margin-top: auto; border-radius: 16px; padding: 16px; }
.side-coord h2 { font-size: 14.5px; }
.side-coord p { font-size: 13px; }
.side-coord .help-links { margin-top: 12px; }
.side-coord .help-links a { height: 36px; font-size: 13px; }
.mobile-only { display: none !important; }
.feed-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px 24px; }
.feed-grid li { padding-bottom: 0; }
.feed-grid li::before { display: none; }
@media (max-width: 900px) {
  .mobile-only { display: block !important; }
  .feed-grid { grid-template-columns: 1fr; gap: 0; }
  .feed-grid li { padding-bottom: 14px; }
  .feed-grid li:last-child { padding-bottom: 0; }
  .feed-grid li:not(:last-child)::before { display: block; }
}

/* ===== v5: greeting badges ===== */
.hbadges { display: flex; flex-wrap: wrap; gap: 8px; }
.hbadge { display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 16px 0 5px; border-radius: 999px; background: #fff; box-shadow: 0 0 0 1px rgba(12,36,60,.07); font-size: 13.5px; color: var(--ink-2); white-space: nowrap; transition: box-shadow .15s; }
.hbadge:hover { box-shadow: 0 0 0 1px rgba(12,36,60,.18); }
.hbadge b { color: var(--ink); font-weight: 600; }
.hb-ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); color: var(--ink); }
.hb-ic.hb-teal { background: var(--tint); color: var(--blue); }

/* ===== v5: calendar page ===== */
body[data-route="calendar"] .side-cal { display: none; }
.cal-open { display: flex; align-items: center; justify-content: center; gap: 6px; height: 36px; margin: 0 8px 8px; border-radius: 10px; font-size: 13px; font-weight: 500; color: var(--blue); }
.cal-open:hover { background: rgba(12,162,192,.08); }
.round-btn.sm { width: 36px; height: 36px; }
.cal-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin-bottom: 16px; }
.cal-month { display: flex; align-items: center; gap: 8px; }
.cal-month h2 { min-width: 150px; text-align: center; font-size: 18px; font-weight: 500; letter-spacing: -.02em; }
.cal-month .pill { margin-left: 4px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--ink-2); }
.cal-legend span { display: inline-flex; align-items: center; gap: 8px; }
.cal-legend i, .dots i { width: 8px; height: 8px; border-radius: 50%; }
.lg-visit { background: var(--brand); }
.lg-trip { background: #E39B00; }
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.month { overflow: hidden; }
.m-head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); padding: 0 6px; border-bottom: 1px solid var(--line-2); }
.m-head span { padding: 12px 8px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.m-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); padding: 6px; gap: 4px; }
.mday { min-height: 98px; min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 6px; border-radius: 12px; cursor: pointer; transition: background .15s; }
.mday:hover { background: #F7F9FA; }
.mday.out { opacity: .45; }
.mday.sel { background: var(--tint); }
.m-num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 500; color: var(--ink); }
.mday.today .m-num { background: var(--ink); color: #fff; }
.evs { display: grid; gap: 4px; min-width: 0; }
.ev { display: flex; align-items: center; gap: 5px; min-width: 0; height: 24px; padding: 0 8px; border-radius: 8px; font-size: 12px; white-space: nowrap; overflow: hidden; }
.ev span { overflow: hidden; text-overflow: ellipsis; }
.ev b { font-weight: 600; }
.ev-visit { background: #DDF3F7; color: #075E73; }
.ev-trip { background: #FFF0D1; color: #7A4A00; }
.ev.is-done { opacity: .55; }
.ev:hover { filter: brightness(.96); }
.ev-more { font-size: 12px; color: var(--muted); padding-left: 4px; }
.dots { display: none; gap: 3px; justify-content: center; }
.agenda { position: sticky; top: 20px; }
.ag-list { padding: 0 12px 8px; }
.ag-item { display: grid; grid-template-columns: 48px 32px minmax(0, 1fr); align-items: center; gap: 10px; padding: 10px 8px; border-radius: 12px; transition: background .15s; }
.ag-item:hover { background: var(--bg); }
.ag-time { font-size: 13px; font-weight: 600; color: var(--ink); display: grid; place-items: center; height: 32px; border-radius: 8px; background: #DDF3F7; }
.ag-trip .ag-time { background: #FFF0D1; color: #7A4A00; }
.ag-txt { min-width: 0; }
.ag-txt b { display: block; font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-txt small { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-note { display: flex; gap: 8px; align-items: flex-start; margin: 4px 20px 18px; padding-top: 14px; border-top: 1px solid var(--line-2); font-size: 12.5px; color: var(--muted); }
.ag-note svg { margin-top: 1px; }
@media (max-width: 1200px) {
  .cal-layout { grid-template-columns: 1fr; }
  .agenda { position: static; }
}
@media (max-width: 760px) {
  .hbadges { width: 100%; gap: 6px; }
  .hbadge { height: 34px; padding: 0 12px; gap: 6px; font-size: 13px; }
  .hbadge .hb-ic { display: none; }
  .mday { min-height: 56px; align-items: center; padding: 4px 0; gap: 4px; }
  .evs { display: none; }
  .dots { display: flex; }
  .m-head span { padding: 10px 0; text-align: center; font-size: 12px; }
  .m-grid { padding: 4px; gap: 2px; }
  .cal-month h2 { min-width: 0; font-size: 16px; }
  .cal-bar { margin-bottom: 12px; }
}
.ag-txt .ag-st { color: var(--ink-2); font-weight: 500; margin-top: 1px; }

/* ===== v6: edit mode ===== */
.btn-xs { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--bg); font-size: 13px; font-weight: 500; color: var(--ink); transition: background .15s; }
.btn-xs:hover { background: var(--line); }
.rq-side { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.btn-edit { height: 36px; padding: 0 14px; font-size: 13.5px; }
.edit-flag { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--blue); }
.card.is-editing { box-shadow: 0 0 0 1.5px rgba(10,122,150,.45), 0 8px 24px -16px rgba(10,122,150,.4); }
.is-editing textarea.inp { min-height: 88px; }
.edit-bar { position: sticky; bottom: 16px; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 12px 12px 18px; border-radius: 16px; background: rgba(12,36,60,.94); color: rgba(255,255,255,.85); font-size: 13px; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 16px 32px -16px rgba(4,20,40,.5); }
.edit-bar > span:first-child { display: inline-flex; align-items: center; gap: 8px; }
.edit-act { display: flex; gap: 8px; }
.edit-bar .btn-line { background: transparent; border-color: rgba(255,255,255,.25); color: #fff; }
.edit-bar .btn-line:hover { border-color: rgba(255,255,255,.5); }
.edit-bar .btn-primary { background: #fff; color: var(--ink); }
.edit-bar .btn-primary:hover { background: var(--tint); }

/* ===== v6: upload + files ===== */
.drop { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 14px; background: var(--bg); cursor: pointer; transition: background .15s, box-shadow .15s; }
.drop:hover { background: #EBF0F2; }
.drop.over { background: var(--tint); box-shadow: inset 0 0 0 2px var(--brand); }
.drop:focus-within { box-shadow: inset 0 0 0 2px var(--blue); }
.drop-ic { width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; display: grid; place-items: center; background: #fff; color: var(--blue); box-shadow: 0 1px 2px rgba(12,36,60,.06); }
.drop b { display: block; font-size: 14px; font-weight: 500; }
.drop small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.drop u { color: var(--blue); text-underline-offset: 2px; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.fgrid:not(:empty) { margin-top: 12px; }
.ftile { position: relative; min-width: 0; }
.fopen { display: grid; width: 100%; text-align: left; border-radius: 12px; overflow: hidden; background: #fff; box-shadow: 0 0 0 1px rgba(12,36,60,.08); transition: box-shadow .15s; }
.fopen:hover { box-shadow: 0 0 0 1px rgba(12,36,60,.2), 0 8px 18px -12px rgba(12,36,60,.35); }
.fthumb { display: grid; place-items: center; aspect-ratio: 4 / 3; background: #0F1B26; overflow: hidden; }
.fthumb img { width: 100%; height: 100%; object-fit: cover; }
.fext { display: grid; justify-items: center; gap: 4px; color: #9FB1C0; }
.fext b { font-size: 11px; font-weight: 600; letter-spacing: .06em; color: #fff; }
.fmeta { display: grid; padding: 8px 10px 10px; min-width: 0; }
.fmeta b { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fmeta small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fdel { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.92); color: var(--ink); opacity: 0; transition: opacity .15s, background .15s, color .15s; }
.ftile:hover .fdel, .fdel:focus-visible { opacity: 1; }
.fdel:hover { background: #C2463F; color: #fff; }
.fdel.static { position: static; opacity: 1; background: var(--bg); }
.fsec-h h2 small { font-size: 13px; font-weight: 400; }
.fsec-p { font-size: 13.5px; color: var(--ink-2); margin: -6px 0 14px; }
.pending { display: grid; gap: 8px; }
.pending:not(:empty) { margin-top: 12px; }
.pending li { display: grid; grid-template-columns: 40px minmax(0, 1fr) 28px; align-items: center; gap: 12px; padding: 8px 10px 8px 8px; border-radius: 12px; background: var(--bg); }
.pthumb { width: 40px; height: 40px; border-radius: 8px; overflow: hidden; display: grid; place-items: center; background: #0F1B26; color: #9FB1C0; }
.pthumb img { width: 100%; height: 100%; object-fit: cover; }
.pmeta { min-width: 0; }
.pmeta b { display: block; font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pmeta small { display: block; font-size: 12px; color: var(--muted); }
.kc-r { display: inline-flex; align-items: center; gap: 8px; }
.kc-files { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); }

/* ===== v6: preview ===== */
.lb { position: fixed; inset: 0; z-index: 120; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: rgba(6,16,28,.9); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: #fff; opacity: 0; pointer-events: none; transition: opacity .2s; }
.lb.on { opacity: 1; pointer-events: auto; }
.lb-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; }
.lb-t { min-width: 0; }
.lb-t b { display: block; font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-t small { display: block; font-size: 12.5px; color: rgba(255,255,255,.65); }
.lb-act { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.lb-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(255,255,255,.08); transition: background .15s; }
.lb-btn:hover { background: rgba(255,255,255,.18); }
.lb-btn[data-lbdel]:hover { background: #C2463F; }
.lb-kind { height: 40px; padding: 0 34px 0 14px; border-radius: 999px; border: 0; background: rgba(255,255,255,.08) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center; color: #fff; font-size: 13.5px; -webkit-appearance: none; appearance: none; }
.lb-kind option { color: var(--ink); }
.lb-stage { min-height: 0; display: grid; place-items: center; padding: 8px 72px; overflow: hidden; }
.lb-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; cursor: zoom-in; box-shadow: 0 30px 60px -20px rgba(0,0,0,.6); }
.lb-stage.zoom { overflow: auto; place-items: start center; }
.lb-stage.zoom .lb-img { max-width: none; max-height: none; cursor: zoom-out; }
.lb-pdf { width: min(960px, 100%); height: 100%; border: 0; border-radius: 10px; background: #fff; }
.lb-none { display: grid; justify-items: center; gap: 10px; text-align: center; max-width: 360px; color: rgba(255,255,255,.75); }
.lb-none b { color: #fff; font-size: 17px; font-weight: 500; }
.lb-none .btn { margin-top: 8px; }
.lb-nav { position: absolute; top: 50%; width: 48px; height: 48px; margin-top: -24px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.1); color: #fff; transition: background .15s; }
.lb-nav:hover { background: rgba(255,255,255,.2); }
.lb-prev { left: 16px; } .lb-next { right: 16px; }
.lb-count { text-align: center; padding: 12px; font-size: 12.5px; color: rgba(255,255,255,.6); }
@media (max-width: 760px) {
  .rq-side { flex-direction: row; align-items: center; justify-content: space-between; width: 100%; grid-row: 1; }
  .rq-head .rq-side .st { justify-self: auto; }
  .edit-bar { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .edit-bar > span:first-child { display: none; }
  .edit-act { width: 100%; } .edit-act .btn { flex: 1; }
  .fgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lb-bar { padding: 10px 12px; flex-wrap: wrap; }
  .lb-kind { flex: 1; }
  .lb-act { width: 100%; }
  .lb-stage { padding: 8px; }
  .lb-nav { top: auto; bottom: 8px; margin: 0; width: 40px; height: 40px; }
}
@media (hover: none) { .fdel { opacity: 1; } }

/* =====================================================================
   Stage 1 — language switch, imaging / aftercare fields, file closing, clinic profile
   ===================================================================== */
.lang { display: flex; padding: 3px; border-radius: 999px; background: #fff; box-shadow: 0 0 0 1px rgba(12,36,60,.07); }
.lang button { border: 0; background: none; padding: 6px 10px; border-radius: 999px; font: inherit; font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--ink-2); cursor: pointer; }
.lang button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.topbar .lang { box-shadow: none; background: var(--bg); }
.topbar .lang button { padding: 5px 8px; }
.mainbar .lang { margin-right: 4px; }

.st-closed { background: #E7EBF0; color: var(--ink); gap: 5px; }
.st-closed::before { display: none; }
.tag-urgent { background: #FDECEC; color: #B23A33; font-weight: 600; }
.kcard.is-urgent { box-shadow: 0 0 0 1.5px rgba(178,58,51,.45), 0 1px 2px rgba(12,36,60,.04); }
.kc-closed { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 10px; background: #EEF1F4; font-size: 13px; color: var(--ink-2); }
.kc-closed b { color: var(--ink); font-weight: 500; }
.kc-svc { flex-wrap: wrap; }
.flag-yes { display: inline-flex; padding: 1px 8px; border-radius: 999px; background: #FFF2D9; color: #8A5300; font-weight: 600; font-size: 13px; }

.decl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.decl .check, .urgent-check { max-width: none; padding: 12px 14px; border-radius: 12px; background: var(--bg); cursor: pointer; }
.decl .check span, .urgent-check span { display: grid; gap: 2px; }
.decl .check b, .urgent-check b { color: var(--ink); font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.decl .check small, .urgent-check small { font-size: 12.5px; color: var(--muted); }
.decl .check:has(input:checked) { background: #FFF2D9; }
.urgent-check:has(input:checked) { background: #FDECEC; }
.urgent-check b svg { color: #B23A33; }
.limits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.lim { position: relative; cursor: pointer; }
.lim input { position: absolute; opacity: 0; }
.lim span { display: grid; place-items: center; height: 52px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-size: 19px; letter-spacing: -.02em; transition: background .15s, border-color .15s, color .15s; }
.lim input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.lim input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.hint { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.hint svg { flex-shrink: 0; margin-top: 1px; }
.f-hint { font-size: 12px; color: var(--muted); margin-top: -3px; }
[data-for][hidden] { display: none !important; }

.close-card { box-shadow: 0 0 0 1.5px rgba(10,122,150,.35); }
.close-card .card-b { display: grid; gap: 14px; }
.close-card .btn { justify-self: start; }
.fee-preview { font-size: 14px; color: var(--ink-2); }
.fee-preview b { color: var(--ink); font-weight: 600; }
.fee-preview small { color: var(--muted); }
.closed-card .card-h h2 { display: inline-flex; align-items: center; gap: 8px; }

.profile-card { max-width: 760px; }
.lock-flag { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.profile-card .hint { margin-top: 14px; }
.link-btn { margin-top: 10px; border: 0; background: none; padding: 0; font: inherit; font-size: 12.5px; color: var(--blue); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
#profile-form .form-foot { justify-content: space-between; }
body.first-run .side-nav, body.first-run .side-cal, body.first-run .side .btn-primary, body.first-run .tabbar, body.first-run [data-tour-start] { opacity: .35; pointer-events: none; }

@media (max-width: 600px) {
  .decl, .limits { grid-template-columns: 1fr; }
  .limits { grid-template-columns: repeat(3, 1fr); }
  .lim span { height: 46px; font-size: 16px; }
  .topbar .lang button { padding: 4px 7px; font-size: 11px; }
}
.auth-l .top-r { display: flex; align-items: center; gap: 14px; }
.auth-l .lang { box-shadow: none; background: var(--bg); }
@media (max-width: 420px) { .auth-l .back span { display: none; } }
.close-card .fields { align-items: end; }
@media (max-width: 900px) { .mainbar .lang { display: none; } }
