/* BBM Turnos — estilos compartidos */
:root {
  --primario: #0E7C66;
  --acento: #FFFFFF;
  --fondo: #0B1220;
  --tarjeta: #141D2E;
  --texto: #FFFFFF;
  --sobre-primario: #FFFFFF;
  --sobre-acento: #0B0F17;
  --fuente: "Montserrat", system-ui, sans-serif;
  --radio: 18px;
  /* Paleta neutra de los paneles de trabajo */
  --p-fondo: #F2F4F7;
  --p-sup: #FFFFFF;
  --p-borde: #E3E7ED;
  --p-texto: #101828;
  --p-suave: #5B6577;
  --p-peligro: #D92D20;
  --p-ok: #079455;
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body { -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
[hidden] { display: none !important; }
img { max-width: 100%; }
.ico { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }

/* ── Botones ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  padding: .8em 1.3em; border-radius: 12px; font-weight: 600; line-height: 1.1;
  background: var(--primario); color: var(--sobre-primario);
  transition: transform .12s ease, filter .15s ease, opacity .15s; user-select: none;
}
a.btn { text-decoration: none; }
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.sec { background: transparent; color: inherit; box-shadow: inset 0 0 0 1.5px currentColor; opacity: .9; }
.btn.suave { background: rgba(127,127,127,.12); color: inherit; }
.btn.peligro { background: var(--p-peligro); color: #fff; }
.btn.acento { background: var(--acento); color: var(--sobre-acento); }
.btn.xl { font-size: 1.25rem; padding: 1.05em 1.6em; border-radius: 16px; }
.btn.chico { padding: .5em .8em; font-size: .88rem; border-radius: 9px; }
.btn.ancho { width: 100%; }

/* ── Aviso flotante ── */
.aviso {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 30px); opacity: 0;
  background: #101828; color: #fff; padding: .85em 1.3em; border-radius: 12px; font-weight: 500;
  box-shadow: 0 12px 32px rgba(0,0,0,.28); transition: .25s; z-index: 1000; max-width: calc(100% - 32px); text-align: center; pointer-events: none;
}
.aviso.visible { opacity: 1; transform: translate(-50%, 0); }
.aviso.error { background: var(--p-peligro); }
.aviso.ok { background: var(--p-ok); }

.credito {
  position: fixed; right: 14px; bottom: 10px; font-size: 11px; opacity: .45; letter-spacing: .02em; z-index: 5; pointer-events: none;
}

/* ════════ Paneles de trabajo (módulo, configuración, BBM) ════════ */
body.panel { background: var(--p-fondo); color: var(--p-texto); font-family: "Inter", system-ui, sans-serif; font-size: 15px; }
.panel .barra {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  padding: 12px 20px; background: var(--p-sup); border-bottom: 1px solid var(--p-borde);
}
.panel .barra .logo-mini { height: 40px; width: auto; max-width: 160px; object-fit: contain; padding: 5px 9px; border-radius: 10px; background: var(--fondo); }
.panel .barra h1 { font-size: 1.05rem; font-weight: 700; }
.panel .barra .sub { color: var(--p-suave); font-size: .85rem; }
.panel .barra .esp { flex: 1; }
.panel .contenedor { max-width: 1180px; margin: 0 auto; padding: 22px 20px 70px; }
.tarjeta { background: var(--p-sup); border: 1px solid var(--p-borde); border-radius: var(--radio); padding: 22px; }
.tarjeta + .tarjeta { margin-top: 16px; }
.tarjeta h2 { font-size: 1.05rem; font-weight: 700; display: flex; align-items: center; gap: .5em; margin-bottom: 4px; }
.tarjeta h2 .ico { color: var(--primario); }
.tarjeta .desc { color: var(--p-suave); font-size: .88rem; margin-bottom: 16px; }
.campo { display: grid; gap: 6px; margin-bottom: 14px; }
.campo > span { font-size: .82rem; font-weight: 600; color: var(--p-suave); }
.campo input[type=text], .campo input[type=password], .campo input[type=number], .campo select, .campo textarea, .entrada {
  width: 100%; padding: .72em .9em; border-radius: 10px; border: 1.5px solid var(--p-borde); background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
}
.campo textarea { resize: vertical; min-height: 70px; }
.campo input:focus, .campo select:focus, .campo textarea:focus, .entrada:focus { border-color: var(--primario); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primario) 18%, transparent); }
.fila { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.rejilla { display: grid; gap: 16px; }
.r2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.r3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .r2, .r3 { grid-template-columns: 1fr; } }
.interruptor { display: flex; align-items: center; gap: 12px; padding: 10px 0; cursor: pointer; }
.interruptor input { appearance: none; width: 42px; height: 24px; border-radius: 20px; background: #CBD2DC; position: relative; transition: .2s; flex: none; cursor: pointer; }
.interruptor input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.interruptor input:checked { background: var(--primario); }
.interruptor input:checked::after { left: 21px; }
.interruptor small { display: block; color: var(--p-suave); font-size: .8rem; }
.chip { display: inline-flex; align-items: center; gap: .4em; padding: .3em .7em; border-radius: 999px; font-size: .78rem; font-weight: 600; background: #EEF1F5; color: var(--p-suave); }
.chip.vivo { background: #E6F6EE; color: var(--p-ok); }
.chip.vivo::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulso 1.6s infinite; }
.chip.caido { background: #FDECEA; color: var(--p-peligro); }
@keyframes pulso { 50% { opacity: .3; } }

/* Acceso con clave */
.acceso { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.acceso .tarjeta { width: min(420px, 100%); text-align: center; padding: 34px 28px; }
.acceso .candado { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; margin: 0 auto 14px; background: color-mix(in srgb, var(--primario) 12%, #fff); color: var(--primario); }
.acceso .candado .ico { width: 28px; height: 28px; }
.acceso h1 { font-size: 1.3rem; margin-bottom: 6px; }
.acceso p { color: var(--p-suave); margin-bottom: 20px; font-size: .92rem; }
.caja-clave { position: relative; display: block; }
.caja-clave input { padding-right: 46px !important; padding-left: 46px !important; }
.ver-clave { position: absolute; right: 6px; top: 50%; transform: translateY(calc(-50% - 7px)); width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; color: var(--p-suave); }
.ver-clave:hover { background: #EEF1F5; color: var(--p-texto); }
.ver-clave .ico { width: 20px; height: 20px; }
.acceso input { text-align: center; font-size: 1.1rem; letter-spacing: .08em; margin-bottom: 14px; }

/* Modal */
.velo { position: fixed; inset: 0; background: rgba(16,24,40,.55); display: grid; place-items: center; padding: 20px; z-index: 200; }
.modal { background: #fff; color: var(--p-texto); border-radius: 20px; padding: 26px; width: min(460px, 100%); box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.modal h3 { font-size: 1.15rem; margin-bottom: 8px; }
.modal p { color: var(--p-suave); margin-bottom: 18px; }
.modal .fila { justify-content: flex-end; }

/* ════════ Pantallas de marca (registro, pantalla, ticket) ════════ */
body.marca {
  background: var(--fondo) center / cover no-repeat; color: var(--texto); font-family: var(--fuente);
  overflow-x: hidden;
}
.marca .logo { max-height: 110px; max-width: min(420px, 70vw); object-fit: contain; }
.marca .nombre-empresa { font-weight: 800; font-size: clamp(1.4rem, 3vw, 2.2rem); letter-spacing: -.01em; }
.vidrio { background: color-mix(in srgb, var(--tarjeta) 88%, transparent); backdrop-filter: blur(14px); border: 1px solid color-mix(in srgb, var(--texto) 9%, transparent); border-radius: 26px; }
.tenue { opacity: .68; }
.cargando { min-height: 100vh; display: grid; place-items: center; font-family: system-ui, sans-serif; color: #98A2B3; background: #0B1220; }
.cargando .giro { width: 38px; height: 38px; border-radius: 50%; border: 3px solid #334155; border-top-color: #94A3B8; animation: girar .8s linear infinite; margin: 0 auto 12px; }
@keyframes girar { to { transform: rotate(360deg); } }
.suspendida { position: fixed; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; background: #0B1220; color: #E2E8F0; font-family: system-ui, "Segoe UI", sans-serif; z-index: 9999; }
.suspendida h1 { font-size: clamp(1.6rem, 4vw, 3rem); font-weight: 800; margin-bottom: 10px; color: #fff; }
.suspendida p { font-size: clamp(1.05rem, 2.2vw, 1.6rem); opacity: .8; }
.suspendida-ico { width: clamp(64px, 9vw, 110px); height: clamp(64px, 9vw, 110px); margin: 0 auto 22px; border-radius: 28%; display: grid; place-items: center; background: rgba(255,255,255,.08); color: #fff; }
.suspendida-ico .ico { width: 48%; height: 48%; }
.suspendida small { position: fixed; right: 16px; bottom: 12px; font-size: 11px; opacity: .45; }
.error-sala { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 24px; font-family: system-ui, sans-serif; background: #0B1220; color: #E2E8F0; }
.error-sala h1 { font-size: 1.4rem; margin-bottom: 8px; }
.error-sala a { color: #93C5FD; }
