:root {
  color-scheme: light;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  color: #19312e;
  background: #f5f7f6;
  --ink: #19312e;
  --muted: #526663;
  --line: #dbe5e1;
  --accent: #16685a;
  --dark: #113733;
  --white: #fff;
  --green-bg: #e9f5ef;
  --green: #22634b;
  --amber-bg: #fff3df;
  --amber: #7b5017;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; }
button, input, select { font: inherit; }
button, .button { cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
a { color: inherit; }
:focus-visible { outline: 3px solid #329b89; outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.sidebar {
  width: 232px;
  background: var(--dark);
  color: #e6f6f0;
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  padding: 33px 18px 23px;
  gap: 45px;
}
.brand { display: flex; align-items: center; gap: 13px; padding-left: 9px; text-decoration: none; font-size: 18px; font-weight: 700; line-height: 1.17; letter-spacing: -.4px; }
.brand-mark { display: grid; grid-template-columns: repeat(2, 7px); gap: 3px; place-content: center; width: 37px; height: 37px; background: #b5ead5; border-radius: 10px; }
.brand-mark i { height: 7px; background: #164b42; border-radius: 2px; }
.brand-mark i:last-child { opacity: .48; }
nav { display: grid; gap: 6px; }
nav button { display: flex; align-items: center; gap: 11px; border: 0; border-radius: 8px; padding: 11px 12px; text-align: left; background: transparent; color: #c6ddd6; font-size: 14px; font-weight: 600; white-space: nowrap; }
nav button:hover { background: #1c4b44; }
nav button[aria-current] { background: #23554c; color: #fff; }
.nav-icon { width: 18px; text-align: center; font-size: 19px; line-height: 20px; color: #ace1cb; }
.sidebar-foot { margin-top: auto; padding: 17px 9px 0; border-top: 1px solid #326058; color: #b6d2c8; font-size: 12px; display: flex; align-items: center; gap: 8px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #87d8b7; }
main { margin-left: 232px; }
.topbar { display: flex; justify-content: flex-end; align-items: center; padding: 0 36px; height: 72px; background: var(--white); border-bottom: 1px solid var(--line); }
.workspace { max-width: 1550px; padding: 32px 36px 50px; margin: auto; }
.page-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 26px; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(28px, 4vw, 38px); letter-spacing: -.045em; line-height: 1.12; }
h2 { font-size: 19px; letter-spacing: -.025em; }
.page-heading p { margin-top: 8px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.primary, .secondary, .subtle, .danger, .icon-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 0 14px; border-radius: 8px; border: 1px solid transparent;
  text-decoration: none; font-weight: 650; font-size: 13px; white-space: nowrap;
}
.primary { color: #fff; background: var(--accent); }
.primary:hover { background: #105348; }
.secondary, .icon-button { color: var(--ink); border-color: var(--line); background: var(--white); }
.secondary:hover, .icon-button:hover { background: #eff5f2; }
.subtle { color: var(--accent); background: transparent; }
.subtle:hover { background: #eaf3ef; }
.danger { background: #fff; color: #a03531; border-color: #eed2d0; }
.danger:hover { background: #fff1f0; }
.danger.solid { color: #fff; background: #a03531; border-color: #a03531; }
.icon-button { padding: 0; width: 36px; min-height: 36px; font-size: 23px; line-height: 1; }
.small { min-height: 35px; padding: 0 11px; }
.controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 13px; background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 12px; }
.day-controls, .inline-form { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.inline-form label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.inline-form input[type="text"] { min-height: 35px; padding: 4px 6px; width: 70px; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 18px 0 9px; }
.map-detail { color: var(--muted); font-size: 13px; }
#occupancy-detail span { display: block; }
.specialty-summary { margin: 18px 0 26px; padding: 14px 16px; }
.specialty-summary h2 { margin-bottom: 9px; }
.specialty-counts { display: flex; flex-wrap: wrap; gap: 7px; list-style: none; padding: 0; margin: 0; }
.specialty-counts li { display: flex; align-items: baseline; gap: 7px; background: var(--green-bg); border-radius: 8px; padding: 5px 9px; font-size: 13px; }
.metric { background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 16px; display: flex; align-items: center; gap: 12px; }
.metric-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 40px; border-radius: 10px; background: #eaf0ee; color: #325b51; font-weight: 700; font-size: 21px; }
.available .metric-icon { background: var(--green-bg); color: var(--green); }
.occupied .metric-icon { background: var(--amber-bg); color: var(--amber); }
.metric-label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); }
.metric strong { display: block; font-size: 27px; line-height: 1.13; font-variant-numeric: tabular-nums; margin-top: 3px; }
.grid-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 13px; }
.segmented { display: flex; background: #eaf0ed; border-radius: 8px; padding: 3px; gap: 3px; }
.segmented button { background: transparent; border: 1px solid transparent; border-radius: 6px; color: var(--muted); font-size: 12px; font-weight: 650; min-height: 29px; padding: 0 11px; }
.segmented button[aria-pressed="true"] { background: #fff; color: var(--accent); border-color: var(--line); }
.room-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: start; }
.room-card, .panel, .empty { background: var(--white); border: 1px solid var(--line); border-radius: 11px; }
.room-card { padding: 13px; min-width: 0; }
.room-header { margin-bottom: 12px; }
.room-title { font-size: 13px; font-weight: 700; overflow-wrap: anywhere; line-height: 1.35; }
.room-state { display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.badge { display: inline-flex; align-items: center; border-radius: 20px; padding: 4px 8px; font-size: 11px; font-weight: 700; background: var(--green-bg); color: var(--green); }
.badge.busy { background: var(--amber-bg); color: var(--amber); }
.badge.blocked, .notice.closure { background: #f0edf7; color: #5a4275; }
.notice.closure { border-color: #ddd2ec; margin: 14px 0 0; line-height: 1.5; }
.quick { border: 0; background: transparent; color: var(--accent); font-weight: 650; font-size: 12px; padding: 5px 2px; white-space: nowrap; }
.quick:hover { text-decoration: underline; }
.record-actions { white-space: nowrap; }
.record-actions .quick + .quick { margin-left: 10px; color: #a03531; }
.appointments { display: grid; gap: 5px; margin-top: 10px; }
.appointment { width: 100%; text-align: left; display: grid; gap: 3px; border: 1px solid #e4ebe8; border-radius: 7px; padding: 7px 8px; background: #f7faf8; color: var(--ink); }
.appointment:hover { border-color: #94c4b5; }
.appointment strong { font-size: 12px; }
.appointment span { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.appointment .appointment-specialty { font-size: 11px; font-weight: 600; color: var(--accent); }
.empty { grid-column: 1 / -1; padding: 25px 18px; color: var(--muted); font-size: 14px; }
.query-form { display: flex; flex-wrap: wrap; align-items: end; gap: 13px; padding: 17px; }
.query-form label, .form-grid > label { display: grid; align-content: start; gap: 6px; font-size: 13px; font-weight: 650; }
.wide-field { flex: 1 1 240px; }
.query-error { flex-basis: 100%; font-size: 14px; }
.block-heading { margin-top: 22px; }
input:not([type="checkbox"]), select { min-height: 40px; min-width: 0; padding: 7px 9px; border: 1px solid #cbd9d4; border-radius: 7px; background: #fff; color: var(--ink); font-size: 14px; }
.query-form input { width: 100%; }
.query-form input[data-date] { width: 131px; }
.query-form input[data-time] { width: 98px; }
.results { margin-top: 16px; display: grid; gap: 10px; }
.result-row { padding: 12px 16px; display: grid; gap: 7px; }
.result-row h2 { font-size: 15px; }
.result-row p, .result-row summary { color: var(--muted); font-size: 13px; }
.result-row summary { cursor: pointer; }
.result-row .appointment { max-width: 350px; }
.date-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.date-chips span { padding: 4px 7px; border-radius: 5px; background: var(--green-bg); color: var(--green); font-size: 12px; }
.table-panel { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
th { background: #eef4f1; color: var(--muted); font-size: 12px; }
td:last-child, th:last-child { text-align: right; }
tr:last-child td { border-bottom: 0; }
td.empty-cell { text-align: left; color: var(--muted); }
.notice { border: 1px solid #bedbcc; background: #eaf6ef; color: var(--green); padding: 10px 13px; margin-bottom: 15px; border-radius: 8px; font-size: 14px; }
.notice.error, .form-error { color: #8b2c28; border-color: #efc9c6; background: #fff0ef; }
dialog { color: var(--ink); width: min(550px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 60px #102e2b38; }
dialog::backdrop { background: #0d2f2b83; }
.dialog-heading, .dialog-footer { display: flex; align-items: center; gap: 8px; padding: 14px 18px; }
.dialog-heading { justify-content: space-between; border-bottom: 1px solid var(--line); }
.dialog-footer { border-top: 1px solid var(--line); flex-wrap: wrap; }
.dialog-body { padding: 17px 18px; }
.dialog-body p { font-size: 14px; line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.full { grid-column: 1 / -1; }
.form-grid select, .form-grid input:not([type="checkbox"]) { width: 100%; }
.date-field { display: grid; align-content: start; gap: 6px; font-size: 13px; font-weight: 650; }
.date-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.map-date-controls { width: 158px; }
.calendar-control { position: relative; display: grid; place-items: center; width: 40px; min-height: 40px; border: 1px solid #cbd9d4; border-radius: 7px; background: #fff; color: var(--accent); font-size: 20px; }
.calendar-control:focus-within { outline: 3px solid #329b89; outline-offset: 2px; }
.calendar-control input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.calendar-control input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: auto; height: auto; cursor: pointer; }
.spacer { flex: 1; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px 10px; margin: 0; min-width: 0; }
legend { font-weight: 650; font-size: 13px; padding: 0 4px; }
.login-screen { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.login-panel { display: grid; gap: 14px; width: min(100%, 420px); padding: 28px; }
.login-panel h1 { margin: 0; }
.login-panel > p { margin: 0; }
.login-panel label, .doctor-picker { display: grid; gap: 6px; align-content: start; font-size: 13px; font-weight: 650; min-width: 0; }
.account-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
#account-role { color: var(--muted); font-size: 12px; }
.doctor-results { list-style: none; margin: 0; padding: 4px; max-height: 160px; overflow: auto; border: 1px solid #cbd9d4; border-radius: 7px; }
.doctor-results li { padding: 7px; border-radius: 4px; cursor: pointer; overflow-wrap: anywhere; }
.doctor-results li:hover, .doctor-results li[aria-selected="true"] { background: #e9f3ef; }
.doctor-feedback { margin: 0; color: var(--muted); }
.read-only [data-admin] { display: none !important; }
.read-only main { margin-left: 0; }
.read-only .topbar { padding-inline: clamp(12px, 4vw, 36px); }
div.appointment { cursor: default; }
.specialty-options { max-height: 150px; overflow: auto; display: grid; gap: 3px; padding: 3px 0; }
.specialty-options label { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.specialty-options input { accent-color: var(--accent); }
.new-specialty-field { display: grid; gap: 6px; margin-top: 10px; font-size: 13px; font-weight: 650; }
.weekdays { display: flex; gap: 6px; flex-wrap: wrap; }
.weekdays label { display: flex; align-items: center; gap: 3px; padding: 4px; font-size: 13px; cursor: pointer; }
.weekdays input { accent-color: var(--accent); }
.optional { color: var(--muted); font-weight: 400; }
.preview, .form-error { padding: 8px 10px; border-radius: 7px; }
.preview { background: #eef5f1; color: var(--muted); }
@media (max-width: 1200px) { .room-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .sidebar { width: 190px; padding-inline: 12px; }
  main { margin-left: 190px; }
  .workspace, .topbar { padding-inline: 20px; }
  .room-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .sidebar { position: static; width: auto; padding: 12px; gap: 12px; }
  .brand { padding-left: 0; font-size: 15px; }
  .brand br { display: none; }
  nav { display: flex; overflow-x: auto; }
  nav button { padding: 7px; font-size: 12px; }
  .sidebar-foot { display: none; }
  main { margin-left: 0; }
  .topbar { height: 55px; padding-inline: 12px; }
  .workspace { padding: 20px 12px 35px; }
  .metrics { gap: 6px; }
  .metric { padding: 8px; gap: 6px; }
  .metric-icon { display: none; }
  .metric-label { font-size: 11px; }
  .room-grid { gap: 7px; }
  .room-card { padding: 8px; }
}
