:root {
  --brand-navy: #252C6A;
  --brand-orange: #F26724;
  --bg: #090C12;
  --surface: #111722;
  --surface-2: #161D2A;
  --surface-3: #1C2534;
  --line: #2B3547;
  --text: #F7F9FC;
  --muted: #AAB5C7;
  --muted-2: #78869B;
  --danger: #E24B55;
  --danger-bg: #2A1418;
  --success: #58D68D;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { background: var(--bg); }
body {
  padding: clamp(10px, 1vw, 18px);
  background:
    radial-gradient(circle at 15% 0%, rgba(37,44,106,.24), transparent 34%),
    linear-gradient(180deg, #0A0D14 0%, #070A0F 100%);
  color: var(--text);
  font-family: "Helvetica Neue", Helvetica, Arial, "Segoe UI", sans-serif;
  overflow-x: hidden;
}
button, select { font: inherit; }

.board-shell {
  width: min(1920px, 100%);
  min-height: calc(100vh - 20px);
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: clamp(10px, .85vw, 16px);
}

.board-header {
  position: relative;
  min-height: 106px;
  display: grid;
  grid-template-columns: minmax(360px, 1fr) auto minmax(250px, .7fr);
  align-items: center;
  gap: 22px;
  padding: 18px 24px;
  overflow: hidden;
  border: 1px solid #343D57;
  border-radius: 14px;
  background: linear-gradient(115deg, rgba(37,44,106,.97), rgba(20,25,55,.98));
  box-shadow: 0 16px 42px rgba(0,0,0,.28);
}
.board-header::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 82px;
  height: 12px;
  background: var(--brand-orange);
  clip-path: polygon(18% 100%, 100% 0, 100% 100%);
}
.brand-lockup { min-width: 0; }
.brand-product {
  color: #FFF;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .18em;
}
.brand-organization {
  margin-top: 3px;
  color: #FFF;
  font-size: clamp(24px, 2.2vw, 42px);
  font-weight: 900;
  letter-spacing: -.025em;
  line-height: 1;
}
.brand-organization span { color: var(--brand-orange); font-style: italic; }
.brand-region {
  margin-top: 8px;
  color: #DDE3F1;
  font-size: clamp(13px, 1vw, 18px);
  font-weight: 700;
}
.header-center { display: flex; align-items: center; gap: 12px; }
.region-control { display: grid; gap: 4px; }
.region-control span {
  color: #C7CEE0;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.region-control select, .tv-mode-button {
  height: 40px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 8px;
  background: rgba(4,7,15,.27);
  color: #FFF;
  font-weight: 800;
}
.region-control select { min-width: 150px; padding: 0 34px 0 11px; }
.region-control option { color: #111; }
.tv-mode-button {
  align-self: end;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  cursor: pointer;
}
.tv-mode-button:hover, .tv-mode-button:focus-visible { background: rgba(242,103,36,.24); outline: 2px solid rgba(242,103,36,.55); outline-offset: 2px; }
.tv-mode-button[aria-pressed="true"] { border-color: var(--brand-orange); background: var(--brand-orange); }
.clock-block { text-align: right; }
.clock-block strong {
  display: block;
  font-size: clamp(44px, 4.2vw, 76px);
  font-weight: 800;
  letter-spacing: -.05em;
  line-height: .9;
  font-variant-numeric: tabular-nums;
}
.clock-block span { display: block; margin-top: 8px; color: #D7DDED; font-size: clamp(12px, .95vw, 16px); font-weight: 700; }

.briefing-grid { display: grid; grid-template-columns: .9fr 1.15fr 1.65fr; gap: clamp(10px, .85vw, 16px); }
.brief-card, .active-panel, .oos-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  box-shadow: 0 12px 32px rgba(0,0,0,.20);
}
.brief-card { min-height: 182px; padding: 15px 17px; overflow: hidden; }
.brief-card > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 9px;
  border-bottom: 2px solid rgba(242,103,36,.52);
}
.brief-card h2, .section-heading h2, .oos-panel h2 { margin: 0; font-size: clamp(18px, 1.35vw, 26px); text-transform: uppercase; letter-spacing: .035em; }
.brief-card > header h2 { color: var(--brand-orange); }
.brief-card > header span { color: var(--muted); font-size: 11px; font-weight: 800; }

.weather-content { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 16px; padding-top: 14px; }
.weather-temp { color: #FFF; font-size: clamp(50px, 4.2vw, 78px); font-weight: 900; line-height: .95; font-variant-numeric: tabular-nums; }
.weather-details { display: grid; gap: 4px; min-width: 0; }
.weather-details strong { font-size: clamp(16px, 1.15vw, 21px); }
.weather-details span { color: var(--muted); font-size: clamp(12px, .9vw, 15px); }

.staff-list { margin: 10px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; }
.staff-list div { min-width: 0; padding: 5px 0; }
.staff-list dt { color: var(--brand-orange); font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .07em; }
.staff-list dd { margin: 3px 0 0; color: #FFF; font-size: clamp(14px, 1vw, 18px); font-weight: 800; overflow-wrap: anywhere; }
.daily-information { min-height: 118px; display: grid; align-content: center; gap: 6px; padding-top: 11px; }
.daily-information h3 { margin: 0; color: #FFF; font-size: clamp(20px, 1.55vw, 29px); }
.daily-information p { margin: 0; color: #E7EBF3; font-size: clamp(15px, 1.05vw, 20px); line-height: 1.35; white-space: pre-wrap; }
.priority-important h3 { color: #FFC166; }
.priority-urgent h3 { color: #FF7C86; }
.loading, .empty-copy { color: var(--muted); font-weight: 700; }

.resources-layout { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: stretch; }
.resources-layout.has-oos { grid-template-columns: minmax(0, 1fr) minmax(230px, 18%); }
.active-panel { min-width: 0; overflow: hidden; }
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 20px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(37,44,106,.22);
}
.section-heading p, .oos-panel header p { margin: 0 0 3px; color: var(--muted); font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; }
.section-heading h2 { color: #FFF; font-size: clamp(24px, 1.8vw, 34px); }
.unit-count { display: flex; align-items: baseline; gap: 8px; color: var(--muted); }
.unit-count strong { color: var(--brand-orange); font-size: clamp(32px, 2.5vw, 46px); line-height: 1; }
.unit-count span { font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.assignment-table-wrap { min-height: 0; overflow: auto; }
.assignment-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.assignment-table th {
  padding: 10px 16px;
  border-bottom: 1px solid #323C50;
  background: #121827;
  color: var(--muted);
  text-align: left;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .09em;
}
.assignment-table td {
  padding: clamp(12px, 1.15vh, 18px) 16px;
  border-bottom: 1px solid #242D3D;
  color: #F8FAFD;
  font-size: clamp(18px, 1.45vw, 29px);
  vertical-align: middle;
}
.assignment-table tbody tr { background: rgba(255,255,255,.008); transition: background .35s ease, box-shadow .35s ease; }
.assignment-table tbody tr:nth-child(even) { background: rgba(255,255,255,.026); }
.assignment-table tbody tr:last-child td { border-bottom: 0; }
.assignment-table tbody tr.row-changed { animation: row-change 2.2s ease-out; }
@keyframes row-change { 0% { background: rgba(242,103,36,.34); box-shadow: inset 5px 0 0 var(--brand-orange); } 100% { background: rgba(255,255,255,.008); box-shadow: inset 0 0 0 transparent; } }
.assignment-table th:nth-child(1), .assignment-table td:nth-child(1) { width: 16%; }
.assignment-table th:nth-child(2), .assignment-table td:nth-child(2) { width: 9%; }
.assignment-table th:nth-child(3), .assignment-table td:nth-child(3) { width: 11%; }
.assignment-table th:nth-child(4), .assignment-table td:nth-child(4) { width: 13%; }
.assignment-table th:nth-child(5), .assignment-table td:nth-child(5) { width: 29%; }
.assignment-table th:nth-child(6), .assignment-table td:nth-child(6) { width: 14%; }
.assignment-table th:nth-child(7), .assignment-table td:nth-child(7) { width: 8%; }
.unit-id { display: block; color: #FFF; font-size: clamp(32px, 2.6vw, 50px); font-weight: 950; letter-spacing: -.035em; line-height: .95; white-space: nowrap; }
.unit-type { display: block; margin-top: 5px; color: var(--muted-2); font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
.crew-copy { font-weight: 850; letter-spacing: -.015em; }
.hours { color: #E9EDF5; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.shift-id { font-weight: 900; }
.care-level-chip { display: inline-flex; align-items: center; padding: 6px 9px; border: 1px solid rgba(242,103,36,.35); border-radius: 6px; background: rgba(242,103,36,.12); color: #FFB083; font-size: clamp(13px, 1vw, 18px); font-weight: 900; white-space: nowrap; }
.status-chip { display: inline-flex; padding: 5px 8px; border-radius: 5px; background: rgba(88,214,141,.10); color: var(--success); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.empty-state { padding: 54px 20px !important; color: var(--muted) !important; text-align: center; font-size: clamp(18px, 1.2vw, 24px) !important; font-weight: 700; }

/* Finger Lakes is intentionally operationally minimal. */
body.region-finger-lakes .batavia-only { display: none !important; }
body.region-finger-lakes .assignment-table th:nth-child(1), body.region-finger-lakes .assignment-table td:nth-child(1) { width: 18%; }
body.region-finger-lakes .assignment-table th:nth-child(3), body.region-finger-lakes .assignment-table td:nth-child(3) { width: 12%; }
body.region-finger-lakes .assignment-table th:nth-child(4), body.region-finger-lakes .assignment-table td:nth-child(4) { width: 16%; }
body.region-finger-lakes .assignment-table th:nth-child(5), body.region-finger-lakes .assignment-table td:nth-child(5) { width: 36%; }
body.region-finger-lakes .assignment-table th:nth-child(6), body.region-finger-lakes .assignment-table td:nth-child(6) { width: 18%; }

.oos-panel { min-width: 0; padding: 0; overflow: hidden; border-color: rgba(226,75,85,.45); background: linear-gradient(180deg, #211217, #140E12); }
.oos-panel > header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid rgba(226,75,85,.32); background: rgba(226,75,85,.08); }
.oos-panel header p { color: #CE8A90; }
.oos-panel h2 { color: #FF858D; font-size: clamp(18px, 1.25vw, 24px); }
.oos-panel > header > strong { min-width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--danger); color: #FFF; font-size: 16px; }
.oos-list { display: grid; align-content: start; }
.oos-unit { padding: 13px 16px; border-bottom: 1px solid rgba(226,75,85,.18); }
.oos-unit:last-child { border-bottom: 0; }
.oos-unit strong { display: block; color: #FFF; font-size: clamp(23px, 1.7vw, 32px); line-height: 1; }
.oos-unit span { display: block; margin-top: 6px; color: #C9A7AB; font-size: 12px; line-height: 1.25; }

.board-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 2px 5px; color: #7F8BA0; font-size: 11px; font-weight: 800; }
.online-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(88,214,141,.08); }

body.cursor-hidden, body.cursor-hidden * { cursor: none !important; }
body.tv-mode { padding: 6px; }
body.tv-mode .board-shell { min-height: calc(100vh - 12px); gap: 8px; }
body.tv-mode .board-header { min-height: 112px; padding: 16px 22px; border-radius: 10px; }
body.tv-mode .brand-organization { font-size: clamp(36px, 2.8vw, 52px); }
body.tv-mode .clock-block strong { font-size: clamp(58px, 5vw, 94px); }
body.tv-mode .brief-card { min-height: 190px; border-radius: 9px; }
body.tv-mode .assignment-table td { padding-top: clamp(15px, 1.45vh, 22px); padding-bottom: clamp(15px, 1.45vh, 22px); }
body.tv-mode .unit-id { font-size: clamp(39px, 3.1vw, 58px); }
body.tv-mode .crew-copy { font-size: clamp(21px, 1.65vw, 32px); }
body.tv-mode .hours { font-size: clamp(20px, 1.5vw, 29px); }
body.tv-mode .board-footer { font-size: 12px; }

@media (max-width: 1180px) {
  .board-header { grid-template-columns: 1fr auto; }
  .header-center { grid-column: 1; grid-row: 2; }
  .clock-block { grid-column: 2; grid-row: 1 / span 2; }
  .briefing-grid { grid-template-columns: 1fr 1fr; }
  .info-card { grid-column: 1 / -1; }
  .resources-layout.has-oos { grid-template-columns: 1fr; }
  .oos-list { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
}
@media (max-width: 760px) {
  body { padding: 6px; }
  .board-header { grid-template-columns: 1fr; }
  .clock-block { grid-column: 1; grid-row: auto; text-align: left; }
  .header-center { grid-column: 1; grid-row: auto; flex-wrap: wrap; }
  .briefing-grid { grid-template-columns: 1fr; }
  .info-card { grid-column: auto; }
  .staff-list { grid-template-columns: 1fr; }
  .assignment-table { min-width: 760px; }
  .tv-mode-label { display: none; }
  .board-footer { flex-wrap: wrap; }
}

/* v1.0.2 full-width dispatch layout */
body {
  padding: 8px;
}
.board-shell {
  width: 100%;
  max-width: none;
  min-height: calc(100vh - 16px);
  margin: 0;
}
.briefing-grid {
  grid-template-columns: .85fr 1.15fr 1.55fr;
}
.briefing-grid.has-oos {
  grid-template-columns: .82fr 1.08fr 1.45fr .95fr;
}
.briefing-oos {
  min-height: 182px;
  height: 100%;
}
.resources-layout,
.resources-layout.has-oos {
  grid-template-columns: minmax(0, 1fr);
}
.active-panel {
  width: 100%;
}
@media (min-width: 1181px) {
  .briefing-grid.has-oos .info-card,
  .briefing-grid.has-oos .briefing-oos {
    min-width: 0;
  }
}
@media (max-width: 1180px) {
  .briefing-grid.has-oos { grid-template-columns: 1fr 1fr; }
  .briefing-grid.has-oos .info-card { grid-column: auto; }
  .briefing-grid.has-oos .briefing-oos { grid-column: auto; }
}
@media (max-width: 760px) {
  .briefing-grid.has-oos { grid-template-columns: 1fr; }
}

/* v1.2.0 assignment display simplification and roster scaling */
.assignment-table-wrap.assignment-two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
  overflow: hidden;
  background: #0D121B;
}
.assignment-two-column .assignment-table-column {
  border: 1px solid #2A3446;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}
.assignment-two-column .assignment-table th {
  padding: 8px 10px;
  font-size: 9px;
}
.assignment-two-column .assignment-table td {
  padding: clamp(9px, .9vh, 13px) 10px;
  font-size: clamp(15px, 1.05vw, 21px);
}
.assignment-two-column .unit-id {
  font-size: clamp(27px, 1.9vw, 38px);
}
.assignment-two-column .care-level-chip {
  padding: 5px 7px;
  font-size: clamp(11px, .8vw, 15px);
}
.assignment-two-column .assignment-table th:nth-child(1),
.assignment-two-column .assignment-table td:nth-child(1) { width: 19%; }
.assignment-two-column .assignment-table th:nth-child(2),
.assignment-two-column .assignment-table td:nth-child(2) { width: 10%; }
.assignment-two-column .assignment-table th:nth-child(3),
.assignment-two-column .assignment-table td:nth-child(3) { width: 18%; }
.assignment-two-column .assignment-table th:nth-child(4),
.assignment-two-column .assignment-table td:nth-child(4) { width: 35%; }
.assignment-two-column .assignment-table th:nth-child(5),
.assignment-two-column .assignment-table td:nth-child(5) { width: 18%; }
body.region-finger-lakes .assignment-two-column .assignment-table th:nth-child(1),
body.region-finger-lakes .assignment-two-column .assignment-table td:nth-child(1) { width: 17%; }
body.region-finger-lakes .assignment-two-column .assignment-table th:nth-child(2),
body.region-finger-lakes .assignment-two-column .assignment-table td:nth-child(2) { width: 13%; }
body.region-finger-lakes .assignment-two-column .assignment-table th:nth-child(3),
body.region-finger-lakes .assignment-two-column .assignment-table td:nth-child(3) { width: 18%; }
body.region-finger-lakes .assignment-two-column .assignment-table th:nth-child(4),
body.region-finger-lakes .assignment-two-column .assignment-table td:nth-child(4) { width: 34%; }
body.region-finger-lakes .assignment-two-column .assignment-table th:nth-child(5),
body.region-finger-lakes .assignment-two-column .assignment-table td:nth-child(5) { width: 18%; }
.assignment-dense .assignment-table td {
  padding-top: 7px;
  padding-bottom: 7px;
}
.assignment-dense .unit-id { font-size: clamp(24px, 1.65vw, 33px); }
.assignment-dense .crew-copy { font-size: clamp(14px, .95vw, 19px); }
body.tv-mode .assignment-two-column .assignment-table td {
  padding-top: clamp(10px, 1vh, 15px);
  padding-bottom: clamp(10px, 1vh, 15px);
}
body.tv-mode .assignment-two-column .unit-id { font-size: clamp(30px, 2.05vw, 42px); }
body.tv-mode .assignment-two-column .crew-copy { font-size: clamp(17px, 1.2vw, 23px); }
body.tv-mode .assignment-dense .assignment-table td { padding-top: 8px; padding-bottom: 8px; }
body.tv-mode .assignment-dense .unit-id { font-size: clamp(26px, 1.8vw, 36px); }

@media (max-width: 1180px) {
  .assignment-table-wrap.assignment-two-column {
    grid-template-columns: 1fr;
    overflow: auto;
  }
}
