/* ==========================================================================
   CSS STYLES - PROGRAM CURĂȚENIE CLASĂ 2026-2027 (IAȘI)
   Mobile-first, Responsive, Dark/Light Theme with Light Default
   ========================================================================== */

:root {
  /* Color Palette - Light Theme (Default) */
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-muted: #f1f5f9;
  --bg-secondary: #e2e8f0;

  --border-subtle: #e2e8f0;
  --border-medium: #cbd5e1;
  --border-focus: #3b82f6;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-inverted: #ffffff;

  /* Semantic Brand & Status Colors */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-subtle: #eff6ff;
  --primary-border: #bfdbfe;

  --duty-color: #2563eb;
  --duty-bg: #eff6ff;
  --duty-border: #93c5fd;

  --break-color: #be123c;
  --break-bg: #ffe4e6;
  --break-border: #fda4af;

  --holiday-color: #c2410c;
  --holiday-bg: #ffedd5;
  --holiday-border: #fdba74;

  --weekend-color: #94a3b8;
  --weekend-bg: #f8fafc;

  --today-ring: #2563eb;

  /* Elevation */
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.06);

  /* Typography */
  --font-sans: 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Fraunces', Georgia, serif;

  /* Dimensions */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --container-max: 1040px;
}

/* Dark Theme Overrides */
[data-theme="dark"] {
  --bg-app: #0b0f19;
  --bg-card: #131b2e;
  --bg-card-hover: #1b253d;
  --bg-muted: #1e293b;
  --bg-secondary: #28354d;

  --border-subtle: #243048;
  --border-medium: #334155;
  --border-focus: #60a5fa;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-inverted: #0f172a;

  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-subtle: rgba(59, 130, 246, 0.15);
  --primary-border: rgba(59, 130, 246, 0.35);

  --duty-color: #60a5fa;
  --duty-bg: rgba(59, 130, 246, 0.15);
  --duty-border: rgba(96, 165, 250, 0.3);

  --break-color: #fb7185;
  --break-bg: rgba(244, 63, 94, 0.15);
  --break-border: rgba(251, 113, 133, 0.3);

  --holiday-color: #fb923c;
  --holiday-bg: rgba(249, 115, 22, 0.15);
  --holiday-border: rgba(251, 146, 60, 0.3);

  --weekend-color: #64748b;
  --weekend-bg: #0d1322;

  --today-ring: #60a5fa;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.25s ease, color 0.25s ease;
  overflow-x: hidden;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  text-decoration: underline;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  touch-action: manipulation;
}

/* Main Container Shell */
.shell {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 1rem 1rem 3rem 1rem;
  flex: 1;
}

@media (min-width: 768px) {
  .shell {
    padding: 1.5rem 2rem 4rem 2rem;
  }
}

/* ==========================================================================
   Header & Topbar
   ========================================================================== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0.75rem;
  z-index: 40;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  color: var(--text-main);
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: linear-gradient(135deg, var(--primary), #4338ca);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  overflow: hidden;
}

.brand-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

.brand-title {
  font-size: 1.125rem;
  letter-spacing: -0.3px;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
}

.nav-link {
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.nav-link:hover {
  color: var(--text-main);
  background-color: var(--bg-muted);
  text-decoration: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.theme-toggle {
  width: 2.375rem;
  height: 2.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background-color: var(--bg-muted);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  font-size: 1.1rem;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s;
}

.theme-toggle:hover {
  transform: scale(1.08);
  background-color: var(--border-subtle);
}

.theme-toggle:active {
  transform: scale(0.95);
}

[data-theme="light"] .theme-toggle .moon-icon {
  display: block;
}
[data-theme="light"] .theme-toggle .sun-icon {
  display: none;
}
[data-theme="dark"] .theme-toggle .moon-icon {
  display: none;
}
[data-theme="dark"] .theme-toggle .sun-icon {
  display: block;
  color: #facc15;
}

/* ==========================================================================
   Mobile Hamburger Menu
   ========================================================================== */
.hamburger {
  display: none;
  width: 2.25rem;
  height: 2.25rem;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-direction: column;
  border-radius: var(--radius-sm);
  background-color: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  transition: all 0.15s ease;
}

.hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background-color: var(--text-main);
  border-radius: 2px;
  transition: all 0.2s ease;
  transform-origin: center;
}

.hamburger.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.is-open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.hamburger.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-links {
  display: flex;
  gap: 0.25rem;
}

@media (max-width: 639px) {
  .hamburger {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0.5rem;
    flex-direction: column;
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    gap: 0.25rem;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    z-index: 50;
    min-width: 160px;
  }

  .nav-links.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nav-link {
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
  }
}

@media (min-width: 640px) {
  .hamburger {
    display: none !important;
  }

  .nav-links {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    flex-direction: row;
    background: none;
    border: none;
    padding: 0;
    box-shadow: none;
  }
}

/* ==========================================================================
   Typography & Shared Elements
   ========================================================================== */
.eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: 0.35rem;
}

h1 {
  font-family: var(--font-serif);
  font-size: 2.35rem;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--text-main);
  font-weight: 700;
}

h1 em {
  font-style: italic;
  color: var(--primary);
  background: linear-gradient(135deg, var(--primary), #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

h2 {
  font-family: var(--font-serif);
  font-size: 1.65rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text-main);
}

@media (min-width: 768px) {
  h1 {
    font-size: 3.25rem;
  }
  h2 {
    font-size: 2.1rem;
  }
}

.pill-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.pill-button.primary {
  background-color: var(--primary);
  color: #ffffff;
}
.pill-button.primary:hover {
  background-color: var(--primary-hover);
}

.pill-button.secondary {
  background-color: var(--primary-subtle);
  color: var(--primary);
  border: 1px solid var(--primary-border);
}
.pill-button.secondary:hover {
  background-color: var(--primary);
  color: #ffffff;
}

.pill-button.outline {
  background-color: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-medium);
}
.pill-button.outline:hover {
  background-color: var(--bg-muted);
  border-color: var(--text-muted);
}

.pill-button.ghost {
  background-color: transparent;
  color: var(--text-muted);
}
.pill-button.ghost:hover {
  background-color: var(--bg-muted);
  color: var(--text-main);
}

.pill-button.full-width {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
  margin-top: 1.75rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: 1.15fr 0.85fr;
    align-items: start;
    margin-top: 2.5rem;
  }
}

.hero-content {
  display: flex;
  flex-direction: column;
}

.hero-copy {
  margin-top: 0.85rem;
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 520px;
}

/* Today / Next Duty Card */
.today-card {
  margin-top: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 5px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.25rem 1.1rem 1.25rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.today-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.today-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.today-chip {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.6rem;
  background-color: var(--duty-bg);
  color: var(--duty-color);
  border-radius: var(--radius-full);
}

.today-number {
  font-size: 1.25rem;
  font-weight: 800;
  font-family: var(--font-serif);
  color: var(--primary);
  opacity: 0.85;
}

.today-name {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.today-date {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
  font-weight: 500;
}

.today-footer {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
}

.countdown-badge {
  font-weight: 600;
  color: var(--primary);
  background-color: var(--bg-muted);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
}

.duty-room-tag {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Quick Finder Card */
.quick-finder-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.finder-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.finder-icon {
  font-size: 1.35rem;
  background: var(--bg-muted);
  width: 2.4rem;
  height: 2.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.finder-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.finder-header p {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.finder-control-wrap {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.student-select {
  flex: 1;
  min-width: 180px;
  padding: 0.6rem 0.85rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text-main);
  background-color: var(--bg-muted);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.student-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-border);
}

.student-summary {
  background-color: var(--bg-muted);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  border: 1px solid var(--border-subtle);
  animation: fadeIn 0.2s ease-out;
}

.summary-stats {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.stat-count {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
}

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

.summary-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  max-height: 140px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.summary-date-pill {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  background-color: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.summary-date-pill:hover {
  background-color: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ==========================================================================
   Section Headers & Controls
   ========================================================================== */
.section-head {
  margin-top: 3rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .section-head {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
}

.calendar-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--bg-card);
  padding: 0.35rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.date-control {
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: var(--text-main);
  font-size: 1.1rem;
  font-weight: 700;
  transition: background-color 0.15s ease;
}

.date-control:hover {
  background-color: var(--bg-muted);
}

.month-label {
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0 0.5rem;
  min-width: 140px;
  text-align: center;
}

/* ==========================================================================
   Calendar Panel & Grid
   ========================================================================== */
.calendar-panel {
  margin-top: 1rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0.85rem;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

@media (min-width: 640px) {
  .calendar-panel {
    padding: 1.25rem;
  }
}

.weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

@media (min-width: 640px) {
  .calendar-grid {
    gap: 6px;
  }
}

/* Calendar Day Cell */
.cal-day {
  aspect-ratio: 1 / 1;
  min-height: 36px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
  gap: 0;
}

@media (min-width: 640px) {
  .cal-day {
    aspect-ratio: auto;
    min-height: 68px;
    padding: 0.3rem;
    border-radius: var(--radius-sm);
    justify-content: space-between;
  }
}

@media (min-width: 768px) {
  .cal-day {
    min-height: 76px;
    padding: 0.4rem;
  }
}

.cal-day:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  border-color: var(--border-medium);
  z-index: 2;
}

.cal-day:active {
  transform: scale(0.96);
  transition: transform 0.1s ease;
}

.cal-day-num {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1;
  text-align: center;
}

@media (max-width: 379px) {
  .cal-day-num {
    font-size: 0.65rem;
  }
}

@media (min-width: 640px) {
  .cal-day-num {
    font-size: 0.85rem;
  }
}

.cal-day.other-month {
  opacity: 0.25;
  cursor: default;
  pointer-events: none;
}

/* Cell Types matching the Image */
/* 1. School Day with Duty */
.cal-day.type-duty {
  background-color: var(--duty-bg);
  border-color: var(--duty-border);
}

.cal-day.type-duty .cal-day-num {
  color: var(--duty-color);
}

.cal-day-badge {
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--duty-color);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1;
  max-width: 100%;
}

@media (max-width: 379px) {
  .cal-day-badge {
    display: none;
  }
}

@media (min-width: 380px) and (max-width: 639px) {
  .cal-day-badge {
    font-size: 0.5rem;
    letter-spacing: -0.4px;
  }
}

@media (min-width: 640px) {
  .cal-day-badge {
    font-size: 0.65rem;
    margin-top: 0.2rem;
  }
}

/* 2. School Day without Duty (e.g. before rotation start 7-9 Sep) */
.cal-day.type-school-noduty {
  background-color: var(--bg-card);
}

/* 3. Vacation (Intervale de vacanță - pink/salmon) */
.cal-day.type-break {
  background-color: var(--break-bg);
  border-color: var(--break-border);
}

.cal-day.type-break .cal-day-num {
  color: var(--break-color);
}

.cal-day-note {
  font-size: 0.5rem;
  font-weight: 600;
  color: var(--break-color);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1;
  max-width: 100%;
}

@media (max-width: 379px) {
  .cal-day-note {
    display: none;
  }
}

@media (min-width: 380px) and (max-width: 639px) {
  .cal-day-note {
    font-size: 0.48rem;
  }
}

@media (min-width: 640px) {
  .cal-day-note {
    font-size: 0.6rem;
  }
}

/* 4. Legal Holiday (Sărbători legale / zile libere - orange/amber) */
.cal-day.type-holiday {
  background-color: var(--holiday-bg);
  border-color: var(--holiday-border);
}

.cal-day.type-holiday .cal-day-num {
  color: var(--holiday-color);
  font-weight: 800;
}

.cal-day-holiday-badge {
  font-size: 0.5rem;
  font-weight: 700;
  color: var(--holiday-color);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1;
  max-width: 100%;
}

@media (max-width: 379px) {
  .cal-day-holiday-badge {
    display: none;
  }
}

@media (min-width: 380px) and (max-width: 639px) {
  .cal-day-holiday-badge {
    font-size: 0.48rem;
  }
}

@media (min-width: 640px) {
  .cal-day-holiday-badge {
    font-size: 0.6rem;
  }
}

/* 5. Weekend (Sâmbătă / Duminică) */
.cal-day.type-weekend {
  background-color: var(--weekend-bg);
  border-color: transparent;
}

.cal-day.type-weekend .cal-day-num {
  color: var(--weekend-color);
}

/* Today highlight */
.cal-day.is-today {
  outline: 2px solid var(--today-ring);
  outline-offset: -1px;
}

/* Filter highlight */
.cal-day.is-filtered {
  outline: 2px solid var(--primary);
  background-color: var(--primary);
  color: #fff !important;
}

.cal-day.is-filtered .cal-day-num,
.cal-day.is-filtered .cal-day-badge {
  color: #fff !important;
}

/* Calendar Legend */
.legend {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.25rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: var(--radius-sm);
  display: inline-block;
}

.dot.duty {
  background-color: var(--duty-color);
}
.dot.break {
  background-color: var(--break-color);
}
.dot.holiday {
  background-color: var(--holiday-color);
}
.dot.weekend {
  background-color: var(--weekend-color);
}

/* ==========================================================================
   Upcoming Duties Section
   ========================================================================== */
.upcoming-section {
  margin-top: 3rem;
}

.section-head.compact {
  margin-top: 0;
  margin-bottom: 1rem;
}

.upcoming-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.assignments-scroller {
  overflow-x: auto;
  padding-bottom: 0.75rem;
  -webkit-overflow-scrolling: touch;
}

.assignments {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(210px, 1fr);
  gap: 0.85rem;
}

@media (min-width: 768px) {
  .assignments {
    grid-auto-columns: 220px;
  }
}

.assignment-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
  position: relative;
}

.assignment-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-border);
}

.assignment-card.is-current {
  border-color: var(--primary);
  background-color: var(--duty-bg);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-index {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--primary);
  background-color: var(--bg-muted);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
}

.card-relative {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.card-person {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 0.15rem;
}

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

/* ==========================================================================
   Team Section
   ========================================================================== */
.team-section {
  margin-top: 3.5rem;
}

.team-tools-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .team-tools-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.team-tools-row h2 {
  margin: 0;
}

.team-count-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.775rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  background-color: var(--primary-subtle);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-full);
}

.team-count-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.775rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  background-color: var(--primary-subtle);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-full);
}

/* Team Grid */
.team-grid {
  margin-top: 1.25rem;
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 0.5rem;
}

@media (min-width: 480px) {
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .team-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .team-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.team-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

.team-card:hover {
  border-color: var(--primary-border);
  background-color: var(--bg-card-hover);
}

.team-member-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  flex: 1;
}

.member-num {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--primary);
  background-color: var(--bg-muted);
  width: 1.8rem;
  height: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.member-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================================
   Modal Backdrop & Card (Phone Friendly)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal-backdrop.is-open {
  display: flex;
  opacity: 1;
}

.modal-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-xl);
  position: relative;
  transform: scale(0.95);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-backdrop.is-open .modal-card {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-size: 1.1rem;
  transition: all 0.15s ease;
}

.modal-close:hover {
  background-color: var(--bg-muted);
  color: var(--text-main);
}

.modal-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.5rem;
}

.modal-badge.duty {
  background-color: var(--duty-bg);
  color: var(--duty-color);
}
.modal-badge.break {
  background-color: var(--break-bg);
  color: var(--break-color);
}
.modal-badge.holiday {
  background-color: var(--holiday-bg);
  color: var(--holiday-color);
}
.modal-badge.weekend {
  background-color: var(--bg-muted);
  color: var(--text-muted);
}

.modal-date {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1rem;
}

.modal-body {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.modal-duty-box {
  background-color: var(--duty-bg);
  border: 1px solid var(--duty-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
}

.modal-duty-box .person-num {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--duty-color);
  text-transform: uppercase;
}

.modal-duty-box .person-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 0.2rem;
}

.modal-duty-box .person-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.modal-status-text {
  font-size: 0.95rem;
  color: var(--text-main);
  line-height: 1.4;
}

.modal-neighbor-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border-subtle);
}

/* ==========================================================================
   Toast Notification
   ========================================================================== */
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  z-index: 300;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.lightbox-backdrop.is-open {
  display: flex;
  opacity: 1;
}

.lightbox-figure {
  margin: 0;
  text-align: center;
  transform: scale(0.85);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lightbox-backdrop.is-open .lightbox-figure {
  transform: scale(1);
}

.lightbox-img {
  width: min(70vw, 380px);
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45),
    0 0 0 4px var(--bg-card),
    0 0 0 6px var(--primary);
  cursor: zoom-out;
}

.lightbox-caption {
  margin-top: 1rem;
  color: #e2e8f0;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.lightbox-close:hover,
.lightbox-close:focus-visible {
  background: rgba(255, 255, 255, 0.25);
  transform: rotate(90deg);
}

.brand-badge {
  cursor: zoom-in;
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background-color: var(--text-main);
  color: var(--text-inverted);
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 200;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
  margin-top: auto;
  padding: 2rem 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  background-color: var(--bg-card);
}

footer a {
  font-weight: 600;
  color: var(--primary);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
