/* Read-only lịch thủ thuật: density cao cho vận hành, dùng cùng token của shell. */
.schedule-view-page-heading { margin-bottom: 12px; }
.schedule-view-tabs { position: relative; display: flex; gap: 28px; align-items: end; min-width: 0; overflow-x: auto; border-bottom: 1px solid var(--border); margin-bottom: 14px; scrollbar-width: thin; }
.schedule-view-tab { min-height: 46px; margin-bottom: -1px; padding: 8px 2px 11px; border: 0; border-bottom: 3px solid transparent; border-radius: 0; color: var(--text-muted); background: transparent; font-weight: 700; white-space: nowrap; }
.schedule-view-tab:hover, .schedule-view-tab:focus-visible { color: var(--primary-700); }
.schedule-view-tab.is-active, .schedule-view-tab[aria-selected="true"] { border-bottom-color: var(--primary-700); color: var(--primary-700); }
.schedule-view-toolbar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; max-width: 100%; margin-bottom: 12px; padding: 12px 14px; overflow: hidden; }
.schedule-view-toolbar-main { display: grid; grid-template-columns: minmax(220px, 1.2fr) auto minmax(180px, auto) auto; align-items: end; gap: 12px; min-width: 0; width: 100%; }
.schedule-view-toolbar-main:has(#schedule-view-date-field:not([hidden])) { grid-template-columns: minmax(180px, 1.2fr) minmax(140px, .75fr) auto minmax(180px, 1fr) auto; }
.schedule-view-search-field { display: grid; gap: 5px; min-width: 0; color: var(--text-muted); font-size: .78rem; font-weight: 700; }
.schedule-view-search-field input { width: 100%; min-width: 0; }
.schedule-view-week-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.schedule-view-week-actions .button { min-height: 44px; padding-inline: 12px; white-space: nowrap; }
.schedule-view-week-range { align-self: center; margin: 0; color: var(--text-strong); font-weight: 700; text-align: center; white-space: nowrap; }
.schedule-view-feedback { min-height: 24px; margin: 0 0 4px; }
.schedule-view-state { display: grid; justify-items: start; gap: 8px; min-height: 150px; align-content: center; }
.schedule-view-state h3, .schedule-view-state p { margin: 0; }
.schedule-view-state p { color: var(--text-muted); }
.schedule-view-state.is-error { border-color: var(--danger-600); background: var(--danger-50); }
.schedule-view-state.is-stale { border-color: var(--warning-600); background: var(--warning-50); }
.schedule-view-layout { display: grid; min-width: 0; gap: 14px; align-items: start; }
.schedule-view-layout.patient-layout, .schedule-view-layout.procedure-layout { grid-template-columns: minmax(190px, 20%) minmax(0, 1fr) minmax(220px, 20%); }
.schedule-view-layout.staff-all-layout { grid-template-columns: minmax(0, 3fr) minmax(230px, 1fr); }
.schedule-view-layout.staff-one-layout { grid-template-columns: minmax(0, 1fr) minmax(230px, 28%); }
.schedule-view-panel { min-width: 0; padding: 14px; }
.schedule-view-panel > h3, .schedule-view-panel > h2 { margin-bottom: 4px; }
.schedule-view-panel-subtitle { margin: 0 0 10px; color: var(--text-muted); font-size: .84rem; }
.schedule-view-list { display: grid; gap: 6px; max-height: min(640px, calc(100dvh - 360px)); overflow: auto; padding-right: 2px; }
.schedule-view-list-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 9px; align-items: center; width: 100%; min-height: 56px; padding: 8px; border: 1px solid transparent; border-radius: 10px; color: var(--text-strong); background: transparent; text-align: left; }
.schedule-view-list-item:hover { border-color: var(--border); background: var(--surface-soft); }
.schedule-view-list-item.is-selected, .schedule-view-list-item[aria-current="true"] { border-color: var(--primary-600); background: var(--primary-100); }
.schedule-view-list-item strong, .schedule-view-list-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.schedule-view-list-item small { color: var(--text-muted); font-size: .76rem; }
.schedule-view-list-item > .status-badge { white-space: nowrap; }
.schedule-view-avatar { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; color: var(--primary-700); background: var(--primary-100); font-size: .76rem; font-weight: 800; }
.schedule-view-procedure-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 12px; color: var(--procedure-accent, var(--primary-700)); background: var(--procedure-bg, var(--primary-100)); font-size: .8rem; font-weight: 800; }
.schedule-view-detail { display: grid; gap: 13px; }
.schedule-view-detail h3, .schedule-view-detail h4, .schedule-view-detail p { margin: 0; }
.schedule-view-detail h3 { font-size: 1.06rem; }
.schedule-view-detail h4 { font-size: .9rem; }
.schedule-view-detail > p { color: var(--text-muted); font-size: .85rem; }
.schedule-view-detail-section { display: grid; gap: 7px; padding-top: 11px; border-top: 1px solid var(--border); }
.schedule-view-detail-section:first-child { padding-top: 0; border-top: 0; }
.schedule-view-detail-list { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.schedule-view-detail-list li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--border); font-size: .82rem; }
.schedule-view-detail-list li:last-child { border-bottom: 0; }
.schedule-view-detail-list span:last-child { color: var(--text-muted); text-align: right; }
.schedule-view-plan-list { display: grid; gap: 8px; }
.schedule-view-plan-card { display: grid; gap: 6px; padding: 9px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); }
.schedule-view-plan-card > strong { color: var(--primary-700); font-size: .82rem; }
.schedule-view-detail-note { margin: 7px 0 0; color: var(--text-muted); font-size: .76rem; line-height: 1.4; }
.schedule-view-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.schedule-view-kpi { display: grid; gap: 3px; min-height: 72px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.schedule-view-kpi span { color: var(--text-muted); font-size: .78rem; }
.schedule-view-kpi strong { font-size: 1.25rem; }
.schedule-view-summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.schedule-view-summary-card { display: grid; gap: 2px; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-soft); }
.schedule-view-summary-card strong { font-size: 1.2rem; }
.schedule-view-summary-card span { color: var(--text-muted); font-size: .76rem; }

/* Time-positioned seven-day calendar. 1.05 px per minute keeps cards compact while preserving their order. */
.schedule-view-calendar { min-width: 0; overflow: hidden; }
.schedule-view-calendar-header { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.schedule-view-calendar-header h3, .schedule-view-calendar-header p { margin: 0; }
.schedule-view-calendar-header h3 { font-size: 1.08rem; }
.schedule-view-calendar-header p { color: var(--text-muted); font-size: .82rem; }
.schedule-view-calendar-scroll { min-width: 0; overflow-x: auto; }
.schedule-view-week-grid { display: grid; grid-template-columns: 50px repeat(7, minmax(68px, 1fr)); min-width: 0; border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.schedule-view-week-grid.is-staff { grid-template-columns: 185px minmax(0, 1fr); min-width: 0; }
.schedule-view-week-grid.is-day { grid-template-columns: 56px minmax(280px, 1fr); min-width: 340px; }
.schedule-view-grid-corner, .schedule-view-day-label { min-height: 48px; padding: 8px 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface-soft); }
.schedule-view-staff-axis-header { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: center; min-height: 48px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface-soft); }
.schedule-view-staff-axis-header span { padding-left: 6px; color: var(--text-muted); font-size: .7rem; white-space: nowrap; }
.schedule-view-day-label { text-align: center; }
.schedule-view-day-label strong, .schedule-view-day-label span { display: block; }
.schedule-view-day-label strong { font-size: .82rem; }
.schedule-view-day-label span { color: var(--text-muted); font-size: .72rem; }
.schedule-view-day-label.is-today { color: var(--primary-700); background: var(--primary-100); }
.schedule-view-time-axis { position: relative; height: var(--schedule-view-track-height, 693px); border-right: 1px solid var(--border); background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--schedule-view-hour-height, 63px) - 1px), var(--border) var(--schedule-view-hour-height, 63px), var(--border) calc(var(--schedule-view-hour-height, 63px) + 1px)); }
.schedule-view-time-axis span { position: absolute; right: 7px; transform: translateY(-50%); color: var(--text-muted); font-size: .7rem; white-space: nowrap; }
.schedule-view-day-track, .schedule-view-staff-track { position: relative; height: var(--schedule-view-track-height, 693px); overflow: hidden; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--schedule-view-hour-height, 63px) - 1px), var(--border) var(--schedule-view-hour-height, 63px), var(--border) calc(var(--schedule-view-hour-height, 63px) + 1px)); }
.schedule-view-day-track.is-today { background-color: rgb(207 250 254 / 18%); }
.schedule-view-assignment { position: absolute; top: calc(var(--assignment-start) * 1px); left: calc(var(--assignment-lane, 0) * 3% + 3px); width: calc(97% / var(--assignment-lanes, 1) - 6px); min-height: 54px; height: max(54px, calc(var(--assignment-duration) * 1px)); max-height: calc(100% - var(--assignment-start) * 1px - 4px); display: grid; align-content: start; gap: 0; overflow: hidden; padding: 2px 3px; border: 1px solid var(--procedure-border, var(--border)); border-left: 3px solid var(--procedure-accent, var(--primary-600)); border-radius: 7px; color: var(--text-strong); background: var(--procedure-bg, var(--surface)); font-size: .7rem; line-height: 1.08; text-align: left; }
.schedule-view-assignment strong, .schedule-view-assignment span, .schedule-view-assignment small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.schedule-view-assignment strong { font-size: .72rem; letter-spacing: -.01em; }
.schedule-view-assignment small { color: var(--text-muted); }
.schedule-view-assignment.mode-patient .schedule-view-assignment-status, .schedule-view-assignment.mode-procedure .schedule-view-assignment-status { display: none; }
.schedule-view-assignment .schedule-view-assignment-status { color: var(--primary-700); font-size: .66rem; font-weight: 700; }
.schedule-view-assignment.tone-b { --procedure-bg: var(--success-50); --procedure-border: var(--success-600); --procedure-accent: var(--success-600); }
.schedule-view-assignment.tone-c { --procedure-bg: var(--warning-50); --procedure-border: var(--warning-600); --procedure-accent: var(--warning-600); }
.schedule-view-assignment.tone-d { --procedure-bg: var(--primary-100); --procedure-border: var(--primary-700); --procedure-accent: var(--primary-700); }
.schedule-view-assignment.tone-e { --procedure-bg: var(--danger-50); --procedure-border: var(--danger-600); --procedure-accent: var(--danger-600); }
.schedule-view-assignment.tone-f { --procedure-bg: var(--primary-100); --procedure-border: var(--primary-600); --procedure-accent: var(--primary-600); }
.schedule-view-assignment.is-cancelled { opacity: .64; }
.schedule-view-assignment.is-completed { --procedure-bg: var(--success-50); }
.schedule-view-unscheduled { position: absolute; inset: 8px; display: grid; place-items: center; color: var(--text-muted); font-size: .8rem; text-align: center; }
.schedule-view-staff-label { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 8px; align-items: center; min-height: 78px; padding: 8px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface); }
.schedule-view-staff-label strong, .schedule-view-staff-label small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.schedule-view-staff-label small { color: var(--text-muted); font-size: .72rem; }
.schedule-view-staff-row { display: contents; }
.schedule-view-staff-track { height: 78px; }
.schedule-view-staff-track .schedule-view-assignment { top: 10px; left: var(--assignment-left, 0%); width: var(--assignment-width, 10%); height: 58px; max-height: 68px; }
.schedule-view-staff-track .schedule-view-unscheduled { inset: 0; }
.schedule-view-no-data { min-height: 110px; display: grid; place-items: center; padding: 20px; color: var(--text-muted); text-align: center; }
.schedule-view-capability-note { margin: 0; padding: 10px; border-radius: 10px; color: var(--text-muted); background: var(--surface-soft); font-size: .8rem; }

@media (max-width: 1180px) {
  .schedule-view-toolbar-main, .schedule-view-toolbar-main:has(#schedule-view-date-field:not([hidden])) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .schedule-view-week-actions { grid-column: 1 / -1; }
  .schedule-view-week-range { text-align: left; }
  .schedule-view-layout.patient-layout, .schedule-view-layout.procedure-layout { grid-template-columns: minmax(190px, 25%) minmax(0, 1fr); }
  .schedule-view-layout.patient-layout .schedule-view-detail, .schedule-view-layout.procedure-layout .schedule-view-detail { grid-column: 1 / -1; }
  .schedule-view-layout.patient-layout .schedule-view-calendar, .schedule-view-layout.procedure-layout .schedule-view-calendar { grid-column: 2; grid-row: 1; }
  .schedule-view-layout.patient-layout .schedule-view-list-panel, .schedule-view-layout.procedure-layout .schedule-view-list-panel { grid-row: 1; }
  .schedule-view-layout.staff-all-layout, .schedule-view-layout.staff-one-layout { grid-template-columns: minmax(0, 1fr); }
  .schedule-view-layout.staff-all-layout .schedule-view-detail, .schedule-view-layout.staff-one-layout .schedule-view-detail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 768px) and (max-width: 1180px) {
  .schedule-view-week-grid { min-width: 700px; }
  .schedule-view-week-grid.is-staff { min-width: 795px; }
}
@media (min-width: 1181px) {
  .schedule-view-week-grid, .schedule-view-week-grid.is-staff { min-width: 0; }
}
@media (max-width: 767px) {
  .schedule-view-tabs { gap: 18px; margin-inline: -2px; }
  .schedule-view-tabs::after { content: '›'; position: sticky; right: 0; flex: 0 0 28px; align-self: stretch; display: grid; place-items: center; margin-left: -28px; color: var(--primary-700); background: linear-gradient(90deg, transparent, var(--surface) 58%); font-size: 1.35rem; font-weight: 800; pointer-events: none; }
  .schedule-view-toolbar { padding: 10px; }
  .schedule-view-toolbar-main, .schedule-view-toolbar-main:has(#schedule-view-date-field:not([hidden])) { grid-template-columns: 1fr; gap: 8px; }
  .schedule-view-week-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .schedule-view-week-actions .button { width: 100%; padding-inline: 6px; }
  .schedule-view-week-range { text-align: left; }
  .schedule-view-layout.patient-layout, .schedule-view-layout.procedure-layout { display: flex; flex-direction: column; }
  .schedule-view-layout.patient-layout .schedule-view-list-panel, .schedule-view-layout.procedure-layout .schedule-view-list-panel { order: 1; width: 100%; }
  .schedule-view-layout.patient-layout .schedule-view-calendar, .schedule-view-layout.procedure-layout .schedule-view-calendar { order: 2; width: 100%; }
  .schedule-view-layout.patient-layout .schedule-view-detail, .schedule-view-layout.procedure-layout .schedule-view-detail { order: 3; width: 100%; }
  .schedule-view-list { max-height: 250px; }
  .schedule-view-kpis { grid-template-columns: 1fr 1fr; }
  .schedule-view-kpi:last-child { grid-column: 1 / -1; }
  .schedule-view-layout.staff-all-layout .schedule-view-detail, .schedule-view-layout.staff-one-layout .schedule-view-detail { display: block; }
  .schedule-view-panel { padding: 12px; }
  .schedule-view-calendar-header { align-items: start; }
  .schedule-view-calendar-header h3 { font-size: 1rem; }
  .schedule-view-week-grid { min-width: 700px; }
  .schedule-view-week-grid.is-staff { min-width: 795px; }
  .schedule-view-week-grid.is-day { min-width: 340px; }
}
@media (max-width: 380px) {
  .schedule-view-week-actions { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .schedule-view-tabs, .schedule-view-calendar-scroll { scroll-behavior: auto; }
}
