/* SchichtKalender – druck.css
 * Zwei Jahresdruckvarianten (1-seitig / 4-seitig), jeweils DIN A4 quer.
 */
:root {
  --p-line:#b8bcc6;
  --p-line-2:#6b7280;
  --p-text:#111318;
  --p-muted:#6b7280;
  --p-free:#e8f6ef;
  --p-free-edge:#a9d2bd;
  --p-holiday:#ffecec;
  --p-sunday:#fff4f4;
}

.print-area { width:max-content; min-width:100%; }
.sheet {
  width:297mm;
  height:210mm;
  padding:8mm;
  margin:0 auto 16px;
  background:#fff;
  color:var(--p-text);
  box-shadow:0 2px 18px rgba(0,0,0,.18);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  box-sizing:border-box;
  overflow:hidden;
  display:flex;
  flex-direction:column;
}
.sheet-head { display:flex; align-items:baseline; justify-content:space-between; margin-bottom:2.5mm; flex:0 0 auto; }
.sheet-title { font-size:13pt; font-weight:800; letter-spacing:-.2px; }
.sheet-sub { font-size:7.5pt; color:var(--p-muted); }
.sheet-meta { text-align:right; }

/* Matrix: Monat als Zeile, Kalendertag als Spalte. */
.year-grid {
  display:grid;
  grid-template-columns:16mm repeat(31, 1fr);
  border-top:.3mm solid var(--p-line-2);
  border-left:.3mm solid var(--p-line-2);
  flex:0 0 auto;
}
.yg-cell {
  border-right:.2mm solid var(--p-line);
  border-bottom:.2mm solid var(--p-line);
  text-align:center;
  overflow:hidden;
  position:relative;
  box-sizing:border-box;
  background:#fff;
}
.yg-head { font-weight:800; font-size:7.5pt; background:#eee; display:flex; align-items:center; justify-content:center; }
.yg-monthname { font-weight:800; font-size:8pt; text-align:left; padding-left:1.2mm; background:#eee; display:flex; align-items:center; }
.yg-empty { background:#f5f5f5; }

.layout-compact .yg-cell { height:11.55mm; }

.day-print { display:grid; grid-template-rows:auto auto 1fr auto; align-items:center; padding:.35mm .15mm; line-height:1.05; }
.dp-date { min-height:2.1mm; display:flex; align-items:center; justify-content:center; gap:.45mm; white-space:nowrap; }
.dp-number { font-size:5.7pt; font-weight:900; color:#111318; }
.dp-weekday { font-size:5.7pt; font-weight:800; color:#4b5563; }
.dp-holiday { font-size:4.4pt; line-height:1.05; font-weight:750; color:#a23b3b; min-height:2.6mm; overflow-wrap:anywhere; }
.dp-entry { align-self:center; font-weight:900; font-size:8.4pt; line-height:1; }
.dp-shift { min-height:2mm; font-size:5.3pt; font-weight:800; color:#374151; }

.yg-sun { background-color:var(--p-sunday); }
.yg-holiday { background-color:var(--p-holiday); }
.yg-holiday::after {
  content:""; position:absolute; top:0; right:0;
  border-width:0 1.5mm 1.5mm 0; border-style:solid;
  border-color:transparent #b86b6b transparent transparent;
}

/* Freizeitblock. */
.yg-free-block {
  background-color:var(--p-free);
  box-shadow:inset 0 .18mm 0 #c9e4d7, inset 0 -.18mm 0 #c9e4d7;
}
.yg-free-start { box-shadow:inset .28mm 0 0 var(--p-free-edge), inset 0 .18mm 0 #c9e4d7, inset 0 -.18mm 0 #c9e4d7; }
.yg-free-end { box-shadow:inset -.28mm 0 0 var(--p-free-edge), inset 0 .18mm 0 #c9e4d7, inset 0 -.18mm 0 #c9e4d7; }
.yg-free-start.yg-free-end { box-shadow:inset .28mm 0 0 var(--p-free-edge), inset -.28mm 0 0 var(--p-free-edge), inset 0 .18mm 0 #c9e4d7, inset 0 -.18mm 0 #c9e4d7; }

/* Blockbeginn nach tatsaechlich gefahrener NS: nur untere Haelfte fuellen. */
.yg-half-after-ns,
.yg-free-block.yg-half-after-ns {
  background:linear-gradient(to bottom,
    #fff 0 calc(50% - .25mm),
    var(--p-free-edge) calc(50% - .25mm) calc(50% + .25mm),
    var(--p-free) calc(50% + .25mm) 100%);
}
.yg-holiday.yg-half-after-ns,
.yg-sun.yg-half-after-ns {
  background:linear-gradient(to bottom,
    var(--p-holiday) 0 calc(50% - .25mm),
    var(--p-free-edge) calc(50% - .25mm) calc(50% + .25mm),
    var(--p-free) calc(50% + .25mm) 100%);
}
.yg-entry { font-weight:800; }

/* Detailmodus: 3 Monatskalender nebeneinander. */
.detail-months { display:grid; grid-template-columns:repeat(3, 1fr); gap:3mm; flex:1 1 auto; min-height:0; }
.detail-month { min-width:0; display:flex; flex-direction:column; }
.detail-month-title { font-size:10pt; font-weight:850; text-align:center; margin-bottom:1.5mm; }
.detail-grid {
  display:grid;
  grid-template-columns:repeat(7, 1fr);
  grid-template-rows:7mm repeat(6, 1fr);
  border-top:.3mm solid var(--p-line-2);
  border-left:.3mm solid var(--p-line-2);
  flex:1 1 auto;
  min-height:0;
}
.detail-head {
  border-right:.2mm solid var(--p-line); border-bottom:.2mm solid var(--p-line);
  background:#eee; display:flex; align-items:center; justify-content:center;
  font-size:7pt; font-weight:850;
}
.detail-day {
  position:relative; min-width:0; overflow:hidden; padding:.7mm;
  border-right:.2mm solid var(--p-line); border-bottom:.2mm solid var(--p-line);
  display:grid; grid-template-rows:auto auto 1fr auto; box-sizing:border-box;
}
.detail-empty { background:#f5f5f5; }
.detail-top { display:flex; justify-content:flex-start; align-items:baseline; gap:1mm; }
.detail-weekday { font-size:6.3pt; font-weight:850; color:#4b5563; }
.detail-number { font-size:7.2pt; font-weight:850; }
.detail-holiday { font-size:5.4pt; line-height:1.08; font-weight:750; color:#9f3434; min-height:6mm; overflow-wrap:anywhere; }
.detail-entry { align-self:center; justify-self:center; font-size:12pt; line-height:1; font-weight:900; }
.detail-shift { justify-self:center; min-height:3mm; font-size:6.5pt; font-weight:850; }

/* Legende/Fuss. */
.legend { display:flex; flex-wrap:wrap; gap:1.5mm 4mm; margin-top:2.5mm; font-size:6.8pt; flex:0 0 auto; }
.legend-item { display:inline-flex; align-items:center; gap:1mm; }
.legend-box {
  width:5mm; height:3.7mm; border:.2mm solid var(--p-line-2); display:inline-flex;
  align-items:center; justify-content:center; font-size:6pt; font-weight:850; position:relative; overflow:hidden;
}
.sheet-foot { margin-top:1.5mm; font-size:6pt; color:var(--p-muted); display:flex; justify-content:space-between; flex:0 0 auto; }

/* Druckerfreundlich/Graustufen: Aussage bleibt ueber Rahmen und Halbfuellung erhalten. */
.print-bw { --p-free:#f0f0f0; --p-free-edge:#777; --p-holiday:#e5e5e5; --p-sunday:#f5f5f5; }
.print-bw .dp-holiday,
.print-bw .detail-holiday { color:#222; }
.print-bw .yg-holiday::after { border-color:transparent #555 transparent transparent; }

@page { size:A4 landscape; margin:0; }
@media print {
  html, body { margin:0; padding:0; background:#fff; }
  .app-header, .bottom-nav, .no-print { display:none !important; }
  .container { max-width:none !important; width:auto !important; margin:0 !important; padding:0 !important; }
  .vorschau-huelle { overflow:visible !important; padding:0 !important; }
  .print-area { width:auto; min-width:0; }
  .sheet {
    width:297mm; height:210mm; margin:0; box-shadow:none;
    break-after:page; page-break-after:always; break-inside:avoid; page-break-inside:avoid;
  }
  .sheet:last-child { break-after:auto; page-break-after:auto; }
  * { -webkit-print-color-adjust:exact; print-color-adjust:exact; }
}

/* ── Jahreskalender im klassischen 12-Spalten-Stil ─────────────── */
.layout-poster {
  padding:7mm 8mm 6mm;
  background:#fffdf8;
}
.poster-head,
.shiftlist-head {
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:8mm;
  margin-bottom:3mm;
  flex:0 0 auto;
}
.poster-title,
.shiftlist-title { font-size:16pt; font-weight:900; letter-spacing:.8px; }
.poster-sub,
.poster-meta,
.shiftlist-sub { font-size:7pt; color:#667085; }
.poster-meta { text-align:right; }
.poster-months {
  display:grid;
  grid-template-columns:repeat(12,minmax(0,1fr));
  gap:1.4mm;
  flex:1 1 auto;
  min-height:0;
}
.poster-month {
  min-width:0;
  border-left:.18mm dotted #c8c2b6;
  padding-left:.7mm;
  display:flex;
  flex-direction:column;
}
.poster-month:first-child { border-left:0; }
.poster-month-name { text-align:center; text-transform:uppercase; font-size:7.1pt; font-weight:900; letter-spacing:.25px; }
.poster-month-year { text-align:center; font-size:5.4pt; color:#777; margin:.2mm 0 1mm; }
.poster-days { display:grid; grid-template-rows:repeat(31,1fr); flex:1 1 auto; min-height:0; }
.poster-day {
  display:grid;
  grid-template-columns:4.2mm 4.4mm 1fr;
  align-items:center;
  min-height:0;
  border-top:.12mm solid #d8d4cb;
  font-size:5.2pt;
  line-height:1;
  overflow:hidden;
}
.poster-day-empty { border-top-color:transparent; }
.poster-date { font-weight:900; text-align:right; padding-right:.7mm; }
.poster-weekday { font-size:4.6pt; font-weight:750; color:#4f5663; text-transform:uppercase; }
.poster-status {
  min-width:0;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:4.8pt;
  font-weight:900;
  border-left:.15mm solid rgba(0,0,0,.08);
}
.poster-sunday .poster-date,.poster-sunday .poster-weekday { color:#a13b3b; }
.poster-holiday { box-shadow:inset 0 0 0 .25mm #efb0ac; }
.status-TS { background:#d6e4ef; color:#1f3546; }
.status-NS { background:#d6e4ef; color:#1f3546; }
.status-U { background:#789a76; color:#fff; }
.status-FS { background:#b9d2c7; color:#27483e; }
.status-SU { background:#d9c4ef; color:#4b2b69; }
.status-KR { background:#e8b6b6; color:#6d2020; }
.status-ZT { background:#d6c49b; color:#4d3a10; }
.status-AFZ { background:#bfc9d7; color:#26364d; }
.status-ST { background:#c9c9c9; color:#222; }
.status-free { background:#f4f1e9; color:#666; }
.status-off { background:transparent; }
.poster-legend {
  display:flex;
  justify-content:center;
  flex-wrap:wrap;
  gap:1.6mm 4mm;
  margin-top:2.4mm;
  font-size:6pt;
  flex:0 0 auto;
}
.poster-legend-item { display:inline-flex; align-items:center; gap:1mm; }
.poster-legend-box { width:7mm; height:4mm; display:inline-flex; align-items:center; justify-content:center; font-size:5.5pt; font-weight:900; border:.15mm solid rgba(0,0,0,.14); }

/* ── Analyse Blatt 4 / Schichtliste als Einzeldruck ─────────────── */
.layout-shiftlist {
  width:210mm;
  height:297mm;
  padding:8mm;
}
.shiftlist-months {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  grid-template-rows:repeat(4,minmax(0,1fr));
  gap:3mm 4mm;
  flex:1 1 auto;
  min-height:0;
}
.shiftlist-month { min-height:0; overflow:hidden; }
.shiftlist-month-name {
  display:flex; justify-content:space-between;
  border-bottom:.35mm solid #555;
  margin-bottom:.6mm; padding-bottom:.5mm;
  font-size:7.4pt; font-weight:900;
}
.shiftlist-month-name span { color:#6b7280; font-weight:750; }
.shiftlist-row {
  display:grid;
  grid-template-columns:12mm 6mm 8mm minmax(0,1fr);
  gap:.8mm;
  align-items:center;
  padding:.38mm .7mm;
  border-bottom:.12mm solid #e1e3e7;
  font-size:6.2pt;
  line-height:1.05;
}
.shiftlist-row strong,.shiftlist-row b { text-align:right; }
.shiftlist-row span,.shiftlist-row strong,.shiftlist-row b { min-width:0; white-space:nowrap; }
.shiftlist-row.is-holiday { background:#ffecec; }
.shiftlist-row.is-entry { background:#f0f3f7; }
.shiftlist-note {
  margin-top:2.2mm;
  padding:1.5mm 2mm;
  font-size:6.2pt;
  line-height:1.35;
  color:#5f6672;
  background:#f7f8fa;
  border-left:.7mm solid #8b5cf6;
  flex:0 0 auto;
}
.print-bw .status-TS,.print-bw .status-NS,.print-bw .status-U,.print-bw .status-FS,
.print-bw .status-SU,.print-bw .status-KR,.print-bw .status-ZT,.print-bw .status-AFZ,
.print-bw .status-ST,.print-bw .status-free { background:#eee; color:#111; border:.12mm solid #777; }

/* H-01: Druckdialog-Hinweis nur in der Bildschirmvorschau. */
.druck-dialog-hinweis { display:block; margin-top:4px; }
@media print { .druck-dialog-hinweis { display:none !important; } }

/* SETO 1.1.12 – erweiterte Grundlayouts */
.simple-print-head {
  align-items:center;
  margin-bottom:1.2mm;
  padding-bottom:1.2mm;
  border-bottom:.25mm solid #d4d7dd;
}
.print-person,.print-group { font-size:8pt; font-weight:850; color:#343943; }
.print-layout-title { text-align:center; font-size:11pt; font-weight:900; margin:0 0 2mm; flex:0 0 auto; }

.layout-halfyear .yg-cell { height:22.4mm; }
.layout-halfyear .dp-number,.layout-halfyear .dp-weekday { font-size:7pt; }
.layout-halfyear .dp-entry { font-size:11pt; }
.layout-halfyear .dp-shift { font-size:6.8pt; }
.layout-halfyear .dp-holiday { font-size:5.4pt; min-height:4mm; }

.layout-leisure .yg-cell { height:11.55mm; }
.layout-leisure .yg-free-block { background:#d8f2e4; box-shadow:inset 0 .3mm 0 #89b99f,inset 0 -.3mm 0 #89b99f; }
.layout-leisure .e-U,.layout-leisure .e-FS,.layout-leisure .e-AFZ,.layout-leisure .e-ZT { outline:.45mm solid rgba(62,113,83,.45); outline-offset:-.6mm; }
.layout-leisure .dp-shift { opacity:.72; font-size:4.9pt; }

.timeline-quarters { display:grid; grid-template-rows:repeat(4,1fr); gap:3mm; flex:1 1 auto; min-height:0; }
.timeline-quarter { min-height:0; display:grid; grid-template-rows:5mm 1fr; }
.timeline-label { font-size:7pt; font-weight:900; display:flex; align-items:center; }
.timeline-days { display:grid; grid-auto-flow:column; grid-auto-columns:1fr; min-height:0; border:.25mm solid #9ea4ad; }
.band-day { position:relative; min-width:0; border-left:.12mm solid #d7dae0; display:grid; grid-template-rows:auto auto 1fr; align-items:center; justify-items:center; padding:.35mm .05mm; overflow:visible; font-size:4.3pt; }
.band-day.month-start { border-left:.6mm solid #5e6570; }
.band-day.month-start::before { content:attr(data-month); position:absolute; top:-4.2mm; left:.2mm; font-size:4.4pt; font-weight:900; white-space:nowrap; color:#4b5260; }
.band-num { font-weight:900; font-size:4.8pt; }
.band-weekday { font-size:3.9pt; font-weight:750; color:#59606b; }
.band-code { align-self:center; font-size:5.3pt; }
.band-holiday-name { display:none; }
.band-sunday { box-shadow:inset 0 0 0 .25mm #dba0a0; }
.band-holiday { outline:.35mm solid #c96363; outline-offset:-.45mm; }
.band-free { background:var(--p-free); }
.band-free-strong { background:#ccebdc; box-shadow:inset 0 0 0 .3mm #90bda5; }

.weeks-grid { display:grid; grid-template-columns:9mm repeat(53,minmax(0,1fr)); grid-template-rows:7mm repeat(7,1fr); flex:1 1 auto; min-height:0; border:.25mm solid #969ca5; overflow:hidden; }
.weeks-corner,.weeks-head,.weeks-row-head { display:flex; align-items:center; justify-content:center; background:#eceef1; border-right:.12mm solid #cdd1d7; border-bottom:.12mm solid #cdd1d7; font-weight:900; }
.weeks-head { font-size:4.4pt; writing-mode:vertical-rl; transform:rotate(180deg); }
.weeks-row-head { font-size:6pt; }
.week-day { min-width:0; position:relative; display:grid; grid-template-rows:auto 1fr; align-items:center; justify-items:center; border-right:.12mm solid #d7dae0; border-bottom:.12mm solid #d7dae0; padding:.25mm 0; overflow:hidden; }
.week-day span { font-size:4.2pt; font-weight:800; }
.week-day b { font-size:5pt; }
.week-sunday { box-shadow:inset 0 0 0 .25mm #dba0a0; }
.week-holiday { outline:.35mm solid #c96363; outline-offset:-.45mm; }
.week-free { background:var(--p-free); }
.outside-year { background:#f0f0f0; }

/* SETO 1.1.13 – einheitliche Arbeits-/Freizeitmarkierung in Spalten und Wochenmatrix */
.layout-poster .status-TS,.layout-poster .status-NS,
.layout-weeks .status-TS,.layout-weeks .status-NS { background:#d6e4ef; color:#1f3546; }
.layout-poster .status-free,.layout-weeks .status-free { background:#d8f2e4; color:#28543f; }

/* Neue Grundlayouts */
.layout-yeargrid .overview-months { grid-template-columns:repeat(4,minmax(0,1fr)); grid-template-rows:repeat(3,minmax(0,1fr)); gap:2mm; flex:1 1 auto; min-height:0; }
.layout-yeargrid .detail-month { min-height:0; }
.layout-yeargrid .detail-month-title { font-size:6pt; padding:.5mm; }
.layout-yeargrid .detail-day { min-height:0; padding:.15mm; }
.layout-yeargrid .detail-number,.layout-yeargrid .detail-weekday { font-size:4.2pt; }
.layout-yeargrid .detail-holiday { font-size:3.3pt; min-height:2.6mm; }
.layout-yeargrid .detail-entry { font-size:5pt; }
.layout-yeargrid .detail-shift { font-size:4pt; }

.layout-doublemonth .overview-months { grid-template-columns:repeat(2,minmax(0,1fr)); gap:4mm; flex:1 1 auto; min-height:0; }
.layout-doublemonth .detail-day { min-height:19mm; }
.layout-doublemonth .detail-month-title { font-size:11pt; }
.layout-doublemonth .detail-number,.layout-doublemonth .detail-weekday { font-size:7pt; }
.layout-doublemonth .detail-holiday { font-size:5.6pt; }
.layout-doublemonth .detail-entry { font-size:10pt; }
.layout-doublemonth .detail-shift { font-size:6.5pt; }

.layout-monthpage .overview-months { grid-template-columns:1fr; flex:1 1 auto; min-height:0; }
.layout-monthpage .detail-day { min-height:26mm; }
.layout-monthpage .detail-month-title { font-size:14pt; }
.layout-monthpage .detail-number,.layout-monthpage .detail-weekday { font-size:9pt; }
.layout-monthpage .detail-holiday { font-size:7pt; }
.layout-monthpage .detail-entry { font-size:14pt; }
.layout-monthpage .detail-shift { font-size:8pt; }

@media print {
  .layout-halfyear,.layout-timeline,.layout-weeks,.layout-leisure,.layout-yeargrid,.layout-doublemonth,.layout-monthpage { width:297mm; height:210mm; }
}

/* SETO 1.1.22 – Feedback #50 Monatsspalten */
.layout-poster .poster-free-block { background:#4f765f; }
.layout-poster .poster-free-block .poster-date,
.layout-poster .poster-free-block .poster-weekday { color:#fff; }
.layout-poster .poster-free-block .poster-status.status-free { background:#4f765f; color:#fff; }
.layout-poster .poster-sick-day { background:#f1cccc; }
.layout-poster .poster-sick-day .poster-date,
.layout-poster .poster-sick-day .poster-weekday { color:#6d2020; }
.layout-poster .poster-sick-day .poster-status { background:#e8b6b6; color:#6d2020; }
.layout-poster .poster-specialday .poster-weekday { color:#b42323; font-weight:900; }

/* SETO 1.1.45 – Feedback #55: Jahresraster sicher innerhalb DIN A4 */
@media print {
  .layout-yeargrid{width:287mm !important;height:200mm !important;max-width:287mm !important;max-height:200mm !important;overflow:hidden !important;box-sizing:border-box !important;}
  .layout-yeargrid .overview-months{gap:1.2mm !important;}
  .layout-yeargrid .legend{margin-top:.6mm !important;}
}
