/* The doctor's screen. One page, three columns, no navigation.
   Everything the doctor needs is visible without a click. */

.doc-body {
  display: flex; flex-direction: column;
  height: 100vh; height: 100dvh; overflow: hidden;
}

/* ── Header ────────────────────────────────────────────────── */
.doc-head {
  flex: none; display: flex; align-items: center; justify-content: space-between;
  gap: var(--s5); padding: var(--s4) var(--s6);
  background: var(--surface-1); border-bottom: 1px solid var(--border);
}
.doc-brand { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.doc-brand .ws-mark {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  background: linear-gradient(145deg, var(--brand-hover), var(--brand));
  color: #fff; display: grid; place-items: center;
  font-family: var(--display); font-size: 17px; box-shadow: var(--e2);
}
.doc-head h1 {
  font-family: var(--display); font-size: 26px; font-weight: 400;
  letter-spacing: -.018em; line-height: 1.15;
}
.doc-head p { font-size: var(--t-md); color: var(--fg-3); margin-top: 1px; }
.doc-head p b { color: var(--clay-text); font-weight: 650; }

.doc-tools { display: flex; align-items: center; gap: var(--s2); }
.doc-search {
  display: flex; align-items: center; gap: var(--s2);
  padding: 0 12px; min-height: 40px; width: 250px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 99px; color: var(--fg-3);
  transition: border-color var(--d-fast) var(--ease), box-shadow var(--d-fast) var(--ease);
}
.doc-search:focus-within { border-color: var(--brand); box-shadow: var(--ring); }
.doc-search svg { width: 17px; height: 17px; }
.doc-search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: var(--t-md); color: var(--fg); }

/* ── Three columns ─────────────────────────────────────────── */
.doc-grid {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px; background: var(--border);
}
.col { display: flex; flex-direction: column; min-height: 0; background: var(--bg); }
.col-head {
  flex: none; display: flex; align-items: center; gap: var(--s2);
  padding: var(--s4) var(--s5) var(--s3);
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.col-head h2 {
  font-size: var(--t-xs); font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--fg-3);
}
.col-count {
  font-size: var(--t-xs); font-weight: 700; font-variant-numeric: tabular-nums;
  background: var(--surface-3); color: var(--fg-2);
  border-radius: 99px; padding: 2px 8px; min-width: 22px; text-align: center;
}
.col-attention .col-head h2 { color: var(--clay-text); }
.col-attention .col-count { background: var(--clay); color: var(--clay-on); }
.col-body {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: var(--s3) var(--s4) var(--s8);
  display: flex; flex-direction: column; gap: var(--s2);
}

/* ── Patient row — the single repeated unit of this screen ─── */
.row-card {
  display: flex; align-items: flex-start; gap: var(--s3);
  width: 100%; text-align: left;
  padding: var(--s3) var(--s3) var(--s3) var(--s4);
  background: var(--surface-1); border: 1px solid var(--border);
  border-left: 3px solid var(--accent, transparent);
  border-radius: var(--r-sm); cursor: pointer; box-shadow: var(--e1);
  animation: rowIn var(--d-slow) var(--ease) both; animation-delay: var(--i, 0ms);
  transition: box-shadow var(--d-base) var(--ease), transform var(--d-base) var(--ease),
              border-color var(--d-base) var(--ease);
}
@keyframes rowIn { from { opacity: 0; transform: translateY(6px) } }
.row-card:hover { box-shadow: var(--e3); transform: translateY(-1px); border-color: var(--border-strong); border-left-color: var(--accent, var(--border-strong)); }
.row-card:active { transform: translateY(0) scale(.995); }

.row-time {
  flex: none; width: 52px; font-variant-numeric: tabular-nums;
  font-size: var(--t-md); font-weight: 650; color: var(--fg-2); padding-top: 1px;
}
/* The row's parts are spans (so the whole row can be one <button>) —
   they must be told to stack. */
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.row-name { display: block; font-size: var(--t-lg); font-weight: 600; letter-spacing: -.008em; line-height: 1.3; }
.row-what { display: block; font-size: var(--t-sm); color: var(--fg-3); margin-top: 2px; }
.row-note, .row-prog, .why { display: flex; }
.row-note { display: block; }
.row-note {
  font-size: var(--t-sm); color: var(--fg-2); margin-top: 7px;
  padding: 6px 9px; background: var(--surface-2); border-radius: var(--r-xs);
  border-left: 2px solid var(--border-strong);
}
.row-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }

/* Treatment progress, read at a glance */
.row-prog { align-items: center; gap: var(--s2); margin-top: 9px; width: 100%; }
.row-prog .progress { flex: 1; height: 6px; }
.row-prog .day { font-size: var(--t-xs); color: var(--fg-3); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Comfort score: number + direction, never colour alone */
.score {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 99px;
  font-size: var(--t-xs); font-weight: 650; white-space: nowrap;
}
.score-good { background: var(--brand-soft); color: var(--brand-text); }
.score-flat { background: var(--surface-3); color: var(--fg-2); }
.score-bad  { background: var(--clay-soft);  color: var(--clay-text); }
.score svg { width: 13px; height: 13px; }

/* The one action a row offers */
.row-do {
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 32px; padding: 0 11px; border-radius: var(--r-xs);
  border: 1px solid var(--border-strong); background: var(--surface-1);
  font-size: var(--t-sm); font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background var(--d-fast) var(--ease), border-color var(--d-fast) var(--ease), transform var(--d-fast) var(--ease);
}
.row-do svg { width: 14px; height: 14px; }
.row-do:hover { background: var(--surface-3); }
.row-do:active { transform: scale(.96); }
.row-do.wa { background: var(--wa); border-color: var(--wa); color: var(--wa-on); }
.row-do.call { background: var(--brand); border-color: var(--brand); color: var(--brand-on); }

.why {
  font-size: var(--t-xs); font-weight: 650; letter-spacing: .04em;
  text-transform: uppercase; color: var(--accent-text, var(--fg-3));
}

.col-empty {
  text-align: center; color: var(--fg-3); font-size: var(--t-md);
  padding: var(--s10) var(--s4); line-height: 1.7;
}
.col-empty strong { display: block; font-family: var(--display); font-size: var(--t-xl); color: var(--fg-2); margin-bottom: 4px; }

/* ── Footer ────────────────────────────────────────────────── */
.doc-foot {
  flex: none; display: flex; align-items: center; gap: var(--s2);
  padding: 9px var(--s6); font-size: var(--t-xs); color: var(--fg-3);
  background: var(--surface-1); border-top: 1px solid var(--border);
}
.foot-link { margin-left: auto; color: var(--fg-2); }
.foot-link:hover { color: var(--brand-text); text-decoration: underline; text-underline-offset: 3px; }

/* ── Drawer — the only thing that opens ────────────────────── */
#drawer-root:empty { display: none; }
.dr-back {
  position: fixed; inset: 0; z-index: var(--z-modal);
  background: var(--scrim); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display: flex; justify-content: flex-end;
  animation: fadeIn var(--d-base) var(--ease);
}
.dr {
  width: min(460px, 100%); height: 100%;
  background: var(--surface-1); border-left: 1px solid var(--border);
  box-shadow: var(--e4); display: flex; flex-direction: column;
  animation: drIn var(--d-slow) var(--ease);
}
@keyframes drIn { from { transform: translateX(28px); opacity: .4 } }
.dr-head {
  flex: none; padding: var(--s5); border-bottom: 1px solid var(--border);
  background: linear-gradient(150deg, var(--surface-2), var(--surface-1) 60%);
}
.dr-top { display: flex; align-items: flex-start; gap: var(--s3); }
.dr-top h2 { font-family: var(--display); font-size: 24px; font-weight: 400; letter-spacing: -.018em; }
.dr-top .sub { font-size: var(--t-sm); color: var(--fg-3); margin-top: 2px; }
.dr-body { flex: 1; overflow-y: auto; padding: var(--s5); display: flex; flex-direction: column; gap: var(--s5); }
.dr-foot {
  flex: none; display: flex; gap: var(--s2); padding: var(--s3) var(--s5);
  border-top: 1px solid var(--border); background: var(--surface-2);
}
.dr-foot .btn { flex: 1; }

.dr-block h3 {
  font-size: var(--t-xs); font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--fg-3); margin-bottom: var(--s2);
}
.dr-facts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.dr-fact .k { font-size: var(--t-xs); color: var(--fg-3); }
.dr-fact .v { font-size: var(--t-md); font-weight: 500; margin-top: 1px; }

.dr-line { display: flex; gap: var(--s3); align-items: flex-start; padding: 7px 0; }
.dr-line .dot { width: 9px; height: 9px; border-radius: 99px; flex: none; margin-top: 5px; background: var(--d, var(--brand)); }
.dr-line .t { font-size: var(--t-sm); }
.dr-line .t b { font-weight: 600; }
.dr-line .t span { color: var(--fg-3); }
.dr-line time { margin-left: auto; font-size: var(--t-xs); color: var(--fg-3); white-space: nowrap; flex: none; }

.dr-quote {
  font-size: var(--t-md); background: var(--wa-soft); color: var(--fg);
  border-radius: var(--r-sm); padding: 10px 12px; border: 1px solid var(--border);
}
.dr-quote span { display: block; font-size: var(--t-xs); color: var(--fg-3); margin-top: 5px; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1080px) {
  .doc-body { height: auto; min-height: 100dvh; overflow: visible; }
  .doc-grid { grid-template-columns: 1fr; gap: 0; background: transparent; }
  .col { border-bottom: 1px solid var(--border); }
  .col-body { overflow: visible; padding-bottom: var(--s5); }
  .col-head { position: sticky; top: 0; z-index: var(--z-sticky); }
  .doc-head { flex-wrap: wrap; padding: var(--s3) var(--s4); }
  .doc-search { width: 100%; order: 3; }
  .dr { width: 100%; }
}
@media (max-width: 560px) {
  .doc-head h1 { font-size: 21px; }
  .doc-tools .btn span { display: none; }
  .row-card { padding: var(--s3); }
}
