:root {
  --page-bg: #eef2f7;
  --panel-bg: #ffffff;
  --panel-border: #d0d7e2;
  --grid-line: #d9d9d9;
  --header-blue: #c9daf8;
  --header-blue-strong: #9fc5f8;
  --header-gold: #fff2cc;
  --priority-cell: #ea9999;
  --regular-cell: #f4cccc;
  --triage-cell: #fff2cc;
  --cutoff-cell: #d9ead3;
  --next-up: #66ff00;
  --current-line: rgba(164, 194, 244, 0.32);
  --current-edge: rgba(111, 168, 220, 0.52);
  --text-main: #202124;
  --text-muted: #5f6368;
  --text-assignment: #c00000;
  --shadow: 0 10px 26px rgba(34, 50, 84, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--page-bg);
  color: var(--text-main);
  font-family: Arial, Helvetica, sans-serif;
}

body {
  min-height: 100vh;
}

.page-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 0.45rem;
  padding: 0.5rem;
}

.page-shell.read-only {
  grid-template-rows: auto 1fr;
}

.page-shell.metrics-page {
  grid-template-rows: auto 1fr;
}

.page-shell.settings-page {
  grid-template-rows: auto 1fr;
}

.top-strip,
.control-strip,
.board-shell {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
}

.top-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.65rem 0.8rem;
}

.brand-block h1,
.brand-block p {
  margin: 0;
}

.eyebrow {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-block h1 {
  font-size: 1.55rem;
  line-height: 1.1;
}

.view-caption {
  margin: 0.1rem 0 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.page-context {
  margin: 0.14rem 0 0;
  color: #17365d;
  font-size: 0.84rem;
  font-weight: 700;
}

.page-context-secondary {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.status-strip {
  min-width: 0;
  display: grid;
  grid-template-columns: fit-content(15rem) fit-content(12rem) minmax(24rem, 1fr);
  gap: 0.55rem;
  align-items: stretch;
}

.page-shell.read-only .status-strip {
  grid-template-columns: fit-content(15rem) fit-content(12rem) minmax(15rem, 1fr) minmax(17rem, 1.1fr);
}

.status-field {
  min-width: 0;
  min-height: 4.25rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--panel-border);
  background: #f9fbfe;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.12rem;
  overflow: hidden;
}

.status-field span {
  color: var(--text-muted);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.status-field strong {
  font-size: 1rem;
  line-height: 1.15;
}

.status-field small {
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.2;
  overflow: auto;
}

.compact-field {
  width: fit-content;
  min-width: 11rem;
  max-width: 15rem;
}

.next-field {
  max-width: 16rem;
}

.mode-field {
  max-width: 13rem;
}

.selected-field {
  min-width: 0;
}

.selected-field strong,
.selected-field small,
.detail-field strong,
.detail-field small {
  white-space: normal;
  word-break: break-word;
}

.selected-field strong {
  min-height: 1.15rem;
  max-height: 2.3rem;
  overflow: hidden;
}

.selected-field small {
  min-height: 2.45rem;
  max-height: 2.45rem;
  padding-right: 0.15rem;
}

.recent-field {
  justify-content: flex-start;
  gap: 0.26rem;
}

.mode-field strong {
  color: #17365d;
}

.recent-assignments {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.18rem;
  max-height: 4.5rem;
  overflow: auto;
}

.recent-assignments li {
  display: grid;
  grid-template-columns: 5.4rem minmax(0, 1fr);
  gap: 0.4rem;
  align-items: start;
  font-size: 0.77rem;
  line-height: 1.2;
}

.recent-assignments-empty {
  grid-template-columns: 1fr !important;
  color: var(--text-muted);
}

.recent-assignment-time {
  color: #17365d;
  font-weight: 700;
}

.recent-assignment-detail {
  min-width: 0;
  word-break: break-word;
}

.header-tools {
  min-width: 0;
  display: grid;
  gap: 0.45rem;
  justify-items: end;
}

.page-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
}

.page-nav a {
  padding: 0.36rem 0.62rem;
  border: 1px solid var(--panel-border);
  background: #f6f8fb;
  color: #17365d;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
}

.page-nav a.active {
  background: var(--header-blue);
  border-color: #a3bfdc;
}

.history-picker {
  display: flex;
  align-items: end;
  gap: 0.4rem;
}

.metrics-filter {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.field-history {
  min-width: 10rem;
}

.page-notice {
  padding: 0.55rem 0.75rem;
  border: 1px solid #e0d4a0;
  background: #fff8dc;
  color: #5f4f13;
  box-shadow: var(--shadow);
  font-size: 0.85rem;
}

.metrics-summary {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(12rem, 1fr));
  gap: 0.55rem;
}

.board-shell {
  min-height: 0;
  padding: 0.3rem;
  overflow: hidden;
}

.board {
  display: grid;
  grid-auto-rows: 18px;
  min-height: 100%;
  border: 1px solid var(--panel-border);
  background: #ffffff;
}

.grid-cell {
  position: relative;
  min-width: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 2px;
  border-right: 1px solid var(--grid-line);
  border-bottom: 1px solid var(--grid-line);
  font-size: 11px;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.grid-cell.current::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--current-line);
  pointer-events: none;
}

.grid-cell.current::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 1px 0 var(--current-edge), inset 0 -1px 0 var(--current-edge);
  pointer-events: none;
}

.grid-cell.corner,
.grid-cell.row-label {
  font-weight: 700;
}

.grid-cell.corner {
  background: var(--header-blue-strong);
  color: #17365d;
}

.grid-cell.row-label {
  background: #ffffff;
  color: #17365d;
}

.grid-cell.row-label.current {
  background: #edf3fb;
}

.grid-cell.doctor-header,
.grid-cell.shift-header,
.grid-cell.order-header {
  cursor: default;
}

.grid-cell.doctor-header {
  background: var(--header-blue);
  color: #17365d;
  font-weight: 700;
}

.grid-cell.shift-header {
  background: var(--header-blue);
  color: #17365d;
  font-weight: 700;
}

.grid-cell.order-header {
  background: var(--header-blue);
  color: #17365d;
  font-weight: 700;
}

.grid-cell.doctor-header.next,
.grid-cell.shift-header.next,
.grid-cell.order-header.next {
  background: var(--next-up);
  color: #173000;
}

.grid-cell.doctor-header.selected,
.grid-cell.shift-header.selected {
  box-shadow: inset 0 0 0 1px #17498b;
}

.grid-cell.inactive {
  color: #8c919a;
}

.grid-cell.kind-priority {
  background: var(--priority-cell);
}

.grid-cell.kind-regular {
  background: var(--regular-cell);
}

.grid-cell.kind-triage {
  background: var(--triage-cell);
}

.grid-cell.kind-cutoff {
  background: var(--cutoff-cell);
}

.grid-cell.kind-blank {
  background: #ffffff;
}

.grid-cell.assignment {
  color: var(--text-assignment);
  font-weight: 700;
}

.grid-cell.selected {
  z-index: 2;
  box-shadow: inset 0 0 0 999px rgba(74, 134, 232, 0.12);
}

.grid-cell.selected::after {
  display: none;
}

.grid-cell.selected.selection-top::after {
  display: none;
}

.grid-cell.selected.selection-right::after {
  display: none;
}

.grid-cell.selected.selection-bottom::after {
  display: none;
}

.grid-cell.selected.selection-left::after {
  display: none;
}

.grid-cell.doctor-header.selected,
.grid-cell.shift-header.selected,
.grid-cell.order-header.selected {
  box-shadow: inset 0 0 0 999px rgba(74, 134, 232, 0.16);
}

.inline-editor {
  width: 100%;
  height: 100%;
  border: 0;
  outline: none;
  padding: 0 2px;
  background: rgba(255, 255, 255, 0.98);
  color: var(--text-main);
  font: inherit;
  text-align: center;
  box-shadow: inset 0 0 0 1px #17498b;
}

.control-strip {
  padding: 0.45rem 0.6rem 0.55rem;
  display: grid;
  gap: 0.4rem;
}

.insight-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  align-items: stretch;
}

.insight-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  padding: 0.65rem 0.75rem;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0.2rem;
}

.insight-card-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 0.45rem;
}

.insight-card h2,
.insight-card p {
  margin: 0;
}

.insight-card h2 {
  font-size: 0.96rem;
  color: #17365d;
}

.insight-card p {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.insight-meta {
  min-height: 1rem;
}

.insight-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  align-content: start;
  gap: 0.34rem;
  min-height: 0;
  height: 100%;
  max-height: none;
  overflow: auto;
}

#doctor-load-board.insight-list {
  gap: 0.22rem;
  max-height: none;
  overflow: hidden;
}

.insight-list li {
  display: grid;
  gap: 0.08rem;
  padding: 0.35rem 0.4rem;
  border: 1px solid var(--panel-border);
  background: #f9fbfe;
}

#doctor-load-board li {
  padding: 0.28rem 0.34rem;
}

.insight-chart-shell {
  padding: 0.5rem 0.55rem !important;
}

.insight-row-split {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: start;
}

.insight-row-main {
  min-width: 0;
  display: grid;
  gap: 0.08rem;
}

.insight-list li strong {
  font-size: 0.8rem;
  color: #17365d;
}

.insight-list li span,
.insight-list li small {
  color: var(--text-muted);
  font-size: 0.76rem;
  line-height: 1.25;
}

.insight-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.2rem;
}

.insight-actions-inline {
  margin-top: 0;
  align-self: center;
  justify-content: flex-end;
}

.insight-button {
  height: 1.8rem;
  padding: 0 0.55rem;
  font-size: 0.76rem;
}

.insight-empty {
  color: var(--text-muted);
}

.doctor-load-chart {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr);
  gap: 0.5rem;
  min-height: 10.4rem;
}

.doctor-load-axis {
  display: grid;
  grid-template-rows: repeat(5, 1fr);
  align-items: end;
  color: var(--text-muted);
  font-size: 0.67rem;
  font-weight: 700;
  text-align: right;
}

.doctor-load-plot {
  position: relative;
  min-height: 10.4rem;
  padding: 0.15rem 0 0 0;
}

.doctor-load-grid-line {
  position: absolute;
  inset: auto 0 2.2rem 0;
  border-top: 1px dashed #d7e0ec;
}

.doctor-load-bars {
  position: absolute;
  inset: 0 0 0.1rem 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(2.4rem, 1fr));
  gap: 0.35rem;
  align-items: end;
}

.doctor-load-column {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 6rem auto;
  gap: 0.22rem;
  align-items: end;
}

.doctor-load-value {
  color: #17365d;
  font-size: 0.67rem;
  font-weight: 700;
  text-align: center;
}

.doctor-load-bar-track {
  position: relative;
  height: 100%;
  border: 1px solid #c8d2e3;
  background: linear-gradient(180deg, #f6f9fe, #edf3ff);
  display: flex;
  align-items: end;
  overflow: hidden;
}

.doctor-load-bar-fill {
  width: 100%;
  min-height: 2px;
  background: linear-gradient(180deg, #6ea0df, #1c4587);
}

.doctor-load-bar-fill.skip-pending {
  background: linear-gradient(180deg, #f6b26b, #bf6d07);
}

.doctor-load-label {
  color: #17365d;
  font-size: 0.64rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.15;
  word-break: break-word;
}

.control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: stretch;
}

.control-row-secondary {
  gap: 0.55rem;
}

.control-group {
  display: flex;
  align-items: end;
  gap: 0.4rem;
  min-width: 0;
}

.control-card {
  padding: 0.55rem 0.65rem 0.6rem;
  border: 1px solid var(--panel-border);
  background: #f9fbfe;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.control-group.compact {
  flex-wrap: wrap;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.16rem;
  min-width: 0;
}

.field span {
  color: var(--text-muted);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field-patient {
  min-width: 12rem;
}

.field-doctor-name {
  min-width: 10rem;
}

.field-small {
  width: 4.8rem;
}

.field-complaint {
  min-width: 18rem;
}

.field-edit-select {
  min-width: 8.2rem;
}

.field-hour {
  width: 4.6rem;
}

#jump-select {
  width: 5rem;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  height: 2rem;
  min-width: 0;
  padding: 0 0.55rem;
  border: 1px solid #c5ccd8;
  background: #ffffff;
  color: var(--text-main);
}

.sheet-button {
  height: 2rem;
  padding: 0 0.72rem;
  border: 1px solid #c5ccd8;
  background: #ffffff;
  color: var(--text-main);
  cursor: pointer;
  font-weight: 700;
}

.sheet-button:disabled {
  cursor: default;
  opacity: 0.55;
}

.sheet-button.primary {
  background: #1c4587;
  border-color: #1c4587;
  color: #ffffff;
}

.sheet-button.accent {
  background: #ffd966;
  border-color: #e0b849;
  color: #5d4600;
}

.sheet-button.subtle {
  background: #eef3fb;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.sheet-button.danger {
  background: #f4cccc;
  border-color: #e2aaaa;
  color: #7c1f1f;
}

.control-help {
  max-width: 18rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.3;
}

.context-menu {
  position: fixed;
  z-index: 20;
  display: grid;
  gap: 0.2rem;
  padding: 0.3rem;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #c7ccd3;
  box-shadow: 0 10px 22px rgba(32, 33, 36, 0.18);
}

.context-menu[hidden] {
  display: none;
}

.context-menu button[hidden] {
  display: none;
}

.context-option {
  justify-content: flex-start;
  min-width: 9.5rem;
  height: 2rem;
}

.context-option.priority {
  background: var(--priority-cell);
  color: #601515;
}

.context-option.regular {
  background: var(--regular-cell);
  color: #5a2424;
}

.context-option.triage {
  background: var(--triage-cell);
  color: #5f4f13;
}

.context-option.cutoff {
  background: var(--cutoff-cell);
  color: #31572e;
}

.context-option.blank {
  background: #ffffff;
  color: var(--text-main);
}

.context-option-detail {
  background: #e9eef7;
  color: #17365d;
}

.toast {
  position: fixed;
  right: 0.85rem;
  bottom: 0.85rem;
  max-width: min(28rem, calc(100vw - 1.7rem));
  background: rgba(32, 33, 36, 0.96);
  color: #ffffff;
  padding: 0.65rem 0.85rem;
  font-size: 0.84rem;
  box-shadow: 0 12px 26px rgba(32, 33, 36, 0.22);
}

.metrics-shell {
  display: grid;
  gap: 0.8rem;
  align-content: start;
}

.settings-shell {
  display: grid;
  align-content: start;
}

.settings-form-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  padding: 0.9rem;
  display: grid;
  gap: 0.9rem;
}

.settings-form-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.settings-section {
  display: grid;
  gap: 0.7rem;
}

.settings-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.settings-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--panel-border);
  background: #f9fbfe;
  font-weight: 700;
  color: #17365d;
}

.settings-inline-field {
  max-width: 10rem;
}

.settings-help {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
}

.settings-actions-top {
  align-self: start;
}

.metric-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.65rem;
}

.metric-card,
.metric-section,
.metrics-empty {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.metric-card span {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.metric-card strong {
  font-size: 1.45rem;
  line-height: 1.1;
}

.metric-section {
  padding: 0.8rem;
}

.metric-section-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.7rem;
}

.metric-section-heading h2,
.metric-section-heading p {
  margin: 0;
}

.metric-section-heading {
  display: grid;
  gap: 0.18rem;
}

.metric-section-heading h2 {
  font-size: 1rem;
  color: #17365d;
}

.metric-section-heading p {
  color: var(--text-muted);
  font-size: 0.83rem;
}

.metric-toggle-group {
  display: inline-flex;
  border: 1px solid var(--panel-border);
  background: #f6f8fb;
}

.metric-toggle {
  height: 2rem;
  padding: 0 0.8rem;
  border: 0;
  border-right: 1px solid var(--panel-border);
  background: transparent;
  color: #17365d;
  cursor: pointer;
  font-weight: 700;
}

.metric-toggle:last-child {
  border-right: 0;
}

.metric-toggle.is-active {
  background: var(--header-blue);
}

.metric-view[hidden] {
  display: none;
}

.metric-table-shell {
  overflow: auto;
}

.metric-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.metric-table th,
.metric-table td {
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--panel-border);
  text-align: left;
  white-space: nowrap;
}

.metric-table thead th {
  background: var(--header-blue);
  color: #17365d;
}

.metric-matrix thead th:first-child,
.metric-matrix tbody th {
  position: sticky;
  left: 0;
  background: #f7fbff;
  color: #17365d;
  z-index: 1;
}

.metric-matrix thead th:first-child {
  z-index: 2;
}

.matrix-shell {
  max-width: 100%;
}

.metric-bar-list {
  display: grid;
  gap: 0.65rem;
}

.metric-bar-axis {
  display: grid;
  grid-template-columns: 10rem minmax(0, 1fr);
  gap: 0.7rem;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.metric-bar-axis-values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
}

.metric-bar-row {
  display: grid;
  grid-template-columns: 10rem minmax(0, 1fr);
  gap: 0.7rem;
  align-items: center;
}

.metric-bar-label {
  color: #17365d;
  font-weight: 700;
}

.metric-bar-values {
  display: grid;
  gap: 0.35rem;
}

.metric-bar-track {
  position: relative;
  min-height: 1.85rem;
  border: 1px solid var(--panel-border);
  background: #f5f8fd;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.metric-bar-series,
.metric-bar-value {
  position: relative;
  z-index: 1;
  font-size: 0.78rem;
  font-weight: 700;
}

.metric-bar-series {
  width: 5.8rem;
  padding-left: 0.55rem;
  color: #17365d;
}

.metric-bar-value {
  margin-left: auto;
  padding-right: 0.55rem;
  color: #17365d;
}

.metric-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  min-width: 0.1rem;
  background: linear-gradient(90deg, #9fc5f8, #6fa8dc);
}

.metric-bar-fill.accent {
  background: linear-gradient(90deg, #ffd966, #f6b26b);
}

.metric-chart-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.metric-chart-grid-two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-chart-card {
  padding: 0.7rem;
  border: 1px solid var(--panel-border);
  background: #f8fbff;
}

.metric-chart-card h3 {
  margin: 0 0 0.55rem;
  font-size: 0.88rem;
  color: #17365d;
}

.metric-column-chart {
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  gap: 0.24rem;
  align-items: end;
  min-height: 11rem;
}

.metric-column-chart-dates {
  grid-template-columns: repeat(auto-fit, minmax(2.8rem, 1fr));
}

.metric-column {
  min-width: 0;
  display: grid;
  gap: 0.2rem;
  align-items: end;
}

.metric-column-track {
  position: relative;
  height: 7rem;
  border: 1px solid var(--panel-border);
  background: linear-gradient(180deg, #f7fafd, #edf4fd);
  display: flex;
  align-items: end;
}

.metric-column-fill {
  width: 100%;
  min-height: 2px;
  background: linear-gradient(180deg, #6fa8dc, #1c4587);
}

.metric-column-value,
.metric-column-label {
  font-size: 0.67rem;
  text-align: center;
}

.metric-column-value {
  color: #17365d;
  font-weight: 700;
}

.metric-column-label {
  color: var(--text-muted);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  height: 2.2rem;
  margin: 0 auto;
}

.metric-doctor-chart-shell {
  overflow: auto;
  display: grid;
  gap: 0.45rem;
}

.metric-doctor-hour-legend,
.metric-doctor-hour-row {
  display: grid;
  grid-template-columns: 15rem minmax(38rem, 1fr);
  gap: 0.55rem;
  align-items: center;
}

.metric-doctor-hour-spacer {
  display: block;
  line-height: 1.2;
}

.metric-doctor-hour-name {
  min-width: 0;
  display: grid;
  gap: 0.3rem;
}

.metric-doctor-hour-title {
  color: #17365d;
  font-weight: 700;
}

.metric-doctor-overall-track {
  position: relative;
  height: 1.05rem;
  border: 1px solid var(--panel-border);
  background: #f5f8fd;
  overflow: hidden;
}

.metric-doctor-overall-fill {
  position: absolute;
  inset: 0 auto 0 0;
  min-width: 0.1rem;
  background: linear-gradient(90deg, #9fc5f8, #3d85c6);
}

.metric-doctor-overall-value {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 0.4rem;
  color: #17365d;
  font-size: 0.72rem;
  font-weight: 700;
}

.metric-doctor-hour-labels,
.metric-doctor-hour-bars {
  display: grid;
  grid-template-columns: repeat(24, minmax(1.5rem, 1fr));
  gap: 0.2rem;
}

.metric-doctor-hour-labels span {
  font-size: 0.62rem;
  color: var(--text-muted);
  text-align: center;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  height: 2rem;
  margin: 0 auto;
}

.metric-doctor-hour-slot {
  position: relative;
  height: 4.2rem;
  border: 1px solid var(--panel-border);
  background: linear-gradient(180deg, #f7fafd, #edf4fd);
  display: flex;
  align-items: end;
}

.metric-doctor-hour-fill {
  width: 100%;
  min-height: 2px;
  background: linear-gradient(180deg, #f6b26b, #cc7a00);
}

.metrics-empty {
  padding: 1rem;
  font-size: 0.92rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1280px) {
  .top-strip {
    grid-template-columns: 1fr;
  }

  .status-strip {
    grid-template-columns: 1fr;
  }

   .insight-strip {
    grid-template-columns: 1fr;
  }

  .header-tools {
    justify-items: stretch;
  }

  .page-nav {
    justify-content: flex-start;
  }

  .metric-chart-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .page-shell {
    min-height: auto;
  }

  .status-strip {
    grid-template-columns: 1fr;
  }

  .board-shell {
    overflow: auto;
  }

  .board {
    min-width: 1120px;
  }

  .history-picker {
    flex-wrap: wrap;
  }

  .insight-strip {
    grid-template-columns: 1fr;
  }

  .metrics-summary {
    grid-template-columns: 1fr;
  }

  .metric-section-header {
    flex-direction: column;
  }

  .metric-bar-axis,
  .metric-bar-row,
  .metric-doctor-hour-legend,
  .metric-doctor-hour-row {
    grid-template-columns: 1fr;
  }

  .metric-bar-axis-values {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-doctor-hour-spacer {
    display: none;
  }
}
