:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --ink: #17212b;
  --muted: #64748b;
  --line: #d8dee8;
  --line-strong: #b8c2d1;
  --teal: #127c75;
  --teal-dark: #0d5f5a;
  --teal-soft: #dff5f2;
  --blue: #2563eb;
  --blue-soft: #e5edff;
  --amber: #b7791f;
  --amber-soft: #fff5d6;
  --rose: #c2415a;
  --rose-soft: #ffe4ea;
  --green: #178a4d;
  --green-soft: #ddf7e8;
  --brand-red: #e21b2d;
  --brand-black: #111418;
  --shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
  --radius: 8px;
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: var(--brand-black);
  color: #f8fafc;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  border-right: 4px solid var(--brand-red);
}

.brand {
  display: grid;
  gap: 9px;
  align-items: start;
  min-width: 0;
}

.brand-logo-wrap {
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  padding: 8px 9px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.brand-logo {
  display: block;
  width: 100%;
  max-height: 52px;
  object-fit: contain;
}

.brand h1 {
  margin: 0;
  font-size: 17px;
  line-height: 1.15;
  color: #ffffff;
}

.brand p {
  margin: 3px 0 0;
  color: #b7c4d5;
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 5px;
}

.nav-button {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: #d8dee8;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 8px;
  text-align: left;
}

.nav-button:hover,
.nav-button:focus-visible {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.07);
  outline: none;
}

.nav-button.is-active {
  background: #ffffff;
  color: #17212b;
  box-shadow: inset 4px 0 0 var(--brand-red);
}

.nav-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.11);
  font-size: 12px;
  font-weight: 800;
}

.nav-button.is-active .nav-icon {
  background: #ffe8eb;
  color: var(--brand-red);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.main {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  padding: 20px;
}

.view {
  display: none;
}

.view.is-active {
  display: grid;
  gap: 12px;
}

.is-hidden {
  display: none !important;
}

.manager-hidden {
  display: none !important;
}

.assistant-grid {
  grid-template-columns: minmax(0, 1fr);
}

.workflow-staff-only {
  display: none !important;
}

body[data-workflow="staff"] .workflow-schedule-only {
  display: none !important;
}

body[data-workflow="staff"] .workflow-staff-only {
  display: grid !important;
}

body[data-workflow="schedule"] #view-schedule,
body[data-workflow="staff"] #view-employees,
body[data-workflow="setup"] #view-arrivals,
body[data-workflow="publish"] #view-export,
body[data-workflow="help"] #view-help {
  order: 1;
}

body[data-workflow="schedule"] #view-assistant,
body[data-workflow="staff"] #view-assistant,
body[data-workflow="setup"] #view-rules,
body[data-workflow="publish"] #view-rotation {
  order: 2;
}

body[data-workflow="setup"] #view-calculator {
  order: 3;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}

.page-header h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.08;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

.button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 11px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  min-height: 36px;
}

.button:hover,
.button:focus-visible {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(18, 124, 117, 0.12);
  outline: none;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  box-shadow: none;
}

.button.primary {
  background: var(--teal);
  border-color: var(--teal);
  color: #ffffff;
}

.button.primary:hover,
.button.primary:focus-visible {
  background: var(--teal-dark);
}

.button.secondary {
  background: var(--blue-soft);
  border-color: #c8d7ff;
  color: #1d4ed8;
}

.button.danger {
  background: var(--rose-soft);
  border-color: #ffc2cf;
  color: #9f1239;
}

.button.danger:hover,
.button.danger:focus-visible {
  background: #ffd4dd;
  border-color: #f7a5b7;
}

.button.ghost {
  background: transparent;
  color: inherit;
}

.button.full {
  width: 100%;
}

.button.small {
  min-height: 32px;
  padding: 6px 9px;
  font-size: 12px;
}

.action-menu {
  position: relative;
}

.action-menu summary {
  list-style: none;
  cursor: pointer;
}

.action-menu summary::-webkit-details-marker {
  display: none;
}

.action-menu[open] summary {
  border-color: var(--line-strong);
  background: #ffffff;
}

.action-menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  min-width: 210px;
  display: none;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.action-menu[open] > .action-menu-panel {
  display: grid;
}

.action-menu-panel .button {
  width: 100%;
  justify-content: flex-start;
}

.compact-settings-panel {
  padding: 0;
}

.settings-disclosure {
  padding: 12px;
}

.settings-disclosure summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
}

.settings-disclosure summary::-webkit-details-marker {
  display: none;
}

.settings-disclosure summary strong {
  font-size: 15px;
}

.settings-disclosure summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.settings-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  min-width: 0;
  box-shadow: var(--shadow);
}

.kpi-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.kpi-card strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  line-height: 1;
}

.kpi-card em {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.kpi-card.productivity.good {
  border-color: #9edbb6;
  background: linear-gradient(180deg, #ffffff 0%, var(--green-soft) 100%);
}

.kpi-card.productivity.bad {
  border-color: #ffc2cf;
  background: linear-gradient(180deg, #ffffff 0%, var(--rose-soft) 100%);
}

.kpi-card.productivity.warn {
  border-color: #f1d68c;
  background: linear-gradient(180deg, #ffffff 0%, var(--amber-soft) 100%);
}

.alert-panel {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  box-shadow: var(--shadow);
  background: var(--surface);
}

.alert-panel strong,
.alert-panel span {
  display: block;
}

.alert-panel strong {
  font-size: 14px;
}

.alert-panel span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.alert-panel.good {
  border-color: #b8e8c8;
  background: var(--green-soft);
}

.alert-panel.bad {
  border-color: #ffc2cf;
  background: var(--rose-soft);
}

.alert-panel.warn {
  border-color: #f1d68c;
  background: var(--amber-soft);
}

.overtime-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.8fr);
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: var(--shadow);
  background: var(--surface);
}

.overtime-panel.good {
  border-color: #b8e8c8;
  background: var(--green-soft);
}

.overtime-panel.bad {
  border-color: #ffc2cf;
  background: var(--rose-soft);
}

.overtime-panel.warn {
  border-color: #f1d68c;
  background: var(--amber-soft);
}

.overtime-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.overtime-metrics div {
  min-width: 0;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 7px;
  padding: 8px 9px;
  background: rgba(255, 255, 255, 0.72);
}

.overtime-metrics span,
.overtime-metrics strong,
.overtime-metrics em,
.overtime-note strong,
.overtime-note span {
  display: block;
}

.overtime-metrics span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.overtime-metrics strong {
  margin-top: 5px;
  font-size: 22px;
  line-height: 1;
}

.overtime-metrics em {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.overtime-note {
  min-width: 0;
  align-self: center;
}

.overtime-note strong {
  font-size: 14px;
}

.overtime-note > span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.overtime-people {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.overtime-people span {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  padding: 4px 7px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
}

.alert-list {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: min(460px, 52vw);
}

.alert-list li {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 8px;
  padding: 5px 7px;
  border: 1px solid rgba(194, 65, 90, 0.22);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.7);
}

.band,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  min-width: 0;
}

.segmented {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.toolbar-stack {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.segment-button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 7px;
  padding: 6px 9px;
  min-height: 32px;
  font-weight: 800;
  white-space: nowrap;
}

.segment-button.is-active {
  background: var(--teal-soft);
  color: var(--teal-dark);
  border-color: #b7e5df;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(290px, 0.65fr);
  gap: 12px;
  align-items: start;
}

.lower-grid {
  grid-template-columns: minmax(0, 1fr);
}

.table-focus-grid,
.roster-grid {
  grid-template-columns: minmax(0, 1fr);
}

.assistant-grid {
  grid-template-columns: minmax(0, 1fr);
}

.panel {
  padding: 12px;
  min-width: 0;
}

.panel.wide {
  min-width: 0;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.panel-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.panel h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.15;
}

.panel p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.input {
  width: 100%;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  border-radius: 7px;
  padding: 7px 9px;
  min-height: 34px;
}

.input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(18, 124, 117, 0.13);
  outline: none;
}

.field-label,
.compact-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.compact-field {
  min-width: 150px;
}

.search-field {
  min-width: 210px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.form-panel {
  display: grid;
  gap: 8px;
}

.mini-input {
  width: 68px;
}

.compact-issue-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--slate);
  font-size: 12px;
}

.compact-issue-list li + li {
  margin-top: 3px;
}

.table-scroll {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 780px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 7px 8px;
  vertical-align: middle;
  text-align: left;
  font-size: 12px;
  min-height: 32px;
}

th:last-child,
td:last-child {
  border-right: 0;
}

tbody tr:last-child td {
  border-bottom: 0;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #edf2f7;
  color: #334155;
  font-size: 11px;
  text-transform: uppercase;
}

.coverage-table {
  min-width: 0;
  table-layout: fixed;
}

.coverage-table th {
  text-align: center;
  padding: 6px 5px;
}

.coverage-table td:not(:first-child) {
  text-align: center;
  padding: 5px;
}

.coverage-table th:first-child,
.coverage-table td:first-child {
  width: 58px;
}

.coverage-table th:nth-child(2),
.coverage-table td:nth-child(2) {
  width: 78px;
}

.coverage-area-head span,
.coverage-area-head em {
  display: block;
}

.coverage-area-head em {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  text-transform: none;
}

.coverage-area-cell {
  min-width: 0;
}

.coverage-area-cell.is-covered {
  background: #ecfdf5;
}

.coverage-area-cell.is-overstaffed {
  background: #fffbeb;
  box-shadow: inset 4px 0 0 var(--amber);
}

.coverage-area-cell.has-gap {
  background: #fff1f2;
  box-shadow: inset 4px 0 0 var(--rose);
}

.coverage-cell-values {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  align-items: stretch;
}

.coverage-cell-values > span {
  min-width: 0;
  display: grid;
  gap: 2px;
  justify-items: center;
  border-radius: 6px;
  padding: 4px 2px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.coverage-cell-values em {
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
}

.coverage-value {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.05;
}

.coverage-cell-values .coverage-gap {
  border-color: transparent;
}

.coverage-cell-values .coverage-gap.gap-good {
  background: #16a34a;
  color: #ffffff;
}

.coverage-cell-values .coverage-gap.gap-good em,
.coverage-cell-values .coverage-gap.gap-good .coverage-value {
  color: #ffffff;
}

.coverage-cell-values .coverage-gap.gap-bad {
  background: #e11d48;
  color: #ffffff;
}

.coverage-cell-values .coverage-gap.gap-bad em,
.coverage-cell-values .coverage-gap.gap-bad .coverage-value {
  color: #ffffff;
}

.coverage-cell-values .coverage-gap.gap-over {
  background: #f59e0b;
  color: #17212b;
}

.coverage-cell-values .coverage-gap.gap-over em,
.coverage-cell-values .coverage-gap.gap-over .coverage-value {
  color: #17212b;
}

.coverage-area-cell.is-overstaffed .coverage-cell-values > span:nth-child(2),
.coverage-area-cell.is-overstaffed .cap-over {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}

.coverage-area-cell.is-overstaffed .coverage-cell-values > span:nth-child(2) em,
.coverage-area-cell.is-overstaffed .coverage-cell-values > span:nth-child(2) .coverage-value,
.coverage-area-cell.is-overstaffed .cap-over em,
.coverage-area-cell.is-overstaffed .cap-over .coverage-value {
  color: #92400e;
}

.hour-cell {
  font-weight: 800;
  color: #334155;
  white-space: nowrap;
}

.gap-good {
  background: var(--green-soft);
  color: #166534;
  font-weight: 800;
}

.gap-watch {
  background: var(--amber-soft);
  color: #92400e;
  font-weight: 800;
}

.gap-bad {
  background: var(--rose-soft);
  color: #9f1239;
  font-weight: 800;
}

.cap-value {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.cap-value strong {
  font-weight: 900;
}

.cap-value em {
  border-radius: 999px;
  background: #fff7ed;
  color: #b7791f;
  padding: 1px 5px;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.cap-over {
  color: var(--rose);
  font-weight: 900;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 5px 9px;
  min-height: 28px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 800;
}

.status-pill.good {
  color: #166534;
  background: var(--green-soft);
  border-color: #b8e8c8;
}

.status-pill.warn {
  color: #92400e;
  background: var(--amber-soft);
  border-color: #f1d68c;
}

.status-pill.bad {
  color: #9f1239;
  background: var(--rose-soft);
  border-color: #ffc2cf;
}

.status-pill.neutral {
  color: #334155;
  background: #f1f5f9;
}

.status-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.area-group-row td {
  background: #eef7f6;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.row-muted {
  color: var(--muted);
}

.cell-input,
.cell-select {
  width: 100%;
  min-width: 72px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 6px;
  padding: 5px;
}

.cell-input:hover,
.cell-input:focus,
.cell-select:hover,
.cell-select:focus {
  border-color: var(--line-strong);
  background: #ffffff;
  outline: none;
}

.roster-table {
  min-width: 0;
  table-layout: fixed;
}

.staff-table-wrap {
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: visible;
}

.roster-table th,
.roster-table td {
  white-space: normal;
}

.roster-table th:nth-child(1),
.roster-table td:nth-child(1) {
  width: 19%;
}

.roster-table th:nth-child(2),
.roster-table td:nth-child(2) {
  width: 13%;
}

.roster-table th:nth-child(3),
.roster-table td:nth-child(3) {
  width: 12%;
}

.roster-table th:nth-child(4),
.roster-table td:nth-child(4),
.roster-table th:nth-child(5),
.roster-table td:nth-child(5),
.roster-table th:nth-child(6),
.roster-table td:nth-child(6) {
  width: 16%;
}

.roster-table th:nth-child(7),
.roster-table td:nth-child(7) {
  width: 8%;
}

.area-chip,
.staff-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--slate);
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
}

.area-chip {
  border-left-width: 4px;
}

.staff-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.staff-chip.good {
  color: #166534;
  background: var(--green-soft);
  border-color: #b8e8c8;
}

.staff-chip.warn {
  color: #92400e;
  background: var(--amber-soft);
  border-color: #f1d68c;
}

.staff-chip.muted {
  color: #64748b;
  background: #f1f5f9;
}

.action-cell {
  display: grid;
  gap: 5px;
}

.staff-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.staff-summary-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 10px;
  display: grid;
  gap: 4px;
  min-width: 0;
}

.staff-summary-card span,
.staff-summary-card em,
.staff-summary-card small {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  line-height: 1.25;
}

.staff-summary-card strong {
  color: var(--ink);
  font-size: 26px;
  line-height: 1;
}

.staff-summary-card.action-card strong {
  font-size: 18px;
}

.staff-detail-content {
  display: grid;
  gap: 12px;
}

.staff-detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 10px;
}

.staff-detail-heading h4,
.staff-detail-section h4 {
  margin: 0;
  font-size: 15px;
}

.staff-detail-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.staff-detail-section {
  display: grid;
  gap: 8px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.cert-detail-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dense-table-scroll {
  width: 100%;
}

.arrival-table {
  min-width: 0;
  table-layout: fixed;
}

.arrival-table td,
.arrival-table th {
  text-align: center;
  padding: 5px;
}

.arrival-table .hour-cell {
  text-align: left;
}

.arrival-table th:first-child,
.arrival-table td:first-child {
  width: 54px;
}

.arrival-table th:nth-child(2),
.arrival-table td:nth-child(2) {
  width: 78px;
}

.arrival-table th span,
.arrival-table th em {
  display: block;
}

.arrival-table th em {
  margin-top: 1px;
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  text-transform: none;
}

.arrival-input {
  min-width: 0;
  padding: 5px 3px;
  text-align: center;
}

.toolbar-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.output-toolbar {
  align-items: center;
}

.output-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  justify-content: flex-end;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  min-height: 38px;
}

.check-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

.metric-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
  background: #f8fafc;
}

.metric-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

canvas {
  width: 100%;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

.rules-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

.rule-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.rule-section:nth-child(2),
.rule-section:nth-child(3) {
  grid-column: 1 / -1;
}

.rule-section-title {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
}

.rule-section-title h3 {
  margin: 0;
  font-size: 16px;
}

.rule-section-title p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  max-width: 520px;
}

.compact-rule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

.compact-rule-grid.two-wide {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.compact-rule {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 8px;
  display: grid;
  gap: 5px;
}

.compact-rule span {
  color: #17212b;
  font-size: 12px;
  font-weight: 900;
}

.compact-rule em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.rule-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
  display: grid;
  gap: 8px;
}

.rule-card h3 {
  margin: 0;
  font-size: 16px;
}

.operating-hours-table {
  display: grid;
  gap: 6px;
}

.operating-hours-head,
.operating-hours-line {
  display: grid;
  grid-template-columns: minmax(130px, 1.1fr) 92px 132px 132px 84px;
  gap: 8px;
  align-items: center;
}

.operating-hours-head {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
  padding: 0 10px;
}

.operating-hours-line {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 8px 10px;
}

.operating-hours-line.is-closed {
  opacity: 0.72;
}

.operating-hours-total {
  display: grid;
  grid-template-columns: minmax(130px, 1.1fr) 92px 132px 132px 84px;
  gap: 8px;
  align-items: center;
  border: 1px solid #b8e8c8;
  border-radius: 8px;
  background: var(--green-soft);
  color: #14532d;
  padding: 8px 10px;
}

.operating-hours-total span {
  grid-column: 1 / 3;
  font-weight: 900;
}

.operating-hours-total em {
  grid-column: 3 / 5;
  justify-self: end;
  color: #166534;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.operating-hours-total strong {
  justify-self: end;
  font-size: 13px;
  font-weight: 900;
}

.operating-day-toggle {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
  color: #17212b;
}

.operating-day-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

.operating-status {
  justify-self: start;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
}

.operating-status.open {
  background: #dff7eb;
  color: #126b3e;
}

.operating-status.closed {
  background: #eef2f7;
  color: var(--muted);
}

.operating-length {
  font-size: 13px;
  color: #17212b;
}

.operating-days-card {
  grid-column: span 3;
}

.facility-card {
  grid-column: span 4;
}

.day-check-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.facility-cap-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.facility-cap-input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 8px;
  display: grid;
  gap: 5px;
}

.facility-cap-input span {
  color: #17212b;
  font-size: 12px;
  font-weight: 900;
}

.facility-cap-input em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.day-check {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 8px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #17212b;
  font-size: 12px;
  font-weight: 900;
}

.day-check.compact {
  padding: 8px 4px;
  height: 38px;
}

.capacity-breakdown {
  display: grid;
  gap: 8px;
}

.capacity-row,
.capacity-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 10px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.capacity-row.is-bottleneck {
  border-color: #f3c56b;
  background: var(--amber-soft);
}

.capacity-row div,
.capacity-note {
  min-width: 0;
}

.capacity-row strong,
.capacity-note strong {
  display: block;
  font-size: 13px;
}

.capacity-row span,
.capacity-note span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.capacity-row em {
  color: var(--ink);
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.capacity-note {
  display: grid;
  align-items: start;
}

.staff-mix-panel {
  grid-column: 1 / -1;
}

.staff-mix-recommendation {
  display: grid;
  gap: 10px;
}

.staff-mix-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.staff-mix-summary-item,
.staff-mix-diagnosis,
.staff-mix-actions {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 10px;
}

.staff-mix-summary-item {
  display: grid;
  gap: 3px;
}

.staff-mix-summary-item span,
.staff-mix-summary-item em,
.staff-mix-diagnosis span,
.staff-mix-actions li {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.staff-mix-summary-item strong {
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}

.staff-mix-summary-item em {
  font-style: normal;
  font-weight: 800;
}

.staff-mix-diagnosis {
  display: grid;
  gap: 4px;
  border-left: 5px solid var(--teal);
}

.staff-mix-diagnosis.good {
  background: var(--green-soft);
  border-color: #a9e7bd;
  border-left-color: var(--green);
}

.staff-mix-diagnosis.warn {
  background: var(--amber-soft);
  border-color: #f3c56b;
  border-left-color: var(--amber);
}

.staff-mix-diagnosis.bad {
  background: var(--rose-soft);
  border-color: #ffc2cf;
  border-left-color: var(--rose);
}

.staff-mix-diagnosis strong,
.staff-mix-actions strong {
  font-size: 14px;
}

.staff-mix-actions {
  display: grid;
  gap: 6px;
}

.staff-mix-actions ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.staff-mix-table th,
.staff-mix-table td {
  vertical-align: top;
}

.calculator-table th,
.calculator-table td {
  vertical-align: top;
}

.day-check input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--teal);
}

.day-check span {
  overflow-wrap: anywhere;
}

.policy-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.policy-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 10px;
  display: grid;
  gap: 6px;
  min-width: 0;
}

.policy-item strong {
  font-size: 13px;
}

.policy-item span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.button-stack {
  display: grid;
  gap: 10px;
}

.assistant-log {
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 10px;
  display: grid;
  align-content: start;
  gap: 7px;
  color: #334155;
  font-size: 13px;
  line-height: 1.35;
}

.assistant-log div {
  border-left: 3px solid var(--teal);
  padding: 6px 8px;
  background: #f8fafc;
  border-radius: 6px;
}

.suggestion-table {
  min-width: 900px;
}

.suggestion-table td:nth-child(3),
.suggestion-table td:nth-child(4),
.suggestion-table th:nth-child(3),
.suggestion-table th:nth-child(4) {
  text-align: center;
  width: 72px;
}

.availability-table {
  min-width: 0;
  table-layout: fixed;
}

.availability-table th:not(:first-child),
.availability-table td:not(:first-child) {
  text-align: center;
  width: 54px;
  padding: 5px 3px;
}

.availability-table th:first-child,
.availability-table td:first-child {
  width: 140px;
}

.availability-table .cell-select {
  min-width: 0;
  max-width: 46px;
  padding: 4px 3px;
  font-size: 11px;
}

.availability-date-header {
  line-height: 1.05;
}

.availability-date-header span,
.availability-date-header strong,
.availability-date-header em {
  display: block;
}

.availability-date-header strong {
  color: #17212b;
  font-size: 11px;
}

.availability-date-header em {
  color: var(--teal-dark);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  margin-top: 2px;
}

.rotation-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.55fr);
}

.rotation-table {
  min-width: 900px;
}

.rotation-table th:not(:first-child),
.rotation-table td:not(:first-child),
.history-table th:not(:first-child),
.history-table td:not(:first-child) {
  text-align: center;
}

.history-table {
  min-width: 760px;
}

.publish-status {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.publish-card {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-2);
}

.publish-card.good {
  border-color: #b8e8c8;
  background: var(--green-soft);
}

.publish-card.bad {
  border-color: #ffc2cf;
  background: var(--rose-soft);
}

.publish-card.warn {
  border-color: #f1d68c;
  background: var(--amber-soft);
}

.publish-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.summary-list {
  display: grid;
  gap: 7px;
}

.summary-list span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 9px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.availability-table th:not(:first-child),
.availability-table td:not(:first-child) {
  text-align: center;
}

.availability-table th:first-child,
.availability-table td:first-child {
  width: 140px;
}

.help-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.help-hero h3 {
  margin: 0;
  font-size: 22px;
}

.help-hero p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.quick-steps {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: quick-step;
}

.quick-steps li {
  counter-increment: quick-step;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.quick-steps li::before {
  content: counter(quick-step);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-weight: 900;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.help-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
  display: grid;
  gap: 8px;
}

.help-card h3,
.help-card p,
.help-card ul {
  margin: 0;
}

.help-card h3 {
  font-size: 16px;
}

.help-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.help-card ul,
.tip-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: #334155;
  font-size: 12px;
  line-height: 1.35;
}

.help-card li strong {
  color: var(--ink);
}

.help-lower-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
}

.term-list {
  display: grid;
  gap: 8px;
}

.term-list div,
.help-note-grid div {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  padding: 9px;
}

.term-list strong,
.help-note-grid strong {
  font-size: 13px;
}

.term-list span,
.help-note-grid span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.help-note-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.import-box {
  min-height: 86px;
  resize: vertical;
  line-height: 1.4;
}

.json-preview {
  width: 100%;
  min-height: 300px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: #243447;
  background: #fbfdff;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.45;
}

.posted-schedule {
  min-width: 0;
}

.posted-sheet {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.posted-titlebar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 2px solid var(--brand-black);
  padding-bottom: 14px;
}

.posted-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.posted-logo {
  width: 190px;
  max-width: 36vw;
  height: auto;
  display: block;
  object-fit: contain;
}

.posted-titlebar h3 {
  margin: 0;
  font-size: 24px;
  line-height: 1.12;
}

.posted-titlebar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.posted-kicker {
  color: var(--brand-red) !important;
  font-size: 12px !important;
  font-weight: 900;
  text-transform: uppercase;
}

.posted-meta {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px 12px;
  min-width: 150px;
  text-align: right;
}

.posted-meta span,
.posted-meta strong {
  display: block;
}

.posted-meta span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.posted-meta strong {
  margin-top: 4px;
  font-size: 18px;
}

.posted-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 700;
}

.posted-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}

.posted-table {
  width: 100%;
  min-width: 860px;
  table-layout: fixed;
}

.posted-table th,
.posted-table td {
  padding: 7px 6px;
  font-size: 12px;
  border-color: #cfd7e3;
}

.posted-table th {
  background: #17212b;
  color: #ffffff;
  text-align: center;
  position: static;
}

.posted-table th:first-child,
.posted-table td:first-child {
  width: 138px;
}

.posted-table th:nth-child(2),
.posted-table td:nth-child(2) {
  width: 58px;
  text-align: center;
}

.posted-table th:last-child,
.posted-table td:last-child {
  width: 58px;
  text-align: center;
}

.posted-table th span {
  color: #cbd5e1;
  font-weight: 700;
}

.schedule-group-row td {
  background: #edf2f7;
  color: #243447;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.posted-name {
  font-weight: 900;
}

.posted-name span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.shift-chip {
  display: block;
  border-left: 4px solid var(--teal);
  border-radius: 6px;
  background: #f8fafc;
  padding: 5px 6px;
  margin: 2px 0;
  min-width: 0;
}

.shift-chip strong,
.shift-chip span {
  display: block;
}

.shift-chip strong {
  color: #17212b;
  font-size: 11px;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.shift-chip span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.off-cell {
  color: #94a3b8;
  font-size: 12px;
  font-style: italic;
}

.closed-cell,
.closed-note {
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
  font-style: italic;
}

.closed-note {
  display: block;
  margin-bottom: 4px;
}

.posted-total {
  background: #f8fafc;
  font-weight: 900;
}

.posted-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

body.modal-open {
  overflow: hidden;
}

.modal-dialog {
  width: min(560px, calc(100vw - 28px));
  max-height: min(88vh, 720px);
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  overflow: auto;
  background: transparent;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.modal-dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
}

.modal-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  min-width: 0;
}

.modal-titlebar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.modal-titlebar h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.15;
}

.modal-titlebar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.issue-dialog {
  width: min(940px, calc(100vw - 28px));
  max-height: min(92vh, 820px);
}

.wide-dialog {
  width: min(1180px, calc(100vw - 28px));
  max-height: min(92vh, 840px);
}

.weekly-setup-scroll {
  max-height: 58vh;
}

.weekly-setup-table {
  min-width: 1060px;
}

.weekly-setup-table th,
.weekly-setup-table td {
  padding: 6px;
}

.issue-card {
  display: grid;
  gap: 12px;
}

.issue-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.issue-summary-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 10px;
  display: grid;
  gap: 4px;
  min-width: 0;
}

.issue-summary-card span,
.issue-summary-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.issue-summary-card strong {
  font-size: 24px;
  line-height: 1;
}

.issue-summary-card.good {
  border-color: #bbf7d0;
  background: var(--green-soft);
}

.issue-summary-card.warn {
  border-color: #fde68a;
  background: var(--amber-soft);
}

.issue-summary-card.bad {
  border-color: #fecdd3;
  background: var(--rose-soft);
}

.exception-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.exception-section {
  display: grid;
  gap: 10px;
}

.exception-section h4 {
  margin: 0;
  font-size: 16px;
}

.exception-section p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.exception-list {
  display: grid;
  gap: 10px;
}

.exception-item {
  display: grid;
  grid-template-columns: minmax(160px, 0.35fr) minmax(0, 1fr);
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-2);
}

.exception-item.bad {
  border-color: #fecdd3;
  background: var(--rose-soft);
}

.exception-item.warn {
  border-color: #fde68a;
  background: var(--amber-soft);
}

.exception-item.good {
  border-color: #bbf7d0;
  background: var(--green-soft);
}

.exception-item strong,
.exception-item span,
.exception-item em {
  display: block;
}

.exception-item strong {
  font-size: 14px;
}

.exception-item span,
.exception-item em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.exception-note {
  min-height: 64px;
  resize: vertical;
}

.issue-chart-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
  display: grid;
  gap: 8px;
}

.issue-chart-panel h4,
.issue-detail h4 {
  margin: 0;
  font-size: 15px;
}

.issue-chart-panel p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.issue-chart-panel canvas {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.issue-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.issue-detail {
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface-2);
}

.issue-detail.good {
  border-left-color: var(--green);
}

.issue-detail.warn {
  border-left-color: var(--amber);
}

.issue-detail.bad {
  border-left-color: var(--rose);
}

.issue-detail ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 5px;
  font-size: 13px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: #17212b;
  color: #ffffff;
  border-radius: 8px;
  padding: 12px 14px;
  min-width: 220px;
  transform: translateY(16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  box-shadow: var(--shadow);
  font-weight: 700;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.danger-text {
  color: var(--rose);
  font-weight: 800;
}

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

@media (max-width: 1150px) {
  .app-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .content-grid,
  .lower-grid,
  .rotation-grid,
  .help-hero,
  .help-lower-grid {
    grid-template-columns: 1fr;
  }

  .rules-grid,
  .policy-grid,
  .kpi-grid,
  .staff-mix-summary,
  .help-grid,
  .help-note-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .operating-days-card {
    grid-column: span 2;
  }

  .facility-card {
    grid-column: span 2;
  }

  .day-check-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .facility-cap-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .operating-hours-head,
  .operating-hours-line,
  .operating-hours-total {
    grid-template-columns: minmax(118px, 1fr) 84px 122px 122px 74px;
  }

  .overtime-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    padding: 14px;
  }

  .brand {
    grid-template-columns: minmax(170px, 230px) minmax(0, 1fr);
    align-items: center;
  }

  .brand-logo {
    max-height: 44px;
  }

  .nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .nav-button {
    justify-content: center;
    padding: 8px 6px;
  }

  .nav-button span:last-child {
    display: none;
  }

  .sidebar-footer {
    grid-template-columns: 1fr auto;
    align-items: end;
  }

  .main {
    padding: 18px 14px 24px;
  }

  .page-header,
  .toolbar,
  .panel-header,
  .alert-panel,
  .rule-section-title,
  .capacity-row {
    flex-direction: column;
    align-items: stretch;
  }

  .header-actions,
  .panel-actions,
  .toolbar-metrics {
    justify-content: flex-start;
  }

  .action-menu {
    width: 100%;
  }

  .action-menu summary {
    width: 100%;
  }

  .action-menu-panel {
    position: static;
    margin-top: 6px;
    box-shadow: none;
  }

  .kpi-grid,
  .rules-grid,
  .policy-grid,
  .staff-mix-summary,
  .issue-summary-grid,
  .issue-list,
  .help-grid,
  .help-note-grid {
    grid-template-columns: 1fr;
  }

  .operating-days-card {
    grid-column: span 1;
  }

  .facility-card {
    grid-column: span 1;
  }

  .day-check-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .facility-cap-grid {
    grid-template-columns: 1fr;
  }

  .operating-hours-head {
    display: none;
  }

  .operating-hours-line {
    grid-template-columns: 1fr 96px;
  }

  .operating-hours-total {
    grid-template-columns: 1fr 96px;
  }

  .operating-hours-total span,
  .operating-hours-total em {
    grid-column: 1;
    justify-self: start;
  }

  .operating-hours-total strong {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: center;
  }

  .operating-day-toggle {
    grid-column: 1 / -1;
  }

  .operating-hours-line input[type="time"] {
    min-width: 0;
  }

  .operating-length {
    justify-self: end;
  }

  .overtime-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-header h2 {
    font-size: 24px;
  }

  .two-col {
    grid-template-columns: 1fr;
  }

  .compact-field,
  .search-field,
  .output-controls {
    min-width: 0;
  }

  .alert-list {
    min-width: 0;
  }

  .alert-list li {
    grid-template-columns: 1fr;
  }

  table {
    min-width: 720px;
  }

  .roster-table {
    min-width: 0;
  }

  .staff-summary-grid,
  .detail-grid,
  .cert-detail-grid {
    grid-template-columns: 1fr;
  }

  .posted-sheet {
    padding: 14px;
  }

  .posted-titlebar,
  .posted-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .posted-brand {
    align-items: flex-start;
    flex-direction: column;
  }

  .posted-logo {
    width: 170px;
    max-width: 100%;
  }

  .posted-meta {
    text-align: left;
  }
}

@media print {
  @page {
    size: landscape;
    margin: 0.35in;
  }

  body {
    background: #ffffff;
    color: #111827;
  }

  .sidebar,
  .no-print,
  .toast,
  .modal-dialog,
  #view-export > .page-header {
    display: none !important;
  }

  .app-shell,
  .main {
    display: block;
    min-height: 0;
    padding: 0;
  }

  .view {
    display: none !important;
  }

  #view-export {
    display: block !important;
  }

  .posted-sheet {
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  .posted-titlebar {
    padding-bottom: 8px;
  }

  .posted-logo {
    width: 1.7in;
    max-width: 1.7in;
  }

  .posted-titlebar h3 {
    font-size: 18pt;
  }

  .posted-note {
    margin: 8px 0;
    padding: 6px 8px;
    background: #eef7f6 !important;
    color: #0d5f5a !important;
  }

  .posted-table-wrap {
    overflow: visible;
    border-radius: 0;
  }

  .posted-table {
    min-width: 0 !important;
    width: 100%;
    table-layout: fixed;
  }

  .posted-table th,
  .posted-table td {
    padding: 4px 5px;
    font-size: 8.5pt;
    break-inside: avoid;
  }

  .posted-table th {
    background: #17212b !important;
    color: #ffffff !important;
  }

  .posted-table th:first-child,
  .posted-table td:first-child {
    width: 1.55in;
  }

  .posted-table th:nth-child(2),
  .posted-table td:nth-child(2),
  .posted-table th:last-child,
  .posted-table td:last-child {
    width: 0.55in;
  }

  .shift-chip {
    background: #ffffff !important;
    padding: 3px 4px;
    margin: 0;
  }

  .shift-chip strong {
    font-size: 8.2pt;
  }

  .shift-chip span,
  .posted-name span,
  .off-cell,
  .posted-footer {
    font-size: 7.5pt;
  }

  .schedule-group-row td {
    background: #e5e7eb !important;
  }
}
