/* ============================================
   UTU CSS VARIABLES & RESET
   ============================================ */
:root {
  /* Brand colors */
  --obsidian: #0D0C0A;
  --tablet: #1F1C17;
  --solar-gold: #E9A23F;
  --bone: #E8E2D6;
  --ash: #8A8278;
  --gold-light: #F2B45C;
  --clay: #8B4A2F;

  /* Functional mapping */
  --bg-darkest: #0D0C0A;
  --bg-dark: #161410;
  --bg-panel: #1F1C17;
  --bg-card: #262219;
  --bg-elevated: #2E2A21;
  --bg-hover: #332E24;
  --border-subtle: #2E2A21;
  --border-medium: #3D372C;
  --text-primary: #E8E2D6;
  --text-secondary: #8A8278;
  --text-muted: #5E584E;
  --accent: #E9A23F;
  --accent-glow: color-mix(in srgb, var(--accent) 15%, transparent);
  --accent-bright: #F2B45C;
  --shift-lead-tint: color-mix(in srgb, #E9A23F 4%, transparent);
  --shift-lead-tint-hover: color-mix(in srgb, #E9A23F 8%, transparent);
  --btn-primary-bg: var(--solar-gold);
  --btn-primary-hover: var(--gold-light);
  --btn-primary-text: var(--obsidian);
  --green-success: #5E8C61;
  --green-bg: rgba(94, 140, 97, 0.08);
  --red-alert: #C0392B;
  --red-bg: rgba(192, 57, 43, 0.10);
  --overtime-red: #C0392B;
  --border: var(--border-subtle);
  --bg-base: var(--bg-panel);
  --error: var(--red-alert);
  --swap-blue: #42a5f5;
  --swap-blue-rgb: 66, 165, 245;

  /* Manager schedule */
  --mgr-shift-bg: rgba(38, 166, 154, 0.10);
  --mgr-shift-border: rgba(38, 166, 154, 0.25);
  --mgr-shift-accent: #26A69A;
  --na-purple: #7E57C2;
  --na-purple-bg: rgba(126, 87, 194, 0.08);
  --na-purple-border: rgba(126, 87, 194, 0.25);
  --partial-amber: #ffb74d;
  --partial-amber-bg: rgba(255, 183, 77, 0.08);
  --yellow-lead: #FFF9C4;
  --yellow-lead-bg: rgba(255, 249, 196, 0.10);
  --rto-red: #C0392B;
  --rto-red-bg: rgba(192, 57, 43, 0.08);
  --red-glow: rgba(192, 57, 43, 0.15);
  --red-bright: #E24B4A;

  /* Position colors — muted, purposeful */
  --pos-box-office: #7B6B9E;
  --pos-concession: #5E8C7A;
  --pos-usher: #6B8BAE;
  --pos-lobby: #AE6B7B;

  /* Layout */
  --sidebar-width: 250px;
  --header-height: 56px;

  /* Shape — sharp, architectural */
  --radius-sm: 2px;
  --radius-md: 2px;
  --radius-lg: 2px;

  /* Week-state/header accent — separate from the general app accent (--accent)
     because red-accent chains must keep red reserved for RTO + the live-week
     cue. Overridden at login by the chain's theme.brandAccent (auth.js
     _applyThemeVars). Static fallback for empty-theme chains reuses the
     palette's cool blue so it can never collide with the red cue. */
  --brand-accent: var(--swap-blue);
  --brand-accent-soft: color-mix(in srgb, var(--brand-accent) 16%, transparent);
  --brand-accent-line: color-mix(in srgb, var(--brand-accent) 48%, transparent);
  --brand-accent-text: color-mix(in srgb, var(--brand-accent) 55%, var(--bone));

  /* Management-schedule page accent — per-chain themed frame distinguishing
     the manager grid from the staff schedule. Overridden at login by the
     chain's theme.mgmtAccent (auth.js _applyThemeVars) — kept on its own key
     rather than theme.accent, since theme.accent also overwrites --solar-gold
     itself. The literal #E9A23F below (not var(--solar-gold)) is deliberate:
     theme.accent overwrites --solar-gold at runtime, and --mgmt-accent must
     not inherit a chain's primary accent as its default — a chain with no
     theme.mgmtAccent must always get the default amber, regardless of theme.accent.
     Screen only — reset in @media print. */
  --mgmt-accent: #E9A23F;

  /* DATE-CLARITY week states. NEXT week = boldest, derived from the brand
     accent. Red is reserved for RTO and the live-week cue only. */
  --week-next: var(--brand-accent);
  --week-live: var(--red-bright);
  --week-live-soft: color-mix(in srgb, var(--week-live) 16%, transparent);
  --week-live-line: color-mix(in srgb, var(--week-live) 48%, transparent);
  --week-past: var(--text-muted);
  --week-past-bg: var(--bg-elevated);
  --danger: var(--red-alert);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 15px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: 'Instrument Sans', sans-serif;
  background: var(--bg-darkest);
  color: var(--text-primary);
  min-height: 100vh;
  overflow: hidden;
}

/* ============================================
   LOGIN SCREEN
   ============================================ */
.login-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg-darkest, var(--obsidian));
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
.login-overlay.hidden {
  opacity: 0; visibility: hidden; pointer-events: none;
}

.login-card {
  width: 380px; max-width: 90vw;
  text-align: center;
}

.login-brand {
  margin-bottom: 48px;
}
.login-chain-logo {
  max-height: 220px;
  max-width: 360px;
  width: 100%;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}
.login-brand h1 {
  font-family: 'Cinzel', serif;
  font-size: 2.8rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--bone);
  line-height: 1;
  margin-bottom: 8px;
}
.login-brand .tagline {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--ash);
  letter-spacing: 0.14em;
  text-transform: lowercase;
}

.login-form {
  background: var(--tablet);
  border: 1px solid var(--border-subtle);
  padding: 32px 28px;
}

.login-form .form-group {
  text-align: left;
  margin-bottom: 18px;
}
.login-form .form-label {
  display: block;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ash);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.login-form .form-input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-darkest);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.15s ease;
}
.login-form .form-input::placeholder {
  color: var(--text-muted);
}
.login-form .form-input:focus {
  border-color: var(--accent, var(--solar-gold));
}

.login-btn {
  width: 100%;
  padding: 12px;
  margin-top: 6px;
  background: var(--btn-primary-bg, var(--solar-gold));
  border: none;
  color: var(--obsidian);
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s ease;
}
.login-btn:hover {
  background: var(--btn-primary-hover, var(--gold-light));
}

.login-footer {
  margin-top: 16px;
}
.login-footer a {
  font-size: 0.78rem;
  color: var(--ash);
  text-decoration: none;
  transition: color 0.15s ease;
}
.login-footer a:hover {
  color: var(--bone);
}

.login-error {
  color: var(--clay);
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  margin-top: 12px;
  min-height: 1.2em;
}

/* ============================================
   APP SHELL
   ============================================ */
.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: var(--header-height) 1fr;
  grid-template-areas: "sidebar header" "sidebar main";
  height: 100vh; width: 100vw;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  grid-area: sidebar;
  background: var(--bg-dark);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

/* UTU bug — small, top */
.sidebar-utu {
  padding: 12px 16px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-utu .utu-mark {
  font-family: 'Cinzel', serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--solar-gold);
  opacity: 0.7;
}
.sidebar-utu .utu-divider {
  width: 1px;
  height: 12px;
  background: var(--border-subtle);
}
.sidebar-utu .utu-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}
.chain-brand {
  align-items: center;
}
.chain-logo-img {
  max-height: 120px;
  max-width: 180px;
  width: 100%;
  object-fit: contain;
  display: block;
}
.sidebar-utu .utu-version {
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* Theater identity */
.sidebar-theater {
  padding: 10px 20px 18px;
  border-bottom: 1px solid var(--border-subtle);
}
.theater-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 8px 10px;
  margin: 0 -10px;
  transition: background 0.15s ease;
}
.theater-selector:hover {
  background: var(--bg-hover);
}
.theater-logo {
  width: 32px; height: 32px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--ash);
}
.theater-info {
  flex: 1;
  min-width: 0;
}
.theater-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.theater-meta {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 1px;
}
.theater-chevron {
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.15s ease;
}
.theater-selector:hover .theater-chevron {
  color: var(--ash);
}

/* Theater dropdown */
.theater-dropdown {
  display: none;
  margin-top: 6px;
  background: var(--bg-panel);
  border: 1px solid var(--border-medium);
}
.theater-dropdown.open {
  display: block;
}
.theater-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.1s ease;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.theater-option:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.theater-option.active {
  color: var(--solar-gold);
  background: var(--accent-glow);
}
.theater-option .opt-logo {
  width: 24px; height: 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: center;
  font-family: 'DM Mono', monospace;
  font-size: 0.58rem;
  color: var(--ash);
  flex-shrink: 0;
}
.theater-option .opt-name {
  flex: 1;
  font-weight: 500;
}

/* Navigation */
.sidebar-nav {
  flex: 1;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.nav-section-label {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  padding: 18px 10px 7px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.12s ease;
  font-size: 0.88rem;
  font-weight: 500;
  user-select: none;
}
.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.nav-item.active {
  background: var(--accent-glow);
  color: var(--solar-gold);
  font-weight: 600;
}
.nav-item.active .nav-icon {
  color: var(--solar-gold);
  opacity: 1;
}
.nav-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  opacity: 0.6;
}

/* Sidebar footer — user */
.sidebar-user {
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-user-avatar {
  width: 30px; height: 30px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-medium);
  display: flex; align-items: center; justify-content: center;
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--ash);
  flex-shrink: 0;
}
.sidebar-user-info {
  flex: 1;
  min-width: 0;
}
.sidebar-user-name {
  font-size: 0.80rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.sidebar-logout {
  padding: 5px 10px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  transition: all 0.15s;
}
.sidebar-logout:hover {
  border-color: var(--clay);
  color: var(--clay);
}

/* ============================================
   HEADER
   ============================================ */
.header {
  grid-area: header;
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.header-page-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.header-week {
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  color: var(--ash);
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
  grid-area: main;
  background: var(--bg-darkest);
  overflow: auto;
  padding: 24px;
}
/* Schedule pages reclaim the content-area gutter — scoped so Day Sheets,
   Roster, Availability, RTO, and Settings keep the standard 24px padding */
.main-content:has(> #page-staff-schedule.active),
.main-content:has(> #page-mgr-schedule.active) {
  padding: 12px 10px;
}

/* Page sections */
.page-section {
  display: none;
}
.page-section.active {
  display: block;
  animation: fadeIn 0.25s ease;
}
/* Management schedule page frame — Solar Gold visual distinction, ID-scoped so
   it can never reach #page-staff-schedule (both share .page-section and
   .schedule-container). Screen only: reset in the @media print block. */
#page-mgr-schedule {
  border-top: 6px solid var(--mgmt-accent);
  border-left: 2px solid var(--mgmt-accent);
  border-right: 2px solid var(--mgmt-accent);
  border-bottom: 2px solid var(--mgmt-accent);
  border-radius: 0;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Placeholder pages */
.placeholder-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  text-align: center;
  color: var(--text-muted);
}
.placeholder-page .ph-icon {
  width: 48px; height: 48px;
  margin-bottom: 20px;
  opacity: 0.25;
  color: var(--ash);
}
.placeholder-page .ph-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.placeholder-page .ph-desc {
  font-size: 0.82rem;
  max-width: 360px;
  line-height: 1.55;
  color: var(--text-muted);
}

/* ============================================
   SETTINGS PAGE
   ============================================ */
.settings-page {
  max-width: 860px;
  animation: fadeIn 0.25s ease;
}
.settings-section {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  margin-bottom: 20px;
  overflow: hidden;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card);
}
.section-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-icon {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.section-icon svg {
  width: 18px; height: 18px;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.section-icon.gold { color: var(--solar-gold); background: var(--accent-glow); }
.section-icon.green { color: var(--green-success); background: var(--green-bg); }
.section-icon.blue { color: var(--pos-usher); background: rgba(107, 139, 174, 0.12); }
.section-icon.purple { color: var(--pos-box-office); background: rgba(123, 107, 158, 0.12); }
.section-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}
.section-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.section-body {
  padding: 20px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-grid.cols-1 { grid-template-columns: 1fr; }
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group.full-width { grid-column: 1 / -1; }
.form-label {
  display: block;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ash);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.form-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-darkest);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.15s ease;
}
.form-input::placeholder { color: var(--text-muted); }
.form-input:focus { border-color: var(--solar-gold); }
.form-input.mono {
  font-family: 'DM Mono', monospace;
  text-align: center;
}
.form-hint {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
}
select.form-input {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%238A8278' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
select.form-input option { background: var(--bg-dark); color: var(--text-primary); }

/* Positions list */
.positions-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.position-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-darkest);
  border: 1px solid var(--border-subtle);
  transition: border-color 0.15s;
}
.position-row:hover { border-color: var(--border-medium); }
.position-color-swatch {
  width: 14px; height: 14px;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
}
.position-color-swatch input[type="color"] {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0; cursor: pointer;
  border: none; padding: 0;
}
.position-name-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  outline: none;
}
.position-name-input::placeholder { color: var(--text-muted); }
.position-order {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  color: var(--text-muted);
  min-width: 20px;
  text-align: center;
}
.position-drag {
  cursor: grab;
  color: var(--text-muted);
  opacity: 0.4;
  transition: opacity 0.15s;
}
.position-row:hover .position-drag { opacity: 0.7; }
.position-remove {
  width: 24px; height: 24px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}
.position-remove:hover {
  color: var(--clay);
  border-color: rgba(139, 74, 47, 0.3);
  background: rgba(139, 74, 47, 0.08);
}
.position-remove svg {
  width: 12px; height: 12px;
  stroke: currentColor; fill: none;
  stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
}
.add-position-btn {
  display: flex; align-items: center; gap: 6px;
  margin-top: 8px;
  padding: 8px 16px;
  background: transparent;
  border: 1px dashed var(--border-medium);
  color: var(--ash);
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.add-position-btn:hover {
  border-color: var(--solar-gold);
  color: var(--solar-gold);
  background: var(--accent-glow);
}

/* Times grid — 7 day columns */
.times-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.time-day-cell {
  background: var(--bg-darkest);
  border: 1px solid var(--border-subtle);
  padding: 10px 6px;
  text-align: center;
  transition: border-color 0.15s;
}
.time-day-cell:hover { border-color: var(--border-medium); }
.time-day-cell .cell-day {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.time-day-cell .cell-date {
  display: block;
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.time-day-cell .form-input {
  text-align: center;
  padding: 8px 4px;
  font-family: 'DM Mono', monospace;
  font-size: 0.82rem;
}
.time-day-cell.weekend { border-color: color-mix(in srgb, var(--accent) 20%, transparent); background: color-mix(in srgb, var(--accent) 3%, transparent); }
.time-day-cell.weekend .cell-day { color: var(--solar-gold); }

.ampm-toggle {
  display: flex;
  justify-content: center;
  gap: 2px;
  margin-top: 4px;
}
.ampm-btn {
  padding: 3px 7px;
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  font-weight: 700;
  border: 1px solid var(--border-subtle);
  background: var(--bg-dark);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.04em;
}
.ampm-btn:hover { border-color: var(--border-medium); color: var(--text-secondary); }
.ampm-btn.active {
  background: rgba(94, 140, 97, 0.15);
  border-color: rgba(94, 140, 97, 0.4);
  color: var(--green-success);
}

.times-section-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.times-section-label .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
}
.times-section-label.staff { color: var(--pos-usher); }
.times-section-label.staff .dot { background: var(--pos-usher); }
.times-section-label.mgr { color: var(--pos-box-office); }
.times-section-label.mgr .dot { background: var(--pos-box-office); }
.times-group { margin-bottom: 20px; }
.times-group:last-child { margin-bottom: 0; }
.copy-across-btn {
  padding: 5px 12px;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(94, 140, 97, 0.3);
  background: rgba(94, 140, 97, 0.08);
  color: var(--green-success);
  transition: all 0.15s;
  white-space: nowrap;
}
.copy-across-btn:hover {
  background: rgba(94, 140, 97, 0.15);
  border-color: rgba(94, 140, 97, 0.5);
}
.times-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  width: 38px; height: 20px;
  cursor: pointer;
  display: inline-block;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
  position: absolute; inset: 0;
  background: var(--border-medium);
  transition: background 0.2s;
}
.toggle-switch input:checked + .toggle-track { background: var(--green-success); }
.toggle-knob {
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: var(--bone);
  transition: transform 0.2s;
  pointer-events: none;
}
.toggle-switch input:checked ~ .toggle-knob { transform: translateX(18px); }
.toggle-switch input:disabled + .toggle-track { opacity: 0.35; cursor: not-allowed; }
.toggle-switch input:disabled ~ .toggle-knob { opacity: 0.35; }

.rule-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.rule-row:last-child { border-bottom: none; }
.rule-info { flex: 1; }
.rule-name {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
}
.rule-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.4;
}
.rule-control {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.rule-control .form-input {
  width: 80px;
  text-align: center;
  padding: 8px 10px;
  font-family: 'DM Mono', monospace;
  font-size: 0.85rem;
}

/* ============================================
   SCHEDULE GRID STYLES
   ============================================ */
/* No outer frame — each zone (context bar, key, legend, grid, summary) is its
   own bordered block on the page background, using the full available width */
.schedule-container {
  background: transparent;
  border: none;
  overflow: visible;
  animation: fadeIn 0.3s ease;
}
/* Context bar — single row: week nav · state pill · today block · actions.
   Left stripe is colored by the viewed week's temporal state. */
.schedule-toolbar {
  display: flex; align-items: center; justify-content: flex-start;
  padding: 9px 14px;
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--border-medium);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  flex-wrap: wrap; gap: 14px;
}
.schedule-toolbar.wk-live { border-left-color: var(--week-live); }
.schedule-toolbar.wk-next { border-left-color: var(--week-next); }
.schedule-toolbar.wk-past { border-left-color: var(--week-past); }
.schedule-toolbar.wk-future { border-left-color: var(--brand-accent-line); }
.schedule-toolbar-left { display: flex; align-items: center; gap: 14px; }
.schedule-toolbar-right { display: flex; align-items: center; gap: 6px; }
.schedule-toolbar .btn { font-size: 12px; font-weight: 600; padding: 6px 10px; }
.schedule-toolbar .btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.schedule-toolbar .btn:hover { border-color: var(--brand-accent-line); }
/* Loud tier — Print / Email: soft accent tint, not solid fill */
.schedule-toolbar .btn-primary {
  background: var(--brand-accent-soft);
  border-color: var(--brand-accent-line);
  color: var(--brand-accent-text);
}
.schedule-toolbar .btn-primary:hover { background: var(--brand-accent-soft); color: var(--text-primary); }
/* Quiet tier */
.btn-quiet {
  background: var(--bg-elevated);
  border-color: var(--border-subtle);
  color: var(--text-muted);
}
.btn-quiet:hover { background: var(--bg-hover); color: var(--text-secondary); }
/* Set-apart destructive tier — Clear week */
.schedule-toolbar .btn-danger {
  background: transparent;
  border-color: color-mix(in srgb, var(--danger) 32%, transparent);
  color: color-mix(in srgb, var(--danger) 60%, var(--text-muted));
}
.schedule-toolbar .btn-danger:hover {
  background: color-mix(in srgb, var(--danger) 13%, transparent);
  border-color: var(--danger);
  color: color-mix(in srgb, var(--danger) 75%, var(--bone));
}
.toolbar-sep { width: 1px; height: 22px; background: var(--border-subtle); flex-shrink: 0; margin: 0 3px; }

/* State pill — sits beside the week navigator */
.week-state-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
  white-space: nowrap;
}
.week-state-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
/* Refused week-level controls while a week is locked (Copy prev, Clear week,
   First Show / close-time selects, day-note textareas). Appearance only —
   deliberately NO pointer-events:none and no native `disabled`, because both
   swallow the click and the user is left with a grey control and no
   explanation. The click must reach the handler so the lock message can say
   why. Scoped to .is-disabled, which only the lock code sets, so no other
   control in the app changes appearance. No new tokens. */
.is-disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Lock/Unlock button, locked state — button state only, no new component.
   Makes a locked week readable at a glance before anything is clicked. */
#ss_lockToggle.is-locked {
  background: var(--partial-amber-bg);
  color: var(--partial-amber);
  border-color: var(--partial-amber);
  opacity: 1;
}
.week-state-pill.wk-next {
  background: var(--brand-accent-soft);
  color: var(--week-next);
  border-color: var(--brand-accent-line);
}
.week-state-pill.wk-live {
  background: var(--week-live-soft);
  color: var(--week-live);
  border-color: var(--week-live-line);
}
.week-state-pill.wk-live .dot { animation: wk-onair 1.6s ease-in-out infinite; }
.week-state-pill.wk-past {
  background: var(--week-past-bg);
  color: var(--week-past);
  border-color: var(--border-medium);
}
.week-state-pill.wk-future {
  background: transparent;
  color: var(--brand-accent-text);
  border-color: var(--border-medium);
}

/* Today block — anchored right, before the actions */
.today-block {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  padding-right: 12px; margin-right: 2px;
  border-right: 1px solid var(--border-subtle);
}
.today-block .tl {
  font-size: 10px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .5px;
}
.today-block .tv {
  font-size: 13px; font-weight: 700; color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.today-block .today-rel { font-size: 11px; font-weight: 600; color: var(--text-muted); line-height: 1.25; }
.schedule-toolbar.wk-live .today-rel { color: var(--week-live); }
.schedule-toolbar.wk-next .today-rel { color: var(--week-next); }
.close-times-display { display: flex; gap: 16px; font-size: 0.78rem; color: var(--text-muted); }
.close-time-item { display: flex; align-items: center; gap: 5px; }
.close-time-item .label { color: var(--text-muted); }
.close-time-item .value { color: var(--text-secondary); font-weight: 500; font-family: 'DM Mono', monospace; }
.week-navigator { display: flex; align-items: center; gap: 6px; }
.week-nav-btn {
  background: var(--bg-elevated); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  width: 29px; height: 29px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; font-size: 15px;
}
.week-nav-btn:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--brand-accent-line); }
.week-range {
  font-family: 'DM Mono', monospace;
  font-size: 1rem; font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  padding: 8px 18px;
  min-width: 240px; text-align: center;
  letter-spacing: 0.02em;
}
.week-range-wrap { display: flex; align-items: center; }
.week-indicator-block {
  display: flex; flex-direction: column; align-items: center;
  flex: 1; gap: 3px;
}
.week-range-label {
  font-family: 'Instrument Sans', sans-serif;
  font-variant-numeric: tabular-nums;
  font-size: 19px; font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
@keyframes wk-onair {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}
/* .week-badge states still used by the RTO week views (rto.js) */
.week-badge {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 700;
  padding: 2px 9px; border-radius: 3px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.week-badge.badge-current {
  background: var(--week-live-soft);
  color: var(--week-live);
  border: 1px solid var(--week-live-line);
}
.week-badge.badge-past {
  background: var(--week-past-bg);
  color: var(--week-past);
}
.week-badge.badge-future {
  background: transparent;
  color: var(--brand-accent-text);
  border: 1px solid var(--border-medium);
}
.color-legend {
  display: flex; align-items: center; gap: 14px;
  padding: 6px 12px;
  margin-top: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-panel);
  font-size: 0.72rem; color: var(--text-muted);
  overflow-x: auto; flex-wrap: wrap;
}

/* Day-column headers — day/date, open pill, close pill, weather all live
   INSIDE the grid's own header row (2-zone header, no detached strips) */
.schedule-table .dhead {
  display: flex; align-items: baseline; justify-content: center; gap: 4px;
  margin-bottom: 6px;
}
.schedule-table thead th.wet { background: color-mix(in srgb, var(--wx-blue) 7%, var(--bg-card)); }
.h-stub-labels {
  display: flex; flex-direction: column; justify-content: center; gap: 8px;
}
.h-stub-labels .rl {
  font-size: 9.5px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; color: var(--text-muted);
}
.h-stub-labels .rl.rl-open { color: var(--brand-accent-text); }
.oc { display: flex; justify-content: center; margin-bottom: 3px; }
.tpill {
  font-family: 'Instrument Sans', sans-serif;
  font-variant-numeric: tabular-nums;
  font-size: 12px; font-weight: 600; color: var(--text-primary);
  padding: 1px 7px;
  border: 1px solid var(--border-medium); border-radius: var(--radius-sm);
  background: var(--bg-panel);
  min-width: 62px; text-align: center;
  letter-spacing: normal; text-transform: none;
}
.oc.open .tpill {
  border-color: var(--brand-accent-line);
  color: var(--brand-accent-text);
}
/* Management grid's First Show mirror — display only, not a control */
.tpill-readonly {
  border-style: dashed;
  cursor: default;
  opacity: 0.85;
}
select.close-time-select,
select.first-show-select {
  -webkit-appearance: none; appearance: none;
  cursor: pointer; outline: none; text-align-last: center;
  color-scheme: dark;
}
.schedule-table thead th .wx {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  margin-top: 5px; padding-top: 5px;
  border-top: 1px solid var(--border-subtle);
  font-size: 11px; font-weight: 600; min-height: 20px;
  text-transform: none; letter-spacing: normal;
  font-variant-numeric: tabular-nums;
}
.wx svg { width: 14px; height: 14px; flex-shrink: 0; stroke: currentColor; fill: none; }
.wx.clear { color: var(--wx-sun); }
.wx.rain { color: var(--wx-blue); }
.wx.partly { color: var(--text-secondary); }
.wx .pct { font-weight: 700; }
.legend-item { display: flex; align-items: center; gap: 5px; }
.legend-swatch { width: 10px; height: 10px; flex-shrink: 0; }
.color-legend .caps {
  font-size: 10px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; color: var(--text-muted);
}
.lg-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

.schedule-scroll {
  overflow-x: auto; overflow-y: auto;
  max-height: calc(100vh - var(--header-height) - 190px);
  margin-top: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-panel);
}
.schedule-table {
  width: 100%; border-collapse: collapse;
  min-width: 960px; table-layout: fixed;
}
.schedule-table col.col-employee { width: 150px; }
.schedule-table col.col-day { width: auto; }
.schedule-table col.col-hours { width: 52px; }
.schedule-table thead th {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg-card);
  border-bottom: 2px solid var(--border-medium);
  border-right: 1px solid var(--border-subtle);
  padding: 8px 6px;
  text-align: center;
  vertical-align: top;
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}
.schedule-table thead th:last-child { border-right: none; vertical-align: middle; font-size: 9.5px; letter-spacing: .5px; color: var(--text-muted); }
.schedule-table thead th:first-child { text-align: left; padding-left: 16px; vertical-align: middle; }
.schedule-table .th-day-name { font-size: 12px; font-weight: 700; color: var(--text-primary); letter-spacing: .3px; }
.schedule-table .th-day-date {
  font-family: 'Instrument Sans', sans-serif;
  font-variant-numeric: tabular-nums;
  font-size: 11px; font-weight: 500;
  color: var(--text-secondary);
  text-transform: none; letter-spacing: normal;
}
.schedule-table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.1s;
}
.schedule-table tbody tr:hover { background: var(--bg-hover); }
.schedule-table tbody tr.shift-lead { background: var(--shift-lead-tint); }
.schedule-table tbody tr.shift-lead:hover { background: var(--shift-lead-tint-hover); }
.schedule-table td {
  padding: 8px 6px;
  vertical-align: middle; font-size: 0.88rem;
}
.schedule-table td:first-child { padding-left: 16px; }
.employee-name {
  font-weight: 600; color: var(--text-primary);
  white-space: nowrap; font-size: 12.5px;
}
.employee-name-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
}
.employee-name-wrap .employee-name {
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Staff schedule grid name cell — two lines (ss-name-*)
   Line 1: the name, full cell width, ellipsis only if the name alone is too
   long. Line 2: role pills then cert pips, slightly smaller than elsewhere.
   Line 2 is a fixed-height row rendered in EVERY employee row (empty or not)
   so all rows share one height; day cells center via the td's existing
   vertical-align: middle. Scoped to #ss_scheduleGrid on purpose — the staff
   roster shares .employee-name-wrap and the manager grid shares
   .schedule-table / .employee-name, and neither changes. Row tints are inline
   per role and untouched. No new colors. */
#ss_scheduleGrid col.col-employee { width: 176px; }  /* fits BAR LEAD + 21+ AC TIPS */
#ss_scheduleGrid tbody td:first-child { padding-top: 6px; padding-bottom: 6px; }
#ss_scheduleGrid .ss-name-stack {
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
}
#ss_scheduleGrid .ss-name-stack .employee-name {
  display: block;
  line-height: 15px;
}
#ss_scheduleGrid .ss-name-badges {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 14px;
  min-height: 14px;
  white-space: nowrap;
  overflow: hidden;   /* safety-net clip: never wraps, never changes row height */
}
#ss_scheduleGrid .ss-name-badges .cert-pips { margin-left: 0; gap: 3px; }
#ss_scheduleGrid .ss-name-badges .role-badge { font-size: 0.52rem; padding: 1px 4px; line-height: 1.2; }
#ss_scheduleGrid .ss-name-badges .cert-pip   { font-size: 0.5rem;  padding: 0 3px;   line-height: 1.2; }
.role-badge {
  flex-shrink: 0;
}
.cert-pips {
  display: inline-flex;
  gap: 3px;
  margin-left: 4px;
  flex-shrink: 0;
}
.cert-pip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Mono', monospace;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 1px 4px;
  background: rgba(94, 140, 97, 0.10);
  border: 1px solid rgba(94, 140, 97, 0.25);
  color: var(--green-success);
  white-space: nowrap;
}

/* Cert editor rows */
.cert-row {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border-subtle);
  background: var(--bg-darkest);
  transition: border-color 0.15s;
}
.cert-row:hover { border-color: var(--border-medium); }
.cert-row-main {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
}
.cert-color-swatch {
  width: 14px; height: 14px;
  flex-shrink: 0;
  position: relative;
}
.cert-color-swatch input[type="color"] {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0; cursor: pointer;
  border: none; padding: 0;
}
.cert-expand-icon {
  width: 16px; height: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.15s, color 0.15s;
}
.cert-row.expanded .cert-expand-icon { transform: rotate(90deg); color: var(--text-secondary); }
.cert-row-detail {
  display: none;
  padding: 0 14px 14px;
  gap: 10px;
}
.cert-row.expanded .cert-row-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.cert-row-detail .form-group { margin-bottom: 0; }
.cert-row-detail .form-input {
  padding: 8px 10px;
  font-size: 0.82rem;
}
.cert-row-detail .form-label {
  font-size: 0.65rem;
  margin-bottom: 4px;
}
.cert-preview-pip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 4px;
}
.shift-cell {
  text-align: center; cursor: pointer;
  transition: background 0.1s; position: relative;
}
.shift-cell:hover { background: rgba(255,255,255, 0.03); }
/* Shifts render as colored TEXT in the position color — no chip/box background */
.shift-block {
  display: inline-flex; align-items: center;
  font-family: 'Instrument Sans', sans-serif;
  font-variant-numeric: tabular-nums;
  font-size: 12.5px; font-weight: 700;
  letter-spacing: .1px;
  padding: 2px 4px;
  white-space: nowrap;
}
.shift-cell.off {
  color: var(--border-medium); font-size: 14px;
}
.hours-cell {
  text-align: center;
  font-family: 'Instrument Sans', sans-serif;
  font-variant-numeric: tabular-nums;
  font-size: 12px; font-weight: 700;
  color: var(--text-secondary);
}
/* Overtime is a WARNING value, not header chrome — it stays red by design,
   alongside RTO and the live-week cue (deliberate exception to "red off the
   grid", which applies to shift text only) */
.hours-cell.warning { color: var(--gold-light); }
.hours-cell.overtime { color: var(--overtime-red); }

/* RTO conflict on schedule grid */
.rto-conflict { border: 1.5px solid var(--rto-red) !important; background: rgba(192, 57, 43, 0.06); position: relative; }
.rto-conflict-badge { position: absolute; top: 3px; right: 4px; font-size: .6rem; font-weight: 700; color: var(--rto-red); background: rgba(192, 57, 43, 0.18); padding: 1px 5px; letter-spacing: .04em; }
.avail-conflict { background: rgba(255,183,77,0.06); }
/* Partial-availability marker — amber italic text on a plain cell */
.avail-note-mark {
  display: block; text-align: center; line-height: 1.2;
  color: var(--partial-amber);
  font-size: 11px; font-weight: 600; font-style: italic;
  font-variant-numeric: tabular-nums;
}
/* RTO — soft two-tone diagonal hatch + lock icon, not a solid red slab */
.rto-cell {
  background: repeating-linear-gradient(135deg,
    color-mix(in srgb, var(--danger) 7%, transparent) 0 5px,
    color-mix(in srgb, var(--danger) 14%, transparent) 5px 10px);
  text-align: center;
}
.rto-cell .rto-text {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .6px;
  color: color-mix(in srgb, var(--danger) 62%, var(--bone));
}
.rto-cell .rto-text svg { width: 11px; height: 11px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2; }

/* RTO warning inside shift modal */
.shift-rto-warning { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--rto-red-bg); border: 1px solid rgba(192, 57, 43, 0.2); font-size: .82rem; color: var(--rto-red); margin-bottom: 16px; }
.shift-rto-warning svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; flex-shrink: 0; }
.schedule-table tfoot td {
  position: sticky; bottom: 0; z-index: 10;
  background: var(--bg-card);
  border-top: 2px solid var(--border-medium);
  padding: 10px 8px; text-align: center;
}
.schedule-table tfoot td:first-child {
  text-align: left; padding-left: 16px;
  font-weight: 700; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.72rem;
}
.daily-total-hours {
  display: block;
  font-family: 'Instrument Sans', sans-serif;
  font-variant-numeric: tabular-nums;
  font-weight: 700; font-size: 14px;
  color: var(--text-primary);
}
/* Grand total — accent, per mockup */
.schedule-table tfoot td:last-child .daily-total-hours { color: var(--brand-accent-text); }
.daily-total-count {
  display: block; font-size: 0.68rem; font-weight: 400;
  color: var(--text-muted); margin-top: 2px;
}
.summary-bar {
  display: flex; align-items: center; gap: 24px;
  padding: 10px 18px;
  margin-top: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 0.78rem;
}
.summary-stat { display: flex; align-items: center; gap: 5px; }
.summary-stat .label { color: var(--text-muted); font-weight: 400; }
.summary-stat .value { color: var(--text-primary); font-weight: 600; font-family: 'Instrument Sans', sans-serif; font-variant-numeric: tabular-nums; }
.shift-hours-preview {
  font-family: 'DM Mono', monospace;
  font-size: 0.82rem; color: var(--solar-gold); font-weight: 600;
}

/* Manager schedule shifts — colored text, no chip/box background */
.mgr-shift-block {
  display: inline-flex; flex-direction: column; align-items: center;
  padding: 2px 4px;
  background: none; border: none;
  white-space: nowrap;
}
.mgr-shift-time {
  font-family: 'Instrument Sans', sans-serif;
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem; font-weight: 600; color: var(--mgr-shift-accent);
}
.mgr-shift-task {
  font-size: 0.65rem; font-weight: 600;
  color: var(--mgr-shift-accent);
  text-transform: uppercase; letter-spacing: 0.04em; margin-top: 1px;
  font-family: 'Instrument Sans', sans-serif;
}
/* GM row dimmed */
.schedule-table tbody tr.gm-row { opacity: 0.45; }
.schedule-table tbody tr.gm-row:hover { opacity: 0.7; }
/* N/A cells — quiet gray on a plain cell (schedule grid) */
.shift-cell.na-cell { background: none; }
.shift-cell .na-text { font-size: 11px; font-weight: 600; color: var(--text-muted); letter-spacing: 0.5px; }
/* Availability page keeps its purple treatment */
.na-text { font-size: 0.78rem; font-weight: 600; color: var(--na-purple); letter-spacing: 0.04em; }
/* Unavailable marker (empty cell marker) */
.unavailable-marker {
  display: block; width: 6px; height: 6px;
  background: var(--border-medium); margin: 0 auto;
}
/* Day notes textarea */
.ms-day-note {
  width: 100%; min-height: 48px; max-height: 120px; resize: vertical;
  background: var(--bg-dark); border: 1px solid var(--border-subtle);
  color: var(--text-primary); font-family: 'Instrument Sans', sans-serif;
  font-size: 0.72rem; padding: 6px 8px; line-height: 1.3; outline: none;
}
.ms-day-note:focus { border-color: var(--solar-gold); }
.ms-notes-row td { vertical-align: top; }
/* Copy mode banner */
.copy-mode-banner {
  display: none; align-items: center; justify-content: space-between;
  padding: 8px 18px; margin-top: 8px;
  background: color-mix(in srgb, var(--solar-gold) 8%, transparent);
  border: 1px solid var(--solar-gold); border-radius: var(--radius-sm);
  font-size: 0.78rem;
}
.copy-mode-banner.visible { display: flex; }
.copy-info { display: flex; align-items: center; gap: 8px; color: var(--solar-gold); }
.copy-info svg { width: 16px; height: 16px; stroke: var(--solar-gold); fill: none; stroke-width: 2; }
.copy-cancel {
  background: none; border: 1px solid var(--solar-gold); color: var(--solar-gold);
  padding: 4px 12px; cursor: pointer; font-size: 0.72rem;
}
.copy-cancel:hover { background: var(--accent-glow); }
.copy-source { outline: 2px solid var(--solar-gold); outline-offset: -2px; }
/* CL toggle row in modal */
.cl-toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 14px;
}
.cl-toggle-label { font-weight: 600; color: var(--text-primary); font-size: 0.88rem; }
.cl-toggle-hint { font-size: 0.68rem; color: var(--text-muted); margin-top: 2px; }

/* ============================================
   ROSTER PAGE STYLES
   ============================================ */
.roster-page { animation: fadeIn 0.3s ease; }
.search-wrap {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; background: var(--bg-darkest);
  border: 1px solid var(--border-subtle);
  min-width: 220px;
}
.search-wrap svg { width: 16px; height: 16px; stroke: var(--text-muted); fill: none; stroke-width: 2; flex-shrink: 0; }
.search-wrap .search-input,
input.search-input {
  background: none; border: none; outline: none;
  color: var(--text-primary); font-family: 'Instrument Sans', sans-serif;
  font-size: 0.85rem; width: 100%;
}
.search-wrap .search-input::placeholder,
input.search-input::placeholder { color: var(--text-muted); }
.roster-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; flex-wrap: wrap; gap: 12px;
}
.roster-toolbar-left { display: flex; align-items: center; gap: 14px; }
.roster-toolbar-right { display: flex; align-items: center; gap: 10px; }
.roster-summary {
  display: flex; gap: 16px;
}
.summary-card {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
}
.summary-card .sc-count {
  font-family: 'DM Mono', monospace;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}
.summary-card .sc-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.btn-accent {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-glow);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--solar-gold);
  padding: 8px 16px;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-accent:hover {
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
}
.roster-table-wrap {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  overflow-x: auto;
}
.roster-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
}
.roster-table thead th {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg-card);
  border-bottom: 2px solid var(--border-medium);
  padding: 12px 14px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  text-align: left;
}
.roster-table thead th.col-status,
.roster-table thead th.col-actions { text-align: center; }
.roster-table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.1s;
}
.roster-table tbody tr:hover { background: var(--bg-hover); }
.roster-table tbody tr:nth-child(even) { background: rgba(255,255,255, 0.01); }
.roster-table tbody tr:nth-child(even):hover { background: var(--bg-hover); }
.roster-table tbody tr.shift-lead { background: var(--shift-lead-tint); }
.roster-table tbody tr.shift-lead:hover { background: var(--shift-lead-tint-hover); }
.roster-table td {
  padding: 10px 14px;
  font-size: 0.88rem;
  vertical-align: middle;
}
.roster-table td.col-status,
.roster-table td.col-actions { text-align: center; }
.roster-emp-name {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  min-width: 0;
}
.roster-pos-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.roster-pos-dot {
  width: 8px; height: 8px;
  flex-shrink: 0;
}
.roster-role {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.roster-contact {
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.roster-contact a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}
.roster-contact a:hover { color: var(--solar-gold); }
.status-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 10px;
}
.status-badge.active {
  background: var(--green-bg);
  color: var(--green-success);
  border: 1px solid rgba(94, 140, 97, 0.25);
}
.status-badge.inactive {
  background: var(--red-bg);
  color: var(--red-alert);
  border: 1px solid rgba(192, 57, 43, 0.25);
}
.roster-action-btn {
  width: 28px; height: 28px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.roster-action-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-medium);
  background: var(--bg-elevated);
}
.roster-action-btn.delete:hover {
  color: var(--red-alert);
  border-color: rgba(192, 57, 43, 0.3);
  background: var(--red-bg);
}
.roster-action-btn svg {
  width: 14px; height: 14px;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* Staff Modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-panel);
  border: 1px solid var(--border-medium);
  width: 480px; max-width: 92vw;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.25s cubic-bezier(0.22, 0.68, 0, 1.2);
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}
.modal-title {
  font-size: 1rem; font-weight: 600;
  color: var(--text-primary);
}
.modal-close {
  width: 28px; height: 28px;
  background: transparent; border: none;
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; font-size: 1.1rem;
}
.modal-close:hover { color: var(--text-primary); }
.modal-body { padding: 20px; }
.modal-body .form-group { margin-bottom: 14px; }
.modal-body .form-group:last-child { margin-bottom: 0; }
.modal-body .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
}
.modal-body .form-label {
  display: block;
  font-size: 0.72rem; font-weight: 600;
  color: var(--ash);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 5px;
}
.modal-body .form-input {
  width: 100%; padding: 9px 12px;
  background: var(--bg-darkest);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.15s;
}
.modal-body .form-input:focus { border-color: var(--solar-gold); }
.modal-body select.form-input {
  cursor: pointer; -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%238A8278' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.modal-body select.form-input option { background: var(--bg-dark); color: var(--text-primary); }
.checkbox-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
}
.checkbox-row label {
  font-size: 0.85rem; color: var(--text-primary);
  cursor: pointer; user-select: none;
}
.checkbox-row input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--solar-gold);
  cursor: pointer;
}
.trained-positions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.trained-pos-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-darkest);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.trained-pos-chip:hover {
  border-color: var(--border-medium);
  color: var(--text-primary);
}
.trained-pos-chip.selected {
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  background: var(--accent-glow);
  color: var(--solar-gold);
}
.trained-pos-chip .chip-dot {
  width: 6px; height: 6px;
  flex-shrink: 0;
}
.trained-pos-chip input[type="checkbox"] {
  display: none;
}
.roster-trained-dots {
  display: flex;
  gap: 3px;
  align-items: center;
  margin-left: 6px;
}
.modal-section-label {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  margin: 16px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
}
.modal-section-label:first-child { margin-top: 0; }
.cert-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 8px;
  background: rgba(94, 140, 97, 0.08);
  border: 1px solid rgba(94, 140, 97, 0.25);
  color: var(--green-success);
  margin-left: 4px;
}
.cert-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.cert-row:last-child { border-bottom: none; }
.cert-name-input {
  flex: 1;
  background: var(--bg-darkest);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 8px 12px;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.15s;
}
.cert-name-input:focus { border-color: var(--solar-gold); }
.section-icon.teal { background: rgba(94, 140, 97, 0.12); color: var(--green-success); }
.roster-certs {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  margin-top: 2px;
}

/* Toast */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--bg-card);
  border: 1px solid var(--green-success);
  color: var(--green-success);
  padding: 12px 20px;
  font-size: 0.82rem;
  font-weight: 500;
  display: flex; align-items: center; gap: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.22, 0.68, 0, 1.2);
  z-index: 1000;
  pointer-events: none;
}
.toast.visible { transform: translateY(0); opacity: 1; }
.toast.toast-error { border-color: var(--rto-red); color: var(--rto-red); }
/* Centered variant — schedule-lock blocked-edit message only. Position/size
   variant of the same toast element, not a new component: the whole point of
   the lock is that the GM NOTICES, and a corner toast on a 1300px grid is
   missable. Inherits pointer-events:none from .toast, so it never blocks
   interaction with the page beneath it. */
.toast.toast-center {
  top: 50%; left: 50%; bottom: auto; right: auto;
  transform: translate(-50%, calc(-50% + 40px));
  max-width: min(560px, calc(100vw - 48px));
  padding: 20px 28px;
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
  justify-content: center;
}
.toast.toast-center.visible { transform: translate(-50%, -50%); opacity: 1; }

/* Confirm Modal */
.confirm-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 600;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
}
.confirm-overlay.open { opacity: 1; pointer-events: all; }
.confirm-box {
  background: var(--bg-panel);
  border: 1px solid var(--border-medium);
  width: 420px; max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.25s cubic-bezier(0.22, 0.68, 0, 1.2);
}
.confirm-overlay.open .confirm-box { transform: translateY(0) scale(1); }
.confirm-body {
  padding: 28px 24px;
  text-align: center;
}
.confirm-icon {
  font-size: 2.2rem;
  margin-bottom: 14px;
  line-height: 1;
}
.confirm-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.confirm-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.confirm-text strong {
  color: var(--clay);
  font-weight: 700;
}
.confirm-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 24px;
  border-top: 1px solid var(--border-subtle);
}
.btn-danger {
  background: rgba(139, 74, 47, 0.12);
  border: 1px solid rgba(139, 74, 47, 0.35);
  color: var(--clay);
}
.btn-danger:hover {
  background: rgba(139, 74, 47, 0.22);
  border-color: rgba(139, 74, 47, 0.5);
}

/* Special Roles list */
.roles-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.roles-list .role-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-darkest);
  border: 1px solid var(--border-subtle);
  transition: border-color 0.15s;
}
.roles-list .role-row:hover { border-color: var(--border-medium); }
.role-color-swatch {
  width: 14px; height: 14px;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
}
.role-color-swatch input[type="color"] {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0; cursor: pointer;
  border: none; padding: 0;
}
.role-name-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  outline: none;
}
.role-name-input::placeholder { color: var(--text-muted); }
.role-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.58rem;
  font-weight: 700;
  padding: 2px 5px;
  vertical-align: middle;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn {
  padding: 10px 22px;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--btn-primary-bg);
  border-color: var(--btn-primary-bg);
  color: var(--btn-primary-text);
}
.btn-primary:hover {
  background: var(--btn-primary-hover);
  border-color: var(--btn-primary-hover);
}
.btn-secondary {
  background: var(--bg-card);
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}
.btn-secondary:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* ============================================
   DAY SHEET PAGE
   ============================================ */
.ds-controls {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.ds-controls-left { display: flex; align-items: center; gap: 12px; }
.ds-controls-right { display: flex; align-items: center; gap: 12px; }
.day-selector { display: flex; gap: 4px; }
.day-tab {
  padding: 6px 14px;
  font-size: 0.82rem; font-weight: 500;
  cursor: pointer;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  transition: all 0.15s;
  font-family: 'Instrument Sans', sans-serif;
}
.day-tab:hover { color: var(--text-primary); border-color: var(--border-medium); }
.day-tab.active {
  background: var(--accent-glow);
  color: var(--solar-gold);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
  font-weight: 600;
}
.sheet-wrapper { max-width: 820px; margin: 0 auto; position: relative; z-index: 2; }

/* Management Coverage rail — screen-only, sibling of .sheet-wrapper so it
   never nests inside the printed day-sheet card. Absolutely positioned off
   .ds-sheet-row so .sheet-wrapper's own centering/width rules are untouched
   in every media, including print. */
.ds-sheet-row { position: relative; }
.ds-coverage-rail {
  position: absolute;
  top: 0;
  left: calc(50% + 410px + 24px);
  width: 260px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}
.ds-rail-header {
  padding: 10px 14px;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--solar-gold);
  border-bottom: 1px solid var(--border-subtle);
}
.ds-rail-body { padding: 6px 0; }
.ds-rail-empty {
  padding: 14px;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
}
.ds-rail-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 14px;
  border-bottom: 1px solid var(--border-subtle);
}
.ds-rail-row:last-child { border-bottom: none; }
.ds-rail-row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ds-rail-name {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ds-rail-time {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-secondary);
}
.ds-rail-badges { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.ds-rail-badge {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.56rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 1px 5px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  white-space: nowrap;
}
.ds-rail-badge-open { color: var(--solar-gold); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.ds-rail-badge-close { color: var(--mgr-shift-accent); border-color: var(--mgr-shift-border); }

@media (max-width: 1280px) {
  .ds-coverage-rail { display: none; }
}

.day-sheet {
  background: #fff; color: #111;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  font-family: 'Instrument Sans', sans-serif;
  position: relative;
}
.sheet-header {
  background: #1a1a1a; color: #fff;
  padding: 16px 22px;
  display: flex; justify-content: space-between; align-items: center;
}
.sheet-header-left h1 {
  font-family: 'Cinzel', serif;
  font-size: 1.4rem; letter-spacing: 0.12em;
  font-weight: 700; color: #fff; line-height: 1;
}
.sheet-header-left .sheet-date {
  font-size: 1rem; font-weight: 600;
  margin-top: 4px; color: #ccc;
}
.sheet-header-right {
  text-align: right; font-family: 'DM Mono', monospace;
  font-size: 0.78rem; color: #999; line-height: 1.5;
}
.sheet-columns {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
}
.sheet-col { border-right: 3px solid #333; }
.sheet-col:last-child { border-right: none; }
.col-header {
  text-align: center; font-size: 1rem; font-weight: 700;
  padding: 8px; text-transform: uppercase; letter-spacing: 0.08em;
  border-bottom: 2px solid #999;
}
.col-header.am { background: #f5f5f5; color: #333; }
.col-header.pm { background: #e8e8e8; color: #222; }
.ds-pos-section { border-bottom: 1px solid #ddd; }
.ds-pos-header {
  font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 5px 12px; color: #333;
  background: #f0f0f0;
  border-bottom: 1px solid #ddd;
  border-left: 4px solid #999;
}
.ds-emp-table { width: 100%; border-collapse: collapse; table-layout: fixed; background: #fff; }
.ds-emp-table tr { border-bottom: 1px solid #ddd; }
.ds-emp-table tr:last-child { border-bottom: none; }
.ds-emp-table td {
  padding: 5px 8px; font-size: 0.8rem; vertical-align: middle;
  background: #fff;
}
.ds-emp-table .emp-station {
  width: 28px; text-align: center; font-family: 'DM Mono', monospace;
  font-size: 0.72rem; color: #999; border-right: 1px solid #ddd;
}
.ds-emp-table .emp-name {
  font-weight: 500; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.ds-emp-table .emp-time {
  width: 130px; text-align: center;
  font-family: 'DM Mono', monospace; font-size: 0.75rem;
  white-space: nowrap; border-left: 1px solid #ddd;
}
.ds-emp-table .emp-break {
  width: 60px; text-align: center; font-size: 0.75rem;
  color: #999; border-left: 1px solid #ddd; min-height: 22px;
  background: #fff;
}
.ds-emp-table .ds-subheader-row th {
  background: #fafafa; border-bottom: 1px solid #ddd;
  font-size: 0.62rem; font-weight: 600; color: #999;
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 3px 8px; text-align: left;
}
.ds-emp-table .ds-subheader-row .sh-station { text-align: center; border-right: 1px solid #ddd; }
.ds-emp-table .ds-subheader-row .sh-station-hidden { width: 0; padding: 0; border: none; overflow: hidden; }
.ds-emp-table .ds-subheader-row .sh-time { text-align: center; border-left: 1px solid #ddd; }
.ds-emp-table .ds-subheader-row .sh-break { text-align: center; border-left: 1px solid #ddd; }
.ds-emp-table .emp-station-hidden { width: 0; padding: 0; border: none; overflow: hidden; }
.ds-emp-table tr.role-row td { background: #f9f5e0 !important; }
.ds-emp-table tr.empty-slot td { height: 26px; background: #fff !important; }

/* Cert badges (Day Sheet only — scoped here, does not touch .cert-pip/.cert-badge
   used elsewhere in the app). Border and background are per-cert, set inline from
   location_settings.certifications; text stays this fixed dark token because the
   Day Sheet is a light/white surface (.day-sheet, above) and several stored cert
   colors (e.g. #ebe51e) are unreadable as text on it. Print override below. */
.ds-cert-badges { display: inline-flex; gap: 3px; margin-left: 4px; vertical-align: middle; }
.ds-cert-badge {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'DM Mono', monospace; font-size: 0.58rem; font-weight: 700;
  letter-spacing: 0.02em; padding: 1px 4px;
  border: 1px solid #ccc; background: rgba(0, 0, 0, 0.05);
  color: #111; white-space: nowrap;
}
.sheet-footer {
  background: #f8f8f8; border-top: 2px solid #ddd;
  padding: 10px 18px; display: flex; justify-content: space-between;
  font-size: 0.75rem; color: #888;
}
.sheet-footer-stats { display: flex; gap: 18px; }
.sheet-footer-stat { display: flex; gap: 4px; }
.sheet-footer-stat .val { font-weight: 600; color: #444; }
.sheet-legend { display: flex; gap: 14px; align-items: center; font-size: 0.72rem; }

/* ============================================
   SWAP FEATURE
   ============================================ */
.btn-swap {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(var(--swap-blue-rgb),0.1); border: 1px solid rgba(var(--swap-blue-rgb),0.3);
  color: var(--swap-blue); padding: 8px 14px;
  font-family: 'Instrument Sans', sans-serif; font-size: 0.82rem; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
}
.btn-swap:hover { background: rgba(var(--swap-blue-rgb),0.2); }
.btn-swap svg { flex-shrink: 0; }
.swap-original {
  padding: 12px 16px; background: var(--bg-darkest);
  border: 1px solid var(--border-subtle); margin-bottom: 16px;
  font-size: 0.85rem; color: var(--text-secondary); line-height: 1.6;
}
.swap-original strong { color: var(--text-primary); font-weight: 600; }
.swap-divider { text-align: center; margin: 16px 0 12px; position: relative; }
.swap-divider::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--border-subtle); }
.swap-divider span { position: relative; background: var(--bg-panel); padding: 0 12px; font-size: 0.72rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.swap-badge {
  position: absolute; top: 2px; left: 3px;
  font-size: 8px; font-weight: 700; color: var(--swap-blue);
  background: rgba(var(--swap-blue-rgb),0.15); padding: 0 3px; border-radius: 1px; letter-spacing: 0.3px;
}
.swap-log-page { max-width: 820px; animation: fadeIn 0.35s ease; }
.swap-log-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 18px; border-bottom: 1px solid var(--border-subtle);
  transition: background 0.1s;
}
.swap-log-item:last-child { border-bottom: none; }
.swap-log-item:hover { background: var(--bg-hover); }
.swap-log-icon {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(var(--swap-blue-rgb),0.1); color: var(--swap-blue);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.swap-log-icon svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.swap-log-detail { flex: 1; }
.swap-log-names { font-size: 0.92rem; color: var(--text-primary); font-weight: 500; }
.swap-log-names .swap-from { color: var(--text-muted); text-decoration: line-through; }
.swap-log-names .swap-to { color: var(--swap-blue); font-weight: 600; }
.swap-log-shift { font-size: 0.82rem; color: var(--text-secondary); margin-top: 2px; }
.swap-log-meta { font-size: 0.72rem; color: var(--text-muted); margin-top: 4px; }
.swap-log-empty { text-align: center; padding: 40px 20px; color: var(--text-muted); font-size: 0.88rem; }

/* ============================================
   STAFF AVAILABILITY
   ============================================ */
.avail-page { animation: fadeIn 0.35s ease; }
.avail-info {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px;
  margin-bottom: 20px; background: var(--na-purple-bg);
  border: 1px solid var(--na-purple-border); font-size: 0.85rem; color: var(--na-purple);
}
.avail-info svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; flex-shrink: 0; }
.avail-container { background: var(--bg-panel); border: 1px solid var(--border-subtle); overflow: hidden; }
.avail-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border-subtle); background: var(--bg-card);
}
.avail-legend {
  display: flex; align-items: center; gap: 16px; padding: 8px 18px;
  border-bottom: 1px solid var(--border-subtle); background: var(--bg-panel);
  font-size: 0.75rem; color: var(--text-muted);
}
.avail-scroll { overflow-x: auto; overflow-y: auto; max-height: calc(100vh - var(--header-height) - 200px); }
.avail-table { width: 100%; border-collapse: collapse; min-width: 700px; }
.avail-table thead th {
  position: sticky; top: 0; z-index: 10; background: var(--bg-card);
  border-bottom: 2px solid var(--border-medium); padding: 12px 10px;
  text-align: center; font-size: 0.78rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-secondary);
  border-right: 1px solid var(--border-subtle);
}
.avail-table thead th:last-child { border-right: none; }
.avail-table thead th:first-child { text-align: left; padding-left: 18px; width: 200px; }
.avail-table tbody tr { border-bottom: 1px solid var(--border-subtle); transition: background 0.1s; }
.avail-table tbody tr:hover { background: var(--bg-hover); }
.avail-table tbody tr.lead-row { background: var(--yellow-lead-bg); }
.avail-table tbody tr.lead-row:hover { background: rgba(255,249,196,0.16); }
.avail-table td {
  padding: 8px 10px; vertical-align: middle; font-size: 0.88rem;
  text-align: center; border-right: 1px solid var(--border-subtle);
}
.avail-table td:last-child { border-right: none; }
.avail-table td:first-child { text-align: left; padding-left: 18px; }
.avail-table tfoot td {
  position: sticky; bottom: 0; z-index: 10; background: var(--bg-card);
  border-top: 2px solid var(--border-medium); padding: 10px;
  text-align: center; font-size: 0.78rem; font-weight: 600;
  color: var(--text-secondary); border-right: 1px solid var(--border-subtle);
}
.avail-table tfoot td:last-child { border-right: none; }
.avail-table tfoot td:first-child { text-align: left; padding-left: 18px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.avail-cell { cursor: pointer; position: relative; min-height: 36px; transition: background 0.1s; }
.avail-cell:hover { filter: brightness(1.15); }
.avail-cell.available { background: var(--green-bg); }
.avail-cell.available .avail-marker { font-size: 0.72rem; font-weight: 600; color: var(--green-success); letter-spacing: 0.04em; }
.avail-cell.not-available { background: var(--na-purple-bg); }
.avail-cell.not-available .avail-marker { font-size: 0.72rem; font-weight: 700; color: var(--na-purple); letter-spacing: 0.04em; }
.avail-cell.partial { background: var(--partial-amber-bg); }
.avail-cell.partial .avail-marker { font-size: 0.72rem; font-weight: 600; color: var(--partial-amber); }
.avail-cell.partial .avail-time { display: block; font-size: 0.65rem; color: var(--partial-amber); font-weight: 600; letter-spacing: 0.02em; }
.avail-note-cell {
  padding: 0 8px;
  vertical-align: middle;
}
.avail-note-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.72rem;
  padding: 4px 2px;
  width: 160px;
  max-width: 160px;
  outline: none;
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.avail-note-input:hover {
  border-bottom-color: var(--border);
  color: var(--text-primary);
}
.avail-note-input:focus {
  border-bottom-color: var(--accent, var(--solar-gold));
  color: var(--text-primary);
}
.avail-note-input::placeholder {
  color: var(--text-muted);
  font-style: italic;
}
.avail-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; border-top: 1px solid var(--border-subtle);
  background: var(--bg-card); font-size: 0.78rem; color: var(--text-muted);
}
.status-select { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.status-option {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px;
  background: var(--bg-darkest); border: 1px solid var(--border-subtle);
  cursor: pointer; transition: all 0.15s;
}
.status-option:hover { border-color: var(--border-medium); }
.status-option.selected-avail { border-color: rgba(94, 140, 97, 0.4); background: var(--green-bg); }
.status-option.selected-na { border-color: var(--na-purple-border); background: var(--na-purple-bg); }
.status-option.selected-partial { border-color: rgba(255, 183, 77, 0.3); background: var(--partial-amber-bg); }
.status-dot-lg { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.status-dot-lg.green { background: var(--green-success); }
.status-dot-lg.amber { background: var(--partial-amber); }
.status-dot-lg.purple { background: var(--na-purple); }
.status-option-label { font-size: 0.88rem; font-weight: 600; color: var(--text-primary); }
.status-option-hint { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.partial-fields { margin-top: 12px; padding: 14px 16px; background: var(--bg-darkest); border: 1px solid var(--border-subtle); }
.partial-fields.hidden { display: none; }
.partial-fields-label { font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 10px; }
.partial-row { display: flex; align-items: center; gap: 8px; }
.partial-row select { background: var(--bg-darkest); color: var(--text-primary); border: 1px solid var(--border-subtle); padding: 8px 10px; font-size: 0.82rem; font-family: 'Instrument Sans', sans-serif; }
.lead-star { color: var(--solar-gold); margin-left: 4px; font-size: 0.8rem; }

/* ============================================
   RTO (REQUESTS TIME OFF)
   ============================================ */
.rto-page { animation: fadeIn 0.35s ease; }
.rto-info {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px;
  margin-bottom: 20px; background: var(--rto-red-bg);
  border: 1px solid rgba(192, 57, 43, 0.2); font-size: 0.85rem; color: var(--rto-red);
}
.rto-info svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; flex-shrink: 0; }
.rto-section {
  background: var(--bg-panel); border: 1px solid var(--border-subtle); overflow: hidden; margin-bottom: 20px;
}
.rto-grid-scroll { overflow-x: auto; }
.rto-grid { width: 100%; border-collapse: collapse; min-width: 700px; }
.rto-grid thead th {
  position: sticky; top: 0; z-index: 10; background: var(--bg-card);
  border-bottom: 2px solid var(--border-medium); padding: 12px 10px;
  text-align: center; font-size: 0.78rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary);
  border-right: 1px solid var(--border-subtle);
}
.rto-grid thead th:last-child { border-right: none; }
.rto-grid thead th:first-child { text-align: left; padding-left: 18px; width: 200px; }
.rto-grid .th-day-name { display: block; font-size: 0.88rem; color: var(--text-primary); }
.rto-grid .th-day-date { display: block; font-size: 0.72rem; font-weight: 400; color: var(--text-muted); margin-top: 2px; }
.rto-grid tbody tr { border-bottom: 1px solid var(--border-subtle); transition: background 0.1s; }
.rto-grid tbody tr:hover { background: var(--bg-hover); }
.rto-grid tbody tr.lead-row { background: var(--yellow-lead-bg); }
.rto-grid td {
  padding: 8px 10px; vertical-align: middle; font-size: 0.92rem;
  text-align: center; border-right: 1px solid var(--border-subtle); cursor: pointer;
}
.rto-grid td:last-child { border-right: none; }
.rto-grid td:first-child { padding-left: 18px; text-align: left; cursor: default; }
.rto-grid tfoot td {
  background: var(--bg-card); border-top: 2px solid var(--border-medium);
  padding: 10px; text-align: center; font-size: 0.78rem; font-weight: 600;
  color: var(--text-secondary); border-right: 1px solid var(--border-subtle);
}
.rto-grid tfoot td:last-child { border-right: none; }
.rto-grid tfoot td:first-child { text-align: left; padding-left: 18px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.rto-marker {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 2px 8px; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  background: var(--rto-red-bg); color: var(--rto-red); border: 1px solid rgba(192, 57, 43, 0.25);
}
.rto-add {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 28px; color: var(--text-muted);
  opacity: 0; transition: opacity 0.15s; font-size: 1.1rem;
}
.rto-grid td:hover .rto-add { opacity: 0.5; }
.rto-type-selector { display: flex; gap: 6px; margin-bottom: 12px; }
.rto-type-btn {
  flex: 1; padding: 10px 8px; border: 1px solid var(--border-medium);
  background: var(--bg-card); color: var(--text-secondary);
  font-family: 'Instrument Sans', sans-serif; font-size: 0.82rem; font-weight: 600;
  cursor: pointer; text-align: center; transition: all 0.15s;
}
.rto-type-btn.active { border-color: var(--rto-red); background: var(--rto-red-bg); color: var(--rto-red); }
.rto-type-btn:hover:not(.active) { background: var(--bg-hover); }
.rto-type-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: -6px; margin-bottom: 12px; font-style: italic; }
.rto-time-row { display: none; align-items: center; gap: 10px; margin-bottom: 12px; }
.rto-time-row.visible { display: flex; }
.rto-list-section { background: var(--bg-panel); border: 1px solid var(--border-subtle); overflow: hidden; }
.rto-list-header {
  padding: 14px 18px; border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card); display: flex; align-items: center; justify-content: space-between;
}
.rto-list-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; border-bottom: 1px solid var(--border-subtle); transition: background 0.1s;
}
.rto-list-item:last-child { border-bottom: none; }
.rto-list-item:hover { background: var(--bg-hover); }
.rto-list-left { display: flex; align-items: center; gap: 12px; }
.rto-list-name { font-weight: 500; font-size: 0.92rem; color: var(--text-primary); }
.rto-list-date { font-size: 0.82rem; color: var(--text-secondary); }
.rto-list-right { display: flex; align-items: center; gap: 8px; }
.rto-list-day {
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; padding: 3px 8px;
}
.rto-list-day.weekend { background: var(--red-glow); color: var(--red-bright); }
.rto-list-day.weekday { background: rgba(var(--swap-blue-rgb),0.1); color: var(--swap-blue); }
.rto-remove-btn {
  width: 26px; height: 26px; background: transparent;
  border: 1px solid transparent; color: var(--text-muted);
  cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.15s;
}
.rto-remove-btn:hover { color: var(--rto-red); border-color: rgba(192, 57, 43, 0.3); background: var(--rto-red-bg); }
.rto-remove-btn svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.rto-empty { text-align: center; padding: 40px 20px; color: var(--text-muted); font-size: 0.88rem; }

/* ============================================
   SCHEDULE PRINT TABLE STYLES (preview + print)
   These apply in the print overlay on-screen AND when printed.
   ============================================ */
#utu-print-overlay .utu-sched-table { width: 100%; border-collapse: collapse; font-family: 'Instrument Sans', sans-serif; table-layout: fixed; }
#utu-print-overlay .utu-sched-table thead { display: table-header-group; }
#utu-print-overlay .utu-sched-table th { background: #1a1a1a; color: #fff; padding: 7px 4px; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; text-align: center; border: 1px solid #333; }
#utu-print-overlay .utu-sched-table th:first-child { text-align: left; padding-left: 10px; }
#utu-print-overlay .utu-sched-table td { padding: 6px 4px; font-size: 0.8rem; text-align: center; border: 1px solid #bbb; vertical-align: middle; color: #111; }
#utu-print-overlay .utu-sched-table td:first-child { text-align: left; padding-left: 10px; font-weight: 600; font-size: 0.82rem; color: #000; }
#utu-print-overlay .utu-sched-table tbody tr.utu-data-row:nth-child(even) td { background: #f5f5f5; }
#utu-print-overlay .utu-sched-table tr.utu-sched-section td,
#utu-print-overlay .utu-sched-table tr.utu-sched-section td:first-child { background: #333; color: #fff; font-weight: 700; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; text-align: center; padding: 6px; border: 1px solid #333; }
#utu-print-overlay .utu-cell-shift { color: #111; font-family: 'DM Mono', monospace; font-size: 0.78rem; font-weight: 400; }
#utu-print-overlay .utu-cell-off { color: #999; font-family: 'DM Mono', monospace; font-size: 0.78rem; font-weight: 400; }
#utu-print-overlay .utu-cell-oncall { border: 1.5px dashed var(--ash); display: block; text-align: center; white-space: nowrap; padding: 2px 4px; }
#utu-print-overlay .utu-role-row td { background: #f5f0d8; color: #111; }
#utu-print-overlay .utu-role-row.even td { background: #efe8c8; color: #111; }
#utu-print-overlay .utu-note-row td { font-size: 0.78rem; color: #333; vertical-align: top; white-space: pre-wrap; line-height: 1.3; padding: 5px 6px; }
#utu-print-overlay .utu-gm-label { font-size: 0.72rem; font-weight: 400; color: #666; margin-left: 3px; }
#utu-print-overlay .utu-task-label { font-size: 0.72rem; color: #1a7a6d; font-weight: 600; margin-top: 2px; }
#utu-print-overlay .utu-page-break { page-break-before: always; break-before: page; margin-top: 0; border-top: 2px dashed #ccc; padding-top: 24px; margin-bottom: 0; }

/* Manager Roster action button icons */
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.row-action-btn { background: none; border: 1px solid var(--border-subtle); border-radius: 2px; padding: 5px; cursor: pointer; color: var(--text-secondary); display: inline-flex; align-items: center; justify-content: center; transition: color 0.15s, border-color 0.15s; }
.row-action-btn:hover { color: var(--bone); border-color: var(--border-medium); }
.row-action-btn.delete:hover { color: var(--red-alert); border-color: rgba(192,57,43,0.4); }
.row-action-btn svg { width: 15px; height: 15px; }

/* ============================================
   PRINT STYLES (@media print)
   ============================================ */
@media print {
  .sidebar, .header { display: none !important; }
  .app-layout {
    display: block !important;
    grid-template-columns: 1fr !important;
    overflow: visible !important;
  }
  .main-content { padding: 0 !important; overflow: visible !important; }
  .page-section { display: none !important; }
  .page-section.active { display: block !important; }
  /* The Solar Gold screen frame must never print — renders as a heavy gray
     bar and wastes toner on the regularly-printed management schedule. */
  #page-mgr-schedule { border: none !important; }
  .ds-controls { display: none !important; }
  .ds-coverage-rail { display: none !important; }
  .sheet-wrapper { max-width: none; margin: 0; }
  .day-sheet { box-shadow: none; margin: 0; overflow: visible; }
  .sheet-header { padding: 12px 16px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sheet-header-left h1 { font-size: 1.3rem; }
  .sheet-header-left .sheet-date { font-size: 1.05rem; }
  .sheet-header-right { font-size: 0.85rem; }
  .col-header { padding: 7px; font-size: 1rem; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ds-pos-header { padding: 5px 12px; font-size: 0.85rem; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ds-emp-table td { padding: 7px 8px; font-size: 0.95rem; overflow: visible; }
  .ds-emp-table { table-layout: auto; }
  .ds-emp-table .emp-name { font-size: 0.95rem; font-weight: 600; }
  .ds-emp-table .emp-time { font-size: 0.88rem; width: auto; }
  .ds-emp-table .emp-station { font-size: 0.85rem; }
  .ds-emp-table .emp-break { min-height: 28px; }
  .ds-emp-table tr.empty-slot td { height: 28px; }
  .ds-emp-table .ds-subheader-row th { font-size: 0.7rem; padding: 4px 8px; }
  .ds-emp-table tr.role-row td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  /* Monochrome-safe: overrides the inline per-cert border-color/background set
     in JS. !important is required here — an inline style attribute otherwise
     outranks this class selector regardless of media query. */
  .ds-cert-badge { border-color: #000 !important; background: transparent !important; color: #000 !important; }
  .sheet-footer { padding: 8px 14px; font-size: 0.75rem; }

  /* Print overlay — hide app, show only overlay content */
  body.utu-printing { background: #fff !important; }
  body.utu-printing .app-layout { display: none !important; }
  body.utu-printing #utu-print-overlay { display: block !important; position: static !important; overflow: visible !important; inset: auto !important; z-index: auto !important; }
  body.utu-printing #utu-print-overlay .print-overlay-actions { display: none !important; }
  body.utu-printing #utu-print-content { padding: 0 8px !important; }

  /* Force color-adjust for schedule table backgrounds */
  #utu-print-overlay .utu-sched-table th,
  #utu-print-overlay .utu-sched-table tr.utu-sched-section td,
  #utu-print-overlay .utu-role-row td,
  #utu-print-overlay .utu-role-row.even td,
  #utu-print-overlay .utu-sched-table tbody tr.utu-data-row:nth-child(even) td {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }

  /* Page setup — orientation is controlled by the user in the browser print dialog.
     The print preview toolbar shows the recommended orientation. */
  @page { margin: 0.4in; }

  /* Page breaks for multi-page schedules */
  #utu-print-overlay .utu-page-break { page-break-before: always; break-before: page; border-top: none; padding-top: 0; }
  #utu-print-overlay .utu-sched-table { page-break-inside: auto; }
  #utu-print-overlay .utu-sched-table tr { page-break-inside: avoid; break-inside: avoid; }

  /* Day Sheet portrait print — fill the page */
  body.utu-print-portrait .sheet-wrapper { max-width: none; }
  body.utu-print-portrait .day-sheet { margin: 0; padding: 0; }

  .utu-cell-oncall {
    border: 1.5px dashed #8A8278;
    display: block;
    text-align: center;
    white-space: nowrap;
    padding: 2px 4px;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--border-medium); }
::-webkit-scrollbar-thumb:hover { background: var(--ash); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .app-layout {
    grid-template-columns: 1fr;
    grid-template-areas: "header" "main";
  }
  .sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    bottom: 0;
    width: 250px;
    z-index: 1000;
    transition: left 0.25s ease;
    box-shadow: none;
  }
  .sidebar.open {
    left: 0;
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  }
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 999;
  }
  .sidebar-overlay.open { display: block; }
  .hamburger-btn {
    display: flex !important;
  }
  .header {
    padding-left: 12px;
  }
  .schedule-table col.col-employee { width: 140px; }
  #ss_scheduleGrid col.col-employee { width: 140px; } /* two-line cell: no widening on mobile */
  .shift-block { font-size: 0.72rem; padding: 4px 6px; }
  .employee-name { font-size: 0.78rem; }
  .schedule-toolbar { flex-wrap: wrap; gap: 8px; }
  .schedule-toolbar .btn { font-size: 0.72rem; padding: 5px 10px; }
  .modal-content { width: 92vw; max-width: 500px; }
  .ds-controls { flex-direction: column; align-items: flex-start; }
  .day-tab { padding: 5px 10px; font-size: 0.75rem; }
  .roster-table td, .roster-table th { padding: 8px 10px; font-size: 0.78rem; }
  .times-grid { grid-template-columns: repeat(4, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid.cols-3 { grid-template-columns: 1fr 1fr; }
  .settings-section { padding: 16px; }
}

/* ============================================
   HELP PAGE
   ============================================ */
.help-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px;
  font-family: 'Instrument Sans', sans-serif;
}
.help-intro {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.help-section {
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  margin-bottom: 8px;
  overflow: hidden;
}
.help-accordion {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  background: var(--bg-panel);
  border: none;
  color: var(--text-primary);
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.help-accordion:hover {
  background: var(--bg-hover);
}
.help-chevron {
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.help-body {
  display: none;
  padding: 14px 18px 16px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-subtle);
}
.help-body.open {
  display: block;
  animation: fadeIn 0.15s ease;
}
.help-body p {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 10px;
}
.help-body p:last-child { margin-bottom: 0; }
.help-body strong { color: var(--text-primary); }

/* ============================================
   LEGAL MODALS (EULA + PRIVACY POLICY)
   ============================================ */
.legal-modal {
  width: 680px;
  max-width: 95vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}
.legal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.84rem;
  line-height: 1.65;
  color: var(--text-secondary);
}
.legal-body h3 {
  font-size: 0.80rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-primary);
  margin: 22px 0 8px;
}
.legal-body h3:first-of-type { margin-top: 4px; }
.legal-body p { margin: 0 0 10px; }
.legal-body ul {
  margin: 0 0 10px 18px;
  padding: 0;
}
.legal-body ul li { margin-bottom: 5px; }
.legal-body strong { color: var(--text-primary); }

/* ============================================
   FORECAST PAGE
   ============================================ */
.forecast-page { padding: 20px 24px; }
.fc-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.fc-week-range {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.88rem; font-weight: 600; color: var(--text-primary);
}
.fc-section {
  background: var(--bg-panel); border: 1px solid var(--border-subtle);
  margin-bottom: 20px; overflow: hidden;
}
.fc-section-title {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--text-secondary);
  padding: 11px 16px; background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
}
.fc-table-wrap { overflow-x: auto; }
.fc-table {
  width: 100%; border-collapse: collapse; min-width: 620px;
  font-family: 'Instrument Sans', sans-serif; font-size: 0.83rem;
}
.fc-table thead th {
  background: var(--bg-card); color: var(--text-primary);
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; padding: 9px 12px; text-align: center;
  border-bottom: 2px solid var(--border-medium);
}
.fc-table thead th:first-child { text-align: left; }
.fc-date {
  display: block; font-size: 0.7rem; font-weight: 400;
  color: var(--text-primary); margin-top: 1px; letter-spacing: 0;
}
.fc-table tbody td {
  padding: 10px 12px; text-align: center;
  border-bottom: 1px solid var(--border-subtle); color: var(--text-primary);
  font-size: 0.9rem; font-weight: 500; font-variant-numeric: tabular-nums;
}
.fc-table tbody tr:last-child td { border-bottom: none; }
.fc-dash { color: var(--text-secondary); font-weight: 400; }
.fc-table .fc-label {
  text-align: left !important; font-weight: 600;
  color: var(--text-primary); white-space: nowrap;
}
.fc-table .fc-total {
  font-weight: 700; color: var(--text-primary); font-size: 0.95rem;
  border-left: 1px solid var(--border-subtle) !important;
}
.fc-row-staff td { background: rgba(94,140,97,0.04); }
.fc-row-mgr td { background: rgba(91,141,184,0.05); }
.fc-table .fc-row-combined td {
  background: var(--bg-elevated);
  font-weight: 700; color: var(--text-primary);
}
.fc-table .fc-empty {
  padding: 28px 16px; text-align: center;
  color: var(--text-muted); font-size: 0.84rem;
}

/* Date input calendar icon — force light color so it's visible on dark themes */
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) opacity(0.6);
  cursor: pointer;
}
.legal-body a { color: var(--solar-gold); }
.legal-effective {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 16px !important;
}
.eula-overlay {
  z-index: 10000;
}
.login-footer a { color: var(--text-muted); font-size: 0.78rem; }

/* ── CSV Import Modal ───────────────────────────────────────────────────────── */
.csv-import-modal { width: 700px; max-width: 95vw; }
.csv-import-summary { margin-bottom: 12px; }
.csv-summary-counts { display: flex; gap: 14px; flex-wrap: wrap; font-size: .83rem; }
.csv-count-ready { color: var(--green-success); font-weight: 600; }
.csv-count-skip { color: var(--red-alert); }
.csv-count-warn { color: var(--solar-gold); }
.csv-preview-wrap {
  max-height: 360px; overflow-y: auto;
  border: 1px solid var(--border-subtle); border-radius: 6px;
}
.csv-preview-wrap .roster-table { margin: 0; }
.csv-preview-wrap .roster-table thead th { position: sticky; top: 0; background: var(--bg-card); z-index: 1; }
.csv-row-skip { opacity: 0.45; }
.csv-unmatched { color: var(--solar-gold); font-style: italic; }
.csv-badge-ready {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: .7rem; font-weight: 600;
  background: rgba(94, 140, 97, 0.12); color: var(--green-success);
  border: 1px solid rgba(94, 140, 97, 0.25);
}
.csv-badge-skip {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: .7rem; font-weight: 600;
  background: var(--red-bg); color: var(--red-alert);
  border: 1px solid rgba(192, 57, 43, 0.25);
}

/* ── ON CALL Shift Support ───────────────────────────────────────────────────── */
.on-call-block {
  border: 1.5px dashed var(--ash);
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.on-call-label {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ash);
  text-transform: uppercase;
}
.on-call-time {
  font-family: 'Instrument Sans', sans-serif;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  color: var(--bone);
}
.btn-oncall {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 12px;
  border: 1.5px solid var(--ash);
  border-radius: 2px;
  background: transparent;
  color: var(--ash);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn-oncall.active {
  border-color: var(--solar-gold);
  color: var(--solar-gold);
}

/* ── Weather / Rain Intelligence ─────────────────────────────────────────────── */
:root {
  --wx-blue: #378ADD;
  --wx-amber: #E9A23F;
  --wx-sun: #E9A23F;
  --wx-cloud: #5F5E5A;
}

.ds-wx-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  background: #fff;
  border-top: 1px solid #e0e0e0;
  border-bottom: 1px solid #e0e0e0;
}
.ds-wx-info { display: flex; flex-direction: column; gap: 2px; }
.ds-wx-badge {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #1a6bb0;
}
.ds-wx-pct {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: #1a6bb0;
}

@media print {
  .ds-wx-panel { border-top: 1px solid #ccc; border-bottom: 1px solid #ccc; }
  .ds-wx-badge { color: #111; }
  .ds-wx-pct { color: #333; }
}

/* ============================================
   READ-ONLY ACCESS (corporate view-only)
   ============================================
   Driven by ONE body class, set in utu_applyReadOnlyUI (ui.js) from
   STATE.readOnly. Appearance only — refusals come from the central guard in
   db.js, and the database enforces the rule independently. Two treatments:
     • HIDE controls whose only purpose is to edit (add / import / lock /
       copy / clear / remove / save buttons). Nothing to read is lost.
     • INERT controls that also carry information the viewer needs to read
       (settings values, first-show / close-time selects, day notes,
       availability notes). They stay visible, dimmed, and take no input.
   Grid cells stay clickable on purpose: the click reaches the gated handler,
   which explains itself ("View-only access.") — same rule as the week lock.
   No new tokens, no hardcoded colors. */
.utu-readonly #ss_lockToggle,
.utu-readonly #ss_copyPrevBtn,
.utu-readonly #ss_clearWeekBtn,
.utu-readonly #ms_lockToggle,
.utu-readonly #ms_copyPrevBtn,
.utu-readonly #ms_clearWeekBtn,
.utu-readonly .utu-edit-only,
.utu-readonly .add-position-btn,
.utu-readonly .position-remove,
.utu-readonly .roster-action-btn,
.utu-readonly .row-action-btn,
.utu-readonly .rto-remove-btn {
  display: none !important;
}

.utu-readonly #page-settings input,
.utu-readonly #page-settings select,
.utu-readonly #page-settings textarea,
.utu-readonly #page-settings .ampm-btn,
.utu-readonly #page-settings .toggle-switch,
.utu-readonly select.first-show-select,
.utu-readonly select.close-time-select,
.utu-readonly .ms-day-note,
.utu-readonly .avail-note-input {
  pointer-events: none;
  opacity: 0.6;
  cursor: default;
}

/* Position rows are draggable for reordering — the drag is an edit. Inert
   without extra dimming (their inputs are already dimmed above). */
.utu-readonly #page-settings .position-row,
.utu-readonly #page-settings .position-drag {
  pointer-events: none;
}

.utu-readonly td[onclick],
.utu-readonly .shift-cell,
.utu-readonly .avail-cell {
  cursor: default;
}

/* ============================================
   SHOW / HIDE PASSWORD TOGGLE (utu-pw-*)
   ============================================
   Built by utu_pwToggleInit (ui.js). The wrapper is a block so it takes the
   input's full width inside any .form-group; the input keeps every existing
   .form-input rule and only gains right padding for the button. Colors are
   semantic tokens only: --text-secondary reads on --bg-darkest before a chain
   theme is applied, and every chain theme overrides both together, so the
   pairing stays legible after theming. Radius 2px (brand). */
.utu-pw-wrap {
  position: relative;
  display: block;
}
.utu-pw-wrap .form-input {
  padding-right: 42px;
}
.utu-pw-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 2px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.utu-pw-toggle svg {
  width: 18px;
  height: 18px;
}
.utu-pw-toggle:hover,
.utu-pw-toggle[aria-pressed="true"] {
  color: var(--text-primary);
}
.utu-pw-toggle:focus-visible {
  outline: none;
  color: var(--text-primary);
  border-color: var(--accent, var(--solar-gold));
}


/* ============================================
   PILL CONTROLS — matches the marketing site
   ============================================
   Pill-shaped, dark and quiet, clear selected state, soft press. Overrides
   only: every rule below targets class names the JS already uses and changes
   appearance only. Colors are semantic tokens — the selected fill reuses the
   primary button's --btn-primary-bg / --btn-primary-text, so it stays
   readable on the default amber and on Stone crimson. The only literal color
   is the switch knob's white. Retires the 2px radius rule for controls.
   Not touched: the Day Sheet paper, @media print, schedule grid cells, the
   print overlay, the login screen. */

/* Neutral line tokens derived from the text color (≈18 / 32 / 45%). */
:root {
  --pill-line:       color-mix(in srgb, var(--text-primary) 18%, transparent);
  --pill-line-hover: color-mix(in srgb, var(--text-primary) 32%, transparent);
  --pill-line-focus: color-mix(in srgb, var(--text-primary) 45%, transparent);
}

/* ── Chip toggles (Edit Employee: Roles, Trained Positions, Certifications) ── */
.trained-pos-chip {
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--pill-line);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
}
.trained-pos-chip:hover {
  border-color: var(--pill-line-hover);
  color: var(--text-primary);
}
.trained-pos-chip.selected {
  background: var(--btn-primary-bg);
  border-color: var(--btn-primary-bg);
  color: var(--btn-primary-text);
}
.trained-pos-chip .chip-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
}
/* Thin ring so the position/role color doesn't vanish into the fill. */
.trained-pos-chip.selected .chip-dot {
  box-shadow: 0 0 0 1.5px var(--btn-primary-text);
}

/* ── Segmented AM/PM (shift editors, Settings split/bridge, swap, availability, RTO) ── */
.ampm-toggle {
  width: fit-content;
  gap: 0;
  padding: 2px;
  border: 1px solid var(--pill-line);
  border-radius: 999px;
}
.ampm-btn {
  height: 32px;
  padding: 0 14px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font-family: 'Instrument Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
}
.ampm-btn:hover { color: var(--text-primary); }
.ampm-btn.active {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
}
/* Settings time grids: seven narrow day cells — same look, compact size. */
.time-day-cell .ampm-toggle { margin-left: auto; margin-right: auto; }
.time-day-cell .ampm-btn {
  height: 22px;
  padding: 0 7px;
  font-size: 0.62rem;
}

/* ── Switches (Active, OP, CL, GM, Settings toggles) ── */
.toggle-track {
  border-radius: 999px;
  background: var(--bg-darkest);
  border: 1px solid var(--pill-line-hover);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.toggle-switch input:checked + .toggle-track {
  background: var(--accent);
  border-color: var(--accent);
}
.toggle-knob {
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
}

/* ── Buttons ── */
/* .btn-primary / .btn-secondary / .btn-ghost are included on their own: a few
   buttons carry only that class (Save Coordinates, the manager-swap modal
   buttons), which is why Save Coordinates rendered as a raw outlined box. */
.btn,
.btn-primary,
.btn-secondary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary {
  background: var(--btn-primary-bg);
  border-color: var(--btn-primary-bg);
  color: var(--btn-primary-text);
}
.btn-primary:hover {
  background: var(--btn-primary-hover);
  border-color: var(--btn-primary-hover);
}
.btn-secondary,
.btn-ghost {
  background: transparent;
  border-color: var(--pill-line);
  color: var(--text-secondary);
}
.btn-secondary:hover,
.btn-ghost:hover {
  background: transparent;
  border-color: var(--pill-line-hover);
  color: var(--text-primary);
}
/* The schedule toolbar packs eight buttons into one row and has its own
   compact size and tiered colors — pill shape only there. */
.schedule-toolbar .btn {
  min-height: 0;
  padding: 6px 12px;
  font-size: 12px;
}
.btn-accent,
.btn-swap,
.btn-danger { border-radius: 999px; }

/* Sidebar "Out" — secondary pill. */
.sidebar-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 20px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--pill-line);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
}
.sidebar-logout:hover {
  border-color: var(--pill-line-hover);
  color: var(--text-primary);
}

/* ── Day tabs (Day Sheets, Fri–Thu) and week arrows ── */
.day-tab {
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--pill-line);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
}
.day-tab:hover {
  border-color: var(--pill-line-hover);
  color: var(--text-primary);
}
.day-tab.active {
  background: var(--btn-primary-bg);
  border-color: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  font-weight: 500;
}
.week-nav-btn {
  width: 32px; height: 32px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--pill-line);
}
.week-nav-btn:hover {
  background: transparent;
  border-color: var(--pill-line-hover);
  color: var(--text-primary);
}

/* ── Inputs, selects, textareas — modals and Settings only ──
   Scoped to .modal and #page-settings so the login form keeps its own look.
   background-color (not background) so the select arrow image survives. */
.modal .form-input,
#page-settings .form-input {
  border-radius: 10px;
  background-color: var(--bg-card);
  border: 1px solid var(--pill-line);
  transition: border-color 0.15s ease;
}
.modal input.form-input,
.modal select.form-input,
#page-settings input.form-input,
#page-settings select.form-input {
  min-height: 40px;
}
.modal .form-input:hover,
#page-settings .form-input:hover { border-color: var(--pill-line-hover); }
.modal .form-input:focus,
#page-settings .form-input:focus { border-color: var(--pill-line-focus); }
/* Compact Settings inputs keep their height: Positions row (Station, Abbr,
   slots, OP minutes), the time grids and the numeric rule fields. */
#page-settings .position-row .form-input,
#page-settings .time-day-cell .form-input,
#page-settings .rule-control .form-input {
  min-height: 0;
}

/* ── Modal and settings panel containers ── */
.modal,
.settings-section { border-radius: 14px; }

/* ── Interaction states (all controls above) ── */
.trained-pos-chip,
.ampm-btn,
.btn, .btn-primary, .btn-secondary, .btn-ghost,
.btn-accent, .btn-swap, .btn-danger,
.sidebar-logout,
.day-tab,
.week-nav-btn {
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}
.trained-pos-chip:active,
.ampm-btn:active,
.btn:active, .btn-primary:active, .btn-secondary:active, .btn-ghost:active,
.btn-accent:active, .btn-swap:active, .btn-danger:active,
.sidebar-logout:active,
.day-tab:active,
.week-nav-btn:active,
.toggle-switch:active .toggle-knob {
  transform: scale(0.97);
}
/* Knob press keeps its on-position. */
.toggle-switch:active input:checked ~ .toggle-knob { transform: translateX(18px) scale(0.97); }

.trained-pos-chip:focus-visible,
.ampm-btn:focus-visible,
.btn:focus-visible, .btn-primary:focus-visible, .btn-secondary:focus-visible, .btn-ghost:focus-visible,
.btn-accent:focus-visible, .btn-swap:focus-visible, .btn-danger:focus-visible,
.sidebar-logout:focus-visible,
.day-tab:focus-visible,
.week-nav-btn:focus-visible,
.modal .form-input:focus-visible,
#page-settings .form-input:focus-visible,
.toggle-switch input:focus-visible + .toggle-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.trained-pos-chip:focus:not(:focus-visible),
.ampm-btn:focus:not(:focus-visible),
.btn:focus:not(:focus-visible), .btn-primary:focus:not(:focus-visible),
.btn-secondary:focus:not(:focus-visible), .btn-ghost:focus:not(:focus-visible),
.btn-accent:focus:not(:focus-visible), .btn-swap:focus:not(:focus-visible),
.btn-danger:focus:not(:focus-visible),
.sidebar-logout:focus:not(:focus-visible),
.day-tab:focus:not(:focus-visible),
.week-nav-btn:focus:not(:focus-visible) {
  outline: none;
}

.ampm-btn:disabled,
.btn:disabled, .btn-primary:disabled, .btn-secondary:disabled, .btn-ghost:disabled,
.btn-accent:disabled, .btn-swap:disabled, .btn-danger:disabled,
.sidebar-logout:disabled,
.day-tab:disabled,
.week-nav-btn:disabled,
.modal .form-input:disabled,
#page-settings .form-input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.toggle-switch input:disabled + .toggle-track,
.toggle-switch input:disabled ~ .toggle-knob { opacity: 0.45; }

@media (prefers-reduced-motion: reduce) {
  .trained-pos-chip, .ampm-btn,
  .btn, .btn-primary, .btn-secondary, .btn-ghost,
  .btn-accent, .btn-swap, .btn-danger,
  .sidebar-logout, .day-tab, .week-nav-btn,
  .toggle-track, .toggle-knob,
  .modal .form-input, #page-settings .form-input {
    transition: none;
  }
  .trained-pos-chip:active, .ampm-btn:active,
  .btn:active, .btn-primary:active, .btn-secondary:active, .btn-ghost:active,
  .btn-accent:active, .btn-swap:active, .btn-danger:active,
  .sidebar-logout:active, .day-tab:active, .week-nav-btn:active,
  .toggle-switch:active .toggle-knob {
    transform: none;
  }
  .toggle-switch:active input:checked ~ .toggle-knob { transform: translateX(18px); }
}

/* ── PILL CONTROLS, part 2: ON CALL, RTO type, availability status ──
   Same rules as the block above: pill shape, --pill-line borders, selected =
   the primary button's --btn-primary-bg / --btn-primary-text. State classes
   are the ones the JS already sets: .btn-oncall.active (staff + manager shift
   editors), .rto-type-btn.active, .status-option.selected-avail/-na/-partial. */

/* ON CALL toggle (shift editors) — chip-sized pill. */
.btn-oncall {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--pill-line);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.btn-oncall:hover {
  border-color: var(--pill-line-hover);
  color: var(--text-primary);
}
.btn-oncall.active {
  background: var(--btn-primary-bg);
  border-color: var(--btn-primary-bg);
  color: var(--btn-primary-text);
}

/* RTO type (All Day / RTO Until / RTO After) — equal-width pills, as before. */
.rto-type-btn {
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--pill-line);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
}
.rto-type-btn:hover:not(.active) {
  background: transparent;
  border-color: var(--pill-line-hover);
  color: var(--text-primary);
}
.rto-type-btn.active {
  background: var(--btn-primary-bg);
  border-color: var(--btn-primary-bg);
  color: var(--btn-primary-text);
}

/* Availability status options (Available / Partial / Not Available). Larger
   pills — each carries a label and a hint line. Selected = the option's OWN
   status color as tint + border (green / amber / purple, the same colors as
   before the pill restyle), not the theme accent — the color is the meaning. */
.status-option {
  border-radius: 999px;
  padding: 10px 22px;
  background: transparent;
  border: 1px solid var(--pill-line);
}
.status-option:hover { border-color: var(--pill-line-hover); }
.status-option.selected-avail {
  background: var(--green-bg);
  border-color: color-mix(in srgb, var(--green-success) 40%, transparent);
}
.status-option.selected-na {
  background: var(--na-purple-bg);
  border-color: var(--na-purple-border);
}
.status-option.selected-partial {
  background: var(--partial-amber-bg);
  border-color: color-mix(in srgb, var(--partial-amber) 30%, transparent);
}
.status-option.selected-avail .status-dot-lg,
.status-option.selected-na .status-dot-lg,
.status-option.selected-partial .status-dot-lg {
  box-shadow: 0 0 0 1.5px var(--btn-primary-text);
}

/* Interaction states — same as the block above. */
.btn-oncall,
.rto-type-btn,
.status-option {
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}
.btn-oncall:active,
.rto-type-btn:active,
.status-option:active { transform: scale(0.97); }
.btn-oncall:focus-visible,
.rto-type-btn:focus-visible,
.status-option:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.btn-oncall:focus:not(:focus-visible),
.rto-type-btn:focus:not(:focus-visible),
.status-option:focus:not(:focus-visible) { outline: none; }
.btn-oncall:disabled,
.rto-type-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
@media (prefers-reduced-motion: reduce) {
  .btn-oncall, .rto-type-btn, .status-option { transition: none; }
  .btn-oncall:active, .rto-type-btn:active, .status-option:active { transform: none; }
}


/* ============================================
   ROUNDED PASS — chip style B, rounded corners, themed Sign In
   ============================================
   Follows the PILL CONTROLS blocks above. CSS only; class names are the ones
   the JS already uses. Theme variables only (the check-mark mask is a shape,
   not a color). Not touched: @media print rules, schedule shift cells, the
   print overlay, the Day Sheet paper apart from its weather box, and the
   certification badges on the grid / Day Sheet / roster rows. */

/* ── A. Pick-many chips: tint + check ─────────────────────────────────────
   Rule of thumb: pick-ONE controls (AM/PM, day tabs, RTO type) keep the solid
   fill from the pill pass; pick-MANY chips (Edit Employee Roles, Trained
   Positions, Certifications) and the ON CALL toggle use a soft tint plus a
   check. The check's 12px slot (plus the 6px gap) is ALWAYS rendered and
   only its opacity changes, so a chip is the same width selected and
   unselected — no row jump. The left padding is 8px in both states so the
   invisible slot doesn't leave an oversized left inset. */
.trained-pos-chip,
.btn-oncall { padding-left: 8px; }
.trained-pos-chip.selected,
.btn-oncall.active {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  color: var(--text-primary);
  box-shadow: none;
}
.btn-oncall { gap: 6px; }
.trained-pos-chip::before,
.btn-oncall::before {
  content: '';
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  opacity: 0;
  transition: opacity 0.12s ease;
  background: var(--accent-bright);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / contain no-repeat;
}
.trained-pos-chip.selected::before,
.btn-oncall.active::before { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .trained-pos-chip::before, .btn-oncall::before { transition: none; }
}
/* The ring from the pill pass was for a dot on a solid fill — not needed on a tint. */
.trained-pos-chip.selected .chip-dot { box-shadow: none; }

/* ── B. Rounded corners ───────────────────────────────────────────────── */

/* Pills */
.tpill { border-radius: 999px; }                     /* First Show / Close boxes, grid header */
.login-btn { border-radius: 999px; }                 /* Sign In */
.add-position-btn { border-radius: 999px; }          /* + Add Role / Certification / Position — dashed border kept */
.status-badge { border-radius: 999px; }              /* ACTIVE / INACTIVE in the rosters */
/* Day Sheet weather box — the one approved Day Sheet change. The pill is the
   OUTER white box (see the :has() rule at the end of this file); the inner
   panel draws no outline of its own, on screen or in print. */
.ds-wx-panel { border: none; }

/* Rounded rectangles */
.nav-item { border-radius: 10px; }                   /* sidebar menu, incl. .active */
.theater-selector { border-radius: 12px; }           /* sidebar theater switcher */
.theater-logo { border-radius: 8px; }                /* M14-style badge inside it */
.login-form { border-radius: 14px; }                 /* the visible login card */
.login-form .form-input { border-radius: 10px; }     /* login email + password */
.summary-card { border-radius: 12px; }               /* roster stat boxes */
.position-row,
.roles-list .role-row,
.cert-row { border-radius: 10px; }                   /* Settings list rows */

/* Staff roster table container. Its existing overflow-x: auto already clips
   to the radius, so it is kept (overflow: hidden would remove horizontal
   scrolling on narrow screens). Rows stay square. */
.roster-table-wrap { border-radius: 12px; }
/* Management roster has no styled container, and adding overflow there would
   break its sticky header or cut off columns — round the header row's outer
   corners instead. */
#mr_table thead th:first-child { border-top-left-radius: 12px; }
#mr_table thead th:last-child  { border-top-right-radius: 12px; }

/* ── C. Sign In follows the theme ────────────────────────────────────────
   Same variables as the Save button (.btn-primary), without the gold/obsidian
   fallbacks — so a chain theme recolors it like everything else. */
.login-btn {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
}
.login-btn:hover { background: var(--btn-primary-hover); }

/* Day Sheet weather box — the visible white box is the inline-styled parent
   of .ds-wx-panel (daysheet.js); reached with :has() so daysheet.js stays
   untouched. !important is not fighting anything (the inline style sets no
   radius); it pins the shape against future inline edits. */
.sheet-header div:has(> .ds-wx-panel) {
  border-radius: 999px !important;
  overflow: hidden;
}

/* Certification badges (21+, TIPS, SERVSAFE…) and role tags (SHIFT LEAD,
   BAR LEAD): 4px corners — softened, deliberately not pills. Radius only;
   size, colors and font unchanged.
     .cert-pip       schedule grid names, certs legend, Settings preview
     .cert-badge     staff roster rows, Settings preview
     .ds-cert-badge  Day Sheet
     .role-badge     schedule grid names, staff roster rows */
.cert-pip,
.cert-badge,
.ds-cert-badge,
.role-badge { border-radius: 4px; }
