/* Vitro panel shell. Tokens from docs/DOMAIN.md section 6. Mobile first, RTL, no external assets. */
@font-face {
  font-family: "Vazirmatn";
  src: url("fonts/Vazirmatn-Variable.f6d31671339d.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --navy: #15283d;
  --amber: #ffb86b;      /* background only, with navy text */
  --blue: #3b6fd6;       /* links and primary buttons; 4.9:1 on white */
  --blue-dark: #2f5ab3;
  --bg: #f3f5f9;
  --surface: #ffffff;
  --line: #dde3ec;
  --text: #15283d;
  --muted: #56657a;
  --danger: #b3261e;
  --radius: 12px;
  --space: 16px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Vazirmatn", Tahoma, sans-serif;
  font-size: 16px;
  line-height: 1.8;
  color: var(--text);
  background: var(--bg);
}

h1 { font-size: 1.35rem; line-height: 1.5; margin: 0 0 8px; text-wrap: balance; }
h2 { font-size: 1.05rem; line-height: 1.6; margin: 0 0 4px; }
p { margin: 0 0 12px; }
a { color: var(--blue); }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px var(--space);
  background: var(--navy);
  color: #fff;
}
.brand { font-weight: 800; font-size: 1.1rem; color: #fff; text-decoration: none; }
.brand-lg { color: var(--navy); font-size: 1.5rem; margin-block-end: 16px; }
.topbar-clinic { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: 0.85; }
.topbar-logout { margin: 0; }

/* Layout */
.layout { display: block; }
.sidenav {
  display: flex;
  gap: 4px;
  padding: 8px var(--space);
  background: var(--surface);
  border-block-end: 1px solid var(--line);
  overflow-x: auto;
}
.sidenav a {
  flex: none;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.sidenav a:hover { background: var(--bg); }
.sidenav a.is-active { background: var(--amber); font-weight: 700; }
.content { padding: var(--space); max-width: 880px; }

@media (min-width: 900px) {
  .layout { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 56px); }
  .sidenav { flex-direction: column; padding: var(--space); border-block-end: 0; border-inline-end: 1px solid var(--line); overflow: visible; }
  .sidenav a { border-radius: 8px; }
  .content { padding: 28px 32px; }
}

.page-head { margin-block-end: 16px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-block-end: var(--space);
}
.card-empty { border-style: dashed; background: transparent; }

/* Forms */
label { display: block; font-weight: 600; margin: 14px 0 6px; }
input, select {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  font: inherit;
  color: var(--text);
  background: #fff;
  border: 1px solid #b8c2d1;
  border-radius: 10px;
}
input[dir="ltr"] { text-align: left; }
input[aria-invalid="true"] { border-color: var(--danger); }
.input-code { font-size: 1.5rem; letter-spacing: 0.4em; text-align: center; font-variant-numeric: tabular-nums; }
.field-error { color: var(--danger); font-size: 0.9rem; margin: 6px 0 0; }
.form .btn { margin-block-start: 20px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 20px;
  font: inherit;
  font-weight: 700;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-quiet { background: transparent; color: inherit; border-color: currentColor; min-height: 40px; padding: 6px 14px; font-weight: 500; }
.btn-block { width: 100%; margin-block-start: 18px; }
.btn-choice { width: 100%; justify-content: space-between; background: #fff; color: var(--text); border-color: var(--line); margin-block-end: 8px; }
.btn-choice:hover { border-color: var(--blue); }

/* Sign-in pages */
body.auth { display: grid; place-items: center; min-height: 100vh; padding: var(--space); }
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px 24px;
}

/* Session 3: brief wizard, notices, uploads */
.steps-nav { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 16px; counter-reset: st; }
.steps-nav li { counter-increment: st; }
.steps-nav a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: 0.875rem; }
.steps-nav a::before { content: counter(st, persian); font-weight: 700; color: var(--muted); }
.steps-nav .is-done a { border-color: #9fc3a8; }
.steps-nav .is-done a::before { content: "✓"; color: #1f7a3a; }
.steps-nav .is-current a { background: var(--amber); border-color: var(--amber); font-weight: 700; }
fieldset { border: 0; padding: 0; margin: 0 0 22px; }
legend { font-weight: 800; font-size: 1.05rem; margin-bottom: 4px; }
textarea { width: 100%; padding: 10px 14px; font: inherit; color: var(--text); border: 1px solid #b8c2d1; border-radius: 10px; background: #fff; resize: vertical; }
.hint { color: var(--muted); font-size: 0.9rem; margin: 6px 0 0; }
.notice { background: #fff6e8; border: 1px solid #f4d3a1; border-radius: 10px; padding: 10px 14px; }
.badge-ok { color: #1f6b35; background: #e8f5ec; border-radius: 8px; padding: 6px 12px; display: inline-block; }
.badge-wait { color: #6a4a00; background: #fff3d6; border-radius: 8px; padding: 6px 12px; display: inline-block; }
.card-warn { border-color: #e8b04b; background: #fffaf0; }
.card h3 { font-size: 1rem; margin: 0 0 8px; }
.row2 { display: grid; gap: 0 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .row2 { grid-template-columns: 1fr 1fr; } }
.check { display: flex; align-items: flex-start; gap: 8px; font-weight: 500; margin: 8px 0; }
.check input { width: auto; min-height: 0; margin-top: 6px; }
.choice-grid { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.phone-row, .edu-row { display: grid; gap: 8px; grid-template-columns: 1fr; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
@media (min-width: 640px) { .phone-row { grid-template-columns: 1.2fr 1fr auto; align-items: center; } .edu-row { grid-template-columns: 2fr 0.6fr 0.6fr; } .why-row { grid-template-columns: 1fr 2fr; } }
.hours-form { width: 100%; border-collapse: collapse; }
.hours-form th, .hours-form td { padding: 6px 4px; text-align: right; border-bottom: 1px solid var(--line); }
.hours-form .range { display: flex; align-items: center; gap: 6px; }
.hours-form input { min-height: 40px; padding: 6px 8px; text-align: center; }
@media (max-width: 640px) { .hours-form thead { display: none; } .hours-form tr { display: block; padding: 8px 0; } .hours-form th, .hours-form td { display: block; border: 0; } }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.form-actions .btn { margin: 0; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.btn-sm { min-height: 34px; padding: 4px 12px; font-size: 0.85rem; }
.thumbs { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); margin: 10px 0; }
.thumb { margin: 0; background: var(--bg); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.thumb img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 6px; }
.file-pick { display: inline-flex; flex-direction: column; gap: 6px; font-weight: 600; margin: 8px 0; }
.file-pick input { min-height: 0; padding: 8px; }
.recorder { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.recorder .btn { margin: 0; }
.voice-card textarea { margin-bottom: 8px; }
.plain-list { padding-inline-start: 20px; }
.plain-list li { margin-bottom: 6px; }
.palette-grid { display: flex; gap: 12px; flex-wrap: wrap; }
.palette { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; background: #fff; }
.palette input { width: auto; min-height: 0; }
.swatch { width: 28px; height: 28px; border-radius: 50%; }
.swatch-ocean { background: linear-gradient(135deg, #0061FE, #15283D); }
.swatch-teal { background: linear-gradient(135deg, #0F766E, #14302E); }
.swatch-violet { background: linear-gradient(135deg, #6D28D9, #24173D); }
.swatch-silver { background: linear-gradient(135deg, #E6E6E8, #5F5F66 45%, #1B1B1D); }
.swatch-champagne { background: linear-gradient(135deg, #E9D9B4, #8A6A2F 45%, #1E1A14); }
.swatch-emerald { background: linear-gradient(135deg, #A9CDBE, #2F6B57 45%, #14201C); }
.swatch-rose { background: linear-gradient(135deg, #FBE9EC, #B8475D 55%, #3A2230); }
.swatch-peach { background: linear-gradient(135deg, #FCEBE3, #C2593A 55%, #3B2620); }
.swatch-sage { background: linear-gradient(135deg, #E8F1EA, #4F7D5E 55%, #22322A); }
.looks { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin: 8px 0 14px; }
.look-card { border: 1px solid var(--line, #e3e8ef); border-radius: 14px; padding: 14px; background: #fff; }
.look-card.is-current { border-color: currentColor; box-shadow: 0 0 0 1px currentColor inset; }
.look-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.look-card .hint { margin: 4px 0 10px; }
.findings { padding-inline-start: 18px; }
.findings li { margin-bottom: 12px; }
.findings p { margin: 0 0 2px; }
.terms p { margin-bottom: 10px; }
.terms .h3 { margin-top: 16px; }

/* Session 4: doctor panel */
.messages:empty { display: none; }
.msg { border-radius: 10px; padding: 10px 14px; margin: 0 0 12px; background: #e8f5ec; color: #1f6b35; }
.msg-error { background: #fdecea; color: var(--danger); }
.msg-warning { background: #fff3d6; color: #6a4a00; }
.page-block { border-top: 1px solid var(--line); padding: 8px 0; }
.page-block summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
.section-list { list-style: none; padding: 0; margin: 0; }
.section-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.section-list li.is-off .s-name { color: var(--muted); text-decoration: line-through; }
.s-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.s-actions form { margin: 0; }
.s-actions .btn { margin: 0; }
.versions { list-style: none; padding: 0; margin: 0; }
.versions li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.versions form { margin: 0; }
.versions .btn { margin: 0; }
.live-findings:empty { display: none; }
.live-findings { background: #fffaf0; border: 1px solid #e8b04b; border-radius: 10px; padding: 8px 12px; margin-top: 6px; font-size: 0.9rem; }
.live-finding { margin: 0 0 6px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; }
.inline-form input { flex: 1 1 240px; }
.inline-form .btn { margin: 0; }
.item-form.is-off { opacity: 0.65; }
.item-photo { width: 120px; aspect-ratio: 1; object-fit: cover; border-radius: 10px; margin-top: 10px; }
.thumb-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.thumb-actions form { margin: 0; }
.thumb-actions .btn { margin: 0; }
.replace-form { margin: 0; }
.replace-form .file-pick { font-size: 0.85rem; margin: 0; }
.suggestions { background: #f0f5ff; border: 1px solid #c9d8f5; border-radius: 10px; padding: 10px 14px; margin-top: 10px; }
.suggestions ul { list-style: none; padding: 0; margin: 0; }
.suggestions summary { cursor: pointer; font-weight: 600; }
.thread .msg-card.from-staff { border-color: #c9d8f5; background: #f7faff; }

/* Session 7: team panel */
.ops-top { background: #0d1c2d; }
.impersonation { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px var(--space); background: var(--danger); color: #fff; font-weight: 700; font-size: 0.9rem; }
.impersonation form { margin: 0; }
.impersonation .btn { background: #fff; color: var(--danger); min-height: 34px; }
.tasks { list-style: none; padding: 0; margin: 0; }
.task { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.task.is-overdue { border-inline-start: 4px solid var(--danger); padding-inline-start: 10px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.stat { display: flex; flex-direction: column; align-items: center; padding: 12px 6px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--text); }
.stat b { font-size: 1.4rem; }
.stat span { font-size: 0.8rem; color: var(--muted); text-align: center; }
.kanban { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .kanban { grid-template-columns: repeat(3, 1fr); } }
.kcol h2 { font-size: 1rem; }
.kcard { display: flex; flex-direction: column; gap: 2px; padding: 12px; margin-bottom: 8px; text-decoration: none; color: var(--text); }
.kcard:hover { border-color: var(--blue); }
.search { margin-bottom: 12px; }
.timeline { list-style: none; padding: 0; margin: 0; font-size: 0.9rem; }
.timeline li { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.tl-money { color: #1f6b35; }
.secret { font-family: monospace; font-size: 1.1rem; word-break: break-all; background: var(--bg); padding: 10px; border-radius: 8px; }
.auth-card a, .auth-card p { overflow-wrap: anywhere; }
.receipt-img { max-width: 100%; border-radius: 10px; margin-top: 12px; }
form.inline { display: inline; }
.inline-form .grow { flex: 1 1 160px; align-self: center; }
.compare .total th, .compare .total td { font-weight: 800; }

/* Session 6: plans, invoices */
.content.public { margin-inline: auto; max-width: 980px; }
.plan-grid { display: grid; gap: var(--space); grid-template-columns: 1fr; margin-bottom: var(--space); }
@media (min-width: 760px) { .plan-grid { grid-template-columns: repeat(3, 1fr); } }
.plan { display: flex; flex-direction: column; margin: 0; }
.plan .btn-block { margin-top: auto; }
.plan-featured { border: 2px solid var(--blue); }
.price { font-size: 1.35rem; font-weight: 800; margin: 8px 0 4px; }
.table-wrap { overflow-x: auto; }
.compare { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.compare th, .compare td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: center; }
.compare tbody th { text-align: right; font-weight: 500; }
.invoice-lines { width: 100%; border-collapse: collapse; margin: 16px 0; }
.invoice-lines td { padding: 8px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.invoice-lines td:last-child { text-align: left; white-space: nowrap; font-variant-numeric: tabular-nums; }
.invoice-lines .total td { font-weight: 800; border-bottom: 0; }
.sub-banner { margin-bottom: 12px; }

/* Session 5: appointments */
.subnav { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 16px; padding-bottom: 4px; }
.subnav a { flex: none; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: 0.875rem; }
.subnav a.is-current { background: var(--amber); border-color: var(--amber); font-weight: 700; }
.day-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.day-head h2 { margin: 0; text-align: center; }
.day-jump { margin: 12px 0; align-items: center; }
.day-jump input { flex: 1 1 120px; min-height: 40px; }
.appts { list-style: none; padding: 0; margin: 0; }
.appt { padding: 12px 0; border-bottom: 1px solid var(--line); }
.appt-main { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.appt-time { font-weight: 800; font-variant-numeric: tabular-nums; }
.appt-tel { text-decoration: none; }
.appt-note { margin: 6px 0 0; color: var(--muted); font-size: 0.9rem; }
.appt .s-actions { margin-top: 8px; }
.appt.is-cancelled .appt-main, .appt.is-noshow .appt-main { color: var(--muted); }
.badge { border-radius: 8px; padding: 2px 10px; font-size: 0.8rem; background: var(--bg); }
.badge-new { background: #fff3d6; color: #6a4a00; }
.badge-confirmed { background: #e8f5ec; color: #1f6b35; }
.badge-done { background: #e8eefb; color: #2f5ab3; }
.badge-cancelled, .badge-noshow { background: #f1f1f1; color: #555; }
.free-times { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip { display: inline-block; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--text); text-decoration: none; font-variant-numeric: tabular-nums; }
.chip:hover { border-color: var(--blue); }
.vp h1 { margin-bottom: 4px; }
.vp-when { font-size: 1.25rem; font-weight: 800; line-height: 1.7; }
