/* =========================================================
   SS Servicios — Self Check-in y Pago de Facturas
   Port de Tailwind/shadcn a CSS vanilla
   ========================================================= */

/* ---------- Tipografía Gilroy (manual de marca) ----------
 * Self-host de los 7 cortes provistos por el cliente. Para los pesos
 * que no tenemos (Bold 700, MediumItalic, etc.) el browser sintetiza
 * o cae al peso disponible más cercano.
 */
@font-face {
  font-family: 'Gilroy';
  src: url('/static/fonts/gilroy/Gilroy-Light.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Gilroy';
  src: url('/static/fonts/gilroy/Gilroy-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Gilroy';
  src: url('/static/fonts/gilroy/Gilroy-RegularItalic.ttf') format('truetype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Gilroy';
  src: url('/static/fonts/gilroy/Gilroy-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Gilroy';
  src: url('/static/fonts/gilroy/Gilroy-SemiBold.otf') format('opentype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Gilroy';
  src: url('/static/fonts/gilroy/Gilroy-ExtraBold.otf') format('opentype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Gilroy';
  src: url('/static/fonts/gilroy/Gilroy-Heavy.ttf') format('truetype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens (HSL) — Manual de marca SS Servicios DIC 2025 ----------
 * Primarios:
 *   Azul SS      #3880C3  → hsl(207 55% 49%)   (PANTONE 2173 C)
 *   Cool Gray 1  #DDDEE0  → hsl(220 6% 87%)
 *   Blanco       #FFFFFF
 * Secundarios:
 *   Verde        #387F53  → hsl(144 38% 36%)   (PANTONE 7736 C)
 *   Amarillo     #F4C66A  → hsl(39 86% 69%)    (PANTONE 2009 C)
 *   Celeste      #5BB7E7  → hsl(200 75% 63%)   (PANTONE 2985 C)
 *   Naranja      #EC702E  → hsl(20 84% 55%)    (PANTONE 1585 C)
 *   Violeta      #915CB0  → hsl(279 30% 53%)   (PANTONE 2071 C)
 *   Azul oscuro  #2A488E  → hsl(222 54% 36%)   (PANTONE 7686 C)
 */
:root {
  --background: 210 20% 98%;
  --foreground: 215 25% 14%;

  --card: 0 0% 100%;
  --card-foreground: 215 25% 14%;

  --popover: 0 0% 100%;
  --popover-foreground: 215 25% 14%;

  /* Azul SS — #3880C3 */
  --primary: 207 55% 49%;
  --primary-foreground: 0 0% 100%;

  --secondary: 220 6% 92%;
  --secondary-foreground: 215 25% 14%;

  /* Basado en Cool Gray 1 — #DDDEE0 */
  --muted: 220 8% 95%;
  --muted-foreground: 215 13% 45%;

  /* Verde SS — #387F53 */
  --accent: 144 38% 36%;
  --accent-foreground: 0 0% 100%;

  --destructive: 0 72% 51%;
  --destructive-foreground: 0 0% 100%;

  --border: 220 6% 87%;
  --input: 220 6% 87%;
  --ring: 207 55% 49%;

  --radius: 0.75rem;

  /* Kiosk (oscuro) — alineado al azul SS */
  --kiosk-bg: 212 30% 12%;
  --kiosk-foreground: 0 0% 100%;
  --kiosk-card: 210 28% 19%;
  --kiosk-card-foreground: 0 0% 100%;
  --kiosk-accent: 144 38% 36%;
  --kiosk-accent-foreground: 0 0% 100%;
  --kiosk-muted: 210 18% 28%;
  --kiosk-warning: 39 86% 69%;     /* Amarillo SS */
  --kiosk-info: 200 75% 63%;       /* Celeste SS */

  --success: 144 38% 36%;
  --success-foreground: 0 0% 100%;

  /* Secundarios de marca (Manual DIC 2025) — tokens reusables para acentos,
     estados o categorías. Usar con moderación; el primario es el dominante. */
  --brand-dark-blue: 222 54% 36%;  /* #2A488E */
  --brand-orange:    20 84% 55%;   /* #EC702E */
  --brand-purple:    279 30% 53%;  /* #915CB0 */
  --brand-black:     0 0% 0%;      /* #000000 */
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; border: 0 solid hsl(var(--border)); }

html, body { height: 100%; }

body {
  /* Gilroy: tipografía oficial del manual de marca SS Servicios */
  font-family: 'Gilroy', 'Manrope', 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  letter-spacing: -0.005em;
}

button {
  font-family: inherit;
  font-size: inherit;
  background: none;
  cursor: pointer;
  color: inherit;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

a { color: inherit; text-decoration: none; }

img, svg { display: block; max-width: 100%; }

/* lucide icons render as <i data-lucide="..."></i>; tras createIcons() pasan a <svg> */
i[data-lucide], svg.lucide { display: inline-block; vertical-align: middle; }

/* Isotipo SS Servicios — imagen oficial. Mantener relación 1:1, sin fondos,
   filtros, sombras ni degradados que alteren el isotipo. */
.brand-mark {
  display: block;
  object-fit: contain;
  background: transparent;
  filter: none;
  box-shadow: none;
  border-radius: 0;
}
.brand-mark.size-8  { width: 2rem;   height: 2rem;   }
.brand-mark.size-10 { width: 2.5rem; height: 2.5rem; }
.brand-mark.size-14 { width: 3.5rem; height: 3.5rem; }
.brand-mark.size-16 { width: 4rem;   height: 4rem;   }

/* Isologo horizontal (símbolo + nombre). Ancho automático, alto fijo según
   el size, centrado. Reemplaza al nombre escrito en toda la plataforma. */
.brand-logo-h {
  display: block; width: auto; max-width: 100%;
  object-fit: contain; margin: 0 auto; height: 3rem;
}
.brand-logo-h.size-10 { height: 2.75rem; }
.brand-logo-h.size-14 { height: 3.5rem; }
.brand-logo-h.size-16 { height: 6.5rem; }

/* Íconos SVG propios (carpeta /static/img). Vienen en negro: se pintan de
   blanco para que combinen con botones y headers oscuros del tótem. */
.svg-icon {
  display: inline-block; vertical-align: middle; object-fit: contain;
  filter: brightness(0) invert(1);
}

/* Tagline / slogan */
.brand-slogan {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: hsl(var(--primary));
  opacity: .85;
}
.brand-slogan strong { font-weight: 800; }
.brand-slogan-light {
  color: hsl(0 0% 100% / .7);
  text-transform: none;
  letter-spacing: 0;
  font-size: 1rem;
  font-weight: 500;
}
.brand-slogan-light strong { color: hsl(0 0% 100%); font-weight: 800; }

/* ---------- Tamaños de iconos lucide ---------- */
.icon-3 { width: .75rem; height: .75rem; }
.icon-3-5 { width: .875rem; height: .875rem; }
.icon-4 { width: 1rem; height: 1rem; }
.icon-5 { width: 1.25rem; height: 1.25rem; }
.icon-6 { width: 1.5rem; height: 1.5rem; }
.icon-7 { width: 1.75rem; height: 1.75rem; }
.icon-8 { width: 2rem; height: 2rem; }
.icon-14 { width: 3.5rem; height: 3.5rem; }
.icon-16 { width: 4rem; height: 4rem; }
.icon-24 { width: 6rem; height: 6rem; }

/* =========================================================
   PANTALLA INDEX (selector tótem / admin)
   ========================================================= */
.index-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: hsl(var(--muted));
  padding: 1rem;
}
.index-wrap {
  max-width: 32rem;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.index-header {
  display: flex; flex-direction: column; gap: .75rem; align-items: center;
}
.index-logo {
  width: 4rem; height: 4rem; border-radius: 1rem;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  display: flex; align-items: center; justify-content: center;
}
.index-title {
  font-size: 1.875rem; font-weight: 700; color: hsl(var(--foreground));
}
.index-subtitle { color: hsl(var(--muted-foreground)); }

.index-cards { display: flex; flex-direction: column; gap: 1rem; }
.index-card {
  display: flex; align-items: center; gap: 1rem;
  width: 100%; padding: 1.25rem;
  border-radius: .75rem;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  text-align: left;
  transition: border-color .2s, box-shadow .2s;
}
.index-card:hover {
  border-color: hsl(var(--primary) / .5);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);
}
.index-card-icon {
  width: 3rem; height: 3rem; border-radius: .5rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.index-card-icon.primary { background: hsl(var(--primary) / .1); color: hsl(var(--primary)); }
.index-card-icon.accent  { background: hsl(var(--accent) / .1);  color: hsl(var(--accent)); }
.index-card-title { font-weight: 600; color: hsl(var(--card-foreground)); }
.index-card-desc { font-size: .875rem; color: hsl(var(--muted-foreground)); }

.index-footer { font-size: .75rem; color: hsl(var(--muted-foreground)); }

/* =========================================================
   TÓTEM (kiosk)
   ========================================================= */
.kiosk-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  /* El gradiente default sirve cuando no hay --kiosk-bg-image seteado.
     Cuando el admin sube un fondo, se setea la var en :root via JS y
     pisa el gradiente. */
  background: var(--kiosk-bg-image, linear-gradient(160deg,
    hsl(212 35% 12%) 0%,
    hsl(207 40% 20%) 50%,
    hsl(215 35% 14%) 100%));
  background-size: cover;
  background-position: center;
  color: hsl(0 0% 100%);
}

/* ----- Pantalla "Toque para arrancar" (overlay, estilo turnera) ----- */
.start-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Mismo patrón: si hay imagen custom (--kiosk-start-bg-image) la usa,
     sino cae al azulado semitransparente. */
  background: var(--kiosk-start-bg-image, rgba(13, 20, 33, 0.92));
  background-size: cover;
  background-position: center;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  color: #fff;
  cursor: pointer;
  z-index: 9999;
  user-select: none;
}
/* Pantalla de arranque "limpia" (sin publicidad): fondo claro, sin imagen ni
   desenfoque, logo a color y texto oscuro. Pedido: que no tenga fondo. */
.start-overlay.start-plain {
  background: hsl(var(--background));
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  color: hsl(var(--foreground));
}
.start-overlay.start-plain .start-hint {
  color: hsl(var(--muted-foreground));
}
.start-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  text-align: center;
  padding: 2rem;
}
.start-title {
  font-size: 2.75rem;
  font-weight: 900;
  letter-spacing: -.02em;
}
.start-hint {
  font-size: 1.375rem;
  color: hsl(0 0% 100% / .7);
  animation: pulse-dot 1.8s ease-in-out infinite;
}

/* ----- Carrusel de publicidad en la pantalla de reposo ----- */
.ad-carousel {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;   /* el click siempre lo toma el overlay (arrancar) */
  background: #000;
}
.ad-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .6s ease;
}
.ad-slide.active { opacity: 1; }
.ad-slide img,
.ad-slide video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Velo inferior para que el logo + "Toque para arrancar" se lean sobre la
   publicidad, sin tapar la pieza. */
.start-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to top,
    rgba(9, 14, 24, 0.88) 0%,
    rgba(9, 14, 24, 0.55) 22%,
    rgba(9, 14, 24, 0) 45%);
}
/* Con publicidad, el logo + hint bajan al pie (no tapan la pieza). */
.start-overlay.has-ads {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.start-overlay.has-ads .start-inner {
  position: absolute;
  z-index: 2;
  left: 0; right: 0; bottom: 0;
  justify-content: flex-end;
  padding-bottom: 2.5rem;
  gap: 1rem;
}

.kiosk-wrap { width: 100%; max-width: 42rem; }
.kiosk-wrap.sm { max-width: 32rem; }
.kiosk-wrap.lg { max-width: 48rem; }

.kiosk-stack    { display: flex; flex-direction: column; gap: 2rem;   }
.kiosk-stack-sm { display: flex; flex-direction: column; gap: 1rem;   }
.kiosk-stack-md { display: flex; flex-direction: column; gap: 1.5rem; }

.kiosk-back {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: 1.125rem;
  color: hsl(0 0% 100% / .6);
  transition: color .2s;
  align-self: flex-start;
}
.kiosk-back:hover { color: hsl(0 0% 100% / .8); }

.kiosk-header { text-align: center; display: flex; flex-direction: column; gap: .5rem; align-items: center; }
.kiosk-header.gap-3 { gap: .75rem; }
.kiosk-header.gap-4 { gap: 1rem; }
.kiosk-h1 { font-size: 2.25rem; font-weight: 700; }
.kiosk-h1-lg { font-size: 3rem; font-weight: 900; letter-spacing: -.025em; }
.kiosk-h1-xl { font-size: 3rem; font-weight: 900; }
.kiosk-h2 { font-size: 1.875rem; font-weight: 700; }
.kiosk-lead { font-size: 1.25rem; color: hsl(0 0% 100% / .7); }
.kiosk-sublead { font-size: 1.125rem; color: hsl(0 0% 100% / .6); }
.kiosk-meta { font-size: 1rem; color: hsl(0 0% 100% / .4); }

.kiosk-card {
  border-radius: 1rem;
  padding: 2rem;
  background: hsl(var(--kiosk-card));
  border: 1px solid hsl(210 18% 28%);
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);
}
.kiosk-card.text-center { text-align: center; }
.kiosk-card.selected {
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 2px hsl(var(--primary) / .3),
              0 25px 50px -12px rgb(0 0 0 / .25);
}
.kiosk-card-row {
  display: flex; align-items: center; gap: 1.25rem;
  width: 100%; text-align: left;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.kiosk-card-row:hover { border-color: hsl(var(--primary) / .5); }

.kiosk-deuda-label { color: hsl(0 0% 100% / .92); font-size: 1.125rem; }
.kiosk-deuda-value { font-size: 3rem; font-weight: 900; margin-top: .5rem; }
/* Recuadro blanco del estado de cuenta: bordes blancos bien marcados para que
   se destaque, pensado en gente grande. Contiene TODO (título, datos del
   cliente y saldo). Sin relleno blanco (el texto es blanco), así se lee. */
.account-status-box {
  border: 2px solid hsl(0 0% 100% / .9);
  background: hsl(0 0% 100% / .06);
  box-shadow: 0 0 0 4px hsl(0 0% 100% / .08),
              0 25px 50px -12px rgb(0 0 0 / .35);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
}
.account-status-title { margin: 0 0 .25rem; }
.account-status-box .account-client { align-items: center; margin-top: 0; }
.account-status-sep {
  width: 82%;
  height: 1px;
  background: hsl(0 0% 100% / .25);
  margin: .9rem 0 .5rem;
}

/* Botones tótem */
.kiosk-btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 1rem;
  font-weight: 700; font-size: 1.5rem;
  padding: 1.5rem 3rem;
  background: linear-gradient(135deg, hsl(207 55% 49%) 0%, hsl(207 60% 58%) 100%);
  color: hsl(0 0% 100%);
  box-shadow: 0 4px 20px hsl(207 55% 49% / .4);
  transition: transform .2s, box-shadow .2s;
  width: 100%;
}
.kiosk-btn-primary:hover { transform: scale(1.02); box-shadow: 0 6px 30px hsl(207 55% 49% / .5); }
.kiosk-btn-primary:active { transform: scale(.98); }
.kiosk-btn-primary:disabled { opacity: .8; cursor: not-allowed; transform: none; }

/* "Pagar con QR" con la marca de Mercado Pago: amarillo MP + logo + texto oscuro. */
.kiosk-btn-primary.btn-mp {
  background: #FFE600;        /* amarillo Mercado Pago */
  color: #2c3a8c;            /* azul oscuro para contraste sobre el amarillo */
  box-shadow: 0 4px 20px rgb(0 0 0 / .25);
}
.kiosk-btn-primary.btn-mp:hover { box-shadow: 0 6px 30px rgb(0 0 0 / .3); }
.btn-mp-logo {
  height: 2.4rem;
  width: 2.4rem;
  object-fit: cover;
  margin-right: .75rem;
  border-radius: 50%;   /* el logo trae fondo blanco: lo dejamos como badge circular */
  box-shadow: 0 1px 3px rgb(0 0 0 / .2);
}

.kiosk-btn-secondary {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 1rem;
  font-weight: 600; font-size: 1.25rem;
  padding: 1.25rem 2.5rem;
  background: hsl(var(--kiosk-muted));
  color: hsl(0 0% 92%);
  border: 1px solid hsl(210 18% 35%);
  transition: background .2s;
}
.kiosk-btn-secondary:hover { background: hsl(210 18% 32%); }

.kiosk-btn-success {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 1rem;
  font-weight: 700; font-size: 1.5rem;
  padding: 1.5rem 3rem;
  background: linear-gradient(135deg, hsl(144 38% 36%) 0%, hsl(144 42% 44%) 100%);
  color: hsl(0 0% 100%);
  box-shadow: 0 4px 20px hsl(144 38% 36% / .4);
  transition: transform .2s;
  width: 100%;
}
.kiosk-btn-success:hover { transform: scale(1.02); }

/* Variantes de tamaño */
.btn-w-full { width: 100%; }
.btn-text-lg  { font-size: 1.125rem; padding: 1rem 2rem; }
.btn-text-xl  { font-size: 1.25rem;  padding: 1.25rem 2.5rem; }
.btn-text-2xl { font-size: 1.5rem;   padding: 1.5rem 3rem; }
.btn-text-3xl { font-size: 1.875rem; padding: 1.75rem 3.5rem; }

/* Identify (DNI display + keypad) */
.dni-display {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700;
  font-size: 3rem;
  letter-spacing: .3em;
  min-height: 4.5rem;
  display: flex; align-items: center; justify-content: center;
}
.dni-empty { color: hsl(0 0% 100% / .2); }
.dni-error { color: hsl(var(--destructive)); margin-top: .75rem; font-size: 1.125rem; }

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
  max-width: 30rem;
  width: 100%;
  margin: 0 auto;
}
.keypad .key {
  width: 100%;
  min-height: 0 !important;
  height: 3.25rem;
  padding: 0 !important;
  font-size: 1.5rem;
  font-weight: 700;
  border-radius: .5rem;
  background: hsl(var(--kiosk-card));
  border: 2px solid hsl(210 18% 35%);
  box-shadow: 0 4px 12px rgb(0 0 0 / .25);
  transition: background .15s, transform .1s, border-color .15s;
}
.keypad .key:hover {
  background: hsl(210 18% 26%);
  border-color: hsl(var(--primary) / .6);
}
.keypad .key:active {
  transform: scale(.96);
  background: hsl(var(--primary) / .25);
}

.identify-actions { display: flex; flex-direction: column; gap: 1rem; }
.identify-row { display: flex; gap: 1rem; }
.identify-row > * { flex: 1; }

.identify-hint {
  text-align: center;
  color: hsl(0 0% 100% / .3);
  font-size: .875rem;
}

/* Lista de cuentas (select-account) */
.kiosk-list { display: flex; flex-direction: column; gap: 1.25rem; }

.account-icon-wrap {
  width: 4rem; height: 4rem;
  border-radius: .75rem;
  background: hsl(var(--primary) / .2);
  color: hsl(var(--primary));
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.account-info { flex: 1; }
.account-type { font-size: 1.5rem; font-weight: 700; }
.account-addr { font-size: 1.125rem; color: hsl(0 0% 100% / .6); }
.account-num { font-size: 1rem; color: hsl(0 0% 100% / .4); margin-top: .25rem; }
.account-count { font-size: .875rem; color: hsl(0 0% 100% / .4); }
.account-saldo-label { font-size: .8rem; color: hsl(0 0% 100% / .45); }
.account-saldo { font-size: 1.375rem; font-weight: 700; white-space: nowrap; }

/* Lista de facturas (account-detail) */
.invoice-list { display: flex; flex-direction: column; gap: .75rem; }

.invoice-check {
  width: 2rem; height: 2rem;
  border-radius: .5rem;
  border: 2px solid hsl(0 0% 100% / .3);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .2s, border-color .2s;
}
.invoice-check.checked {
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
  color: hsl(0 0% 100%);
}
.invoice-period { font-size: 1.25rem; font-weight: 600; }
.invoice-due { color: hsl(0 0% 100% / .5); }
.invoice-amount { font-size: 1.5rem; font-weight: 700; }
.invoice-vencida {
  display: inline-flex; align-items: center; gap: .25rem;
  color: hsl(var(--kiosk-warning));
  font-size: .875rem;
}
.invoice-amount-wrap { text-align: right; }
.invoice-row-flex { flex: 1; }

/* Saldo fijo arriba del listado de facturas */
.invoice-summary {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
}
.invoice-summary-value { font-size: 2rem; font-weight: 900; white-space: nowrap; }

/* La lista scrollea dentro de su propio recuadro: la página no se alarga */
.invoice-scroll {
  overflow-y: auto;
  max-height: 46vh;
  padding-right: .25rem;
  -webkit-overflow-scrolling: touch;
}
.invoice-scroll::-webkit-scrollbar { width: 8px; }
.invoice-scroll::-webkit-scrollbar-thumb {
  background: hsl(0 0% 100% / .18); border-radius: 8px;
}
.invoice-status { padding: 1rem 0 .25rem; text-align: center; }
.invoice-loading {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  color: hsl(0 0% 100% / .6);
}
.invoice-empty { color: hsl(0 0% 100% / .45); padding: .5rem 0; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* QR Mercado Pago */
.qr-wrap {
  background: white;
  padding: 1rem;
  border-radius: 1rem;
  display: inline-block;
  box-shadow: 0 8px 24px rgb(0 0 0 / .35);
}
.qr-wrap canvas {
  display: block;
}

/* Confirm */
.confirm-summary { display: flex; flex-direction: column; gap: 1.25rem; }
.confirm-row {
  display: flex; justify-content: space-between; font-size: 1.125rem;
}
.confirm-row .lbl { color: hsl(0 0% 100% / .6); }
.confirm-row .val { font-weight: 600; }
.confirm-divider { border: 0; border-top: 1px solid hsl(var(--kiosk-muted)); }
.confirm-total {
  display: flex; justify-content: space-between;
  font-size: 1.5rem; font-weight: 700;
}
.confirm-total .accent { color: hsl(var(--kiosk-accent)); }

.confirm-info {
  display: flex; align-items: center; gap: 1rem; font-size: 1.125rem;
  color: hsl(0 0% 100% / .7);
}
.confirm-info .icon-wrap { color: hsl(var(--primary)); flex-shrink: 0; }

/* Processing */
.processing-wrap {
  text-align: center;
  display: flex; flex-direction: column; gap: 2.5rem; align-items: center;
}

/* Badge limpio para "imprimiendo" — sin anillo giratorio (se veía roto).
   La actividad la da el pulse del badge + los processing-dots de abajo. */
.print-badge {
  width: 7rem;
  height: 7rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: hsl(var(--primary) / .15);
  color: hsl(var(--primary));
  animation: pulse-dot 1.8s ease-in-out infinite;
}
/* Badge limpio para "Insertá tu tarjeta" — sin el anillo giratorio, que se veía
   como un círculo roto (mismo criterio que el badge de "imprimiendo"). La
   actividad la dan los processing-dots de abajo. */
.processing-icon {
  position: relative;
  width: 8rem; height: 8rem;
  border-radius: 9999px;
  display: flex; align-items: center; justify-content: center;
  background: hsl(var(--primary) / .15);
  animation: pulse-dot 1.8s ease-in-out infinite;
}
.processing-card-icon {
  display: flex; align-items: center; justify-content: center;
  color: hsl(var(--primary));
}

.processing-dots { display: flex; justify-content: center; gap: .75rem; }
.processing-dots .dot {
  width: 1rem; height: 1rem; border-radius: 9999px;
  background: hsl(var(--primary));
  opacity: .3;
  animation: pulse-dot 1.2s ease-in-out infinite;
}
.processing-dots .dot:nth-child(2) { animation-delay: .4s; }
.processing-dots .dot:nth-child(3) { animation-delay: .8s; }

/* Success */
.success-icon { color: hsl(var(--kiosk-accent)); }
.success-summary { display: flex; flex-direction: column; gap: 1rem; text-align: left; font-size: 1.25rem; }
.success-row { display: flex; justify-content: space-between; }
.success-row .lbl { color: hsl(0 0% 100% / .6); }
.success-row .val { font-weight: 600; }
.success-row .val.accent {
  color: hsl(var(--kiosk-accent));
  font-weight: 700;
  font-size: 1.5rem;
}
.success-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
}

/* Survey */
.survey-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem;
}
.survey-card {
  display: flex; flex-direction: column; align-items: center; gap: .75rem;
  padding: 2rem; cursor: pointer;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.survey-card:hover { transform: scale(1.05); }
.survey-emoji { font-size: 4rem; line-height: 1; }
.survey-label { font-size: 1.5rem; font-weight: 600; }

/* Welcome (extra) */
.welcome-wrap {
  text-align: center;
  display: flex; flex-direction: column; gap: 2.5rem; align-items: center;
  width: 100%;
}
.welcome-logo {
  display: inline-flex; align-items: center; gap: .75rem;
  margin-bottom: 1rem;
}
.welcome-logo-box {
  width: 4rem; height: 4rem; border-radius: 1rem;
  background: hsl(var(--primary));
  display: flex; align-items: center; justify-content: center;
  color: hsl(0 0% 100%);
}
.welcome-title {
  font-size: 3rem; font-weight: 900; letter-spacing: -.025em;
}
.welcome-subtitle {
  font-size: 1.25rem; color: hsl(0 0% 100% / .6);
}
.welcome-message { display: flex; flex-direction: column; gap: 1rem; }
.welcome-buttons { display: flex; flex-direction: column; gap: 1.25rem; }
.welcome-footer {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  color: hsl(0 0% 100% / .4); font-size: 1.125rem;
}

/* Barra de marca superior del tótem (logo SS Servicios arriba de la pantalla).
   Pedido en el mapa de interfaz: estado de cuenta, confirmar, QR y error. */
.kiosk-brandbar {
  display: flex; justify-content: center; align-items: center;
  width: 100%;
  margin-bottom: .25rem;
}
.kiosk-brandbar .brand-logo-h { height: 4rem; margin: 0; }  /* logo más grande para que destaque */

/* Datos del cliente bajo "Estado de cuenta" — en blanco y más grandes para
   que se lean de lejos (nº de cliente, nombre y domicilio). */
.account-client { display: flex; flex-direction: column; gap: .35rem; margin-top: .25rem; }
/* Letras en blanco (pedido explícito del mapa de interfaz para esta pantalla). */
.account-client-line { font-size: 1.375rem; color: hsl(0 0% 100%); }
.account-client-name { font-size: 1.75rem; font-weight: 700; color: hsl(0 0% 100%); }
.account-client-addr { font-size: 1.25rem; color: hsl(0 0% 100%); }

/* Slogan / título del welcome — ampliados (pedido "agrandar" / "ampliar"). */
.welcome-slogan { font-size: 1.375rem; }
.welcome-h2 { font-size: 2.5rem; }
.welcome-lead { font-size: 1.5rem; }

/* Total destacado en la pantalla del QR. */
.qr-total { font-size: 2.25rem; font-weight: 900; color: hsl(0 0% 100%); }

/* =========================================================
   ADMIN
   ========================================================= */
.admin-login-screen {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: hsl(var(--muted));
  padding: 1rem;
}
.admin-login-card {
  width: 100%; max-width: 28rem;
  background: hsl(var(--card));
  border-radius: 1rem;
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);
  padding: 2rem;
  display: flex; flex-direction: column; gap: 1.5rem;
  border: 1px solid hsl(var(--border));
}
.admin-login-header { text-align: center; display: flex; flex-direction: column; gap: .5rem; align-items: center; }
.admin-login-logo {
  width: 3.5rem; height: 3.5rem; border-radius: .75rem;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  display: flex; align-items: center; justify-content: center;
}
.admin-login-title { font-size: 1.5rem; font-weight: 700; color: hsl(var(--card-foreground)); }
.admin-login-subtitle { color: hsl(var(--muted-foreground)); }

.admin-login-form { display: flex; flex-direction: column; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: .5rem; }
.field label { font-size: .875rem; font-weight: 500; color: hsl(var(--card-foreground)); }
.field-with-icon { position: relative; }
.field-with-icon .field-icon {
  position: absolute; left: .75rem; top: 50%; transform: translateY(-50%);
  color: hsl(var(--muted-foreground));
  pointer-events: none;
}
.field-with-icon input { padding-left: 2.5rem; }

.input {
  width: 100%;
  padding: .75rem 1rem;
  border-radius: .5rem;
  border: 1px solid hsl(var(--input));
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  outline: none;
  transition: box-shadow .15s;
}
.input:focus { box-shadow: 0 0 0 2px hsl(var(--ring)); }

.btn-primary-solid {
  width: 100%;
  padding: .75rem 1rem;
  border-radius: .5rem;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  font-weight: 600;
  transition: background .15s;
}
.btn-primary-solid:hover { background: hsl(var(--primary) / .9); }

.admin-login-hint { text-align: center; font-size: .875rem; color: hsl(var(--muted-foreground)); }
.admin-login-forgot {
  color: hsl(var(--primary));
  text-decoration: none;
  font-weight: 500;
}
.admin-login-forgot:hover { text-decoration: underline; }
.admin-login-error {
  background: hsl(0 84% 96%);
  border: 1px solid hsl(0 84% 75%);
  color: hsl(0 70% 40%);
  border-radius: .5rem;
  padding: .625rem .875rem;
  font-size: .875rem;
}

/* Layout admin */
.admin-layout {
  min-height: 100vh;
  display: flex;
  background: hsl(var(--muted));
}
.admin-sidebar {
  width: 16rem;
  background: hsl(var(--card));
  border-right: 1px solid hsl(var(--border));
  display: flex; flex-direction: column;
  flex-shrink: 0;
}
.admin-sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid hsl(var(--border));
}
.admin-sidebar-brand {
  display: flex; align-items: center; gap: .75rem;
}
.admin-brand-logo {
  width: 2.5rem; height: 2.5rem; border-radius: .5rem;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  display: flex; align-items: center; justify-content: center;
}
.admin-brand-name { font-weight: 700; color: hsl(var(--card-foreground)); }
.admin-brand-role { font-size: .75rem; color: hsl(var(--muted-foreground)); }

.admin-nav {
  flex: 1;
  padding: 1rem;
  display: flex; flex-direction: column; gap: .25rem;
}
.admin-nav-link {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1rem;
  border-radius: .5rem;
  font-size: .875rem; font-weight: 500;
  color: hsl(var(--muted-foreground));
  transition: background .15s, color .15s;
  cursor: pointer;
  border: 0;
  width: 100%;
  text-align: left;
}
.admin-nav-link:hover {
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
}
.admin-nav-link.active {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.admin-sidebar-footer {
  padding: 1rem;
  border-top: 1px solid hsl(var(--border));
  display: flex; flex-direction: column; gap: .5rem;
}
.admin-nav-link.danger { color: hsl(var(--destructive)); }
.admin-nav-link.danger:hover { background: hsl(var(--destructive) / .1); color: hsl(var(--destructive)); }

.admin-main {
  flex: 1;
  padding: 2rem;
  overflow: auto;
}

.admin-page-header { display: flex; flex-direction: column; gap: .25rem; }
.admin-page-header h1 { font-size: 1.875rem; font-weight: 700; color: hsl(var(--foreground)); }
.admin-page-header p  { color: hsl(var(--muted-foreground)); }

.admin-page { display: flex; flex-direction: column; gap: 2rem; }
.admin-page.gap-6 { gap: 1.5rem; }

/* Personalización — fondos del tótem */
.branding-wrap {
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
  min-height: calc(100vh - 4rem);
  display: flex;
  flex-direction: column;
}
.branding-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  justify-content: center;
}

.branding-item {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 1rem;
  padding: 1.75rem;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.branding-item:hover {
  border-color: hsl(var(--primary) / .45);
  box-shadow: 0 6px 22px hsl(215 25% 14% / .07);
}

/* Mockup del tótem (vertical 9:16) como preview del fondo */
.branding-device {
  flex: 0 0 auto;
  height: clamp(210px, 32vh, 340px);
  width: auto;
  aspect-ratio: 9 / 16;
  background: hsl(215 28% 12%);
  border-radius: 1.25rem;
  padding: 7px;
  box-shadow: 0 8px 22px hsl(215 25% 14% / .24);
  align-self: center;
}
.branding-device-screen {
  position: relative;
  width: 100%; height: 100%;
  border-radius: .7rem;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-color: hsl(var(--muted));
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: .4rem;
  color: hsl(var(--muted-foreground));
  font-size: .72rem;
  text-align: center;
}
/* Imagen/video que llena la "pantalla" del mockup (branding y publicidad). */
.branding-device-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
}
.branding-device-screen video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}

.branding-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.branding-title { margin: 0; font-size: 1.2rem; font-weight: 600; color: hsl(var(--foreground)); }
.branding-desc { margin: .35rem 0 0; font-size: .9rem; color: hsl(var(--muted-foreground)); line-height: 1.5; }

/* Zona de drag & drop */
.branding-drop {
  margin-top: 1rem;
  border: 1.5px dashed hsl(var(--border));
  border-radius: .85rem;
  padding: .9rem 1rem;
  display: flex; align-items: center; gap: .85rem;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  color: hsl(var(--muted-foreground));
}
.branding-drop:hover, .branding-drop.dragover {
  border-color: hsl(var(--primary));
  background: hsl(var(--primary) / .05);
}
.branding-drop > i { color: hsl(var(--primary)); flex-shrink: 0; }
.branding-drop.has-file {
  border-style: solid;
  border-color: hsl(var(--accent));
  background: hsl(var(--accent) / .06);
  color: hsl(var(--foreground));
}
.branding-drop.has-file > i { color: hsl(var(--accent)); }
.branding-drop-main { font-size: .85rem; font-weight: 500; word-break: break-word; }
.branding-drop-hint { font-size: .75rem; color: hsl(var(--muted-foreground)); margin-top: .1rem; }

.branding-foot { margin-top: 1rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.branding-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .55rem 1.15rem; border-radius: .6rem;
  font-weight: 600; font-size: .875rem;
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
  transition: background .15s, opacity .15s;
}
.branding-btn:hover { background: hsl(var(--primary) / .9); }
.branding-btn-ghost {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .55rem .9rem; border-radius: .6rem;
  font-weight: 500; font-size: .85rem;
  background: transparent; color: hsl(var(--muted-foreground));
  transition: background .15s, color .15s;
}
.branding-btn-ghost:hover { color: hsl(var(--destructive)); background: hsl(var(--destructive) / .09); }
.branding-msg { font-size: .8rem; margin-top: .75rem; }

/* ----- Admin · Publicidad — galería de piezas (mismo lenguaje que branding) ----- */
.ads-gallery-wrap { margin-top: 2.5rem; }
.ads-section-title {
  margin: 0 0 .25rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}
.ads-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1.5rem;
  align-items: start;
}
.ad-piece {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: .65rem;
  transition: opacity .15s, transform .15s;
  cursor: grab;
}
.ad-piece:active { cursor: grabbing; }
.ad-piece.inactive { opacity: .55; }
/* Mientras se arrastra: la pieza queda tenue y el resto se corre para mostrar el hueco. */
.ad-piece.dragging { opacity: .35; cursor: grabbing; }
/* Número de posición en el carrusel (1, 2, 3…), bien visible arriba de cada pieza. */
.ad-order-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem;
  border-radius: 9999px;
  font-size: 1.05rem; font-weight: 700; line-height: 1;
  background: hsl(var(--accent)); color: hsl(var(--accent-foreground, 0 0% 100%));
  box-shadow: 0 1px 3px hsl(0 0% 0% / .18);
}
.ad-piece.inactive .ad-order-num { background: hsl(var(--muted-foreground)); }
/* Reusa el mockup del tótem (.branding-device) pero más chico para la grilla. */
.ad-piece-device {
  height: 220px;
  width: auto;
  align-self: center;
}
.ad-type-badge {
  position: absolute; top: .4rem; left: .4rem; z-index: 1;
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .18rem .45rem;
  border-radius: 9999px;
  font-size: .68rem; font-weight: 600;
  background: hsl(215 28% 12% / .82); color: #fff;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.ad-inactive-badge {
  position: absolute; top: .4rem; right: .4rem; z-index: 1;
  padding: .18rem .45rem;
  border-radius: 9999px;
  font-size: .68rem; font-weight: 600;
  background: hsl(0 0% 0% / .6); color: hsl(0 0% 100% / .9);
}
.ad-piece-actions { display: flex; align-items: center; gap: .35rem; }
.ad-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem;
  border-radius: .5rem;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  color: hsl(var(--muted-foreground));
  transition: background .15s, color .15s, border-color .15s;
}
.ad-btn:hover:not(:disabled) { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.ad-btn:disabled { opacity: .35; cursor: not-allowed; }
.ad-btn.on { color: hsl(var(--accent)); border-color: hsl(var(--accent) / .5); }
.ad-btn.danger:hover:not(:disabled) { background: hsl(var(--destructive) / .1); color: hsl(var(--destructive)); border-color: hsl(var(--destructive) / .4); }

@media (max-width: 560px) {
  .branding-wrap { min-height: 0; }
  .branding-list { justify-content: flex-start; }
  .branding-item { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .branding-device { height: auto; width: 120px; align-self: flex-start; }
}

.admin-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem;
}

.admin-stat-card {
  border-radius: .75rem;
  padding: 1.5rem;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1.25rem;
}
@media (min-width: 640px) {
  .admin-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-stats-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .admin-stats-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.stat-icon-wrap {
  width: 3rem; height: 3rem;
  border-radius: .75rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: hsl(var(--primary-foreground));
}
.stat-icon-wrap.bg-primary  { background: hsl(var(--primary)); }
.stat-icon-wrap.bg-accent   { background: hsl(var(--accent)); }
.stat-icon-wrap.bg-warning  { background: hsl(var(--kiosk-warning)); }

.stat-card-flex { display: flex; align-items: center; gap: 1rem; }
.stat-value { font-size: 1.5rem; font-weight: 700; color: hsl(var(--card-foreground)); }
.stat-label { font-size: .875rem; color: hsl(var(--muted-foreground)); }

.charts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 1024px) {
  .charts-grid { grid-template-columns: 1fr 1fr; }
}

.chart-title {
  font-weight: 600;
  color: hsl(var(--card-foreground));
  margin-bottom: 1rem;
}

.chart-box {
  width: 100%;
  height: 250px;
  position: relative;
}
.chart-box.h-300 { height: 300px; }

/* Tablas */
.table-wrap { overflow-x: auto; }
.admin-table {
  width: 100%;
  font-size: .875rem;
  border-collapse: collapse;
}
.admin-table thead tr { border-bottom: 1px solid hsl(var(--border)); }
.admin-table th {
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  padding: .75rem 1rem;
  text-align: left;
}
.admin-table th.right { text-align: right; }
.admin-table th.center { text-align: center; }
.admin-table tbody tr {
  border-bottom: 1px solid hsl(var(--border) / .5);
  transition: background .15s;
}
.admin-table tbody tr:hover { background: hsl(var(--muted) / .5); }
.admin-table td {
  padding: .75rem 1rem;
  color: hsl(var(--card-foreground));
}
.admin-table td.right { text-align: right; font-weight: 600; }
.admin-table td.center { text-align: center; }
.admin-table td.muted { color: hsl(var(--muted-foreground)); }
.admin-table td.mono-xs {
  color: hsl(var(--muted-foreground));
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .75rem;
}
.admin-table td.semibold { font-weight: 500; }

/* Status badges */
.badge {
  display: inline-block;
  padding: .25rem .5rem;
  border-radius: 9999px;
  font-size: .75rem;
  font-weight: 500;
}
.badge.success { background: hsl(var(--accent) / .1); color: hsl(var(--accent)); }
.badge.danger  { background: hsl(var(--destructive) / .1); color: hsl(var(--destructive)); }
.badge.warning { background: hsl(45 93% 47% / .12); color: hsl(38 92% 50%); }

/* Aviso de inactividad (cuenta regresiva antes de cerrar la sesión del tótem) */
.idle-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: hsl(0 0% 0% / .7);
  display: flex; align-items: center; justify-content: center;
  padding: 2rem;
}
.idle-card {
  background: hsl(var(--kiosk-card));
  border: 1px solid hsl(210 18% 28%);
  border-radius: 1.25rem;
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / .4);
  padding: 2.5rem;
  max-width: 440px; width: 100%;
  text-align: center;
  color: hsl(0 0% 100%);   /* el overlay va sobre el body (texto oscuro): forzamos blanco */
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
}

.inline-status {
  display: inline-flex; align-items: center; gap: .25rem;
  font-size: .75rem; font-weight: 500;
}
.inline-status.success { color: hsl(var(--accent)); }
.inline-status.warning { color: hsl(var(--kiosk-warning)); }

/* Filters */
.admin-filters {
  display: flex; gap: .75rem; flex-wrap: wrap;
  align-items: center;          /* todo alineado verticalmente al centro */
  justify-content: center;      /* cluster centrado dentro de la tarjeta */
}
.admin-filters .search-wrap {
  position: relative;
  flex: 0 1 340px;              /* no se come todo el ancho */
  min-width: 220px;
}
.admin-filters .search-wrap .search-icon {
  position: absolute; left: .75rem; top: 50%; transform: translateY(-50%);
  color: hsl(var(--muted-foreground)); pointer-events: none;
}
/* Misma altura para todos los controles de la barra de filtros */
.admin-filters .admin-input,
.admin-filters .admin-btn-primary {
  height: 2.5rem;
}
.admin-filters .admin-btn-primary { white-space: nowrap; }
/* Rango de fechas (Operaciones): label en línea, mismo alto que el resto */
.op-date-range { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.op-date-range label {
  display: flex; align-items: center; gap: .4rem;
  font-size: .8rem; font-weight: 500; color: hsl(var(--muted-foreground));
  white-space: nowrap;
}
.op-date-range .admin-input { font-size: .875rem; width: auto; }
.admin-input {
  width: 100%;
  padding: .625rem 1rem;
  border-radius: .5rem;
  border: 1px solid hsl(var(--input));
  background: hsl(var(--card));
  color: hsl(var(--card-foreground));
  outline: none;
  font-size: .875rem;
}
.admin-input:focus { box-shadow: 0 0 0 2px hsl(var(--ring)); }
.admin-input.with-icon { padding-left: 2.5rem; }

.admin-btn-primary {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .5rem 1rem;
  border-radius: .5rem;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  font-size: .875rem; font-weight: 500;
  transition: background .15s;
}
.admin-btn-primary:hover { background: hsl(var(--primary) / .9); }

.admin-empty {
  text-align: center;
  padding: 2rem 0;
  color: hsl(var(--muted-foreground));
}

/* Conversion grid */
.conv-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: .75rem;
}
.conv-cell { text-align: center; }
.conv-square {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: .75rem;
  background: hsl(var(--muted));
  display: flex; align-items: center; justify-content: center;
  margin-bottom: .5rem;
}
.conv-pct {
  font-size: 1.5rem;
  font-weight: 700;
  color: hsl(var(--card-foreground));
}
.conv-day { font-size: .875rem; color: hsl(var(--muted-foreground)); }

/* 404 */
.notfound {
  display: flex; min-height: 100vh; align-items: center; justify-content: center;
  background: hsl(var(--muted));
  text-align: center;
}
.notfound h1 { font-size: 2.25rem; font-weight: 700; margin-bottom: 1rem; }
.notfound p  { font-size: 1.25rem; color: hsl(var(--muted-foreground)); margin-bottom: 1rem; }
.notfound a  { color: hsl(var(--primary)); text-decoration: underline; }
.notfound a:hover { color: hsl(var(--primary) / .9); }

/* =========================================================
   Animaciones
   ========================================================= */
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px hsl(207 55% 49% / .35); }
  50%      { box-shadow: 0 0 40px hsl(207 55% 49% / .65); }
}
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes pulse-dot {
  0%, 100% { opacity: .3; transform: scale(1); }
  50%      { opacity: 1;  transform: scale(1.3); }
}

.animate-pulse-glow { animation: pulse-glow 2s ease-in-out infinite; }
.animate-spin-slow  { animation: spin-slow 1.5s linear infinite; }

/* Spinner mini para botón Continuar */
.spinner-mini {
  width: 1.5rem; height: 1.5rem;
  border: 3px solid hsl(0 0% 100% / .3);
  border-top-color: hsl(0 0% 100%);
  border-radius: 9999px;
  animation: spin-slow 1.5s linear infinite;
}
.spinner-row { display: inline-flex; align-items: center; gap: .75rem; }

/* Spinner grande para pantallas de carga (renderLoading) */
.spinner-lg {
  width: 4rem; height: 4rem;
  border: 5px solid hsl(var(--primary) / .2);
  border-top-color: hsl(var(--primary));
  border-radius: 9999px;
  animation: spin-slow 1s linear infinite;
}

/* Utilidades genéricas mínimas usadas en markup */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: .25rem; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }
.gap-4 { gap: 1rem; }
.text-center { text-align: center; }
.mr-2 { margin-right: .5rem; }
.mr-3 { margin-right: .75rem; }

/* Responsive: admin sidebar colapsable en pantallas chicas */
@media (max-width: 768px) {
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; }
  .admin-sidebar-header { flex: 1 1 100%; }
  .admin-nav { flex-direction: row; flex-wrap: wrap; flex: 1 1 100%; }
  .admin-sidebar-footer { flex-direction: row; flex: 1 1 100%; }
  .admin-main { padding: 1rem; }
}

/* =========================================================
 * TOTEM 720x1280 (portrait estrecho)
 * Overrides solo para el flujo /kiosk/* (.kiosk-screen)
 * Se activa cuando el viewport es portrait y angosto.
 * En desktop/landscape (admin, stats, login) NO se aplica.
 * ========================================================= */
@media (orientation: portrait) and (max-width: 800px) {

  /* ----- Layout base ----- */
  .kiosk-screen {
    padding: 1.25rem 1rem;
    justify-content: center;    /* contenido centrado vertical, aprovecha los 1280px */
  }
  .kiosk-wrap,
  .kiosk-wrap.sm,
  .kiosk-wrap.lg { max-width: 100%; }

  .kiosk-stack    { gap: 1.5rem; }
  .kiosk-stack-md { gap: 1.25rem; }
  .kiosk-stack-sm { gap: .75rem; }

  /* ----- Tipografía (ampliada: aprovechar el alto del tótem 1280px) ----- */
  .kiosk-h1     { font-size: 2.25rem; }
  .kiosk-h1-lg  { font-size: 2.75rem; line-height: 1.12; }
  .kiosk-h1-xl  { font-size: 2.75rem; line-height: 1.12; }
  .kiosk-h2     { font-size: 1.875rem; }
  .kiosk-lead    { font-size: 1.375rem; line-height: 1.45; }
  .kiosk-sublead { font-size: 1.125rem; }
  .kiosk-meta    { font-size: 1rem; }

  /* Welcome: slogan/título/lead ampliados y menos apretados */
  .welcome-slogan { font-size: 1.375rem; }
  .welcome-h2     { font-size: 2.5rem; }
  .welcome-lead   { font-size: 1.625rem; }
  .welcome-subtitle { font-size: 1.375rem; }

  /* Bienvenida: repartir el contenido en TODO el alto del tótem (no un cluster
     centrado y chico). El wrap crece y distribuye logo / mensaje / botones con
     aire parejo, aprovechando los 1280px. */
  .welcome-screen .kiosk-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
  }
  .welcome-wrap {
    flex: 1;
    justify-content: space-evenly;
    padding: 1rem 0;
  }

  /* Estado de cuenta: datos del cliente grandes y en blanco (gente grande) */
  .account-status-title { font-size: 2.6rem; }
  .account-client-line { font-size: 1.5rem; }
  .account-client-name { font-size: 2.1rem; }
  .account-client-addr { font-size: 1.25rem; }
  .qr-total { font-size: 2rem; }

  /* ----- Botones: barras más finas (menos alto) y letras más grandes -----
     Pedido repetido en el mapa de interfaz: "achicar barras, ampliar letras". */
  .kiosk-btn-primary,
  .kiosk-btn-success,
  .kiosk-btn-secondary {
    width: 100%;
    max-width: 27rem;          /* anchos más chicos (pedido del mapa de interfaz) */
    margin-left: auto;
    margin-right: auto;
    align-self: center;        /* centra el botón cuando el contenedor es flex */
    padding: .85rem 1.5rem;    /* alto como estaba */
    font-size: 1.5rem;
    border-radius: .85rem;
  }
  .btn-text-lg  { font-size: 1.375rem; padding: .75rem 1.25rem;  }
  .btn-text-xl  { font-size: 1.5rem;   padding: .85rem 1.5rem;   }
  .btn-text-2xl { font-size: 1.625rem; padding: .9rem 1.5rem;    }
  .btn-text-3xl { font-size: 1.75rem;  padding: 1rem 1.5rem;     }

  /* ----- Keypad (tótem): números más grandes y aprovechando el ancho ----- */
  .keypad {
    max-width: 25rem;
    gap: .85rem;
  }
  .keypad .key {
    height: 4.25rem !important;
    min-height: 0 !important;
    padding: 0 !important;
    font-size: 2rem;
    border-radius: .6rem;
  }

  /* ----- Iconos (los más grandes comen demasiado vertical) ----- */
  .kiosk-screen .icon-24 { width: 5rem;    height: 5rem;    }
  .kiosk-screen .icon-16 { width: 3.25rem; height: 3.25rem; }
  .kiosk-screen .icon-14 { width: 3rem;    height: 3rem;    }
  .kiosk-screen .brand-mark.size-16 { width: 3.25rem; height: 3.25rem; }
  .kiosk-screen .brand-mark.size-14 { width: 3rem;    height: 3rem;    }

  /* ----- Card de monto/deuda (DNI lookup) ----- */
  .kiosk-deuda-value { font-size: 3.4rem; }
  .kiosk-deuda-label { font-size: 1.6rem; }
  .kiosk-card { padding: 1.25rem; }

  /* ----- DNI input ----- */
  .dni-display { font-size: 2.625rem; }
  .dni-error   { font-size: 1rem; }

  /* ----- Pantalla de ingreso de DNI: aprovechar el alto (no tan centrado) -----
     Reparte el contenido en toda la altura del tótem con más aire vertical. */
  .identify-screen .kiosk-stack {
    gap: 2.5rem;
    min-height: calc(100vh - 2.5rem);
    justify-content: center;
  }
  .identify-screen .keypad { margin-top: .5rem; margin-bottom: .5rem; }

  /* ----- Account list ----- */
  .account-icon-wrap { width: 3rem; height: 3rem; }
  .account-type { font-size: 1.25rem; }
  .account-addr { font-size: .95rem; }
  .account-num  { font-size: .85rem; }

  /* ----- Invoice list ----- */
  .invoice-period { font-size: 1.125rem; }
  .invoice-due    { font-size: .875rem; }
  .invoice-amount { font-size: 1.25rem; }

  /* ----- Confirm: label y value apilados para no pelear el ancho ----- */
  .confirm-summary { gap: 1rem; }
  .confirm-row {
    flex-direction: column;
    align-items: flex-start;
    gap: .15rem;
  }
  .confirm-row .lbl { font-size: 1.125rem; }
  .confirm-row .val { font-size: 1.375rem; }
  .confirm-total          { font-size: 1.5rem; }
  .confirm-total .accent  { font-size: 1.875rem; }
  .confirm-info           { font-size: .95rem; padding: 1rem; gap: .75rem; }

  /* ----- Success ----- */
  .success-summary { font-size: 1.05rem; gap: .75rem; }
  .success-row .lbl       { font-size: .9rem; }
  .success-row .val       { font-size: 1rem; }
  .success-row .val.accent { font-size: 1.25rem; }
  .success-actions { grid-template-columns: 1fr; }

  /* ----- Survey (encuesta de satisfacción) ----- */
  .survey-grid { gap: .875rem; }
  .survey-card { padding: 1.25rem .75rem; }
  .survey-emoji { font-size: 3rem; }
  .survey-label { font-size: 1.125rem; }

  /* ----- QR ----- */
  .qr-wrap {
    padding: 1rem;
  }
  .qr-wrap img,
  .qr-wrap canvas {
    width: 100%;
    max-width: 320px;
    height: auto;
    display: block;
    margin: 0 auto;
  }

  /* ----- Processing (procesando pago / imprimiendo) ----- */
  .processing-wrap     { gap: 1.5rem; }
  .processing-icon     { width: 5rem;  height: 5rem;  }
  .processing-card-icon { width: 4rem; height: 4rem; }

  /* ----- Botón de volver (más grande, pedido en el mapa de interfaz) ----- */
  .kiosk-back { font-size: 1.5rem; gap: .6rem; color: hsl(0 0% 100% / .85); }
  .kiosk-back .svg-icon { width: 2rem; height: 2rem; }

  /* ----- Inputs de teclado virtual ----- */
  input,
  select,
  textarea {
    font-size: 1.125rem;   /* >= 16px para que Android no haga zoom al focusear */
  }
}
