/* ===== core.css — estilos compartidos (núcleo), SIEMPRE cargado en primer lugar ===== */
:root {
  --fondo: #0b1220;
  --fondo-2: #0a1122;
  --superficie: rgba(18, 27, 48, 0.25);
  --superficie-fuerte: rgba(17, 25, 46, 0.25);
  --superficie-suave: rgba(255, 255, 255, 0.05);
  --superficie-hover: rgba(255, 255, 255, 0.09);
  --superficie-porta: rgba(10, 17, 34, 0.25);
  --texto: #f2f6ff;
  --texto-suave: #b7c3e0;
  --texto-flotante: rgba(255, 255, 255, 0.62);
  --borde: rgba(148, 163, 199, 0.16);
  --borde-fuerte: rgba(148, 163, 199, 0.32);
  --acento: #3b82f6;
  --acento-2: #60a5fa;
  --amarillo: #fbbf24;
  --exito: #34d399;
  --peligro: #fb7185;
  --sombra: 0 18px 40px rgba(2, 6, 16, 0.45);
  --blur: 24px;
  --radio-xl: 26px;
  --radio-lg: 20px;
  --radio-md: 14px;
  --radio-sv: 28px;
  --fondo-app:
    radial-gradient(circle at 76% 12%, rgba(255, 196, 0, 0.14), transparent 44%),
    radial-gradient(ellipse at 50% 106%, rgba(255, 158, 74, 0.55), rgba(214, 92, 43, 0.26) 38%, transparent 62%),
    radial-gradient(ellipse at 22% 104%, rgba(255, 178, 96, 0.28), transparent 46%),
    linear-gradient(176deg, #0a0f1e 0%, #121a33 30%, #1c2c46 52%, #43301c 76%, #170a05 100%);
  --brillo:
    radial-gradient(ellipse 90% 34% at 50% 100%, rgba(255, 190, 110, 0.42), rgba(255, 144, 80, 0.12) 45%, transparent 62%),
    radial-gradient(ellipse 40% 16% at 50% 100%, rgba(255, 214, 150, 0.5), transparent 70%),
    linear-gradient(to bottom, transparent 54%, rgba(70, 44, 24, 0.5) 100%);
  --frente: #272727;
  --frente-alto: #373737;
  --entrada: #3a3a3a;
  --carta: #242832;
  --carta-grad2: #251c28;
  --fab-cara: #111215;
  --fab-cara-hover: #1b1d21;
  --fab-cara-activo: #24262b;
  --toque: rgba(255, 255, 255, 0.25);
  --modal-oscurecer: rgba(3, 6, 14, 0.68);

  /* Matriz de diseño: tipografía */
  --fuente: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --fuente-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  /* Texto sobre acentos (botones/badges de color) */
  --texto-inverso: #ffffff;
  /* Derivados del acento */
  --acento-oscuro: #1d4ed8;
  --acento-bg: rgba(59, 130, 246, 0.12);
  --acento-anillo: rgba(59, 130, 246, 0.2);
  --exito-oscuro: #16a34a;
  /* Tintes de estado (fondo sólido -> -texto, tintes -> -bg/-borde) */
  --estado-exito-texto: #10b981; --estado-exito-bg: rgba(16, 185, 129, 0.18); --estado-exito-borde: rgba(16, 185, 129, 0.45);
  --estado-pendiente-texto: #f59e0b; --estado-pendiente-bg: rgba(245, 158, 11, 0.18); --estado-pendiente-borde: rgba(245, 158, 11, 0.45);
  --estado-info-texto: #94a3b8; --estado-info-bg: rgba(148, 163, 184, 0.18); --estado-info-borde: rgba(148, 163, 184, 0.4);
  --estado-error-texto: #f87171; --estado-error-bg: rgba(248, 113, 113, 0.18); --estado-error-borde: rgba(248, 113, 113, 0.45);
  --amarillo-bg: rgba(251, 191, 36, 0.12);
  --amarillo-borde: rgba(251, 191, 36, 0.35);
  /* Formulario "papel" (modales sv-*): campos claros constantes */
  --campo-texto: #0b0f1a;
  --campo-fondo: rgba(255, 255, 255, 0.9);
  --campo-fondo-fuerte: #ffffff;
  --campo-capa: rgba(255, 255, 255, 0.85);
  --campo-borde: rgba(0, 0, 0, 0.3);
  --campo-placeholder: #98a0b5;
  --campo-anillo: rgba(11, 15, 26, 0.12);
  /* Botón oscuro (sv-boton-negro) */
  --boton-negro-1: #232837;
  --boton-negro-2: #0b0f1a;
  /* Linterna 360° (funcional) */
  --linterna: #ffc400;
  --linterna-bg: rgba(255, 196, 0, 0.18);
  --linterna-borde: rgba(255, 196, 0, 0.6);
}

@media (prefers-color-scheme: light) {
  :root {
    --fondo: #eef1f8;
    --fondo-2: #e4eaf6;
    --superficie: rgba(11, 18, 32, 0.045);
    --superficie-fuerte: rgba(11, 18, 32, 0.07);
    --superficie-suave: rgba(11, 18, 32, 0.05);
    --superficie-hover: rgba(11, 18, 32, 0.09);
    --superficie-porta: rgba(11, 18, 32, 0.05);
    --texto: #11192e;
    --texto-suave: #4d5a7a;
    --texto-flotante: rgba(11, 18, 32, 0.62);
    --borde: rgba(11, 18, 32, 0.22);
    --borde-fuerte: rgba(11, 18, 32, 0.4);
    --sombra: 0 18px 40px rgba(11, 18, 32, 0.18);
--fondo-app:
    radial-gradient(circle at 76% 12%, rgba(255, 196, 0, 0.1), transparent 44%),
    radial-gradient(ellipse at 50% 106%, rgba(255, 170, 110, 0.5), rgba(244, 122, 76, 0.18) 40%, transparent 60%),
    radial-gradient(ellipse at 22% 104%, rgba(255, 196, 140, 0.35), transparent 46%),
    linear-gradient(176deg, #eef1f8 0%, #dde6f6 32%, #c7d5ee 56%, #e9cbb4 78%, #f0d8c4 100%);
  --brillo:
    radial-gradient(ellipse 84% 30% at 50% 100%, rgba(255, 214, 170, 0.5), rgba(255, 210, 160, 0.15) 46%, transparent 60%),
    linear-gradient(to bottom, transparent 62%, rgba(255, 250, 240, 0.6) 100%);
    --frente: #ffffff;
    --frente-alto: rgba(255, 255, 255, 0.35);
    --entrada: rgba(255, 255, 255, 0.4);
    --carta: rgba(255, 255, 255, 0.35);
    --carta-grad2: rgba(255, 255, 255, 0.12);
    --fab-cara: #10131d;
    --fab-cara-hover: #1b1f2d;
    --fab-cara-activo: #262b3d;
    --toque: rgba(11, 18, 32, 0.08);
    --modal-oscurecer: rgba(11, 18, 32, 0.45);
  }
}

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--fondo);
}

html, body {
  margin: 0;
  height: 100%;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--texto);
  font-family: var(--fuente);
  -webkit-tap-highlight-color: transparent;
  font-variant-numeric: tabular-nums;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: var(--brillo), var(--fondo-app);
}

body::after {
  content: "";
  position: fixed;
  inset: auto 0 0 0;
  height: 34vh;
  z-index: 0;
  pointer-events: none;
  background-repeat: no-repeat;
  background-position:
    bottom left 0%,
    bottom left 8%, bottom left 21%, bottom left 35%, bottom left 50%, bottom left 68%, bottom left 84%, bottom left 96%,
    bottom left 4%, bottom left 10%, bottom left 15%, bottom left 24%, bottom left 30%, bottom left 38%, bottom left 45%, bottom left 55%, bottom left 61%, bottom left 72%, bottom left 78%, bottom left 90%;
  background-size:
    100% 5vh,
    40px 10vh, 60px 9vh, 34px 12vh, 48px 7vh, 26px 11vh, 44px 8vh, 20px 10vh,
    46px 14vh, 26px 9vh, 58px 18vh, 30px 11vh, 52px 16vh, 22px 24vh, 64px 12vh, 28px 8vh, 50px 15vh, 24px 17vh, 56px 11vh, 30px 13vh;
  background-image:
    linear-gradient(rgba(3, 24, 40, 0.94), rgba(3, 24, 40, 0.94)),
    linear-gradient(rgba(6, 44, 66, 0.42), rgba(6, 44, 66, 0.42)), linear-gradient(rgba(6, 44, 66, 0.42), rgba(6, 44, 66, 0.42)), linear-gradient(rgba(6, 44, 66, 0.42), rgba(6, 44, 66, 0.42)), linear-gradient(rgba(6, 44, 66, 0.42), rgba(6, 44, 66, 0.42)), linear-gradient(rgba(6, 44, 66, 0.42), rgba(6, 44, 66, 0.42)), linear-gradient(rgba(6, 44, 66, 0.42), rgba(6, 44, 66, 0.42)), linear-gradient(rgba(6, 44, 66, 0.42), rgba(6, 44, 66, 0.42)),
    linear-gradient(rgba(4, 30, 50, 0.9), rgba(4, 30, 50, 0.9)), linear-gradient(rgba(4, 30, 50, 0.9), rgba(4, 30, 50, 0.9)), linear-gradient(rgba(4, 30, 50, 0.9), rgba(4, 30, 50, 0.9)), linear-gradient(rgba(4, 30, 50, 0.9), rgba(4, 30, 50, 0.9)), linear-gradient(rgba(4, 30, 50, 0.9), rgba(4, 30, 50, 0.9)), linear-gradient(rgba(4, 30, 50, 0.9), rgba(4, 30, 50, 0.9)), linear-gradient(rgba(4, 30, 50, 0.9), rgba(4, 30, 50, 0.9)), linear-gradient(rgba(4, 30, 50, 0.9), rgba(4, 30, 50, 0.9)), linear-gradient(rgba(4, 30, 50, 0.9), rgba(4, 30, 50, 0.9)), linear-gradient(rgba(4, 30, 50, 0.9), rgba(4, 30, 50, 0.9)), linear-gradient(rgba(4, 30, 50, 0.9), rgba(4, 30, 50, 0.9)), linear-gradient(rgba(4, 30, 50, 0.9), rgba(4, 30, 50, 0.9)), linear-gradient(rgba(4, 30, 50, 0.9), rgba(4, 30, 50, 0.9));
}

@media (prefers-color-scheme: light) {
  body::after {
    background-image:
      linear-gradient(rgba(208, 229, 240, 0.95), rgba(208, 229, 240, 0.95)),
      linear-gradient(rgba(172, 210, 230, 0.5), rgba(172, 210, 230, 0.5)), linear-gradient(rgba(172, 210, 230, 0.5), rgba(172, 210, 230, 0.5)), linear-gradient(rgba(172, 210, 230, 0.5), rgba(172, 210, 230, 0.5)), linear-gradient(rgba(172, 210, 230, 0.5), rgba(172, 210, 230, 0.5)), linear-gradient(rgba(172, 210, 230, 0.5), rgba(172, 210, 230, 0.5)), linear-gradient(rgba(172, 210, 230, 0.5), rgba(172, 210, 230, 0.5)), linear-gradient(rgba(172, 210, 230, 0.5), rgba(172, 210, 230, 0.5)),
      linear-gradient(rgba(126, 170, 200, 0.9), rgba(126, 170, 200, 0.9)), linear-gradient(rgba(126, 170, 200, 0.9), rgba(126, 170, 200, 0.9)), linear-gradient(rgba(126, 170, 200, 0.9), rgba(126, 170, 200, 0.9)), linear-gradient(rgba(126, 170, 200, 0.9), rgba(126, 170, 200, 0.9)), linear-gradient(rgba(126, 170, 200, 0.9), rgba(126, 170, 200, 0.9)), linear-gradient(rgba(126, 170, 200, 0.9), rgba(126, 170, 200, 0.9)), linear-gradient(rgba(126, 170, 200, 0.9), rgba(126, 170, 200, 0.9)), linear-gradient(rgba(126, 170, 200, 0.9), rgba(126, 170, 200, 0.9)), linear-gradient(rgba(126, 170, 200, 0.9), rgba(126, 170, 200, 0.9)), linear-gradient(rgba(126, 170, 200, 0.9), rgba(126, 170, 200, 0.9)), linear-gradient(rgba(126, 170, 200, 0.9), rgba(126, 170, 200, 0.9)), linear-gradient(rgba(126, 170, 200, 0.9), rgba(126, 170, 200, 0.9)), linear-gradient(rgba(126, 170, 200, 0.9), rgba(126, 170, 200, 0.9));
  }
}

@layer base {
  button,
  input,
  select,
  textarea {
    font: inherit;
    touch-action: manipulation;
  }
}

a {
  touch-action: manipulation;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(251, 191, 36, 0.85);
  outline-offset: 3px;
}

::selection {
  background: rgba(251, 191, 36, 0.28);
}

.oculta { display: none !important; }
[hidden] { display: none !important; }
.sin-scroll { overflow: hidden; }

/* ───── Login ───────────────────────────────────────────────────── */

.vista-login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.u-anillo {
  position: relative;
  width: min(100%, 348px);
  max-width: 94vw;
  border-radius: 24px;
  overflow: hidden;
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.35),
    0 8px 16px rgba(0, 0, 0, 0.35),
    0 0 8px rgba(255, 255, 255, 0.09),
    0 0 16px rgba(255, 255, 255, 0.06);
}

.u-anillo::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 300%;
  height: 300%;
  transform: translate(-50%, -50%);
  background: conic-gradient(
    from 0deg,
    transparent 72%,
    #9ab4ff 84%,
    #ffffff 90%,
    #ffd66b 96%,
    transparent 100%
  );
  animation: u-girar 6s linear infinite;
  will-change: transform;
}

@keyframes u-girar {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.u-caja {
  position: relative;
  z-index: 1;
  margin: 2px;
  border-radius: 22px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)),
    var(--superficie);
  border: 1px solid var(--borde);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(135%);
  backdrop-filter: blur(var(--blur)) saturate(135%);
  transform: translate3d(0, 0, 0);
  padding: 26px 24px 24px;
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  box-shadow:
    inset 0 40px 60px -8px rgba(255, 255, 255, 0.1),
    inset 4px 0 12px -6px rgba(255, 255, 255, 0.1),
    inset 0 0 12px -4px rgba(255, 255, 255, 0.1);
}

@keyframes u-aparecer {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes u-entrada {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.u-forma,
.u-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.u-cabeza {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.u-cabeza .u-logo {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  box-shadow:
    8px 8px 16px rgba(0, 0, 0, 0.25),
    -8px -8px 16px rgba(255, 255, 255, 0.06);
}

.u-cabeza h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--texto);
  letter-spacing: 0.4px;
}

.u-sub {
  margin: -4px 0 4px;
  text-align: center;
  color: var(--texto-suave);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}

.u-separador {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--texto-flotante);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.u-separador::before,
.u-separador::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--borde);
}

.u-interruptor {
  border: none;
  background: none;
  color: var(--acento-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
  text-align: center;
}
.u-interruptor:hover {
  text-decoration: underline;
}

.u-input,
.u-select,
.u-textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--entrada);
  color: var(--texto);
  outline: none;
  font-size: 16px;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.u-input::placeholder,
.u-textarea::placeholder {
  color: var(--texto-suave);
}
.u-input:focus,
.u-select:focus,
.u-textarea:focus {
  border-color: var(--borde-fuerte);
  background: var(--entrada);
}

.u-button {
  width: 100%;
  height: 42px;
  border: none;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: grid;
  place-content: center;
  gap: 10px;
  background: var(--frente-alto);
  color: var(--texto);
  transition: background 0.3s, box-shadow 0.3s;
  box-shadow:
    inset 0 3px 6px -4px rgba(0, 0, 0, 0.35),
    inset 0 -3px 6px -2px rgba(0, 0, 0, 0.35);
}
.u-button:hover:not(:disabled) {
  background: var(--toque);
  box-shadow:
    inset 0 3px 6px rgba(0, 0, 0, 0.35),
    inset 0 -3px 6px rgba(0, 0, 0, 0.35),
    0 0 8px rgba(0, 0, 0, 0.08);
}
.u-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.u-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.u-google svg {
  width: 18px;
  height: 18px;
}

.u-estado {
  margin: 0;
  min-height: 1em;
  text-align: center;
  color: var(--texto-flotante);
  font-size: 12px;
}
.u-estado[data-error="true"] {
  color: var(--peligro);
}

.u-footer {
  display: flex;
  gap: 4px;
  color: var(--texto-flotante);
  font-size: 12px;
}
.u-footer .u-enlace {
  position: relative;
  color: var(--texto-flotante);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.3s ease;
}
.u-footer .u-enlace::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  border-radius: 6px;
  height: 1px;
  background: currentColor;
  transition: width 0.3s ease;
}
.u-footer .u-enlace:hover {
  color: var(--texto);
}
.u-footer .u-enlace:hover::after {
  width: 100%;
}

/* ───── Vista de aplicación (shell) ─────────────────────────────── */

.vista-login, .vista-app { position: relative; z-index: 1; }

.vista-app {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 84px 1fr;
}

/* Contenedor de plantillas montadas: sus hijos (vistas y modales) participan del grid/layout del padre */
#dom-modulos {
  display: contents;
}

.panel-lateral {
  position: sticky;
  top: 0;
  height: 100dvh;
  padding: 0.85rem 0.7rem;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-y: auto;
}

.card {
  width: 100%;
  max-width: 60px;
  align-self: center;
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
}

.card .separator {
  align-self: center;
  width: 26px;
  border-top: 1.5px solid var(--borde-fuerte);
}

.card .list {
  list-style-type: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
  margin: 0;
}

.card .list .element {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--texto-suave);
  transition: background-color 0.3s ease-out, color 0.3s ease-out, transform 0.3s ease-out;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  cursor: pointer;
  border: none;
  background: none;
}

.card .list .element svg {
  width: 19px;
  height: 19px;
  transition: stroke 0.3s ease-out;
  flex-shrink: 0;
}

.card .list .element .label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.card .list .element .badge {
  position: absolute;
  top: 3px;
  right: 3px;
  margin: 0;
}

.card .list .element:hover {
  background-color: #5353ff;
  color: #ffffff;
  transform: translate(1px, -1px);
}

.card .list .element.activo {
  background-color: #5353ff;
  color: #ffffff;
}

.card .list .delete:hover {
  background-color: #8e2a2a;
}

.card .list .element:active {
  transform: scale(0.99);
}

.card .list:not(:last-child) .element:hover svg {
  stroke: #ffffff;
}

.card .list:last-child svg {
  stroke: #bd89ff;
}
.card .list:last-child .element {
  color: #bd89ff;
}

.card .list:last-child .element:hover {
  background-color: rgba(107, 78, 148, 0.55);
}

.marca-lateral {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  padding: 0;
  text-align: center;
}
.marca-lateral strong,
.marca-lateral .usuario-rol {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.marca-lateral .logo-icono {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(30, 52, 142, 0.4);
}

.card .placeholder {
  color: var(--texto-suave);
  font-size: 0.85rem;
  padding: 4px 7px;
}

.usuario-rol {
  font-size: 0.68rem;
  color: var(--texto-suave);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.contenido {
  flex: 1;
  padding: 1.4rem;
  display: grid;
  place-items: start center;
  width: 100%;
  min-width: 0;
}

.tarjeta {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)),
    var(--superficie);
  border: 1px solid var(--borde);
  border-radius: var(--radio-xl);
  box-shadow: var(--sombra);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(135%);
  backdrop-filter: blur(var(--blur)) saturate(135%);
  transform: translate3d(0, 0, 0);
}

.tarjeta::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 88% 12%, rgba(251, 191, 36, 0.1), transparent 30%),
    radial-gradient(circle at 12% 88%, rgba(59, 130, 246, 0.12), transparent 36%);
  pointer-events: none;
}

.contenido .tarjeta { padding: 1.5rem; max-width: 980px; width: 100%; }

.contenido h2 {
  position: relative;
  z-index: 1;
  margin: 0 0 0.4rem;
  font-size: 1.35rem;
  letter-spacing: -0.4px;
}

/* ───── Tarjeta Historial de Vales ──────────────────────────────── */

.historial-vales-card {
  position: relative;
  width: 100%;
  max-width: 980px;
  padding: 1.6rem;
  color: var(--texto);
  border: 1.5px solid var(--borde-fuerte);
  border-radius: var(--radio-sv);
  box-shadow: var(--sombra);
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

.historial-vales-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: calc(var(--radio-sv) - 1px);
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)),
    var(--superficie);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(135%);
  backdrop-filter: blur(var(--blur)) saturate(135%);
}

.historial-vales-card h2 {
  margin-bottom: 0.15rem;
}

.historial-vales-cabecera {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.historial-vales-cabecera p {
  margin: 0;
  color: var(--texto-suave);
  font-size: 0.9rem;
}

.vale-suma {
  flex-shrink: 0;
  padding: 0.45rem 0.9rem;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--texto);
  background: var(--superficie-suave);
  border: 1px solid var(--borde);
  border-radius: 14px;
  white-space: nowrap;
}

.historial-vales-lista {
  position: relative;
  display: grid;
  gap: 0.6rem;
  max-height: clamp(260px, 48vh, 460px);
  overflow-y: auto;
  padding-right: 0.25rem;
}

.historial-vales-lista::-webkit-scrollbar { width: 8px; }
.historial-vales-lista::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--superficie-hover);
  border: 2px solid transparent;
  background-clip: padding-box;
}

.historial-vales-vacio {
  margin: 0;
  padding: 1.2rem;
  text-align: center;
  color: var(--texto-suave);
  font-size: 0.95rem;
  background: var(--superficie-suave);
  border: 1px dashed var(--borde);
  border-radius: 16px;
}

.historial-vales-error { color: var(--peligro); }

/* ───── Fila de vale "libro de caja": inicio (acciones + historial) y modales ── */
.vale-row {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.7rem 1.05rem;
  background: var(--superficie-suave);
  border: 1px solid var(--borde);
  border-radius: 14px;
  padding: 13px 15px;
  transition: background 0.15s;
}

.vale-row:hover { background: var(--superficie-hover); }

.vale-id {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.vale-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--superficie-fuerte);
  border: 1px solid var(--borde);
  color: var(--texto);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.vale-folio {
  font-family: var(--fuente-mono);
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.2px;
  color: var(--texto);
  background: var(--superficie-fuerte);
  border: 1px solid var(--borde);
  border-radius: 8px;
  padding: 0.22rem 0.55rem;
  white-space: nowrap;
}

.vale-info {
  display: flex;
  flex-direction: column;
  flex: 1 1 150px;
  gap: 3px;
  min-width: 0;
}

.vale-solicitante {
  margin: 0;
  color: var(--texto);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.vale-depto { margin: 0; color: var(--texto-suave); font-size: 0.72rem; font-weight: 500; }

.vale-motivo {
  margin: 0.15rem 0 0;
  color: var(--texto-flotante);
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}

.vale-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; max-width: 100%; margin-left: auto; /* envuelta sola en su línea: el margen la deja al ras derecho */ }

.vale-linea { display: flex; align-items: center; gap: 0.55rem; }

.vale-badge {
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  border-width: 1px;
  border-style: solid; /* el color del estado lo da la utility .badge-* de tw.src */
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.vale-monto { font-weight: 800; font-size: 1.02rem; font-variant-numeric: tabular-nums; letter-spacing: -0.2px; white-space: nowrap; }

.vale-fecha { color: var(--texto-flotante); font-size: 0.7rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

.vale-pdf {
  margin-top: 2px;
  cursor: pointer;
  padding: 0.3rem 0.72rem;
  border-radius: 999px;
  border: 1px solid var(--borde-fuerte);
  background: transparent;
  color: var(--texto);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.vale-pdf:hover { border-color: var(--acento); color: var(--acento); }

/* 240+ filas en el historial del modal: skip de layout/paint fuera del viewport */
#modal-vales-historial .vale-row {
  content-visibility: auto;
  contain-intrinsic-size: auto 96px;
}

/* ── Resumen tipo recibo del modal vales activos ── */
#modal-vale-activos .va-resumen {
  background: var(--superficie-suave);
  border: 1px solid var(--borde);
  border-radius: 14px;
  padding: 0.85rem 1.05rem;
  margin-bottom: 0.85rem;
}
#modal-vale-activos .va-conteo { margin: 0 0 0.55rem; color: var(--texto-suave); font-size: 0.78rem; }
#modal-vale-activos .va-total { margin: 0; display: flex; align-items: baseline; gap: 0.6rem; }
#modal-vale-activos .va-total-etiqueta { color: var(--texto); font-size: 0.8rem; font-weight: 700; }
#modal-vale-activos .va-total-linea { flex: 1 1 auto; min-width: 1.5rem; border-bottom: 2px dotted var(--borde-fuerte); transform: translateY(-3px); }
#modal-vale-activos .va-total-monto {
  color: var(--acento);
  font-size: 1.3rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.4px;
}

/* ── Secciones del historial: título + pill de conteo ── */
#modal-vales-historial .vh-seccion { display: flex; align-items: center; gap: 0.6rem; }
#modal-vales-historial .vh-conteo {
  background: var(--superficie-fuerte);
  border: 1px solid var(--borde);
  border-radius: 999px;
  padding: 0.06rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--texto-suave);
}
#modal-vales-historial .kpi-card { cursor: pointer; }
#modal-vales-historial .kpi-numero { font-size: 1.25rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.3px; }
#modal-vales-historial .kpi-sub { font-size: 0.72rem; color: var(--texto-flotante); font-variant-numeric: tabular-nums; }
#modal-vales-historial .vh-filtro-activo { border-color: var(--acento); box-shadow: inset 0 0 0 1px var(--acento); }

/* Los KPIs del modal van inline a 4 columnas: en móvil, 2×2 (la inline solo la gana !important) */
@media (max-width: 640px) {
  #modal-vales-historial .sv-forma { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

/* ───── Inicio: dos mitades (acciones + historial) ──────────────── */

#inicio-usuario {
  width: 100%;
  max-width: 980px;
  height: calc(100dvh - 2.8rem);
  min-height: 560px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.1rem;
  overflow: hidden;
}

.acciones-vales-card,
#inicio-usuario .historial-vales-card {
  position: relative;
  width: 100%;
  padding: 1.6rem;
  color: var(--texto);
  border: 1.5px solid var(--borde-fuerte);
  border-radius: var(--radio-sv);
  box-shadow: var(--sombra);
  transform: translate3d(0, 0, 0);
  will-change: transform;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.acciones-vales-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: calc(var(--radio-sv) - 1px);
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)),
    var(--superficie);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(135%);
  backdrop-filter: blur(var(--blur)) saturate(135%);
}

.acciones-vales-card h2 {
  margin-bottom: 0.15rem;
}

.acciones-vales-lista {
  position: relative;
  display: grid;
  gap: 0.6rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.25rem;
}

#inicio-usuario .historial-vales-lista {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.25rem;
  max-height: none;
}

#inicio-usuario .historial-vales-cabecera {
  flex-shrink: 0;
}

.acciones-vales-lista::-webkit-scrollbar { width: 8px; }
.acciones-vales-lista::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--superficie-hover);
  border: 2px solid transparent;
  background-clip: padding-box;
}

.accion-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.9rem;
  padding: 0.75rem 1rem;
  background: var(--superficie-suave);
  border: 1px solid transparent;
  border-radius: 16px;
  cursor: pointer;
  overflow: hidden;
}

.accion-row::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.34;
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  transform: translate3d(0, 0, 0);
}
.accion-row::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  border-radius: 0 4px 4px 0;
}

.accion-row:hover { filter: brightness(1.06); }

.accion-row.accion-aprobacion::before { background: rgba(251, 191, 36, 0.55); }
.accion-row.accion-aprobacion::after { background: #fbbf24; }
.accion-row.accion-entrega::before { background: rgba(52, 211, 153, 0.5); }
.accion-row.accion-entrega::after { background: #34d399; }
.accion-row.accion-liquidacion::before { background: rgba(96, 165, 250, 0.5); }
.accion-row.accion-liquidacion::after { background: #60a5fa; }
.accion-row.accion-revision::before { background: rgba(167, 139, 250, 0.5); }
.accion-row.accion-revision::after { background: #a78bfa; }

.accion-tipo {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-bottom: 0.1rem;
}
.accion-aprobacion .accion-tipo { color: #b45309; }
.accion-entrega .accion-tipo { color: #047857; }
.accion-liquidacion .accion-tipo { color: #1d4ed8; }
.accion-revision .accion-tipo { color: #6d28d9; }

@media (prefers-color-scheme: light) {
  .accion-aprobacion .accion-tipo { color: #92400e; }
  .accion-entrega .accion-tipo { color: #065f46; }
  .accion-liquidacion .accion-tipo { color: #1e40af; }
  .accion-revision .accion-tipo { color: #5b21b6; }
}

.accion-quien {
  color: var(--texto-suave);
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.accion-detalle {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.12rem;
}
.accion-monto {
  font-weight: 800;
  font-size: 0.98rem;
  white-space: nowrap;
}
.accion-fecha {
  color: var(--texto-flotante);
  font-size: 0.75rem;
  white-space: nowrap;
}

.accion-caret {
  color: var(--texto-flotante);
  font-size: 0.9rem;
}

/* Resumen + campos del modal de acción */
.accion-resumen {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.9rem;
  background: var(--superficie-suave);
  border: 1px solid var(--borde);
  border-radius: 14px;
  font-size: 0.9rem;
}
.accion-resumen strong {
  font-size: 1.05rem;
  letter-spacing: -0.2px;
}
.accion-resumen span {
  color: var(--texto-suave);
}
.accion-resumen .accion-resumen-monto {
  font-weight: 800;
  color: var(--texto);
}
.accion-resumen-fila {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--borde);
}
.accion-resumen-fila:last-child {
  border-bottom: none;
}
.accion-resumen-fila span {
  color: var(--texto-suave);
  font-size: 0.85rem;
}
.accion-resumen-fila strong {
  font-size: 0.95rem;
  text-align: right;
}
.accion-campos {
  display: grid;
  gap: 0.9rem;
  margin-bottom: 1rem;
}
.accion-botones-dual {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.accion-botones-dual .sv-boton {
  flex: 1;
}
.vale-row-accion {
  cursor: pointer;
  transition: background 0.15s ease;
}
.vale-row-accion:hover {
  background: var(--superficie-fuerte);
}
.sv-boton-verde {
  background: var(--exito-oscuro);
  color: var(--texto-inverso);
  border: none;
  border-radius: 10px;
  padding: 0.6rem 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}
.sv-boton-verde:hover {
  background: #15803d;
}
.sv-boton-rojo {
  background: #dc2626;
  color: var(--texto-inverso);
  border: none;
  border-radius: 10px;
  padding: 0.6rem 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}
.sv-boton-rojo:hover {
  background: #b91c1c;
}

/* Evidencias fotográficas */
.evidencias-contenedor {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.evidencias-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.evidencia-item {
  position: relative;
  background: var(--superficie-suave);
  border: 1px solid var(--borde);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.evidencia-img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  display: block;
}
.evidencia-info {
  padding: 0.4rem 0.5rem;
  font-size: 0.7rem;
  color: var(--texto-suave);
  display: flex;
  justify-content: space-between;
  gap: 0.3rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.evidencia-eliminar {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}
.evidencia-eliminar:hover {
  background: rgba(220, 38, 38, 0.9);
}

/* ───── Botones / estado secundarios ────────────────────────────── */

.boton-secundario {
  background: var(--superficie-suave);
  border: 1px solid var(--borde);
  color: var(--texto-suave);
  padding: 0.55rem 1rem;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.boton-secundario:hover { color: var(--texto); background: var(--superficie-hover); border-color: var(--borde-fuerte); }

/* ───── Modal (fondo) ───────────────────────────────────────────── */

.modal-fondo {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 18px;
  background: var(--modal-oscurecer);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  animation: u-entrada 0.18s ease;
}

/* ───── FAB flotante ────────────────────────────────────────────── */

.fab-zona {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 400;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
  pointer-events: none;
}

.fab-zona .fab-blob,
.fab-zona .fab-item {
  pointer-events: auto;
}

.fab-menu {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  min-width: 14rem;
  padding: 0.5rem;
  border: 1px solid var(--borde-fuerte);
  border-radius: 1rem;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)),
    var(--superficie-porta);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(135%);
  backdrop-filter: blur(var(--blur)) saturate(135%);
  transform: translate3d(0, 0, 0);
  box-shadow: 0 14px 32px rgba(2, 6, 16, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: u-entrada 0.18s ease;
}

.fab-item {
  border: none;
  border-radius: 0.6rem;
  padding: 0.7rem 1rem;
  background: var(--superficie-suave);
  color: var(--texto);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.fab-item:hover {
  background: var(--superficie-hover);
  transform: translateY(-1px);
}
.fab-item:active {
  transform: scale(0.98);
}

.fab-vacio {
  padding: 0.7rem 1rem;
  border-radius: 0.6rem;
  background: var(--superficie-suave);
  color: var(--texto-suave);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.35;
  max-width: 16rem;
}

.fab-blob {
  position: relative;
  width: 64px;
  height: 64px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 50%;
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.35),
    0 8px 16px rgba(0, 0, 0, 0.35),
    0 0 8px rgba(255, 255, 255, 0.09),
    0 0 16px rgba(255, 255, 255, 0.06);
}

.fab-blob .spin {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  opacity: 0.85;
  transition: opacity 0.3s ease;
}
.fab-blob:hover .spin {
  opacity: 1;
}

.fab-blob .spin::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 300%;
  height: 300%;
  transform: translate(-50%, -50%);
  background: conic-gradient(
    from 0deg,
    transparent 72%,
    #9ab4ff 84%,
    #ffffff 90%,
    #ffd66b 96%,
    transparent 100%
  );
  animation: u-girar 6s linear infinite;
  will-change: transform;
}

.fab-blob .button-face {
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--fab-cara);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -2px 6px rgba(0, 0, 0, 0.4);
  transition: background 0.15s ease;
}
.fab-blob:hover .button-face {
  background: var(--fab-cara-hover);
}
.fab-blob:active .button-face {
  background: var(--fab-cara-activo);
}

/* Botón manual de instalación PWA (beforeinstallprompt) */
.boton-instalar-pwa {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 900;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid var(--borde);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)),
    var(--superficie-fuerte);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(135%);
  backdrop-filter: blur(var(--blur)) saturate(135%);
  color: var(--texto);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: background 0.15s ease, transform 0.15s ease;
}
.boton-instalar-pwa:hover {
  background: var(--superficie);
}
.boton-instalar-pwa:active {
  transform: scale(0.97);
}

/* ───── Panel de notificaciones (lateral derecho) ───────────────── */

.notificaciones-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 360px;
  max-width: 100vw;
  height: 100vh;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)),
    var(--superficie-fuerte);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(135%);
  backdrop-filter: blur(var(--blur)) saturate(135%);
  transform: translate3d(0, 0, 0);
  border-left: 1px solid var(--borde);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
  animation: u-entrada 0.18s ease;
}

.notificaciones-cabecera {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--borde);
}

.notificaciones-cabecera h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.notificaciones-cerrar {
  background: none;
  border: none;
  color: var(--texto-suave);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}
.notificaciones-cerrar:hover {
  color: var(--texto);
}

.notificaciones-acciones {
  padding: 12px 20px;
  border-bottom: 1px solid var(--borde);
}

.notificaciones-lista {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.notificaciones-vacio {
  text-align: center;
  color: var(--texto-suave);
  padding: 40px 20px;
}

.notificacion-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radio-md);
  transition: background 0.15s ease;
}
.notificacion-item:hover {
  background: var(--superficie-hover);
}

.notificacion-item.no-leida {
  background: rgba(59, 130, 246, 0.1);
}

.notificacion-icono {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.notificacion-contenido {
  flex: 1;
  min-width: 0;
}

.notificacion-titulo {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.notificacion-mensaje {
  font-size: 0.85rem;
  color: var(--texto-suave);
  line-height: 1.4;
}

.notificacion-fecha {
  font-size: 0.75rem;
  color: var(--texto-suave);
  margin-top: 6px;
  opacity: 0.7;
}

.notificacion-marcar {
  background: none;
  border: none;
  color: var(--acento);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}
.notificacion-marcar:hover {
  background: var(--superficie-hover);
}

.badge {
  background: var(--peligro);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 8px;
  min-width: 18px;
  text-align: center;
}

/* ───── Toasts ──────────────────────────────────────────────────── */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radio-md);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)),
    var(--superficie-fuerte);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(135%);
  backdrop-filter: blur(var(--blur)) saturate(135%);
  border: 1px solid var(--borde);
  box-shadow: var(--sombra);
  transform: translateX(120%);
  transition: transform 0.3s ease;
  will-change: transform;
  animation: u-entrada 0.18s ease;
  max-width: 320px;
}
.toast.mostrar {
  transform: translateX(0);
}
.toast-exito { border-color: var(--exito); }
.toast-error { border-color: var(--peligro); }
.toast-info { border-color: var(--acento); }

/* ── Visor interno de fotos / PDF (sub-vista del dashboard flota) ───────── */
.visor-media-360 {
  position: fixed;
  inset: 0;
  z-index: 700;
  display: flex;
  flex-direction: column;
  background: var(--fondo);
}
.visor-media-360.oculto { display: none !important; }

.visor-media-cabecera {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--borde);
  background: var(--fondo-2);
}
.visor-media-cabecera .btn-volver-visor {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--borde-fuerte);
  background: var(--superficie-hover);
  color: var(--texto);
  font-size: 0.88rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.visor-media-cabecera .btn-volver-visor:active { transform: scale(0.97); }
.visor-media-cabecera .visor-titulo {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.visor-media-cabecera .visor-titulo strong {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--texto);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.visor-media-cabecera .visor-titulo span {
  font-size: 0.75rem;
  color: var(--texto-suave);
}

.visor-media-cuerpo {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
}

.visor-galeria-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.visor-galeria-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--superficie-suave);
  border: 1px solid var(--borde);
}
.visor-galeria-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: #000;
  cursor: pointer;
}
.visor-galeria-item span {
  padding: 0 8px 8px;
  font-size: 0.72rem;
  color: var(--texto-suave);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.visor-vacio {
  text-align: center;
  padding: 40px 16px;
  color: var(--texto-suave);
  font-size: 0.9rem;
}

.visor-pdf-frame {
  width: 100%;
  height: calc(100dvh - 70px);
  border: 0;
  border-radius: 12px;
  background: #1a1a1a;
}

.visor-foto-ampliada {
  position: fixed;
  inset: 0;
  z-index: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
  padding: 16px;
}
.visor-foto-ampliada.oculto { display: none !important; }
.visor-foto-ampliada img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
}
.visor-foto-ampliada .cerrar-ampliada {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

.btn-media, .btn-pdf {
  cursor: pointer;
  font-family: inherit;
}

/* ── Evidencias (miniaturas): cards de vales + galería de liquidaciones ── */
.vale-evidencias {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.evidencia-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--borde-fuerte);
  background: var(--superficie-fuerte);
  cursor: zoom-in;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.evidencia-thumb:hover {
  transform: translateY(-1px) scale(1.05);
  border-color: var(--acento);
}
.evidencia-thumb:focus-visible {
  outline: 2px solid var(--acento);
  outline-offset: 2px;
}

