/* OrthoAI UI kit. Shared by Clinic, Policy and Registry. */
:root {
  --navy-900: #0F1B2B; --navy-800: #16243A; --navy-700: #24344A; --navy-600: #33465E; --slate: #64748B; --slate-300: #98A6B8; --slate-200: #B4C0CE;
  --paper: #F4F6F9; --panel: #EDF1F5; --panel-2: #F7F9FB; --line: #DDE3EA; --line-2: #E9EDF2; --white: #FFFFFF;
  --teal-700: #096B6B; --teal: #0B7F7F; --teal-400: #3FB8B8; --teal-100: #E0F2F1; --teal-50: #F1FAF9;
  --coral: #EF7B5F; --coral-700: #B24E37; --coral-100: #FDEBE5; --amber: #D69E2E; --amber-700: #8A6414; --amber-100: #FBF1DC;
  --green: #2E8B57; --green-100: #E3F3EA; --red: #C0392B; --red-100: #F9E3E0;
  --ink: #0F1B2B; --ink-2: #33465E; --muted: #64748B;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --r: 12px; --r-sm: 8px; --shadow: 0 1px 2px rgba(15,27,43,.05); --shadow-md: 0 4px 16px rgba(15,27,43,.08);
  --side-w: 236px; --focus: 0 0 0 3px rgba(11,127,127,.18);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); font-size: 13.5px; line-height: 1.5; color: var(--ink); background: var(--paper); min-height: 100vh; -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
a { color: var(--teal-700); text-decoration: none; } a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 8px; line-height: 1.25; letter-spacing: -0.015em; color: var(--ink); }
h1 { font-size: 22px; font-weight: 700; } h2 { font-size: 16px; font-weight: 650; } h3 { font-size: 14px; font-weight: 650; }
h4 { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
p { margin: 0 0 10px; } .muted { color: var(--muted); } .small { font-size: 12.5px; } .tiny { font-size: 11.5px; } .mono { font-family: var(--mono); font-size: 12px; }
.right { text-align: right; } .center { text-align: center; } .nowrap { white-space: nowrap; } .hidden { display: none !important; }
.mt-0{margin-top:0}.mt-1{margin-top:8px}.mt-2{margin-top:16px}.mt-3{margin-top:24px}.mb-1{margin-bottom:8px}.mb-2{margin-bottom:16px}.mb-3{margin-bottom:24px}
.flex { display: flex; gap: 12px; align-items: center; } .flex-wrap { flex-wrap: wrap; } .between { justify-content: space-between; } .col { flex-direction: column; align-items: stretch; } .grow { flex: 1; }
.grid { display: grid; gap: 16px; align-items: stretch; } .grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); } .grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); } .grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid-side { grid-template-columns: minmax(0, 1fr) 340px; } .grid-side-l { grid-template-columns: 220px minmax(0, 1fr); }
.grid > .card, .grid > .kpi { height: 100%; }
@media (max-width: 1100px) { .grid-2, .grid-3, .grid-4, .grid-side, .grid-side-l { grid-template-columns: 1fr; } }

/* ---------------- shell: fixed sidebar + content ---------------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--navy-900); color: #fff; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 14px 14px; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 15px; letter-spacing: -0.01em; padding: 2px 8px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--teal-400), var(--teal)); display: inline-grid; place-items: center; font-weight: 800; color: #fff; font-size: 14px; flex: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.brand-sub { display: block; color: var(--slate-300); font-weight: 500; font-size: 11px; letter-spacing: .02em; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav a { display: flex; align-items: center; gap: 10px; color: #B7C3D3; padding: 8px 10px; border-radius: 8px; font-size: 13.5px; font-weight: 500; line-height: 1.2; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav a.active { background: rgba(255,255,255,.1); color: #fff; }
.nav a.active .ic { color: var(--teal-400); }
.nav .ic { width: 18px; height: 18px; flex: none; color: #8A9AB0; }
.nav .sect { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: #6B7A8C; padding: 14px 10px 6px; }
.ic { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: inline-block; vertical-align: -3px; }
.side-foot { display: flex; flex-direction: column; gap: 10px; }
.persona { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 13px; padding: 10px; border-radius: 10px; background: rgba(255,255,255,.05); }
.persona > span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.persona .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--teal-400); color: var(--navy-900); display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.persona .role { color: var(--slate-300); font-size: 11.5px; display: block; font-weight: 400; text-transform: capitalize; }
.persona form { margin: 0; }
.persona .btn { background: transparent; color: #B7C3D3; border-color: transparent; padding: 6px; } .persona .btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.side-links { display: flex; flex-wrap: wrap; gap: 2px 10px; padding: 0 10px; font-size: 11.5px; color: #6B7A8C; align-items: center; }
.side-links a { color: #8A9AB0; } .side-links a:hover { color: #fff; }
.side-links form { display: inline; margin: 0; } .side-links .btn { background: transparent; border-color: transparent; color: #8A9AB0; padding: 0; font-size: 11.5px; font-weight: 500; } .side-links .btn:hover { color: #fff; background: transparent; }
main.content { padding: 28px 32px 56px; width: 100%; max-width: 1480px; }
body.bare .shell { grid-template-columns: 1fr; } body.bare .side { display: none; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin-bottom: 2px; } .page-head .sub { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.page-head > .flex, .page-head > form { margin-top: 2px; }
footer.foot { display: none; }
.topbar, .topbar-inner, .demo-band { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; } .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px; gap: 8px; }
  .nav { flex-direction: row; flex-wrap: wrap; flex: 1 1 100%; } .nav .sect { display: none; } .side-foot { flex-direction: row; align-items: center; margin-left: auto; } .side-links { display: none; }
  main.content { padding: 18px 16px 40px; }
}

/* ---------------- cards & KPIs ---------------- */
.card { background: var(--white); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px 22px; min-width: 0; }
.card + .card { margin-top: 16px; } .grid > .card + .card, .grid > .kpi + .kpi { margin-top: 0; } .card.tight { padding: 14px 16px; } .card.flat { box-shadow: none; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; } .card-head h2, .card-head h3 { margin: 0; }
.card > h2:first-child, .card > h3:first-child { margin-bottom: 12px; }
.kpi { background: var(--white); border: 1px solid var(--line-2); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; justify-content: center; min-height: 104px; min-width: 0; }
.kpi .v { font-size: 28px; font-weight: 650; letter-spacing: -0.03em; color: var(--ink); line-height: 1.1; font-variant-numeric: tabular-nums; } .kpi .v small { font-size: 13px; color: var(--muted); font-weight: 500; letter-spacing: 0; margin-left: 2px; }
.kpi .l { color: var(--muted); font-size: 12.5px; margin-top: 6px; line-height: 1.35; } .kpi.accent .v { color: var(--teal-700); } .kpi.warn .v { color: var(--coral-700); }
.step-list { counter-reset: s; list-style: none; padding: 0; margin: 0; } .step-list li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.step-list li::before { counter-increment: s; content: counter(s); width: 24px; height: 24px; border-radius: 50%; background: var(--teal-100); color: var(--teal-700); font-weight: 700; font-size: 12px; display: grid; place-items: center; flex: none; }
.step-list li:last-child { border-bottom: none; }

/* ---------------- chips ---------------- */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 6px; border: 1px solid transparent; white-space: nowrap; vertical-align: middle; line-height: 1.5; }
.chip-teal { background: var(--teal-100); color: var(--teal-700); } .chip-coral { background: var(--coral-100); color: var(--coral-700); } .chip-amber { background: var(--amber-100); color: var(--amber-700); }
.chip-green { background: var(--green-100); color: var(--green); } .chip-red { background: var(--red-100); color: var(--red); } .chip-grey { background: var(--panel); color: var(--slate); }
.chip-navy { background: var(--navy-800); color: #fff; } .chip-outline { background: transparent; border-color: var(--line); color: var(--slate); }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.maturity { font-family: var(--mono); font-weight: 600; font-size: 10px; letter-spacing: .04em; text-transform: uppercase; cursor: help; padding: 2px 7px; }
.maturity::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.maturity-real_model { background: var(--teal-100); color: var(--teal-700); } .maturity-deterministic { background: var(--green-100); color: var(--green); }
.maturity-heuristic { background: var(--amber-100); color: var(--amber-700); } .maturity-scripted { background: var(--panel); color: var(--slate); }
.src-chip { font-family: var(--mono); font-size: 10px; letter-spacing: .02em; }

/* ---------------- buttons & forms ---------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--white); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 7px 13px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.3; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s; box-shadow: 0 1px 1px rgba(15,27,43,.04); }
.btn:hover { border-color: var(--slate-300); text-decoration: none; background: var(--panel-2); } .btn:active { transform: translateY(0.5px); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn-primary { background: var(--teal); color: #fff; border-color: var(--teal); } .btn-primary:hover { background: var(--teal-700); border-color: var(--teal-700); color: #fff; }
.btn-dark { background: var(--navy-900); color: #fff; border-color: var(--navy-900); } .btn-dark:hover { background: var(--navy-700); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--teal-700); box-shadow: none; } .btn-ghost:hover { background: var(--teal-100); }
.btn-danger { color: var(--red); } .btn-danger:hover { background: var(--red-100); border-color: #E6B8B3; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; } .btn-xs { padding: 3px 8px; font-size: 11.5px; border-radius: 6px; } .btn[disabled], .btn.busy { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn .ic { width: 15px; height: 15px; }
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=search], input[type=email], input[type=url], select, textarea { width: 100%; padding: 8px 11px; border: 1px solid var(--line); border-radius: var(--r-sm); font: inherit; font-size: 13.5px; background: #fff; color: var(--ink); transition: border-color .12s, box-shadow .12s; }
input::placeholder, textarea::placeholder { color: var(--slate-300); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: var(--focus); }
select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }
textarea { resize: vertical; min-height: 80px; } .field { margin-bottom: 14px; } .field .hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
.suggested { background: #FFFBEB !important; border-color: var(--amber) !important; } .suggested-tag { color: var(--amber-700); font-size: 11px; font-weight: 600; }
.checkline { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 13px; } .checkline input { width: auto; accent-color: var(--teal); }
input[type=checkbox], input[type=radio] { accent-color: var(--teal); }
input[type=file] { font-size: 12.5px; }

/* ---------------- tables ---------------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; } .tbl tr:last-child td { border-bottom: none; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: var(--panel-2); } .tbl tr.click td:first-child { border-radius: 6px 0 0 6px; } .tbl tr.click td:last-child { border-radius: 0 6px 6px 0; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; } .tbl-wrap { overflow-x: auto; }
.tbl td .chip { margin: 1px 0; } .tbl .btn-xs, .tbl .btn-sm { vertical-align: middle; }

/* ---------------- notes, toasts, progress ---------------- */
.note { border-radius: var(--r-sm); padding: 10px 14px; font-size: 13px; border: 1px solid; margin-bottom: 12px; }
.note-info { background: var(--teal-50); border-color: #CFE7E5; color: var(--teal-700); } .note-warn { background: var(--amber-100); border-color: #EED9A8; color: var(--amber-700); }
.note-error { background: var(--red-100); border-color: #EABCB6; color: var(--red); } .note-ok { background: var(--green-100); border-color: #BFE0CC; color: var(--green); }
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--navy-900); color: #fff; padding: 10px 14px; border-radius: 10px; font-size: 13px; box-shadow: var(--shadow-md); animation: fade 4s forwards; display: flex; align-items: center; gap: 8px; max-width: 420px; }
.toast::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--teal-400); flex: none; } .toast.error { background: var(--red); } .toast.error::before { background: #fff; }
@keyframes fade { 0%,80% { opacity: 1 } 100% { opacity: 0 } }
.pbar { position: fixed; left: 0; top: 0; height: 2px; width: 0; background: var(--teal-400); z-index: 200; opacity: 0; transition: width .3s ease, opacity .3s; }
body.pending .pbar { opacity: 1; width: 78%; transition: width 6s cubic-bezier(.1,.7,.2,1), opacity .2s; }

/* ---------------- tooth chart ---------------- */
.tooth-chart { width: 100%; max-width: 760px; } .tooth-chart svg { width: 100%; height: auto; display: block; }
.tooth { cursor: pointer; } .tooth rect { fill: #fff; stroke: var(--slate-300); stroke-width: 1; rx: 6; } .tooth text { font-family: var(--mono); font-size: 11px; fill: var(--navy-700); text-anchor: middle; pointer-events: none; }
.tooth.st-sound rect { fill: #fff; } .tooth.st-restored rect { fill: #DDE7F0; stroke: #7F98B0; } .tooth.st-crown rect { fill: #C8D6E3; stroke: #5B7A99; } .tooth.st-root_canal rect { fill: #E4DDF3; stroke: #8E7CC3; }
.tooth.st-caries rect { fill: var(--coral-100); stroke: var(--coral); } .tooth.st-missing rect { fill: var(--panel); stroke: var(--line); stroke-dasharray: 3 3; } .tooth.st-missing text { fill: var(--slate-300); }
.tooth.st-implant rect { fill: #DDF3EF; stroke: var(--teal); } .tooth.st-impacted rect { fill: var(--amber-100); stroke: var(--amber); } .tooth.st-watch rect { fill: #FFF8E6; stroke: var(--amber); }
.tooth.st-flagged rect { fill: var(--coral-100); stroke: var(--coral); stroke-width: 2; } .tooth.selected rect { stroke: var(--navy-900); stroke-width: 2.5; }
.tooth .flag { fill: var(--coral); } .tooth:hover rect { filter: brightness(.96); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; } .legend span { display: inline-flex; align-items: center; gap: 5px; } .legend i { width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--line); display: inline-block; }
.legend .l-sound { background: #fff } .legend .l-restored { background: #DDE7F0 } .legend .l-crown { background: #C8D6E3 } .legend .l-caries { background: var(--coral-100); border-color: var(--coral) } .legend .l-missing { background: var(--panel); border-style: dashed } .legend .l-flagged { background: var(--coral-100); border-color: var(--coral); border-width: 2px } .legend .l-implant { background: #DDF3EF } .legend .l-root_canal { background:#E4DDF3 }

/* ---------------- image viewer ---------------- */
.viewer { position: relative; background: #0B141C; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line-2); }
.viewer .stage { position: relative; width: 100%; aspect-ratio: 2 / 1; overflow: hidden; cursor: grab; touch-action: none; } .viewer.portrait .stage { aspect-ratio: 3 / 4; } .viewer.square .stage { aspect-ratio: 4 / 3; }
.viewer .layer { position: absolute; left: 0; top: 0; transform-origin: 0 0; } .viewer img { display: block; user-select: none; -webkit-user-drag: none; }
.viewer .box { position: absolute; border: 2px solid var(--teal-400); border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.4); }
.viewer .box.sev-3 { border-color: var(--coral); } .viewer .box.sev-2 { border-color: #F7B267; } .viewer .box.sev-0 { border-color: var(--slate-300); border-style: dashed; }
.viewer .box .tag { position: absolute; left: -2px; top: -20px; background: var(--navy-900); color: #fff; font-family: var(--mono); font-size: 10px; padding: 1px 5px; border-radius: 3px; white-space: nowrap; }
.viewer .toolbar { position: absolute; right: 10px; top: 10px; display: flex; gap: 4px; z-index: 2; background: rgba(15,27,43,.7); padding: 3px; border-radius: 8px; backdrop-filter: blur(6px); }
.viewer .toolbar .btn { padding: 4px 8px; font-size: 12px; background: transparent; color: #fff; border-color: transparent; box-shadow: none; } .viewer .toolbar .btn:hover { background: rgba(255,255,255,.15); }
.viewer .caption { position: absolute; left: 10px; bottom: 10px; display: flex; gap: 6px; z-index: 2; flex-wrap: wrap; } .viewer .caption .chip { background: rgba(15,27,43,.78); color: #fff; backdrop-filter: blur(6px); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; } .thumb { border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: #0B141C; cursor: pointer; position: relative; transition: box-shadow .12s; } .thumb:hover { box-shadow: var(--shadow-md); } .thumb img { width: 100%; height: 100px; object-fit: cover; display: block; }
.thumb .cap { font-size: 11.5px; padding: 6px 8px; background: #fff; color: var(--muted); display: flex; justify-content: space-between; gap: 6px; } .thumb.active { outline: 2px solid var(--teal); }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .compare .pane { position: relative; background: #0B141C; border-radius: var(--r); overflow: hidden; } .compare img { width: 100%; display: block; } .compare .lbl { position: absolute; left: 8px; top: 8px; }
.lightbox { position: fixed; inset: 0; background: rgba(6,12,18,.94); z-index: 90; display: flex; align-items: center; justify-content: center; } .lightbox img { max-width: 96vw; max-height: 92vh; }
.lightbox .close { position: absolute; top: 14px; right: 18px; color: #fff; font-size: 28px; cursor: pointer; background: none; border: none; }

/* ---------------- timeline ---------------- */
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); } .timeline li { position: relative; padding: 0 0 16px 16px; }
.timeline li::before { content: ""; position: absolute; left: -24px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--teal); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--teal-100); }
.timeline li.payer::before { background: var(--navy-700); box-shadow: 0 0 0 2px var(--line); } .timeline li.alert::before { background: var(--coral); box-shadow: 0 0 0 2px var(--coral-100); }
.timeline .when { font-family: var(--mono); font-size: 11.5px; color: var(--muted); } .timeline .what { font-weight: 600; } .timeline .where { color: var(--muted); font-size: 12.5px; }

/* ---------------- completeness ring & checklist ---------------- */
.ring { --p: 0; width: 84px; height: 84px; border-radius: 50%; background: conic-gradient(var(--teal) calc(var(--p) * 1%), var(--panel) 0); display: grid; place-items: center; flex: none; }
.ring > div { width: 66px; height: 66px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px; color: var(--ink); text-align: center; line-height: 1.1; } .ring small { display: block; font-size: 10px; color: var(--muted); font-weight: 500; }
.ring.warn { background: conic-gradient(var(--coral) calc(var(--p) * 1%), var(--panel) 0); }
.checklist { list-style: none; margin: 0; padding: 0; } .checklist li { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; } .checklist li:last-child { border-bottom: none; }
.checklist .ok, .checklist .no { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; } .checklist .ok { background: var(--green-100); color: var(--green); } .checklist .no { background: var(--coral-100); color: var(--coral-700); }
.checklist .d { color: var(--muted); font-size: 12.5px; }

/* ---------------- proposals ---------------- */
.proposal { border: 1px solid var(--line-2); border-left: 3px solid var(--amber); border-radius: 10px; padding: 12px 14px; background: #fff; margin-bottom: 10px; }
.proposal.accepted { border-left-color: var(--green); } .proposal.modified { border-left-color: var(--teal); } .proposal.rejected { border-left-color: var(--slate-300); opacity: .8; }
.proposal .ph { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; flex-wrap: wrap; } .proposal .title { font-weight: 650; } .proposal .actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.proposal .ev { font-size: 12.5px; color: var(--muted); margin-top: 4px; } .proposal .decided { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.opt { border: 1px solid var(--line-2); border-radius: 8px; padding: 10px 12px; margin-top: 8px; } .opt.rec { border-color: var(--teal); background: var(--teal-50); }

/* ---------------- rule trace & decisions ---------------- */
.trace { font-size: 13px; } .trace .row { display: grid; grid-template-columns: 22px 150px 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line-2); align-items: start; } .trace .row:last-child { border-bottom: none; }
.trace .pass { color: var(--green); font-weight: 700; } .trace .fail { color: var(--coral-700); font-weight: 700; } .trace .chk { font-family: var(--mono); font-size: 11.5px; color: var(--muted); text-transform: uppercase; }
.decision { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; font-size: 14px; padding: 6px 12px; border-radius: 8px; }
.decision-approved { background: var(--green-100); color: var(--green); } .decision-denied { background: var(--red-100); color: var(--red); } .decision-review { background: var(--amber-100); color: var(--amber-700); } .decision-partially_approved { background: var(--amber-100); color: var(--amber-700); }

/* ---------------- tabs & side navigation ---------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs a, .tabs button { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--muted); background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer; margin-bottom: -1px; }
.tabs a:hover, .tabs button:hover { color: var(--ink); text-decoration: none; }
.tabs a.active, .tabs button.active { color: var(--ink); border-bottom-color: var(--teal); } .tab-pane { display: none; } .tab-pane.active { display: block; }
.sidenav { display: flex; flex-direction: column; gap: 2px; } .sidenav a { padding: 8px 12px; border-radius: 8px; color: var(--ink-2); font-weight: 500; } .sidenav a.active, .sidenav a:hover { background: var(--white); box-shadow: var(--shadow); text-decoration: none; color: var(--ink); }

/* ---------------- bars ---------------- */
.bar { height: 8px; background: var(--panel); border-radius: 999px; overflow: hidden; } .bar > i { display: block; height: 100%; background: var(--teal); border-radius: 999px; } .bar.coral > i { background: var(--coral); } .bar.navy > i { background: var(--navy-600); }
.barrow { display: grid; grid-template-columns: 200px 1fr 60px; gap: 10px; align-items: center; font-size: 13px; padding: 5px 0; } .barrow .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.spark { width: 100%; height: 90px; }

/* ---------------- dark theme (Department dashboard) ---------------- */
body.theme-dark { background: var(--navy-900); color: #E9EDF1; } .theme-dark .side { border-right: 1px solid #1F2E42; }
.theme-dark .card, .theme-dark .kpi { background: var(--navy-800); border-color: #24344A; box-shadow: none; }
.theme-dark .kpi .v, .theme-dark h1, .theme-dark h2, .theme-dark h3 { color: #fff; } .theme-dark .kpi .l, .theme-dark .muted, .theme-dark h4, .theme-dark .tbl th, .theme-dark .page-head .sub { color: var(--slate-200); }
.theme-dark .tbl th { border-color: #2A3B52; } .theme-dark .tbl td { border-color: #24344A; color: #E9EDF1; } .theme-dark .bar { background: #24344A; } .theme-dark .barrow { color: #E9EDF1; }
.theme-dark .kpi.accent .v { color: var(--teal-400); } .theme-dark .kpi.warn .v { color: var(--coral); }
.theme-dark a { color: var(--teal-400); } .theme-dark .chip-grey { background: #24344A; color: var(--slate-200); } .theme-dark .btn { background: var(--navy-800); color: #fff; border-color: #34495E; box-shadow: none; } .theme-dark .btn:hover { background: var(--navy-700); }
.theme-dark .tabs a { color: var(--slate-200); } .theme-dark .tabs a.active { color: #fff; border-bottom-color: var(--teal-400); } .theme-dark .tabs { border-color: #24344A; }

/* ---------------- sign-in ---------------- */
.signin-wrap { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; background: radial-gradient(1200px 600px at 20% -10%, var(--teal-50), transparent), radial-gradient(900px 500px at 110% 110%, #EEF3F8, transparent), var(--paper); }
.signin { width: 100%; max-width: 440px; }
.signin .brand { color: var(--ink); padding: 0; margin-bottom: 26px; justify-content: center; font-size: 17px; } .signin .brand .brand-sub { color: var(--muted); }
.signin h1 { font-size: 22px; text-align: center; margin-bottom: 4px; } .signin .sub { text-align: center; color: var(--muted); margin-bottom: 22px; }
.persona-grid { display: flex; flex-direction: column; gap: 8px; } .persona-grid form { margin: 0; display: flex; }
.persona-card { background: #fff; border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); display: flex; gap: 12px; align-items: center; text-align: left; cursor: pointer; font: inherit; width: 100%; color: var(--ink); transition: border-color .12s, box-shadow .12s, transform .12s; }
.persona-card:hover { border-color: var(--teal); box-shadow: var(--shadow-md); transform: translateY(-1px); } .persona-card:focus-visible { outline: none; box-shadow: var(--focus); }
.persona-card .avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--teal-100); color: var(--teal-700); display: grid; place-items: center; font-weight: 700; flex: none; font-size: 13px; }
.persona-card > span:nth-child(2) { flex: 1; min-width: 0; } .persona-card .n { font-weight: 650; display: block; } .persona-card .b { color: var(--muted); font-size: 12.5px; display: block; }
.persona-card .chev { color: var(--slate-300); flex: none; }
.signin .foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 22px; } .signin .foot a { color: var(--muted); margin: 0 6px; }

/* ---------------- misc ---------------- */
.hero { background: linear-gradient(135deg, var(--navy-900), var(--navy-700)); color: #fff; border-radius: 14px; padding: 28px 30px; margin-bottom: 22px; }
.hero h1 { color: #fff; font-size: 26px; } .hero p { color: #D4DBE1; max-width: 760px; } .hero .chip { background: rgba(255,255,255,.12); color: #fff; }
details.more summary { cursor: pointer; color: var(--teal-700); font-weight: 600; font-size: 13px; } details.more[open] summary { margin-bottom: 8px; }
pre.code { background: var(--navy-900); color: #DFF3F3; border-radius: 10px; padding: 12px 14px; font-family: var(--mono); font-size: 12px; overflow-x: auto; margin: 0; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; font-size: 13px; } .kv dt { color: var(--muted); } .kv dd { margin: 0; }
.evidence { display: inline-flex; align-items: center; gap: 6px; background: var(--panel); border-radius: 6px; padding: 3px 8px; font-size: 12px; color: var(--ink-2); margin: 2px 4px 2px 0; }
.empty { color: var(--muted); text-align: center; padding: 26px 12px; font-size: 13px; }
.print-only { display: none; }
@media print { .side, .pbar, .toasts, footer.foot, .no-print { display: none !important; } .shell { display: block; } body { background: #fff; } main.content { padding: 0; max-width: none; } .card { box-shadow: none; break-inside: avoid; } .print-only { display: block; } }
body.bare main.content { padding: 0; max-width: none; }
.tbl .decision { font-size: 12.5px; padding: 4px 9px; white-space: nowrap; }
.decision { white-space: nowrap; }
.compare { align-items: start; }

.persona > a:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: #fff; } .persona > a:hover { text-decoration: none; color: #fff; }
.persona a.avatar { text-decoration: none; }
.signin .card { padding: 26px 28px; } .signin .card h1 { text-align: left; } .signin .card .sub { text-align: left; margin-bottom: 18px; }
.btn-block { width: 100%; padding: 10px 14px; font-size: 14px; }

/* ---------------- design review pass: tables, filters, dialogs, responsive, focus ---------------- */
.tbl td.num, .tbl th.num, .tbl td.mono, .tbl td.nowrap, .tbl td.right, .tbl a.mono, .tbl td > .mono:only-child { white-space: nowrap; }
.tbl td .chip, .tbl td .decision { white-space: nowrap; }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; position: relative; margin: 0 -22px; padding: 0 22px; }
.card.tight .tbl-wrap { margin: 0 -16px; padding: 0 16px; }
.tbl-wrap.scrollable { mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
.tbl-wrap.scrollable.at-end { mask-image: none; -webkit-mask-image: none; }
.card > table.tbl { display: block; overflow-x: auto; }
.card > table.tbl > thead, .card > table.tbl > tbody { display: table; width: 100%; }
.tbl.compact td { padding: 6px 10px; }
.tbl th.right { text-align: right; }
.tbl .btn-primary { background: var(--white); color: var(--ink); border-color: var(--line); } .tbl .btn-primary:hover { background: var(--panel-2); border-color: var(--slate-300); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; } .pager .btn { min-width: 34px; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; } .filters .field { margin: 0; min-width: 140px; flex: 0 1 auto; }
.filters label { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 3px; font-weight: 600; } .filters .grow { flex: 1 1 200px; }
.filters select, .filters input { width: 100%; } .filters .actions { display: flex; gap: 6px; align-items: center; padding-bottom: 1px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

input:disabled, select:disabled, textarea:disabled, input[readonly], textarea[readonly] { background: var(--panel-2); color: var(--ink-2); border-color: var(--line-2); cursor: default; }
.theme-dark select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23B4C0CE' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.theme-dark input, .theme-dark select, .theme-dark textarea { background-color: var(--navy-800); color: #E9EDF1; border-color: #34495E; }
.pw-field { display: flex; gap: 6px; align-items: center; } .pw-field input { flex: 1; } .pw-toggle { flex: none; }
input[type=file] { padding: 7px 10px; border: 1px dashed var(--line); border-radius: var(--r-sm); background: var(--panel-2); width: 100%; }
input[type=file]::file-selector-button { font: inherit; font-size: 12.5px; font-weight: 600; padding: 4px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); margin-right: 10px; cursor: pointer; }

/* dialogs (confirmations, modify / reject forms) */
dialog.dlg { border: none; border-radius: 14px; padding: 0; width: min(440px, calc(100vw - 32px)); box-shadow: 0 24px 64px rgba(15,27,43,.22); color: var(--ink); font-family: var(--font); }
dialog.dlg::backdrop { background: rgba(15,27,43,.45); backdrop-filter: blur(2px); }
dialog.dlg form { padding: 22px 24px; margin: 0; } dialog.dlg h3 { margin-bottom: 6px; font-size: 16px; } dialog.dlg .dlg-body { font-size: 13.5px; margin: 0 0 16px; }
dialog.dlg .dlg-actions { display: flex; justify-content: flex-end; gap: 8px; } dialog.dlg .field { margin-bottom: 12px; }
dialog.dlg .btn-danger.btn-fill { background: var(--red); color: #fff; border-color: var(--red); }
.btn-danger.btn-fill { background: var(--red); color: #fff; border-color: var(--red); } .btn-danger.btn-fill:hover { background: #A93226; }

/* error page */
.error-card { max-width: 480px; margin: 12vh auto 0; text-align: center; padding: 34px 30px; } .error-card .code { font-size: 44px; font-weight: 700; color: var(--slate-300); letter-spacing: -0.03em; line-height: 1; margin-bottom: 8px; }
.error-card h1 { font-size: 20px; } .error-card p { margin-bottom: 18px; }

/* toasts */
.toast { cursor: pointer; } .toast.error { animation: none; background: var(--red); } .toast .x { margin-left: 6px; opacity: .7; font-weight: 700; }

/* focus visibility and keyboard rows */
.nav a:focus-visible, .tabs a:focus-visible, .tabs button:focus-visible, .sidenav a:focus-visible, .side-links a:focus-visible, .persona a:focus-visible, a.btn:focus-visible, .thumb:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 8px; }
tr.click:focus-visible { outline: none; } tr.click:focus-visible td { background: var(--teal-50); } tr.click:focus-visible td:first-child { box-shadow: inset 3px 0 0 var(--teal); }

/* compact tooth chart in narrow columns */
.tooth-chart.mini .tooth text, .tooth-chart.mini > svg > text { display: none; } .tooth-chart.mini .tooth rect { rx: 3; } .tooth-chart.mini .legend { display: none; }

/* sparkline sizing */
.spark { height: 64px; max-width: 360px; }

/* empty states */
.empty { color: var(--muted); text-align: center; padding: 22px 12px; font-size: 13px; border: 1px dashed var(--line); border-radius: 10px; background: var(--panel-2); }
.empty strong { display: block; color: var(--ink-2); font-weight: 600; margin-bottom: 2px; }

/* page head wrapping and inputs */
.page-head > .flex { flex-wrap: wrap; } .page-head input[type=search], .page-head input[type=text] { min-width: 0; }
.grid > * { min-width: 0; } input[type=number] { min-width: 0; }

/* responsive tuning */
@media (max-width: 1100px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-2, .grid-side, .grid-side-l { grid-template-columns: 1fr; }
  .sidenav.tabs { flex-direction: row; flex-wrap: wrap; position: static; border-bottom: 1px solid var(--line); gap: 2px; margin-bottom: 14px; }
  .sidenav.tabs a { border-radius: 0; box-shadow: none; border-bottom: 2px solid transparent; background: none; } .sidenav.tabs a.active { border-bottom-color: var(--teal); background: none; color: var(--ink); }
  main.content { padding: 22px 20px 48px; }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } .page-head { flex-direction: column; align-items: stretch; } .page-head > .flex { width: 100%; }
  .page-head form.flex input { flex: 1 1 140px; width: auto !important; } .tbl-wrap { margin: 0 -16px; padding: 0 16px; } .card { padding: 16px; }
  .kpi .v { font-size: 24px; } .hide-sm { display: none !important; }
}

/* ---------------- charts ---------------- */
.chart { width: 100%; height: auto; display: block; font-family: var(--font); } .chart .grid { stroke: var(--line-2); stroke-width: 1; } .chart .tick { font-size: 10.5px; fill: var(--muted); font-family: var(--mono); }
.chart .lab { font-size: 11px; fill: var(--ink-2); } .chart .val { font-size: 10.5px; fill: var(--ink-2); font-weight: 600; } .chart.donut { max-width: 220px; margin: 0 auto; }
.chart .center { font-size: 26px; font-weight: 700; fill: var(--ink); } .chart .sub { font-size: 11px; fill: var(--muted); }
.theme-dark .chart .grid { stroke: #24344A; } .theme-dark .chart .tick, .theme-dark .chart .sub { fill: var(--slate-200); } .theme-dark .chart .lab, .theme-dark .chart .val { fill: #E9EDF1; } .theme-dark .chart .center { fill: #fff; }
.tilemap { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; } .tile { border-radius: 10px; padding: 12px 14px; color: var(--ink); text-decoration: none; display: block; min-height: 78px; }
.tile.dark, .tile.dark .t-sub { color: #fff; } .tile:hover { text-decoration: none; filter: brightness(.97); } .tile .t-label { font-size: 12px; font-weight: 600; } .tile .t-value { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin-top: 2px; } .tile .t-sub { font-size: 11px; color: var(--ink-2); }
.theme-dark .tile { color: var(--ink); }

/* ---------------- stepper / progress ---------------- */
.steps { display: flex; gap: 0; counter-reset: st; margin: 6px 0 14px; flex-wrap: wrap; } .steps > div { flex: 1 1 120px; position: relative; padding: 0 10px 0 0; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; min-width: 0; }
.steps > div::before { counter-increment: st; content: counter(st); width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); background: #fff; display: grid; place-items: center; font-weight: 700; font-size: 11.5px; color: var(--muted); flex: none; }
.steps > div.done::before { background: var(--teal); border-color: var(--teal); color: #fff; content: "✓"; } .steps > div.now { color: var(--ink); font-weight: 600; } .steps > div.now::before { border-color: var(--teal); color: var(--teal-700); }
.steps > div:not(:last-child)::after { content: ""; flex: 1; height: 2px; background: var(--line-2); margin-left: 4px; } .steps > div.done:not(:last-child)::after { background: var(--teal-100); }
.theme-dark .steps > div::before { background: var(--navy-800); border-color: #34495E; }

/* ---------------- misc for new features ---------------- */
.risk-high { color: var(--coral-700); } .risk-moderate { color: var(--amber-700); } .risk-low { color: var(--green); }
.chip-risk-high { background: var(--coral-100); color: var(--coral-700); } .chip-risk-moderate { background: var(--amber-100); color: var(--amber-700); } .chip-risk-low { background: var(--green-100); color: var(--green); }
.qr { display: block; margin: 8px auto; } .qr-fallback { word-break: break-all; }
.banner { border-radius: 10px; padding: 10px 14px; display: flex; gap: 10px; align-items: flex-start; font-size: 13px; margin-bottom: 14px; }
.banner-safety { background: var(--coral-100); color: var(--coral-700); border: 1px solid #F3C3B7; } .banner-safety strong { color: var(--coral-700); }
.banner-info { background: var(--teal-50); color: var(--teal-700); border: 1px solid #CFE7E5; }
.perio-grid { display: grid; grid-template-columns: 60px repeat(6, 1fr); gap: 3px; font-size: 12px; font-family: var(--mono); } .perio-grid .h { color: var(--muted); font-size: 10.5px; text-align: center; } .perio-grid .c { text-align: center; padding: 4px 0; border-radius: 4px; background: var(--panel-2); }
.perio-grid .c.d4 { background: var(--amber-100); color: var(--amber-700); } .perio-grid .c.d6 { background: var(--coral-100); color: var(--coral-700); font-weight: 700; } .perio-grid .c.bop { box-shadow: inset 0 -2px 0 var(--coral); }
.dose-bar { height: 10px; border-radius: 999px; background: var(--panel); overflow: hidden; } .dose-bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--teal-400), var(--amber)); }
.signature-pad { border: 1px dashed var(--line); border-radius: 10px; background: #fff; touch-action: none; width: 100%; height: 160px; }
.rtl, [dir=rtl] { direction: rtl; text-align: right; }
.timeline-h { display: flex; gap: 6px; align-items: flex-end; overflow-x: auto; padding-bottom: 6px; } .timeline-h .ev { flex: none; width: 120px; border: 1px solid var(--line-2); border-radius: 8px; padding: 8px; font-size: 12px; background: #fff; }
.card.highlight { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-100); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } @media (max-width: 800px) { .split { grid-template-columns: 1fr; } }
