/* Doctor's desk: a calm, scannable working view. Reuses the tokens and controls from styles.css. */
body.doctor { min-height: 100vh; }
.doc-wrap { max-width: 1040px; margin-inline: auto; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 64px max(16px, env(safe-area-inset-left, 0px)); }

/* Login */
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); background: var(--tint); }
.login-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: clamp(24px, 5vw, 40px); box-shadow: var(--shadow); }
.login-card .mark { width: 52px; height: 52px; margin-bottom: 18px; }
.login-card h1 { font-size: 1.7rem; margin-bottom: 6px; }
.login-card > p { color: var(--muted); margin-bottom: 22px; font-size: .95rem; }
.login-card .btn { width: 100%; }
.login-card .back { display: inline-block; margin-top: 18px; font-size: .9rem; color: var(--link); font-weight: 600; }

/* Top bar */
.doc-top { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; justify-content: space-between; margin-bottom: 24px; }
.doc-top h1 { font-size: clamp(1.5rem, 3vw, 2rem); }
.doc-top .sub { color: var(--muted); font-size: .92rem; font-weight: 600; }
.doc-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Summary tiles */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
@media (max-width: 720px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.tile .n { font: 600 2rem/1.1 var(--font-display); color: var(--primary-ink); font-variant-numeric: tabular-nums; }
.tile .l { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }

/* Next patient */
.next { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between; background: var(--primary); color: var(--on-primary); border-radius: 18px; padding: 18px 22px; margin-bottom: 26px; }
.next .k { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; opacity: .9; }
.next .v { font: 600 1.35rem var(--font-display); }
.next .m { font-size: .92rem; opacity: .95; }
.next a { color: inherit; font-weight: 700; }

/* Tabs and toolbar */
.tabs { display: inline-flex; gap: 6px; padding: 5px; border-radius: 999px; background: var(--tint); margin-bottom: 20px; }
.tabs button { border: 0; background: transparent; color: var(--fg); font: 700 .95rem var(--font-body); padding: 10px 20px; border-radius: 999px; cursor: pointer; min-height: 44px; transition: background-color .2s ease; }
.tabs button[aria-selected="true"] { background: var(--primary); color: var(--on-primary); }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; margin-bottom: 18px; }
.toolbar .search { flex: 1 1 240px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .92rem; min-height: 44px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--primary); }

/* Booking list */
.day { margin-bottom: 28px; }
.day-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 2px solid var(--line); }
.day-head h2 { font-size: 1.25rem; }
.day-head span { color: var(--muted); font-weight: 600; font-size: .9rem; }
.day-head .today-chip { background: var(--cta); color: var(--on-cta); border-radius: 999px; padding: 1px 10px; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.appt { display: grid; grid-template-columns: 128px minmax(0, 1fr) auto; gap: 8px 18px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; margin-bottom: 10px; transition: border-color .2s ease, box-shadow .2s ease; }
.appt:hover { border-color: var(--primary-ink); box-shadow: var(--shadow); }
.appt .when { font: 600 1.05rem var(--font-display); color: var(--primary-ink); font-variant-numeric: tabular-nums; }
.appt .when small { display: block; font: 600 .72rem var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.appt .who-name { font-weight: 700; }
.appt .meta { display: flex; flex-wrap: wrap; gap: 2px 14px; color: var(--muted); font-size: .9rem; }
.appt .meta a { color: var(--link); font-weight: 700; }
.appt .note { margin-top: 4px; font-size: .88rem; color: var(--muted); font-style: italic; overflow-wrap: anywhere; }
.appt .acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.appt.is-done, .appt.is-cancelled { opacity: .72; }
.appt.is-cancelled .who-name { text-decoration: line-through; }
.pill { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; border: 1.5px solid currentColor; vertical-align: middle; margin-left: 8px; }
.pill.done { color: var(--ok); }
.pill.cancelled { color: var(--danger); }
.pill.online { color: var(--primary-ink); }
@media (max-width: 720px) {
  .appt { grid-template-columns: minmax(0, 1fr); }
  .appt .acts { justify-content: flex-start; }
}
.mini { min-height: 40px; padding: 6px 14px; font-size: .85rem; }
.mini.danger { color: var(--danger); border-color: var(--danger); }
.mini.danger.confirming { background: var(--danger); color: var(--bg); }

.empty { text-align: center; padding: 48px 16px; border: 2px dashed var(--line); border-radius: 18px; color: var(--muted); }
.empty strong { display: block; font: 600 1.2rem var(--font-display); color: var(--primary-ink); margin-bottom: 6px; }

/* Day planner */
.plan-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 8px; }
.plan-bar input[type="date"] { width: auto; min-width: 190px; }
.plan-sum { color: var(--muted); font-weight: 600; margin-bottom: 18px; min-height: 1.5em; }
.plan-session { margin-bottom: 24px; }
.plan-session h3 { font-size: 1.1rem; margin-bottom: 10px; }
.plan-session h3 span { font: 600 .85rem var(--font-body); color: var(--muted); margin-left: 8px; }
.row { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 4px 16px; align-items: center; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); margin-bottom: 6px; font-size: .95rem; }
.row .t { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--primary-ink); }
.row.free { background: transparent; border-style: dashed; color: var(--muted); }
.row.free .t { color: var(--muted); }
.row .nm { font-weight: 700; }
.row .md { color: var(--muted); font-size: .88rem; margin-left: 10px; }
.row.is-cancelled-row { display: none; }
.status-line { min-height: 1.4em; margin-bottom: 12px; font-weight: 600; font-size: .92rem; }
.status-line[data-kind="error"] { color: var(--danger); }
.status-line[data-kind="ok"] { color: var(--ok); }
