/* Lomé · tokens de la spec 04, sección 8 (Brand Book de Bismarck Branding Studio) */
:root {
  --midnight: #3B3535;
  --coffee: #5F432C;
  --camel: #C1A37F;
  --taupe: #C0B8A7;
  --linen: #EFECE9;
  --musky: #92AB98;
  --blanco: #FFFFFF;

  --fondo: var(--linen);
  --superficie: var(--blanco);
  --texto: var(--midnight);
  --texto-suave: #6B6360;
  --borde: var(--taupe);
  --acento: var(--coffee);

  /* estados (8.3) */
  --e-pendiente-fg: var(--midnight); --e-pendiente-bg: #E3DED5;
  --e-activa-fg: var(--coffee);      --e-activa-bg: #EFE6DC;
  --e-curso-fg: #8A5A1F;             --e-curso-bg: #F6EAD7;
  --e-lista-fg: #3F6B4E;             --e-lista-bg: #E1EBE3;
  --e-cancelada-fg: #9A3B2E;         --e-cancelada-bg: #F5E1DD;
  --e-pausa-fg: var(--midnight);     --e-pausa-bg: #C9D7CC;

  --radio: 10px;
  --sombra: 0 1px 2px rgba(59, 53, 53, .08), 0 4px 16px rgba(59, 53, 53, .06);
  --fuente: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--fuente); font-size: 15px; line-height: 1.45; color: var(--texto); background: var(--fondo); }
h1, h2, h3 { font-weight: 500; letter-spacing: .01em; margin: 0 0 .5em; }
h1 { font-size: 1.45rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
a { color: var(--acento); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--coffee); outline-offset: 2px; }

/* ---------- estructura ---------- */
.marco { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.lateral { background: var(--midnight); color: var(--linen); padding: 22px 14px; display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.marca { padding: 4px 10px 22px; }
.marca img { display: block; }
.marca .logo { width: 148px; margin: 0 auto; }
.marca .rombo { display: none; }
.lateral a { color: var(--linen); text-decoration: none; padding: 9px 12px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; }
.lateral a:hover { background: rgba(239, 236, 233, .08); }
.lateral a.activo { background: rgba(239, 236, 233, .14); }
.lateral .pie { margin-top: auto; font-size: .82rem; opacity: .85; padding: 10px 12px; border-top: 1px solid rgba(239, 236, 233, .15); }
.lateral .pie button { background: none; border: 0; color: var(--camel); padding: 6px 0 0; cursor: pointer; }
.globo { background: var(--camel); color: var(--midnight); border-radius: 99px; font-size: .72rem; font-weight: 600; padding: 1px 8px; }
.principal { padding: 24px 28px 48px; min-width: 0; }
.encabezado { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.encabezado h1 { margin: 0; }
.fila { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.columnas { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.suave { color: var(--texto-suave); font-size: .88rem; }

/* ---------- piezas ---------- */
.tarjeta { background: var(--superficie); border: 1px solid #E2DDD3; border-radius: var(--radio); box-shadow: var(--sombra); padding: 18px; }
.tarjeta + .tarjeta { margin-top: 14px; }
.boton { border: 1px solid var(--borde); background: var(--blanco); color: var(--texto); border-radius: 8px; padding: 9px 16px; cursor: pointer; min-height: 40px; }
.boton:hover { border-color: var(--coffee); }
.boton.principal-b { background: var(--coffee); border-color: var(--coffee); color: var(--blanco); }
.boton.principal-b:hover { background: #4E3624; }
.boton.peligro { color: var(--e-cancelada-fg); border-color: #DDB8B1; }
.boton.chico { padding: 4px 10px; min-height: 32px; font-size: .86rem; }
.boton:disabled { opacity: .5; cursor: not-allowed; }
.campo { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.campo label { font-size: .82rem; color: var(--texto-suave); }
.campo input, .campo select, .campo textarea { border: 1px solid var(--borde); border-radius: 8px; padding: 9px 11px; background: var(--blanco); min-height: 40px; }
.campo textarea { min-height: 70px; resize: vertical; }
.estado { display: inline-block; border-radius: 99px; padding: 2px 10px; font-size: .76rem; font-weight: 500; white-space: nowrap; }
.e-pendiente { color: var(--e-pendiente-fg); background: var(--e-pendiente-bg); }
.e-activa { color: var(--e-activa-fg); background: var(--e-activa-bg); }
.e-curso { color: var(--e-curso-fg); background: var(--e-curso-bg); }
.e-lista { color: var(--e-lista-fg); background: var(--e-lista-bg); }
.e-cancelada { color: var(--e-cancelada-fg); background: var(--e-cancelada-bg); }
.e-pausa { color: var(--e-pausa-fg); background: var(--e-pausa-bg); }
.error { background: var(--e-cancelada-bg); color: var(--e-cancelada-fg); border-radius: 8px; padding: 10px 12px; margin: 10px 0; }
.aviso { background: var(--e-curso-bg); color: var(--e-curso-fg); border-radius: 8px; padding: 8px 12px; margin: 6px 0; font-size: .9rem; }
.vacio { text-align: center; padding: 34px 16px; color: var(--texto-suave); }
.vacio .olas { width: 120px; opacity: .55; margin-bottom: 8px; }
table.lista { width: 100%; border-collapse: collapse; }
.lista th { text-align: left; font-weight: 500; font-size: .8rem; color: var(--texto-suave); padding: 8px; border-bottom: 1px solid #E2DDD3; }
.lista td { padding: 10px 8px; border-bottom: 1px solid #EEEAE3; vertical-align: top; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.total { font-size: 1.6rem; font-weight: 500; }

/* ---------- agenda ---------- */
.agenda { overflow-x: auto; background: var(--superficie); border-radius: var(--radio); box-shadow: var(--sombra); border: 1px solid #E2DDD3; }
.rejilla { display: grid; position: relative; min-width: 720px; }
.rejilla .cabeza { position: sticky; top: 0; background: var(--superficie); z-index: 2; font-weight: 500; font-size: .86rem; padding: 10px 8px; border-bottom: 1px solid #E2DDD3; }
.rejilla .hora { font-size: .74rem; color: var(--texto-suave); text-align: right; padding: 0 8px; transform: translateY(-.6em); }
.rejilla .celda { border-top: 1px solid #F1EDE7; border-left: 1px solid #F1EDE7; cursor: pointer; }
.rejilla .celda.hora-llena { border-top-color: #E4DFD7; }
.rejilla .celda:hover { background: #F7F3EE; }
.bloque { margin: 1px 3px; border-radius: 8px; padding: 5px 8px; font-size: .78rem; line-height: 1.3; overflow: hidden; cursor: pointer; border-left: 4px solid currentColor; z-index: 1; position: relative; }
.bloque .quien { font-weight: 600; font-size: .82rem; }
.bloque .limpieza { position: absolute; left: 0; right: 0; bottom: 0; background: repeating-linear-gradient(45deg, rgba(59,53,53,.06), rgba(59,53,53,.06) 4px, transparent 4px, transparent 8px); }

/* ---------- ventanas y avisos ---------- */
.velo { position: fixed; inset: 0; background: rgba(59, 53, 53, .42); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 20; overflow-y: auto; }
.ventana { background: var(--superficie); border-radius: 14px; width: min(620px, 100%); padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.ventana .acciones { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
#avisos { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 30; }
.toast { background: var(--midnight); color: var(--linen); border-radius: 10px; padding: 10px 14px; box-shadow: var(--sombra); max-width: 360px; }
.toast.mal { background: var(--e-cancelada-fg); }
.opciones { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.opcion { border: 1px solid var(--borde); border-radius: 8px; padding: 8px 10px; background: var(--blanco); cursor: pointer; text-align: left; }
.opcion:hover, .opcion.sel { border-color: var(--coffee); background: var(--e-activa-bg); }

/* ---------- entrada ---------- */
.entrada { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--midnight); }
.entrada > div { width: min(400px, 100%); }
.entrada .tarjeta { width: 100%; }
.entrada .marca { padding-bottom: 26px; }
.entrada .marca .logo { width: 230px; }
.teclado { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.teclado button { min-height: 64px; font-size: 1.4rem; border-radius: 12px; border: 1px solid var(--borde); background: var(--blanco); cursor: pointer; }
.puntos { text-align: center; font-size: 1.8rem; letter-spacing: .5em; min-height: 2.4rem; }

/* ---------- cabina (tableta) ---------- */
.cabina .boton { min-height: 56px; font-size: 1.05rem; padding: 12px 22px; }
.cabina .campo input { min-height: 52px; font-size: 1.1rem; }
.servicio-grande { font-size: 1.3rem; font-weight: 500; }
.crono { font-size: 3rem; font-weight: 300; font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  .marco { grid-template-columns: 1fr; }
  .lateral { flex-direction: row; flex-wrap: wrap; padding: 10px; align-items: center; position: static; height: auto; }
  .marca { padding: 0 10px; }
  .lateral .marca .logo { display: none; }
  .lateral .marca .rombo { display: block; height: 36px; }
  .lateral .pie { margin: 0 0 0 auto; border: 0; padding: 4px 8px; }
  .principal { padding: 16px; }
  .columnas { grid-template-columns: 1fr; }
}

[hidden] { display: none !important; }
select { max-width: 100%; }
.rejilla .hora.primera { transform: none; }
.ventana [data-horarios] .opciones { max-height: 252px; overflow-y: auto; }
a.boton { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
a.boton[aria-label] { font-size: 1.25rem; line-height: 1; padding: 0 14px; }

/* D4-01: verificación con el celular */
.codigo-celular { font-size: 1.4rem; letter-spacing: .15em; text-align: center; }
.qr { display: block; width: 200px; height: 200px; margin: 8px auto 12px; background: #fff; }
.clave-celular { display: inline-block; margin-top: 4px; font-size: .95rem; word-break: break-word; }
.codigos-recuperacion { list-style: none; padding: 0; margin: 12px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.codigos-recuperacion code { font-size: 1rem; }
.fila-check { display: flex; gap: 8px; align-items: center; margin-top: 8px; }

/* D4-08: notas previas en cabina */
.notas-previas { margin-top: 12px; }
.notas-previas summary { cursor: pointer; font-weight: 500; min-height: 32px; }
.notas-previas p { margin: 8px 0 0; }

/* PA-310: transferencias */
.tabla-ancha { overflow-x: auto; }
.candidato { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; padding: 8px 0; border-top: 1px solid var(--taupe, #C0B8A7); }

/* Pestañas y marcadores de pantallas de gestión */
.pestanas { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; border-bottom: 1px solid #E2DDD3; }
.pestanas button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 9px 12px; cursor: pointer; color: var(--texto-suave); min-height: 40px; }
.pestanas button.activa { color: var(--texto); border-bottom-color: var(--camel); font-weight: 500; }
.opcion.activa { border-color: var(--coffee, #5F432C); background: #F7F3EE; }
.metricas { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 14px; }
.metrica { background: var(--superficie); border: 1px solid #E2DDD3; border-radius: var(--radio); padding: 14px; }
.metrica b { display: block; font-size: 1.5rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.lista-desplazable { overflow-x: auto; }

a.metrica { color: inherit; text-decoration: none; }
a.opcion { display: block; color: inherit; text-decoration: none; }
/* PA-601 */
body.reserva { background: var(--midnight); min-height: 100vh; }
.reserva-marco { width: min(560px, 100%); margin: 0 auto; padding: 28px 16px 48px; }
.reserva-logo { display: block; width: 190px; margin: 0 auto 22px; }
.campo-trampa { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.lateral .enlaces { display: flex; flex-direction: column; gap: 2px; flex: 1; min-height: 0; overflow-y: auto; }
.lateral .pie { flex-shrink: 0; }
.reserva .opciones { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); max-height: 260px; overflow-y: auto; }
.reserva .opcion { text-align: center; }
@media (max-width: 900px) {
  .lateral .enlaces { order: 3; flex: 0 0 100%; flex-direction: row; overflow-x: auto; overflow-y: visible; }
  .lateral .enlaces a { white-space: nowrap; flex-shrink: 0; gap: 6px; }
}
