/* ── Reset & base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f4f0;
  color: #1a1a1a;
  min-height: 100vh;
}

/* ── Header ───────────────────────────────────────────────────────────────── */
header {
  background: #111;
  color: #fff;
  padding: 18px 24px;
}
.header-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: baseline;
  gap: 16px;
}
header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}
header span {
  font-size: 0.8rem;
  color: #aaa;
  letter-spacing: 0.04em;
}

/* ── Layout ───────────────────────────────────────────────────────────────── */
main {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 16px 60px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Card ─────────────────────────────────────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid #e2e0d8;
  border-radius: 10px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card h2 {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #666;
}
.btn-hoy {
  padding: 5px 14px;
  background: #111;
  color: #fff;
  border: none;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-hoy:hover { background: #444; }

/* ── Fields ───────────────────────────────────────────────────────────────── */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}
@media (max-width: 560px) {
  .field-row { grid-template-columns: 1fr; }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #555;
  display: flex;
  align-items: center;
  gap: 6px;
}
.auto-badge {
  background: #e8f5e9;
  color: #2e7d32;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 20px;
  letter-spacing: 0.04em;
}

input[type="text"],
input[type="date"],
input[type="number"],
select {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid #ddd;
  border-radius: 7px;
  font-size: 0.9rem;
  background: #fff;
  color: #111;
  transition: border-color 0.15s;
  appearance: none;
  -webkit-appearance: none;
}
input[type="text"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
select:focus {
  outline: none;
  border-color: #111;
}
input[readonly] {
  background: #f7f7f5;
  color: #555;
  cursor: default;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}

/* ── Add row ──────────────────────────────────────────────────────────────── */
.add-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}
.add-row .field { flex: 1; }
.field-qty { max-width: 100px; }

.btn-add {
  flex-shrink: 0;
  padding: 9px 18px;
  background: #111;
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
  margin-bottom: 1px;
}
.btn-add:hover { background: #333; }

/* ── Lista de sabores ─────────────────────────────────────────────────────── */
#lista-sabores {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sabor-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fafaf8;
  border: 1px solid #e8e6de;
  border-radius: 8px;
  padding: 10px 14px;
  gap: 12px;
}
.sabor-nombre {
  font-size: 0.88rem;
  font-weight: 600;
  flex: 1;
}
.sabor-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.qty-input {
  width: 64px !important;
  text-align: center;
  padding: 5px 8px !important;
  font-size: 0.85rem !important;
}
.unidad {
  font-size: 0.75rem;
  color: #888;
}
.btn-remove {
  background: none;
  border: none;
  color: #bbb;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.12s, background 0.12s;
  line-height: 1;
}
.btn-remove:hover { color: #d32f2f; background: #fdecea; }

.empty-msg {
  font-size: 0.82rem;
  color: #aaa;
  text-align: center;
  padding: 16px 0 4px;
}

/* ── Actions ──────────────────────────────────────────────────────────────── */
.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.resumen {
  font-size: 0.82rem;
  color: #555;
}
.resumen.hidden { display: none; }

.btn-generate {
  padding: 13px 32px;
  background: #111;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  margin-left: auto;
}
.btn-generate:hover:not(:disabled) { background: #333; }
.btn-generate:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
