/* ═══════════════════════════════════════════════════════════════════════════
   gestion/styles.css — App de Gestión iaCity
   Sistema visual: cabecera doble (marca del ayto + barra de sección con color),
   color propio por módulo y por bandeja, tarjetas con acento y targets ≥44px.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* Marca del municipio (la fija el backend por login) */
  --color-muni: #1565c0;
  --color-muni-oscuro: #0d47a1;
  /* Color de la sección activa (lo fija el JS al entrar en cada pantalla) */
  --c-sec: #1565c0;
  --c-sec-suave: #e8f0fb;

  --fondo: #eef1f5;
  --panel: #ffffff;
  --borde: #e2e7ee;
  --borde-fuerte: #cfd6e0;
  --texto: #16202b;
  --texto-suave: #64748b;
  --texto-tenue: #94a3b8;
  --ok: #1b8a3f;
  --mal: #c62828;
  --aviso: #e0a800;

  --radio: 16px;
  --radio-sm: 11px;
  --sombra: 0 1px 2px rgba(16, 32, 43, .05), 0 4px 14px rgba(16, 32, 43, .06);
  --sombra-alta: 0 8px 28px rgba(16, 32, 43, .14);
}

/* Colores por módulo / bandeja — el hilo conductor de todo el diseño */
.c-qr           { --c-sec: #0d47a1; --c-sec-suave: #e6edf9; }
.c-campo        { --c-sec: #0097a7; --c-sec-suave: #e0f4f7; }
.c-incidencias  { --c-sec: #e65100; --c-sec-suave: #fdeee3; }
.c-tareas       { --c-sec: #6a1b9a; --c-sec-suave: #f2e8f8; }
.c-mensajes     { --c-sec: #00838f; --c-sec-suave: #e0f2f4; }
.c-aclaraciones { --c-sec: #ad1457; --c-sec-suave: #fbe7ef; }
.c-reservas     { --c-sec: #2e7d32; --c-sec-suave: #e7f4e8; }
.c-citas        { --c-sec: #5e35b1; --c-sec-suave: #eee9f8; }
.c-colonias     { --c-sec: #c2185b; --c-sec-suave: #fce8ef; }
.c-muni         { --c-sec: var(--color-muni); --c-sec-suave: #eef2f8; }

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--fondo);
  color: var(--texto);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
}
.vista { min-height: 100dvh; display: flex; flex-direction: column; }
.oculta { display: none !important; }

/* ═══ CABECERA 1: marca — solo el escudo del ayto, centrado sobre blanco ═══ */
.marca-bar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center;
  padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top));
  background: #fff; border-bottom: 1px solid var(--borde);
}
.marca-escudo { height: 54px; max-width: 74%; object-fit: contain; }

/* ═══ CABECERA 2: barra de sección (dónde estoy) ═══ */
.sec-bar {
  position: sticky; z-index: 30; top: 0;
  display: flex; align-items: center; gap: 8px;
  padding: 11px 10px;
  background: var(--c-sec); color: #fff;
  box-shadow: 0 2px 10px rgba(16, 32, 43, .12);
}
.sec-bar .sec-titulo {
  flex: 1; min-width: 0; font-size: 17px; font-weight: 700; letter-spacing: -.2px;
  display: flex; align-items: center; gap: 9px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sec-bar .sec-titulo i { font-size: 16px; opacity: .95; }
.sec-bar .btn-icono { color: #fff; }
.sec-acciones { display: flex; gap: 2px; }

.btn-icono {
  background: none; border: 0; font-size: 19px; color: var(--texto);
  cursor: pointer; padding: 9px; min-width: 44px; min-height: 44px;
  border-radius: 12px; transition: background .15s;
}
.btn-icono:active { background: rgba(255, 255, 255, .18); }

/* ═══ LOGIN y cajas centradas ═══ */
#v-login, #v-muni, #v-2fa, #v-sa {
  align-items: center; justify-content: center; padding: 22px;
  background: linear-gradient(160deg, #f7f9fc 0%, #e7edf5 100%);
}
.login-caja {
  width: 100%; max-width: 400px; background: var(--panel); border-radius: 22px;
  padding: 32px 26px; box-shadow: var(--sombra-alta); text-align: center;
}
.login-escudo {
  width: 82px; height: 82px; object-fit: contain; margin-bottom: 14px;
  border-radius: 18px; padding: 6px; background: #fff;
  box-shadow: 0 3px 14px rgba(16, 32, 43, .12);
}
.login-caja h1 { font-size: 23px; font-weight: 700; letter-spacing: -.4px; margin-bottom: 5px; }
.login-sub { color: var(--texto-suave); font-size: 14px; margin-bottom: 22px; line-height: 1.5; }
.login-caja label { display: block; text-align: left; font-size: 12.5px; font-weight: 600; color: var(--texto-suave); margin-bottom: 15px; text-transform: uppercase; letter-spacing: .3px; }
.login-caja input {
  width: 100%; margin-top: 6px; padding: 14px 13px; font-size: 16px; font-weight: 500;
  border: 1.5px solid var(--borde); border-radius: 13px; background: #f9fbfd; color: var(--texto);
  transition: border-color .15s, background .15s;
}
.login-caja input:focus { outline: 0; border-color: var(--color-muni); background: #fff; }
.in-codigo { text-align: center; font-size: 30px !important; font-weight: 700 !important; letter-spacing: 12px; margin-bottom: 18px; }
#inBuscaMuni { width: 100%; padding: 13px; font-size: 16px; border: 1.5px solid var(--borde); border-radius: 13px; margin-bottom: 14px; }

/* ═══ BOTONES ═══ */
.btn-primario, .btn-secundario, .btn-peligro {
  width: 100%; border-radius: 13px; cursor: pointer; font-weight: 700; font-size: 15.5px;
  min-height: 50px; padding: 14px; transition: transform .08s, box-shadow .15s, opacity .15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primario { color: #fff; background: var(--c-sec); border: 0; box-shadow: 0 3px 12px color-mix(in srgb, var(--c-sec) 32%, transparent); }
.btn-secundario { color: var(--c-sec); background: var(--c-sec-suave); border: 1.5px solid color-mix(in srgb, var(--c-sec) 26%, transparent); }
.btn-peligro { color: var(--mal); background: #fdecec; border: 1.5px solid #f6c9c9; }
.btn-primario:active, .btn-secundario:active, .btn-peligro:active { transform: scale(.975); }
.btn-primario:disabled { opacity: .55; }
.btn-compacto { width: auto; padding: 10px 15px; min-height: 42px; font-size: 14px; text-decoration: none; }
.btn-enlace { background: none; border: 0; color: var(--texto-suave); font-size: 14px; margin-top: 16px; cursor: pointer; text-decoration: underline; }
.btn-enlace-claro { background: none; border: 0; color: #fff; font-size: 13px; cursor: pointer; text-decoration: underline; margin-left: auto; }
.error { color: var(--mal); font-size: 14px; min-height: 18px; margin-top: 10px; font-weight: 600; }

.lista-munis { display: flex; flex-direction: column; gap: 9px; max-height: 52dvh; overflow-y: auto; }
.item-muni {
  padding: 15px; font-size: 16px; font-weight: 600; text-align: left; background: #f9fbfd;
  border: 1.5px solid var(--borde); border-radius: 13px; cursor: pointer; min-height: 52px; color: var(--texto);
}
.item-muni:active { background: var(--c-sec-suave); border-color: var(--color-muni); }

/* ═══ DASHBOARD ═══ */
.banner-sa {
  display: flex; align-items: center; gap: 9px; padding: 9px 16px;
  background: #1a1f4e; color: #fff; font-size: 13px; font-weight: 600;
}
.dash-saludo { padding: 20px 18px 4px; max-width: 780px; margin: 0 auto; width: 100%; }
.dash-saludo h2 { font-size: 21px; font-weight: 700; letter-spacing: -.4px; }
.dash-saludo p { font-size: 13.5px; color: var(--texto-suave); margin-top: 3px; }
.grid-tiles {
  flex: 1; display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px;
  padding: 16px 16px 26px; align-content: start; max-width: 780px; margin: 0 auto; width: 100%;
}
@media (min-width: 620px) { .grid-tiles { grid-template-columns: repeat(3, 1fr); } }
/* Botón principal de módulo: bloque de color pleno, icono en vidrio y flecha.
   Legible de un vistazo y con el color del módulo como identidad. */
.tile {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 16px;
  min-height: 142px; padding: 16px; border: 0; border-radius: 20px; cursor: pointer; text-align: left;
  color: #fff; background: linear-gradient(145deg, var(--c-sec) 0%, color-mix(in srgb, var(--c-sec) 74%, #000) 100%);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--c-sec) 34%, transparent);
  transition: transform .11s, box-shadow .2s, filter .15s;
}
/* Brillo decorativo (da profundidad sin cargar el diseño) */
.tile::before {
  content: ''; position: absolute; z-index: -1; width: 148px; height: 148px; right: -54px; top: -60px;
  border-radius: 50%; background: rgba(255, 255, 255, .16);
}
.tile::after {
  content: '\f054'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
  position: absolute; right: 16px; bottom: 17px; font-size: 13px; opacity: .55;
}
.tile:active { transform: scale(.96) translateY(1px); filter: brightness(1.06); }
.tile-icono {
  width: 52px; height: 52px; border-radius: 16px; display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .22); color: #fff; font-size: 24px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28);
}
.tile span { font-size: 15.5px; font-weight: 800; color: #fff; line-height: 1.25; letter-spacing: -.2px; padding-right: 18px; }
.tile-badge {
  position: absolute; top: 13px; right: 13px; background: #fff; color: var(--c-sec);
  border-radius: 12px; font-size: 12px; font-weight: 800; padding: 3px 9px; min-width: 24px; text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .22);
}
/* Variante neutra (Ajustes) para no competir con los módulos */
.tile.tile-neutro {
  background: var(--panel); color: var(--texto); box-shadow: var(--sombra);
  border: 1.5px solid var(--borde);
}
.tile.tile-neutro .tile-icono { background: #eef2f7; color: var(--texto-suave); box-shadow: none; }
.tile.tile-neutro span { color: var(--texto); }
.tile.tile-neutro::before { display: none; }
.tile.tile-neutro::after { color: var(--texto-tenue); }
.sin-modulos { grid-column: 1 / -1; text-align: center; color: var(--texto-suave); padding: 46px 20px; line-height: 1.7; }
.dash-pie { text-align: center; color: var(--texto-tenue); font-size: 11.5px; padding: 10px 12px 20px; }

/* ═══ PESTAÑAS de bandeja (cada una con SU color) ═══ */
.siu-tabs { display: flex; gap: 7px; padding: 12px 12px 2px; overflow-x: auto; scrollbar-width: none; }
.siu-tabs::-webkit-scrollbar { display: none; }
.siu-tab {
  position: relative; flex: 1; min-width: 84px; padding: 11px 8px; font-size: 13px; font-weight: 700;
  border-radius: 13px; border: 1.5px solid var(--borde); background: var(--panel); color: var(--texto-suave);
  cursor: pointer; min-height: 46px; white-space: nowrap; transition: all .15s;
}
.siu-tab.activa { border-color: transparent; color: #fff; background: var(--c-tab, var(--c-sec)); box-shadow: 0 3px 10px color-mix(in srgb, var(--c-tab, var(--c-sec)) 34%, transparent); }
.siu-badge {
  position: absolute; top: -7px; right: -5px; background: var(--mal); color: #fff;
  border-radius: 11px; font-size: 11px; font-weight: 800; padding: 2px 7px; min-width: 20px;
  box-shadow: 0 2px 6px rgba(198, 40, 40, .4);
}
.campo-tabs { display: flex; gap: 7px; padding: 12px 14px 2px; }
.campo-tab {
  flex: 1; padding: 12px; font-size: 15px; font-weight: 700; border-radius: 13px;
  border: 1.5px solid var(--borde); background: var(--panel); color: var(--texto-suave); cursor: pointer; min-height: 48px;
}
.campo-tab.activa { border-color: transparent; background: var(--c-sec); color: #fff; box-shadow: 0 3px 10px color-mix(in srgb, var(--c-sec) 34%, transparent); }

/* ═══ FILTROS como botones de color ═══ */
.filtros-fila { display: flex; gap: 7px; padding: 10px 12px 2px; overflow-x: auto; scrollbar-width: none; }
.filtros-fila::-webkit-scrollbar { display: none; }
.filtro-btn {
  padding: 9px 14px; font-size: 13px; font-weight: 700; border-radius: 22px; cursor: pointer;
  border: 1.5px solid var(--borde); background: var(--panel); color: var(--texto-suave);
  white-space: nowrap; min-height: 40px; transition: all .15s;
}
.filtro-btn.on {
  color: #fff; border-color: transparent;
  background: var(--f-color, var(--c-sec));
  box-shadow: 0 3px 10px color-mix(in srgb, var(--f-color, var(--c-sec)) 36%, transparent);
}
.busca-fila { display: flex; gap: 8px; padding: 10px 12px 0; }
.busca-fila input[type=search] {
  flex: 1; padding: 12px 14px; font-size: 15px; border: 1.5px solid var(--borde);
  border-radius: 24px; background: var(--panel); min-width: 0;
}
.busca-fila input[type=search]:focus { outline: 0; border-color: var(--c-sec); }
.busca-fila select, .siu-filtros select {
  padding: 11px 10px; font-size: 14px; font-weight: 600; border: 1.5px solid var(--borde);
  border-radius: 13px; background: var(--panel); color: var(--texto);
}
.siu-filtros { display: flex; gap: 8px; padding: 10px 12px 0; align-items: center; }
.siu-filtros input[type=search] { flex: 1; padding: 12px 14px; font-size: 15px; border: 1.5px solid var(--borde); border-radius: 24px; min-width: 0; }
.chip-filtro {
  padding: 10px 14px; font-size: 13px; font-weight: 700; border-radius: 22px; cursor: pointer;
  border: 1.5px solid var(--borde); background: var(--panel); color: var(--texto-suave); white-space: nowrap; min-height: 42px;
}
.chip-filtro.activo, .chip-filtro.on { border-color: transparent; color: #fff; background: var(--c-sec); }

/* ═══ LISTAS y TARJETAS ═══ */
.siu-lista, .campo-lista, .res-slots {
  padding: 13px 13px 96px; display: flex; flex-direction: column; gap: 11px;
  max-width: 680px; margin: 0 auto; width: 100%;
}
.siu-card {
  position: relative; text-align: left; width: 100%; background: var(--panel);
  border: 0; border-radius: var(--radio); padding: 14px 16px; cursor: pointer;
  box-shadow: var(--sombra); transition: transform .09s;
  border-left: 4px solid transparent;
}
.siu-card:active { transform: scale(.985); }
.siu-card.no-vista { border-left-color: var(--c-sec); background: linear-gradient(90deg, var(--c-sec-suave) 0%, var(--panel) 60%); }
.siu-card-linea1 { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 6px; }
.siu-num { font-weight: 800; font-size: 14.5px; color: var(--c-sec); letter-spacing: -.2px; }
.chip-estado { font-size: 11px; font-weight: 800; padding: 4px 10px; border-radius: 20px; color: #fff; letter-spacing: .2px; }
.chip-cat { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 20px; background: #eef2f7; color: #4b5b6b; }
.chip-urgente { font-size: 11px; font-weight: 800; padding: 4px 10px; border-radius: 20px; background: #fdecec; color: var(--mal); letter-spacing: .2px; }
.siu-card-texto { font-size: 14.5px; color: var(--texto); font-weight: 400; line-height: 1.5; }
.siu-card-texto strong { display: block; font-weight: 700; margin-bottom: 2px; }
.siu-card.no-vista .siu-card-texto { font-weight: 500; }
.siu-card-pie { font-size: 12px; color: var(--texto-suave); margin-top: 7px; font-weight: 500; }
.campo-vacio { text-align: center; color: var(--texto-suave); padding: 50px 24px; line-height: 1.7; font-size: 14.5px; }

/* ═══ FAB ═══ */
.fab {
  position: fixed; right: 18px; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 35;
  width: 60px; height: 60px; border-radius: 50%; border: 0; color: #fff; font-size: 23px; cursor: pointer;
  background: var(--c-sec); box-shadow: 0 6px 20px color-mix(in srgb, var(--c-sec) 46%, transparent);
  transition: transform .1s;
}
.fab:active { transform: scale(.92); }

/* ═══ DETALLE (bloques) ═══ */
.siu-det, .campo-edit {
  padding: 14px 13px 30px; display: flex; flex-direction: column; gap: 13px;
  max-width: 680px; margin: 0 auto; width: 100%;
}
.siu-bloque { background: var(--panel); border: 0; border-radius: var(--radio); padding: 16px; box-shadow: var(--sombra); }
.siu-bloque h3 {
  font-size: 12.5px; color: var(--c-sec); font-weight: 800; margin-bottom: 12px;
  text-transform: uppercase; letter-spacing: .6px;
}
.siu-bloque textarea, .siu-bloque input[type=text], .siu-bloque input[type=date],
.siu-bloque input[type=time], .siu-bloque select, .siu-bloque input[type=file] {
  width: 100%; padding: 13px; font-size: 15.5px; border: 1.5px solid var(--borde);
  border-radius: var(--radio-sm); margin-bottom: 9px; background: #f9fbfd; color: var(--texto); font-family: inherit;
}
.siu-bloque textarea:focus, .siu-bloque input:focus, .siu-bloque select:focus { outline: 0; border-color: var(--c-sec); background: #fff; }
.siu-desc { font-size: 15.5px; line-height: 1.6; white-space: pre-wrap; }
.siu-foto { width: 100%; border-radius: var(--radio-sm); margin-top: 10px; box-shadow: var(--sombra); }
.estado-botones { display: flex; gap: 7px; flex-wrap: wrap; }
.estado-btn {
  flex: 1; min-width: 46%; min-height: 50px; border-radius: var(--radio-sm); border: 2px solid var(--borde);
  background: var(--panel); font-size: 14.5px; font-weight: 700; cursor: pointer; color: var(--texto); transition: all .12s;
}
.estado-btn.sel { color: #fff; border-color: transparent; box-shadow: 0 3px 10px rgba(16, 32, 43, .16); }
.timeline { display: flex; flex-direction: column; gap: 12px; }
.timeline-item { border-left: 3px solid var(--c-sec-suave); padding-left: 12px; font-size: 13.5px; line-height: 1.5; }
.timeline-item .tl-fecha { color: var(--texto-tenue); font-size: 12px; margin-top: 2px; }
.dest-lista { display: flex; flex-direction: column; gap: 3px; max-height: 190px; overflow-y: auto; margin-bottom: 10px; }
.dest-item { display: flex; align-items: center; gap: 10px; font-size: 14.5px; padding: 9px 6px; border-radius: 9px; }
.dest-item:active { background: var(--c-sec-suave); }
.dest-item input { width: 20px; height: 20px; accent-color: var(--c-sec); }
.check-linea { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; padding: 4px 0; }
.check-linea input { width: 21px; height: 21px; accent-color: var(--c-sec); }
.tarea-mini {
  display: flex; align-items: center; gap: 9px; padding: 11px 0; font-size: 13.5px;
  border-bottom: 1px solid var(--fondo); cursor: pointer;
}
.tarea-mini:last-child { border-bottom: 0; }

/* ═══ FORMULARIOS ═══ */
.siu-form { padding: 16px 14px 30px; display: flex; flex-direction: column; gap: 15px; max-width: 600px; margin: 0 auto; width: 100%; }
.siu-form label { font-size: 12.5px; font-weight: 700; color: var(--texto-suave); display: flex; flex-direction: column; gap: 7px; text-transform: uppercase; letter-spacing: .3px; }
.siu-form select, .siu-form textarea, .siu-form input[type=file], .siu-form input[type=text],
.siu-form input[type=email], .siu-form input[type=date], .v-input {
  padding: 13px; font-size: 16px; font-weight: 500; border: 1.5px solid var(--borde);
  border-radius: var(--radio-sm); background: var(--panel); color: var(--texto); font-family: inherit;
}
.siu-form select:focus, .siu-form textarea:focus, .siu-form input:focus, .v-input:focus { outline: 0; border-color: var(--c-sec); }
.siu-gps { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.siu-gps .btn-secundario { width: auto; }
.campo-grupo h3 { font-size: 12.5px; color: var(--c-sec); margin-bottom: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; }
.campo-botones { display: flex; gap: 8px; }
.campo-btn {
  flex: 1; min-height: 56px; border-radius: 14px; border: 2px solid var(--borde);
  background: var(--panel); font-size: 15px; font-weight: 700; cursor: pointer; color: var(--texto); transition: all .12s;
}
.campo-btn.sel-verde { background: var(--ok); border-color: var(--ok); color: #fff; }
.campo-btn.sel-amarilla { background: var(--aviso); border-color: var(--aviso); color: #fff; }
.campo-btn.sel-roja { background: var(--mal); border-color: var(--mal); color: #fff; }
.campo-btn.sel-neutro { background: var(--c-sec); border-color: var(--c-sec); color: #fff; }
.campo-grupo input { width: 100%; padding: 13px; font-size: 16px; border: 1.5px solid var(--borde); border-radius: var(--radio-sm); background: var(--panel); }
.campo-meta { font-size: 12.5px; color: var(--texto-suave); line-height: 1.5; }
.campo-edit-acciones { padding: 0 14px 28px; display: flex; flex-direction: column; gap: 10px; max-width: 680px; margin: 0 auto; width: 100%; }

/* ═══ CAMPO (playas/montaña) ═══ */
.campo-card {
  display: flex; align-items: center; gap: 13px; text-align: left; width: 100%;
  background: var(--panel); border: 0; border-radius: var(--radio);
  padding: 14px; cursor: pointer; min-height: 74px; box-shadow: var(--sombra);
}
.campo-card:active { transform: scale(.985); }
.campo-estado {
  width: 52px; height: 52px; border-radius: 15px; flex: none; display: flex;
  align-items: center; justify-content: center; font-size: 21px; color: #fff;
}
.e-verde { background: var(--ok); } .e-amarilla { background: var(--aviso); } .e-roja { background: var(--mal); }
.e-abierto { background: var(--ok); } .e-precaucion { background: var(--aviso); } .e-cerrado { background: var(--mal); } .e-nd { background: #9aa7b3; }
.campo-card-info { flex: 1; min-width: 0; }
.campo-card-info strong { display: block; font-size: 16px; font-weight: 700; margin-bottom: 2px; }
.campo-card-info span { font-size: 13px; color: var(--texto-suave); }
.badge-manual { font-size: 10.5px; font-weight: 800; color: #8a5a00; background: #fdf2d9; border-radius: 20px; padding: 4px 9px; letter-spacing: .3px; }

/* ═══ RESERVAS ═══ */
.res-dias { display: flex; gap: 7px; padding: 12px 12px 0; overflow-x: auto; scrollbar-width: none; }
.res-dias::-webkit-scrollbar { display: none; }
.res-dia {
  min-width: 60px; padding: 9px 4px; text-align: center; border-radius: 14px;
  border: 1.5px solid var(--borde); background: var(--panel); cursor: pointer; flex: none;
}
.res-dia strong { display: block; font-size: 18px; font-weight: 800; }
.res-dia span { font-size: 10.5px; color: var(--texto-suave); text-transform: uppercase; font-weight: 700; letter-spacing: .4px; }
.res-dia.activo { border-color: transparent; background: var(--c-sec); box-shadow: 0 3px 10px color-mix(in srgb, var(--c-sec) 34%, transparent); }
.res-dia.activo strong, .res-dia.activo span { color: #fff; }
.res-slot {
  display: flex; align-items: center; gap: 13px; width: 100%; text-align: left;
  background: var(--panel); border: 0; border-radius: var(--radio); padding: 13px 15px;
  cursor: pointer; min-height: 62px; box-shadow: var(--sombra); border-left: 4px solid transparent;
}
.res-slot:active { transform: scale(.985); }
.res-slot .hora { font-weight: 800; font-size: 15px; min-width: 96px; letter-spacing: -.3px; }
.res-slot .info { flex: 1; min-width: 0; font-size: 13px; color: var(--texto-suave); }
.res-slot .info strong { display: block; font-size: 14.5px; color: var(--texto); font-weight: 700; }
.chip-slot { font-size: 10.5px; font-weight: 800; padding: 5px 11px; border-radius: 20px; white-space: nowrap; letter-spacing: .3px; }
.sl-libre { background: #e3f4e8; color: var(--ok); }
.sl-reservada { background: #e3edf8; color: #1565c0; }
.sl-pendiente { background: #fdf2d9; color: #8a5a00; }
.sl-bloqueada { background: #fdecec; color: var(--mal); }
.caja-kpis { display: flex; gap: 10px; }
.caja-kpi { flex: 1; background: var(--panel); border: 0; border-radius: var(--radio); padding: 16px 10px; text-align: center; box-shadow: var(--sombra); }
.caja-kpi strong { display: block; font-size: 24px; font-weight: 800; color: var(--c-sec); letter-spacing: -.6px; }
.caja-kpi span { font-size: 11.5px; color: var(--texto-suave); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }

/* ═══ LECTOR QR ═══ */
.chip-red { font-size: 11px; font-weight: 800; padding: 5px 11px; border-radius: 20px; letter-spacing: .3px; }
.chip-red.online { background: rgba(255, 255, 255, .22); color: #fff; }
.chip-red.offline { background: #fdecec; color: var(--mal); }
.qr-provision { padding: 24px 18px; max-width: 460px; margin: 0 auto; width: 100%; }
.qr-provision h2 { font-size: 19px; font-weight: 700; margin-bottom: 6px; }
.qr-provision p { font-size: 14px; color: var(--texto-suave); margin-bottom: 18px; line-height: 1.55; }
.qr-provision label { display: block; font-size: 12.5px; font-weight: 700; color: var(--texto-suave); margin-bottom: 15px; text-transform: uppercase; letter-spacing: .3px; }
.qr-provision input { width: 100%; margin-top: 6px; padding: 13px; font-size: 16px; border: 1.5px solid var(--borde); border-radius: var(--radio-sm); background: var(--panel); }
.qr-video-caja {
  position: relative; background: #000; aspect-ratio: 1 / 1; overflow: hidden;
  width: min(100%, 46dvh); margin: 12px auto 0; border-radius: 20px; box-shadow: var(--sombra-alta);
}
#qrVideo { width: 100%; height: 100%; object-fit: cover; }
.qr-marco { position: absolute; inset: 13%; border: 3px solid rgba(255, 255, 255, .9); border-radius: 20px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .3); pointer-events: none; }
.qr-manual { display: flex; gap: 8px; padding: 11px 13px 0; max-width: 600px; margin: 0 auto; width: 100%; }
.qr-manual input {
  flex: 1; padding: 13px; font-size: 16px; border: 1.5px solid var(--borde);
  border-radius: var(--radio-sm); text-transform: uppercase; background: var(--panel);
}
.qr-historial { padding: 13px; display: flex; flex-direction: column; gap: 7px; max-width: 600px; margin: 0 auto; width: 100%; }
.hist-fila {
  display: flex; align-items: center; gap: 11px; font-size: 13px; padding: 10px 14px;
  background: var(--panel); border-radius: var(--radio-sm); box-shadow: var(--sombra); font-weight: 600;
}
.hist-fila code { flex: 1; font-family: ui-monospace, Menlo, monospace; }
.hist-ok i { color: var(--ok); } .hist-mal i { color: var(--mal); }
.qr-resultado {
  position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px; padding: 26px; text-align: center; color: #fff;
}
.qr-resultado.res-ok { background: linear-gradient(160deg, #1e9c4a 0%, #147a37 100%); }
.qr-resultado.res-mal { background: linear-gradient(160deg, #d43535 0%, #a81f1f 100%); }
.qr-res-icono i { font-size: 96px; }
.qr-res-msg { font-size: 23px; font-weight: 800; line-height: 1.35; letter-spacing: -.3px; }
.qr-res-datos { font-size: 15px; display: grid; grid-template-columns: auto auto; gap: 5px 16px; text-align: left; }
.qr-res-datos dt { opacity: .85; text-transform: capitalize; }
.qr-res-datos dd { font-weight: 700; }
.qr-res-servicios { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.qr-resultado .btn-primario { max-width: 340px; background: rgba(255, 255, 255, .2); border: 2px solid #fff; box-shadow: none; }

/* ═══ TAB BAR INFERIOR (estilo GoodBarber) ═══
   Navegación contextual: en el dashboard = accesos globales; dentro de un
   módulo = sus bandejas, cada una con SU color al activarse. */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  display: flex; align-items: stretch;
  background: rgba(255, 255, 255, .97);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--borde);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -3px 18px rgba(16, 32, 43, .07);
}
.tabbar-item {
  position: relative; flex: 1; border: 0; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 9px 2px 8px; min-height: 60px; color: var(--texto-tenue);
  font-size: 10.5px; font-weight: 700; letter-spacing: .1px; transition: color .15s;
}
.tabbar-item i { font-size: 21px; transition: transform .18s, color .15s; }
.tabbar-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tabbar-item.on { color: var(--t-color, var(--c-sec)); }
.tabbar-item.on i { transform: translateY(-1px) scale(1.1); }
.tabbar-item.on::before {
  content: ''; position: absolute; top: 0; left: 22%; right: 22%; height: 3px;
  border-radius: 0 0 4px 4px; background: var(--t-color, var(--c-sec));
}
.tabbar-badge {
  position: absolute; top: 5px; left: 54%; background: var(--mal); color: #fff;
  border-radius: 11px; font-size: 10px; font-weight: 800; padding: 1px 6px; min-width: 18px;
  text-align: center; box-shadow: 0 2px 6px rgba(198, 40, 40, .45);
}
/* Con tab bar, el contenido necesita hueco inferior (y el FAB sube) */
body.con-tabbar .siu-lista,
body.con-tabbar .campo-lista,
body.con-tabbar .res-slots,
body.con-tabbar .siu-det,
body.con-tabbar .grid-tiles { padding-bottom: 92px; }
body.con-tabbar .fab { bottom: calc(78px + env(safe-area-inset-bottom)); }

/* ═══ AJUSTES ═══ */
.ajustes-cuerpo { padding: 18px 14px 40px; display: flex; flex-direction: column; gap: 14px; max-width: 560px; margin: 0 auto; width: 100%; }
.ajustes-cuerpo h2 { font-size: 12.5px; color: var(--texto-suave); font-weight: 800; text-transform: uppercase; letter-spacing: .6px; margin-top: 4px; }
.aj-identidades { font-size: 14px; color: var(--texto-suave); background: var(--panel); padding: 15px; border-radius: var(--radio); box-shadow: var(--sombra); line-height: 1.6; }
/* Ficha de usuario */
.aj-usuario { display: flex; align-items: center; gap: 14px; background: var(--panel); border-radius: var(--radio); padding: 16px; box-shadow: var(--sombra); }
.aj-avatar {
  width: 54px; height: 54px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, var(--color-muni), var(--color-muni-oscuro)); color: #fff; font-size: 21px; font-weight: 800;
}
.aj-usuario-txt strong { display: block; font-size: 16.5px; font-weight: 700; }
.aj-usuario-txt span { font-size: 13px; color: var(--texto-suave); }
/* Franja horaria de notificaciones */
.dias-fila { display: flex; gap: 6px; margin-bottom: 14px; }
.dia-btn {
  flex: 1; min-height: 46px; border-radius: 13px; border: 1.5px solid var(--borde); background: var(--panel);
  font-size: 14px; font-weight: 800; color: var(--texto-suave); cursor: pointer; transition: all .13s;
}
.dia-btn.on { background: var(--color-muni); border-color: transparent; color: #fff; box-shadow: 0 3px 9px color-mix(in srgb, var(--color-muni) 35%, transparent); }
.horas-fila { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.horas-fila label { flex: 1; font-size: 11.5px; font-weight: 700; color: var(--texto-suave); text-transform: uppercase; letter-spacing: .4px; }
.horas-fila input[type=time] {
  width: 100%; margin-top: 5px; padding: 12px; font-size: 16px; font-weight: 600; text-align: center;
  border: 1.5px solid var(--borde); border-radius: var(--radio-sm); background: #f9fbfd; color: var(--texto);
}
.switch-linea { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.switch-linea strong { font-size: 15px; font-weight: 700; }
.switch-linea small { display: block; font-size: 12.5px; color: var(--texto-suave); font-weight: 400; margin-top: 2px; }
.switch { position: relative; width: 52px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute; inset: 0; background: #cfd6e0; border-radius: 30px; cursor: pointer; transition: background .2s;
}
.switch span::before {
  content: ''; position: absolute; height: 24px; width: 24px; left: 3px; top: 3px; background: #fff;
  border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::before { transform: translateX(22px); }
