/* The dashboard's look: hospital-desk-dashboard's clinic design
   (clearprompt/hospital-desk-dashboard, src/styles.css), the parts we use. White cards on a soft aqua-grey,
   navy for what you press, aqua for what's booked. */
:root {
  --bg: #F5F8F8; --card: #FFFFFF; --line: #E3EAEA; --line-2: #D3DDDD;
  --ink: #172235; --muted: #687385; --faint: #98A2B0;
  --navy: #17294A; --navy-2: #24395F; --aqua: #CDF1EE; --aqua-2: #8BDDD6; --aqua-ink: #0D5D57;
  --green: #15803D; --green-soft: #DCF5E5; --amber: #A15C07; --amber-soft: #FEF0D5; --red: #D33A3A; --red-soft: #FDE8E8;
  --r: 14px; --shadow: 0 1px 2px rgba(23, 34, 53, .04), 0 4px 16px rgba(23, 34, 53, .04);
  --font: "Plus Jakarta Sans", system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 700; } h2 { font-size: 16px; font-weight: 700; } h3 { font-size: 15px; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--aqua-2); outline-offset: 2px; }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.app { --sidew: 236px; min-height: 100vh; display: grid; grid-template-columns: var(--sidew) minmax(0, 1fr);
       background: linear-gradient(90deg, var(--card) calc(var(--sidew) - 1px), var(--line) calc(var(--sidew) - 1px) var(--sidew), var(--bg) var(--sidew)); }
.side { padding: 22px 16px; display: flex; flex-direction: column; gap: 24px; position: sticky; top: 0; height: 100vh; align-self: start; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.brand .logo { width: 34px; height: 34px; border-radius: 10px; background: var(--navy); color: #fff; display: grid; place-items: center; }
.brand b { display: block; font-size: 15px; line-height: 1.2; }
.brand span { font-size: 12px; color: var(--muted); }
nav.tabs { display: flex; flex-direction: column; gap: 2px; }
nav.tabs a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 500; }
nav.tabs a:hover { background: var(--bg); color: var(--ink); }
nav.tabs a[aria-current="page"] { background: var(--aqua); color: var(--navy); font-weight: 600; }
.content { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 16px; padding: 16px 24px; border-bottom: 1px solid var(--line); background: var(--card); position: sticky; top: 0; z-index: 5; }
.top .title { flex: 1; min-width: 0; }
.top .title p { color: var(--muted); font-size: 13px; }
.livetag { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--muted); }
.livetag i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.livetag.on { color: var(--aqua-ink); } .livetag.on i { background: var(--green); }
main { padding: 20px 24px 48px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); min-width: 0; }
.card-head { padding: 16px 18px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-head p { font-size: 13px; color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 6px; padding: 2px 9px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pill.ok { background: var(--aqua); color: var(--aqua-ink); }
.pill.go { background: var(--green-soft); color: var(--green); }
.pill.wait { background: #EEF2F4; color: var(--muted); }
.pill.warn { background: var(--amber-soft); color: var(--amber); }
.av { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: 12.5px; flex: none; background: var(--aqua); color: var(--navy); }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--navy); color: #fff; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.kpi .lbl { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 500; }
.kpi .lbl svg { color: var(--navy); }
.kpi b { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.kpi small { color: var(--muted); font-size: 12.5px; }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 20px; align-items: start; }

.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px; padding: 10px 18px; background: var(--bg); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 14px; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr[data-call] { cursor: pointer; }
.tbl tbody tr:hover td { background: #F9FBFB; }
.tbl .person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tbl .person b { font-weight: 600; display: block; white-space: nowrap; }
.tbl small { color: var(--muted); font-size: 12.5px; display: block; }
.tbl tr.done td { color: var(--faint); }
.tbl .what { max-width: 360px; }
.tbl .what small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tblwrap { overflow-x: auto; }
.empty { padding: 26px 18px; color: var(--muted); text-align: center; }
.token { display: inline-grid; place-items: center; min-width: 34px; height: 30px; padding: 0 8px; border-radius: 8px; background: var(--navy); color: #fff; font-weight: 700; font-size: 14px; }

.sched { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.sblock { display: block; width: 100%; border-radius: 10px; padding: 10px 12px; background: color-mix(in srgb, var(--c) 12%, white); border-left: 3px solid var(--c); }
.sblock .row { display: flex; justify-content: space-between; gap: 8px; }
.sblock b { font-size: 13.5px; } .sblock small { color: var(--muted); font-size: 12.5px; }
.sblock .bar { display: block; height: 5px; border-radius: 3px; background: rgba(255,255,255,.85); margin-top: 8px; overflow: hidden; }
.sblock .bar i { display: block; height: 100%; background: var(--c); }
.sublbl { font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 14px 16px 8px; border-top: 1px solid var(--line); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 18px; }
.dstrip { padding: 0 18px 16px; }
.days { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; background: #EAF6F5; border-radius: 12px; padding: 6px; }
.days button { border: 0; background: none; border-radius: 9px; padding: 6px 2px; text-align: center; line-height: 1.2; }
.days button small { display: block; font-size: 11px; color: var(--muted); }
.days button b { font-size: 15px; font-weight: 600; }
.days button em { display: block; font-style: normal; font-size: 11px; color: var(--aqua-ink); font-weight: 600; min-height: 14px; }
.days button:hover { background: rgba(255,255,255,.7); }
.days button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.days button[aria-pressed="true"] small, .days button[aria-pressed="true"] em { color: #B8C3D6; }

.wk td, .wk th { padding: 8px 8px; }
.wk td:first-child, .wk th:first-child { padding-left: 18px; width: 200px; }
.wk th.istoday { color: var(--navy); }
.wcell { vertical-align: top !important; }
.wbox { width: 100%; min-height: 72px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #fff; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.wcell.usual .wbox { background: #F2FBFA; border-color: #CBEDEA; }
.wcell.off .wbox { background: repeating-linear-gradient(135deg, #FAFBFB 0 6px, #F3F6F6 6px 12px); }
.wcell.istoday .wbox { outline: 2px solid var(--navy); outline-offset: -1px; }
.wbox .slot { font-size: 13px; font-weight: 600; white-space: nowrap; }
.wbox .offtxt { font-size: 13px; color: var(--faint); }
.wbox small { font-size: 12px; color: var(--muted); line-height: 1.3; }
.tag { font-size: 11px; font-weight: 700; border-radius: 5px; padding: 1px 6px; white-space: nowrap; background: var(--aqua); color: var(--aqua-ink); }

/* A call opened in the list: what it booked and who for, the recording, then the transcript, folded. */
.tbl tr.open > td { background: #F2FBFA; }
.tbl tr.detail > td { padding: 0 18px 16px; background: #F2FBFA; cursor: default; }
.tbl tr.detail:hover > td { background: #F2FBFA; }
.callx { display: flex; flex-direction: column; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.callx .facts { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; }
.callx .facts span { color: var(--muted); } .callx .facts b { color: var(--ink); font-weight: 600; }
.callx audio { width: 100%; height: 40px; flex: none; }
.callx .foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.linesbtn { border: 0; background: none; padding: 2px 0; color: var(--navy); font-weight: 600; font-size: 13.5px; }
.linesbtn:hover { text-decoration: underline; text-underline-offset: 3px; }
.lines { max-height: 340px; overflow-y: auto; border-top: 1px solid var(--line); padding-top: 6px; }
.line { display: grid; grid-template-columns: 42px 52px minmax(0, 1fr); gap: 8px; width: 100%; border: 0; background: none; text-align: left;
        padding: 5px 6px; border-radius: 8px; font-size: 14px; line-height: 1.45; }
.line:hover { background: var(--bg); }
.line.playing { background: var(--aqua); }
.line .t { color: var(--faint); font-size: 12.5px; padding-top: 2px; }
.line .who { color: var(--muted); font-size: 12.5px; font-weight: 600; padding-top: 2px; }
.line.asha .who { color: var(--aqua-ink); }
.line.cut .txt { color: var(--muted); }
.line.cut .txt::after { content: " · cut off"; font-size: 12px; color: var(--faint); }
.line.tool { cursor: default; } .line.tool:hover { background: none; }
.line.tool .txt { font-size: 13px; font-weight: 600; color: var(--navy); }

@media (max-width: 1080px) {
  .app { --sidew: 76px; }
  .side { padding: 18px 10px; align-items: center; }
  .brand div, nav.tabs a .word { display: none; }
  nav.tabs a { justify-content: center; padding: 12px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pair { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .app { display: block; background: var(--bg); }
  .side { position: static; height: auto; padding: 0; }
  .brand { display: none; }
  nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; flex-direction: row; background: var(--card); border-top: 1px solid var(--line); z-index: 6; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  nav.tabs a { flex: 1; flex-direction: column; gap: 2px; padding: 6px 2px; font-size: 11px; }
  nav.tabs a .word { display: block; }
  .top { padding: 14px 16px; }
  main { padding: 16px 12px 96px; }
  .kpi b { font-size: 24px; }
  .tbl td, .tbl th { padding: 10px 12px; }
  .days { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tbl tr.detail > td { padding: 0 8px 12px; }
  .line { grid-template-columns: 34px 44px minmax(0, 1fr); gap: 6px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
