:root {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #475569;
  --text-light: #64748b;

  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eff6ff;

  --pto: #10b981;
  --pto-dark: #059669;
  --pto-soft: #ecfdf5;

  --stretch-bg: #dcfce7;
  --stretch-border: #86efac;

  --holiday: #f59e0b;
  --holiday-soft: #fffbeb;

  --work-bg: #eff6ff;
  --work-text: #1e40af;

  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 6px 24px rgba(15, 23, 42, 0.06);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

.hidden {
  display: none !important;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 1.15rem;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: #fff;
  font-weight: 800;
  font-size: 0.78rem;
  padding: 4px 8px;
  border-radius: 8px;
  letter-spacing: 0.02em;
}

.year-pill {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: 4px;
  vertical-align: middle;
}

.header-nav {
  display: flex;
  gap: 20px;
}

.header-nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

.header-nav a:hover {
  color: var(--primary);
}

/* Hero */
.hero {
  padding: 42px 0 28px;
  text-align: center;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary-dark);
  background: var(--primary-soft);
  border: 1px solid #bfdbfe;
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.hero h1 {
  margin: 0 auto 14px;
  font-size: clamp(1.9rem, 4vw, 2.85rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  max-width: 820px;
}

.hero h1 .accent {
  background: linear-gradient(135deg, var(--primary), #059669);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  margin: 0 auto;
  max-width: 700px;
  color: var(--text-muted);
  font-size: 1.04rem;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.control-card {
  padding: 24px;
  margin-bottom: 20px;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.shift-equiv {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--pto-dark);
  background: var(--pto-soft);
  padding: 2px 8px;
  border-radius: 999px;
}

.select-input,
.number-input,
.date-input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.select-input:focus,
.number-input:focus,
.date-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.hours-row {
  display: grid;
  grid-template-columns: 92px 1fr;
  align-items: center;
  gap: 12px;
}

.range-input {
  width: 100%;
  accent-color: var(--primary);
  cursor: pointer;
}

.field-hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-light);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
  margin-top: 2px;
}

.checkbox-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Sub-panels */
.sub-panel {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}

.sub-panel-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.sub-label {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text);
  margin-right: 8px;
}

.day-pills {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.day-pill {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.day-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.shift-len-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.compact-select {
  width: auto;
  min-width: 100px;
  height: 36px;
}

.date-input {
  width: auto;
  height: 38px;
}

/* Action Bar */
.action-bar {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.action-left,
.action-right {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.1s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-accent {
  background: var(--pto);
  color: #fff;
}

.btn-accent:hover {
  background: var(--pto-dark);
}

.btn-secondary {
  background: var(--surface-soft);
  color: var(--text);
  border-color: #cbd5e1;
}

.btn-secondary:hover {
  background: #e2e8f0;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.toast {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  font-size: 0.88rem;
  font-weight: 600;
}

/* KPI Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}

.stat-card.highlight {
  background: linear-gradient(135deg, #eff6ff, #ecfdf5);
  border-color: #93c5fd;
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-light);
}

.stat-value {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 4px 0 2px;
}

.stat-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Stretches */
.stretches-section {
  margin-bottom: 22px;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.25rem;
}

.section-note {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.stretches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.stretch-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--pto);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}

.stretch-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.stretch-days {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--pto-dark);
}

.stretch-badge {
  font-size: 0.76rem;
  font-weight: 700;
  background: var(--primary-soft);
  color: var(--primary-dark);
  padding: 2px 8px;
  border-radius: 999px;
}

.stretch-dates {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.stretch-meta {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 4px;
}

.empty-stretches {
  background: var(--surface);
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 18px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* Hack Banner */
.hack-banner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 22px;
}

.hack-icon {
  font-size: 1.4rem;
  line-height: 1.2;
}

.hack-banner h3 {
  margin: 0 0 4px;
  font-size: 0.98rem;
  color: #92400e;
}

.hack-banner p {
  margin: 0;
  font-size: 0.88rem;
  color: #78350f;
}

/* Legend */
.legend-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 20px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 500;
}

.swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

.swatch-work {
  background: var(--work-bg);
  border: 1px solid #93c5fd;
}

.swatch-pto {
  background: var(--pto);
}

.swatch-off {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
}

.swatch-stretch {
  background: var(--stretch-bg);
  border: 1px solid var(--stretch-border);
}

.swatch-holiday {
  background: var(--holiday-soft);
  border: 2px solid var(--holiday);
}

/* 12-Month Calendar Grid */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 36px;
}

.month-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}

.month-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.month-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.month-pto-pill {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--pto-dark);
  background: var(--pto-soft);
  padding: 2px 7px;
  border-radius: 999px;
}

.weekdays-row,
.days-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.weekdays-row {
  margin-bottom: 4px;
}

.weekday-cell {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-light);
  padding: 2px 0;
}

.day-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid transparent;
  user-select: none;
  transition: transform 0.08s ease, box-shadow 0.12s ease;
}

.day-cell.empty {
  pointer-events: none;
}

.day-cell.off {
  background: #f8fafc;
  color: var(--text-light);
}

.day-cell.work {
  background: var(--work-bg);
  color: var(--work-text);
  border-color: #bfdbfe;
  cursor: pointer;
}

.day-cell.work:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.16);
}

.day-cell.pto {
  background: var(--pto);
  color: #ffffff;
  border-color: var(--pto-dark);
  cursor: pointer;
  font-weight: 700;
}

.day-cell.pto:hover {
  background: var(--pto-dark);
}

.day-cell.off.in-stretch {
  background: var(--stretch-bg);
  color: #166534;
  border-color: var(--stretch-border);
}

.day-cell.holiday {
  box-shadow: inset 0 0 0 2px var(--holiday);
}

.day-tag {
  font-size: 0.56rem;
  line-height: 1;
  font-weight: 700;
  opacity: 0.85;
  margin-top: 1px;
}

/* Prose / SEO Content Sections */
.content-section {
  margin-bottom: 24px;
}

.prose-card {
  padding: 28px;
}

.prose-card h2 {
  margin: 0 0 12px;
  font-size: 1.35rem;
}

.prose-card p {
  margin: 0 0 16px;
  color: var(--text-muted);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead {
  background: var(--surface-soft);
}

th,
td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
}

tbody tr:last-child td {
  border-bottom: none;
}

.table-footnote {
  font-size: 0.8rem !important;
  color: var(--text-light) !important;
  margin-top: 10px !important;
  margin-bottom: 0 !important;
}

.holiday-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}

.holiday-item {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--holiday-soft);
  border: 1px solid #fde68a;
}

.holiday-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #92400e;
}

.holiday-date {
  font-size: 0.8rem;
  color: #78350f;
}

/* FAQ */
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 10px;
  background: #fafcff;
}

.faq-item:last-child {
  margin-bottom: 0;
}

.faq-item summary {
  font-weight: 700;
  cursor: pointer;
  color: var(--text);
}

.faq-item p {
  margin: 10px 0 0;
  font-size: 0.92rem;
}

/* Footer */
.site-footer {
  margin-top: 40px;
  padding: 28px 0 42px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  text-align: center;
}

.footer-inner p {
  margin: 0 0 6px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer-note {
  font-size: 0.8rem !important;
  color: var(--text-light) !important;
}

/* Responsive */
@media (max-width: 980px) {
  .control-grid {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .calendar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .header-nav {
    display: none;
  }
  .calendar-grid {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .control-card,
  .prose-card {
    padding: 18px;
  }
  .action-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .action-left,
  .action-right {
    width: 100%;
  }
  .btn {
    flex: 1;
  }
}

/* Print Styles */
@media print {
  .site-header,
  .action-bar,
  .hack-banner,
  .site-footer {
    display: none !important;
  }
  body {
    background: #fff;
  }
  .calendar-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
