/* ============================================================
   Design Tokens — matching UnterhaltsPlan / FamilienKalender Demo
   ============================================================ */
:root {
  --forest-900: oklch(0.24 0.045 155);
  --forest-800: oklch(0.32 0.055 155);
  --forest-700: oklch(0.42 0.075 152);
  --forest-600: oklch(0.55 0.10 150);
  --forest-500: oklch(0.66 0.10 148);
  --forest-100: oklch(0.94 0.025 150);
  --forest-50:  oklch(0.97 0.012 150);

  --blue-700: oklch(0.38 0.12 240);
  --blue-100: oklch(0.93 0.04 240);

  --purple-700: oklch(0.42 0.14 295);
  --purple-100: oklch(0.94 0.04 295);

  --gray-400: oklch(0.70 0.00 0);
  --gray-100: oklch(0.94 0.00 0);

  --cream:   oklch(0.985 0.010 85);
  --cream-2: oklch(0.970 0.014 82);

  --ink-900: oklch(0.18 0.015 250);
  --ink-700: oklch(0.35 0.012 250);
  --ink-400: oklch(0.58 0.010 250);
  --ink-200: oklch(0.82 0.006 250);

  --surface: #ffffff;
  --border:  oklch(0.88 0.008 250);

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow:    0 2px 8px rgba(0,0,0,0.10);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);

  --font: 'Inter', system-ui, -apple-system, sans-serif;

  --header-h: 56px;
}

/* ============================================================
   Reset
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--cream);
  color: var(--ink-900);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }
a { color: inherit; text-decoration: none; }

/* ============================================================
   Header
   ============================================================ */
.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.header-inner {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.header-brand { display: flex; align-items: center; gap: 12px; }
.logo-link:hover .logo { color: var(--forest-700); }
.logo {
  font-size: 1rem;
  font-weight: 700;
  color: var(--forest-900);
  letter-spacing: -0.02em;
  transition: color 0.15s;
}
.app-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--forest-700);
  background: var(--forest-50);
  border: 1px solid var(--forest-100);
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: 0.01em;
}
.header-nav { display: flex; gap: 8px; }

/* ============================================================
   Local Notice
   ============================================================ */
.local-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--forest-50);
  border-bottom: 1px solid var(--forest-100);
  color: var(--forest-800);
  font-size: 0.82rem;
  padding: 8px 20px;
}

/* ============================================================
   App Layout — 3 columns on desktop, stacked on mobile
   ============================================================ */
.app-layout {
  max-width: 1380px;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  grid-template-columns: 240px 1fr 280px;
  gap: 16px;
  align-items: start;
}

/* ============================================================
   Panels
   ============================================================ */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.panel-title {
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-400);
  margin-bottom: 16px;
}

/* ============================================================
   Setup Panel
   ============================================================ */
.setup-panel { display: flex; flex-direction: column; gap: 12px; }
.setup-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }

.legend { margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--border); }
.legend-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-400);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.legend-items { display: flex; flex-wrap: wrap; gap: 6px; }

/* ============================================================
   Form elements
   ============================================================ */
.field { display: flex; flex-direction: column; gap: 4px; }
.field-row { display: flex; gap: 8px; }
.field-row .field { flex: 1; }
.field-label {
  font-size: 0.80rem;
  font-weight: 600;
  color: var(--ink-700);
}
.input, .select, .textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--cream);
  color: var(--ink-900);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--forest-600);
  box-shadow: 0 0 0 3px var(--forest-100);
}
.input-sm { padding: 6px 8px; font-size: 0.85rem; }
.textarea { resize: vertical; min-height: 60px; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s, transform 0.08s;
  white-space: nowrap;
  cursor: pointer;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--forest-800);
  color: #fff;
}
.btn-primary:hover { background: var(--forest-900); }

.btn-secondary {
  background: var(--forest-100);
  color: var(--forest-800);
  border: 1px solid var(--forest-100);
}
.btn-secondary:hover { background: var(--forest-50); border-color: var(--forest-500); }

.btn-ghost {
  background: transparent;
  color: var(--ink-700);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--cream-2); border-color: var(--ink-200); }

.btn-sm { padding: 6px 12px; font-size: 0.82rem; }
.btn-danger {
  background: transparent;
  color: oklch(0.45 0.15 25);
  border: none;
  padding: 2px 6px;
  font-size: 0.80rem;
}
.btn-danger:hover { color: oklch(0.35 0.18 25); }

/* ============================================================
   Calendar
   ============================================================ */
.calendar-panel { min-height: 320px; }
.calendar-header { margin-bottom: 12px; }

.calendar-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--ink-400);
  font-size: 0.9rem;
  text-align: center;
  padding: 20px;
}

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

.cal-weekday {
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  color: var(--ink-400);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 0 8px;
}
.cal-weekday.weekend { color: var(--ink-400); }

.cal-empty { /* placeholder cell */ }

.cal-day {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.12s, transform 0.08s, box-shadow 0.12s;
  min-height: 36px;
  font-size: 0.82rem;
  font-weight: 500;
  user-select: none;
}
.cal-day:hover { transform: scale(1.06); box-shadow: var(--shadow); z-index: 1; }
.cal-day.selected { border-color: var(--ink-900) !important; box-shadow: var(--shadow-md); z-index: 2; }

.cal-day.mother   { background: var(--forest-100); color: var(--forest-900); }
.cal-day.father   { background: var(--blue-100);   color: var(--blue-700); }
.cal-day.shared   { background: var(--purple-100); color: var(--purple-700); }
.cal-day.unclear  { background: var(--gray-100);   color: var(--ink-400); }

.day-num { font-size: 0.82rem; font-weight: 600; line-height: 1; }

.day-indicators {
  display: flex;
  gap: 2px;
  position: absolute;
  bottom: 3px;
}
.dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
}
.dot-holiday  { background: oklch(0.70 0.15 60); }
.dot-handover { background: oklch(0.48 0.16 25); }

/* ============================================================
   Legend items
   ============================================================ */
.legend-item {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
}
.legend-item.mother  { background: var(--forest-100); color: var(--forest-900); }
.legend-item.father  { background: var(--blue-100);   color: var(--blue-700); }
.legend-item.shared  { background: var(--purple-100); color: var(--purple-700); }
.legend-item.unclear { background: var(--gray-100);   color: var(--ink-400); }

/* ============================================================
   Detail / Editor Panel
   ============================================================ */
.detail-panel { display: flex; flex-direction: column; gap: 0; }
.detail-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  color: var(--ink-400);
  font-size: 0.88rem;
  text-align: center;
}
.day-editor { display: flex; flex-direction: column; gap: 16px; }
#dayEditor { scroll-margin-top: 80px; }
.editor-date {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink-900);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* Care buttons */
.care-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.care-btn {
  padding: 8px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.80rem;
  font-weight: 600;
  border: 2px solid transparent;
  background: var(--cream-2);
  color: var(--ink-700);
  transition: all 0.12s;
  cursor: pointer;
}
.care-btn:hover { border-color: var(--ink-200); }
.care-btn.active[data-owner="mother"]  { background: var(--forest-100); color: var(--forest-900); border-color: var(--forest-500); }
.care-btn.active[data-owner="father"]  { background: var(--blue-100);   color: var(--blue-700);   border-color: var(--blue-700); }
.care-btn.active[data-owner="shared"]  { background: var(--purple-100); color: var(--purple-700); border-color: var(--purple-700); }
.care-btn.active[data-owner="unclear"] { background: var(--gray-100);   color: var(--ink-400);   border-color: var(--gray-400); }

/* Toggle */
.toggle-label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.toggle-input { display: none; }
.toggle-track {
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: var(--ink-200);
  position: relative;
  transition: background 0.15s;
  flex-shrink: 0;
}
.toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
  box-shadow: var(--shadow-sm);
}
.toggle-input:checked + .toggle-track { background: var(--forest-600); }
.toggle-input:checked + .toggle-track::after { transform: translateX(16px); }
.toggle-text { font-size: 0.85rem; color: var(--ink-700); }

/* Handover section */
.section-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-400);
  margin-bottom: 10px;
}
.handover-form { display: flex; flex-direction: column; gap: 8px; }
.handover-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.handover-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: var(--cream-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--ink-700);
}
.handover-item-info { flex: 1; }

/* ============================================================
   Statistics
   ============================================================ */
.stats-section { padding: 0 20px 16px; max-width: 1380px; margin: 0 auto; }
.stats-inner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.stats-title {
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-400);
  margin-bottom: 16px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}
.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 8px;
  background: var(--cream);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  text-align: center;
}
.stat-card.mother-stat { background: var(--forest-50); border-color: var(--forest-100); }
.stat-card.father-stat { background: var(--blue-100); border-color: oklch(0.85 0.05 240); }
.stat-card.shared-stat { background: var(--purple-100); border-color: oklch(0.86 0.05 295); }
.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--ink-900);
  line-height: 1;
}
.stat-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--ink-400);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ============================================================
   Export
   ============================================================ */
.export-section { padding: 0 20px 24px; max-width: 1380px; margin: 0 auto; }
.export-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.export-heading {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink-900);
  margin: 0;
}
.export-desc {
  font-size: 0.85rem;
  color: var(--ink-400);
  margin: 0;
}
.export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.export-note { font-size: 0.82rem; color: var(--ink-400); margin: 0; }

/* Import preview panel */
.import-preview {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 4px;
}
.import-preview-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--forest-900);
  margin: 0 0 10px;
}
.import-preview-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.import-meta-row {
  display: flex;
  gap: 8px;
  font-size: 0.83rem;
  color: var(--ink-700);
  align-items: baseline;
}
.import-meta-row span { color: var(--ink-400); min-width: 130px; flex-shrink: 0; }
.import-meta-row strong { color: var(--ink-900); }
.import-meta-row em { color: var(--ink-600); word-break: break-all; }
.import-meta-note {
  font-style: italic;
  color: oklch(0.45 0.10 60);
  background: oklch(0.97 0.025 80);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
}
.import-preview-warning {
  font-size: 0.80rem;
  color: var(--ink-600);
  font-style: italic;
  margin: 0 0 12px;
  line-height: 1.5;
}
.import-preview-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* Import status inline message */
.import-status {
  font-size: 0.82rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-top: 4px;
}
.import-status--success {
  color: var(--forest-700);
  background: var(--forest-50);
  border: 1px solid var(--forest-100);
}
.import-status--error {
  color: oklch(0.45 0.15 25);
  background: #fff5f5;
  border: 1px solid oklch(0.85 0.08 25);
}
.import-status--neutral {
  color: var(--ink-600);
  background: var(--cream);
  border: 1px solid var(--border);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: 1.5px solid var(--forest);
  background: transparent;
  color: var(--forest);
  transition: background 0.15s, color 0.15s;
}
.btn-secondary:hover { background: var(--forest); color: #fff; }
.btn-secondary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

/* ============================================================
   Print-only summary (hidden on screen)
   ============================================================ */
.print-summary { display: none; }

/* ============================================================
   Footer
   ============================================================ */
.app-footer {
  max-width: 1380px;
  margin: 0 auto;
  padding: 16px 20px 32px;
}
.disclaimer {
  font-size: 0.78rem;
  color: var(--ink-400);
  background: oklch(0.98 0.020 80);
  border: 1px solid oklch(0.88 0.040 80);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  line-height: 1.5;
}

/* ============================================================
   Responsive — Mobile ≤ 720px
   ============================================================ */
@media (max-width: 900px) {
  .app-layout {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 520px) {
  .app-layout { padding: 12px; gap: 12px; }
  .stats-section, .export-section, .app-footer { padding-left: 12px; padding-right: 12px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .header-nav .btn-ghost:last-child { display: none; }
  .care-buttons { grid-template-columns: 1fr 1fr; }
  .care-btn { min-height: 44px; font-size: 0.875rem; }
  .cal-day { font-size: 0.82rem; min-height: 44px; padding: 3px 2px; }
  .export-actions { flex-direction: column; align-items: flex-start; }
  .handover-form .field-row { flex-direction: column; }
  .month-nav { gap: 4px; }
  .month-nav-title { font-size: 1rem; }
  .stat-value { font-size: 1.3rem; }
  .stat-label { font-size: 0.75rem; }
  input[type="text"],
  input[type="time"],
  input[type="date"],
  select,
  textarea { font-size: 16px; }
}

/* ============================================================
   Month navigation
   ============================================================ */
.month-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.month-nav-title {
  flex: 1;
  text-align: center;
  margin-bottom: 0;
}

/* ============================================================
   Empty state actions
   ============================================================ */
.calendar-empty { flex-direction: column; gap: 12px; }
.empty-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* ============================================================
   Save status
   ============================================================ */
.save-status {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--forest-700);
  background: var(--forest-50);
  border: 1px solid var(--forest-100);
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.save-status--error { color: oklch(0.45 0.15 25); background: #fff5f5; border-color: oklch(0.85 0.08 25); }

/* ============================================================
   Migration banner
   ============================================================ */
.migration-banner {
  background: oklch(0.97 0.025 80);
  border-bottom: 1px solid oklch(0.88 0.06 80);
  color: oklch(0.40 0.08 60);
  font-size: 0.82rem;
  padding: 8px 20px;
  text-align: center;
}

/* ============================================================
   Inline field feedback
   ============================================================ */
.field-error {
  font-size: 0.80rem;
  color: oklch(0.45 0.15 25);
  margin-top: 4px;
}
.field-success {
  font-size: 0.80rem;
  color: var(--forest-700);
  margin-top: 4px;
}
.field-feedback { font-size: 0.80rem; margin-top: 6px; }

/* ============================================================
   Handover empty state
   ============================================================ */
.handover-empty {
  font-size: 0.80rem;
  color: var(--ink-400);
  padding: 8px 0;
  font-style: italic;
}

/* ============================================================
   Holiday range section
   ============================================================ */
.holiday-range-section {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ============================================================
   Multi-Month Overview
   ============================================================ */
.mm-section {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 20px 24px;
}
.mm-section-inner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.mm-section-title {
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-400);
  margin-bottom: 4px;
}
.mm-section-subtitle {
  font-size: 0.82rem;
  color: var(--ink-400);
  margin-bottom: 16px;
}

#multi-month-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.mm-card {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mm-card--active {
  border-color: var(--forest-700);
  box-shadow: 0 0 0 2px var(--forest-100);
}
.mm-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.mm-card-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--forest-900);
}
.mm-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}
.mm-badge--open {
  background: oklch(0.95 0.08 60);
  color: oklch(0.45 0.14 60);
}
.mm-badge--done {
  background: var(--forest-50);
  color: var(--forest-700);
}
.mm-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 0.82rem;
  color: var(--ink-700);
}
.mm-card-stats strong { color: var(--forest-800); }
.mm-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.mm-updated { font-size: 0.75rem; color: var(--ink-400); }
.mm-open-btn {
  background: var(--forest-800);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
  min-height: 36px;
}
.mm-open-btn:hover { background: var(--forest-900); }
.mm-empty {
  color: var(--ink-400);
  font-size: 0.88rem;
  padding: 4px 0;
}
.mm-hint { color: var(--ink-400); font-size: 0.82rem; margin-top: 8px; }
.mm-totals-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-400);
  margin: 20px 0 10px;
}
.mm-totals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}
.mm-total-card {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mm-total-card span {
  font-size: 0.72rem;
  color: var(--ink-400);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}
.mm-total-card strong {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink-900);
  line-height: 1;
}

@media (max-width: 520px) {
  .mm-section { padding-left: 12px; padding-right: 12px; }
  #multi-month-list { grid-template-columns: 1fr; }
  .mm-totals-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   Print styles
   ============================================================ */
@media print {
  body { background: #fff !important; color: #111 !important; }

  .app-header,
  .local-notice,
  .setup-panel,
  .detail-panel,
  .export-section,
  .mm-section,
  .app-footer,
  .calendar-header .btn,
  #detailPanel { display: none !important; }

  .app-layout {
    display: block;
    padding: 0;
    max-width: none;
  }
  .calendar-panel {
    border: none;
    box-shadow: none;
    padding: 0;
    background: #fff !important;
  }
  .stats-section { padding: 0; }
  .stats-inner { border: none; box-shadow: none; padding: 0; background: #fff !important; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .stat-card { border: 1px solid #ccc; background: #fff !important; box-shadow: none !important; }
  .stat-value { color: #111 !important; }
  .stat-label { color: #444 !important; }

  .print-summary {
    display: block !important;
    padding: 0 0 16px;
    margin-bottom: 16px;
    border-bottom: 2px solid #333;
    background: #fff !important;
  }
  .print-meta { font-size: 0.88rem; color: #333; margin-bottom: 14px; line-height: 1.6; }
  .print-section-heading {
    font-size: 0.92rem;
    font-weight: 600;
    color: #111;
    margin: 14px 0 5px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 3px;
  }
  .print-stats { margin-bottom: 4px; font-size: 0.88rem; line-height: 1.8; }
  .print-days { font-size: 0.80rem; line-height: 1.8; }
  .print-handovers,
  .print-holidays { font-size: 0.82rem; line-height: 1.7; }
  .print-disclaimer { font-size: 0.72rem; color: #777; margin-top: 16px; font-style: italic; }

  .cal-day { border: 1px solid #ddd !important; }
  .cal-day.mother  { background: #d4edda !important; color: #155724 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .cal-day.father  { background: #cce5ff !important; color: #004085 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .cal-day.shared  { background: #e2d9f3 !important; color: #3d1a6e !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .cal-day.unclear { background: #f0f0f0 !important; color: #666 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
