/* ============================================================
   styles.css — Estilos compartidos CUC Estacionamiento
   Mobile-first · sin frameworks
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --negro:   #272322;
  --rojo:    #b7372f;
  --rojo2:   #d34a40;
  --rojo-soft:#fff1f0;
  --verde:   #16a34a;
  --verde2:  #15803d;
  --amber:   #d97706;
  --azul:    #2563eb;

  --bg:      #fafafa;
  --bg2:     #ffffff;
  --border:  #e7e2e0;

  --text:    #1a1a1a;
  --text2:   #555555;
  --text3:   #999999;

  --radius:  14px;
  --radius-sm: 8px;
  --shadow:  0 2px 12px rgba(39,35,34,.07);
  --shadow-md: 0 4px 20px rgba(39,35,34,.11);
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body.admin-page,
body.app-page {
  max-width: none;
}
/* En pantallas más anchas (tablet/desktop) centramos el contenido */
@media (min-width: 500px) {
  body:not(.admin-page):not(.app-page) {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    min-height: 100vh;
  }
}
button { cursor: pointer; border: none; background: none; font: inherit; }
input, select, textarea { font: inherit; }
a { color: inherit; }
img { max-width: 100%; }

/* ── Header claro con acento rojo ───────────────────────────── */
.app-header {
  background: #fff;
  padding: 1rem 1.25rem .85rem;
  padding-right: clamp(90px, 28vw, 160px);
  display: flex;
  align-items: center;
  gap: .9rem;
  min-width: 0;
  position: relative;
  overflow: hidden;
  border-bottom: 3px solid var(--rojo);
  box-shadow: 0 2px 12px rgba(39,35,34,.06);
}
/* monolito emergiendo por la derecha en todos los banners */
.app-header::after {
  content: '';
  position: absolute;
  right: 40px;
  top: -12px;
  bottom: -12px;
  width: clamp(60px, 20vw, 110px);
  background: url('monolito.png') no-repeat bottom right / contain;
  pointer-events: none;
}
.rojo-stripe {
  display: none; /* reemplazado por border-bottom en app-header */
}
.app-header-info { flex: 1; min-width: 0; }
.app-header-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-header-sub {
  font-size: .75rem;
  color: var(--rojo);
  font-weight: 600;
  margin-top: .1rem;
}

/* ── Logo ───────────────────────────────────────────────────── */
.logo-md { width: 48px; height: 48px; object-fit: contain; border-radius: 8px; }
.logo-sm { width: 36px; height: 36px; object-fit: contain; border-radius: 6px; }
.logo-xs { width: 30px; height: 30px; object-fit: contain; border-radius: 5px; }

/* ── Botones ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .65rem 1.1rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: .88rem;
  transition: opacity .15s, transform .1s, filter .1s;
  text-align: center;
  line-height: 1.2;
}
.btn:active { transform: scale(.97); }
.btn:hover  { filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; filter: none; }

.btn-negro   { background: var(--negro); color: #fff; }
.btn-rojo    { background: var(--rojo);  color: #fff; }
.btn-verde   { background: var(--verde); color: #fff; }
.btn-amber   { background: var(--amber); color: #fff; }
.btn-danger  { background: #dc2626;      color: #fff; }
.btn-outline {
  background: #fff;
  color: var(--negro);
  border: 2px solid #d0d0d0;
}
.btn-outline:hover { border-color: var(--rojo); color: var(--rojo); filter: none; }
.btn-ghost {
  background: transparent;
  color: rgba(255,255,255,.65);
  border: 1.5px solid rgba(255,255,255,.3);
}

.btn-sm  { padding: .45rem .85rem; font-size: .8rem; }
.btn-md  { padding: .7rem 1.2rem; }
.btn-lg  { padding: .9rem 1.4rem; font-size: 1rem; }
.btn-full { width: 100%; }

/* ── Formulario ─────────────────────────────────────────────── */
.form-card {
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.form-card-header { margin-bottom: 1.1rem; }
.form-card-header h2 {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: .2rem;
}
.form-card-header p { font-size: .85rem; color: var(--text2); }

.campo { display: flex; flex-direction: column; gap: .35rem; margin-bottom: .9rem; }
.campo label { font-size: .82rem; font-weight: 700; color: var(--text2); }
.campo input,
.campo select,
.campo textarea {
  padding: .7rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  background: #fafafa;
  color: var(--text);
  transition: border-color .15s;
  -webkit-appearance: none;
}
.campo input:focus,
.campo select:focus,
.campo textarea:focus {
  outline: none;
  border-color: var(--negro);
  background: #fff;
}
.campo input.input-error,
.campo select.input-error { border-color: var(--rojo); }

.campo-error {
  font-size: .78rem;
  color: var(--rojo);
  font-weight: 600;
  display: none;
}
.campo-error.visible { display: block; }

/* ── Alertas inline ─────────────────────────────────────────── */
.alerta-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
  border-radius: var(--radius-sm);
  padding: .65rem .9rem;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: .9rem;
}
.alerta-ok {
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #15803d;
  border-radius: var(--radius-sm);
  padding: .65rem .9rem;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: .9rem;
}

/* ── Toast ──────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: .5rem;
  z-index: 1000;
  pointer-events: none;
  width: 90%;
  max-width: 380px;
}
.toast {
  padding: .75rem 1.1rem;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 700;
  text-align: center;
  animation: toastIn .25s ease;
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
}
.toast-ok    { background: var(--verde); color: #fff; }
.toast-error { background: #dc2626;      color: #fff; }
.toast-warn  { background: var(--amber); color: #fff; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Confirm overlay ────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  z-index: 500;
}
.overlay.open { display: flex; }
.overlay-box {
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 1.5rem;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
}
.overlay-box h3 {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: .5rem;
}
.overlay-box p {
  font-size: .88rem;
  color: var(--text2);
  margin-bottom: 1.1rem;
  line-height: 1.5;
}
.overlay-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: .2rem .55rem;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.4;
}
.badge-activo  { background: #dcfce7; color: #15803d; }
.badge-sin-cerrar { background: #fee2e2; color: #b91c1c; }
.badge-cerrado { background: #f3f4f6; color: #6b7280; }
.badge-ef      { background: #fef9c3; color: #854d0e; }
.badge-tr      { background: #dbeafe; color: #1d4ed8; }
.badge-libre   { background: #f3e8ff; color: #7c3aed; }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}

.res-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}
.res-card {
  background: var(--bg2);
  border-radius: var(--radius);
  padding: .85rem 1rem;
  box-shadow: var(--shadow);
}
.res-card-destac {
  grid-column: 1 / -1;
  background: var(--verde);
}
.res-card-destac .res-label { color: rgba(255,255,255,.8); }
.res-card-destac .res-valor,
.res-card-destac .res-valor.grande,
.res-card-destac .res-valor.verde {
  color: #fff;
}
.res-card-destac .res-sub { color: rgba(255,255,255,.85); }
.res-label { font-size: .72rem; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: .04em; }
.res-valor { font-size: 1.6rem; font-weight: 900; line-height: 1.1; margin-top: .15rem; }
.res-valor.verde { color: var(--verde); }
.res-valor.grande { font-size: 2rem; }
.res-sub { font-size: .78rem; color: var(--text3); margin-top: .2rem; }

/* ── Home hero header ───────────────────────────────────────── */
.home-hero {
  background: #fff;
  position: relative;
  overflow: hidden;
  border-bottom: 3px solid var(--rojo);
  box-shadow: 0 2px 14px rgba(39,35,34,.06);
}
.home-hero-body {
  display: flex;
  align-items: center;
  padding: 1.35rem 1.25rem 1.3rem;
  gap: 1.1rem;
  padding-right: clamp(90px, 28vw, 160px);
  min-height: 90px;
}
.home-hero-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  flex-shrink: 0;
}
.home-hero-info { flex: 1; min-width: 0; }
.home-hero-titulo {
  font-size: clamp(1.1rem, 4.5vw, 1.45rem);
  font-weight: 900;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -.02em;
}
.home-hero-sub {
  font-size: clamp(.75rem, 2.8vw, .88rem);
  font-weight: 700;
  color: var(--rojo2);
  letter-spacing: .03em;
  text-transform: uppercase;
  margin-top: .35rem;
}
.home-hero-monolito {
  position: absolute;
  right: 50px;
  bottom: -12px;
  height: 105%;
  width: auto;
  object-fit: contain;
  object-position: bottom right;
  pointer-events: none;
  user-select: none;
}

/* ── Evento card (lista) ────────────────────────────────────── */
.evento-card {
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .15s;
  border: 2px solid transparent;
  min-width: 0;
  width: 100%;
}
.evento-card:hover  { border-color: var(--rojo); }
.evento-card:active { transform: scale(.98); }
.evento-card-vs {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: .3rem;
}
.evento-card-meta {
  display: flex;
  gap: .4rem;
  font-size: .8rem;
  color: var(--text2);
  flex-wrap: wrap;
}
.evento-card-precio {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--verde);
  margin-top: .45rem;
}

/* ── Evento fila (admin dashboard) ─────────────────────────── */
.evento-fila {
  background: var(--bg2);
  border-radius: var(--radius);
  padding: .85rem .9rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: .6rem;
  border-left: 4px solid transparent;
  min-width: 0;
  width: 100%;
}
.evento-fila.evento-activo  { border-left-color: var(--verde); }
.evento-fila.evento-cerrado { border-left-color: var(--border); }
.evento-info { flex: 1; min-width: 0; }
.evento-nombre {
  font-size: .92rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.evento-meta { font-size: .78rem; color: var(--text2); margin-top: .15rem; }
.evento-stats {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .3rem;
  flex-wrap: wrap;
}
.evento-stat-txt { font-size: .75rem; color: var(--text3); }
.evento-acciones {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  flex-shrink: 0;
}

/* ── Cobro: header ──────────────────────────────────────────── */
.cobro-header {
  background: #fff;
  padding: .85rem 1rem;
  display: flex;
  align-items: center;
  gap: .7rem;
  min-width: 0;
  border-bottom: 3px solid var(--rojo);
  box-shadow: 0 2px 12px rgba(39,35,34,.06);
}
.cobro-header-info { flex: 1; min-width: 0; }
.cobro-header-cobrador {
  font-size: .78rem;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cobro-header-partido {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cobro-header-precio {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--rojo);
  background: var(--rojo-soft);
  border: 1.5px solid rgba(183,55,47,.22);
  padding: .35rem .7rem;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

/* ── Cobro: barra de stats ──────────────────────────────────── */
.cobro-stats-bar {
  background: #fff;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  padding: .55rem .35rem .6rem;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(39,35,34,.05);
  width: 100%;
}
.cobro-stat {
  text-align: center;
  padding: .15rem .1rem;
  min-width: 0;
}
.cobro-stat-num {
  font-size: clamp(.84rem, 3.7vw, 1.02rem);
  font-weight: 900;
  color: var(--text);
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cobro-stat-lbl {
  font-size: clamp(.52rem, 2.35vw, .62rem);
  color: var(--text3);
  margin-top: .18rem;
  font-weight: 700;
}

/* ── Cobro: alias banner ────────────────────────────────────── */
.alias-banner {
  background: #ecfdf5;
  border: 2px solid #22c55e;
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  box-shadow: 0 8px 24px rgba(22,163,74,.16);
}
.alias-banner-label {
  font-size: .82rem;
  font-weight: 900;
  color: var(--verde2);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.alias-banner-valor {
  font-size: clamp(1.45rem, 8vw, 2.15rem);
  font-weight: 900;
  color: var(--verde2);
  margin-top: .2rem;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

/* ── Cobro: input ticket ────────────────────────────────────── */
.ticket-input-wrap label {
  display: block;
  font-size: .82rem;
  font-weight: 700;
  color: var(--text2);
  margin-bottom: .35rem;
}
.ticket-input {
  width: 100%;
  padding: .85rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1.5rem;
  font-weight: 900;
  text-align: center;
  letter-spacing: .1em;
  background: var(--bg2);
  -webkit-appearance: none;
}
.ticket-input:focus {
  outline: none;
  border-color: var(--negro);
}

/* ── Cobro: botones de método ───────────────────────────────── */
.cobro-metodos {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.btn-metodo {
  width: 100%;
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: .85rem 1.1rem;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--bg2);
  text-align: left;
  transition: border-color .15s, transform .1s;
  box-shadow: var(--shadow);
}
.btn-metodo:active { transform: scale(.98); }
.btn-metodo-icon { font-size: 1.5rem; flex-shrink: 0; }
.btn-metodo-texto { flex: 1; }
.btn-metodo-titulo { display: block; font-size: .95rem; font-weight: 800; }
.btn-metodo-sub    { display: block; font-size: .75rem; color: var(--text3); margin-top: .1rem; }
.btn-metodo.seleccionado {
  border-color: var(--negro);
  box-shadow: 0 6px 18px rgba(0,0,0,.14);
}

.btn-metodo-ef    { border-color: #fde68a; }
.btn-metodo-ef:hover { border-color: var(--amber); }
.btn-metodo-tr    { border-color: #bfdbfe; }
.btn-metodo-tr:hover { border-color: var(--azul); }
.btn-metodo-tr.seleccionado {
  border-color: var(--verde);
  background: #f0fdf4;
}
.btn-metodo-tr.seleccionado .btn-metodo-titulo,
.btn-metodo-tr.seleccionado .btn-metodo-sub {
  color: var(--verde2);
}
.btn-metodo-libre { border-color: #e9d5ff; }
.btn-metodo-libre:hover { border-color: #7c3aed; }

/* ── Cobro: acciones de turno ──────────────────────────────── */
.cobro-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: .65rem;
}
.btn-cobro-secundario,
.btn-terminar-cobranza {
  width: 100%;
  min-height: 3.25rem;
  padding: .85rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 900;
  transition: transform .1s, filter .15s, border-color .15s;
}
.btn-cobro-secundario:active,
.btn-terminar-cobranza:active { transform: scale(.98); }
.btn-cobro-secundario {
  background: #fff;
  border: 2px solid #fca5a5;
  color: var(--rojo);
  font-size: .9rem;
}
.btn-terminar-cobranza {
  background: var(--negro);
  border: 2px solid var(--negro);
  color: #fff;
  font-size: 1rem;
  box-shadow: 0 8px 22px rgba(0,0,0,.18);
}
.btn-cobro-secundario:hover,
.btn-terminar-cobranza:hover { filter: brightness(1.06); }

/* ── Cierre cobrador ────────────────────────────────────────── */
.cierre-fila {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .75rem 0;
  border-bottom: 1px solid var(--border);
}
.cierre-fila:last-child { border-bottom: none; }
.cierre-fila-titulo { font-size: .9rem; font-weight: 700; }
.cierre-fila-sub    { font-size: .75rem; color: var(--text3); margin-top: .1rem; }
.cierre-fila-monto  { font-size: 1rem; font-weight: 900; }

/* ── Copiar box ─────────────────────────────────────────────── */
.copiar-box textarea {
  width: 100%;
  padding: .75rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .8rem;
  line-height: 1.5;
  resize: none;
  background: #fafafa;
  color: var(--text);
  margin-bottom: .6rem;
  font-family: 'Courier New', monospace;
}

/* ── Volver btn ─────────────────────────────────────────────── */
.btn-volver {
  font-size: .82rem;
  font-weight: 700;
  color: var(--text2);
  padding: .3rem 0;
  margin-bottom: .5rem;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}
.btn-volver:hover { color: var(--negro); }
.login-volver-wrap {
  margin-top: 1rem;
}
.btn-volver-cobrador {
  width: 100%;
  min-height: 3rem;
  justify-content: center;
  margin: 0;
  padding: .78rem 1rem;
  border: 2px solid var(--negro);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--negro);
  text-decoration: none;
  font-size: .95rem;
  box-shadow: 0 3px 12px rgba(0,0,0,.08);
}
.btn-volver-cobrador:hover {
  background: var(--negro);
  color: #fff;
}

/* ── Empty state ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text3);
}
.empty-icon  { font-size: 2.5rem; margin-bottom: .75rem; }
.empty-title { font-size: 1rem; font-weight: 700; color: var(--text2); margin-bottom: .3rem; }
.empty-text  { font-size: .85rem; }

/* ── Sección titulo ─────────────────────────────────────────── */
.sec-title {
  font-size: .78rem;
  font-weight: 800;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .6rem;
}

/* ── Tabla ──────────────────────────────────────────────────── */
.tabla-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); }
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg2);
  font-size: .82rem;
}
thead th {
  background: #f4f4f4;
  color: var(--text2);
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .65rem .75rem;
  text-align: left;
  white-space: nowrap;
}
tbody td {
  padding: .6rem .75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr.fila-eliminada td { opacity: .4; text-decoration: line-through; }
.td-sub { display: block; font-size: .7rem; color: var(--text3); }

/* ── Tabs ───────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: .1rem;
  background: var(--border);
  border-radius: 10px;
  padding: .2rem;
}
.tab {
  flex: 1;
  padding: .5rem .6rem;
  border-radius: 8px;
  font-size: .8rem;
  font-weight: 700;
  color: var(--text2);
  text-align: center;
  transition: background .15s, color .15s;
}
.tab.active {
  background: var(--bg2);
  color: var(--rojo);
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}

/* ── Login screen admin ─────────────────────────────────────── */
.admin-page .rojo-stripe {
  background: var(--rojo);
  height: 5px;
}

/* ── Topbar admin ───────────────────────────────────────────── */
.topbar {
  background: var(--rojo);
  border-bottom: none;
  padding: .7rem 1.1rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.topbar-titulo { font-size: .95rem; font-weight: 800; flex: 1; color: #fff; }
.topbar-user   { font-size: .78rem; color: rgba(255,255,255,.75); }

/* ── Screens (admin) ────────────────────────────────────────── */
.screen { display: none; }
.screen.active { display: block; }

/* ── Nav admin (bottom) ─────────────────────────────────────── */
.admin-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg2);
  border-top: 3px solid var(--rojo);
  display: flex;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 20px rgba(0,0,0,.14);
}
.admin-page #toast-container {
  bottom: 5.5rem; /* encima del nav fijo */
}
.admin-nav-btn {
  flex: 1;
  min-width: 0;
  min-height: 4.5rem;
  padding: .7rem .25rem .55rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .22rem;
  font-size: clamp(.62rem, 2.7vw, .74rem);
  font-weight: 700;
  color: var(--text3);
  transition: color .15s, background .15s;
  line-height: 1.15;
  text-align: center;
}
.admin-nav-btn.active {
  color: var(--rojo);
  background: #fff0ef;
}
.admin-nav-btn:active { background: #e8e8e8; }
.admin-nav-icon { font-size: clamp(1.15rem, 5vw, 1.45rem); line-height: 1; }

/* ── Método seleccionado ────────────────────────────────────── */
.btn-metodo.seleccionado {
  border-width: 2.5px;
}
.btn-metodo-ef.seleccionado   { border-color: var(--amber); background: #fffbeb; }
.btn-metodo-tr.seleccionado   { border-color: var(--azul);  background: #eff6ff; }

/* ── Cobrador activo (sin cerrar turno) ─────────────────────── */
.cobrador-activo td {
  background: #fff5f5;
  border-top: 1px solid #fecaca;
  border-bottom: 1px solid #fecaca;
}
.cobrador-activo td:first-child {
  border-left: 4px solid var(--rojo);
}
.text-rojo { color: var(--rojo); }

/* ── Auditoría: fila de evento ──────────────────────────────── */
.audit-evento-row {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .75rem 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.audit-evento-row:last-child { border-bottom: none; }
.audit-evento-row.audit-sel { background: #f0f9ff; border-radius: var(--radius-sm); padding-left: .5rem; }

/* ── Modal pase libre ───────────────────────────────────────── */
#modal-libre.overlay .overlay-box {
  max-height: 90vh;
  overflow-y: auto;
}

/* ── Padding inferior (por nav fija) ────────────────────────── */
.pb-nav { padding-bottom: 5rem; }

/* ── Grid utilitario ────────────────────────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}
@media (max-width: 500px) {
  .grid-2 { grid-template-columns: 1fr; }
}

/* ── Fixes responsive generales ─────────────────────────────── */
.res-cards { min-width: 0; }
.res-card  { min-width: 0; word-break: break-word; }
.form-card { min-width: 0; }
.campo input, .campo select { width: 100%; }
.btn-full  { width: 100%; min-width: 0; }
.overlay-box { min-width: 0; }
.tabs { min-width: 0; }
.tab  { min-width: 0; font-size: clamp(.7rem, 3vw, .8rem); }

/* ── Texto util ─────────────────────────────────────────────── */
.text-muted  { color: var(--text3); }
.text-verde  { color: var(--verde); }
.text-rojo   { color: var(--rojo); }
.fw-900      { font-weight: 900; }
.fs-sm       { font-size: .82rem; }
.mt-1        { margin-top: .5rem; }
.mt-2        { margin-top: 1rem; }
.mt-3        { margin-top: 1.5rem; }

/* ── Gap util para flex/grid ────────────────────────────────── */
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.flex  { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ── Cobrador responsive ───────────────────────────────────── */
.app-page {
  --app-pad: clamp(1rem, 3vw, 2rem);
  --app-content: 1040px;
}
.app-page #app {
  width: 100%;
  min-height: 100vh;
}
.app-page .app-main {
  width: min(100%, var(--app-content));
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 420px) {
  .app-page .cobro-header {
    padding: .65rem .8rem;
  }
  .app-page .cobro-header-precio {
    font-size: .9rem;
  }
  .app-page .cobro-stats-bar {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding-left: .25rem;
    padding-right: .25rem;
  }
  .app-page .cobro-actions {
    grid-template-columns: 1fr !important;
  }
}

@media (min-width: 700px) {
  .app-page .app-header,
  .app-page .cobro-header {
    padding-left: var(--app-pad);
    padding-right: var(--app-pad);
  }
  .app-page .app-main {
    padding-left: var(--app-pad) !important;
    padding-right: var(--app-pad) !important;
  }
  .app-page .app-main-home {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }
  .app-page .app-main-home .sec-title,
  .app-page .app-main-home > div:last-child,
  .app-page .app-main-home .empty-state {
    grid-column: 1 / -1;
  }
  .app-page .app-main-form {
    max-width: 560px;
  }
  .app-page .app-main-cobro {
    display: grid !important;
    grid-template-columns: minmax(280px, .85fr) minmax(320px, 1.15fr);
    gap: 1rem !important;
    align-items: start;
  }
  .app-page .app-main-cobro #cobro-alerta,
  .app-page .app-main-cobro .ticket-input-wrap,
  .app-page .app-main-cobro #alias-banner,
  .app-page .app-main-cobro #btn-registrar,
  .app-page .app-main-cobro .cobro-actions {
    grid-column: 1;
  }
  .app-page .app-main-cobro .cobro-metodos-panel {
    grid-column: 2;
    grid-row: 1 / span 5;
  }
  .app-page .cobro-metodos {
    gap: .8rem;
  }
  .app-page .btn-metodo {
    min-height: 5.6rem;
  }
  .app-page .cobro-stats-bar {
    grid-template-columns: repeat(5, minmax(0, 10rem));
    justify-content: center;
    gap: .4rem;
    padding: .55rem var(--app-pad);
  }
  .app-page .app-main-cierre {
    max-width: 720px;
  }
}

@media (min-width: 1024px) {
  .app-page .app-main-home {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .app-page .evento-card {
    height: 100%;
  }
}

/* ── Admin responsive ──────────────────────────────────────── */
.admin-page {
  --admin-pad: clamp(1rem, 3vw, 2rem);
  --admin-content: 1180px;
}
.admin-page .topbar {
  padding-left: var(--admin-pad);
  padding-right: var(--admin-pad);
}
#admin-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
}
.admin-header-simple {
  background: #fff;
  border-bottom: 2px solid var(--border);
  padding: .65rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .9rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
}
.admin-header-nombre {
  flex: 1;
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
}
.admin-page #btn-logout {
  min-width: 96px;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}
.admin-page .topbar-titulo,
.admin-page .topbar-user {
  min-width: 0;
}
.admin-page .screen.active {
  display: block;
  width: 100%;
}
.centro-bloque {
  display: block;
  width: 100%;
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}
.admin-page .screen.active > div:not(.admin-nav):not(.detalle-band):not(.banner-wrap):not(.detalle-back-bar) {
  width: 100% !important;
  max-width: 1180px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box;
}
.admin-page .screen.active > .banner-wrap {
  width: 100%;
  max-width: none !important;
  margin: 0 !important;
}
/* barra de volver: full-width */
.admin-page .detalle-back-bar {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: .65rem 1.1rem;
  background: var(--bg2);
  border-bottom: 2px solid var(--border);
  box-sizing: border-box;
}
#detalle-acciones {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  padding: .25rem 0;
}
#detalle-acciones .btn {
  flex: 1;
  min-width: 140px;
}
.clave-box {
  background: #fff;
  border: 2px solid var(--negro);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  text-align: center;
}
.clave-label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text2);
  margin-bottom: .5rem;
}
.clave-valor {
  font-size: 2.4rem;
  font-weight: 900;
  letter-spacing: .18em;
  color: var(--negro);
  line-height: 1;
  margin-bottom: .4rem;
}
.clave-hint {
  font-size: .72rem;
  color: var(--text3);
}
/* header del detalle: full-width */
.admin-page .detalle-band {
  background: #fff;
  border-bottom: 3px solid var(--rojo);
  padding: .85rem 1.1rem;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  box-sizing: border-box;
}
.admin-page .detalle-band-inner {
  max-width: var(--admin-content);
  margin-left: auto;
  margin-right: auto;
}
.admin-page #detalle-titulo {
  color: var(--text) !important;
}
.admin-page #detalle-meta {
  color: var(--text2) !important;
}
.admin-page #screen-login > div {
  width: 100%;
  max-width: none;
}
.admin-page #screen-login > div:last-child {
  max-width: 440px;
}
.admin-page .evento-fila,
.admin-page .card,
.admin-page .form-card,
.admin-page .res-card {
  border-radius: 10px;
}

@media (max-width: 420px) {
  .admin-page .topbar {
    gap: .5rem;
    padding: .55rem .75rem;
  }
  .admin-page .topbar-titulo {
    font-size: .86rem;
  }
  .admin-page .topbar-user {
    display: none;
  }
  .admin-page #btn-logout {
    margin-left: 0 !important;
    min-width: 90px;
    padding-inline: 1rem;
  }
  .admin-page .evento-fila {
    align-items: stretch;
    flex-direction: column;
  }
  .admin-page .evento-nombre {
    white-space: normal;
  }
  .admin-page .evento-acciones {
    flex-direction: row;
  }
  .admin-page .evento-acciones .btn {
    flex: 1;
  }
  .admin-page .res-cards {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 700px) {
  /* desktop: banner sticky, toast vuelve a posición normal */
  #admin-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
  }
  .admin-page #toast-container {
    bottom: 1.5rem;
  }
  .admin-page .detalle-band {
    padding-left: var(--admin-pad);
    padding-right: var(--admin-pad);
  }
  .admin-page .pb-nav {
    padding-top: 0;
    padding-bottom: 2rem;
  }
  .admin-page #screen-detalle.pb-nav {
    padding-top: 0;
  }
  .admin-page .admin-nav {
    position: static;
    border-top: 0;
    border-bottom: 1px solid var(--border);
    justify-content: center;
    gap: .35rem;
    padding: .45rem var(--admin-pad);
    box-shadow: 0 4px 16px rgba(0,0,0,.05);
  }
  .admin-page .admin-nav-btn {
    flex: 0 1 auto;
    min-height: 0;
    min-width: 8.5rem;
    max-width: 11rem;
    padding: .65rem .9rem;
    border-radius: var(--radius-sm);
    flex-direction: row;
    font-size: .86rem;
    gap: .45rem;
  }
  .admin-page .admin-nav-btn.active {
    background: var(--rojo);
    color: #fff;
  }
  .admin-page .admin-nav-icon {
    font-size: 1.05rem;
  }
  .admin-page .res-cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .admin-page .res-card-destac {
    grid-column: span 2;
  }
  .admin-page .evento-fila {
    padding: 1rem 1.1rem;
  }
  .admin-page .evento-acciones {
    flex-direction: row;
  }
  .admin-page .form-card {
    max-width: 760px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
  }
  .admin-page #screen-crear .centro-bloque > div {
    width: 100%;
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
  }
  .admin-page #screen-dashboard > div:not(.admin-nav),
  .admin-page #screen-stats > div:not(.admin-nav),
  .admin-page #screen-auditoria > div:not(.admin-nav),
  .admin-page #screen-detalle > div:not(.admin-nav) {
    padding-left: var(--admin-pad) !important;
    padding-right: var(--admin-pad) !important;
  }
}

@media (min-width: 1024px) {
  .admin-page .res-cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .admin-page .res-card-destac {
    grid-column: span 1;
  }
  .admin-page #lista-activos,
  .admin-page #lista-cerrados {
    display: grid !important;
    grid-template-columns: minmax(0, 620px);
    justify-content: center;
    align-items: stretch;
  }
  .admin-page .evento-fila {
    height: 100%;
  }
  .admin-page .tabla-wrap {
    overflow-x: auto;
  }
  .admin-page table {
    min-width: 720px;
  }
}
