:root {
  --appointment-ink: #15233b;
  --appointment-muted: #63708a;
  --appointment-panel: #ffffff;
  --appointment-canvas: #eef3f9;
  --appointment-border: #dfe7f1;
  --appointment-blue: #2d6bd8;
  --appointment-blue-soft: #eaf2ff;
  --appointment-green: #1f9d78;
  --appointment-green-soft: #e9f8f3;
  --appointment-red: #c7424d;
}

.appointments-page {
  min-height: 100vh;
  color: var(--appointment-ink);
  background:
    radial-gradient(circle at 80% -15%, rgba(76, 142, 230, 0.16), transparent 34rem),
    var(--appointment-canvas);
}

.appointment-topbar {
  padding-block: 14px;
  background: linear-gradient(110deg, #10243e, #1c4e86 62%, #367bd3);
}

.appointment-brand {
  color: #fff;
  font-size: 1.15rem;
  font-weight: 780;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.appointment-brand span {
  margin-left: 8px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.appointment-topbar .language-switcher {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.12);
}

.appointment-topbar .language-option {
  min-width: 34px;
  padding: 6px 8px;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
  text-decoration: none;
}

.appointment-topbar .language-option.active {
  color: #24446f;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}

.appointment-topbar .language-option-en-disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.appointment-shell {
  width: min(1600px, calc(100% - 40px));
  margin: 0 auto;
  padding: 42px 0 64px;
}

.appointment-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.appointment-eyebrow {
  margin: 0 0 9px;
  color: #2b66bd;
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.appointment-hero h1,
.appointment-calendar-toolbar h2,
.appointment-side-heading h2,
.appointment-modal-card h2 {
  margin: 0;
  color: var(--appointment-ink);
  letter-spacing: -0.04em;
}

.appointment-hero h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.appointment-hero p:not(.appointment-eyebrow) {
  max-width: 620px;
  margin: 9px 0 0;
  color: var(--appointment-muted);
  line-height: 1.55;
}

.appointment-hero-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 10px 13px;
  border: 1px solid var(--appointment-border);
  border-radius: 999px;
  color: #55647c;
  background: rgba(255, 255, 255, 0.8);
  font-size: 0.78rem;
  font-weight: 700;
}

.appointment-note-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--appointment-green);
  box-shadow: 0 0 0 4px rgba(31, 157, 120, 0.12);
}

.appointment-alert {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 12px;
  font-weight: 650;
}

.appointment-alert-error { color: #9d2934; background: #fff0f1; border: 1px solid #ffd7da; }
.appointment-alert-success { color: #16715a; background: #ecfbf5; border: 1px solid #c7f0e1; }

.appointment-dashboard {
  display: grid;
  grid-template-columns: minmax(245px, 290px) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--appointment-border);
  border-radius: 22px;
  background: var(--appointment-panel);
  box-shadow: 0 18px 45px rgba(34, 58, 91, 0.09);
}

.appointment-sidebar {
  padding: 28px;
  border-right: 1px solid var(--appointment-border);
  background: linear-gradient(180deg, #f7faff, #fff);
}

.appointment-side-heading h2 { font-size: 1.35rem; }
.appointment-side-heading p:not(.appointment-eyebrow) {
  color: var(--appointment-muted);
  font-size: 0.9rem;
  line-height: 1.58;
}

.appointment-date-form,
.appointment-booking-form {
  display: grid;
  gap: 9px;
}

.appointment-date-form { margin-top: 26px; }
.appointment-date-form label,
.appointment-booking-form label {
  color: #42516a;
  font-size: 0.78rem;
  font-weight: 750;
}

.appointment-date-form input,
.appointment-date-form button,
.appointment-booking-form input,
.appointment-booking-form select,
.appointment-booking-form textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 43px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #cfdae8;
  border-radius: 9px;
  color: var(--appointment-ink);
  background: #fff;
  font: inherit;
}

.appointment-date-form button,
.appointment-submit-button {
  border: 0;
  color: #fff;
  background: var(--appointment-blue);
  font-weight: 750;
  cursor: pointer;
}

.appointment-date-form button:hover,
.appointment-submit-button:hover { background: #225bb9; }

.appointment-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 28px;
}

.appointment-stats div {
  padding: 12px;
  border: 1px solid var(--appointment-border);
  border-radius: 11px;
  background: #fff;
}

.appointment-stats span,
.appointment-stats strong { display: block; }
.appointment-stats span { color: var(--appointment-muted); font-size: 0.7rem; font-weight: 700; }
.appointment-stats strong { margin-top: 4px; font-size: 1.45rem; letter-spacing: -0.05em; }

.appointment-legend {
  display: grid;
  gap: 9px;
  margin-top: 24px;
  color: #56657d;
  font-size: 0.8rem;
  font-weight: 650;
}

.appointment-legend span { display: inline-flex; align-items: center; gap: 8px; }
.appointment-legend i { width: 10px; height: 10px; border-radius: 4px; }
.legend-available { border: 1px solid #8fd5bf; background: var(--appointment-green-soft); }
.legend-booked { background: #477cd1; }

.appointment-preview-note {
  margin-top: 30px;
  padding: 15px;
  border-radius: 12px;
  color: #4f6180;
  background: var(--appointment-blue-soft);
  font-size: 0.78rem;
  line-height: 1.48;
}

.appointment-preview-note p { margin: 6px 0 0; }

.appointment-calendar-card { min-width: 0; padding: 28px; }

.appointment-calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.appointment-calendar-toolbar h2 { font-size: 1.4rem; }

.appointment-day-close-button {
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid #d5a0a0;
  border-radius: 9px;
  color: #8f3030;
  background: #fff7f7;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 750;
  cursor: pointer;
}
.appointment-day-close-button:hover { background: #ffeded; }
.appointment-day-close-button:disabled { opacity: 0.7; cursor: default; }
.report-patient-link { border: 0; padding: 0; background: none; color: inherit; font: inherit; font-weight: 750; text-align: left; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.report-patient-link:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.report-card { width: min(100%, 980px); }
.report-card [hidden] { display: none !important; }
.report-card textarea { min-height: 300px; resize: vertical; line-height: 1.65; }
.report-notice { padding: 12px; border-radius: 9px; background: #edf4fb; color: #425b79; font-size: .85rem; }
.report-email-panel { margin-top: 20px; border-top: 1px solid #d3dfed; padding-top: 16px; }
.report-email-panel summary { cursor: pointer; font-weight: 750; padding: 10px 0; }
.report-email-panel fieldset { border: 0; padding: 0; margin: 8px 0; }
.report-email-panel label { display: grid; gap: 8px; font-weight: 650; }
.report-email-panel input { box-sizing: border-box; width: 100%; min-height: 44px; padding: 10px; border: 1px solid #c5d5e7; border-radius: 8px; font: inherit; }
.report-email-panel p { font-size: .85rem; line-height: 1.5; }
.report-email-panel :disabled { opacity: .6; cursor: default; }
#report-error { color: #a32936; }
#report-preview { width: 100%; height: 60vh; min-height: 280px; border: 1px solid #d3dfed; border-radius: 9px; }
.report-actions { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 14px; }
.report-actions button, .report-actions a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; box-sizing: border-box; padding: 10px 16px; border: 1px solid #c5d5e7; border-radius: 9px; background: #edf4fb; color: #214d83; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
@media (max-width: 640px) { .report-actions > * { flex: 1 1 100%; } }

.appointment-week-actions { display: flex; gap: 8px; }
.appointment-week-actions a {
  padding: 9px 10px;
  border: 1px solid var(--appointment-border);
  border-radius: 8px;
  color: #3f506c;
  background: #fff;
  font-size: 0.75rem;
  font-weight: 720;
  text-decoration: none;
  white-space: nowrap;
}
.appointment-week-actions a:hover { border-color: #9fbee9; color: #1d57ac; background: #f6faff; }
.appointment-week-actions .appointment-today-link { color: #1f5db5; border-color: #b9d1f4; background: #edf5ff; }

.appointment-calendar-scroll {
  max-height: min(760px, calc(100vh - 250px));
  overflow: auto;
  padding-bottom: 4px;
  scrollbar-color: #b6c5d9 transparent;
}
.appointment-calendar-grid {
  display: grid;
  grid-template-columns: 66px repeat(7, minmax(126px, 1fr));
  min-width: 970px;
  border-top: 1px solid var(--appointment-border);
  border-left: 1px solid var(--appointment-border);
}

.appointment-grid-head,
.appointment-day-header {
  min-height: 72px;
  padding: 13px 10px;
  border-right: 1px solid var(--appointment-border);
  border-bottom: 1px solid var(--appointment-border);
  background: #f8fafd;
}

.appointment-grid-head,
.appointment-day-header {
  position: sticky;
  top: 0;
  z-index: 2;
}

.appointment-grid-head {
  display: flex;
  align-items: end;
  color: #8794a9;
  font-size: 0.68rem;
  font-weight: 750;
}

.appointment-grid-head { z-index: 3; }
.appointment-grid-head { min-height: 72px; }

.appointment-day-header { text-align: center; }
.appointment-day-header span,
.appointment-day-header strong,
.appointment-day-header small { display: block; }
.appointment-day-header span { color: #6d7c91; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.appointment-day-header strong { margin: 1px 0; font-size: 1.3rem; letter-spacing: -0.04em; }
.appointment-day-header small { color: #9ba6b6; font-size: 0.65rem; text-transform: capitalize; }
.appointment-day-header.is-today { background: #eaf3ff; box-shadow: inset 0 3px 0 #3976d1; }

.appointment-time-column {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 50px;
  padding-top: 9px;
  border-right: 1px solid var(--appointment-border);
  border-bottom: 1px solid var(--appointment-border);
  color: #8e9bad;
  background: #fbfcfe;
  font-size: 0.68rem;
  font-weight: 730;
}

.appointment-slot {
  min-height: 50px;
  padding: 7px 9px;
  border: 0;
  border-right: 1px solid var(--appointment-border);
  border-bottom: 1px solid var(--appointment-border);
  text-align: left;
  font: inherit;
}

.appointment-slot-available {
  color: #308367;
  background: #fff;
  cursor: pointer;
  transition: background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.appointment-slot-available span,
.appointment-slot-available small { display: block; }
.appointment-slot-available span { font-size: 0.72rem; font-weight: 760; }
.appointment-slot-available small { margin-top: 2px; color: #8a9cae; font-size: 0.62rem; }
.appointment-slot-available:hover { z-index: 1; background: var(--appointment-green-soft); box-shadow: inset 0 0 0 1px #7dcdb4, 0 3px 12px rgba(31, 157, 120, 0.12); transform: scale(1.015); }
.appointment-slot-available:focus-visible { outline: 3px solid rgba(45, 107, 216, 0.35); outline-offset: -3px; }

.appointment-slot-booked { color: #fff; background: linear-gradient(135deg, #3c70c2, #28579e); }
.appointment-move-handle { display:block; width:100%; margin:0 0 5px; min-height:32px; padding:4px; border:1px solid #ffffff55; border-radius:6px; color:#fff; background:#ffffff16; font:inherit; font-size:.68rem; font-weight:700; cursor:grab; touch-action:none; -webkit-user-select:none; user-select:none; }
.appointment-move-handle:focus-visible { outline:2px solid white; outline-offset:2px; }
.appointment-dragging,.appointment-dragging * { cursor:grabbing !important; user-select:none !important; -webkit-user-select:none !important; }
.move-source { opacity:.48; }
.appointment-slot-cell.move-target-valid { outline:3px solid #26a36d; outline-offset:-3px; background:#ddf7e9; }
.appointment-slot-cell.move-target-invalid { outline:3px solid #cf4759; outline-offset:-3px; background:#ffe6e9; }
.appointment-drag-ghost { position:fixed; z-index:100; pointer-events:none; width:200px; padding:15px; box-sizing:border-box; color:white; background:#28579e; border-radius:10px; box-shadow:0 10px 26px #10243e55; font-weight:700; font-size:.85rem; }
.appointment-trash-drop { display:none; position:fixed; z-index:101; bottom:max(24px,env(safe-area-inset-bottom)); left:50%; transform:translateX(-50%); width:210px; min-height:104px; align-items:center; justify-content:center; flex-direction:column; gap:4px; border:2px dashed #cf5364; border-radius:18px; background:#fff4f5; color:#a32e40; box-shadow:0 8px 32px #65203230; font:inherit; font-weight:750; touch-action:none; }
.appointment-dragging .appointment-trash-drop,.appointment-picking .appointment-trash-drop { display:flex; }
.appointment-trash-drop small { font-size:.72rem; font-weight:500; }
.appointment-trash-drop.is-target { background:#b32e43; color:white; border-style:solid; border-color:#b32e43; box-shadow:0 0 0 7px #e5aab280,0 8px 32px #65203230; }
.trash-confirm-button { background:#ac3041 !important; color:white !important; border-color:#ac3041 !important; }
.appointment-trash-items { display:grid; gap:10px; margin:18px 0; }
.appointment-trash-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px; border:1px solid #dce5f0; border-radius:12px; }
.appointment-trash-row div { min-width:0; overflow-wrap:anywhere; }
.appointment-trash-row strong,.appointment-trash-row small { display:block; }
.appointment-trash-row small { color:#6a7890; margin-top:5px; font-size:.78rem; }
.appointment-trash-row button { min-height:44px; flex-shrink:0; border:1px solid #b8c9df; color:#28579e; background:white; border-radius:8px; padding:8px 12px; font:inherit; font-size:.8rem; font-weight:650; cursor:pointer; }
@media(max-width:480px) { .appointment-trash-drop { width:180px; min-height:90px; bottom:max(14px,env(safe-area-inset-bottom)); } .appointment-trash-row { align-items:flex-start; flex-direction:column; } }
.appointment-picking .appointment-slot-cell[data-drop-state=free] { box-shadow:inset 0 0 0 2px #78c5a1; cursor:copy; }
.move-feedback-error,#move-confirm-error { color:#a32936; }
.move-confirm-card { max-width:580px; }
.move-patient-name { font-size:1.1rem; font-weight:750; color:#214d83; }
.move-time-comparison { display:grid; gap:12px; margin:20px 0; }
.move-time-comparison div { padding:12px 14px; border:1px solid #d8e3f1; border-radius:9px; background:#f8fbff; }
.move-time-comparison dt { color:#63708a; font-size:.8rem; margin-bottom:5px; }
.move-time-comparison dd { margin:0; font-weight:700; }
@media (pointer:coarse) { .appointment-move-handle { min-height:44px; } }
.appointment-slot-booked > span,
.appointment-slot-booked > strong { display: block; }
.appointment-slot-time { color: rgba(255,255,255,0.72); font-size: 0.62rem; font-weight: 650; }
.appointment-slot-booked > strong { margin-top: 5px; font-size: 0.76rem; }
.appointment-slot-booked > strong + span { margin-top: 2px; color: rgba(255,255,255,0.8); font-size: 0.65rem; }
.appointment-slot-booked details { margin-top: 6px; }
.appointment-slot-booked summary { cursor: pointer; color: rgba(255,255,255,0.88); font-size: 0.64rem; font-weight: 700; }
.appointment-slot-booked details p { margin: 5px 0; color: #fff; font-size: 0.65rem; line-height: 1.35; overflow-wrap: anywhere; }
.appointment-prescription-link { color: #fff; font-size: 0.65rem; font-weight: 750; }

.appointment-cancel-button {
  width: 100%;
  margin: 4px 0 0;
  padding: 6px;
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 6px;
  color: #fff;
  background: rgba(19, 43, 83, 0.42);
  font: inherit;
  font-size: 0.62rem;
  font-weight: 700;
  cursor: pointer;
}

.appointment-modal[hidden] { display: none; }
.appointment-modal { position: fixed; z-index: 30; inset: 0; display: grid; place-items: center; padding: 22px; }
.appointment-modal-backdrop { position: absolute; inset: 0; background: rgba(13, 28, 48, 0.6); backdrop-filter: blur(3px); }
.appointment-modal-card {
  box-sizing: border-box;
  position: relative;
  z-index: 1;
  width: min(100%, 760px);
  max-height: calc(100vh - 44px);
  overflow-y: auto;
  padding: 29px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 25px 70px rgba(3, 14, 31, 0.32);
}
.appointment-modal-card h2 { font-size: 1.55rem; }
.appointment-modal-close {
  position: absolute;
  top: 15px;
  right: 16px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  color: #57657b;
  background: #eef2f7;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}
.appointment-selected-slot { margin: 12px 0 22px; padding: 11px 12px; border-radius: 9px; color: #22579e; background: #edf5ff; font-size: 0.85rem; font-weight: 750; }
.appointment-booking-form label { display: grid; gap: 7px; }
.appointment-booking-form input[type="radio"] { width: 20px; min-height: 20px; }
.appointment-booking-form fieldset label { display: flex; align-items: center; margin: 10px 0; }
.appointment-slot:disabled { cursor: default; opacity: .65; }
.appointment-slot-blocked { background: #f3f5f8; color: #778499; font-size: .72rem; border: 1px solid #e5eaf0; }
.appointment-slot-toggle { margin: 2px 0 0; }
.appointment-slot-cell { position: relative; min-width: 0; min-height: 30px; padding: 1px 4px; border-right: 1px solid var(--appointment-border); border-bottom: 1px solid var(--appointment-border); }
.appointment-slot-empty { display: block; min-height: 1px; }
.appointment-slot-cell > .appointment-slot { width: 100%; box-sizing: border-box; }
.appointment-slot-cell > .appointment-slot-available { min-height: 30px; padding: 3px 20px 3px 5px; }
.appointment-slot-toggle { position: absolute; z-index: 2; right: 5px; bottom: 3px; margin: 0; background: #fff; border-radius: 4px; }
.appointment-slot-toggle button { width: auto; min-height: 16px; padding: 1px 4px; font-size: .6rem; }
.appointment-slot-toggle button { border: 0; padding: 2px 5px; background: transparent; color: #456b9b; font-size: .66rem; cursor: pointer; }
.appointment-slot-toggle button:hover { text-decoration: underline; }
.appointment-slot-toggle button:disabled { opacity: .55; cursor: wait; }
.appointment-slot-cell.is-open > .appointment-slot-available { background: #e8f7ef; border-color: #b8dfc9; }

/* Internal workspace: the agenda remains usable while the dossier is open. */
[hidden] { display: none !important; }
.internal-view-toolbar { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; margin:18px 0; }
.internal-view-toolbar [role=group], .day-quick-actions { display:flex; flex-wrap:wrap; gap:8px; }
.internal-view-toolbar p { color:var(--appointment-muted); font-size:.85rem; }
.day-summary { background:white; border-radius:16px; margin-bottom:18px; }
.day-summary > summary { cursor:pointer; font-weight:750; padding:12px 0; }
.internal-view-toolbar button, .day-quick-actions button, .report-drawer button, .day-menu-actions button {
  font:inherit; font-size:.86rem; font-weight:650; border:1px solid #cbd8e8; border-radius:9px;
  padding:10px 13px; min-height:42px; background:#fff; color:#214d83; cursor:pointer;
}
.internal-view-toolbar button[aria-pressed=true], .patient-workflow button[aria-pressed=true] { background:#214d83; color:#fff; border-color:#214d83; }
.internal-view-toolbar button:hover, .report-drawer button:hover { border-color:#3475d0; }
.report-drawer button:disabled { opacity:.5; cursor:wait; }
.day-menu { position:sticky; overflow:visible; container-type:inline-size; }
.day-menu summary { cursor:pointer; list-style:none; padding:6px 0; border-radius:8px; }
.day-menu summary::-webkit-details-marker { display:none; }
.day-menu summary strong { display:flex; align-items:center; justify-content:center; gap:4px; }
.day-menu summary:focus-visible { outline:2px solid #3475d0; outline-offset:2px; }
.day-menu-chevron { flex-shrink:0; opacity:.55; transition:transform .15s ease; }
.day-menu[open] .day-menu-chevron { transform:rotate(180deg); }
.day-menu[open] { z-index:8; }
.day-menu-actions { position:absolute; top:calc(100% + 4px); left:0; right:0; width:100%; padding:6px; box-sizing:border-box;
  display:grid; gap:6px; background:#fff; border:1px solid #dce5f0; box-shadow:0 6px 18px #10243e1a; border-radius:10px; text-align:center; }
.day-menu-actions button { display:flex; align-items:center; justify-content:center; gap:5px; width:100%; min-width:0;
  min-height:36px; margin:0; padding:7px 3px; box-sizing:border-box; font-size:.76rem; line-height:1.2; white-space:nowrap; }
.day-menu-actions button svg { flex-shrink:0; }
.day-menu-actions [data-day-action=open] { color:#23694f; background:#eff8f3; border-color:#cee5d8; }
.day-menu-actions [data-day-action=close] { color:#9a3b48; background:#fff4f4; border-color:#eed6db; }
.day-menu-actions button:hover { filter:brightness(.97); }
.day-menu-actions button:disabled { opacity:.45; cursor:default; }
.agenda-hours-notice,.day-hours-help { color:#63708a; font-size:.82rem; line-height:1.6; }
.manage-hours-button { font:inherit; padding:10px 14px; color:#214d83; background:#edf5ff; border:1px solid #bad0eb; border-radius:9px; cursor:pointer; font-weight:700; }
.day-hours-card { max-width:620px; }
#internal-calendar-grid .appointment-calendar-grid { grid-template-columns:var(--internal-columns); min-width:600px; }
.appointment-calendar-toolbar:has(.manage-hours-button) { flex-wrap:wrap; }
#day-hours-error { color:#a32936; font-size:.85rem; }
#day-hours-error:empty { display:none; }
@container (max-width:75px) { .day-menu-actions button span { display:none; } .day-menu-actions button { gap:0; } }
.patient-list-card { background:white; border:1px solid var(--appointment-border); border-radius:18px; overflow:hidden; }
.patient-list-card header { padding:20px 24px; }
.patient-list-card h2 { margin:0; font-size:1.3rem; }
.patient-list-card header p { color:var(--appointment-muted); }
.patient-table-scroll { overflow:auto; }
.patient-table { width:100%; border-collapse:collapse; text-align:left; min-width:760px; }
.patient-table th { color:#526682; background:#f3f7fc; font-size:.76rem; letter-spacing:.03em; padding:14px 18px; }
.patient-table td { padding:18px; border-top:1px solid #e2e9f3; vertical-align:top; min-width:160px; }
.patient-table tr:hover { background:#f8fbff; }
.patient-table td:first-child { width:30%; }
.patient-table td > *, .patient-table td > a { display:block; margin:4px 0 9px; }
.patient-table td > .report-patient-link { color:#24558c; font-size:.86rem; }
.patient-table small { color:var(--appointment-muted); max-width:300px; }
.patient-row-time { font-size:.76rem; font-weight:750; color:#63708a; }
.riziv-list-header { display:flex; justify-content:space-between; align-items:flex-start; gap:18px; flex-wrap:wrap; }
.riziv-list-tools { padding-top:0; }
.riziv-list-notice { margin:0 24px 16px; color:#63708a; font-size:.8rem; line-height:1.6; max-width:850px; }
#riziv-status { margin:0 24px 18px; font-size:.82rem; color:#336b57; }
.riziv-patient-table td:first-child { width:auto; min-width:35px; color:#63708a; font-size:.8rem; }
.riziv-patient-table td:nth-child(2) { min-width:115px; }
.riziv-patient-table td:nth-child(3) { min-width:180px; }
.riziv-patient-table td:last-child { color:#63708a; font-size:.78rem; }
.riziv-view-active .day-summary, .history-view-active .day-summary { display:none; }
.history-close { font-size:1.6rem !important; min-width:42px; padding:0 !important; flex-shrink:0; }
.history-add-button { font:inherit; font-size:.86rem; padding:11px 15px; border:1px solid #bad0eb; border-radius:9px; background:#edf5ff; color:#214d83; font-weight:750; cursor:pointer; }
.history-feedback { margin:0 24px 16px; color:#526682; font-size:.85rem; }
.history-status { display:inline-flex !important; padding:5px 9px; border-radius:20px; font-size:.75rem; font-weight:750; background:#eef2f7; color:#59677d; }
.history-status-ready { background:#e7f5ee; color:#24694f; }
.history-status-transferred { background:#eaf1ff; color:#285aaa; }
.history-editor-section { margin:20px 0; padding-top:12px; border-top:1px solid #dce5f0; scroll-margin-top:16px; }
.history-editor-section h3 { font-size:1rem; }
.history-help { font-size:.8rem; color:#63708a; line-height:1.6; }
#history-status { font-size:.82rem; color:#336b57; }
#history-error { color:#a32936; font-size:.85rem; line-height:1.6; }
#history-error:empty { display:none; }
#history-readonly-text { white-space:pre-wrap; overflow-wrap:anywhere; padding:18px; background:#f8fbff; border:1px solid #dce5f0; border-radius:10px; font-size:.96rem; line-height:1.8; user-select:text; }
#history-text-editor { display:grid; gap:16px; }
#history-text-editor textarea { font-weight:400; }
.history-review { display:flex !important; align-items:flex-start; gap:10px !important; padding:12px; background:#edf5ff; border-radius:9px; font-size:.85rem; }
.history-review input { width:19px !important; min-height:19px !important; height:19px; flex-shrink:0; margin:0; }
.history-document { border:1px solid #dce5f0; padding:16px; border-radius:12px; margin:12px 0; }
.history-document h4 { margin:0 0 12px; }
.history-document [data-history-upload] { display:grid; gap:12px; }
.history-document label { display:grid; gap:8px; font-size:.85rem; }
.history-document input { max-width:100%; min-width:0; }
.history-document small { color:#63708a; font-size:.75rem; }
.history-document [data-history-filename] { font-size:.82rem; overflow-wrap:anywhere; }
.history-table td small { margin-bottom:6px; }
.internal-billing-picker { min-width:0; padding:14px; border:1px solid #dce5f0; border-radius:10px; background:#f8fbff; }
.patient-identifier-form .internal-billing-picker { grid-column:1 / -1; }
.internal-billing-picker label { display:grid; gap:8px; font-size:.85rem; font-weight:700; }
.internal-billing-picker input { width:100%; box-sizing:border-box; }
.billing-description { font-size:.84rem; line-height:1.6; color:#415775; overflow-wrap:anywhere; }
.billing-copy-status { font-size:.8rem; color:#336b57; }
.billing-copy-status:empty { display:none; }
.history-register-tools { display:flex; flex-wrap:wrap; align-items:center; gap:12px; margin:0 24px 16px; }
.history-register-tools p { flex:1 1 300px; font-size:.8rem; color:#63708a; line-height:1.6; margin:0; }
.history-register-tools button,.register-row-action button,.history-row-feedback button { font:inherit; padding:9px 12px; border:1px solid #cbd8e8; border-radius:8px; background:white; color:#214d83; cursor:pointer; font-size:.8rem; }
.register-row-action button[data-register-action="remove"] { color:#973b46; border-color:#ebcbd0; }
.history-row-feedback { display:flex; align-items:center; flex-wrap:wrap; gap:12px; margin:0 24px 16px; padding:12px; background:#edf5ff; border-radius:9px; font-size:.83rem; }
.history-row-feedback[hidden] { display:none; }
.history-row-feedback span { flex:1 1 220px; }
@media print {
  .printing-riziv { padding:0 !important; background:white; color:black; }
  .printing-riziv .appointment-topbar,
  .printing-riziv .appointment-hero,
  .printing-riziv .day-summary,
  .printing-riziv .internal-view-toolbar,
  .printing-riziv #availability-feedback,
  .printing-riziv #internal-calendar,
  .printing-riziv #patient-list,
  .printing-riziv #report-modal,
  .printing-riziv #history-panel,
  .printing-riziv #history-list,
  .printing-riziv #appointment-modal,
  .printing-riziv .riziv-list-tools,
  .printing-riziv #riziv-status { display:none !important; }
  body.printing-riziv .appointment-shell { width:100%; margin:0; padding:0; }
  .printing-riziv .riziv-list-card { border:0; border-radius:0; box-shadow:none; }
  .printing-riziv .patient-table-scroll { overflow:visible; }
  body.printing-riziv .riziv-patient-table { width:100%; min-width:0; table-layout:auto; font-size:9pt; }
  body.printing-riziv .riziv-patient-table td,
  body.printing-riziv .riziv-patient-table th { min-width:0; padding:7px 5px; overflow-wrap:anywhere; }
  .printing-riziv .riziv-patient-table tr { break-inside:avoid; }
  .printing-riziv .riziv-patient-table thead { display:table-header-group; }
  .printing-riziv .riziv-patient-table .report-patient-link { border:0; padding:0; background:none; color:black; text-decoration:none; font:inherit; }
  .printing-riziv .riziv-patient-table [data-report-action=identity] { display:none; }
}
.report-drawer { --drawer-pad:24px; position:fixed; top:0; right:0; bottom:0; z-index:25; width:var(--report-width, 560px);
  box-sizing:border-box; background:#fff; border-left:1px solid #ccd9e9; box-shadow:-12px 0 40px #1733531a;
  display:flex; flex-direction:column; animation:report-slide-in .18s ease-out; }
.report-drawer-header { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:20px var(--drawer-pad); background:#f5f8fd; border-bottom:1px solid #dfe7f1; }
.report-drawer-header h2 { font-size:1.25rem; margin:0; overflow-wrap:anywhere; }
.report-drawer-header .appointment-eyebrow { font-size:.64rem; margin-bottom:6px; }
.report-drawer-header #report-close { font-size:1.6rem; min-width:42px; padding:0; flex-shrink:0; }
.report-drawer-content { padding:0 var(--drawer-pad) 20px; overflow-y:auto; overscroll-behavior:contain; min-height:0; }
#report-patient-summary { font-size:.85rem; color:#526682; line-height:1.6; }
.patient-workflow { display:flex; gap:8px; border-bottom:1px solid #dfe7f1; padding-bottom:15px; }
.patient-workflow button { flex:1; }
#report-save-status { color:#336b57; font-size:.8rem; min-height:1.2em; }
#report-error:empty, #patient-details-status:empty, #patient-request-status:empty { display:none; }
.patient-identifier-form { padding:14px; border:1px solid #e1e8f2; border-radius:10px; margin:18px 0; display:grid; grid-template-columns:1fr auto; gap:10px; align-items:end; }
.patient-identifier-form label { display:grid; gap:7px; font-size:.8rem; font-weight:650; }
.patient-identifier-form label span { color:#63708a; font-weight:400; }
.patient-identifier-form input { min-width:0; box-sizing:border-box; width:100%; padding:10px; border:1px solid #cbd8e8; border-radius:7px; font:inherit; }
#patient-details-status { grid-column:1/-1; font-size:.8rem; }
.report-drawer .appointment-booking-form { display:grid; gap:16px; }
.report-drawer .appointment-booking-form textarea { min-height:330px; line-height:1.7; font-size:.95rem; padding:14px; resize:vertical; }
.report-fields-row { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.report-section-heading { display:flex; justify-content:space-between; gap:10px; flex-wrap:wrap; align-items:center; }
.report-section-heading h3 { font-size:1rem; }
#report-readonly-meta { color:#63708a; font-size:.8rem; }
#report-readonly-text { white-space:pre-wrap; overflow-wrap:anywhere; padding:20px; border:1px solid #dfe7f1; background:#fafcfe; border-radius:10px; font-size:.96rem; line-height:1.8; user-select:text; }
.report-drawer iframe { width:100%; box-sizing:border-box; height:55vh; min-height:300px; border:1px solid #d3dfed; border-radius:9px; margin-top:14px; background:#f3f6fa; }
.request-upload-form { display:grid; gap:12px; }
.request-upload-form p { line-height:1.6; font-size:.86rem; }
.file-drop-label { padding:22px; border:2px dashed #aac1df; border-radius:12px; background:#f5f9ff; display:grid; gap:14px; font-weight:650; }
.file-drop-label input { max-width:100%; }
.patient-navigation { display:flex; justify-content:space-between; gap:10px; border-top:1px solid #dfe7f1; margin-top:24px; padding-top:18px; }
.report-panel-open { --report-width: min(46vw, 700px); padding-right:var(--report-width); }
.report-panel-open .appointment-sidebar { display:none; }
.report-panel-open .appointment-dashboard { grid-template-columns:minmax(0,1fr); }
.report-panel-open .appointment-hero h1 { font-size:1.6rem; }
.report-panel-open .appointment-hero-note { display:none; }
.report-panel-open .appointment-shell { width:calc(100% - 28px); padding-top:24px; }
.report-panel-open .appointment-calendar-toolbar { flex-wrap:wrap; }
.report-panel-open .patient-table { min-width:0; table-layout:fixed; }
.report-panel-open .patient-table td { min-width:0; padding:12px 10px; overflow-wrap:anywhere; }
.report-panel-open .patient-table th { padding:12px 10px; font-size:.69rem; }
.report-panel-open .patient-table .report-patient-link { font-size:.8rem; }
.report-panel-open .appointment-calendar-grid { min-width:500px; grid-template-columns:var(--internal-columns); }
.report-panel-open .appointment-day-header { padding:10px 2px; }
.report-panel-open .appointment-day-header small { font-size:.55rem; overflow-wrap:anywhere; }
.report-panel-open .appointment-topbar .admin-topbar-actions { flex-wrap:wrap; }
@keyframes report-slide-in { from { transform:translateX(30px); opacity:.3; } to { transform:translateX(0); opacity:1; } }
@media (min-width:800px) and (max-width:1100px) {
  .report-panel-open { --report-width:52vw; }
  .report-panel-open .appointment-hero { display:block; }
  .report-panel-open .appointment-topbar .admin-topbar-badge { display:none; }
  .report-drawer { --drawer-pad:16px; }
  .patient-identifier-form { grid-template-columns:1fr; }
}
@media (max-width:799px) {
  .report-panel-open { padding-right:0; }
  .report-drawer { width:100%; --drawer-pad:16px; }
  .report-fields-row, .patient-identifier-form { grid-template-columns:1fr; }
  .patient-workflow { flex-wrap:wrap; }
  .patient-navigation button { font-size:.75rem; padding:9px; }
}
@media (prefers-reduced-motion:reduce) { .report-drawer { animation:none; } }
#availability-feedback { padding: 9px 13px; color: #385b88; background: #edf5ff; border-radius: 8px; }
.appointment-booking-form label span { color: #94a1b4; font-weight: 550; }
.appointment-booking-form textarea { min-height: 86px; resize: vertical; }
.appointment-booking-form select[size] {
  min-height: 210px;
  padding: 6px;
  line-height: 1.35;
}
.appointment-booking-form select optgroup { color: #2f5f9f; font-size: 0.76rem; font-weight: 800; }
.appointment-booking-form select option { padding: 7px 8px; color: var(--appointment-ink); font-size: 0.82rem; }
.appointment-field-help { font-size: 0.72rem; }
.appointment-prescription-section {
  display: grid;
  gap: 13px;
  margin-top: 4px;
  padding: 15px;
  border: 1px solid #d9e5f2;
  border-radius: 12px;
  background: #f7faff;
}
.appointment-prescription-title {
  margin: 0;
  color: #2f4e76;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.appointment-prescription-copy {
  margin: 5px 0 0;
  color: #66758b;
  font-size: 0.77rem;
  line-height: 1.45;
}
.appointment-upload-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.appointment-upload-choice { min-width: 0; }
.appointment-upload-input {
  position: absolute;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.appointment-upload-choice > label {
  display: block;
  padding: 10px 9px;
  border: 1px dashed #91afd5;
  border-radius: 9px;
  color: #2d609f;
  background: #fff;
  font-size: 0.76rem;
  font-weight: 750;
  text-align: center;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}
.appointment-upload-choice > label:hover { border-color: #3974ba; background: #edf5ff; }
.appointment-upload-input:focus-visible + label { outline: 3px solid rgba(45, 107, 216, 0.3); outline-offset: 2px; }
.appointment-upload-status {
  display: block;
  margin-top: 6px;
  color: #79889e;
  font-size: 0.66rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
  text-align: center;
}
.appointment-submit-button { min-height: 46px; margin-top: 8px; border-radius: 9px; font-size: 0.9rem; }
.appointment-modal-open { overflow: hidden; }

.appointment-compact-week-wrap { margin-top: 24px; overflow-x: auto; }
.appointment-compact-week { width: 100%; min-width: 700px; table-layout: fixed; border-collapse: collapse; }
.appointment-compact-week th { padding: 14px 6px; background: #f8fafd; border: 1px solid var(--appointment-border); }
.appointment-compact-week th span, .appointment-compact-week th strong { display: block; }
.appointment-compact-week th span { font-size: .8rem; color: var(--appointment-muted); margin-bottom: 5px; }
.appointment-compact-week td { padding: 0; height: 44px; border: 1px solid var(--appointment-border); text-align: center; }
.appointment-compact-week .appointment-slot { width: 100%; min-height: 44px; border: 0; text-align: center; padding: 5px; }
.appointment-compact-week .appointment-slot strong { font-size: .8rem; }
.appointment-compact-week .appointment-slot small { display: block; font-size: .65rem; margin-top: 2px; }
.appointment-closed-cell { background: #f3f5f8; }
.appointment-closed-label { color: var(--appointment-muted); font-size: .75rem; }

/* Keep a calendar on touch screens, with readable columns and touch targets. */
.appointment-mobile-closed-days { display: none; }
.appointment-shell, .appointment-booking-form, .appointment-booking-form label { min-width: 0; }
.appointment-calendar-toolbar { flex-wrap: wrap; }
.appointment-week-actions { flex-wrap: wrap; }
.appointment-week-actions a { min-height: 44px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; white-space: normal; }
.appointment-modal-card { max-height: calc(100dvh - 44px); overscroll-behavior: contain; }
.appointment-modal-card h2 { padding-right: 44px; }
.appointment-modal-close { width: 44px; height: 44px; }
.appointment-booking-form fieldset { min-width: 0; border: 1px solid var(--appointment-border); border-radius: 9px; }
.appointment-booking-form fieldset label { min-height: 44px; }
.appointment-booking-form input[type="radio"] { flex-shrink: 0; }
.appointment-booking-form input, .appointment-booking-form select, .appointment-booking-form textarea { max-width: 100%; min-width: 0; }
#selected-exam { margin: 0; overflow-wrap: anywhere; line-height: 1.5; }
@media (max-width: 1024px) {
  .appointment-compact-week { min-width: 0; }
  .appointment-compact-week .appointment-slot { min-height: 48px; }
  .appointment-booking-form input, .appointment-booking-form select, .appointment-booking-form textarea,
  .appointment-date-form input { font-size: 16px; }
  .appointment-booking-form select:not([size]) { min-height: 48px; }
}
@media (max-width: 700px) {
  .appointment-compact-week .appointment-closed-column { display: none; }
  .appointment-mobile-closed-days { display: block; font-size: .8rem; color: var(--appointment-muted); }
  .appointment-compact-week .appointment-slot strong { font-size: .95rem; }
  .appointment-compact-week .appointment-slot small { font-size: .7rem; }
  .appointment-modal { padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); }
  .appointment-modal-card { max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .appointment-brand span { display: block; margin: 4px 0 0; }
}

@media (max-width: 980px) {
  .appointment-dashboard { grid-template-columns: 1fr; }
  .appointment-sidebar { border-right: 0; border-bottom: 1px solid var(--appointment-border); }
  .appointment-date-form { grid-template-columns: 1fr auto; align-items: end; }
  .appointment-date-form label { grid-column: 1 / -1; }
  .appointment-date-form button { min-width: 118px; }
  .appointment-preview-note { display: none; }
}

@media (max-width: 640px) {
  .appointment-shell { width: min(100% - 24px, 1600px); padding-top: 25px; }
  .appointment-hero, .appointment-calendar-toolbar { align-items: flex-start; flex-direction: column; }
  .appointment-hero-note { font-size: 0.7rem; }
  .appointment-dashboard { border-radius: 16px; }
  .appointment-sidebar, .appointment-calendar-card { padding: 20px 16px; }
  .appointment-calendar-toolbar { gap: 13px; }
  .appointment-week-actions { width: 100%; }
  .appointment-week-actions a { flex: 1; padding-inline: 7px; text-align: center; }
  .appointment-date-form { grid-template-columns: 1fr; }
  .appointment-date-form label { grid-column: auto; }
  .appointment-calendar-grid { min-width: 860px; grid-template-columns: 56px repeat(7, minmax(115px, 1fr)); }
  .appointment-modal-card { padding: 26px 20px; }
  .appointment-calendar-scroll { max-height: 640px; }
  .appointment-upload-options { grid-template-columns: 1fr; }
}
