/* Remotify · paquete de diseño compartido (diseno/remotify.css)
   Paleta y componentes tomados de los prototipos «Cobranzas · Remotify», «Planillas Remotify» y «Remotify – Menús».
   Sin estilos en línea ni recursos externos: la política CSP del núcleo es default-src 'self'. */

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("fuentes/manrope-latin-wght-normal.woff2") format("woff2-variations"), url("fuentes/manrope-latin-wght-normal.woff2") format("woff2");
  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: "Manrope";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("fuentes/manrope-latin-ext-wght-normal.woff2") format("woff2-variations"), url("fuentes/manrope-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, 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;
}

/* ------------------------------------------------------------------ tokens */
:root {
  color-scheme: light;
  --canvas: #EEF0EB; --surface: #FBFBF8; --surface2: #F2F3EF; --table: #FFFFFF;
  --ink: #1B1F24; --muted: #5F6670; --line: #E2E4DE; --line2: #D3D6CF;
  --accent: #2E5E8C; --accent-h: #244B71; --accent-ink: #FFFFFF; --accent-soft: #E3ECF5;
  --rojo: #9E1B32; --rojo-bg: #F5DDE1; --amar: #865A00; --amar-bg: #F6E8C8;
  --verde: #4E6B35; --verde-bg: #E2EBD6; --azul: #5E4F80; --azul-bg: #ECE7F3;
  --gris: #5F6670; --gris-bg: #E7E9E4; --rust: #B5532F; --rust-soft: #F6E2D8;
  /* cinco colores de los íconos */
  --i-terracota: #D97757; --i-cielo: #6A9BCC; --i-oliva: #788C5D; --i-ocre: #E3B873; --i-lavanda: #9B87B5;
  --kipu-fondo: #E6E9E2;
  --sombra: 0 1px 2px rgba(27,31,36,.04), 0 8px 20px rgba(27,31,36,.05);
  --sombra-alta: 0 10px 30px rgba(27,31,36,.14);
  --velo: rgba(20,26,32,.45);
  --radius: 14px;
  --f: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --canvas: #15181B; --surface: #1D2125; --surface2: #24292E; --table: #1A1E22;
    --ink: #ECEEE9; --muted: #A3AAB2; --line: #30363C; --line2: #3D444B;
    --accent: #8DB6DE; --accent-h: #A8C8E8; --accent-ink: #10161C; --accent-soft: #1E2E3E;
    --rojo: #F08A9A; --rojo-bg: #3E1A22; --amar: #E8C27E; --amar-bg: #3A3019;
    --verde: #A9BE8C; --verde-bg: #243020; --azul: #C3B5DA; --azul-bg: #2B2638;
    --gris: #A3AAB2; --gris-bg: #2A2F34; --rust: #E08A64; --rust-soft: #3A2820;
    --kipu-fondo: #1A1E21;
    --sombra: 0 1px 2px rgba(0,0,0,.3), 0 8px 20px rgba(0,0,0,.25);
    --sombra-alta: 0 10px 30px rgba(0,0,0,.5);
    --velo: rgba(0,0,0,.6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #15181B; --surface: #1D2125; --surface2: #24292E; --table: #1A1E22;
  --ink: #ECEEE9; --muted: #A3AAB2; --line: #30363C; --line2: #3D444B;
  --accent: #8DB6DE; --accent-h: #A8C8E8; --accent-ink: #10161C; --accent-soft: #1E2E3E;
  --rojo: #F08A9A; --rojo-bg: #3E1A22; --amar: #E8C27E; --amar-bg: #3A3019;
  --verde: #A9BE8C; --verde-bg: #243020; --azul: #C3B5DA; --azul-bg: #2B2638;
  --gris: #A3AAB2; --gris-bg: #2A2F34; --rust: #E08A64; --rust-soft: #3A2820;
  --kipu-fondo: #1A1E21;
  --sombra: 0 1px 2px rgba(0,0,0,.3), 0 8px 20px rgba(0,0,0,.25);
  --sombra-alta: 0 10px 30px rgba(0,0,0,.5);
  --velo: rgba(0,0,0,.6);
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box }
html { -webkit-text-size-adjust: 100%; height: 100% }
body {
  margin: 0; min-height: 100%; background: var(--canvas); color: var(--ink);
  font: 15px/1.45 var(--f); font-variant-numeric: tabular-nums;
}
button, input, select, textarea { font: inherit; color: inherit }
a { color: var(--accent); text-underline-offset: 2px }
h1, h2, h3 { margin: 0; text-wrap: balance }
h1 { font-size: clamp(22px, 3.2vw, 28px); font-weight: 800; letter-spacing: -.02em }
h2 { font-size: 16px; font-weight: 800 }
h3 { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--muted) }
p { margin: 0 }
[hidden] { display: none !important }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0 }
.muted { color: var(--muted) } .small { font-size: 13px } .bad { color: var(--rojo) } .good { color: var(--verde) } .warn { color: var(--amar) }
.saltar { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 800; text-decoration: none }
.saltar:focus { top: 12px }

/* logo: dos versiones, se muestra la del tema activo */
.logo-img { display: block; height: 44px; width: auto }
.logo-img.oscuro { display: none }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-img.claro { display: none }
  :root:not([data-theme="light"]) .logo-img.oscuro { display: block }
}
:root[data-theme="dark"] .logo-img.claro { display: none }
:root[data-theme="dark"] .logo-img.oscuro { display: block }

/* íconos de cinco colores con superposición multiply (en oscuro, normal con opacidad) */
svg.ico-m { isolation: isolate; display: block }
svg.ico-m .m { mix-blend-mode: multiply }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) svg.ico-m .m { mix-blend-mode: normal; opacity: .82 } }
:root[data-theme="dark"] svg.ico-m .m { mix-blend-mode: normal; opacity: .82 }
svg.lin { display: block; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none }

/* ------------------------------------------------------------------ cabecera */
.cabecera { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20 }
.cab-fila { display: flex; align-items: center; gap: 10px 14px; padding: 10px 24px; flex-wrap: wrap; max-width: 1480px; margin: 0 auto }
.cab-logo { display: flex; align-items: center; border-radius: 8px; min-height: 44px }
.cab-sep { width: 1px; height: 28px; background: var(--line2) }
.cab-modulo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 16px; min-width: 0 }
.cab-modulo svg { width: 28px; height: 28px }
.cab-crece { flex: 1 }
.cab-menu { position: relative; display: flex }
.selector-empresa {
  display: flex; align-items: center; gap: 10px; min-height: 44px; max-width: 340px; padding: 4px 12px 4px 6px;
  border: 1px solid var(--line2); border-radius: 12px; background: var(--surface); text-align: left; cursor: pointer;
}
.selector-empresa:hover { border-color: var(--muted) }
.selector-empresa .txt { min-width: 0; display: flex; flex-direction: column; line-height: 1.2 }
.selector-empresa b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.selector-empresa small { font-size: 11.5px; color: var(--muted) }
.chevron { color: var(--muted); transition: transform .15s; width: 16px; height: 16px }
[aria-expanded="true"] > .chevron { transform: rotate(180deg) }
.avatar {
  width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center;
  font-weight: 800; font-size: 12px; color: #1B1F24; background: var(--i-ocre)
}
.avatar.redondo { border-radius: 50%; background: var(--accent-soft); color: var(--accent) }
.boton-usuario {
  display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 6px 4px 4px; border: 0; border-radius: 22px;
  background: transparent; cursor: pointer
}
.boton-usuario:hover { background: var(--surface2) }
.boton-usuario .avatar { width: 36px; height: 36px }
.menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; min-width: 240px; max-width: min(380px, calc(100vw - 24px));
  margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--line2);
  border-radius: var(--radius); box-shadow: var(--sombra-alta)
}
.menu.izq { right: auto; left: 0 }
.menu .cab-usuario { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; line-height: 1.3 }
.menu .cab-usuario b { display: block }
.menu .cab-usuario span { display: block; font-size: 13px; color: var(--muted); overflow-wrap: anywhere }
.menu-op {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 6px 12px; border: 0; border-radius: 10px;
  background: transparent; color: var(--ink); text-align: left; text-decoration: none; cursor: pointer; font-weight: 600; font-size: 14px
}
.menu-op:hover, .menu-op:focus-visible { background: var(--surface2) }
.menu-op[aria-checked="true"], .menu-op.actual { background: var(--accent-soft) }
.menu-op .txt { min-width: 0; flex: 1 }
.menu-op .txt b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.menu-op .txt small { display: block; font-size: 12px; color: var(--muted); font-weight: 500 }
.menu-op .check { color: var(--accent); width: 18px; height: 18px }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px }
.menu-op.peligro { color: var(--rojo) }
.pestanas { display: flex; gap: 2px; padding: 0 18px; overflow-x: auto; scrollbar-width: none; max-width: 1480px; margin: 0 auto }
.pestanas::-webkit-scrollbar { display: none }
.pestanas a {
  padding: 11px 14px 12px; font-weight: 600; font-size: 14px; color: var(--muted); border-bottom: 3px solid transparent;
  white-space: nowrap; text-decoration: none
}
.pestanas a:hover { color: var(--ink) }
.pestanas a[aria-current="page"] { color: var(--ink); font-weight: 800; border-bottom-color: var(--accent) }

/* ------------------------------------------------------------------ contenido */
.principal { width: 100%; max-width: 1280px; margin: 0 auto; padding: 28px 24px 64px; display: flex; flex-direction: column; gap: 18px }
.titulo { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px }
.titulo .sub { color: var(--muted); margin-top: 4px }
.acciones { display: flex; flex-wrap: wrap; gap: 8px; align-items: center }
.tarjeta { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--sombra); min-width: 0 }
.tarjeta > * + * { margin-top: 12px }
.vacio { padding: 40px 20px; text-align: center; color: var(--muted) }
.nota { background: var(--surface2); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; color: var(--muted) }

/* ------------------------------------------------------------------ botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border: 1px solid var(--line2); border-radius: 10px; background: var(--surface); color: var(--ink);
  font-weight: 700; font-size: 14.5px; text-decoration: none; cursor: pointer; white-space: nowrap
}
.btn:hover { border-color: var(--muted) }
.btn.pri { background: var(--accent); border-color: var(--accent); color: var(--accent-ink) }
.btn.pri:hover { background: var(--accent-h); border-color: var(--accent-h) }
.btn.tinta { background: var(--ink); border-color: var(--ink); color: var(--surface); min-height: 52px; font-size: 16px; border-radius: 12px }
.btn.tinta:hover { opacity: .9 }
.btn.peligro { color: var(--rojo) }
.btn.peligro:hover { border-color: var(--rojo) }
.btn.pri.peligro-pri { background: var(--rojo); border-color: var(--rojo); color: #fff }
.btn-tema { position: absolute; top: 16px; right: 16px }
.btn.enlace { border-color: transparent; background: transparent; color: var(--accent); padding: 0 8px }
.btn.enlace:hover { background: var(--accent-soft) }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px }
.btn.ancho { width: 100% }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed }
.btn .giro { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: giro .8s linear infinite }
@keyframes giro { to { transform: rotate(360deg) } }
.btn-icono { width: 44px; height: 44px; padding: 0; border-radius: 10px }
.btn svg.lin { width: 18px; height: 18px }
.btn.sm svg.lin { width: 16px; height: 16px }

/* ------------------------------------------------------------------ formularios */
.campo { display: flex; flex-direction: column; gap: 6px; min-width: 0 }
.campo > label, .campo > .etiqueta { font-size: 14px; font-weight: 700 }
.campo .ayuda { font-size: 12.5px; color: var(--muted) }
.campo .error-campo { font-size: 13px; color: var(--rojo); font-weight: 600 }
.entrada, select.entrada, textarea.entrada {
  width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--line2); border-radius: 12px;
  background: var(--table); color: var(--ink); font-size: 15px
}
textarea.entrada { padding: 10px 14px; min-height: 96px }
select.entrada { padding-right: 34px }
.entrada::placeholder { color: var(--muted); opacity: .8 }
.entrada:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent) }
.entrada[aria-invalid="true"] { border-color: var(--rojo) }
.entrada.sm { min-height: 38px; font-size: 14px; border-radius: 10px; padding: 0 10px }
.entrada.codigo { font-size: 26px; font-weight: 800; letter-spacing: .5em; text-align: center; padding-left: .5em; min-height: 60px }
.con-boton { position: relative }
.con-boton .entrada { padding-right: 92px }
.con-boton .btn { position: absolute; right: 5px; top: 5px; min-height: 38px; padding: 0 12px; border: 0; background: transparent; color: var(--muted); font-size: 13px }
.con-boton .btn:hover { color: var(--ink); background: var(--surface2) }
.casilla { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; min-height: 44px; padding-top: 11px }
.casilla input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); flex: none }
.form { display: flex; flex-direction: column; gap: 18px }
.rejilla { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 16px }
.rejilla .todo { grid-column: 1 / -1 }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0 }
legend { padding: 0; font-weight: 800; margin-bottom: 8px }

/* alertas */
.alerta { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 14px; font-weight: 600; background: var(--rojo-bg); color: var(--rojo) }
.alerta svg { width: 20px; height: 20px; margin-top: 1px }
.alerta.ok { background: var(--verde-bg); color: var(--verde) }
.alerta.aviso { background: var(--amar-bg); color: var(--amar) }
.alerta.info { background: var(--accent-soft); color: var(--accent) }
.alerta p + p { margin-top: 4px; font-weight: 500 }

/* indicaciones de clave */
.requisitos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px }
.requisitos li { display: flex; align-items: center; gap: 8px; color: var(--muted) }
.requisitos li::before { content: ""; width: 16px; height: 16px; flex: none; border-radius: 50%; border: 2px solid var(--line2) }
.requisitos li.cumple { color: var(--verde) }
.requisitos li.cumple::before { border-color: var(--verde); background: var(--verde); box-shadow: inset 0 0 0 3px var(--surface) }
.requisitos li.falla { color: var(--rojo) }
.requisitos li.falla::before { border-color: var(--rojo) }
.medidor { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px }
.medidor i { height: 6px; border-radius: 3px; background: var(--gris-bg) }
.medidor[data-nivel="1"] i:nth-child(-n+1) { background: var(--rojo) }
.medidor[data-nivel="2"] i:nth-child(-n+2) { background: var(--amar) }
.medidor[data-nivel="3"] i:nth-child(-n+3) { background: var(--i-oliva) }
.medidor[data-nivel="4"] i { background: var(--verde) }
.medidor-txt { font-size: 12.5px; color: var(--muted); font-weight: 600 }

/* ------------------------------------------------------------------ tablas */
.tabla-caja { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--table) }
table.tabla { border-collapse: collapse; width: 100%; font-size: 14px }
.tabla th, .tabla td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle }
.tabla th { font-weight: 800; font-size: 11.5px; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); background: var(--surface2); white-space: nowrap }
.tabla tbody tr:last-child td { border-bottom: 0 }
.tabla tbody tr:hover td { background: var(--surface2) }
.tabla td small { display: block; color: var(--muted); font-size: 12.5px }
.tabla td.d, .tabla th.d { text-align: right }
.tabla .acciones { flex-wrap: nowrap; justify-content: flex-end }
.tabla tr.inactivo td:not(:last-child) { opacity: .6 }

/* chips */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; padding: 2px 10px 2px 8px; border-radius: 99px; white-space: nowrap; background: var(--gris-bg); color: var(--gris) }
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor }
.chip.sin-punto::before { display: none }
.chip.rojo { color: var(--rojo); background: var(--rojo-bg) } .chip.amar { color: var(--amar); background: var(--amar-bg) }
.chip.verde { color: var(--verde); background: var(--verde-bg) } .chip.azul { color: var(--azul); background: var(--azul-bg) }
.chip.acento { color: var(--accent); background: var(--accent-soft) }
.chips { display: flex; flex-wrap: wrap; gap: 6px }

/* ------------------------------------------------------------------ diálogo y aviso */
dialog.dialogo {
  border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--ink); padding: 0;
  width: min(640px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); box-shadow: var(--sombra-alta)
}
dialog.dialogo.ancho { width: min(980px, calc(100vw - 24px)) }
dialog.dialogo::backdrop { background: var(--velo) }
.dlg-cab { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px }
.dlg-cuerpo { padding: 18px 20px; overflow: auto; max-height: calc(100dvh - 190px); display: flex; flex-direction: column; gap: 16px }
.dlg-pie { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap }
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: 20px; z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px) }
.toast { background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 10px; font-weight: 700; font-size: 14px; box-shadow: var(--sombra-alta) }
.toast.mal { background: var(--rojo); color: #fff }
.cuenta-atras { font-size: 40px; font-weight: 800; letter-spacing: -.02em; text-align: center; color: var(--amar) }
.secreto {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface2);
  border: 1px dashed var(--line2); font: 700 18px/1.3 ui-monospace, "SFMono-Regular", Consolas, monospace; overflow-wrap: anywhere
}
.secreto code { flex: 1; min-width: 0 }

/* ------------------------------------------------------------------ cuadrícula de módulos (inicio) */
.inicio { display: flex; flex-direction: column; align-items: center; gap: 40px; padding: 40px 24px 72px; max-width: 1020px; margin: 0 auto }
.saludo { text-align: center; display: flex; flex-direction: column; gap: 6px }
.saludo h1 { font-size: clamp(24px, 4vw, 34px) }
.buscar-app { position: relative; width: 100%; max-width: 520px; color: var(--muted) }
.buscar-app svg { position: absolute; left: 18px; top: 15px; width: 18px; height: 18px }
.buscar-app input { width: 100%; height: 48px; padding: 0 18px 0 46px; border: 1px solid var(--line2); border-radius: 24px; background: var(--surface); font-size: 15px; color: var(--ink) }
.apps { width: 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 36px 12px; margin: 0; padding: 0; list-style: none }
.app {
  display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 8px 4px; border-radius: 14px;
  color: var(--ink); text-decoration: none; text-align: center; font-size: 14px; font-weight: 700; text-wrap: balance
}
.app .ico {
  width: 84px; height: 84px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line);
  display: grid; place-items: center; box-shadow: 0 1px 2px rgba(27,31,36,.06), 0 10px 22px rgba(27,31,36,.08);
  transition: transform .18s ease, box-shadow .18s ease
}
.app .ico svg { width: 52px; height: 52px }
.app:hover .ico, .app:focus-visible .ico { transform: translateY(-4px); box-shadow: 0 2px 4px rgba(27,31,36,.08), 0 16px 30px rgba(27,31,36,.16) }
.app:focus-visible { outline-offset: 4px }
.app .rol { margin-top: -8px; font-size: 11.5px; font-weight: 600; color: var(--muted) }
.seccion-apps { width: 100%; display: flex; flex-direction: column; gap: 18px }
.seccion-apps > h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); text-align: center }

/* ------------------------------------------------------------------ pantallas de acceso (kipu) */
.acceso { min-height: 100vh; min-height: 100dvh; display: flex; flex-wrap: wrap; background: var(--surface) }
.acceso-form { flex: 1 1 460px; padding: 36px clamp(16px, 6vw, 88px); display: flex; flex-direction: column; gap: 36px; min-width: 0 }
.acceso-form > .logo-img, .acceso-form > .cab-logo { align-self: flex-start }
.acceso-centro { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 28px; width: 100%; max-width: 440px }
.acceso-centro.ancho { max-width: 620px }
.lema { font-size: clamp(36px, 4.6vw, 60px); line-height: 1.02; font-weight: 800; letter-spacing: -.04em }
.lema span { display: block }
.lema span + span { color: var(--rust) }
.acceso h1.paso { font-size: clamp(26px, 3.4vw, 34px); letter-spacing: -.03em }
.acceso .bajada { color: var(--muted); font-size: 15px; margin-top: -16px }
.acceso-pie { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font-size: 13px; color: var(--muted) }
.acceso-pie a { color: var(--ink); font-weight: 700 }
.fila-entre { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px }
.enlace-fuerte { font-size: 14px; font-weight: 700; color: var(--rust); text-decoration: none; padding: 10px 0 }
.enlace-fuerte:hover { text-decoration: underline }
.kipu { flex: 1 1 360px; min-height: 320px; position: relative; overflow: hidden; background: var(--kipu-fondo) }
.kipu svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block }
.kipu p {
  position: absolute; left: 32px; right: 32px; bottom: 28px; max-width: 320px; padding: 10px 14px; border-radius: 10px;
  background: var(--surface); box-shadow: var(--sombra); font-size: 13px; line-height: 1.5; color: var(--muted)
}
.aviso-texto { display: flex; flex-direction: column; gap: 12px; font-size: 14.5px; line-height: 1.55 }
.aviso-texto ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px }
.pasos-indicador { display: flex; gap: 6px; align-items: center; font-size: 13px; font-weight: 700; color: var(--muted) }
.pasos-indicador i { width: 28px; height: 4px; border-radius: 2px; background: var(--line2) }
.pasos-indicador i.hecho { background: var(--accent) }

/* ------------------------------------------------------------------ administración */
.barra-filtros { display: flex; flex-wrap: wrap; gap: 8px; align-items: center }
.barra-filtros .entrada { max-width: 320px; min-height: 44px }
.accesos-empresa { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 12px; background: var(--table) }
.accesos-empresa > header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 12px; align-items: center }
.accesos-empresa > header b { display: block }
.accesos-modulos { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px 14px }
.acceso-mod { display: flex; align-items: center; gap: 10px; min-width: 0 }
.acceso-mod svg { width: 26px; height: 26px; flex: none }
.acceso-mod label { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 700 }
.acceso-mod select { width: 150px; flex: none }
.modulos-check { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 12px }
.modulos-check .casilla { padding-top: 0; align-items: center }
.modulos-check svg { width: 24px; height: 24px }
.leyenda-roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 6px 14px; font-size: 13px; color: var(--muted) }
.leyenda-roles b { color: var(--ink) }

/* ------------------------------------------------------------------ adaptable */
@media (max-width: 860px) {
  .cab-fila { padding: 8px 14px }
  .logo-img { height: 34px }
  .principal { padding: 18px 16px 48px }
  .inicio { padding: 28px 16px 56px; gap: 30px }
  .apps { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 26px 8px }
  .app .ico { width: 72px; height: 72px; border-radius: 16px }
  .app .ico svg { width: 44px; height: 44px }
  .kipu { flex-basis: 100%; min-height: 0; height: 140px; order: -1 }
  .kipu p { display: none }
  .acceso-form { gap: 28px; padding-top: 24px }
}
@media (max-width: 640px) {
  /* tablas como tarjetas apiladas: cada celda lleva su rótulo en data-etiqueta */
  .tabla-caja.apilable { border: 0; background: transparent; overflow: visible }
  .apilable table.tabla, .apilable .tabla tbody, .apilable .tabla tr, .apilable .tabla td { display: block; width: 100% }
  .apilable .tabla thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0) }
  .apilable .tabla tr { background: var(--table); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; padding: 6px 0 }
  .apilable .tabla tbody tr:hover td { background: transparent }
  .apilable .tabla td { border: 0; padding: 6px 14px; display: flex; gap: 12px; align-items: center; justify-content: space-between }
  .apilable .tabla td[data-etiqueta]::before { content: attr(data-etiqueta); font-size: 12px; font-weight: 700; color: var(--muted); flex: none }
  .apilable .tabla td:first-child { padding-top: 10px }
  .apilable .tabla td:last-child { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px }
  .apilable .tabla td .chips { justify-content: flex-end }
  .apilable .tabla .acciones { width: 100% }
  .apilable .tabla .acciones .btn { flex: 1 }
}
@media (max-width: 560px) {
  .cab-sep, .cab-modulo > span { display: none }
  .cab-menu.empresa { order: 10; flex-basis: 100% }
  .selector-empresa { max-width: none; width: 100% }
  .selector-empresa .txt { flex: 1 }
  .cab-menu.empresa .menu { left: 0; right: 0; max-width: none }
  .tarjeta { padding: 16px }
  .acceso-mod select { width: 130px }
  .tabla th, .tabla td { padding: 9px 10px }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important } }
@media print { .cabecera, .toasts { display: none } body { background: #fff } }
