/* public/css/estilos.css — alineado a manual de marca MiChefLab */

:root {
  /* Paleta MiChefLab */
  --color-fondo: #f0ebe3;          /* Crema */
  --color-superficie: #ffffff;
  --color-texto: #0d0d0d;          /* Negro MiChef */
  --color-texto-suave: #555555;    /* Gris texto */
  --color-borde: #e0d8cc;          /* Borde crema */
  --color-acento: #ff6b1a;         /* Naranja MiChef */
  --color-acento-hover: #ff8c47;   /* Naranja claro */
  --color-acento-suave: #ffe4d2;
  --color-exito: #16a34a;
  --color-exito-suave: #f0fdf4;
  --color-error: #dc2626;
  --color-error-suave: #fff1f2;

  /* Tipografía MiChefLab */
  --fuente-display: 'Barlow Condensed', sans-serif;
  --fuente-cuerpo: 'Space Grotesk', sans-serif;
  --fuente-mono: 'JetBrains Mono', 'Courier New', monospace;

  /* Layout */
  --radio: 6px;
  --sombra: 0 1px 2px rgba(13, 13, 13, 0.06), 0 4px 12px rgba(13, 13, 13, 0.05);

  /* Sidebar oscura (igual patrón que Asesor/Caja/Oído) */
  --sidebar-fondo: #0d0d0d;
  --sidebar-texto: #ffffff;
  --sidebar-texto-suave: #9a9a9a;
  --sidebar-hover: #1f1f1f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--color-fondo);
  color: var(--color-texto);
  font-family: var(--fuente-cuerpo);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--fuente-display);
  font-weight: 900;
  letter-spacing: -0.01em;
  margin: 0 0 0.4em;
}

h1 { font-size: 2.2rem; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.3rem; }

a { color: var(--color-acento); }

.contenedor {
  max-width: 480px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem;
}

.contenedor-ancho {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Wordmark MiChefLab: ícono + "MiChef" + "Lab" en naranja */
.marca {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 2rem;
}

.marca__icono {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  flex-shrink: 0;
}

.marca__texto-grupo {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.marca__wordmark {
  font-family: var(--fuente-display);
  font-weight: 900;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
}

.marca__mi-chef { color: var(--color-texto); }
.marca__lab { color: var(--color-acento); }

.marca__producto {
  font-family: var(--fuente-cuerpo);
  font-weight: 600;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-texto-suave);
}

/* Variante para fondos oscuros (sidebar) */
.marca--sobre-oscuro .marca__mi-chef { color: #ffffff; }
.marca--sobre-oscuro .marca__producto { color: var(--sidebar-texto-suave); }

.tarjeta {
  background: var(--color-superficie);
  border: 1px solid var(--color-borde);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 1.75rem;
}

.campo {
  margin-bottom: 1.1rem;
}

.campo label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-texto-suave);
  margin-bottom: 0.35rem;
}

.campo input,
.campo select,
.campo textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--color-borde);
  border-radius: var(--radio);
  font-family: var(--fuente-cuerpo);
  font-size: 0.95rem;
  color: var(--color-texto);
  background: #fff;
}

.campo input:focus,
.campo select:focus,
.campo textarea:focus {
  outline: 2px solid var(--color-acento);
  outline-offset: 1px;
  border-color: var(--color-acento);
}

.boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.3rem;
  border-radius: var(--radio);
  border: none;
  font-family: var(--fuente-cuerpo);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: transform 0.08s ease, opacity 0.15s ease, background 0.15s ease;
}

.boton:active { transform: scale(0.98); }

.boton:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.boton__spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  display: inline-block;
  animation: girar 0.7s linear infinite;
}

.boton--secundario .boton__spinner,
.boton--texto .boton__spinner {
  border: 2px solid rgba(255,107,26,0.3);
  border-top-color: var(--color-acento);
}

@keyframes girar {
  to { transform: rotate(360deg); }
}

.boton--principal {
  background: var(--color-acento);
  color: #fff;
  width: 100%;
}

.boton--principal:hover { background: var(--color-acento-hover); }

.boton--secundario {
  background: transparent;
  color: var(--color-texto);
  border: 1px solid var(--color-borde);
}

.boton--texto {
  background: transparent;
  color: var(--color-acento);
  padding: 0.4rem 0.2rem;
}

.error-mensaje {
  background: var(--color-error-suave);
  color: var(--color-error);
  border-radius: var(--radio);
  padding: 0.65rem 0.85rem;
  font-size: 0.87rem;
  margin-bottom: 1rem;
}

.enlace-alterno {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.88rem;
  color: var(--color-texto-suave);
}

/* Ficha tipo credencial — usada para PIN y código anónimo */
.ficha-credencial {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.9rem 1.4rem;
  background: var(--color-acento-suave);
  border-radius: var(--radio);
  position: relative;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
}

.ficha-credencial__etiqueta {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-texto-suave);
}

.ficha-credencial__valor {
  font-family: var(--fuente-mono);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-texto);
}

/* Estados (badges) */
.estado {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.55rem;
  border-radius: 3px;
}

.estado--editable { background: var(--color-exito-suave); color: var(--color-exito); }
.estado--bloqueada { background: var(--color-error-suave); color: var(--color-error); }
.estado--pendiente { background: var(--color-acento-suave); color: var(--color-acento); }
.estado--evaluada { background: var(--color-exito-suave); color: var(--color-exito); }
.estado--no_presentada { background: #eee; color: var(--color-texto-suave); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ------------------------------------------------------------------
   Shell de app: sidebar oscura + contenido claro
   (mismo patrón visual que Asesor / Caja / Oído)
   ------------------------------------------------------------------ */
.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.app-sidebar {
  background: var(--sidebar-fondo);
  color: var(--sidebar-texto);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
}

.app-sidebar .marca { margin-bottom: 1.75rem; }

.app-sidebar__volver {
  font-size: 0.8rem;
  color: var(--sidebar-texto-suave);
  text-decoration: none;
  display: block;
  margin-bottom: 1.25rem;
}

.app-sidebar__contexto {
  padding-bottom: 1.25rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #262626;
}

.app-sidebar__contexto-nombre {
  font-family: var(--fuente-display);
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 0.4rem;
}

.app-sidebar__label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6a6a6a;
  margin: 0.5rem 0 0.4rem;
  padding: 0 0.7rem;
}

.app-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.app-sidebar-nav button,
.app-sidebar-nav a {
  text-align: left;
  background: transparent;
  border: none;
  padding: 0.6rem 0.7rem;
  border-radius: var(--radio);
  font-family: var(--fuente-cuerpo);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--sidebar-texto);
  cursor: pointer;
  text-decoration: none;
  display: block;
}

.app-sidebar-nav button:hover,
.app-sidebar-nav a:hover { background: var(--sidebar-hover); }

.app-sidebar-nav button.activo {
  background: var(--color-acento);
  color: #fff;
}

.app-sidebar__spacer { flex: 1; }

.app-sidebar__footer {
  border-top: 1px solid #262626;
  padding-top: 1rem;
  font-size: 0.82rem;
  color: var(--sidebar-texto-suave);
}

.app-sidebar__footer .boton--secundario {
  border-color: #333;
  color: #fff;
  width: 100%;
  margin-top: 0.6rem;
}

.app-content {
  padding: 2rem 2.5rem;
}

/* Fila de tarjetas de resumen (mismo patrón que Asesor) */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1.75rem;
  max-width: 900px;
}

.stat-card {
  background: var(--color-superficie);
  border: 1px solid var(--color-borde);
  border-radius: var(--radio);
  padding: 1rem 1.1rem;
}

.stat-card__numero {
  font-family: var(--fuente-display);
  font-weight: 900;
  font-size: 1.9rem;
  line-height: 1;
  color: var(--color-acento);
  margin-bottom: 0.25rem;
}

.stat-card__numero--alerta { color: var(--color-error); }
.stat-card__numero--ok { color: var(--color-exito); }

.stat-card__etiqueta {
  font-size: 0.78rem;
  color: var(--color-texto-suave);
}

/* Tablas de planillas: card contenedora, columnas parejas, encabezado marcado */
.tabla-planilla-wrap {
  background: var(--color-superficie);
  border: 1px solid var(--color-borde);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 0.5rem 1.25rem;
  overflow-x: auto;
}

.tabla-planilla {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.tabla-planilla th,
.tabla-planilla td {
  padding: 0.75rem 0.6rem;
  text-align: center;
  border-bottom: 1px solid var(--color-borde);
  font-size: 0.88rem;
}

.tabla-planilla th:first-child,
.tabla-planilla td:first-child {
  text-align: left;
  font-weight: 600;
  width: 26%;
}

.tabla-planilla thead th {
  background: var(--color-fondo);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-texto-suave);
  border-bottom: 2px solid var(--color-borde);
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}

.tabla-planilla tbody tr:hover { background: var(--color-acento-suave); }

.tabla-planilla tfoot td,
.tabla-planilla tr.fila-total td {
  font-weight: 700;
  border-top: 2px solid var(--color-texto);
  border-bottom: none;
  background: var(--color-fondo);
}
