:root {
  --bg: #070c18;
  --bg-alt: #141d35;
  --surface: #1e2a4a;
  --surface-hi: #2a3a60;
  --text: #f3f6ff;
  --muted: #b8c4dd;
  --accent: #5eb8ff;
  --accent-strong: #1e7fd6;
  --border: rgba(255, 255, 255, 0.14);
  --border-strong: rgba(255, 255, 255, 0.22);
  --radius: 12px;
  --max: 1100px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  scroll-behavior: smooth;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #cfe6ff; }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  background: rgba(11, 18, 32, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.3px;
}
.brand-logo { width: 32px; height: 32px; }
.brand-text { font-size: 1.05rem; }
.nav-links {
  list-style: none;
  display: flex;
  gap: 22px;
  margin: 0;
  padding: 0;
}
.nav-links a { color: var(--muted); font-size: 0.95rem; }
.nav-links a:hover { color: var(--text); }

/* Hero */
.hero {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px;
  background:
    radial-gradient(
      ellipse at top,
      rgba(62, 166, 255, 0.18),
      transparent 60%
    ),
    var(--bg);
}
.hero-inner { max-width: 780px; }
.hero-logo {
  width: 110px;
  height: 110px;
  margin-bottom: 24px;
  filter: drop-shadow(0 10px 30px rgba(62, 166, 255, 0.35));
}
.hero h1 {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  margin: 0 0 16px;
  letter-spacing: -0.5px;
  line-height: 1.15;
}
.tagline {
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  color: var(--muted);
  margin: 0 auto 32px;
  max-width: 620px;
}
.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--accent);
  color: #07203a;
}
.btn-primary:hover { background: #6ebeff; color: #07203a; }
.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* Sections */
.section { padding: 90px 0; }
.section-alt { background: var(--bg-alt); }
.section h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 0 0 32px;
  letter-spacing: -0.3px;
}

/* Grid of cards */
.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}
.card h3 {
  margin: 0 0 10px;
  font-size: 1.15rem;
  color: var(--text);
}
.card p { margin: 0; color: var(--muted); }

/* Section subtitle */
.section-sub {
  color: var(--muted);
  margin: -20px 0 28px;
  max-width: 640px;
}

/* Quick links */
.grid-links {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.link-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  color: var(--text);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.link-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  background: #1a2647;
  color: var(--text);
}
.link-icon { font-size: 1.6rem; }
.link-title { font-weight: 600; font-size: 1.05rem; }
.link-desc { color: var(--muted); font-size: 0.9rem; }

/* Team */
.grid-team {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.person {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
}
.avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #07203a;
  background: linear-gradient(135deg, #3ea6ff, #1e7fd6);
  letter-spacing: 1px;
}
.person h3 { margin: 0 0 4px; font-size: 1.05rem; }
.role { margin: 0 0 10px; color: var(--muted); font-size: 0.9rem; }
.person a { font-size: 0.9rem; }

/* Resources */
.res-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}
.res-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.res-list a { font-weight: 600; }
.res-list span { color: var(--muted); font-size: 0.9rem; }

/* Section title */
.sec-title {
  font-size: 1.1rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin: 28px 0 14px;
  font-weight: 600;
}

/* Ratios */
.ratios {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 8px;
}
.ratio {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ratio-label {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 1px;
}
.ratio-value { font-size: 1.5rem; font-weight: 700; }
.ratio-sub { color: var(--muted); font-size: 0.82rem; }
.bar {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 4px;
}
.bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* My Shifts list */
.my-shifts {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}
.my-shift {
  display: grid;
  grid-template-columns: 80px 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.my-shift.off {
  opacity: 0.55;
  grid-template-columns: 80px 1fr;
}
.ms-day { font-weight: 700; letter-spacing: 1px; color: var(--muted); }
.ms-time { font-size: 1.05rem; font-weight: 600; }
.ms-meta { color: var(--muted); font-size: 0.9rem; }
.ms-hrs {
  background: rgba(62,166,255,0.15);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}
.cta-row { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }

/* Requests tabs + forms */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tab:hover { color: var(--text); }
.tab.active {
  background: var(--accent);
  color: #07203a;
  border-color: var(--accent);
  font-weight: 600;
}
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 12px;
}
.form-card h2 { margin: 0 0 18px; font-size: 1.2rem; }
.req-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.req-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 0.85rem;
}
.req-form .full { grid-column: 1 / -1; }
.req-form input,
.req-form select,
.req-form textarea {
  background: var(--bg-alt);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: inherit;
}
.req-form input:focus,
.req-form select:focus,
.req-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chips label {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
}
.actions { display: flex; justify-content: flex-end; }

@media (max-width: 640px) {
  .req-form { grid-template-columns: 1fr; }
  .my-shift { grid-template-columns: 60px 1fr auto; gap: 10px; padding: 12px; }
  .my-shift .ms-meta { grid-column: 2 / -1; }
  .my-shift.off { grid-template-columns: 60px 1fr; }
}

/* Badge */
.badge {
  display: inline-block;
  background: rgba(62,166,255,0.15);
  color: var(--accent);
  border: 1px solid rgba(62,166,255,0.35);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 0 4px;
}

/* Schedule table */
.schedule-wrap { overflow-x: auto; }
table.sched {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9rem;
}
table.sched th, table.sched td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.sched thead th {
  background: #111a2e;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 1px;
}
table.sched td.name { font-weight: 600; }
table.sched td.role { color: var(--muted); }
table.sched td.off { color: #3f4c6b; text-align: center; }
table.sched td.shift span {
  display: inline-block;
  background: rgba(62,166,255,0.15);
  color: var(--accent);
  border: 1px solid rgba(62,166,255,0.30);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.82rem;
}
table.sched td.total { font-weight: 700; text-align: right; }
table.sched tr:hover td { background: rgba(255,255,255,0.02); }
.sticky { position: sticky; left: 0; background: var(--surface); }
table.sched thead th.sticky { background: #111a2e; z-index: 1; }

/* Dashboard */
.dashboard { padding: 40px 0 80px; }
.dash-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}
.dash-head h1 { margin: 0 0 4px; font-size: 1.8rem; }
.muted { color: var(--muted); margin: 0; }
.filter {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}
.filter select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.95rem;
}
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.kpi-label { color: var(--muted); font-size: 0.85rem; letter-spacing: 0.5px; text-transform: uppercase; }
.kpi-value { font-size: 1.6rem; font-weight: 700; }
.kpi-delta { font-size: 0.85rem; }
.kpi-delta.up { color: #5ee0a0; }
.kpi-delta.down { color: #ff8a8a; }
.charts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.chart-card h3 { margin: 0 0 12px; font-size: 1rem; color: var(--muted); font-weight: 600; }
.chart-card.wide { grid-column: 1 / -1; }
.note-small { color: var(--muted); font-size: 0.85rem; margin-top: 18px; text-align: center; }
@media (max-width: 720px) {
  .charts { grid-template-columns: 1fr; }
  .chart-card.wide { grid-column: auto; }
}

/* Announcements */
.announcements {
  display: grid;
  gap: 16px;
}
.note {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.note time {
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.note h3 { margin: 6px 0 8px; font-size: 1.1rem; }
.note p { margin: 0; color: var(--muted); }

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  background: var(--bg);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}
.footer-logo { width: 32px; height: 32px; }

@media (max-width: 560px) {
  .nav-links { gap: 14px; }
  .brand-text { display: none; }
}

/* ------------ Global responsive polish (2026-04-23) ------------
   Tightens container/nav padding on phones, wraps the dash-head hero,
   trims hero whitespace, and lets long nav lists scroll horizontally
   instead of overflowing. Applies to every page that uses styles.css. */

@media (max-width: 768px) {
  .container { padding: 0 16px; }
  .nav { padding: 10px 16px; flex-wrap: wrap; row-gap: 8px; }
  .nav-links { flex-wrap: wrap; gap: 12px 18px; row-gap: 8px; }
  .dash-head { flex-wrap: wrap; gap: 12px; }
  .dash-head h1 { font-size: 1.4rem; }
  .hero { padding: 48px 16px; min-height: auto; }
  .hero-logo { width: 80px; height: 80px; margin-bottom: 18px; }
  .charts { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .container { padding: 0 12px; }
  .nav { padding: 8px 12px; }
  .nav-links { gap: 10px 14px; font-size: 0.9rem; }
  .nav-links a { font-size: 0.88rem; }
  .kpi { padding: 14px 16px; }
  .kpi-value { font-size: 1.35rem; }
  .footer-inner { font-size: 0.8rem; flex-direction: column; gap: 4px; }
  .footer-logo { width: 24px; height: 24px; }
  .schedule-wrap { margin: 0 -12px; padding: 0 12px; } /* let table edge bleed to viewport */
}

/* Honor iOS / Android safe-area insets so the nav and content don't
   sit under notches when added to home screen as a PWA. */
@supports (padding: env(safe-area-inset-left)) {
  .nav,
  .container,
  .hero {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
}

/* ===== Version chip — universal page-version badge =====
   Appears on every page next to the page title or in the topbar.
   Format: MM-DD vN.M (e.g. 05-01 v1.3). Bump on every change to that
   page so we can verify deploys + reference versions in chat. */
.ver-chip {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 999px;
  background: rgba(244,183,64,0.22); color: #0f172a;
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums; white-space: nowrap;
  margin-left: 8px; vertical-align: middle;
}

/* ===== Cross-document view transitions =====
   Browsers that support the View Transitions API (Chrome 126+,
   Edge 126+, Safari 18+) get a smooth crossfade between pages
   instead of the harsh white flash. Falls back gracefully — older
   browsers just navigate normally. No JS, no framework needed. */
@view-transition {
  navigation: auto;
}
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 180ms;
  animation-timing-function: ease;
}

/* (Removed: global <main> fade-in. Mario directive 2026-05-01 — only
   Schedule and Next Week needed it; the fade made roster/monitor/etc.
   feel slow when they were already fast. The schedule grid keeps its
   targeted fade-in via body.xl-ready in excel-schedule.html.) */

/* ===== Update toast + chip flash =====
   Brief confirmation after a successful update so the manager can see
   the version they're now on. Auto-dismisses, doesn't block any UI. */
.sbi-toast {
  position: fixed; top: 16px; right: 16px; z-index: 9999;
  display: inline-flex; align-items: center; gap: 8px;
  background: #166534; color: #fff; padding: 10px 16px;
  border-radius: 8px; font-size: 13px; font-weight: 600;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  animation: sbi-toast-in 0.25s ease both, sbi-toast-out 0.25s ease 3s forwards;
}
.sbi-toast-ic { font-size: 14px; line-height: 1; }
@keyframes sbi-toast-in  { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes sbi-toast-out {                                                  to { opacity: 0; transform: translateY(-12px); } }

/* Brief 2.5s highlight on the version chip when it changes vs the
   prior visit. Helps the eye land on what's new without being noisy. */
.ver-chip-flash {
  animation: sbi-chip-flash 0.6s ease 0s 4;
}
@keyframes sbi-chip-flash {
  0%, 100% { transform: scale(1);    box-shadow: 0 0 0 0   rgba(244,183,64,0); }
  50%      { transform: scale(1.08); box-shadow: 0 0 0 4px rgba(244,183,64,0.45); }
}
