@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&family=Outfit:wght@300;400;500;600;700&display=swap');

/* ══════════════════════════════════════════════════════════
   RECETARIO HOGAZA — hoja de estilos
   Paleta y tipografías alineadas con el catálogo mayorista.
   Mismos selectores y misma estructura que la versión anterior:
   solo cambia la estética.
   ══════════════════════════════════════════════════════════ */

:root {
  /* --- paleta de marca --- */
  --verde: #364E41;
  --verde-osc: #26382F;
  --verde-mid: #4A6455;
  --lima: #E5E897;
  --crema: #F6F1E3;
  --crema-osc: #EDE5D2;
  --dorado: #C4A052;
  --dorado-cl: #DEC489;

  /* --- variables originales, retonalizadas --- */
  --border: #E0D6BE;
  --header-bg: #EFE7D3;
  --base-bg: #DDE6D4;
  --base-border: #C4A052;
  --scale-bg: #F0E2C4;
  --text: #2A3B32;
  --muted: #6E7C73;
  --brand: #364E41;
  --card-bg: #F1DCD2;
  --laminados-bg: #EBDCB8;
  --laminados-text: #8A6A22;
  --pasteleria-bg: #D6DFC7;
  --pasteleria-text: #4A6455;

  --radio: 14px;
  --sombra: 0 1px 2px rgba(38,56,47,.05), 0 8px 24px -12px rgba(38,56,47,.18);
}

* { box-sizing: border-box; }

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--crema);
  color: var(--text);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

/* ---------- BARRA SUPERIOR ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 24px;
  border-bottom: 1px solid rgba(229,232,151,.18);
  background: var(--verde);
  box-shadow: 0 6px 18px -12px rgba(38,56,47,.5);
}
.topbar .brand {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  color: var(--lima);
  font-size: 17px;
  letter-spacing: .02em;
  display: flex; align-items: center; gap: 11px;
}
/* el logo es oscuro: se recolorea a lima para que se lea sobre el verde */
.brand-logo {
  height: 24px; width: auto; display: block;
  filter: brightness(0) invert(0.9) sepia(0.6) saturate(3.5) hue-rotate(18deg) brightness(1.05);
}
.topbar a {
  color: rgba(246,241,227,.82);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: color .18s;
}
.topbar a:hover { color: var(--lima); }
.topbar-right { display: flex; align-items: center; gap: 18px; margin-left: auto; }
.user-badge {
  font-size: 12.5px; color: rgba(246,241,227,.6); white-space: nowrap;
  font-weight: 300;
}

.page { max-width: 940px; margin: 0 auto; padding: 32px 24px 70px; }
.page-admin { max-width: 1200px; }

/* ---------- INGRESO ---------- */
.login-wrap { display: flex; justify-content: center; padding: 74px 20px; }
.login-card {
  width: 100%;
  background: #fff;
  max-width: 360px;
  border: 1px solid var(--crema-osc);
  border-top: 3px solid var(--verde);
  border-radius: var(--radio);
  padding: 34px 32px;
  box-shadow: var(--sombra);
  display: flex;
  flex-direction: column;
}
.login-card h1 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 26px; font-weight: 600; color: var(--verde);
  margin: 0 0 6px; letter-spacing: -.01em;
}
.login-card label,
.modal-card label {
  font-size: 11px; font-weight: 600; margin: 18px 0 7px;
  color: var(--verde-mid); text-transform: uppercase; letter-spacing: .12em;
}
.login-card input, .modal-card input[type="text"], .modal-card input[type="password"] {
  font-family: inherit;
  font-size: 15px;
  padding: 11px 15px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.login-card input:focus, .modal-card input:focus {
  border-color: var(--verde);
  box-shadow: 0 0 0 3px rgba(54,78,65,.1);
}
.login-card button, .modal-card button, .admin-actions button {
  font-family: inherit;
  margin-top: 24px;
  padding: 12px 18px;
  font-size: 14.5px;
  font-weight: 600;
  border-radius: 999px;
  border: none;
  background: var(--verde);
  color: var(--lima);
  cursor: pointer;
  transition: transform .18s, box-shadow .18s, background .18s;
}
.login-card button:hover, .modal-card button:hover, .admin-actions button:hover {
  background: var(--verde-osc);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px -8px rgba(38,56,47,.5);
}
.login-card button:disabled { opacity: 0.55; cursor: default; transform: none; box-shadow: none; }
.login-error {
  margin-top: 14px;
  font-size: 13px;
  color: #8E3B2E;
  background: #FBEDE7;
  border: 1px solid #E8C7B9;
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: 400;
}

/* ---------- ADMIN ---------- */
.admin-actions { margin-bottom: 20px; }
.acciones-col { white-space: nowrap; }
.btn-link {
  border: none;
  background: none;
  color: var(--verde);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background .15s, color .15s;
}
.btn-link:hover { background: var(--crema-osc); }
.btn-danger { color: #A8412F; }
.btn-danger:hover { background: #FBEDE7; }

/* ---------- MODAL ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(38,56,47,.42);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
}
.modal-card {
  background: #fff;
  width: 100%;
  max-width: 400px;
  border-radius: var(--radio);
  border-top: 3px solid var(--verde);
  padding: 28px 30px;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px -20px rgba(38,56,47,.45);
}
.modal-card h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 21px; font-weight: 600; color: var(--verde); margin: 0 0 6px;
}
.checkbox-label {
  display: flex; align-items: center; gap: 9px; font-size: 13px;
  margin-top: 16px; flex-direction: row;
  text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--text);
}
.modal-buttons { display: flex; gap: 10px; margin-top: 22px; }
.btn-secundario {
  background: #fff !important;
  color: var(--verde) !important;
  border: 1px solid var(--border) !important;
}
.btn-secundario:hover { background: var(--crema) !important; }

/* ---------- BUSCADOR Y FILTROS ---------- */
.search-wrap { margin-bottom: 18px; }
.search-wrap input {
  width: 100%;
  font-family: inherit;
  font-size: 14.5px;
  padding: 13px 20px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.search-wrap input:focus {
  border-color: var(--verde);
  box-shadow: 0 0 0 3px rgba(54,78,65,.1);
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 26px; }
.chip {
  font-family: inherit;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 9px 17px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  color: var(--muted);
  transition: all .18s;
}
.chip:hover { border-color: var(--verde-mid); color: var(--verde); }
.chip.active { background: var(--verde); color: var(--lima); border-color: var(--verde); }

/* ---------- TARJETAS ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}
.card {
  background: var(--card-bg);
  border: 1px solid #E4CDC1;
  border-radius: var(--radio);
  padding: 20px;
  cursor: pointer;
  box-shadow: var(--sombra);
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.card:hover {
  box-shadow: 0 2px 4px rgba(38,56,47,.06), 0 18px 36px -18px rgba(38,56,47,.32);
  transform: translateY(-3px);
  border-color: var(--dorado-cl);
}
.card .area {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: #9A5B3F;
  text-transform: uppercase;
  letter-spacing: .16em;
  margin-bottom: 9px;
}
.card h3 {
  font-family: 'Fraunces', Georgia, serif;
  margin: 0 0 5px; font-size: 18px; font-weight: 600;
  color: var(--verde); line-height: 1.24; letter-spacing: -.005em;
}
.card .rinde { font-size: 12.5px; color: var(--muted); font-weight: 300; }
.card[data-area="laminados"] { background: var(--laminados-bg); border-color: #DCC9A0; }
.card[data-area="laminados"] .area { color: var(--laminados-text); }
.card[data-area="pasteleria"] { background: var(--pasteleria-bg); border-color: #C4CFB2; }
.card[data-area="pasteleria"] .area { color: var(--pasteleria-text); }

.empty-state, .loading-state {
  color: var(--muted); font-size: 14px; padding: 56px 0; text-align: center; font-weight: 300;
}

/* ---------- FICHA DE RECETA ---------- */
h1 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 30px; font-weight: 600; color: var(--verde);
  margin: 14px 0 6px; letter-spacing: -.01em; line-height: 1.15;
}
h1::after {
  content: ''; display: block; width: 46px; height: 2px;
  background: var(--verde); margin-top: 12px;
}
.subtitle { color: var(--muted); font-size: 14.5px; margin: 14px 0 22px; font-weight: 300; }
.meta {
  display: flex; gap: 0; flex-wrap: wrap; margin-bottom: 22px; font-size: 13px;
  background: #fff;
  border: 1px solid var(--crema-osc);
  border-left: 3px solid var(--verde);
  border-radius: 10px;
  padding: 14px 20px;
  box-shadow: var(--sombra);
}
.meta-item {
  color: var(--muted); font-weight: 300;
  padding: 0 20px; border-left: 1px solid var(--crema-osc);
}
.meta-item:first-child { padding-left: 0; border-left: none; }
.meta-item b { color: var(--verde); font-weight: 600; }
.legend { display: flex; gap: 26px; margin-bottom: 18px; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--muted); font-weight: 300; }
.scale-picker-label {
  font-size: 11px; color: var(--laminados-text); margin: 0 0 9px;
  text-transform: uppercase; letter-spacing: .14em; font-weight: 600;
}
.swatch { width: 14px; height: 14px; border-radius: 4px; display: inline-block; border: 1px solid rgba(38,56,47,.1); }
.foto-receta {
  width: 100%; max-height: 300px; object-fit: cover;
  border-radius: var(--radio); margin-bottom: 22px;
  box-shadow: var(--sombra);
}

/* ---------- TABLA ---------- */
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
  background: #fff;
  box-shadow: var(--sombra);
  border-radius: 10px;
  overflow: hidden;
}
th, td {
  border: 1px solid var(--border);
  padding: 11px 14px;
  text-align: right;
  white-space: nowrap;
  font-weight: 400;
}
th:first-child, td:first-child { text-align: left; white-space: normal; }
thead th {
  background: var(--verde);
  font-weight: 600;
  color: var(--lima);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
  border-color: var(--verde-mid);
}
.col-base { background: var(--base-bg); }
.col-scale { background: var(--scale-bg); }
/* la columna base va toda en verde pastel, encabezado incluido */
thead th.col-base { background: var(--base-bg); color: var(--verde); }
thead th.col-scale { background: var(--laminados-bg); color: var(--laminados-text); }
th.col-base { border-top: 3px solid var(--verde); }
th.col-scale { border-top: 3px solid var(--dorado); }
tr.total-row td {
  font-style: normal;
  font-weight: 600;
  color: var(--lima);
  background: var(--verde-mid);
  border-color: #5C7767;
  border-top: 2px solid var(--verde);
}
.badge {
  display: inline-block; font-size: 9.5px; font-weight: 700;
  padding: 3px 8px; border-radius: 999px; margin-left: 7px;
  vertical-align: middle;
  background: var(--dorado); color: #fff;
  text-transform: uppercase; letter-spacing: .08em;
}

/* ---------- PROCESO ---------- */
.proceso {
  margin-top: 34px;
  border: 1px solid var(--crema-osc);
  border-left: 3px solid var(--verde);
  border-radius: var(--radio);
  padding: 22px 26px;
  background: #fff;
  box-shadow: var(--sombra);
}
.proceso h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 17px; font-weight: 600;
  color: var(--verde);
  margin: 0 0 12px;
}
.proceso h2::after {
  content: ''; display: block; width: 34px; height: 2px;
  background: var(--dorado); margin-top: 9px;
}
.proceso p, .proceso li {
  font-size: 13.5px; color: var(--muted); line-height: 1.75;
  white-space: pre-line; font-weight: 300;
}
.foot-meta {
  margin-top: 22px; font-size: 11.5px; color: var(--muted);
  border-top: 1px solid var(--crema-osc); padding-top: 12px; font-weight: 300;
}

/* ---------- ANCHO DE COLUMNAS DE LA TABLA ----------
   Los títulos largos (ej. "Escala x 80 unidades (3920 g)") forzaban columnas
   muy anchas y la escala quedaba cortada fuera de la pantalla. Dejando que el
   encabezado baje de línea, entran la columna BASE y al menos una escala sin
   tener que desplazarse hacia la derecha. */
thead th {
  white-space: normal;
  vertical-align: bottom;
  letter-spacing: .06em;
}
th.col-base, th.col-scale { min-width: 104px; }
th:first-child, td:first-child { min-width: 130px; }

.table-scroll { overflow-x: auto; }

@media (max-width: 640px) {
  .page { padding: 22px 16px 60px; }
  .topbar { padding: 13px 16px; }
  table { font-size: 12px; }
  th, td { padding: 8px 9px; }
  h1 { font-size: 24px; }
  .meta { gap: 6px 0; }
  .meta-item { padding: 0 14px; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
}

/* ==============================================================
   Logo Hogaza Bakery
   El PNG ya viene en el color correcto, así que se anula el filtro
   que teñía el logo anterior. El selector apunta solo a los
   archivos nuevos: las páginas que todavía usan logo-gho.png
   siguen viéndose igual hasta que se migren.
   ============================================================== */
.brand-logo[src*="logo-hogaza"]{
  height: 34px;
  width: auto;
  display: block;
  filter: none;
}
@media (max-width: 560px){
  .brand-logo[src*="logo-hogaza"]{ height: 27px; }
}

/* El link de volver quedaba pegado al nombre de la marca. */
.topbar .brand + a{ margin-left: 14px; }
