:root {
  --ink: #142b31;
  --muted: #5d716e;
  --line: #dde7e4;
  --paper: #f4f7f5;
  --white: #ffffff;
  --navy: #183840;
  --mint: #2f9a84;
  --mint-soft: #e2f3ee;
  --amber: #b97716;
  --amber-soft: #fff1d8;
  --red: #c24a41;
  --red-soft: #fde9e6;
  --blue-soft: #e8f0fd;
  --shadow: 0 1px 2px rgba(20, 43, 49, .06), 0 4px 18px rgba(20, 43, 49, .05);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, "Noto Sans Devanagari", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--paper); color: var(--ink); font-size: 14px; line-height: 1.45; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
[hidden] { display: none !important; }   /* a class's display: flex must not un-hide an element */

/* ---------- brand & top bar ---------- */
.brand { display: flex; align-items: center; gap: 10px; }
.brand strong { display: block; font-size: 15px; letter-spacing: .2px; }
.brand small { display: block; color: var(--muted); font-size: 11px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; background: var(--navy); color: #fff;
  display: grid; place-items: center; font-weight: 800;
}
.brand-logo { width: 30px; height: 30px; display: block; flex: none; }
.cobrand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cobrand-x { color: var(--muted); font-size: 16px; line-height: 1; }
.partner-logo { height: 32px; width: auto; display: block; }
.login-card .cobrand { justify-content: space-between; }
.login-card .partner-logo { height: 36px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sched-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pill.sample { background: var(--amber-soft); color: var(--amber); }
.dept-filter { display: block; padding: 10px 14px 0; }
.dept-filter select { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; background: var(--white); color: var(--ink); font-size: 13px; }
/* Sarvodaya link: their blue as the accent; Dr.Mate's own marks stay as they are. */
.brand-sarvodaya { --mint: #0a86b8; --mint-soft: #e1f2f9; --navy: #0d3b52; }
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 10px 18px; background: var(--white); border-bottom: 1px solid var(--line);
}
.hospital-switch { display: flex; gap: 6px; background: var(--paper); padding: 4px; border-radius: 11px; }
.hospital-switch button {
  border: 0; background: transparent; border-radius: 8px; padding: 7px 12px; cursor: pointer; text-align: left;
  min-width: 150px;
}
.hospital-switch button strong { display: block; font-size: 13px; }
.hospital-switch button small { display: block; color: var(--muted); font-size: 11px; }
.hospital-switch button.on { background: var(--white); box-shadow: var(--shadow); }
.hospital-switch button:disabled { opacity: .55; cursor: not-allowed; }
.voice-controls { display: flex; align-items: flex-end; gap: 10px; margin-left: auto; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 3px; }
.field span { font-size: 11px; color: var(--muted); }
.field select, .field input[type=range] { min-width: 0; }
.field select { border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; background: var(--white); max-width: 290px; }
.pace input { width: 120px; accent-color: var(--mint); }
.seg { display: inline-flex; background: var(--paper); border-radius: 8px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 6px 10px; border-radius: 6px; cursor: pointer; font-size: 12px; }
.seg button.on { background: var(--white); box-shadow: var(--shadow); font-weight: 600; }
.logout { color: var(--muted); text-decoration: none; font-size: 12px; }
.mode-nav { display: inline-flex; background: var(--paper); border-radius: 10px; padding: 3px; gap: 2px; }
.mode-nav a { text-decoration: none; color: var(--muted); font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: 8px; white-space: nowrap; }
.mode-nav a.on { background: var(--white); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- buttons ---------- */
.btn {
  border: 1px solid var(--line); background: var(--white); border-radius: 9px; padding: 8px 14px; cursor: pointer;
  font-weight: 600;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn.danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn.ghost { background: transparent; }
.btn.big { padding: 12px 26px; font-size: 15px; border-radius: 12px; }
.btn.wide { width: 100%; }
.link { border: 0; background: none; color: var(--mint); cursor: pointer; font-weight: 600; padding: 0; font-size: 12px; }
.link:disabled { color: var(--muted); cursor: not-allowed; }

/* ---------- board ---------- */
.board {
  display: grid; grid-template-columns: minmax(330px, 1.05fr) minmax(320px, 1fr) minmax(380px, 1.25fr);
  gap: 14px; padding: 14px 18px 22px; height: calc(100vh - 62px); min-height: 640px;
}
.panel {
  background: var(--white); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; min-height: 0; overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line);
}
.panel-head small { color: var(--muted); font-size: 10px; letter-spacing: .8px; font-weight: 700; }
.panel-head h2 { font-size: 15px; margin-top: 2px; }
.pill {
  border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 600; background: var(--paper); color: var(--muted);
  white-space: nowrap;
}
.pill.live { background: var(--mint-soft); color: var(--mint); }
.pill.speaking { background: var(--blue-soft); color: #3e64a8; }
.pill.ended { background: var(--paper); color: var(--muted); }
.pill.soft { background: var(--paper); }

/* ---------- call ---------- */
.call-stage { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px; border-bottom: 1px solid var(--line); }
.orb { width: 74px; height: 74px; border-radius: 50%; background: var(--mint-soft); display: grid; place-items: center; transition: transform .2s; }
.orb span { width: 34px; height: 34px; border-radius: 50%; background: var(--mint); opacity: .55; transition: all .2s; }
.orb.listening span { opacity: 1; animation: breathe 1.6s ease-in-out infinite; }
.orb.speaking { background: var(--blue-soft); }
.orb.speaking span { background: #3e64a8; opacity: 1; animation: talk .5s ease-in-out infinite alternate; }
.orb.caller span { background: var(--amber); opacity: 1; transform: scale(1.18); }
@keyframes breathe { 0%, 100% { transform: scale(.92); } 50% { transform: scale(1.08); } }
@keyframes talk { from { transform: scale(.9); } to { transform: scale(1.2); } }
.call-controls { display: flex; gap: 10px; }
.level { width: 220px; height: 5px; background: var(--paper); border-radius: 3px; overflow: hidden; }
.level i { display: block; height: 100%; width: 0; background: var(--mint); transition: width .08s; }
.transcript { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.transcript .empty { color: var(--muted); text-align: center; margin: auto; font-size: 13px; }
.line { max-width: 88%; display: flex; flex-direction: column; gap: 3px; }
.line .bubble { padding: 9px 12px; border-radius: 14px; font-size: 14px; }
.line.agent { align-self: flex-start; }
.line.agent .bubble { background: var(--paper); border-top-left-radius: 4px; }
.line.caller { align-self: flex-end; text-align: right; }
.line.caller .bubble { background: var(--navy); color: #fff; border-top-right-radius: 4px; }
.line.partial .bubble { background: transparent; color: var(--muted); border: 1px dashed var(--line); }
.line.filler .bubble, .line.bc .bubble { background: transparent; color: var(--muted); font-style: italic; padding: 2px 6px; }
.line.retracted .bubble { text-decoration: line-through; opacity: .5; }
.line small { color: var(--muted); font-size: 11px; }
.line .tag { display: inline-block; border-radius: 6px; padding: 0 6px; margin-left: 4px; font-size: 10.5px; background: var(--paper); }
.line .tag.safety { background: var(--red-soft); color: var(--red); }
.line .tag.cut { background: var(--amber-soft); color: var(--amber); }
.type-row { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); }
.type-row input { flex: 1; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; }
.metrics { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; padding: 8px 14px 12px; color: var(--muted); font-size: 12px; }
.metrics b { color: var(--ink); }
.metrics .link { margin-left: auto; }

/* ---------- booking ---------- */
.booking-panel { overflow-y: auto; }
.steps { display: flex; list-style: none; padding: 12px 14px 4px; margin: 0; gap: 4px; flex-wrap: wrap; }
.steps li {
  flex: 1; min-width: 58px; text-align: center; font-size: 11px; padding: 6px 4px; border-radius: 8px;
  background: var(--paper); color: var(--muted); font-weight: 600;
}
.steps li.done { background: var(--mint-soft); color: var(--mint); }
.steps li.now { background: var(--navy); color: #fff; }
.card { margin: 10px 14px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin: 0; }
.facts div { min-width: 0; }
.facts .wide { grid-column: 1 / -1; }
.facts dt { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.facts dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.facts dd.fresh { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: var(--amber-soft); } to { background: transparent; } }
.offer { display: inline-block; border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px; margin: 2px 4px 2px 0; font-weight: 600; font-size: 12.5px; }
.offer.picked { border-color: var(--mint); background: var(--mint-soft); color: var(--mint); }
.safety { margin: 10px 14px 0; border-radius: 12px; padding: 10px 12px; font-weight: 600; }
.safety.emergency, .safety.crisis { background: var(--red-soft); color: var(--red); }
.safety.urgent { background: var(--amber-soft); color: var(--amber); }
.safety small { display: block; font-weight: 400; color: var(--ink); margin-top: 2px; }
.done-card { background: var(--mint-soft); border-color: #bfe4d8; }
.done-card h3 { font-size: 15px; color: var(--mint); }
.done-card p { margin: 4px 0 0; }
.callback-card { background: var(--blue-soft); border-color: #cbd9f5; }
.activity { margin: 6px 14px 14px; }
.activity-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.activity-head h3 { font-size: 13px; }
.activity-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.activity-list li { border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; font-size: 12.5px; }
.activity-list li.new { animation: flash 2s ease-out; }
.activity-list .kind { font-size: 10.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; margin-right: 6px; }

/* ---------- schedule ---------- */
.days { display: flex; gap: 6px; padding: 10px 14px 4px; overflow-x: auto; }
.days button {
  border: 1px solid var(--line); background: var(--white); border-radius: 8px; padding: 5px 10px; cursor: pointer;
  white-space: nowrap; font-size: 12px;
}
.days button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.days button.has-new { box-shadow: 0 0 0 2px var(--mint) inset; }
.legend { display: flex; gap: 6px; padding: 6px 14px; flex-wrap: wrap; }
.doctors { flex: 1; overflow-y: auto; padding: 4px 14px 14px; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.doctor { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.doctor.focus { border-color: var(--mint); box-shadow: 0 0 0 3px var(--mint-soft); }
.doctor-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.doctor-head strong { font-size: 13.5px; }
.doctor-head small { color: var(--muted); font-size: 11.5px; }
.doctor .off { color: var(--muted); font-size: 12px; margin-top: 6px; }
.slots { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.chip { display: inline-block; border-radius: 6px; padding: 3px 6px; font-size: 11px; font-weight: 600; border: 1px solid transparent; }
.chip.free { background: var(--mint-soft); color: var(--mint); }
.chip.taken { background: #eef1f0; color: #9aa8a5; }
.chip.booked { background: var(--navy); color: #fff; }
.chip.past { background: transparent; color: #b8c3c0; border-color: #eef1f0; }
.chip.offered { box-shadow: 0 0 0 2px var(--amber); }
.chip.pulse { animation: pulse 1.6s ease-out 3; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(47, 154, 132, .7); } 100% { box-shadow: 0 0 0 10px rgba(47, 154, 132, 0); } }
.window { border: 1px solid var(--line); border-radius: 9px; padding: 6px 8px; margin-top: 6px; }
.window .bar { height: 6px; background: var(--paper); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.window .bar i { display: block; height: 100%; background: var(--mint); }
.window.restricted { border-style: dashed; }
.window.offered { border-color: var(--amber); }
.window.pulse { animation: pulse 1.6s ease-out 3; }
.window-head { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; }
.wait-est { font-size: 11px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }

/* ---------- login ---------- */
.login-body { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login-card { width: 100%; max-width: 380px; background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: 26px; box-shadow: var(--shadow); }
.login-card h1 { font-size: 20px; margin: 18px 0 6px; }
.login-card .login-foot { margin: 16px 0 0; font-size: 13px; text-align: center; }
.login-card .login-foot a { color: var(--muted); }
.login-card form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.login-card label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.login-card input { border: 1px solid var(--line); border-radius: 9px; padding: 10px; font-size: 15px; color: var(--ink); }
.alert { background: var(--red-soft); color: var(--red); border-radius: 9px; padding: 8px 10px; margin-top: 12px; font-size: 13px; }

/* ---------- small screens ---------- */
@media (max-width: 1180px) {
  .board { grid-template-columns: 1fr 1fr; height: auto; }
  .schedule-panel { grid-column: 1 / -1; min-height: 520px; }
  .call-panel { min-height: 620px; }
}
@media (max-width: 760px) {
  .topbar { padding: 10px 16px; }
  .cobrand { width: 100%; }
  .cobrand-x { display: none; }
  .partner-logo { height: 26px; margin-left: auto; }
  .hospital-switch { width: 100%; }
  .hospital-switch button { flex: 1; min-width: 0; }
  .voice-controls { margin-left: 0; width: 100%; }
  .field select { max-width: 100%; }
  .board { grid-template-columns: 1fr; padding: 12px 16px 20px; }
  .call-panel { min-height: 560px; }
  .btn, .seg button, .days button { min-height: 40px; }
  .type-row input { font-size: 16px; }
}

/* ---------------------------------------------------------------- reception's front desk */
.desk { padding: 16px; max-width: 1280px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.desk-days { display: flex; gap: 6px; flex-wrap: wrap; }
.desk-days .chip { cursor: pointer; border: 1px solid var(--line); background: #fff; font: inherit; font-size: 12.5px; padding: 5px 10px; }
.desk-grid { display: grid; grid-template-columns: minmax(300px, 0.9fr) minmax(360px, 1.4fr); gap: 12px; align-items: start; }
.desk-doctors { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.desk-sub { border-top: 1px solid var(--line); }
.desk-callbacks { list-style: none; margin: 0; padding: 4px 16px 14px; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.desk-callbacks small { display: block; color: var(--muted); font-size: 11.5px; }
.desk a[href^="tel:"] { color: inherit; font-variant-numeric: tabular-nums; }
@media (max-width: 860px) { .desk-grid { grid-template-columns: 1fr; } }
.reception-new { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 16px 16px; }
.reception-new .rx-input { flex: 1 1 200px; }
.desk-actions { display: flex; gap: 8px; align-items: center; }
.walkin { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; padding: 12px 16px 16px; border-bottom: 1px solid var(--line); }
.walkin .field select, .walkin .rx-input { width: 100%; max-width: none; }
.walkin .w-wide, .walkin .w-msg, .walkin .w-buttons { grid-column: 1 / -1; }
.walkin .w-msg { margin: 0; font-size: 13px; color: var(--muted); min-height: 1em; }
.walkin .w-msg.bad { color: var(--red); }
.walkin .w-msg.good { color: var(--green, #1f7a5c); }
.walkin .w-buttons { display: flex; gap: 8px; justify-content: flex-end; }
.walkin .move-what { margin: 0; font-size: 13.5px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; white-space: nowrap; }
.row-actions .btn { padding: 4px 10px; font-size: 12.5px; min-height: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
