:root {
  /* Serial Slip: ink-blue chamber register, yellow token slip, red rubber stamp */
  --bg: #f2f5fa;
  --card: #ffffff;
  --ink: #14204a;
  --muted: #5a6382;
  --line: #dde3ef;
  --brand: #1f3a93;
  --brand-ink: #ffffff;
  --brand-soft: #e7ecf8;
  --accent: #d2452c;
  --danger: #c0392b;
  --ok: #1e8e4f;
  --slip: #fff3c4;
  --slip-line: #e2cd7c;
  --radius: 10px;
  --num: "Tiro Bangla", Georgia, serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 "Anek Latin", "Noto Sans Bengali", "Hind Siliguri", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}
.wrap { max-width: 480px; margin: 0 auto; padding: 16px 16px 48px; }
.wrap.wide { max-width: 1100px; }

.top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.top .brand { font-weight: 700; color: var(--brand); font-size: 15px; }
.lang-btn {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 14px; cursor: pointer;
}

.doctor-card {
  position: relative; overflow: hidden;
  background: linear-gradient(165deg, rgba(255,255,255,.07), transparent 55%), var(--brand);
  color: #fff; border-radius: 12px; padding: 20px 16px 16px; margin-bottom: 12px;
  box-shadow: 0 10px 30px -14px rgba(20, 32, 74, .6);
}
.doctor-card::after {
  content: ""; position: absolute; right: -40px; bottom: -40px; width: 160px; height: 160px; border-radius: 50%;
  border: 22px solid rgba(255,255,255,.06); pointer-events: none;
}
.doc-head { display: flex; gap: 12px; align-items: center; }
.avatar {
  flex: 0 0 auto; width: 84px; height: 84px; border-radius: 50%; overflow: hidden;
  border: 3px solid rgba(255,255,255,.85); background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-weight: 700; font-size: 28px; box-shadow: 0 4px 14px rgba(0,0,0,.18);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.doc-id { min-width: 0; }
.doctor-card h1 { margin: 0; font-size: 23px; line-height: 1.2; }
.doctor-card .deg { opacity: .92; font-size: 14px; margin-top: 4px; }
.chip { display: inline-block; margin-top: 8px; padding: 4px 8px; border-radius: 999px; background: rgba(255,255,255,.18); font-size: 13px; font-weight: 600; }
.desig { margin-top: 12px; font-size: 14px; opacity: .95; }
.desig:empty { display: none; }
.facts { display: flex; gap: 8px; margin-top: 12px; }
.fact { flex: 1; background: rgba(255,255,255,.12); border-radius: 8px; padding: 8px 8px; display: flex; flex-direction: column; }
.fact b { font-size: 17px; line-height: 1.2; }
.fact span { font-size: 12px; opacity: .85; }
.doctor-card .meta { margin-top: 12px; font-size: 14px; display: grid; gap: 4px; }
.mrow { display: flex; gap: 8px; align-items: flex-start; }
.mrow .ic { width: 18px; text-align: center; flex: 0 0 18px; }
.mrow span:last-child:empty { display: none; }
.about { margin-top: 8px; font-size: 14px; }
.about summary { cursor: pointer; font-weight: 600; opacity: .95; }
.about p { margin: 4px 0 0; opacity: .92; white-space: pre-line; }
.call {
  display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 12px; padding: 8px; border-radius: 8px;
  background: #fff; color: var(--brand); font-weight: 700; text-decoration: none;
}
.notice { background: #fff6e9; border: 1px solid #f3d3a9; color: #7a4a12; padding: 8px 12px; border-radius: 10px; margin-bottom: 12px; font-size: 14px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.card h2 { margin: 0 0 12px; font-size: 18px; }

label { display: block; font-size: 14px; font-weight: 600; margin: 12px 0 4px; }
input, select, textarea {
  width: 100%; padding: 12px; font: inherit; color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
input.big { font-size: 22px; letter-spacing: 2px; text-align: center; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.btn {
  display: block; width: 100%; padding: 12px; margin-top: 16px; border: 0; border-radius: 8px;
  background: var(--brand); color: var(--brand-ink); font: inherit; font-weight: 700; font-size: 17px; cursor: pointer;
  text-align: center; text-decoration: none;
}
.btn:disabled { opacity: .55; cursor: default; }
.btn.secondary { background: var(--brand-soft); color: var(--brand); }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn.danger { background: #fdecea; color: var(--danger); }
.btn.small { display: inline-block; width: auto; padding: 8px 12px; margin: 0; font-size: 14px; }
.link { background: none; border: 0; color: var(--brand); font: inherit; padding: 0; cursor: pointer; text-decoration: underline; }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg.three { grid-template-columns: repeat(3, 1fr); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label {
  margin: 0; padding: 12px 8px; text-align: center; border: 1px solid var(--line); border-radius: 10px;
  font-weight: 600; cursor: pointer; background: #fff;
}
.seg input:checked + label { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.seg input:focus-visible + label { outline: 2px solid var(--brand); }

.dates { display: grid; gap: 8px; }
.date-opt input { position: absolute; opacity: 0; pointer-events: none; }
.date-opt label {
  margin: 0; display: flex; justify-content: space-between; align-items: center;
  padding: 12px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 600; background: #fff;
}
.date-opt label small { font-weight: 400; color: var(--muted); }
.date-opt input:checked + label { border-color: var(--brand); background: var(--brand-soft); }
.date-opt input:disabled + label { opacity: .5; cursor: not-allowed; }

.msg { margin-top: 8px; font-size: 14px; }
.msg.err { color: var(--danger); }
.msg.ok { color: var(--ok); }
.hint { color: var(--muted); font-size: 14px; margin-top: 8px; }
.testcode { background: #fff6e9; border: 1px dashed var(--accent); padding: 8px 8px; border-radius: 8px; margin-top: 8px; font-size: 14px; }

.ticket { text-align: center; background: var(--slip); border: 1px solid var(--slip-line); position: relative; margin-top: 16px; }
.ticket .serial { font-family: var(--num); font-size: 88px; font-weight: 400; color: var(--brand); line-height: 1; margin: 8px 0 8px; }
.ticket .tear { border-top: 2px dashed var(--slip-line); margin: 8px -16px 4px; position: relative; }
.ticket .tear::before, .ticket .tear::after { content: ""; position: absolute; top: -11px; width: 20px; height: 20px; border-radius: 50%; background: var(--bg); border: 1px solid var(--slip-line); }
.ticket .tear::before { left: -11px; clip-path: inset(0 0 0 50%); }
.ticket .tear::after { right: -11px; clip-path: inset(0 50% 0 0); }
.ticket .kv { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-top: 1px dashed var(--slip-line); font-size: 15px; text-align: right; }
.ticket .kv span { text-align: left; }
.ticket .tear + .kv, .ticket .kv.hidden + .kv { border-top: 0; }
.ticket .hint { color: #6b5d2a; }
.stamp { position: absolute; right: 14px; top: -13px; background: var(--slip); border: 2px solid var(--accent); color: var(--accent); border-radius: 5px;
         padding: 0 8px; font-size: 13px; font-weight: 700; letter-spacing: .04em; transform: rotate(6deg); }

.my-appt { border: 1px solid var(--slip-line); background: var(--slip); border-radius: 8px; padding: 12px; margin-bottom: 8px; }
.my-appt .head { border-bottom: 1px dashed var(--slip-line); padding-bottom: 8px; }
.my-appt .head { display: flex; justify-content: space-between; align-items: baseline; }
.my-appt .num { font-family: var(--num); font-size: 44px; font-weight: 400; color: var(--brand); line-height: 1.05; }
.my-appt .live { margin-top: 8px; padding: 8px 8px; background: rgba(255,255,255,.7); border-radius: 8px; font-size: 14px; }
.my-appt .live.turn { background: #e7f7ec; color: var(--ok); font-weight: 700; }
.my-appt .actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

.foot { text-align: center; margin-top: 16px; font-size: 14px; }
.foot a { color: var(--brand); }
.hidden { display: none !important; }

/* Doctor panel: compact, dense layout */
body.panel { font-size: 14px; }
body.panel .wrap.mid { max-width: 860px; padding-top: 12px; }
body.panel .card { padding: 12px; margin-bottom: 8px; border-radius: 12px; }
body.panel .card h2 { font-size: 16px; margin: 0 0 8px; }
body.panel label { font-size: 12.5px; margin: 8px 0 4px; }
body.panel input, body.panel select, body.panel textarea { padding: 8px 8px; border-radius: 8px; font-size: 14px; }
body.panel .btn { padding: 8px 12px; font-size: 14px; margin-top: 12px; border-radius: 9px; }
body.panel .hint { font-size: 12.5px; }

.p-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.p-avatar { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: var(--brand-soft); color: var(--brand);
            display: grid; place-items: center; font-weight: 700; flex: 0 0 auto; border: 2px solid var(--brand); }
.p-avatar.big { width: 72px; height: 72px; font-size: 22px; }
.p-avatar img { width: 100%; height: 100%; object-fit: cover; }
.p-id { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.p-id b { font-size: 15px; }
.p-id span { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 13px; cursor: pointer; }

.tabs { display: flex; gap: 4px; margin-bottom: 8px; align-items: center; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; background: none; padding: 8px 8px; font: inherit; font-size: 14px; cursor: pointer; color: var(--muted);
               border-bottom: 2px solid transparent; margin-bottom: -4px; }
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.tabs-links { margin-left: auto; display: flex; gap: 8px; font-size: 13px; }
.tabs-links a { color: var(--brand); text-decoration: none; }
.flash { padding: 8px 12px; border-radius: 8px; margin-bottom: 8px; font-size: 13px; }
.flash.ok { background: #e7f7ec; color: #1e6b3a; }
.flash.err { background: #fdecea; color: var(--danger); }

.now-row { display: flex; align-items: center; gap: 12px; }
.now-num { font-family: var(--num); font-size: 44px; font-weight: 400; color: var(--brand); line-height: 1; min-width: 48px; text-align: center; }
.now-info { flex: 1; min-width: 0; }
.now-name { font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-pill { display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--brand-soft); color: var(--brand); white-space: nowrap; }
.status-pill.off { background: #eef1f7; color: var(--muted); }
.ctrl { display: grid; grid-template-columns: 2fr repeat(5, 1fr); gap: 4px; margin-top: 12px; }
body.panel .ctrl .btn { margin: 0; padding: 8px 4px; }
.stats { display: flex; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; margin-top: 8px; }
.stats b { color: var(--ink); }

.fold summary { cursor: pointer; font-weight: 600; color: var(--brand); }
.walkin { display: grid; grid-template-columns: 2fr 1.5fr 70px 80px auto; gap: 4px; margin-top: 8px; }
body.panel .walkin .btn { margin: 0; }

.list-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.list-head h2 { margin: 0 !important; }
.list-head input { width: auto; }
table.q { width: 100%; border-collapse: collapse; font-size: 13px; }
table.q th, table.q td { text-align: left; padding: 4px 4px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.q th { color: var(--muted); font-weight: 600; font-size: 12px; }
table.q td .sub { color: var(--muted); font-size: 12px; }
table.q tr.serving { background: var(--brand-soft); }
table.q tr.done td, table.q tr.cancelled td, table.q tr.absent td { color: var(--muted); }
td.acts { white-space: nowrap; text-align: right; }
.mini { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 4px 8px; font: inherit; font-size: 12px; cursor: pointer; margin-left: 4px; }
.mini:hover { border-color: var(--brand); color: var(--brand); }
.tag { display: inline-block; font-size: 11px; padding: 4px 8px; border-radius: 999px; background: #eef1f7; }
.tag.serving { background: var(--brand); color: #fff; }
.tag.booked { background: #e8f0fe; color: #1f4fbf; }
.tag.absent { background: #fdecea; color: var(--danger); }
.tag.new { background: #fff1e6; color: #a65413; }
.scroll-x { overflow-x: auto; }

.switch { display: flex !important; align-items: center; gap: 8px; font-weight: 600; margin-top: 0 !important; }
.switch input, .days input { width: auto; }
.days { display: flex; flex-wrap: wrap; gap: 4px; }
.days label { margin: 0; font-weight: 500; display: inline-flex; gap: 4px; align-items: center; border: 1px solid var(--line); padding: 4px 8px; border-radius: 7px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.grid2c { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; }
.photo-row { display: flex; gap: 12px; align-items: center; }
.sms-out { background: #121a3a; color: #dbe4ff; padding: 8px; border-radius: 8px; font-size: 12.5px; white-space: pre-wrap; word-break: break-word; margin: 8px 0 0; }
code { background: #eef1f7; padding: 4px 4px; border-radius: 4px; font-size: 12.5px; }

@media (max-width: 640px) {
  .ctrl { grid-template-columns: repeat(3, 1fr); }
  .ctrl .primary-act { grid-column: 1 / -1; }
  .walkin { grid-template-columns: 1fr 1fr; }
  .walkin .btn { grid-column: 1 / -1; }
  .grid4 { grid-template-columns: 1fr 1fr; }
  .grid2c { grid-template-columns: 1fr; }
  .tabs-links { margin-left: 0; width: 100%; padding: 4px 0 4px; }
  table.q:not(.rp-table) th:nth-child(4), table.q:not(.rp-table) td:nth-child(4), table.q:not(.rp-table) th:nth-child(5), table.q:not(.rp-table) td:nth-child(5) { display: none; }
}

.credit { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 16px 16px; }
.credit a { color: var(--brand); text-decoration: none; }

.tag.sms { background: #e7f7ec; color: #1e6b3a; }
.inline-field { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-field > * { min-width: 0; }
.inline-field .hint { flex: 1 1 200px; }
.inline-field input { width: 80px; flex: 0 0 80px; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: #14204a; color: #fff;
         padding: 8px 16px; border-radius: 10px; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.2); z-index: 10; }

/* Prescription writer */
.rx-layout { display: grid; grid-template-columns: 260px 1fr; gap: 8px; align-items: start; }
.hist { border-top: 1px solid var(--line); padding: 8px 0; }
.hist:first-of-type { border-top: 0; padding-top: 0; }
.hist-head { display: flex; justify-content: space-between; align-items: center; gap: 4px; flex-wrap: wrap; }
.hist-head .mini { margin: 0 0 0 4px; text-decoration: none; color: inherit; display: inline-block; }
.hist .sub, .pt-row .sub { color: var(--muted); font-size: 12.5px; }
.vitals { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.med, .med-head { display: grid; grid-template-columns: 2.4fr 1fr 1fr 1.4fr 30px; gap: 4px; align-items: center; }
.med { margin-bottom: 4px; }
.med-head { color: var(--muted); font-size: 12px; }
.med .mini { margin: 0; height: 32px; }
.rx-actions { display: flex; gap: 8px; }
.rx-actions .btn { width: auto; }
.pt-search { display: flex; gap: 8px; }
.pt-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.pt-row:first-child { border-top: 0; }
.pt-row .acts a { text-decoration: none; color: inherit; display: inline-block; }
.rx-list a { display: block; text-decoration: none; color: inherit; }
@media (max-width: 760px) {
  .rx-layout { grid-template-columns: 1fr; }
  .rx-layout aside { order: 2; }
  .vitals { grid-template-columns: repeat(3, 1fr); }
  .med { grid-template-columns: 1fr 1fr 1fr 30px; padding-bottom: 4px; border-bottom: 1px dashed var(--line); }
  .med input:first-child { grid-column: 1 / -1; }
  .med-head { display: none; }
}
.rx-now { width: auto !important; margin: 0 !important; text-decoration: none; padding: 8px 12px !important; white-space: nowrap; }
a.mini { text-decoration: none; color: inherit; display: inline-block; }

/* Reports */
.rp-range { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: center; }
.rp-quick .mini { margin: 0 4px 4px 0; }
.mini.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.rp-dates { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.rp-dates input { width: auto; }
.rp-dates .mini { margin: 0; }
.rp-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 12px; }
.rp-stat { border: 1px solid var(--line); border-radius: 10px; padding: 8px 8px; display: flex; flex-direction: column; line-height: 1.25; }
.rp-stat b { font-family: var(--num); font-weight: 400; font-size: 26px; line-height: 1.15; color: var(--brand); }
.rp-stat span { font-weight: 600; font-size: 13px; }
.rp-stat small { color: var(--muted); font-size: 11.5px; }
.rp-chart { display: flex; gap: 4px; align-items: flex-end; overflow-x: auto; padding-bottom: 4px; min-height: 40px; }
.rp-col { flex: 1 0 26px; max-width: 46px; display: flex; flex-direction: column; align-items: center; font-size: 11px; }
.rp-bar { height: 140px; width: 70%; display: flex; flex-direction: column-reverse; background: #eef1f7; border-radius: 4px 4px 0 0; overflow: hidden; }
.rp-bar i { display: block; width: 100%; }
.rp-bar i.seen, .sw.seen { background: var(--brand); }
.rp-bar i.absent, .sw.absent { background: #f0a39a; }
.rp-col small { color: var(--muted); white-space: nowrap; font-size: 10px; }
.rp-legend { font-size: 12px; color: var(--muted); margin-top: 4px; display: flex; gap: 4px; align-items: center; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-left: 4px; }
.rp-tops .card { margin-bottom: 8px; }
.rp-top { margin: 0; padding-left: 20px; font-size: 13.5px; }
.rp-top li { padding: 4px 0; border-bottom: 1px dashed var(--line); }
.rp-top li b { float: right; color: var(--brand); }
.rp-table tr.rp-total td { font-weight: 700; border-top: 2px solid var(--line); }
.rp-table td:first-child { white-space: nowrap; }

/* Several doctors */
.doc-switch { margin: 0; }
.doc-switch select { width: auto; max-width: 220px; padding: 4px 8px; font-size: 13px; }
.doc-row { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.doc-row:first-of-type { border-top: 0; }
.doc-row.off .doc-row-id b { color: var(--muted); }
.doc-row-id .sub { color: var(--muted); font-size: 12.5px; }
.doc-row-acts { display: flex; gap: 4px; align-items: center; margin: 0; flex-wrap: wrap; }
.doc-row-acts input { width: 150px; padding: 4px 8px; font-size: 13px; }
.doc-row-acts .mini { margin: 0; }

/* Patient page: choose a doctor */
.clinic-head { background: var(--brand); color: #fff; border-radius: var(--radius); padding: 16px 16px; margin-bottom: 12px; }
.clinic-head h1 { margin: 0; font-size: 22px; line-height: 1.25; }
.clinic-head .hint { color: rgba(255,255,255,.9); margin-top: 4px; }
.choose-title { font-size: 17px; margin: 0 0 8px; }
.doc-list { display: grid; gap: 8px; margin-bottom: 12px; }
.doc-pick { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line);
            border-radius: var(--radius); padding: 12px; font: inherit; color: inherit; cursor: pointer; }
.doc-pick:hover, .doc-pick:focus-visible { border-color: var(--brand); box-shadow: 0 2px 10px rgba(31,58,147,.12); }
.doc-pick .avatar { border: 2px solid var(--brand); background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; }
.dp-id { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.dp-id b { font-size: 17px; }
.dp-deg, .dp-time { color: var(--muted); font-size: 13px; }
.dp-id .chip { background: var(--brand-soft); color: var(--brand); align-self: flex-start; margin: 4px 0 4px; font-size: 12px; }
.dp-go { font-size: 26px; color: var(--brand); }
.change-doc { position: relative; z-index: 1; background: rgba(255,255,255,.18); color: #fff; border: 0; border-radius: 999px; padding: 4px 12px;
              font: inherit; font-size: 13px; cursor: pointer; margin-bottom: 8px; }
.appt-doc { font-weight: 700; color: var(--brand); margin-bottom: 4px; }

/* Super admin dashboard */
.ov-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 8px; }
.ov-stats .rp-stat { background: var(--card); }
.ov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.ov-doc { margin: 0 !important; display: flex; flex-direction: column; gap: 8px; }
.ov-doc.off { opacity: .6; }
.ov-head { display: flex; align-items: center; gap: 8px; }
.ov-now { display: flex; align-items: center; gap: 8px; background: var(--brand-soft); border-radius: 10px; padding: 8px 8px; }
.ov-now .now-num { font-size: 32px; min-width: 40px; }
.ov-now-name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-doc .stats { margin-top: 0; }
.ov-bar { height: 6px; background: #eef1f7; border-radius: 99px; overflow: hidden; }
.ov-bar i { display: block; height: 100%; background: var(--brand); }
.ov-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.ov-acts { display: flex; gap: 4px; flex-wrap: wrap; margin-top: auto; }
.ov-acts .mini { margin: 0; }
.edit-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.edit-head .mini { margin: 0; }
.edit-head b { font-size: 17px; }
.edit-links { margin-left: auto; display: flex; gap: 4px; }
.sec-title { font-size: 14px; color: var(--muted); margin: 12px 4px 4px; text-transform: uppercase; letter-spacing: .04em; }
table.logins td { vertical-align: top; }
.doc-row .p-avatar { flex: 0 0 auto; }
.doc-row-id { flex: 1; min-width: 0; }

/* Go-live checklist (super admin overview) and SMS settings */
.golive h2 { margin-top: 0; }
.golive ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.golive li { padding: 8px 8px 8px 32px; border-radius: 8px; position: relative; background: #fff8e6; }
.golive li::before { content: "!"; position: absolute; left: 10px; top: 8px; width: 16px; height: 16px; border-radius: 50%;
  background: #c98a00; color: #fff; font: 700 11px/16px system-ui; text-align: center; }
.golive li.fail { background: #fdecec; }
.golive li.fail::before { background: #c0392b; }
.golive li b { display: block; font-weight: 600; }
.golive li span { display: block; font-size: 13px; color: var(--muted, #5b6b67); }
.golive-ok { margin: 0 0 12px; padding: 8px 12px; border-radius: 8px; background: #e6f6ef; color: #0f6b4c; font-weight: 600; }
.radio-row { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 4px 0 8px; }
.radio-row label { display: flex; align-items: center; gap: 4px; font-weight: 500; margin: 0; }
.radio-row input { width: auto; margin: 0; }
.day-note { background: #fff8e6; padding: 8px 12px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.day-note b { margin-right: 4px; }

/* Profile helpers (assets/bd_medical.js) */
.deg-pick { margin-top: 4px; }
.desig-help { display: grid; grid-template-columns: 1fr 2fr; gap: 4px; margin-top: 4px; }
@media (max-width: 640px) { .desig-help { grid-template-columns: 1fr; } }
.fu-row { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 200px); gap: 8px; }
@media (max-width: 640px) { .fu-row { grid-template-columns: 1fr 1fr; } }

/* Several chambers per doctor */
.ch-list { display: grid; gap: 8px; margin-top: 12px; }
.ch-line { display: grid; gap: 4px; padding: 8px 12px; border: 1px solid rgba(255, 255, 255, .22); border-radius: 8px; background: rgba(255, 255, 255, .09); }
.ch-line .hint { margin: 0; color: inherit; opacity: .85; }
.ch-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.ch-opt { text-align: left; font: inherit; color: var(--ink); background: var(--card); border: 1.5px solid var(--line); border-radius: 8px;
          padding: 8px 12px; cursor: pointer; display: grid; gap: 4px; }
.ch-opt small { color: var(--muted); }
.ch-opt.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.ch-pick { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 8px; }
.ch-pick .mini { margin: 0; font-size: 13px; padding: 4px 8px; }
.ch-pick .mini small { opacity: .75; }
.chambers .ch-item { border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; margin-top: 8px; }
.chambers .ch-item summary { cursor: pointer; padding: 8px 0; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.chambers .ch-item summary .hint { margin: 0; }
.chambers .ch-item[open] { padding-bottom: 12px; }
.chambers .ch-item.add summary b { color: var(--brand); }
.ch-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }

/* Fees at reception */
.mini.fee { color: var(--muted); }
.mini.fee.paid { background: #e7f7ec; border-color: #b7e2c4; color: #1e6b3a; font-weight: 600; }
.fee-dlg { border: 0; border-radius: var(--radius); padding: 16px; width: min(360px, calc(100vw - 32px)); box-shadow: 0 12px 40px rgba(20, 32, 74, .25); color: var(--ink); }
.fee-dlg::backdrop { background: rgba(20, 32, 74, .35); }
.fee-dlg h2 { margin: 0 0 4px; }
.fee-dlg #feeAmt { font-size: 22px; font-weight: 700; }
.pay-methods { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.pay-methods label { margin: 0; font-weight: 500; display: inline-flex; gap: 4px; align-items: center; border: 1px solid var(--line); padding: 4px 8px; border-radius: 7px; }
.fee-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.fee-acts .btn { width: auto; margin: 0; }
.w-paid { grid-column: 1 / -1; margin: 0; }

/* "Add to home screen" card on the booking page */
.card.install { display: flex; align-items: center; gap: 12px; padding: 12px 12px; }
.card.install.hidden { display: none; }
.card.install img { border-radius: 10px; flex: 0 0 auto; }
.card.install > div { flex: 1; min-width: 0; font-size: 15px; }
.card.install .hint { margin: 4px 0 0; }
.card.install .pill { flex: 0 0 auto; }
.card.install .link { color: var(--muted); font-size: 16px; padding: 4px; }

/* Demo mode */
.demo-strip { background: #fff3c4; color: #5b4a00; border-bottom: 1px solid #e8d48a; text-align: center; font-size: 13px; padding: 4px 12px; }
.demo-logins { max-width: 420px; margin: 12px auto 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; text-align: center; }
.demo-logins > b, .demo-logins > .hint { flex-basis: 100%; margin: 0; }
.demo-logins form { margin: 0; }
.demo-logins code { font-size: 12px; opacity: .7; margin-left: 4px; }
/* Medicine type-ahead in the prescription writer */
.medpick { position: absolute; z-index: 50; max-height: 320px; overflow-y: auto; background: var(--card, #fff); border: 1px solid var(--line); border-radius: 10px;
           box-shadow: 0 8px 28px rgba(20,32,74,.18); padding: 4px; max-width: calc(100vw - 16px); }
.medpick .opt { padding: 8px 8px; border-radius: 7px; cursor: pointer; display: grid; gap: 4px; }
.medpick .opt b { font-weight: 600; }
.medpick .opt small { color: var(--muted); font-size: 12px; }
.medpick .opt.on, .medpick .opt:hover { background: var(--brand-soft, #e3e9f8); }

/* Hover and keyboard focus for every button and link. */
a:hover { text-decoration-thickness: 2px; }
.btn, .mini, .pill, .lang-btn, .tabs button, .link, .call, .change-doc { transition: filter .15s, background-color .15s, border-color .15s, color .15s; }
.btn:not(:disabled):hover { filter: brightness(1.08); }
.btn:not(:disabled):active { transform: translateY(1px); }
.btn.ghost:not(:disabled):hover { border-color: var(--brand); color: var(--ink); filter: none; }
.btn.secondary:not(:disabled):hover, .btn.danger:not(:disabled):hover { filter: brightness(.96); }
.tabs button:hover { color: var(--ink); }
.tabs-links a:hover, .link:hover { color: var(--ink); }
.pill:hover, .lang-btn:hover, .change-doc:hover { filter: brightness(.95); }
:where(a, button, summary, [role=button], [tabindex]):focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.btn:focus-visible { outline-offset: 3px; }

/* Loading: skeleton bars and a small spinner, shown until the data arrives. */
.skel { display: block; height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--line) 25%, var(--brand-soft, #e3e9f8) 50%, var(--line) 75%);
        background-size: 200% 100%; animation: skel 1.2s linear infinite; }
.skel-row td { padding-block: 12px; }
.skel.tall { height: 56px; border-radius: 12px; }
@keyframes skel { to { background-position: -200% 0; } }
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: middle; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-box { display: flex; gap: 8px; align-items: center; color: var(--muted); padding: 12px 0; }
@media (prefers-reduced-motion: reduce) { .skel, .spinner { animation: none; } }

/* Empty lists: one line saying why, and the one thing to do next. */
.empty { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 20px 12px; color: var(--muted); }
.empty p { margin: 0; }
.empty .btn { width: auto; margin: 0; }
.rp-chart .empty { flex: 1; }
.medpick .opt-busy { padding: 8px 12px; font-size: 13px; }

/* Inline field errors (assets/forms.js). */
.field-err { color: var(--danger, #c0392b); font-size: 13px; font-weight: 500; margin-top: 4px; flex-basis: 100%; grid-column: 1 / -1; }
.field-err::before { content: "⚠ "; }
[aria-invalid="true"] { border-color: var(--danger, #c0392b) !important; }
