:root {
  color-scheme: light;
  --ink: #102a3a;
  --ink-soft: #5c7180;
  --surface: #ffffff;
  --canvas: #edf4f7;
  --navy: #073d55;
  --primary: #0b5f7f;
  --primary-bright: #167da1;
  --free: #dff3ef;
  --free-strong: #198675;
  --approval: #e8def8;
  --approval-strong: #7652a7;
  --closed: #d5dee3;
  --occupied: #c6d5dd;
  --implant: #e85858;
  --removal: #4f9f70;
  --other: #e2ae2d;
  --danger: #bd3d45;
  --border: #d3e0e6;
  --shadow: 0 20px 50px rgba(21, 50, 65, 0.16);
  --radius-lg: 24px;
  --radius-md: 16px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(22, 125, 161, .15), transparent 28rem),
    var(--canvas);
  color: var(--ink);
}

button, input, select, textarea { font: inherit; }
button { color: inherit; }

.app-shell {
  width: min(100%, 1120px);
  min-height: 100vh;
  margin: 0 auto;
  background: rgba(255,255,255,.68);
  border-left: 1px solid rgba(211,224,230,.8);
  border-right: 1px solid rgba(211,224,230,.8);
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 80% 10%, rgba(22,125,161,.22), transparent 28rem),
    linear-gradient(145deg, #e7f1f4, #f8fbfc);
}

.auth-card {
  width: min(100%, 880px);
  min-height: 540px;
  display: grid;
  grid-template-columns: minmax(280px, 1.05fr) minmax(320px, .95fr);
  overflow: hidden;
  border: 1px solid rgba(211,224,230,.9);
  border-radius: 28px;
  background: #fff;
  box-shadow: var(--shadow);
}

.auth-hero {
  min-height: 300px;
  background:
    linear-gradient(115deg, rgba(7,61,85,.18), rgba(7,61,85,.64)),
    url("./assets/dental-implant-header.jpg") center / cover no-repeat,
    linear-gradient(145deg, #073d55, #167da1);
}

.auth-content { align-self: center; padding: clamp(28px, 6vw, 54px); }
.auth-content h1 { margin: 3px 0 0; color: var(--navy); font-size: clamp(1.65rem, 4vw, 2.4rem); letter-spacing: -.045em; line-height: 1.05; }
.auth-lead { margin: 16px 0 22px; color: var(--ink-soft); line-height: 1.5; }
.auth-form { display: grid; gap: 14px; }
.invite-person { display: grid; gap: 3px; margin: -6px 0 20px; padding: 13px 14px; border-radius: 14px; background: #eef6f8; }
.invite-person small, .muted-copy, .field-hint { color: var(--ink-soft); }
.muted-copy { line-height: 1.45; }
.base-rule-note { margin: 13px 2px 0; color: var(--ink-soft); font-size: .8rem; line-height: 1.45; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 72px;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 12px clamp(14px, 4vw, 26px);
  color: #fff;
  background: linear-gradient(120deg, #073d55, #0b5f7f 72%, #147895);
  box-shadow: 0 8px 24px rgba(7,61,85,.18);
}

.brand-mark, .role-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px 14px 14px 4px;
  background: #fff;
  color: var(--navy);
  font-weight: 850;
  letter-spacing: -.04em;
}

.brand-copy h1, .sheet-heading h2 { margin: 0; font-size: 1.22rem; letter-spacing: -.025em; }
.eyebrow { margin: 0 0 2px; text-transform: uppercase; letter-spacing: .09em; font-weight: 800; font-size: .72rem; opacity: .72; }

.icon-button, .avatar-button {
  position: relative;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 14px;
  background: rgba(255,255,255,.13);
  color: #fff;
  cursor: pointer;
}

.avatar-button { border: 1px solid rgba(255,255,255,.38); font-size: .78rem; font-weight: 850; }
.notification-dot { position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: #ffd65a; border: 2px solid var(--primary); }

#app { min-height: calc(100vh - 150px); padding: 18px clamp(14px, 4vw, 26px) 112px; }

.page-head, .section-head, .sheet-heading, .card-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.page-head { margin-bottom: 16px; }
.page-head h2 { margin: 0; font-size: clamp(1.35rem, 5vw, 2rem); letter-spacing: -.045em; }
.page-head p { margin: 3px 0 0; color: var(--ink-soft); font-size: .9rem; }

.month-switcher, .date-switcher {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  gap: 8px;
}

.round-button, .ghost-button, .pill-button, .primary-button, .secondary-button, .danger-button {
  min-height: 44px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-weight: 750;
}
.round-button { width: 42px; }
.ghost-button { padding: 0 14px; color: var(--primary); }
.primary-button { padding: 0 18px; border-color: var(--primary); background: var(--primary); color: #fff; }
.secondary-button { padding: 0 18px; color: var(--primary); background: #fff; }
.danger-button { padding: 0 18px; border-color: #f1c9cc; color: var(--danger); background: #fff5f5; }
.wide { width: 100%; }

.panel {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.94);
  box-shadow: 0 10px 32px rgba(33,75,94,.08);
}

.finder-panel { margin-bottom: 16px; background: linear-gradient(145deg, #073d55, #0b607d); color: #fff; border: 0; }
.finder-panel .section-head h3 { margin: 0; font-size: 1rem; }
.finder-panel .section-head p { margin: 2px 0 0; color: rgba(255,255,255,.72); font-size: .78rem; }
.finder-date { display: grid; gap: 6px; margin-top: 14px; color: rgba(255,255,255,.78); font-size: .78rem; font-weight: 800; }
.finder-date input { width: 100%; min-height: 44px; padding: 8px 11px; border: 1px solid rgba(255,255,255,.3); border-radius: 12px; background: rgba(255,255,255,.12); color: #fff; color-scheme: dark; }
.duration-pills { display: flex; gap: 8px; overflow-x: auto; padding: 13px 0 4px; scrollbar-width: none; }
.duration-pills::-webkit-scrollbar { display: none; }
.pill-button { flex: 0 0 auto; min-height: 38px; padding: 0 14px; background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.24); color: #fff; }
.pill-button.active { background: #fff; color: var(--navy); border-color: #fff; }

.finder-results { display: grid; gap: 8px; margin-top: 12px; }
.finder-result { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; width: 100%; padding: 11px 12px; border: 0; border-radius: 13px; background: rgba(255,255,255,.1); color: #fff; text-align: left; cursor: pointer; }
.finder-result strong { display: block; font-size: .9rem; }
.finder-result small { opacity: .75; }
.finder-result .badge { background: rgba(255,255,255,.16); color: #fff; }

.legend-block { margin: 12px 2px 15px; }
.legend-title { margin: 0 0 8px; color: var(--ink-soft); font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 13px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); font-size: .78rem; }
.legend-swatch { width: 12px; height: 12px; border-radius: 4px; background: var(--swatch); }

.month-card { padding: 8px; }
.timeline-scale { display: grid; grid-template-columns: 62px 1fr; align-items: end; padding: 4px 10px 8px; color: var(--ink-soft); font-size: .7rem; }
.scale-marks { display: flex; justify-content: space-between; }
.month-list { display: grid; gap: 3px; }
.month-row { display: grid; grid-template-columns: 62px 1fr auto; gap: 9px; align-items: center; min-height: 38px; padding: 4px 6px; border: 0; border-radius: 11px; background: transparent; text-align: left; cursor: pointer; }
.month-row:hover, .month-row:focus-visible { background: #eef7fa; outline: none; }
.month-row.today { background: #e7f4f8; }
.month-row.past { opacity: .52; cursor: default; filter: grayscale(.75); }
.month-row.past:hover { background: transparent; }
.month-row.past .month-segment { background: #d7dfe3; }
.month-row.closed-day { cursor: default; background: #eef1f3; }
.month-row.closed-day .month-segment { background: var(--closed); }
.day-label { display: flex; align-items: baseline; gap: 5px; }
.day-label strong { font-size: 1rem; }
.day-label span { color: var(--ink-soft); font-size: .72rem; }
.month-bar { height: 17px; display: flex; overflow: hidden; border-radius: 6px; background: var(--free); box-shadow: inset 0 0 0 1px rgba(0,0,0,.04); }
.month-segment { min-width: 2px; height: 100%; }
.segment-free { background: var(--free); }
.segment-restricted { background: repeating-linear-gradient(135deg, var(--approval) 0 4px, #d9c9f0 4px 7px); }
.segment-closed { background: var(--closed); }
.segment-implant { background: var(--implant); }
.segment-removal { background: var(--removal); }
.segment-other { background: var(--other); }
.row-chevron { color: #8aa0ab; }

.status-chip, .badge { display: inline-flex; align-items: center; gap: 5px; width: fit-content; padding: 5px 9px; border-radius: 999px; font-weight: 800; font-size: .72rem; }
.status-chip.confirmed { background: #def2eb; color: #17684f; }
.status-chip.pending { background: #f0e8fb; color: #6b4697; }
.status-chip.cancelled, .status-chip.declined { background: #f1f3f4; color: #71808a; }
.badge.approval { background: var(--approval); color: #68458d; }
.badge.free { background: var(--free); color: #176b61; }

.day-panel { padding: 10px 10px 18px; overflow: hidden; }
.day-summary { display: flex; gap: 9px; overflow-x: auto; padding: 4px 2px 14px; }
.day-legends { display: grid; gap: 8px; margin: 0 2px 14px; }
.summary-chip { flex: 0 0 auto; padding: 9px 12px; border-radius: 12px; background: #f1f6f8; font-size: .78rem; color: var(--ink-soft); }
.summary-chip strong { display: block; color: var(--ink); font-size: .92rem; }
.day-timeline { position: relative; min-height: 2496px; }
.time-row { height: 52px; display: grid; grid-template-columns: 56px 1fr; align-items: start; }
.time-label { padding-top: 4px; color: var(--ink-soft); font-size: .76rem; font-variant-numeric: tabular-nums; }
.slot-button { height: 48px; border: 0; border-top: 1px solid #dce6ea; background: rgba(223,243,239,.43); cursor: pointer; text-align: left; color: var(--free-strong); }
.slot-button.restricted { background: repeating-linear-gradient(135deg, rgba(232,222,248,.66) 0 7px, rgba(245,240,251,.8) 7px 14px); color: var(--approval-strong); }
.slot-button.closed { background: var(--closed); color: #657783; cursor: not-allowed; }
.booking-block { position: absolute; left: 56px; right: 4px; z-index: 3; padding: 9px 11px; border: 0; border-radius: 12px; color: #fff; text-align: left; overflow: hidden; box-shadow: 0 7px 18px rgba(16,42,58,.15); cursor: pointer; }
.booking-block.implant { background: var(--implant); }
.booking-block.removal { background: var(--removal); }
.booking-block.other { background: var(--other); color: #4f3b00; }
.booking-block.pending { outline: 3px solid var(--approval); outline-offset: -3px; }
.booking-block strong, .booking-block small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.booking-block strong { font-size: .86rem; }
.booking-block small { margin-top: 2px; font-size: .76rem; opacity: .9; }
.booking-block .booking-doctor { font-weight: 800; }
.booking-block .booking-comment { padding-top: 1px; border-top: 1px solid rgba(255,255,255,.26); opacity: .96; }
.booking-block.other .booking-comment { border-top-color: rgba(79,59,0,.2); }
.booking-block.compact { padding: 3px 8px; }
.booking-block.compact strong, .booking-block.compact small { margin-top: 0; font-size: .75rem; line-height: 1.08; }

.card-list { display: grid; gap: 11px; }
.booking-card { display: grid; gap: 10px; padding: 15px; border: 1px solid var(--border); border-radius: 17px; background: #fff; cursor: pointer; text-align: left; }
.booking-card h3 { margin: 0; font-size: 1rem; }
.booking-card p { margin: 2px 0 0; color: var(--ink-soft); font-size: .84rem; }
.category-line { display: flex; align-items: center; gap: 8px; }
.category-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--cat); }
.empty-state { padding: 38px 18px; text-align: center; color: var(--ink-soft); }
.empty-state strong { display: block; margin-bottom: 5px; color: var(--ink); }

.queue-actions, .form-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.plan-time { min-width: 56px; font-weight: 850; font-variant-numeric: tabular-nums; }

.bottom-nav {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, 1120px);
  display: flex;
  justify-content: center;
  gap: 4px;
  min-height: calc(72px + var(--safe-bottom));
  padding: 8px 8px calc(8px + var(--safe-bottom));
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(16px);
  overflow-x: auto;
  scrollbar-width: none;
}
.bottom-nav::-webkit-scrollbar { display: none; }
.nav-button { flex: 1 1 0; max-width: 156px; min-width: 58px; min-height: 54px; display: grid; place-items: center; gap: 2px; border: 0; border-radius: 15px; background: transparent; color: #718691; cursor: pointer; font-size: .68rem; font-weight: 800; }
.nav-button span:first-child { font-size: 1.12rem; line-height: 1; }
.nav-button.active { color: var(--primary); background: #e8f3f6; }

.sheet-dialog { width: min(100%, 640px); max-height: min(92vh, 820px); margin: auto auto 0; padding: 0; border: 0; border-radius: 26px 26px 0 0; background: transparent; box-shadow: var(--shadow); }
.sheet-dialog::backdrop { background: rgba(8,30,42,.52); backdrop-filter: blur(3px); }
.sheet { max-height: min(92vh, 820px); overflow-y: auto; padding: 10px 18px calc(24px + var(--safe-bottom)); background: #fff; }
.sheet-handle { width: 42px; height: 5px; margin: 0 auto 16px; border-radius: 999px; background: #d2dde2; }
.sheet-heading { margin-bottom: 16px; }
.sheet .icon-button.subtle { color: var(--ink-soft); background: #eff4f6; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: grid; gap: 6px; margin-bottom: 13px; }
.field > span { font-size: .8rem; color: var(--ink-soft); font-weight: 750; }
.field input, .field select, .field textarea { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: #fff; color: var(--ink); outline: none; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary-bright); box-shadow: 0 0 0 3px rgba(22,125,161,.12); }
.field textarea { min-height: 92px; resize: vertical; }
.time-field { min-width: 0; margin: 0 0 13px; padding: 0; border: 0; }
.time-field legend { margin-bottom: 6px; color: var(--ink-soft); font-size: .8rem; font-weight: 750; }
.time-select { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; gap: 6px; }
.time-select select { min-width: 0; padding-inline: 8px; text-align: center; font-variant-numeric: tabular-nums; }
.time-select span { color: var(--ink-soft); font-weight: 850; }
.quick-durations { display: flex; gap: 7px; flex-wrap: wrap; }
.quick-durations button { min-height: 36px; padding: 0 11px; border: 1px solid var(--border); border-radius: 10px; background: #f7fafb; cursor: pointer; }
.quick-durations button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.approval-note { margin: 4px 0 14px; padding: 12px; border-radius: 13px; background: #f4effb; color: #5f4282; font-size: .84rem; }
.validation-error { margin: -4px 0 12px; color: var(--danger); font-size: .82rem; font-weight: 700; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.detail-cell { padding: 12px; border-radius: 13px; background: #f2f6f8; }
.detail-cell small { display: block; color: var(--ink-soft); margin-bottom: 3px; }
.detail-comment { margin: 12px 0 18px; padding: 14px; border-left: 4px solid var(--cat); border-radius: 4px 13px 13px 4px; background: #f7fafb; }
.role-option { width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; padding: 13px 4px; border: 0; border-bottom: 1px solid var(--border); background: transparent; text-align: left; cursor: pointer; }
.role-option .role-icon { background: #e8f3f6; }
.role-option .role-icon.nurse { background: #f0e8fb; color: #6b4697; }
.role-option .role-icon.admin { background: #fff0c8; color: #7a5700; }
.role-option strong, .role-option small { display: block; }
.role-option small { margin-top: 3px; color: var(--ink-soft); }
.notification-item { padding: 13px 0; border-bottom: 1px solid var(--border); }
.notification-item strong { display: block; font-size: .9rem; }
.notification-item p { margin: 4px 0 0; color: var(--ink-soft); font-size: .82rem; }
.admin-shield { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: #fff0c8; color: #765500; font-weight: 900; }
.admin-layout { display: grid; gap: 16px; }
.admin-form .section-head, .admin-rules .section-head, .history-panel .section-head { margin-bottom: 15px; }
.admin-form h3, .admin-rules h3, .history-panel h3 { margin: 0; }
.admin-form .section-head p, .admin-rules .section-head p, .history-panel .section-head p { margin: 3px 0 0; color: var(--ink-soft); font-size: .82rem; }
.restriction-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--border); border-left: 5px solid var(--closed); border-radius: 14px; background: #f9fbfc; }
.restriction-card.approval { border-left-color: var(--approval-strong); background: #fbf8ff; }
.restriction-card p { margin: 4px 0 0; color: var(--ink-soft); font-size: .82rem; }
.restriction-card .danger-button { min-height: 38px; }
.history-panel { margin-top: 16px; }
.history-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); font-size: .84rem; }
.history-row small { flex: 0 0 auto; color: var(--ink-soft); }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 94px; transform: translate(-50%, 20px); min-width: min(86vw, 360px); padding: 13px 16px; border-radius: 13px; background: #102a3a; color: #fff; text-align: center; opacity: 0; pointer-events: none; transition: .2s ease; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 760px) {
  #app { padding-top: 28px; }
  .month-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .85fr); gap: 18px; align-items: start; }
  .finder-panel { position: sticky; top: 98px; grid-column: 2; grid-row: 1; max-height: calc(100vh - 116px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
  .month-main { grid-column: 1; grid-row: 1; }
  .admin-layout { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: start; }
  .admin-form { position: sticky; top: 98px; }
  .sheet-dialog { margin: auto; border-radius: 26px; }
  .sheet { border-radius: 26px; padding: 16px 24px 26px; }
  .day-panel { max-width: 760px; margin: 0 auto; }
}

@media (max-width: 420px) {
  .brand-copy .eyebrow { display: none; }
  .topbar { grid-template-columns: auto 1fr auto auto; padding-inline: 12px; }
  .brand-mark { width: 40px; height: 40px; }
  .month-row { grid-template-columns: 54px 1fr 8px; gap: 5px; }
  .timeline-scale { grid-template-columns: 54px 1fr; }
  .field-grid { grid-template-columns: 1fr 1fr; }
  .nav-button { font-size: .62rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* Visual direction v7: surgical dentistry */
:root {
  --ink: #102647;
  --ink-soft: #5f7190;
  --canvas: #f2f5f6;
  --navy: #063d48;
  --primary: #00675d;
  --primary-bright: #16877b;
  --free: #dff5ec;
  --free-strong: #168466;
  --approval: #e9ddff;
  --approval-strong: #8060bd;
  --closed: #d7dadd;
  --implant: #ef4d55;
  --removal: #48bd86;
  --other: #ffbd2e;
  --border: #dbe3ea;
  --shadow: 0 18px 48px rgba(17, 42, 63, .14);
  --radius-lg: 18px;
  --radius-md: 13px;
}

body {
  background: var(--canvas);
}

.app-shell {
  width: min(100%, 1180px);
  background: #fff;
  border-color: #e4eaee;
}

.topbar {
  isolation: isolate;
  min-height: 132px;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto 1fr;
  align-items: center;
  overflow: hidden;
  padding: 18px clamp(18px, 4vw, 34px);
  background: #034f55;
  box-shadow: 0 8px 24px rgba(0, 69, 73, .22);
}

.topbar::before,
.topbar::after {
  position: absolute;
  inset: 0;
  z-index: -2;
  content: "";
}

.topbar::before {
  background: url("./assets/dental-implant-header.jpg") center right / cover no-repeat;
}

.topbar::after {
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(0, 72, 76, .98) 0%, rgba(0, 77, 81, .92) 38%, rgba(0, 67, 75, .46) 68%, rgba(0, 39, 51, .58) 100%),
    linear-gradient(0deg, rgba(0, 63, 67, .18), rgba(0, 63, 67, .18));
}

.brand-copy {
  grid-column: 1;
  grid-row: 1 / 3;
  align-self: center;
}

.brand-copy h1 {
  max-width: 270px;
  margin: 0;
  color: #fff;
  font-size: clamp(1.35rem, 4vw, 1.85rem);
  line-height: 1.08;
  letter-spacing: -.035em;
  text-shadow: 0 2px 12px rgba(0, 31, 38, .35);
}

.room-badge {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  align-items: baseline;
  gap: 8px;
  align-self: end;
  padding: 7px 13px;
  border: 1px solid rgba(119, 224, 213, .52);
  border-radius: 9px;
  background: rgba(0, 65, 64, .68);
  box-shadow: 0 10px 30px rgba(0, 33, 39, .14);
  backdrop-filter: blur(3px);
}

.room-badge span {
  font-size: .82rem;
  font-weight: 700;
}

.room-badge strong {
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -.055em;
}

.topbar-actions {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.topbar-actions .icon-button,
.topbar-actions .avatar-button {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(0, 50, 56, .48);
  backdrop-filter: blur(3px);
}

.notification-dot {
  top: 5px;
  right: 5px;
  border-color: #004c51;
}

#app {
  min-height: calc(100vh - 204px);
  padding: 20px clamp(14px, 4vw, 28px) 112px;
}

.calendar-controls {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
}

.calendar-controls .month-switcher,
.calendar-controls .date-switcher {
  flex: 1 1 auto;
}

.calendar-controls .ghost-button {
  flex: 0 0 auto;
}

.round-button,
.ghost-button,
.pill-button,
.primary-button,
.secondary-button,
.danger-button {
  border-radius: 10px;
}

.round-button {
  border-color: transparent;
  color: var(--ink);
  font-size: 1.7rem;
  line-height: 1;
}

.ghost-button {
  color: var(--primary);
  background: #f7faf9;
}

.primary-button {
  border-color: #005c54;
  background: linear-gradient(135deg, #00675d, #004e4c);
}

.panel {
  border-color: var(--border);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: 0 8px 28px rgba(28, 56, 76, .07);
}

.legend-block {
  margin: 10px 2px 12px;
}

.legend-title {
  margin-bottom: 6px;
  color: #73849b;
  font-size: .68rem;
}

.legend {
  gap: 7px 16px;
}

.legend-item {
  color: #334866;
  font-size: .74rem;
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
}

.month-card {
  padding: 6px 4px;
  border: 0;
  box-shadow: none;
}

.month-list {
  gap: 6px;
}

.month-row {
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 8px;
  min-height: 58px;
  padding: 3px 5px;
  border-radius: 9px;
}

.month-row:hover,
.month-row:focus-visible,
.month-row.today {
  background: #eff9f7;
}

.month-row.past {
  opacity: 1;
  filter: grayscale(.85);
}

.month-row.past .day-label {
  opacity: .46;
}

.month-row.past .month-segment,
.month-row.closed-day .month-segment {
  background: var(--closed);
}

.day-label {
  align-self: end;
  padding-bottom: 5px;
}

.day-label strong {
  color: #112955;
  font-size: 1.1rem;
}

.day-label span {
  color: #405878;
  font-size: .7rem;
}

.month-time {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.row-scale-marks {
  display: flex;
  justify-content: space-between;
  color: #405878;
  font-size: .61rem;
  font-variant-numeric: tabular-nums;
}

.month-bar {
  height: 31px;
  border-radius: 5px;
  background: var(--free);
}

.month-segment {
  box-shadow: inset -1px 0 rgba(255, 255, 255, .22);
}

.row-chevron {
  display: none;
}

.finder-panel {
  background: linear-gradient(145deg, #005d58, #004550);
}

.day-summary {
  padding-top: 2px;
}

.summary-chip {
  border: 1px solid #e2e9ed;
  border-radius: 10px;
  background: #f8fafb;
}

.day-legends {
  margin-top: 2px;
}

.day-panel {
  padding: 6px 8px 18px;
  border: 0;
  box-shadow: none;
}

.slot-button {
  border-top-color: rgba(140, 164, 177, .22);
  background: rgba(223, 245, 236, .72);
}

.slot-button.restricted {
  background: repeating-linear-gradient(135deg, rgba(221, 207, 252, .78) 0 5px, rgba(242, 235, 255, .86) 5px 10px);
}

.booking-block {
  padding: 8px 12px;
  border: 1px solid rgba(18, 52, 70, .08);
  border-left: 7px solid transparent;
  border-radius: 7px;
  color: var(--ink);
  box-shadow: 0 4px 12px rgba(24, 53, 67, .08);
}

.booking-block.implant {
  border-left-color: #ee3344;
  background: linear-gradient(110deg, #ffd0d3, #ffb7bd);
}

.booking-block.removal {
  border-left-color: #21aa72;
  background: linear-gradient(110deg, #d7f5e7, #bcebd7);
}

.booking-block.other {
  border-left-color: #ffb20d;
  background: linear-gradient(110deg, #fff1bd, #ffe18a);
  color: #4c3a05;
}

.booking-block.pending {
  outline: 2px dashed rgba(111, 76, 164, .7);
  outline-offset: -3px;
}

.booking-block .booking-comment,
.booking-block.other .booking-comment {
  border-top-color: rgba(16, 38, 71, .13);
}

.bottom-nav {
  width: min(100%, 1180px);
  min-height: calc(70px + var(--safe-bottom));
  border-top-color: #e0e7eb;
  background: rgba(255, 255, 255, .98);
}

.nav-button {
  color: #25416a;
  border-radius: 10px;
}

.nav-button.active {
  color: #00675d;
  background: #edf8f5;
}

.sheet-dialog {
  border-radius: 22px 22px 0 0;
}

.sheet {
  background: #fff;
}

.sheet-heading h2 {
  color: #102647;
  font-size: 1.3rem;
}

.sheet-heading .eyebrow {
  color: #657792;
  text-transform: none;
  letter-spacing: 0;
}

.field > span,
.time-field legend,
.category-field legend {
  color: #243b61;
}

.field input,
.field select,
.field textarea {
  border-radius: 9px;
  border-color: #d8e0e9;
}

.category-field {
  min-width: 0;
  margin: 0 0 13px;
  padding: 0;
  border: 0;
}

.category-field legend {
  margin-bottom: 7px;
  font-size: .8rem;
  font-weight: 750;
}

.category-options {
  display: grid;
  gap: 5px;
}

.category-option {
  position: relative;
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 9px 12px;
  border: 1px solid #dbe3ea;
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
}

.category-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: 0;
  padding: 0;
  opacity: 0;
}

.category-radio {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid var(--cat);
  border-radius: 50%;
  background: color-mix(in srgb, var(--cat) 18%, white);
}

.category-option input:checked + .category-radio::after {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cat);
  content: "";
}

.category-option:has(input:checked) {
  border-color: color-mix(in srgb, var(--cat) 70%, #9aabba);
  background: color-mix(in srgb, var(--cat) 6%, white);
}

.category-option:focus-within {
  box-shadow: 0 0 0 3px rgba(22, 135, 123, .14);
}

.employees-layout { margin-top: 18px; }
.employee-list { display: grid; gap: 12px; margin-top: 14px; }
.employee-card { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 16px; background: #fff; }
.employee-card.inactive { opacity: .68; background: #f5f7f8; }
.employee-heading, .account-summary { display: flex; align-items: center; gap: 11px; }
.employee-heading > span:last-child, .account-summary > span:last-child { display: grid; gap: 2px; }
.employee-heading small, .account-summary small { color: var(--ink-soft); }
.employee-heading .role-icon, .account-summary .role-icon { flex: 0 0 auto; color: #fff; background: var(--primary); }
.employee-heading .role-icon.nurse, .account-summary .role-icon.nurse { background: #7b5aa8; }
.employee-heading .role-icon.admin, .account-summary .role-icon.admin { background: #073d55; }
.employee-fields { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 9px; }
.compact-field { margin: 0; }
.employee-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.employee-actions button { min-height: 38px; padding-inline: 12px; font-size: .78rem; }
.account-summary { margin: 8px 0 22px; padding: 14px; border-radius: 16px; background: #eef6f8; }

@media (min-width: 760px) {
  .finder-panel,
  .admin-form {
    top: 154px;
  }

  .sheet-dialog {
    border-radius: 22px;
  }
}

@media (max-width: 560px) {
  .auth-screen { padding: 0; place-items: stretch; }
  .auth-card { min-height: 100vh; grid-template-columns: 1fr; border: 0; border-radius: 0; }
  .auth-hero { min-height: 205px; }
  .auth-content { align-self: start; padding: 26px 20px 36px; }

  .topbar {
    min-height: 142px;
    padding: 14px;
  }

  .topbar::before {
    background-position: 58% center;
  }

  .topbar::after {
    background: linear-gradient(90deg, rgba(0, 72, 76, .99) 0%, rgba(0, 72, 76, .9) 48%, rgba(0, 47, 58, .43) 100%);
  }

  .brand-copy h1 {
    max-width: 170px;
    font-size: 1.3rem;
  }

  .room-badge {
    gap: 6px;
    padding: 6px 9px;
  }

  .room-badge span {
    font-size: .72rem;
  }

  .room-badge strong {
    font-size: 1.72rem;
  }

  .calendar-controls {
    align-items: stretch;
  }

  .calendar-controls .ghost-button {
    min-height: 42px;
    padding-inline: 10px;
    font-size: .72rem;
  }

  .month-row {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 4px;
  }

  .month-bar {
    height: 29px;
  }

  .legend-item {
    font-size: .69rem;
  }

  .employee-fields { grid-template-columns: 1fr; }
  .employee-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .employee-actions button:last-child { grid-column: 1 / -1; }
}

@supports not (color: color-mix(in srgb, red 50%, white)) {
  .category-radio { background: #fff; }
  .category-option:has(input:checked) { border-color: var(--cat); background: #f8fafb; }
}
