/* main.css — sistema de diseño, base, marco de la aplicación e ingreso.

   El diseño replica el panel de CPE Service (api-sunat-descarga/apps/panel), que a su vez
   sigue el sistema de diseño de Kodevo: mismas superficies, tipografía, radios, pesos y
   proporciones. El único cambio de identidad es el color primario: #F48C06.

   Los colores de la referencia están en oklch; aquí van convertidos a hex con el mismo
   resultado, para que el sistema se vea igual en tablets y navegadores antiguos.
   Las variantes del primario (suave, fuerte, acento) se calcularon con la misma
   luminosidad y croma que las de la referencia, cambiando solo el matiz. */

@font-face {
  font-family: "IBM Plex Sans Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 700;
  src: url("../fonts/ibm-plex-sans-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 700;
  src: url("../fonts/ibm-plex-sans-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url("../fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2");
}

/* ---------- Tokens: tema claro ---------- */

:root {
  /* Color primario del sistema. Cambiarlo aquí lo cambia en todo el sistema. */
  --primary: #f48c06;
  --primary-hover: var(--primary);          /* primario al 90 %, sobre el fondo */
  --primary-foreground: #ffffff;
  --brand-soft: #fff6ef;
  --brand-strong: #8a4c00;           /* el primario cuando hace de texto: 6.6:1 */

  /* En claro, página, tarjeta, diálogo y sidebar son el mismo color; las separa la sombra. */
  --background: #fbfeff;
  --foreground: #08181d;
  --card: #fbfeff;
  --popover: #fbfeff;
  --secondary: #fafdfe;
  --secondary-foreground: #0d3944;
  --muted: #fafdfe;
  --muted-foreground: #5c7077;
  --accent: #feefe4;
  --accent-foreground: #703d00;

  --destructive: #ff5f73;
  --destructive-foreground: #ffffff;
  --destructive-strong: #ff5f73;
  --success: #1af788;
  --success-foreground: #00220d;
  --success-strong: #02713a;
  --warning: #ffb703;
  --warning-foreground: #261800;
  --warning-strong: #7a5602;
  --info: #3fa1ef;
  --info-strong: #1f5f99;

  --border: #e1eaed;
  --input: #d9e4e7;
  /* Sin líneas en todo el sistema: lo que antes marcaba un borde (campos, botones, mesas libres)
     se distingue con este relleno suave. */
  --campo: #eef3f5;
  /* Borde de los campos de texto y selects: delgado, para que se note dónde se escribe. */
  --borde-campo: #cdd8dc;
  --campo-hover: #e4ecef;

  /* Sin fondo de hover en todo el sistema: pasar el cursor no cambia el color de nada.
     Lo que se puede pulsar se reconoce por el cursor de mano; con teclado, por el contorno de foco. */
  --hover: transparent;
  --hover-campo: var(--campo);

  /* Series de los gráficos. La 1 es el primario. El orden es fijo y está validado para daltonismo
     (vecinos ΔE >= 15) y contraste en claro y en oscuro: no se cambia un color sin volver a validar. */
  --serie-1: #f48c06;
  --serie-1-suave: #f7c295;
  --serie-2: #2a78d6;
  --serie-3: #1baf7a;
  --serie-4: #4a3aa7;
  --serie-5: #e87ba4;
  --ring: #f48c06;
  --overlay: rgba(8, 24, 29, 0.14);

  --sidebar: #fbfeff;
  --sidebar-foreground: #22363d;
  --sidebar-accent-foreground: #703d00;
  /* Hover de la barra lateral: apenas un matiz, para no competir con el ítem activo. */
  --sidebar-hover: var(--hover);
  --sidebar-border: #dee9ec;

  --sombra-tarjeta: 0 1px 2px -1px rgba(8, 24, 29, 0.07), 0 4px 12px -6px rgba(8, 24, 29, 0.1);
  --sombra-elevada: 0 2px 4px -2px rgba(8, 24, 29, 0.08), 0 12px 24px -12px rgba(8, 24, 29, 0.14), 0 32px 64px -32px rgba(8, 24, 29, 0.18);

  --radio: 0.7rem;
  --radio-md: calc(var(--radio) - 2px);
  --radio-sm: calc(var(--radio) - 4px);
  --radio-xl: calc(var(--radio) + 4px);

  --riel: 16rem;
  --riel-icono: 3rem;
  --riel-movil: 18rem;
  --celda: 60px;
  --control: 2.25rem;                /* alto de botones y campos: h-9 */

  --fuente: "IBM Plex Sans Variable", "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --fuente-mono: "IBM Plex Mono", ui-monospace, monospace;
  --fuente-ticket: "IBM Plex Mono", "Cascadia Mono", "Consolas", ui-monospace, monospace;

  color-scheme: light;
}

/* ---------- Tokens: tema oscuro ---------- */

.dark {
  --primary-hover: var(--primary);
  --brand-soft: #402812;
  --brand-strong: #eeb687;

  --background: #060b11;
  --foreground: #f1f5fa;
  --card: #0c1219;
  --popover: #131a22;
  --secondary: #121920;
  --secondary-foreground: #ebf1f7;
  --muted: #11181e;
  --muted-foreground: #98a4b1;
  --accent: #341f0c;
  --accent-foreground: #f6ceae;

  --success-strong: #01e97e;
  --warning-strong: #fdb502;
  --info-strong: #8fc6f5;

  --border: #181f26;
  --input: #1d252d;
  --campo: #161e26;
  --borde-campo: #2c3640;
  --campo-hover: #1d2731;

  --serie-1: #d77700;
  --serie-1-suave: #643d18;
  --serie-2: #3987e5;
  --serie-3: #199e70;
  --serie-4: #9085e9;
  --serie-5: #d55181;
  --overlay: rgba(0, 0, 0, 0.55);

  --sidebar: #04080d;
  --sidebar-foreground: #d6dce3;
  --sidebar-accent-foreground: #f8d8be;
  --sidebar-hover: var(--hover);
  --sidebar-border: #161d25;

  /* En oscuro las superficies tienen escalones propios: la tarjeta no lleva sombra. */
  --sombra-tarjeta: none;
  --sombra-elevada: 0 2px 4px -2px rgba(0, 0, 0, 0.4), 0 16px 32px -16px rgba(0, 0, 0, 0.55), 0 40px 80px -40px rgba(0, 0, 0, 0.65);

  color-scheme: dark;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--fuente);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--foreground);
  background: var(--background);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* La interfaz va entera en semibold o bold, como la referencia. */
h1, h2, h3 { font-weight: 700; line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 1.0625rem; }
h2 { font-size: 0.9375rem; }
h3 { font-size: 0.875rem; }
p { margin: 0 0 0.6em; }
strong, b { font-weight: 700; }
a { color: var(--brand-strong); text-underline-offset: 4px; }
ul { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
/* Ningún control lleva borde: ni el del navegador. */
button, input, select, textarea, fieldset, iframe { border: 0; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
hr { border: 0; margin: 0.5rem 0; }
code, kbd, pre { font-family: var(--fuente-mono); }
[hidden] { display: none !important; }

::selection { background: var(--primary); color: var(--primary-foreground); }

/* El foco nunca se apaga; con ratón no aparece. */
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

/* Barra de desplazamiento delgada en el color primario. */
* { scrollbar-width: thin; scrollbar-color: var(--primary) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background-color: var(--primary); border-radius: var(--radio-sm); }

input::-ms-reveal, input::-ms-clear { display: none; }

.solo-lector {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Identificadores (RUC, DNI, serie-número) en monoespaciada: el 0 y la O no se confunden. */
.font-id { font-family: var(--fuente-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.tabular { font-variant-numeric: tabular-nums; }

/* Iconos de trazo grueso y nunca menores de 16 px. */
.icono {
  width: 1rem; height: 1rem; min-width: 1rem; min-height: 1rem; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
}
.girando { animation: girar 1s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

.cargando, .fatal { max-width: 34rem; margin: 18vh auto; padding: 0 1.25rem; color: var(--muted-foreground); }
.fatal h1 { margin-bottom: 0.75rem; color: var(--destructive-strong); font-size: 1.25rem; }
.fatal p { color: var(--foreground); }

/* ---------- Marco ---------- */

.app { display: flex; min-height: 100vh; min-height: 100svh; }

/* Barra lateral: 16 rem; plegada, 3 rem de iconos. */
.riel {
  position: sticky; top: 0; flex: none;
  width: var(--riel); height: 100vh; height: 100svh;
  display: flex; flex-direction: column;
  background: var(--sidebar); color: var(--sidebar-foreground);
  transition: width 0.2s linear;
  z-index: 30;
}
.riel-cabeza, .riel-pie { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.5rem; }
.riel-marca {
  display: flex; align-items: center; gap: 0.5rem; width: 100%; height: 3rem; padding: 0.5rem;
  border-radius: var(--radio-md); color: inherit; text-decoration: none; overflow: hidden; background: none; border: 0; text-align: left;
}
@media (hover: hover) { .riel-marca:hover { background: var(--sidebar-hover); } }
.riel-logo {
  flex: none; width: 2rem; height: 2rem; border-radius: var(--radio-md);
  display: grid; place-items: center; background: var(--primary); color: var(--primary-foreground);
}
.riel-logo .icono { width: 1.1rem; height: 1.1rem; }
.riel-marca-texto { display: grid; min-width: 0; line-height: 1.2; }
.riel-marca-nombre { font-size: 0.9375rem; font-weight: 700; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.riel-marca-sub { font-size: 0.6875rem; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.riel-contenido { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
.riel-contenido::-webkit-scrollbar { display: none; }
.riel-grupo { padding: 0.5rem; min-width: 0; }
.riel-grupo-titulo {
  display: flex; align-items: center; height: 2rem; padding: 0 0.5rem; margin: 0;
  font-size: 0.75rem; color: color-mix(in srgb, var(--sidebar-foreground) 70%, transparent);
  white-space: nowrap; transition: margin 0.2s linear, opacity 0.2s linear;
}
.riel-lista { display: flex; flex-direction: column; gap: 0; }
.riel-enlace {
  position: relative; display: flex; align-items: center; gap: 0.5rem;
  height: 2rem; padding: 0.5rem; border-radius: var(--radio-md);
  color: inherit; text-decoration: none; font-size: 0.875rem; overflow: hidden; white-space: nowrap;
}
@media (hover: hover) { .riel-enlace:hover { background: var(--sidebar-hover); } }
/* Ítem activo: sin fondo; lo marca el color naranja del texto y del icono. */
.riel-enlace.activo { background: transparent; color: var(--brand-strong); font-weight: 700; }
.riel-enlace.activo .icono { color: var(--primary); }
.riel-enlace:focus-visible, .riel-marca:focus-visible, .riel-boton:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
.riel-texto { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.riel-insignia {
  min-width: 1.25rem; height: 1.25rem; padding: 0 0.3rem; border-radius: var(--radio-sm);
  display: inline-grid; place-items: center;
  background: var(--primary); color: var(--primary-foreground);
  font-size: 0.75rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.riel-pie-plan { padding: 0 0.5rem 0.25rem; font-size: 0.75rem; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.riel-boton {
  display: flex; align-items: center; gap: 0.5rem; width: 100%; min-height: 2rem; padding: 0.5rem;
  background: none; border: 0; border-radius: var(--radio-md); color: inherit; text-align: left; overflow: hidden; white-space: nowrap;
}
@media (hover: hover) { .riel-boton:hover { background: var(--sidebar-hover); } }
.riel-usuario { height: 3rem; }
.riel-avatar {
  flex: none; width: 2rem; height: 2rem; border-radius: var(--radio-md);
  display: grid; place-items: center; background: var(--campo); color: var(--brand-strong);
  font-weight: 700; font-size: 0.875rem;
}
.riel-usuario-texto { display: grid; min-width: 0; line-height: 1.2; }
.riel-usuario-nombre { font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.riel-usuario-rol { font-size: 0.75rem; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; }

/* Barra plegada a iconos.
   Escritorio (desde 1024 px): la pliega el usuario con el botón del encabezado, y se recuerda.
   Tablet (768 a 1023 px): va plegada siempre, para dejar sitio al trabajo; el botón la despliega
   encima del contenido, como un panel, sin mover lo que hay debajo. */
@media (min-width: 1024px) {
  .riel-plegado .riel { width: var(--riel-icono); }
  .riel-plegado .riel-grupo-titulo { margin-top: -2rem; opacity: 0; pointer-events: none; }
  .riel-plegado .riel-texto, .riel-plegado .riel-marca-texto, .riel-plegado .riel-usuario-texto,
  .riel-plegado .riel-insignia, .riel-plegado .riel-pie-plan, .riel-plegado .riel-boton > span:not(.riel-avatar) { display: none; }
  .riel-plegado .riel-enlace, .riel-plegado .riel-boton { width: 2rem; padding: 0.5rem; justify-content: center; }
  .riel-plegado .riel-marca { width: 2rem; height: 2rem; padding: 0; justify-content: center; }
  .riel-plegado .riel-usuario { width: 2rem; height: 2rem; padding: 0; }
  /* Plegada, el aviso de pendientes queda como un punto sobre el icono. */
  .riel-plegado .riel-enlace:has(.riel-insignia:not([hidden]))::after {
    content: ""; position: absolute; top: 0.3rem; right: 0.3rem; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--primary);
  }
}
@media (min-width: 768px) and (max-width: 1023px) {
  body:not(.menu-abierto) .riel { width: var(--riel-icono); }
  body:not(.menu-abierto) .riel-grupo-titulo { margin-top: -2rem; opacity: 0; pointer-events: none; }
  body:not(.menu-abierto) .riel-texto, body:not(.menu-abierto) .riel-marca-texto, body:not(.menu-abierto) .riel-usuario-texto,
  body:not(.menu-abierto) .riel-insignia, body:not(.menu-abierto) .riel-pie-plan, body:not(.menu-abierto) .riel-boton > span:not(.riel-avatar) { display: none; }
  body:not(.menu-abierto) .riel-enlace, body:not(.menu-abierto) .riel-boton { width: 2rem; padding: 0.5rem; justify-content: center; }
  body:not(.menu-abierto) .riel-marca { width: 2rem; height: 2rem; padding: 0; justify-content: center; }
  body:not(.menu-abierto) .riel-usuario { width: 2rem; height: 2rem; padding: 0; }
  /* Plegada, el aviso de pendientes queda como un punto sobre el icono. */
  body:not(.menu-abierto) .riel-enlace:has(.riel-insignia:not([hidden]))::after {
    content: ""; position: absolute; top: 0.3rem; right: 0.3rem; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--primary);
  }
  .menu-abierto .riel { position: fixed; inset: 0 auto 0 0; width: var(--riel); box-shadow: var(--sombra-elevada); }
  .menu-abierto .area { margin-left: var(--riel-icono); }
  .menu-abierto .velo { display: block; position: fixed; inset: 0; z-index: 25; background: var(--overlay); }
}

.velo { display: none; }

.area { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; }

/* Encabezado fijo con la ruta de navegación; el contenido pasa por debajo, desenfocado. */
.barra {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 0.75rem;
  height: 3.5rem; padding: 0 1.5rem;
  background: color-mix(in srgb, var(--background) 85%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  }
.barra .barra-menu { margin-left: -0.25rem; }
.barra-miga { font-size: 0.8125rem; color: var(--muted-foreground); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barra-miga strong { color: var(--foreground); }
.barra-derecha { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }
.barra-estado { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

.contenido { width: 100%; max-width: 1320px; margin: 0 auto; padding: 1.5rem 1.5rem 4rem; flex: 1; min-width: 0; }

.franjas:empty { display: none; }
.franjas { display: grid; gap: 0.5rem; margin-bottom: 1rem; }
.franja {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem 1rem; flex-wrap: wrap;
  padding: 0.875rem 1rem; border-radius: var(--radio);
  background: color-mix(in srgb, var(--info) 10%, var(--card)); box-shadow: var(--sombra-tarjeta);
  font-size: 0.84375rem;
}
.franja-alerta { background: color-mix(in srgb, var(--destructive) 10%, var(--card)); }
.franja-ok { background: color-mix(in srgb, var(--success) 10%, var(--card)); }
.franja-aviso { background: color-mix(in srgb, var(--warning) 12%, var(--card)); }
.vista .franja, .modal .franja { margin-bottom: 0.9rem; }

/* Encabezado de la sección: título a la izquierda, acción principal a la derecha. */
.encabezado { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.encabezado:has(.barra-acciones:empty) { margin-bottom: 1rem; }
.barra-titulo { font-size: 1.0625rem; font-weight: 700; letter-spacing: -0.01em; max-width: 68ch; }
.barra-acciones { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.barra-acciones:empty { display: none; }

.vista { min-width: 0; }
.vista:focus { outline: none; }

/* Pantalla de cocina en ventana propia: sin barra lateral ni avisos. */
.kiosko .riel, .kiosko .barra-menu, .kiosko .franjas, .franjas.ocultas { display: none; }
.kiosko .contenido { max-width: none; }

/* ---------- Ingreso ---------- */

.ingreso { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: 1.5rem 1rem; background: var(--background); }
.ingreso-caja { width: 100%; max-width: 26rem; display: grid; gap: 1.5rem; }
.ingreso-marca-fila { display: flex; align-items: center; gap: 0.6rem; justify-content: center; }
.ingreso-marca-fila .riel-logo { width: 2.25rem; height: 2.25rem; }
.ingreso-marca { font-size: 1.125rem; font-weight: 700; letter-spacing: -0.01em; margin: 0; overflow-wrap: anywhere; }
.ingreso-fecha { color: var(--muted-foreground); font-size: 0.8125rem; margin: 0; text-align: center; }
.ingreso-fecha::first-letter { text-transform: uppercase; }
.ingreso-panel { background: var(--card); border-radius: var(--radio-xl); box-shadow: var(--sombra-tarjeta); padding: 1.5rem; }
.dark .ingreso-panel { box-shadow: none; }
.ingreso-panel h2 { font-size: 1.0625rem; margin-bottom: 0.25rem; }
.ingreso-ayuda { color: var(--muted-foreground); font-size: 0.8125rem; margin-bottom: 1rem; }
.ingreso-usuarios { display: grid; gap: 0.25rem; }
.ingreso-usuario {
  display: grid; grid-template-columns: auto 1fr auto; column-gap: 0.75rem; align-items: center;
  text-align: left; padding: 0.5rem; min-height: 3rem; background: transparent; border: 0; border-radius: var(--radio-md);
}
@media (hover: hover) { .ingreso-usuario:hover { background: var(--hover); } }
.ingreso-usuario::after { content: "›"; color: var(--muted-foreground); font-size: 1.25rem; line-height: 1; }
.ingreso-inicial {
  grid-row: 1 / 3; width: 2.25rem; height: 2.25rem; border-radius: var(--radio-md); display: grid; place-items: center;
  background: var(--campo); color: var(--brand-strong); font-weight: 700;
}
.ingreso-usuario::after { grid-column: 3; grid-row: 1 / 3; }
.ingreso-nombre { font-weight: 700; align-self: end; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ingreso-rol { font-size: 0.75rem; color: var(--muted-foreground); align-self: start; }
.ingreso-volver {
  display: inline-flex; align-items: center; gap: 0.3rem; background: none; border: 0; padding: 0.25rem 0;
  color: var(--brand-strong); margin-bottom: 0.75rem; font-size: 0.8125rem;
}
@media (hover: hover) { .ingreso-volver:hover { text-decoration: underline; text-underline-offset: 4px; } }
.ingreso-tema { justify-self: center; }

/* ---------- Teclado de PIN ---------- */

.pin { max-width: 19rem; position: relative; }
.ingreso-panel .pin { margin: 0 auto; }
.pin-oculto { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.pin-puntos { display: flex; gap: 0.6rem; margin-bottom: 0.4rem; justify-content: center; padding: 0.4rem; border-radius: var(--radio-md); }
.pin-punto { width: 0.85rem; height: 0.85rem; border-radius: 50%; background: var(--input); }
.pin-punto.opcional { background: var(--campo); }
.pin-punto.lleno { background: var(--primary); }
.pin:focus-within .pin-puntos { outline: 2px solid var(--ring); outline-offset: 2px; }
.pin-mensaje { min-height: 1.4em; color: var(--destructive-strong); font-size: 0.8125rem; margin: 0.2rem 0 0.4rem; text-align: center; }
.pin-teclas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.pin-tecla {
  height: 3.25rem; font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums;
  background: var(--campo); border-radius: var(--radio-md);
  transition: background-color 0.15s, color 0.15s;
}
@media (hover: hover) { .pin-tecla:hover { background: var(--hover-campo); } }
.pin-tecla:active { background: var(--campo); }
.pin-borrar, .pin-entrar { font-size: 0.875rem; }
.pin-entrar { background: var(--primary); color: var(--primary-foreground); }
@media (hover: hover) { .pin-entrar:hover { background: var(--primary-hover); color: var(--primary-foreground); } }
.pin.sacudir { animation: sacudir 0.28s; }
@keyframes sacudir { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.pin-usuarios { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.9rem; }
.pin-usuario {
  height: 2rem; padding: 0 0.75rem; border-radius: 999px; background: var(--campo);
  font-size: 0.8125rem;
}
@media (hover: hover) { .pin-usuario:hover { background: var(--hover-campo); } }
.pin-usuario.activo { background: var(--primary); color: var(--primary-foreground); }

/* Menos movimiento, pero no cero: el indicador de carga sigue girando. */
@media (prefers-reduced-motion: reduce) {
  *:not(.girando), *::before, *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important; scroll-behavior: auto !important;
  }
  .girando { animation-duration: 1.6s !important; }
}
