/* Drag & Drop */
.drag-over {
  outline: 2px dashed #6366f1;
  background-color: #eef2ff;
}
.dragging { opacity: 0.4; }

/* While dragging: only direct slot-column children (not interactive elements inside) block pointer events */
body.drag-in-progress .slot-column {
  pointer-events: none;
}

/* Entry cards */
.entry-card {
  cursor: grab;
  transition: box-shadow 0.15s;
}
.entry-card:active { cursor: grabbing; }
.entry-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.12); }

/* Slot columns */
.slot-column {
  min-height: 80px;
  transition: background 0.15s;
}

/* Nutrient bar */
.nutrient-bar {
  position: sticky;
  bottom: 0;
  z-index: 40;
}

/* Recording animation */
@keyframes pulse-red {
  0%, 100% { background-color: #ef4444; }
  50% { background-color: #dc2626; }
}
.recording { animation: pulse-red 1s infinite; }

/* Mobile day tabs */
.day-tab.active {
  border-bottom: 2px solid #6366f1;
  color: #4f46e5;
  font-weight: 600;
}

/* Confidence badges */
.conf-high { background: #dcfce7; color: #166534; }
.conf-medium { background: #fef9c3; color: #713f12; }
.conf-low { background: #fee2e2; color: #991b1b; }

/* Scrollbar for week view */
.week-scroll { overflow-x: auto; }

/* Page groups: transparent to grid on screen */
.chart-page1, .chart-page2 { display: contents; }

/* ── PDF/Print ──────────────────────────────────── */

/* Charts: A4 Querformat */
@page { size: A4 landscape; margin: 8mm; }

@media print {
  body * { visibility: hidden; }

  /* ── Charts-Print ── */
  body.printing-charts #chartsModalContent,
  body.printing-charts #chartsModalContent * { visibility: visible; }

  body.printing-charts #chartsModalContent {
    display: block !important;
    position: static !important;
    width: 277mm !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 3mm 4mm 2mm !important;
    box-sizing: border-box;
    background: white !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  body.printing-charts .charts-scroll-area { overflow: visible !important; flex: none !important; padding: 0 !important; }
  body.printing-charts #chartsModalContent h2            { font-size: 10pt; margin: 0 0 1mm; }
  body.printing-charts #chartsModalContent .print-period { font-size: 7pt; color: #6b7280; margin: 0 0 2mm; }
  body.printing-charts .charts-controls { display: none !important; }
  body.printing-charts .charts-grid { display: block !important; }

  body.printing-charts .chart-page1 { display: block !important; break-after: page; }
  body.printing-charts .chart-page1 > * + * { margin-top: 4mm; }
  body.printing-charts .chart-page2 { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 4mm !important; }
  body.printing-charts .chart-page2 .chart-span3 { grid-column: span 2 !important; }

  body.printing-charts .chart-title {
    font-size: 7pt !important; font-weight: 600;
    margin: 0 0 1mm !important; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
  }
  body.printing-charts .chart-h-p1  { height: 85mm !important; }
  body.printing-charts .chart-h-p2a { height: 88mm !important; }
  body.printing-charts .chart-h-p2b { height: 96mm !important; }

  /* ── Report-Print (A4 Hochformat) ── */
  body.printing-report #reportModalContent,
  body.printing-report #reportModalContent * { visibility: visible; }

  body.printing-report #reportModalContent {
    display: block !important;
    position: static !important;
    width: 190mm !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 8mm !important;
    box-sizing: border-box;
    background: white !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
    font-size: 9pt;
  }
  body.printing-report .report-scroll-area  { overflow: visible !important; flex: none !important; padding: 0 !important; }
  body.printing-report .report-controls     { display: none !important; }
  body.printing-report .report-tabs         { display: none !important; }
  body.printing-report .report-close        { display: none !important; }

  body.printing-report .report-day-title    { font-size: 11pt; font-weight: 700; border-bottom: 1pt solid #000; margin-bottom: 2mm; padding-bottom: 1mm; }
  body.printing-report .report-slot-label   { font-size: 8pt; font-weight: 600; color: #374151; }
  body.printing-report .report-recipe-title { font-size: 10pt; font-weight: 700; margin-top: 4mm; border-bottom: 1pt solid #6366f1; }
  body.printing-report .report-appendix-hdr { font-size: 12pt; font-weight: 700; border-top: 2pt solid #000; padding-top: 3mm; margin-top: 5mm; break-before: page; }

  body.printing-report table { width: 100%; border-collapse: collapse; font-size: 8pt; }
  body.printing-report th, body.printing-report td { padding: 0.5mm 1mm; }
  body.printing-report th { border-bottom: 0.5pt solid #9ca3af; text-align: left; }
  body.printing-report td.num { text-align: right; }
}

/* Toast */
#toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  transition: opacity 0.3s;
}
