:root {
  --brand: #1d6fd6;
  --brand-dark: #1258b0;
  --brand-light: #4b93ea;
  --brand-soft: rgba(29, 111, 214, 0.12);
  --brand-glow: rgba(29, 111, 214, 0.28);
  --ink: #0b1f3a;
  --muted: #5b6f8a;
  --line: #d7e3f2;
  --bg: #f3f7fc;
  --bg-2: #e8f1fb;
  --card: #ffffff;
  --card-2: #f8fbff;
  --sidebar: #082445;
  --sidebar-2: #0b3060;
  --topbar: rgba(255, 255, 255, 0.86);
  --good: #0f766e;
  --warn: #b45309;
  --crit: #b91c1c;
  --info: #1d6fd6;
  --shadow: 0 10px 30px rgba(8, 36, 69, 0.08);
  --shadow-hover: 0 18px 40px rgba(29, 111, 214, 0.16);
  --input-bg: #ffffff;
  --table-hover: #f3f8ff;
  --chip-bg: #ffffff;
  --overlay: rgba(8, 36, 69, 0.48);
  --hero-glow-1: rgba(29, 111, 214, 0.22);
  --hero-glow-2: rgba(14, 165, 233, 0.16);
  color-scheme: light;
}

html[data-theme="dark"] {
  --brand: #4b93ea;
  --brand-dark: #1d6fd6;
  --brand-light: #7eb0f4;
  --brand-soft: rgba(75, 147, 234, 0.16);
  --brand-glow: rgba(75, 147, 234, 0.28);
  --ink: #e8eef7;
  --muted: #93a4bf;
  --line: #1e3350;
  --bg: #07111f;
  --bg-2: #0b1a2e;
  --card: #0e1c30;
  --card-2: #11243d;
  --sidebar: #06101c;
  --sidebar-2: #0a1b31;
  --topbar: rgba(8, 18, 33, 0.86);
  --good: #2dd4bf;
  --warn: #fbbf24;
  --crit: #fb7185;
  --info: #7eb0f4;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  --shadow-hover: 0 20px 44px rgba(29, 111, 214, 0.22);
  --input-bg: #0b1a2e;
  --table-hover: #122844;
  --chip-bg: #12243c;
  --overlay: rgba(2, 8, 18, 0.62);
  --hero-glow-1: rgba(29, 111, 214, 0.18);
  --hero-glow-2: rgba(14, 165, 233, 0.10);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; background-color: var(--bg); color: var(--ink); }
h1, h2, h3, h4, h5, h6 { color: var(--ink); }
.sidebar, .sidebar h1, .sidebar h2, .sidebar h3 { color: #e2e8f0; }
body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, Segoe UI, sans-serif;
}
body.app-body {
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 420px at 10% -10%, var(--brand-soft), transparent 50%),
    radial-gradient(900px 360px at 100% 0%, rgba(14, 165, 233, 0.08), transparent 46%);
}

.sidebar {
  width: 272px;
  background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
  color: #e2e8f0;
  transition: width .2s ease, transform .2s ease;
}
.sidebar.collapsed { width: 76px; }
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-group-title,
.sidebar.collapsed .brand-text,
.sidebar.collapsed .user-meta { display: none; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-light), var(--brand-dark));
  color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
  box-shadow: 0 8px 18px var(--brand-glow);
}
.nav-group-title {
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: #8aa0c0;
  padding: 14px 16px 6px;
}
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; margin: 2px 8px; border-radius: 10px;
  color: #c5d4ea; text-decoration: none; font-size: 14px;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.nav-link i { width: 18px; text-align: center; }
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; transform: translateX(2px); }
.nav-link.active { background: var(--brand-soft); color: #dbeafe; box-shadow: inset 0 0 0 1px rgba(75,147,234,.25); }

.topbar {
  height: 64px;
  background: var(--topbar);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.muted, .text-slate-500, .text-slate-400 { color: var(--muted) !important; }
.text-slate-600 { color: var(--muted) !important; }

.card {
  position: relative;
  background: linear-gradient(180deg, var(--card) 0%, var(--card-2) 100%);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  color: var(--ink);
  overflow: hidden;
  animation: cardIn .55s cubic-bezier(.2,.8,.2,1) both;
  transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease;
}
.card::before {
  content: "";
  position: absolute; inset: 0 auto auto 0; width: 100%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--brand-light), var(--brand), transparent);
  opacity: .7;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(29, 111, 214, 0.35);
}
.card.kpi { padding: 16px 18px; }
.card .card { animation: none; }
.kpi .label { font-size: 12px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.kpi .value { font-size: 28px; font-weight: 700; letter-spacing: -.03em; margin-top: 4px; color: var(--ink); }
#kpi-grid .card:nth-child(1) { animation-delay: .04s; }
#kpi-grid .card:nth-child(2) { animation-delay: .08s; }
#kpi-grid .card:nth-child(3) { animation-delay: .12s; }
#kpi-grid .card:nth-child(4) { animation-delay: .16s; }
#kpi-grid .card:nth-child(5) { animation-delay: .20s; }
#kpi-grid .card:nth-child(6) { animation-delay: .24s; }
#kpi-grid .card:nth-child(7) { animation-delay: .28s; }
#kpi-grid .card:nth-child(8) { animation-delay: .32s; }

.stat-row {
  display: flex; justify-content: space-between; align-items: center;
  border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px;
  background: var(--card);
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.stat-row:hover { transform: translateY(-2px); border-color: var(--brand-light); }
.stat-row span { color: var(--muted); }

.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 2px 8px; font-size: 11px; font-weight: 600; }
.badge-good { background: rgba(15,118,110,.14); color: var(--good); }
.badge-warn { background: rgba(180,83,9,.14); color: var(--warn); }
.badge-crit { background: rgba(185,28,28,.14); color: var(--crit); }
.badge-info { background: var(--brand-soft); color: var(--info); }
.badge-muted { background: var(--bg-2); color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 10px; border: 1px solid transparent; padding: 8px 14px;
  font-weight: 600; font-size: 14px; cursor: pointer; background: var(--card); color: var(--ink);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--brand-light), var(--brand-dark));
  color: #fff;
  box-shadow: 0 8px 18px var(--brand-glow);
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-danger { background: #b91c1c; color: #fff; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.table-wrap { overflow: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr { transition: background .2s ease; }
table.data tr:hover td { background: var(--table-hover); }

.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px;
  font: inherit; background: var(--input-bg); color: var(--ink);
}
.input:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }

.modal-backdrop {
  position: fixed; inset: 0; background: var(--overlay); z-index: 60;
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.modal-backdrop.open { display: flex; }
.modal {
  width: min(720px, 100%); background: var(--card); color: var(--ink); border-radius: 18px; max-height: 90vh; overflow: auto;
  border: 1px solid var(--line); box-shadow: var(--shadow-hover);
  animation: cardIn .35s ease both;
}
.toast-wrap { position: fixed; right: 16px; bottom: 16px; z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: var(--card); padding: 10px 14px; border-radius: 12px; font-size: 14px; box-shadow: var(--shadow); animation: cardIn .3s ease both; }
.toast.error { background: #991b1b; color: #fff; }
.toast.warn { background: #9a3412; color: #fff; }

.search-panel {
  position: absolute; top: 52px; left: 0; right: 0; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; display: none; max-height: 420px; overflow: auto; z-index: 40;
  color: var(--ink); box-shadow: var(--shadow);
}
.search-panel.open { display: block; }
.search-panel a { color: var(--ink); }
.search-panel a:hover { background: var(--table-hover); }

.roster-grid { min-width: 1100px; }
.roster-table th, .roster-table td { vertical-align: top; }
.roster-name { min-width: 180px; position: sticky; left: 0; background: var(--card); z-index: 1; }
.roster-group td { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); background: var(--bg-2); }
.roster-cell { min-height: 84px; border: 1px dashed var(--line); border-radius: 12px; padding: 6px; background: var(--bg-2); transition: background .2s ease, border-color .2s ease; }
.roster-cell.dragover { border-color: var(--brand); background: var(--brand-soft); }
.roster-chip { border-left-width: 4px; border-left-style: solid; }
.roster-leave {
  font-size: 11px; font-weight: 700; color: var(--crit);
  background: rgba(185,28,28,.12); border-radius: 8px; padding: 4px 8px; margin-bottom: 4px;
}
.roster-strip { display: grid; grid-template-columns: repeat(7, minmax(110px, 1fr)); gap: 8px; overflow-x: auto; }
.roster-day { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--card); }
.roster-day.ok { box-shadow: inset 0 -3px 0 var(--good); }
.roster-day.warn { box-shadow: inset 0 -3px 0 var(--warn); }
.roster-day.crit { box-shadow: inset 0 -3px 0 var(--crit); }
.leave-cal {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
}
.leave-cal .dow { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 4px 6px; }
.leave-day {
  min-height: 78px; border: 1px solid var(--line); border-radius: 12px; padding: 6px 8px;
  background: var(--bg-2); font-size: 12px;
}
.leave-day.out { opacity: .4; }
.leave-day.holiday { background: rgba(29,111,214,.08); }
.leave-day.today { box-shadow: inset 0 0 0 2px var(--brand); }
.leave-pip {
  display: block; border-radius: 6px; padding: 2px 6px; margin-top: 4px;
  font-size: 10px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.leave-card { padding: 16px 18px; min-height: 150px; }
.leave-card .bar { height: 6px; border-radius: 999px; margin-bottom: 12px; }
.av-swatch, .av-cell {
  width: 22px; height: 22px; border-radius: 6px; display: inline-block; vertical-align: middle;
  border: 1px solid var(--line); background: var(--bg-2);
}
.av-cell { width: 100%; min-height: 42px; border-radius: 10px; cursor: pointer; }
.av-available { background: rgba(15,118,110,.18); }
.av-unavailable, .av-cannot_work { background: rgba(185,28,28,.2); }
.av-preferred { background: rgba(29,111,214,.22); }
.av-restricted { background: rgba(180,83,9,.2); }
.att-meta { font-size: 12px; color: var(--muted); margin-top: 6px; }
.att-times { font-variant-numeric: tabular-nums; font-size: 13px; margin-top: 8px; }
.tr-pipeline {
  display: grid; grid-template-columns: repeat(5, minmax(200px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px;
}
.tr-col {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; padding: 10px; min-width: 200px;
}
.tr-col h3 { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.tr-col .card { margin-bottom: 10px; min-height: 0; }
.tr-due { font-size: 12px; margin-top: 8px; color: var(--muted); }
.tr-due.overdue { color: var(--crit); font-weight: 600; }
.tr-due.due_soon { color: var(--warn); font-weight: 600; }
.wl-suggest {
  border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; margin-bottom: 16px;
  background: var(--card); display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between;
}
.wl-req-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.wl-req-table th, .wl-req-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.wl-req-table input { width: 4.5rem; }
.wl-req-table .area-row td { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: var(--bg-2); }
.card.static-card { overflow: auto; }
.card.static-card:hover { transform: none; box-shadow: var(--shadow); }

.card.auth-card {
  overflow: visible;
  flex-shrink: 0;
  width: min(520px, 92%);
  margin: 32px auto 48px;
  padding: 32px;
}
.card.auth-card:hover { transform: none; box-shadow: var(--shadow); }
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
  min-width: 0;
}
.auth-field > span {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.3;
}
.auth-card .input {
  display: block;
  width: 100%;
  min-height: 42px;
  background: var(--bg);
  border-color: var(--line);
}
.auth-card textarea.input { min-height: 88px; resize: vertical; }
.auth-card select.input {
  cursor: pointer;
  appearance: auto;
}
.auth-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  margin-top: 14px;
}
.auth-row .auth-field { margin-top: 0; }
@media (max-width: 560px) {
  .auth-row { grid-template-columns: 1fr; }
}
.chip {
  border-radius: 10px; padding: 6px 8px; font-size: 12px; background: var(--chip-bg); border: 1px solid var(--line);
  cursor: grab; margin-bottom: 4px; transition: transform .18s ease, box-shadow .18s ease;
}
.chip:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.chip.critical { border-color: rgba(185,28,28,.4); background: rgba(185,28,28,.12); }
.chip.warning { border-color: rgba(180,83,9,.4); background: rgba(180,83,9,.12); }

.coverage-bar { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.coverage-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-light)); }
.coverage-bar > span.cov-good { background: var(--good); }
.coverage-bar > span.cov-warn { background: var(--warn); }
.coverage-bar > span.cov-crit { background: var(--crit); }

.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.skeleton { background: linear-gradient(90deg, var(--line), var(--card), var(--line)); background-size: 200% 100%; animation: shine 1.2s infinite; border-radius: 8px; height: 14px; }

.alert-crit, .alert-warn {
  border-radius: 14px; padding: 12px 14px; border: 1px solid;
  animation: cardIn .4s ease both;
}
.alert-crit { background: rgba(185,28,28,.12); border-color: rgba(185,28,28,.28); color: var(--crit); }
.alert-warn { background: rgba(180,83,9,.12); border-color: rgba(180,83,9,.28); color: var(--warn); }
html[data-theme="dark"] .alert-crit { background: rgba(251,113,133,.16); border-color: rgba(251,113,133,.38); }
html[data-theme="dark"] .alert-warn { background: rgba(251,191,36,.14); border-color: rgba(251,191,36,.36); }

.site-footer {
  padding: 18px 20px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}
.site-footer p { margin: 0; }

.theme-toggle {
  width: 40px; height: 40px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}
.theme-toggle:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
html.theme-light .theme-toggle .icon-sun,
html[data-theme="light"] .theme-toggle .icon-sun { display: none; }
html.theme-dark .theme-toggle .icon-moon,
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.landing {
  min-height: 100vh;
  height: auto;
  display: flex; flex-direction: column;
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 420px at 12% -8%, var(--hero-glow-1), transparent 55%),
    radial-gradient(700px 360px at 90% 8%, var(--hero-glow-2), transparent 50%);
  color: var(--ink);
}
.landing-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 8vw;
}
.landing-hero {
  padding: 48px 8vw 28px;
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center;
}
.landing-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--brand); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
}
.landing-hero h1 {
  font-size: clamp(2.2rem, 4vw, 3.6rem); line-height: 1.12; margin: 14px 0 16px; letter-spacing: -.03em;
  color: var(--ink);
}
.landing h2, .landing h3 { color: var(--ink); }
.landing-hero p.lead { font-size: 1.125rem; color: var(--muted); max-width: 36rem; }
.hero-visual {
  min-height: 340px; padding: 22px;
}
.pulse-dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--brand);
  box-shadow: 0 0 0 0 var(--brand-glow);
  animation: pulse 1.8s infinite;
}
.landing-stats, .landing-features, .landing-steps, .landing-cta {
  padding: 18px 8vw 8px;
}
.landing-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.landing-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding-top: 28px; padding-bottom: 12px; }
.landing-stats .card:nth-child(1), .landing-features .card:nth-child(1) { animation-delay: .05s; }
.landing-stats .card:nth-child(2), .landing-features .card:nth-child(2) { animation-delay: .10s; }
.landing-stats .card:nth-child(3), .landing-features .card:nth-child(3) { animation-delay: .15s; }
.landing-stats .card:nth-child(4), .landing-features .card:nth-child(4) { animation-delay: .20s; }
.landing-features .card:nth-child(5) { animation-delay: .25s; }
.landing-features .card:nth-child(6) { animation-delay: .30s; }
.landing-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature-icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-soft); color: var(--brand);
  margin-bottom: 12px;
}
.landing-cta-box {
  margin: 28px 8vw 12px;
  padding: 36px;
  text-align: center;
}
.landing .site-footer { padding: 28px 8vw 36px; }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes shine { to { background-position: -200% 0; } }
@keyframes pulse {
  70% { box-shadow: 0 0 0 12px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.duty-swatch, .duty-cell {
  width: 22px; height: 22px; border-radius: 6px; display: inline-block; vertical-align: middle;
  border: 1px solid var(--line); background: var(--bg-2);
}
.duty-cell { cursor: pointer; }
.duty-off { background: var(--bg-2); }
.duty-ok { background: #0f766e; border-color: #0f766e; }
.duty-sup { background: #f59e0b; border-color: #f59e0b; }
.duty-gap { background: #b91c1c; border-color: #b91c1c; }
.shift-timeline {
  position: relative; height: 72px; border-radius: 14px;
  background: linear-gradient(90deg, var(--bg-2), var(--card-2));
  border: 1px solid var(--line); overflow: hidden;
}
.shift-block {
  position: absolute; top: 10px; height: 52px; border-radius: 10px;
  color: #fff; font-size: 11px; font-weight: 700; padding: 8px 10px;
  overflow: hidden; white-space: nowrap;
  box-shadow: 0 8px 18px rgba(0,0,0,.18);
}
.shift-card { padding: 16px 18px; min-height: 150px; cursor: pointer; }
.shift-card .swatch { width: 100%; height: 6px; border-radius: 999px; margin-bottom: 12px; }

.staff-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
.staff-card { padding: 16px 18px; cursor: pointer; min-height: 168px; }
.staff-card .avatar {
  width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand-light), var(--brand-dark));
  color: #fff; font-weight: 700;
}
.staff-card .name { font-weight: 700; margin-top: 10px; }
.int-card { padding: 16px 18px; min-height: 188px; }
.int-card .int-code { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.int-card .int-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.profile-dl { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; font-size: 13px; }
.profile-dl dt { color: var(--muted); }
.profile-dl dd { margin: 0; }
.drawer { width: min(980px, 100%); }
.drawer-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  padding: 18px 22px; border-bottom: 1px solid var(--line);
}
.drawer-body { padding: 18px 22px 24px; }
.audit-json {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px; line-height: 1.45;
  background: var(--bg-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; overflow: auto; white-space: pre-wrap; word-break: break-word;
}
#audit-table tbody tr[data-audit] { cursor: pointer; }
.tab-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.shift-req-row { align-items: center; }
.rpt-letterhead, .rpt-letterfoot, .rpt-print-banner { display: none; }
body.pdf-doc {
  background: #fff !important;
  background-image: none !important;
  color: #0b1f3a;
  padding: 18px 22px 28px;
  min-height: auto;
  color-scheme: light;
}
body.pdf-doc .rpt-letterhead,
body.pdf-doc .rpt-letterfoot { display: block; }
body.pdf-doc .rpt-letterhead {
  margin: 0 0 12px; padding: 0 0 12px; border-bottom: 2px solid #1d6fd6;
}
body.pdf-doc .rpt-letterhead-top {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  padding-bottom: 10px; border-bottom: 1px solid #d7e3f2;
}
body.pdf-doc .rpt-brand { display: flex; align-items: center; gap: 12px; }
body.pdf-doc .rpt-mark {
  width: 36px; height: 36px; border-radius: 8px;
  background: #fff; color: #1d6fd6; border: 2px solid #1d6fd6;
  font-weight: 800; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
body.pdf-doc .rpt-product {
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  font-weight: 700; color: #1d6fd6; margin-bottom: 2px;
}
body.pdf-doc .rpt-lab { font-size: 16px; font-weight: 700; color: #082445; letter-spacing: -.02em; }
body.pdf-doc .rpt-doc-meta { text-align: right; }
body.pdf-doc .rpt-doc-kicker {
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  font-weight: 700; color: #1d6fd6;
}
body.pdf-doc .rpt-doc-ref { font-size: 12px; font-weight: 600; color: #082445; margin-top: 2px; font-variant-numeric: tabular-nums; }
body.pdf-doc .rpt-doc-class { font-size: 10px; color: #5b6f8a; margin-top: 4px; }
body.pdf-doc .rpt-letterhead-title { margin: 12px 0 10px; }
body.pdf-doc .rpt-letterhead-title h1 {
  margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.03em; color: #082445;
}
body.pdf-doc .rpt-letterhead-title p { margin: 4px 0 0; font-size: 11px; color: #5b6f8a; max-width: 90%; }
body.pdf-doc .rpt-meta-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 16px;
  margin: 0; padding: 10px 12px; background: #f3f7fc;
  border: 1px solid #d7e3f2; border-radius: 8px;
}
body.pdf-doc .rpt-meta-grid dt {
  font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: #5b6f8a; font-weight: 600;
}
body.pdf-doc .rpt-meta-grid dd { margin: 2px 0 0; font-size: 12px; font-weight: 600; color: #082445; }
body.pdf-doc .rpt-table-card {
  border: 1px solid #d7e3f2; border-radius: 8px; overflow: visible; padding: 0; background: #fff;
}
body.pdf-doc table.data { font-size: 12px; }
body.pdf-doc table.data th {
  font-size: 10px; letter-spacing: .08em; color: #082445; background: #e8f1fb; font-weight: 700;
  border-bottom: 2px solid #1d6fd6;
}
body.pdf-doc table.data tbody tr:nth-child(even) td { background: #f7fafc; }
body.pdf-doc .rpt-letterfoot {
  margin-top: 14px; padding-top: 8px; border-top: 1px solid #d7e3f2;
}
body.pdf-doc .rpt-letterfoot-row {
  display: flex; justify-content: space-between; gap: 16px;
  font-size: 11px; color: #5b6f8a;
}
body.pdf-doc .pdf-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin: 0 0 16px; padding: 10px 12px;
  background: #f3f7fc; border: 1px solid #d7e3f2; border-radius: 10px;
}
body.pdf-doc .pdf-toolbar p { margin: 0; font-size: 12px; color: #5b6f8a; }
.tab-btn {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 999px; padding: 8px 14px; font-weight: 600; cursor: pointer;
}
.tab-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.skill-group { margin-bottom: 22px; }
.skill-group h2 { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.skill-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.comp-matrix { border-collapse: separate; border-spacing: 3px; min-width: 720px; font-size: 11px; }
.comp-matrix .sticky { position: sticky; left: 0; background: var(--card); z-index: 1; min-width: 160px; text-align: left; padding: 6px 8px; }
.matrix-cell {
  width: 28px; height: 28px; border-radius: 6px; display: block;
  border: 1px solid var(--line); background: var(--bg-2);
}
.lv-not_trained { background: #94a3b8; }
.lv-training { background: #f59e0b; }
.lv-supervised { background: #fb923c; }
.lv-competent { background: #0f766e; }
.lv-advanced { background: #1d6fd6; }
.lv-trainer { background: #7c3aed; }
.lv-expired { background: #b91c1c; }
.comp-swatch { width: 12px; height: 12px; border-radius: 4px; display: inline-block; margin-right: 4px; vertical-align: middle; }
.set-perm-mod { margin-bottom: 18px; }
.set-perm-mod h3 {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 8px; font-weight: 700;
}
.set-perm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.set-perm-item {
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px;
  background: var(--card-2); display: flex; align-items: center; gap: 8px; font-size: 13px;
}
.set-rule {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  margin-bottom: 8px; background: var(--card-2);
}

@media (max-width: 1024px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 50; transform: translateX(-100%); }
  .sidebar.open { transform: none; }
  .sidebar-overlay { display: none; position: fixed; inset: 0; background: var(--overlay); z-index: 40; }
  .sidebar-overlay.open { display: block; }
  .landing-hero, .landing-stats, .landing-features, .landing-steps { grid-template-columns: 1fr; }
  .staff-grid, .skill-cards { grid-template-columns: 1fr; }
  .set-perm-grid { grid-template-columns: 1fr; }
  .tr-pipeline { grid-template-columns: 1fr; }
  .roster-strip { grid-template-columns: repeat(2, 1fr); }
  .leave-cal { grid-template-columns: repeat(7, minmax(36px, 1fr)); }
}

.mt-1 { margin-top: 4px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.flex-col { flex-direction: column; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-8 { margin-top: 2rem; }
.mb-4 { margin-bottom: 1rem; }
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: 1fr 1fr; }

@media (prefers-reduced-motion: reduce) {
  .card, .chip, .nav-link, .btn, .toast, .modal { animation: none !important; transition: none !important; transform: none !important; }
}

@media print {
  html,
  html.dark,
  html.theme-dark,
  html.theme-light,
  html[data-theme="dark"],
  html[data-theme="light"] {
    color-scheme: light !important;
    --brand: #1d6fd6;
    --brand-dark: #1258b0;
    --brand-light: #4b93ea;
    --brand-soft: rgba(29, 111, 214, 0.12);
    --brand-glow: rgba(29, 111, 214, 0.28);
    --ink: #0b1f3a;
    --muted: #5b6f8a;
    --line: #d7e3f2;
    --bg: #ffffff;
    --bg-2: #e8f1fb;
    --card: #ffffff;
    --card-2: #f8fbff;
    --good: #0f766e;
    --warn: #b45309;
    --crit: #b91c1c;
    --info: #1d6fd6;
    --input-bg: #ffffff;
    --table-hover: transparent;
    --chip-bg: #ffffff;
  }
  .sidebar, .topbar, .no-print, .site-footer, .theme-toggle, #sidebar-overlay, #alert-host { display: none !important; }
  html, body, body.app-body,
  html.dark, html.theme-dark, html[data-theme="dark"],
  html.dark body, html[data-theme="dark"] body {
    background: #fff !important;
    background-image: none !important;
    color: #0b1f3a !important;
    color-scheme: light !important;
  }
  body.app-body, .flex.min-h-screen, .flex-1.flex.flex-col { display: block !important; min-height: 0 !important; }
  .main { margin: 0 !important; padding: 0 !important; }
  .card {
    animation: none !important; box-shadow: none !important; transform: none !important;
    background: #fff !important; color: #0b1f3a !important; border-color: #d7e3f2 !important;
  }
  .card::before { display: none; }
  .card:hover { transform: none !important; box-shadow: none !important; }
  table.data th, table.data td { color: #0b1f3a !important; border-color: #d7e3f2 !important; }
  table.data thead { display: table-header-group; }
  table.data tfoot { display: table-footer-group; }
  table.data tr { break-inside: avoid; page-break-inside: avoid; }
  table.data tr:hover td { background: transparent !important; }
  .roster-cell { min-height: 56px; }
  a[href]::after { content: none !important; }
  html[data-theme="dark"] .alert-crit,
  html.dark .alert-crit,
  html.theme-dark .alert-crit { background: rgba(185,28,28,.12) !important; border-color: rgba(185,28,28,.28) !important; color: #b91c1c !important; }
  html[data-theme="dark"] .alert-warn,
  html.dark .alert-warn,
  html.theme-dark .alert-warn { background: rgba(180,83,9,.12) !important; border-color: rgba(180,83,9,.28) !important; color: #b45309 !important; }

  body[data-page="reports"], body.pdf-doc {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    color-scheme: light !important;
    font-size: 11px;
    line-height: 1.4;
    color: #0b1f3a !important;
    background: #fff !important;
    padding: 0 !important;
  }
  :is(body[data-page="reports"], body.pdf-doc) #rpt-root { max-width: none; }
  :is(body[data-page="reports"], body.pdf-doc) .rpt-letterhead {
    display: block !important;
    margin: 0 0 12px;
    padding: 0 0 12px;
    border-bottom: 2px solid #1d6fd6;
    break-after: avoid;
    page-break-after: avoid;
  }
  :is(body[data-page="reports"], body.pdf-doc) .rpt-letterhead-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #d7e3f2;
  }
  :is(body[data-page="reports"], body.pdf-doc) .rpt-brand { display: flex; align-items: center; gap: 12px; }
  :is(body[data-page="reports"], body.pdf-doc) .rpt-mark {
    width: 36px; height: 36px; border-radius: 8px;
    background: #fff; color: #1d6fd6; border: 2px solid #1d6fd6;
    font-weight: 800; font-size: 18px;
    display: flex; align-items: center; justify-content: center;
  }
  :is(body[data-page="reports"], body.pdf-doc) .rpt-product {
    font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
    font-weight: 700; color: #1d6fd6; margin-bottom: 2px;
  }
  :is(body[data-page="reports"], body.pdf-doc) .rpt-lab { font-size: 16px; font-weight: 700; color: #082445; letter-spacing: -.02em; }
  :is(body[data-page="reports"], body.pdf-doc) .rpt-doc-meta { text-align: right; }
  :is(body[data-page="reports"], body.pdf-doc) .rpt-doc-kicker {
    font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
    font-weight: 700; color: #1d6fd6;
  }
  :is(body[data-page="reports"], body.pdf-doc) .rpt-doc-ref { font-size: 12px; font-weight: 600; color: #082445; margin-top: 2px; font-variant-numeric: tabular-nums; }
  :is(body[data-page="reports"], body.pdf-doc) .rpt-doc-class { font-size: 10px; color: #5b6f8a; margin-top: 4px; }
  :is(body[data-page="reports"], body.pdf-doc) .rpt-letterhead-title { margin: 12px 0 10px; }
  :is(body[data-page="reports"], body.pdf-doc) .rpt-letterhead-title h1 {
    margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.03em; color: #082445;
  }
  :is(body[data-page="reports"], body.pdf-doc) .rpt-letterhead-title p {
    margin: 4px 0 0; font-size: 11px; color: #5b6f8a; max-width: 90%;
  }
  :is(body[data-page="reports"], body.pdf-doc) .rpt-meta-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 16px;
    margin: 0; padding: 10px 12px; background: #f3f7fc;
    border: 1px solid #d7e3f2; border-radius: 8px;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  :is(body[data-page="reports"], body.pdf-doc) .rpt-meta-grid dt {
    font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: #5b6f8a; font-weight: 600;
  }
  :is(body[data-page="reports"], body.pdf-doc) .rpt-meta-grid dd { margin: 2px 0 0; font-size: 12px; font-weight: 600; color: #082445; }
  :is(body[data-page="reports"], body.pdf-doc) #rpt-kpis {
    display: flex !important; gap: 0 !important; margin: 0 0 12px !important;
    border: 1px solid #d7e3f2; border-radius: 8px; overflow: hidden;
    break-inside: avoid; page-break-inside: avoid;
  }
  :is(body[data-page="reports"], body.pdf-doc) #rpt-kpis .card.kpi {
    flex: 1; margin: 0; padding: 8px 12px; border: 0; border-right: 1px solid #d7e3f2;
    border-radius: 0; background: #fff !important; box-shadow: none !important;
  }
  :is(body[data-page="reports"], body.pdf-doc) #rpt-kpis .card.kpi:last-child { border-right: 0; }
  :is(body[data-page="reports"], body.pdf-doc) #rpt-kpis .kpi .label { font-size: 8px; letter-spacing: .1em; color: #5b6f8a !important; }
  :is(body[data-page="reports"], body.pdf-doc) #rpt-kpis .kpi .value { font-size: 16px; margin-top: 2px; color: #082445 !important; }
  :is(body[data-page="reports"], body.pdf-doc) .rpt-table-card {
    border: 1px solid #d7e3f2 !important; border-radius: 8px; overflow: visible; padding: 0;
    background: #fff !important;
  }
  :is(body[data-page="reports"], body.pdf-doc) .rpt-table-card::before { display: none; }
  :is(body[data-page="reports"], body.pdf-doc) .table-wrap { overflow: visible; }
  :is(body[data-page="reports"], body.pdf-doc) table.data { font-size: 10px; width: 100%; border-collapse: collapse; }
  :is(body[data-page="reports"], body.pdf-doc) table.data th {
    text-align: left; font-size: 8px; letter-spacing: .08em; text-transform: uppercase;
    color: #082445 !important; background: #e8f1fb !important; font-weight: 700;
    padding: 7px 8px; border-bottom: 2px solid #1d6fd6 !important;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  :is(body[data-page="reports"], body.pdf-doc) table.data td {
    padding: 6px 8px; border-bottom: 1px solid #e2eaf4 !important; color: #0b1f3a !important;
    vertical-align: middle;
  }
  :is(body[data-page="reports"], body.pdf-doc) table.data tbody tr:nth-child(even) td {
    background: #f7fafc !important;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  :is(body[data-page="reports"], body.pdf-doc) table.data .rpt-print-banner { display: table-row !important; }
  :is(body[data-page="reports"], body.pdf-doc) table.data .rpt-print-banner th {
    background: #f3f7fc !important; color: #1d6fd6 !important; font-size: 8px; letter-spacing: .1em;
    text-transform: uppercase; font-weight: 700; padding: 6px 8px;
    border-bottom: 0 !important; border-top: 2px solid #1d6fd6 !important;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  :is(body[data-page="reports"], body.pdf-doc) .badge {
    border: 1px solid currentColor !important; background: transparent !important;
    border-radius: 3px; padding: 0 5px; font-size: 8px; letter-spacing: .04em;
    text-transform: uppercase; font-weight: 700; line-height: 1.6;
  }
  :is(body[data-page="reports"], body.pdf-doc) .badge-good { color: #0f766e !important; }
  :is(body[data-page="reports"], body.pdf-doc) .badge-warn { color: #b45309 !important; }
  :is(body[data-page="reports"], body.pdf-doc) .badge-crit { color: #b91c1c !important; }
  :is(body[data-page="reports"], body.pdf-doc) .badge-info { color: #1d6fd6 !important; }
  :is(body[data-page="reports"], body.pdf-doc) .badge-muted { color: #5b6f8a !important; }
  :is(body[data-page="reports"], body.pdf-doc) .empty { padding: 24px 8px; }
  :is(body[data-page="reports"], body.pdf-doc) .empty i { display: none; }
  :is(body[data-page="reports"], body.pdf-doc) .rpt-letterfoot {
    display: block !important; margin-top: 14px; padding-top: 8px;
    border-top: 1px solid #d7e3f2; break-inside: avoid; page-break-inside: avoid;
  }
  :is(body[data-page="reports"], body.pdf-doc) .rpt-letterfoot-row {
    display: flex; justify-content: space-between; gap: 16px;
    font-size: 8.5px; color: #5b6f8a;
  }
}
