/* ============================================================
   AMAZONIA DIETS VIEW - Cuadrante Semanal de Dietas
   Estilo fiel a la ficha física del departamento
   ============================================================ */

.amz-diet-page {
  padding: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.amz-diet-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  background: var(--surface, #ffffff);
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--border, #e2e8f0);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.amz-diet-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.amz-diet-status {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  min-width: 9rem;
  text-align: right;
}

.amz-diet-status.saved {
  color: #10b981;
}

.amz-diet-card-wrap {
  background: #ffffff;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1.5px solid #0f172a;
  overflow-x: auto;
}

/* ── Tabla de Dietas Estilo Cuadrante ───────────────────────── */
.amz-diet-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-family: inherit;
  font-size: 9pt;
}

.amz-diet-table th,
.amz-diet-table td {
  border: 1.2px solid #334155;
  padding: 0;
  text-align: center;
  vertical-align: middle;
  height: 34px;
}

/* Cabecera principal */
.amz-th-main {
  background: #0f172a !important;
  color: #ffffff !important;
  font-size: 10.5pt;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-align: center;
  width: 20%;
  padding: 6px 10px;
}

.amz-th-day {
  background: #f59e0b !important;
  color: #0f172a !important;
  font-size: 10pt;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 6px 4px;
  width: 11.4%;
  position: relative;
}

.amz-th-day.amz-today {
  background: #ea580c !important;
  color: #ffffff !important;
  box-shadow: inset 0 0 0 2px #ffffff;
}

.amz-today-badge {
  display: block;
  font-size: 6.5pt;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1;
  margin-top: 2px;
  background: rgba(0,0,0,0.25);
  color: #fff;
  border-radius: 3px;
  padding: 1px 3px;
}

/* Celda de Animal / Grupo */
.amz-td-animal {
  font-weight: 800;
  text-align: left;
  padding: 0 6px;
  position: relative;
}

.amz-animal-row-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
}

.amz-animal-in {
  flex: 1;
  font-weight: 800;
  font-size: 8.5pt;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border: none;
  background: transparent;
  outline: none;
  color: inherit;
  width: 100%;
}

.amz-animal-in::placeholder {
  color: rgba(0,0,0,0.3);
  font-weight: normal;
  text-transform: none;
}

/* Selector de color sutil */
.amz-color-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.3);
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
}

/* Celdas de días */
.amz-td-day {
  background: #ffffff;
  transition: background-color 0.15s;
}

.amz-td-day.amz-col-today {
  background: #fffbeb;
  border-left-color: #f59e0b;
  border-right-color: #f59e0b;
}

.amz-td-day.has-food {
  background: #e2e8f0;
}

.amz-td-day.has-food.amz-col-today {
  background: #fef3c7;
}

.amz-day-in {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  outline: none;
  text-align: center;
  font-size: 8pt;
  font-weight: 800;
  text-transform: uppercase;
  color: #0f172a;
  padding: 0 2px;
}

.amz-day-in:focus {
  background: #e0e7ff;
}

.amz-row-move {
  display: flex;
  flex-direction: column;
  gap: 1px;
  opacity: 0.3;
  transition: opacity 0.15s;
  margin-right: 3px;
  flex-shrink: 0;
}

.amz-diet-table tr:hover .amz-row-move {
  opacity: 1;
}

.amz-move-btn {
  background: transparent;
  border: none;
  color: #1e293b;
  cursor: pointer;
  padding: 0;
  width: 14px;
  height: 10px;
  font-size: 8px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
}

.amz-move-btn:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.18);
  color: #000;
}

.amz-move-btn:disabled {
  opacity: 0.2;
  cursor: default;
}

.amz-row-del {
  border: none;
  background: #fee2e2;
  color: #ef4444;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  line-height: 1;
  cursor: pointer;
  font-size: 11px;
  font-weight: bold;
  opacity: 0;
  transition: opacity 0.15s;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.amz-diet-table tr:hover .amz-row-del {
  opacity: 1;
}

/* Leyenda inferior informativa */
.amz-diet-footer {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
}

.amz-diet-legend {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.amz-legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
}

.amz-legend-chip {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid #64748b;
}

/* ── Estilos de Impresión (A4 Landscape) ────────────────────── */
@page {
  size: A4 landscape;
  margin: 8mm;
}

@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    padding: 0 !important;
    margin: 0 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .app-header,
  .breadcrumbs,
  .amz-diet-toolbar,
  .amz-row-del,
  .amz-color-dot,
  .no-print {
    display: none !important;
  }

  .amz-diet-page {
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
  }

  .amz-diet-card-wrap {
    border: 2px solid #000000 !important;
    padding: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
  }

  .amz-diet-table {
    border-collapse: collapse !important;
  }

  .amz-diet-table th,
  .amz-diet-table td {
    border: 1.2px solid #000000 !important;
    height: 28px !important;
  }

  .amz-th-main {
    background: #000000 !important;
    color: #ffffff !important;
    font-size: 11pt !important;
  }

  .amz-th-day {
    background: #f59e0b !important;
    color: #000000 !important;
    font-size: 10pt !important;
  }

  .amz-td-day.has-food {
    background: #e2e8f0 !important;
  }

  .amz-animal-in,
  .amz-day-in {
    color: #000000 !important;
    font-size: 8.5pt !important;
  }

  .amz-today-badge {
    display: none !important;
  }
}
