/* Monitor de sucursales — móvil primero (390 px). Hueso + tinta; el color lo ponen las 3 sucursales. */
@font-face { font-family: Geist; src: url(/vendor/fonts/Geist-Variable.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #F4F1EA; --surface: #FFFFFF; --surface-2: #ECE8DE; --line: #DDD8CB;
  --ink: #1B1F23; --ink-2: #444A51; --muted: #5F666D; --on-ink: #FFFFFF;
  --ok: #1F6B2E; --ok-bg: #E3F1E4; --aviso: #8A5A00; --aviso-bg: #FBEFD2; --error: #B42318; --error-bg: #FBE4E1; --foco: #1C7ED6;
  --r-s: 10px; --r-m: 14px; --r-l: 20px;
  --sombra: 0 1px 2px rgba(27,31,35,.06), 0 6px 20px rgba(27,31,35,.07);
  --seg-top: env(safe-area-inset-top, 0px); --seg-bot: env(safe-area-inset-bottom, 0px);
  --alto-app: 100dvh;
  --fuente: Geist, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--fuente); font-size: 16px; line-height: 1.4; overscroll-behavior: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--foco); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.i { width: 24px; height: 24px; fill: currentColor; flex: none; }
.i--s { width: 18px; height: 18px; }
.tenue { color: var(--muted); font-weight: 400; }
h1, h2, h3, p, dl, dd, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }

/* ---------- Estructura ---------- */
.raiz { height: var(--alto-app); display: flex; flex-direction: column; overflow: hidden; }
.arranque { margin: auto; display: flex; gap: 10px; }
.arranque__punto { width: 14px; height: 14px; border-radius: 50%; animation: pulso 1.2s ease-in-out infinite; }
.arranque__punto:nth-child(1) { background: #1C7ED6; } .arranque__punto:nth-child(2) { background: #2F9E44; animation-delay: .2s; } .arranque__punto:nth-child(3) { background: #E8590C; animation-delay: .4s; }
@keyframes pulso { 0%, 100% { transform: scale(.7); opacity: .5; } 50% { transform: scale(1); opacity: 1; } }
.app { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pane { flex: 1; min-height: 0; display: flex; flex-direction: column; outline: none; }
.vista { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.contenido { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 4px 16px 24px; display: flex; flex-direction: column; gap: 14px; }

/* ---------- Botones y campos ---------- */
.btn { min-height: 48px; padding: 0 20px; border-radius: var(--r-m); border: 1.5px solid transparent; background: var(--ink); color: var(--on-ink); font-weight: 600; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: none; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn--suave { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn--peligro { background: var(--surface); color: var(--error); border-color: #E7B8B3; }
.btn--bloque { width: 100%; }
.btn--s { min-height: 44px; padding: 0 16px; font-size: 15px; }
.icono-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; color: var(--ink); flex: none; }
.icono-btn:active { background: var(--surface-2); }
.girando .i { animation: giro .8s linear infinite; }
@keyframes giro { to { transform: rotate(360deg); } }
.enlace { background: none; border: 0; padding: 0; min-height: 24px; color: inherit; font-weight: 700; text-decoration: underline; }
.campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.campo > label, .etiqueta { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.input { min-height: 48px; width: 100%; padding: 0 14px; border-radius: var(--r-m); border: 1.5px solid var(--line); background: var(--surface); font-size: 16px; min-width: 0; }
.input:focus-visible { outline-offset: 0; border-color: var(--foco); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
.ayuda { font-size: 14px; color: var(--muted); display: flex; gap: 6px; align-items: flex-start; }
.ayuda .i { margin-top: 1px; }
.error-campo { font-size: 14px; color: var(--error); font-weight: 600; }

/* ---------- Acceso ---------- */
.login { flex: 1; overflow: auto; display: flex; flex-direction: column; justify-content: center; padding: calc(24px + var(--seg-top)) 24px calc(24px + var(--seg-bot)); max-width: 440px; width: 100%; margin: 0 auto; gap: 28px; }
.login__marca { display: flex; flex-direction: column; gap: 14px; }
.puntos { display: flex; gap: 8px; }
.puntos i { width: 14px; height: 14px; border-radius: 50%; display: block; }
.login h1 { font-size: 30px; line-height: 1.1; letter-spacing: -0.02em; font-weight: 650; }
.login__sub { color: var(--ink-2); font-size: 16px; }
.login form { display: flex; flex-direction: column; gap: 16px; }

/* ---------- Encabezado del panel ---------- */
.cabecera { padding: calc(14px + var(--seg-top)) 16px 10px; display: flex; flex-direction: column; gap: 12px; flex: none; }
.cabecera__fila { display: flex; align-items: flex-start; gap: 8px; justify-content: space-between; }
.titulo { font-size: 26px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.1; }
.subtitulo { font-size: 14px; color: var(--muted); margin-top: 4px; }
.solo-lectura { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--ink-2); }
.solo-lectura .i { vertical-align: -3px; }
.segmentos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: var(--surface-2); border-radius: var(--r-m); }
.segmento { min-height: 44px; border: 0; background: transparent; border-radius: 10px; font-weight: 600; font-size: 15px; color: var(--ink-2); }
.segmento[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--sombra); }

/* ---------- Resumen y tarjetas ---------- */
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-m); font-size: 14.5px; }
.banner--aviso { background: var(--aviso-bg); color: var(--aviso); }
.banner .i { margin-top: 1px; }
.hero { border-radius: var(--r-l); padding: 18px 20px; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); }
.hero--ok { background: var(--ok-bg); border-color: #B9DBBD; color: var(--ok); }
.hero--aviso { background: var(--aviso-bg); border-color: #EBD59A; color: var(--aviso); }
.hero--alerta { background: var(--error-bg); border-color: #F0BDB7; color: var(--error); }
.hero__etq { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.hero__num { display: flex; align-items: baseline; gap: 8px; margin: 2px 0; }
.hero__num > span:first-child { font-size: 56px; line-height: 1; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.hero__unidad { font-size: 20px; font-weight: 600; }
.hero__det { font-size: 15px; font-weight: 500; }
.tarjetas { display: flex; flex-direction: column; gap: 14px; }
.suc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 21px 16px 16px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--sombra); position: relative; overflow: hidden; }
.suc::before, .acordeon::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: var(--c); }
.suc__cab { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.suc__punto { width: 12px; height: 12px; border-radius: 50%; background: var(--c); flex: none; }
.suc__id { flex: 1; min-width: 120px; }
.suc__id h2 { font-size: 20px; font-weight: 650; letter-spacing: -0.01em; }
.suc__horario { font-size: 13.5px; color: var(--muted); }
.estado { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); max-width: 100%; }
.estado--ok { background: var(--ok-bg); color: var(--ok); }
.estado--aviso { background: var(--aviso-bg); color: var(--aviso); }
.estado--mal { background: var(--error-bg); color: var(--error); }
.cifras { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cifras > div { background: var(--bg); border-radius: var(--r-m); padding: 10px 10px 8px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cifras dt { font-size: 13px; color: var(--ink-2); font-weight: 600; order: 2; }
.cifras dd { font-size: 30px; line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; order: 1; }
.cifras .cifra--alerta { background: var(--error-bg); }
.cifras .cifra--alerta dd, .cifras .cifra--alerta dt { color: var(--error); }
.barra { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.barra span { display: block; height: 100%; background: var(--c); border-radius: 4px; }
.suc__prom { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--ink-2); }
.suc__prom b { color: var(--ink); }
.suc__prom--lento b { color: var(--error); }
.pend h3 { font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.insignia { min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; background: var(--error); color: #fff; font-size: 13px; font-weight: 700; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.insignia--cero { background: var(--ok-bg); color: var(--ok); }
.pend ul { display: flex; flex-direction: column; margin-bottom: 10px; }
.fila { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); min-height: 56px; }
.fila:last-child { border-bottom: 0; }
.fila__txt { min-width: 0; flex: 1; }
.fila__nombre { font-size: 16px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fila__previa { font-size: 14px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tiempo { flex: none; text-align: right; font-size: 14px; font-weight: 700; padding: 4px 10px; border-radius: 10px; background: var(--aviso-bg); color: var(--aviso); font-variant-numeric: tabular-nums; max-width: 46%; }
.tiempo small { display: block; font-size: 11.5px; font-weight: 600; opacity: .9; }
.tiempo--alerta { background: var(--error-bg); color: var(--error); }
.sin-pend { padding: 6px 0 4px; }
.nota { font-size: 13px; color: var(--muted); padding: 0 4px; }
.vacio { padding: 48px 28px; text-align: center; color: var(--ink-2); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.vacio h2 { font-size: 20px; }
.vacio p { max-width: 300px; }

/* ---------- Barra inferior ---------- */
.tabs { display: flex; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 12px calc(6px + var(--seg-bot)); gap: 8px; flex: none; }
.tab { flex: 1; min-height: 52px; border: 0; background: transparent; border-radius: var(--r-m); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.tab[aria-current="page"] { color: var(--ink); background: var(--surface-2); }

/* ---------- Ajustes ---------- */
.bloque { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.bloque__t { font-size: 18px; font-weight: 650; }
.acordeon { padding: 5px 0 0; gap: 0; position: relative; overflow: hidden; }
.acordeon summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 14px 16px; min-height: 56px; cursor: pointer; flex-wrap: wrap; }
.acordeon summary::-webkit-details-marker { display: none; }
.acordeon__t { font-size: 18px; font-weight: 650; flex: 1; }
.acordeon__flecha { transition: transform .15s; }
.acordeon[open] .acordeon__flecha { transform: rotate(180deg); }
.acordeon__cuerpo { padding: 0 12px 16px; display: flex; flex-direction: column; gap: 14px; }
.vinc { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.vinc .campo { width: 100%; }
.codigo { width: 100%; background: var(--bg); border-radius: var(--r-m); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.codigo__num { font-size: 40px; font-weight: 700; letter-spacing: .08em; text-align: center; font-variant-numeric: tabular-nums; }
.pasos { padding-left: 20px; list-style: decimal; display: flex; flex-direction: column; gap: 6px; font-size: 15px; color: var(--ink-2); }
.sep { border: 0; border-top: 1px solid var(--line); margin: 0; width: 100%; }
.form { display: flex; flex-direction: column; gap: 14px; }
.dos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dias { display: flex; gap: 3px; flex-wrap: wrap; }
.dia-btn { flex: 1 0 44px; min-width: 44px; min-height: 44px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 700; }
.dia-btn[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.interruptor { display: flex; gap: 12px; align-items: flex-start; min-height: 44px; font-weight: 600; font-size: 15.5px; }
.interruptor input { width: 24px; height: 24px; margin: 8px 0 0; accent-color: var(--ink); flex: none; }
.interruptor small { display: block; font-weight: 400; color: var(--muted); font-size: 13.5px; }
.interruptor span { padding-top: 8px; }
.avisos { display: flex; flex-direction: column; }
.aviso { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.aviso:last-child { border-bottom: 0; }
.aviso__cab { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.aviso__txt { font-size: 14.5px; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.usuarios { display: flex; flex-direction: column; gap: 10px; }
.usuario { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; font-size: 15px; }
.clave-nueva { background: var(--aviso-bg); border-radius: var(--r-m); padding: 14px; display: flex; flex-direction: column; gap: 10px; font-size: 14.5px; }
.clave { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }
.plegable summary { min-height: 44px; display: flex; align-items: center; font-weight: 650; cursor: pointer; }
.plegable form { padding-top: 6px; }
.cuenta { display: flex; gap: 12px; align-items: center; }
.avatar-u { width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }

/* ---------- Avisos de la app ---------- */
.aviso-conexion { position: fixed; left: 12px; right: 12px; top: calc(8px + var(--seg-top)); z-index: 50; background: var(--ink); color: #fff; padding: 12px 14px; border-radius: var(--r-m); font-size: 14px; text-align: center; }
.toasts { position: fixed; left: 12px; right: 12px; bottom: calc(76px + var(--seg-bot)); z-index: 60; display: flex; justify-content: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--r-m); font-size: 15px; box-shadow: var(--sombra); max-width: 420px; }
.toast--error { background: var(--error); }

/* ---------- Escritorio ---------- */
@media (min-width: 900px) {
  .app { flex-direction: row-reverse; }
  .tabs { flex-direction: column; border-top: 0; border-right: 1px solid var(--line); width: 96px; padding: 20px 12px; justify-content: flex-start; }
  .tab { flex: none; width: 100%; }
  .pane { align-items: center; }
  .vista { width: 100%; max-width: 1240px; }
  .cabecera, .contenido { padding-left: 32px; padding-right: 32px; }
  .cabecera { flex-direction: row; align-items: center; justify-content: space-between; }
  .cabecera .cabecera__fila { flex: 1; }
  .segmentos { width: 340px; }
  .tarjetas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
  .hero { display: grid; grid-template-columns: auto 1fr; column-gap: 28px; align-items: center; }
  .hero__etq { grid-column: 1 / -1; }
  .toasts { bottom: 24px; }
}
@media (min-width: 900px) and (max-width: 1100px) { .tarjetas { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
