/* Food Program & Meal Counts — module styles. Flat cards, design tokens, no gradients. */

.mod-section-sub {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
  color: var(--ink-soft, #6b6259);
}

/* Controls */
.date-controls,
.month-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.room-filter {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.9rem 0 0.4rem;
}
.room-filter label {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ink-soft, #6b6259);
}

.sheet-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.save-note {
  font-size: 0.8rem;
  color: var(--ink-soft, #6b6259);
}

.print-only { display: none; }

/* Meal grid */
.table-scroll {
  overflow-x: auto;
  margin-top: 0.8rem;
  border: 1px solid var(--line-strong, #e5dccb);
  border-radius: 14px;
  background: var(--card, #fffdf8);
}

.meal-grid,
.totals-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
  font-size: 0.9rem;
}

.meal-grid th,
.meal-grid td,
.totals-table th,
.totals-table td {
  padding: 0.55rem 0.6rem;
  text-align: center;
  border-bottom: 1px solid var(--line, #efe8d8);
}

.meal-grid thead th,
.totals-table thead th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft, #6b6259);
  border-bottom: 1.5px solid var(--line-strong, #e5dccb);
}

.meal-grid .name-col,
.totals-table .name-col {
  text-align: left;
  position: sticky;
  left: 0;
  background: var(--card, #fffdf8);
  min-width: 140px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.9rem;
  color: var(--ink, #2b2620);
}

.meal-grid tbody tr:last-child th,
.meal-grid tbody tr:last-child td,
.totals-table tbody tr:last-child th,
.totals-table tbody tr:last-child td {
  border-bottom: none;
}

.col-count {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink, #2b2620);
  margin-top: 0.1rem;
}

.meal-cell {
  width: 52px;
  height: 44px;
  border-radius: 10px;
  border: 1.5px solid var(--line-strong, #e5dccb);
  background: transparent;
  color: var(--ink, #2b2620);
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 60ms ease;
}
.meal-cell:hover {
  border-color: var(--sage, #7d9b76);
}
.meal-cell:active {
  transform: scale(0.94);
}
.meal-cell.on {
  background: var(--sage, #7d9b76);
  border-color: var(--sage, #7d9b76);
  color: #fff;
}
.meal-cell:focus-visible {
  outline: 2px solid var(--sage, #7d9b76);
  outline-offset: 2px;
}

/* Monthly totals */
.totals-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.7rem;
  margin: 0.9rem 0 1.1rem;
}
.total-card {
  background: var(--card, #fffdf8);
  border: 1px solid var(--line-strong, #e5dccb);
  border-radius: 12px;
  padding: 0.7rem 0.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.total-num {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ink, #2b2620);
}
.total-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft, #6b6259);
}
.row-total {
  font-weight: 800;
  color: var(--ink, #2b2620);
}

/* Empty states */
.empty-state {
  margin: 1rem 0;
  padding: 1.4rem 1.2rem;
  border: 1.5px dashed var(--line-strong, #e5dccb);
  border-radius: 14px;
  text-align: center;
  color: var(--ink-soft, #6b6259);
}
.empty-state p { margin: 0.2rem 0; }
.empty-state strong { color: var(--ink, #2b2620); }

/* Responsive */
@media (max-width: 640px) {
  .totals-row { grid-template-columns: repeat(2, 1fr); }
  .meal-cell { width: 46px; height: 42px; }
  .mod-section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.7rem;
  }
}

/* Print: daily sheet only */
@media print {
  .module-header,
  .module-hero-banner,
  #summary-section,
  .no-print,
  .sheet-actions {
    display: none !important;
  }
  .module-body {
    padding: 0;
    max-width: none;
  }
  .mod-section {
    box-shadow: none;
    border: none;
    margin: 0;
  }
  .print-only {
    display: block;
    font-weight: 700;
    margin: 0.4rem 0 0.8rem;
  }
  .table-scroll {
    border: 1px solid #999;
    overflow: visible;
  }
  .meal-grid { min-width: 0; }
  .meal-cell {
    border: 1px solid #666;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .meal-cell.on {
    background: #ddd !important;
    color: #000 !important;
  }
}
