/* ===== WEEKLY OVERVIEW (printable) ===== */

.weekly-body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.weekly-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(135deg, #064E3B 0%, var(--primary-dark) 55%, var(--primary) 100%);
  border-bottom: 4px solid var(--primary-mid);
  padding-top: max(10px, env(safe-area-inset-top, 0px));
  padding-bottom: 10px;
}
.weekly-topbar-inner {
  width: 100%;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.weekly-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.weekly-logo { height: 44px; width: auto; object-fit: contain; display: none; filter: brightness(0) invert(1); }
.weekly-logo.visible { display: block; }
.weekly-titles { min-width: 0; }
.weekly-title {
  color: #fff;
  font-weight: 900;
  font-size: 18px;
  line-height: 1.1;
  letter-spacing: .2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60vw;
}
.weekly-subtitle { color: rgba(255,255,255,.82); font-weight: 700; font-size: 12px; margin-top: 2px; }

.weekly-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.weekly-actions .btn { white-space: nowrap; }

.weekly-main {
  flex: 1;
  min-height: 0;
  padding: 14px 16px 26px;
}

.weekly-grid {
  width: 100%;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.weekly-loading {
  grid-column: 1 / -1;
  padding: 18px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.day-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  min-height: 180px;
}
.day-card-header {
  padding: 10px 12px;
  background: linear-gradient(180deg, var(--primary-light) 0%, #ffffff 100%);
  border-bottom: 1px solid var(--border-soft);
}
.day-name { font-weight: 900; color: var(--primary-dark); font-size: 14px; line-height: 1.1; }
.day-slogan { margin-top: 4px; color: var(--text-soft); font-weight: 700; font-size: 11px; line-height: 1.25; }

.day-list { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 6px; }

.w-item {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 8px;
  align-items: start;
}
.w-time {
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.25;
  word-break: break-word;
}
.w-title { font-weight: 800; color: var(--text); font-size: 12px; line-height: 1.25; word-break: break-word; }
.w-note { margin-top: 2px; font-weight: 600; color: var(--blue); font-size: 11px; line-height: 1.25; word-break: break-word; }

.w-heading {
  border: 1px solid rgba(0,0,0,.06);
  border-left: 4px solid var(--primary);
  background: rgba(34,197,94,.08);
  border-radius: 10px;
  padding: 6px 8px;
  font-weight: 900;
  color: var(--primary-deeper);
  font-size: 12px;
  line-height: 1.2;
  white-space: pre-wrap;
  word-break: break-word;
}

.weekly-footer {
  padding: 10px 16px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-soft);
  background: var(--surface);
}
.weekly-status { color: var(--muted); font-size: 12px; font-weight: 700; }

/* ── Mobile: horizontales Swipen statt winzigen Spalten ──────────────────── */
@media (max-width: 980px) {
  .weekly-topbar-inner { padding: 0 12px; }
  .weekly-main { padding: 12px 12px 18px; }

  .weekly-grid {
    grid-template-columns: repeat(7, minmax(86vw, 1fr));
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
  }
  .day-card { scroll-snap-align: start; }

  /* dezente Scrollbar (falls sichtbar) */
  .weekly-grid::-webkit-scrollbar { height: 8px; }
  .weekly-grid::-webkit-scrollbar-thumb { background: rgba(17,24,39,.18); border-radius: 999px; }
}

@media (max-width: 560px) {
  .weekly-title { max-width: 80vw; }
}

/* ── Print / PDF ─────────────────────────────────────────────────────────── */
@page {
  size: A4 landscape;
  margin: 8mm;
}
@media print {
  .no-print { display: none !important; }
  .weekly-body { background: #fff; }
  .weekly-topbar { position: static; border-bottom: 2px solid #ddd; padding: 6mm 0 4mm; }
  .weekly-topbar-inner { max-width: none; padding: 0; }
  .weekly-main { padding: 0; }
  .weekly-grid {
    max-width: none;
    width: 100%;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 3mm;
  }
  .weekly-actions { display: none !important; }
  .weekly-footer { display: none !important; }

  .weekly-logo { height: 30px; }
  .weekly-title { font-size: 14px; max-width: none; }
  .weekly-subtitle { font-size: 10px; }

  .day-card { box-shadow: none; min-height: 0; border-radius: 8px; }
  .day-card-header { background: #f3f6f4; padding: 4mm 3mm 3mm; }
  .day-name { font-size: 11px; }
  .day-slogan { display: none !important; } /* für 1 Seite: nur Tag + Plan */

  .day-list { padding: 3mm; gap: 2.2mm; }
  .w-item { grid-template-columns: 16mm 1fr; gap: 2mm; }
  .w-time { font-size: 9px; }
  .w-title { font-size: 9px; font-weight: 800; }
  .w-note { display: none !important; } /* Notizen im Druck weglassen */
  .w-heading { padding: 2mm 2.4mm; font-size: 9px; border-radius: 6px; }

  /* möglichst in 1 Seite bleiben */
  .day-card, .day-list { break-inside: avoid; page-break-inside: avoid; }

  /* Browser druckt sonst oft Farben nicht */
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

