/* ============================================================
   Base & Reset
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red: #c8102e;
  --red-dark: #a00d24;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-900: #111827;
  --amber: #d97706;
  --amber-bg: #fffbeb;
  --amber-border: #f59e0b;
  --white: #ffffff;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow: 0 2px 8px rgba(0,0,0,0.10);
  --radius: 6px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html, body {
  height: 100%;
  font-family: var(--font);
  font-size: 14px;
  color: var(--gray-900);
  background: var(--gray-100);
}

/* ============================================================
   Header
   ============================================================ */
.app-header {
  background: var(--gray-900);
  color: var(--white);
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-cross {
  font-size: 22px;
  font-weight: 900;
  color: var(--red);
  line-height: 1;
}

.logo-text {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.region-badge {
  background: rgba(255,255,255,0.12);
  color: var(--white);
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.2);
}

/* ============================================================
   Upload Screen
   ============================================================ */
.upload-screen {
  min-height: calc(100vh - 52px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.upload-zone {
  background: var(--white);
  border: 2px dashed var(--gray-300, #d1d5db);
  border-radius: 12px;
  padding: 60px 48px;
  text-align: center;
  max-width: 480px;
  width: 100%;
  transition: border-color 0.15s, background 0.15s;
  cursor: pointer;
}

.upload-zone.drag-over {
  border-color: var(--red);
  background: #fff5f5;
}

.upload-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.upload-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 8px;
}

.upload-sub {
  color: var(--gray-500);
  font-size: 13px;
  margin-bottom: 24px;
  line-height: 1.5;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn-primary {
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--red-dark); }

.btn-outline {
  background: var(--white);
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.btn-outline:hover { border-color: var(--gray-400); background: var(--gray-50); }

.btn-ghost {
  background: transparent;
  color: var(--gray-500);
  border: none;
  border-radius: var(--radius);
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: color 0.15s;
}
.btn-ghost:hover { color: var(--gray-900); }

.btn-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--gray-500);
  padding: 4px 8px;
  border-radius: 4px;
  line-height: 1;
}
.btn-icon:hover { background: var(--gray-100); color: var(--gray-900); }

.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ============================================================
   Toolbar
   ============================================================ */
.toolbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 500;
}

.date-input {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 5px 8px;
  font-size: 12px;
  font-family: var(--font);
  color: var(--gray-900);
  background: var(--white);
}
.date-input:focus { outline: 2px solid var(--red); outline-offset: -1px; }

.pdf-title-input {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 6px 10px;
  font-size: 12px;
  font-family: var(--font);
  color: var(--gray-900);
  width: 200px;
  background: var(--white);
}
.pdf-title-input:focus { outline: 2px solid var(--red); outline-offset: -1px; }
.pdf-title-input::placeholder { color: var(--gray-400); }

/* ============================================================
   Role Panel
   ============================================================ */
.role-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 199;
}

.role-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 340px;
  background: var(--white);
  border-left: 1px solid var(--gray-200);
  z-index: 200;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 16px rgba(0,0,0,0.1);
}

.role-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
}

.role-panel-header h3 {
  font-size: 15px;
  font-weight: 600;
}

.role-panel-hint {
  font-size: 11px;
  color: var(--gray-500);
  padding: 8px 20px;
  border-bottom: 1px solid var(--gray-200);
}

.role-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
  padding: 8px 0;
}

.role-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  cursor: default;
  user-select: none;
  border-bottom: 1px solid var(--gray-100);
  transition: background 0.1s;
}
.role-item:hover { background: var(--gray-50); }
.role-item.dragging { opacity: 0.4; }
.role-item.drag-over { border-top: 2px solid var(--red); }

.drag-handle {
  color: var(--gray-400);
  font-size: 16px;
  cursor: grab;
  flex-shrink: 0;
}
.drag-handle:active { cursor: grabbing; }

.role-item input[type="checkbox"] {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  accent-color: var(--red);
  cursor: pointer;
}

.role-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.role-name-text {
  flex: 1;
  font-size: 12px;
  color: var(--gray-700);
  line-height: 1.3;
}

.role-arrows {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.arrow-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 10px;
  color: var(--gray-400);
  padding: 1px 3px;
  line-height: 1;
  border-radius: 3px;
}
.arrow-btn:hover { color: var(--gray-900); background: var(--gray-100); }

/* ============================================================
   Tab Bar & View Toggle
   ============================================================ */
.tab-bar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 0;
}

.tab-btn {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--gray-900); }
.tab-btn.active { color: var(--red); border-bottom-color: var(--red); }

.view-toggle {
  margin-left: auto;
  display: flex;
  background: var(--gray-100);
  border-radius: var(--radius);
  padding: 3px;
  gap: 2px;
}
.view-btn {
  background: none;
  border: none;
  border-radius: 4px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.view-btn.active { background: var(--white); color: var(--gray-900); box-shadow: var(--shadow-sm); }

/* ============================================================
   Calendar Nav & Legend
   ============================================================ */
.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 16px 20px 8px;
}

.month-title {
  font-size: 18px;
  font-weight: 600;
  min-width: 220px;
  text-align: center;
}

.nav-btn {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  width: 32px;
  height: 32px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.nav-btn:hover { background: var(--gray-100); }

.month-summary {
  text-align: center;
  font-size: 12px;
  color: var(--gray-500);
  padding: 0 20px 8px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 8px 20px 12px;
  border-bottom: 1px solid var(--gray-200);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--gray-700);
}

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

.unfilled-swatch {
  background: var(--amber-border);
}

/* ============================================================
   Monthly Calendar — week-block container
   Each week is a .week-block > .week-grid for clean print pagination.
   ============================================================ */
.calendar-grid {
  display: block;
  margin: 0 20px 20px;
}

/* Week header — visible on screen as a compact label bar,
   repurposed as a full per-page header on print */
.week-print-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 10px;
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
}

.week-print-month {
  display: none;
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-900);
}

.week-print-range {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-900);
}

.week-block {
  border: 1px solid var(--gray-200);
  margin-bottom: 12px;
  border-radius: 4px;
  overflow: hidden;
}

.week-grid {
  display: grid;
  grid-template-columns: 150px repeat(7, 1fr);
  gap: 1px;
  background: var(--gray-200);
}

.day-header {
  background: var(--gray-100);
  text-align: center;
  padding: 6px 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.day-cell {
  background: var(--white);
  min-height: 110px;
  padding: 4px;
  vertical-align: top;
}

.day-cell.empty { background: var(--gray-50); }

.date-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
  padding: 2px 4px;
  margin-bottom: 3px;
  display: inline-block;
}

.day-cell.today .date-num {
  background: var(--red);
  color: var(--white);
  border-radius: 999px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 11px;
}

.shift-chip {
  display: flex;
  flex-direction: column;
  padding: 3px 5px;
  margin-bottom: 2px;
  border-radius: 4px;
  border-left: 3px solid var(--gray-300);
  background: var(--gray-50);
  font-size: 10px;
  cursor: default;
  line-height: 1.3;
}

.shift-chip.unfilled {
  border-left-color: var(--amber-border);
  background: var(--amber-bg);
}

.chip-time {
  color: var(--gray-500);
  font-size: 9px;
}

.chip-role {
  color: var(--gray-600, #4b5563);
  font-size: 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip-name {
  color: var(--gray-900);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.unfilled-label {
  color: var(--amber);
  font-weight: 600;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.chip-phone {
  color: #2563eb;
  font-size: 10px;
  text-decoration: none;
  letter-spacing: 0.01em;
}
.chip-phone:hover {
  color: var(--red);
  text-decoration: underline;
}

.chip-signup {
  font-size: 9px;
  font-weight: 600;
  color: var(--amber);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.chip-signup:hover {
  color: var(--red);
  text-decoration: underline;
}

/* ============================================================
   Weekly Grid
   ============================================================ */
.weekly-grid {
  display: grid;
  grid-template-columns: 150px repeat(7, 1fr);
  gap: 1px;
  background: var(--gray-200);
  border: 1px solid var(--gray-200);
  margin: 0 20px 20px;
}

.weekly-day-header {
  background: #374151;
  color: #ffffff;
  text-align: center;
  padding: 7px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.5;
}

.weekly-day-header div:last-child {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0.85;
}


.weekly-day-header.empty {
  background: #4b5563;
  opacity: 0.5;
}

.weekly-day-header.today {
  background: var(--red-dark);
}

.weekly-day-cell {
  background: var(--white);
  min-height: 160px;
  padding: 6px;
}

.weekly-day-cell .shift-chip {
  font-size: 11px;
  padding: 4px 7px;
  margin-bottom: 3px;
}

.weekly-day-cell .chip-time { font-size: 10px; }
.weekly-day-cell .chip-role { font-size: 10px; }
.weekly-day-cell .chip-name { font-size: 11px; }
.weekly-day-cell .unfilled-label { font-size: 10px; }

/* ============================================================
   Swimlane Shared Styles
   ============================================================ */
.swimlane-corner {
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
}

/* Date-number row that leads each week block in the monthly view */
.swimlane-date-corner {
  background: var(--gray-100);
  border-top: 2px solid var(--gray-300);
}

.swimlane-date-cell {
  background: var(--gray-100);
  border-top: 2px solid var(--gray-300);
  text-align: center;
  padding: 4px 4px 3px;
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-600, #4b5563);
}

.swimlane-date-cell.empty {
  background: var(--gray-50);
  border-top-color: var(--gray-200);
}

.swimlane-date-cell.today {
  color: var(--red);
}

/* Role label cell — left column of each swimlane row */
.swimlane-label {
  background: var(--gray-50);
  border-left: 4px solid var(--gray-300);
  padding: 6px 8px 6px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-700);
  line-height: 1.35;
  word-break: break-word;
  display: flex;
  align-items: flex-start;
}

/* Data cell at role × day intersection */
.swimlane-cell {
  background: var(--white);
  padding: 4px;
  min-height: 52px;
  vertical-align: top;
}

.swimlane-cell.empty {
  background: var(--gray-50);
}


/* ============================================================
   Analysis
   ============================================================ */
.analysis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 20px;
}

.analysis-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.analysis-card--full {
  grid-column: 1 / -1;
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-900);
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
}

.card-body {
  padding: 12px;
  overflow-x: auto;
  max-height: 400px;
  overflow-y: auto;
}

.no-data {
  color: var(--gray-500);
  font-size: 13px;
  text-align: center;
  padding: 20px;
}

/* ============================================================
   Data Tables
   ============================================================ */
.table-wrapper { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table th {
  text-align: left;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  border-bottom: 2px solid var(--gray-200);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.data-table th.sortable { cursor: pointer; user-select: none; }
.data-table th.sortable:hover { color: var(--gray-900); }
.data-table th.sort-asc::after { content: ' ▲'; font-size: 9px; }
.data-table th.sort-desc::after { content: ' ▼'; font-size: 9px; }

.data-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  vertical-align: top;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--gray-50); }

.data-table td.gap-cell { color: var(--amber); font-weight: 500; }

/* Role distribution */
.role-dist-list { display: flex; flex-direction: column; gap: 12px; }


.role-dist-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 5px;
}

.role-dist-name {
  font-size: 12px;
  color: var(--gray-700);
  font-weight: 500;
}

.role-dist-stats {
  font-size: 11px;
  color: var(--gray-500);
  white-space: nowrap;
}

.progress-bar {
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* ============================================================
   Coverage Gaps — role grouping
   ============================================================ */
.gap-role-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 5px;
  margin-top: 12px;
  border-top: 1px solid var(--gray-200);
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-900);
}
.gap-role-heading:first-child { margin-top: 0; border-top: none; }

.gap-role-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.gap-role-name { flex: 1; }

.gap-role-meta {
  font-size: 11px;
  font-weight: 400;
  color: var(--gray-500);
  white-space: nowrap;
}

.gap-total {
  margin-top: 12px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-700);
  border-top: 2px solid var(--gray-200);
  text-align: right;
}

/* ============================================================
   Fill % Day-of-Week Grid
   ============================================================ */
.fill-grid-wrapper {
  margin-top: 20px;
  border-top: 1px solid var(--gray-200);
  padding-top: 12px;
}

.fill-grid-heading {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.fill-grid-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.fill-grid-table th {
  text-align: center;
  padding: 5px 6px;
  font-size: 10px;
  font-weight: 600;
  color: var(--gray-500);
  border-bottom: 1px solid var(--gray-200);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fill-grid-table th:first-child { text-align: left; }

.fill-grid-role {
  padding: 5px 8px 5px 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--gray-700);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
}

.fill-grid-swatch {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

.fill-cell {
  text-align: center;
  padding: 4px 6px;
  font-size: 11px;
  border-bottom: 1px solid var(--gray-100);
  white-space: nowrap;
}

.fill-cell-empty { color: var(--gray-400); }
.fill-good  { background: #f0fdf4; color: #15803d; }
.fill-warn  { background: #fffbeb; color: #b45309; }
.fill-bad   { background: #fff1f2; color: #b91c1c; }
.fill-cell-overall { font-weight: 700; border-left: 2px solid var(--gray-200); }

/* ============================================================
   Roster Tab
   ============================================================ */
.roster-content {
  padding: 16px 20px 32px;
  max-width: 860px;
}

.roster-role-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 0 6px;
  margin-top: 8px;
  border-top: 2px solid var(--gray-200);
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-900);
}

.roster-role-heading:first-child { border-top: none; margin-top: 0; }

.roster-role-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.roster-role-count {
  font-size: 11px;
  font-weight: 400;
  color: var(--gray-500);
  margin-left: 4px;
}

.roster-table { margin-bottom: 8px; }

.roster-phone {
  font-size: 12px !important;
  font-weight: 500;
}

.roster-email {
  color: var(--gray-500);
  font-size: 12px;
  text-decoration: none;
}
.roster-email:hover { color: var(--red); text-decoration: underline; }

td.muted { color: var(--gray-400); font-size: 12px; }

/* ============================================================
   Version badge
   ============================================================ */
.version-badge {
  margin-left: auto;
  font-size: 10px;
  font-family: monospace;
  color: var(--white);
  opacity: 0.35;
  user-select: none;
}

/* ============================================================
   Utility
   ============================================================ */
.hidden { display: none !important; }
.tab-content { display: block; }
.view-pane { display: block; }

/* ============================================================
   Print Styles
   ============================================================ */
.print-only { display: none; }

.print-header {
  padding: 12px 20px 8px;
  border-bottom: 2px solid var(--gray-900);
  margin-bottom: 8px;
}

.print-logo {
  font-size: 14px;
  font-weight: 700;
  color: var(--red);
}

.print-title-display {
  font-size: 22px;
  font-weight: 700;
  color: var(--gray-900);
  margin-top: 4px;
}

.print-meta {
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 2px;
}

@media print {
  /* ══════════════════════════════════════════
     PAGE SETUP
  ══════════════════════════════════════════ */
  /* margin-top: 18mm reserves space for the fixed header (≈11mm) on every page */
  @page { size: portrait; margin: 18mm 14mm 10mm; }

  :root { font-size: 10pt; }

  html, body {
    background: white;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  /* ══════════════════════════════════════════
     SHOW / HIDE
  ══════════════════════════════════════════ */
  .no-print    { display: none !important; }
  .print-only  { display: block !important; }
  .tab-content { display: block !important; }
  .view-pane   { display: block !important; }

  body[data-print-view="monthly"]    #view-weekly    { display: none !important; }
  body[data-print-view="weekly"]     #view-monthly   { display: none !important; }
  body[data-print-active="schedule"] #tab-analysis   { display: none !important; }
  body[data-print-active="schedule"] #tab-roster     { display: none !important; }
  body[data-print-active="analysis"] #tab-schedule   { display: none !important; }
  body[data-print-active="analysis"] #tab-roster     { display: none !important; }
  body[data-print-active="roster"]   #tab-schedule   { display: none !important; }
  body[data-print-active="roster"]   #tab-analysis   { display: none !important; }

  /* ══════════════════════════════════════════
     GLOBAL PRINT HEADER
     position:fixed repeats this on every page.
     White background with a thin dark bottom border — minimal ink.
  ══════════════════════════════════════════ */
  .print-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    padding: 3.5mm 14mm 2mm;
    border-bottom: 1pt solid #111827;
    margin-bottom: 0;
    display: flex !important;
    align-items: baseline;
    gap: 14pt;
  }
  .print-logo {
    font-size: 10pt;
    font-weight: 800;
    color: #111827;
    letter-spacing: -0.01em;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .print-logo .logo-cross { color: #111827; }
  .print-title-display {
    font-size: 13pt;
    font-weight: 700;
    color: #111827;
    flex: 1;
    letter-spacing: -0.01em;
  }
  .print-meta {
    font-size: 8pt;
    font-weight: 500;
    color: #4b5563;
    white-space: nowrap;
    letter-spacing: 0.01em;
  }

  /* ══════════════════════════════════════════
     LEGEND — hidden in print (role colors removed, legend has no meaning)
  ══════════════════════════════════════════ */
  .legend { display: none !important; }

  /* Month summary hidden in print — it shifts page 1 content down unevenly vs pages 2+ */
  .month-summary { display: none !important; }

  /* ══════════════════════════════════════════
     MONTHLY CALENDAR — one week per page
  ══════════════════════════════════════════ */
  .calendar-grid { margin: 0; display: block !important; }
  /* Monthly print title is redundant with week-print-header — hide only the monthly one */
  #month-title-print { display: none !important; }

  .week-block {
    break-before: page;
    border: none;
    border-radius: 0;
    margin-bottom: 0;
    overflow: visible;
    /* Push week content below the position:fixed header which sits at top:0 of
       the content area in Chromium PDF (not the physical page top).
       padding-top avoids the CSS page-break margin-collapse. */
    padding-top: 14mm;
  }
  /* First week block also needs the padding — fixed header sits at top of content area on page 1 too */
  .week-block:first-child { break-before: avoid; padding-top: 14mm; }

  /* Per-page week header — white bg, no borders (day-header below has its own) */
  .week-print-header {
    display: flex !important;
    align-items: baseline;
    justify-content: space-between;
    padding: 2pt 0 3pt;
    margin-bottom: 0;
    background: #ffffff !important;
    border-top: none;
    border-bottom: none;
  }
  .week-print-month {
    display: block !important;
    font-size: 8pt;
    font-weight: 800;
    color: #111827;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .week-print-range {
    display: block !important;
    font-size: 8pt;
    font-weight: 500;
    color: #6b7280;
    letter-spacing: 0.01em;
  }

  /* Week grid — use a lighter gap (#e5e7eb) so the grid lines are visible but minimal ink */
  .week-grid {
    gap: 0.5pt;
    background: #e5e7eb;
  }

  /* Day-of-week header row — white with bottom border, no fill */
  .day-header {
    font-size: 8pt;
    font-weight: 700;
    padding: 3.5pt 3pt;
    background: #ffffff !important;
    color: #111827 !important;
    text-align: center;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-bottom: 1pt solid #111827;
  }

  /* Date-number row — white, not filled */
  .swimlane-date-corner { background: #ffffff !important; border-top: none; }
  .swimlane-date-cell {
    font-size: 10pt;
    font-weight: 700;
    padding: 2.5pt 4pt;
    text-align: center;
    background: #ffffff !important;
    color: #111827;
    border-top: none;
  }
  .swimlane-date-cell.empty { background: #ffffff !important; color: #9ca3af; }
  .swimlane-date-cell.today { color: #111827; }

  /* Role label column — white, monochrome left border (no role color in print) */
  .swimlane-label {
    font-size: 8pt;
    font-weight: 700;
    padding: 5pt 6pt 5pt 8pt;
    border-left: 3pt solid #374151 !important;
    background: #ffffff !important;
    color: #111827;
    line-height: 1.3;
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
  }

  /* Shift cells — always white, no fill for empty */
  .swimlane-cell {
    background: #ffffff !important;
    padding: 2.5pt 3pt;
    min-height: 0;
    vertical-align: top;
  }
  .swimlane-cell.empty { background: #ffffff !important; }

  /* Confirmed chips — monochrome left rule, no role color in print */
  .shift-chip {
    border-left: 2pt solid #374151 !important;
    border-radius: 0;
    padding: 1.5pt 4pt;
    margin-bottom: 2pt;
    background: transparent !important;
    break-inside: avoid;
  }

  /* Unfilled chips — full dashed outline so they read as "empty slots" at a glance */
  .shift-chip.unfilled {
    background: transparent !important;
    border: 1.5pt dashed #6b7280 !important;
    padding: 2pt 4pt;
  }

  .chip-time      { font-size: 8pt; font-weight: 500; color: #4b5563; letter-spacing: 0.01em; }
  .chip-name      { font-size: 9pt; font-weight: 700; color: #111827; letter-spacing: -0.01em; }
  .chip-phone     { font-size: 8pt; font-weight: 500; color: #1d4ed8; text-decoration: underline; white-space: nowrap; }
  .chip-role      { display: none; }
  /* UNFILLED label — large, heavy, clearly dominant within the outlined chip */
  .unfilled-label {
    font-size: 9pt;
    font-weight: 800;
    color: #111827;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  .chip-signup    { font-size: 8pt; font-weight: 600; color: #1d4ed8; text-decoration: underline; }

  /* ══════════════════════════════════════════
     WEEKLY CALENDAR — single landscape page
  ══════════════════════════════════════════ */
  /* Push weekly view below the position:fixed header (same fix as monthly week-blocks) */
  #view-weekly { padding-top: 14mm; }

  /* Week title shown in weekly print view */
  #week-title-print {
    font-size: 11pt;
    font-weight: 700;
    color: #111827;
    margin-bottom: 4pt;
    letter-spacing: -0.01em;
  }

  .weekly-grid {
    gap: 0.5pt;
    background: #e5e7eb;
    margin: 0;
  }

  /* Weekly day header — white bg, dark bottom border, no fill */
  .weekly-day-header {
    font-size: 8.5pt;
    font-weight: 700;
    padding: 4pt 3pt;
    background: #ffffff !important;
    color: #111827 !important;
    text-align: center;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-bottom: 1pt solid #111827;
  }
  /* Reset opacity:0.85 from screen style on the date sub-line — causes fuzzy PDF text */
  .weekly-day-header div:last-child { opacity: 1; }
  .weekly-day-header.empty {
    opacity: 1;
    color: #9ca3af !important;
    border-bottom-color: #d1d5db;
  }
  /* today highlight intentionally omitted for print — saves ink, date still reads */

  .weekly-day-cell {
    background: #ffffff !important;
    padding: 4pt;
    min-height: 0;
  }
  .weekly-day-cell .shift-chip          { padding: 2.5pt 5pt; margin-bottom: 2.5pt; border-left-width: 2pt !important; }
  .weekly-day-cell .shift-chip.unfilled { padding: 3pt 5pt; }
  .weekly-day-cell .chip-time           { font-size: 8pt; }
  .weekly-day-cell .chip-name           { font-size: 9.5pt; font-weight: 700; }
  .weekly-day-cell .chip-phone          { font-size: 8pt; color: #1d4ed8; text-decoration: underline; }

  /* ══════════════════════════════════════════
     ANALYSIS — stacked cards
  ══════════════════════════════════════════ */
  /* padding-top pushes first card below the position:fixed header on page 1 */
  .analysis-grid { display: block !important; padding: 14mm 0 0; }

  .analysis-card {
    margin-bottom: 12pt;
    break-inside: avoid;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }

  /* Card title — white bg with bold dark text and heavy bottom border, no fill */
  .card-title {
    font-size: 10pt;
    font-weight: 700;
    padding: 4pt 0;
    background: #ffffff !important;
    color: #111827;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-bottom: 1.5pt solid #111827;
  }

  .card-body { max-height: none; overflow: visible; padding: 6pt 0 0; }

  .data-table      { font-size: 9pt; }
  .data-table th   { font-size: 8pt; font-weight: 700; padding: 4pt 8pt 4pt 0; background: #ffffff !important; color: #111827; letter-spacing: 0.04em; border-bottom: 0.75pt solid #111827; text-align: left; }
  .data-table td   { font-size: 9pt; padding: 3pt 8pt 3pt 0; color: #111827; border-bottom: 0.5pt solid #e5e7eb; }

  .progress-bar    { height: 4pt; background: #e5e7eb !important; }
  .progress-fill   { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .role-dist-name  { font-size: 9pt; font-weight: 600; color: #111827; }
  .role-dist-stats { font-size: 8pt; font-weight: 500; color: #4b5563; }

  /* ══════════════════════════════════════════
     ROSTER
  ══════════════════════════════════════════ */
  /* padding-top pushes content below the position:fixed header on page 1 */
  .roster-content      { padding-top: 14mm; }
  .roster-role-heading { border-top: 0.75pt solid #d1d5db; padding-top: 8pt; font-size: 11pt; font-weight: 700; color: #111827; }
  .roster-phone        { font-size: 9pt !important; font-weight: 600; color: #1d4ed8; }
  .roster-email        { font-size: 9pt; color: #6b7280; }

}
