/* Inventario de la Sede · Partido Libre — sistema creado por PROAUDIH
   Colores de la bandera de Libre: rojo, negro, blanco y franja amarilla. */

@font-face {
  font-family: 'Montserrat'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(fonts/montserrat.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: 'Montserrat'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(fonts/montserrat-ext.woff2) format('woff2');
  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;
}

:root {
  --rojo: #d4001f; --rojo-2: #b3001a; --rojo-3: #8a0014; --rojo-suave: #fdecee; --rojo-borde: #f4c4cb;
  --negro: #121212; --negro-2: #1d1d1f; --amarillo: #ffc400;
  --fondo: #f4f3f1; --superficie: #ffffff; --superficie-2: #faf9f7;
  --texto: #18181b; --texto-2: #52525b; --texto-3: #85858d;
  --borde: #e7e4e0; --borde-2: #d6d2cc;
  --verde: #15803d; --verde-suave: #e7f5ec;
  --ambar: #a85b06; --ambar-suave: #fdf2df;
  --azul: #1e4fd8; --azul-suave: #e8eefc;
  --morado: #6b2bd6; --morado-suave: #f0eafd;
  --gris-suave: #efeeec;
  --radio: 18px; --radio-2: 12px; --radio-3: 8px;
  --sombra: 0 1px 2px rgba(17,17,17,.05), 0 12px 32px -16px rgba(17,17,17,.16);
  --sombra-2: 0 24px 64px -20px rgba(17,17,17,.4);
  --lateral: 268px;
  --fuente: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', Consolas, 'Liberation Mono', monospace;
  --franja: linear-gradient(var(--amarillo) 0 50%, var(--negro) 50% 100%);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--fuente); font-size: 16px; line-height: 1.45; font-weight: 500;
  color: var(--texto); background: var(--fondo); -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--rojo-2); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(212,0,31,.35); outline-offset: 2px; }
.i { width: 20px; height: 20px; flex: none; }
.i--16 { width: 16px; height: 16px; }
.i--24 { width: 24px; height: 24px; }
.mono { font-family: var(--mono); letter-spacing: .02em; }
.solo-lector { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.carga-inicial { min-height: 100dvh; display: grid; place-items: center; color: var(--texto-3); font-weight: 600; }

/* ---------- Entrada (inicio de sesión) ---------- */
.entrada { min-height: 100dvh; display: grid; grid-template-columns: 1.15fr 1fr; background: var(--superficie); }
.entrada__bandera {
  position: relative; overflow: hidden; background: var(--rojo); color: #fff;
  display: flex; flex-direction: column; justify-content: center; padding: 64px clamp(32px, 6vw, 88px) 120px;
}
.entrada__bandera::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 80% at 100% 0%, rgba(255,255,255,.16), transparent 55%),
              radial-gradient(90% 70% at 0% 100%, rgba(0,0,0,.22), transparent 60%);
}
.entrada__bandera::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 64px; background: linear-gradient(var(--amarillo) 0 16px, var(--negro) 16px); }
.entrada__logo { width: min(420px, 78%); position: relative; filter: drop-shadow(0 10px 30px rgba(0,0,0,.18)); }
.entrada__titulo { position: relative; font-size: clamp(30px, 3.6vw, 48px); font-weight: 800; letter-spacing: -.02em; line-height: 1.04; margin: 34px 0 12px; }
.entrada__sub { position: relative; font-size: 17px; line-height: 1.5; max-width: 460px; opacity: .94; margin: 0; }
.entrada__puntos { position: relative; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.entrada__puntos span { font-size: 13px; font-weight: 700; padding: 7px 12px; border-radius: 999px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); }
.entrada__panel { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(24px, 6vw, 88px); }
.entrada__form { width: 100%; max-width: 410px; margin: 0 auto; }
.entrada__form h2 { font-size: 28px; font-weight: 800; letter-spacing: -.01em; margin: 0 0 6px; }
.entrada__form > p:not(.error-form) { color: var(--texto-2); margin: 0 0 6px; }
.entrada__creditos { margin: 40px auto 0; max-width: 410px; width: 100%; }
@media (max-width: 880px) {
  .entrada { grid-template-columns: 1fr; }
  .entrada__bandera { padding: 40px 24px 92px; }
  .entrada__bandera::after { height: 48px; background: linear-gradient(var(--amarillo) 0 12px, var(--negro) 12px); }
  .entrada__titulo { margin-top: 22px; }
  .entrada__puntos { display: none; }
  .entrada__panel { padding: 32px 20px 40px; }
}

.creditos { display: flex; align-items: center; gap: 12px; padding-top: 18px; border-top: 1px solid var(--borde); color: var(--texto-3); font-size: 12.5px; font-weight: 600; }
.creditos img { height: 30px; width: auto; }
.creditos strong { color: var(--texto-2); }

/* ---------- Marco de la app ---------- */
.marco { display: grid; grid-template-columns: var(--lateral) minmax(0, 1fr); min-height: 100dvh; }
.lateral { position: sticky; top: 0; height: 100dvh; background: var(--negro); color: #d4d4d8; display: flex; flex-direction: column; }
.lateral__marca { position: relative; background: var(--rojo); padding: 24px 22px 22px; }
.lateral__marca::after { content: ''; position: absolute; left: 0; right: 0; bottom: -10px; height: 10px; background: var(--franja); }
.lateral__marca img { height: 46px; width: auto; }
.lateral__sede { margin-top: 12px; color: #fff; font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; opacity: .95; }
.nav { flex: 1; overflow: auto; padding: 26px 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.nav__grupo { padding: 16px 14px 6px; color: #6f6f78; font-size: 10.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px; color: #c7c7cd; text-decoration: none; font-size: 14.5px; font-weight: 600; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a[aria-current="page"] { background: rgba(255,255,255,.09); color: #fff; }
.nav a[aria-current="page"]::before { content: ''; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--rojo); }
.nav__cuenta { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--rojo); color: #fff; font-size: 11.5px; font-weight: 800; display: grid; place-items: center; }
.lateral__pie { padding: 16px 20px 20px; border-top: 1px solid rgba(255,255,255,.08); font-size: 11.5px; color: #8b8b93; font-weight: 600; }
.lateral__pie img { height: 28px; width: auto; margin-top: 8px; }

.principal { min-width: 0; display: flex; flex-direction: column; }
.barra { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 14px 32px; background: rgba(244,243,241,.88); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--borde); }
.barra__titulo { flex: 1; min-width: 0; margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yo { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border-radius: 999px; border: 1px solid var(--borde); background: var(--superficie); }
.yo__nombre { font-size: 13.5px; font-weight: 700; line-height: 1.15; }
.yo__rol { font-size: 11.5px; color: var(--texto-3); font-weight: 600; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--rojo); color: #fff; display: grid; place-items: center; font-size: 13.5px; font-weight: 800; flex: none; }
.contenido { width: 100%; max-width: 1280px; margin: 0 auto; padding: 26px 32px 120px; }

.barra-movil { display: none; }
.abajo { display: none; }
.hoja-menu { display: none; }

@media (max-width: 980px) {
  .marco { grid-template-columns: minmax(0, 1fr); }
  .lateral, .barra { display: none; }
  .barra-movil {
    display: flex; position: sticky; top: 0; z-index: 30; align-items: center; gap: 12px;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; background: var(--rojo); color: #fff;
  }
  .barra-movil::after { content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 6px; background: var(--franja); }
  .barra-movil img { height: 26px; width: auto; }
  .barra-movil h1 { flex: 1; min-width: 0; margin: 0; padding-left: 10px; border-left: 1px solid rgba(255,255,255,.35); font-size: 16px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .barra-movil .avatar { width: 32px; height: 32px; background: #fff; color: var(--rojo); }
  .contenido { padding: 24px 16px calc(112px + env(safe-area-inset-bottom, 0px)); }
  .abajo {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)); background: var(--superficie);
    border-top: 1px solid var(--borde); box-shadow: 0 -10px 28px -18px rgba(0,0,0,.3);
  }
  .abajo a, .abajo button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; border: 0; background: none; color: var(--texto-3); font-size: 11px; font-weight: 700; text-decoration: none; cursor: pointer; }
  .abajo a[aria-current="page"] { color: var(--rojo); }
  .abajo__escanear .abajo__circulo { width: 56px; height: 56px; margin-top: -26px; border-radius: 50%; background: var(--rojo); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 24px -8px rgba(212,0,31,.65); border: 4px solid var(--superficie); }
  .abajo__escanear { color: var(--texto) !important; }
  .hoja-menu { display: block; }
}

/* Menú "Más" en el celular */
.hoja-menu__fondo { position: fixed; inset: 0; z-index: 60; background: rgba(10,10,10,.45); display: flex; align-items: flex-end; }
.hoja-menu__panel { width: 100%; background: var(--superficie); border-radius: 22px 22px 0 0; padding: 10px 16px calc(18px + env(safe-area-inset-bottom, 0px)); box-shadow: var(--sombra-2); }
.hoja-menu__asa { width: 44px; height: 5px; border-radius: 999px; background: var(--borde-2); margin: 4px auto 12px; }
.hoja-menu__panel a, .hoja-menu__panel button { display: flex; width: 100%; align-items: center; gap: 14px; padding: 14px 10px; border: 0; border-radius: 12px; background: none; color: var(--texto); font-weight: 700; font-size: 15.5px; text-decoration: none; text-align: left; cursor: pointer; }
.hoja-menu__panel a:active, .hoja-menu__panel button:active { background: var(--gris-suave); }
.hoja-menu__panel .creditos { margin-top: 8px; }

/* ---------- Piezas comunes ---------- */
.encabezado { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 20px; margin-bottom: 20px; }
.encabezado h2 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.015em; }
.encabezado p { margin: 4px 0 0; color: var(--texto-2); }
.acciones { display: flex; flex-wrap: wrap; gap: 10px; }

.tarjeta { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); box-shadow: var(--sombra); }
.tarjeta__cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.tarjeta__cab h3 { margin: 0; font-size: 16.5px; font-weight: 800; }
.tarjeta__cuerpo { padding: 18px 20px 20px; }
.tarjeta + .tarjeta { margin-top: 18px; }
.rejilla-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.rejilla-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 980px) { .rejilla-2, .rejilla-3 { grid-template-columns: minmax(0, 1fr); } }
.separado { margin-top: 18px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px;
  border: 1px solid transparent; border-radius: var(--radio-2); background: var(--rojo); color: #fff;
  font-size: 15px; font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .15s, transform .1s, box-shadow .15s; box-shadow: 0 8px 18px -10px rgba(212,0,31,.7);
}
.btn:hover { background: var(--rojo-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--sec { background: var(--superficie); color: var(--texto); border-color: var(--borde-2); box-shadow: none; }
.btn--sec:hover { background: var(--superficie-2); border-color: #c8c3bc; }
.btn--negro { background: var(--negro); box-shadow: 0 8px 18px -10px rgba(0,0,0,.6); }
.btn--negro:hover { background: #000; }
.btn--fantasma { background: transparent; color: var(--texto-2); box-shadow: none; }
.btn--fantasma:hover { background: var(--gris-suave); color: var(--texto); }
.btn--peligro { background: var(--superficie); color: var(--rojo-3); border-color: var(--rojo-borde); box-shadow: none; }
.btn--peligro:hover { background: var(--rojo-suave); }
.btn--chico { min-height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn--bloque { width: 100%; }
.btn--icono { width: 44px; padding: 0; }

.campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.campo > span { font-size: 13px; font-weight: 700; color: var(--texto-2); }
.campo > span em { color: var(--rojo); font-style: normal; }
.campo small { color: var(--texto-3); font-size: 12px; }
.entrada-texto, .campo input, .campo select, .campo textarea {
  width: 100%; min-height: 48px; padding: 11px 14px; border: 1px solid var(--borde-2); border-radius: var(--radio-2);
  background: var(--superficie); font-size: 16px; font-weight: 500; transition: border-color .15s, box-shadow .15s;
}
.campo textarea { min-height: 92px; resize: vertical; }
.campo input:focus, .campo select:focus, .campo textarea:focus, .entrada-texto:focus { outline: none; border-color: var(--rojo); box-shadow: 0 0 0 4px rgba(212,0,31,.14); }
.campo--pin input { font-family: var(--mono); font-size: 26px; letter-spacing: .5em; text-align: center; }
.formulario { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.formulario .ancho { grid-column: 1 / -1; }
@media (max-width: 640px) { .formulario { grid-template-columns: minmax(0, 1fr); } }
.error-form { margin: 0; padding: 12px 14px; border-radius: var(--radio-2); background: var(--rojo-suave); color: var(--rojo-3); font-weight: 600; font-size: 14px; }

.segmento { display: inline-flex; padding: 4px; gap: 4px; border-radius: 14px; background: var(--gris-suave); border: 1px solid var(--borde); }
.segmento button { border: 0; background: none; padding: 9px 16px; border-radius: 10px; font-weight: 700; font-size: 14px; color: var(--texto-2); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.segmento button[aria-pressed="true"] { background: var(--superficie); color: var(--texto); box-shadow: 0 2px 8px -3px rgba(0,0,0,.2); }
.segmento b { font-size: 12px; padding: 1px 7px; border-radius: 999px; background: var(--rojo-suave); color: var(--rojo-2); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--gris-suave); color: var(--texto-2); }
.chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .8; }
.chip--nuevo { background: var(--azul-suave); color: var(--azul); }
.chip--bueno, .chip--ok { background: var(--verde-suave); color: var(--verde); }
.chip--regular, .chip--aviso, .chip--en_reparacion { background: var(--ambar-suave); color: var(--ambar); }
.chip--malo, .chip--peligro { background: var(--rojo-suave); color: var(--rojo-3); }
.chip--prestado { background: var(--morado-suave); color: var(--morado); }
.chip--de_baja { background: #2a2a2d; color: #f4f4f5; }
.chip--en_sede { background: var(--gris-suave); color: var(--texto-2); }
.codigo { display: inline-block; padding: 3px 8px; border-radius: 7px; background: var(--negro); color: #fff; font-family: var(--mono); font-size: 12.5px; font-weight: 700; letter-spacing: .04em; }

/* Tablero */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { position: relative; overflow: hidden; padding: 18px 18px 16px; background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); box-shadow: var(--sombra); text-decoration: none; color: inherit; display: block; }
.kpi__icono { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--rojo-suave); color: var(--rojo); margin-bottom: 14px; }
.kpi__valor { font-size: clamp(22px, 2.2vw, 30px); font-weight: 800; letter-spacing: -.02em; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi__etiqueta { margin-top: 6px; font-size: 13px; font-weight: 700; color: var(--texto-2); }
.kpi__nota { margin-top: 2px; font-size: 12px; color: var(--texto-3); font-weight: 600; }
.kpi--rojo { background: var(--rojo); border-color: var(--rojo); color: #fff; }
.kpi--rojo .kpi__icono { background: rgba(255,255,255,.16); color: #fff; }
.kpi--rojo .kpi__etiqueta, .kpi--rojo .kpi__nota { color: rgba(255,255,255,.86); }
.kpi--rojo::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 8px; background: var(--franja); }

.saludo { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.saludo h2 { margin: 0; font-size: clamp(22px, 2.6vw, 30px); font-weight: 800; letter-spacing: -.02em; }
.saludo p { margin: 4px 0 0; color: var(--texto-2); font-weight: 600; }

.alertas { display: flex; flex-direction: column; gap: 10px; }
.alerta { display: flex; align-items: center; gap: 14px; padding: 13px 14px; border-radius: 14px; border: 1px solid var(--borde); background: var(--superficie-2); color: inherit; text-decoration: none; }
.alerta:hover { border-color: var(--borde-2); background: var(--superficie); }
.alerta__icono { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.alerta--peligro .alerta__icono { background: var(--rojo-suave); color: var(--rojo); }
.alerta--aviso .alerta__icono { background: var(--ambar-suave); color: var(--ambar); }
.alerta--info .alerta__icono { background: var(--azul-suave); color: var(--azul); }
.alerta--ok .alerta__icono { background: var(--verde-suave); color: var(--verde); }
.alerta strong { display: block; font-size: 14.5px; }
.alerta span { font-size: 13px; color: var(--texto-2); }

.barras { display: flex; flex-direction: column; gap: 12px; }
.barra-dato { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; font-size: 13.5px; font-weight: 600; }
.barra-dato__pista { grid-column: 1 / -1; height: 10px; border-radius: 999px; background: var(--gris-suave); overflow: hidden; }
.barra-dato__relleno { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--rojo), #ef3348); }
.barra-dato b { font-weight: 800; }
.apilada { display: flex; height: 16px; border-radius: 999px; overflow: hidden; background: var(--gris-suave); }
.apilada span { height: 100%; }
.leyenda { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; font-size: 12.5px; font-weight: 700; color: var(--texto-2); }
.leyenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.atajos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 760px) { .atajos { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.atajo { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 16px; border: 1px solid var(--borde); background: var(--superficie); color: inherit; text-decoration: none; font-weight: 700; font-size: 14.5px; box-shadow: var(--sombra); cursor: pointer; text-align: left; }
.atajo:hover { border-color: var(--rojo-borde); }
.atajo .i { color: var(--rojo); width: 24px; height: 24px; }

/* Listas de bienes */
.herramientas { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.buscador { position: relative; flex: 1 1 280px; }
.buscador .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--texto-3); }
.buscador input { width: 100%; min-height: 48px; padding: 0 14px 0 44px; border: 1px solid var(--borde-2); border-radius: var(--radio-2); background: var(--superficie); font-size: 16px; }
.buscador input:focus { outline: none; border-color: var(--rojo); box-shadow: 0 0 0 4px rgba(212,0,31,.14); }
.filtros { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.filtros select { min-height: 40px; padding: 0 34px 0 12px; border: 1px solid var(--borde-2); border-radius: 10px; background-color: var(--superficie); font-size: 14px; font-weight: 600; max-width: 100%; }
.resumen-lista { font-size: 13px; color: var(--texto-3); font-weight: 600; margin: 0 0 10px; }

.lista { display: flex; flex-direction: column; background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); box-shadow: var(--sombra); overflow: hidden; }
.fila { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--borde); color: inherit; text-decoration: none; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; width: 100%; cursor: pointer; font: inherit; }
.fila:last-child { border-bottom: 0; }
.fila:hover { background: var(--superficie-2); }
.fila__icono { width: 52px; height: 52px; border-radius: 13px; display: grid; place-items: center; background: var(--gris-suave); color: var(--texto-2); overflow: hidden; }
.fila__icono img { width: 100%; height: 100%; object-fit: cover; }
.fila__icono--material { background: var(--rojo-suave); color: var(--rojo); }
.fila__titulo { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 700; font-size: 15px; }
.fila__sub { margin-top: 3px; font-size: 13px; color: var(--texto-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fila__lado { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: right; }
.fila__cantidad { font-size: 18px; font-weight: 800; }
.fila__cantidad small { font-size: 12px; color: var(--texto-3); font-weight: 600; }
.fila__cantidad--baja { color: var(--rojo); }
@media (max-width: 640px) { .fila { grid-template-columns: 44px minmax(0, 1fr); } .fila__icono { width: 44px; height: 44px; } .fila__lado { grid-column: 2; flex-direction: row; align-items: center; justify-content: flex-start; flex-wrap: wrap; } }

.vacio { padding: 44px 24px; text-align: center; color: var(--texto-2); }
.vacio .i { width: 44px; height: 44px; color: var(--rojo); margin: 0 auto 12px; }
.vacio h3 { margin: 0 0 6px; color: var(--texto); font-size: 18px; font-weight: 800; }
.vacio p { margin: 0 auto 18px; max-width: 460px; }
.pasos { counter-reset: paso; list-style: none; padding: 0; margin: 18px auto 22px; max-width: 520px; text-align: left; display: flex; flex-direction: column; gap: 10px; }
.pasos li { counter-increment: paso; display: flex; gap: 12px; align-items: flex-start; font-weight: 600; }
.pasos li::before { content: counter(paso); flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--rojo); color: #fff; font-size: 13px; font-weight: 800; display: grid; place-items: center; }

.boton-flotante { position: fixed; right: 24px; bottom: 28px; z-index: 25; width: 60px; height: 60px; border-radius: 50%; border: 0; background: var(--rojo); color: #fff; display: grid; place-items: center; box-shadow: 0 14px 30px -10px rgba(212,0,31,.75); cursor: pointer; }
@media (max-width: 980px) { .boton-flotante { bottom: calc(92px + env(safe-area-inset-bottom, 0px)); right: 18px; } }

/* Ficha del bien */
.ficha { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; align-items: start; }
.ficha--form { grid-template-columns: 260px minmax(0, 1fr); }
@media (max-width: 980px) { .ficha, .ficha--form { grid-template-columns: minmax(0, 1fr); } }
.qr-mini svg { width: 100%; height: auto; display: block; }
.entrada__form { display: grid; gap: 16px; }
.ficha__foto { position: relative; aspect-ratio: 4 / 3; border-radius: var(--radio); overflow: hidden; background: linear-gradient(135deg, var(--gris-suave), #e3e0dc); display: grid; place-items: center; color: var(--texto-3); }
.ficha__foto img { width: 100%; height: 100%; object-fit: cover; }
.ficha__foto .i { width: 54px; height: 54px; }
.ficha__nombre { margin: 10px 0 4px; font-size: clamp(22px, 2.4vw, 30px); font-weight: 800; letter-spacing: -.015em; line-height: 1.15; }
.ficha__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.datos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; margin: 0; }
@media (max-width: 640px) { .datos { grid-template-columns: minmax(0, 1fr); } }
.datos div { padding: 11px 0; border-bottom: 1px solid var(--borde); min-width: 0; }
.datos dt { font-size: 12px; font-weight: 700; color: var(--texto-3); text-transform: uppercase; letter-spacing: .06em; }
.datos dd { margin: 3px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.existencias { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 18px 20px; border-radius: var(--radio); background: var(--negro); color: #fff; }
.existencias__numero { font-size: 42px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.existencias__numero small { font-size: 15px; font-weight: 600; opacity: .75; margin-left: 6px; }
.existencias__nota { margin-top: 6px; font-size: 13px; opacity: .8; font-weight: 600; }
.prestamo-activo { padding: 16px 18px; border-radius: var(--radio); background: var(--morado-suave); border: 1px solid #ddd0fb; }
.prestamo-activo strong { color: var(--morado); }

.tiempo { list-style: none; padding: 0; margin: 0; }
.tiempo li { position: relative; padding: 0 0 18px 28px; }
.tiempo li::before { content: ''; position: absolute; left: 6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--rojo); box-shadow: 0 0 0 4px var(--rojo-suave); }
.tiempo li::after { content: ''; position: absolute; left: 10px; top: 20px; bottom: 0; width: 2px; background: var(--borde); }
.tiempo li:last-child::after { display: none; }
.tiempo strong { font-size: 14px; }
.tiempo p { margin: 2px 0 0; font-size: 13.5px; color: var(--texto-2); }
.tiempo small { display: block; margin-top: 2px; font-size: 12px; color: var(--texto-3); font-weight: 600; }

/* Escáner */
.camara { position: relative; overflow: hidden; border-radius: var(--radio); background: #000; aspect-ratio: 3 / 4; max-height: 70vh; width: 100%; max-width: 560px; margin: 0 auto; }
.camara video { width: 100%; height: 100%; object-fit: cover; }
.camara__marco { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.camara__marco span { width: 64%; aspect-ratio: 1; border-radius: 22px; box-shadow: 0 0 0 999px rgba(0,0,0,.42); border: 3px solid rgba(255,255,255,.9); position: relative; }
.camara__marco span::after { content: ''; position: absolute; left: 8%; right: 8%; height: 3px; top: 50%; background: var(--rojo); box-shadow: 0 0 14px 2px rgba(212,0,31,.8); animation: barrido 1.8s ease-in-out infinite; }
@keyframes barrido { 0%, 100% { transform: translateY(-110px); } 50% { transform: translateY(110px); } }
@media (prefers-reduced-motion: reduce) { .camara__marco span::after { animation: none; } }
.camara__estado { position: absolute; left: 12px; right: 12px; bottom: 12px; padding: 10px 14px; border-radius: 12px; background: rgba(0,0,0,.6); color: #fff; font-size: 14px; font-weight: 600; text-align: center; }
.camara--apagada { display: grid; place-items: center; color: #d4d4d8; text-align: center; padding: 24px; }
.escaneo-manual { display: flex; gap: 10px; max-width: 560px; margin: 16px auto 0; }
.escaneo-manual input { flex: 1; min-width: 0; min-height: 48px; padding: 0 14px; border: 1px solid var(--borde-2); border-radius: var(--radio-2); font-family: var(--mono); font-size: 16px; text-transform: uppercase; }

/* Toma física */
.progreso { height: 14px; border-radius: 999px; background: var(--gris-suave); overflow: hidden; }
.progreso span { display: block; height: 100%; background: linear-gradient(90deg, var(--rojo), #f0364b); border-radius: 999px; transition: width .4s; }
.cifras { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
@media (max-width: 640px) { .cifras { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cifra { padding: 12px 14px; border-radius: 14px; background: var(--superficie-2); border: 1px solid var(--borde); }
.cifra b { display: block; font-size: 24px; font-weight: 800; }
.cifra span { font-size: 12.5px; font-weight: 700; color: var(--texto-2); }
.marcado { color: var(--verde); }
.fila--vista { background: var(--verde-suave); }

/* Ventanas (modales) y avisos */
.modal-fondo { position: fixed; inset: 0; z-index: 70; background: rgba(12,12,12,.5); display: grid; place-items: center; padding: 18px; animation: aparecer .15s ease-out; }
.modal { width: 100%; max-width: 560px; max-height: calc(100dvh - 36px); overflow: auto; background: var(--superficie); border-radius: 22px; box-shadow: var(--sombra-2); }
.modal--ancho { max-width: 820px; }
.modal__cab { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; background: var(--superficie); border-bottom: 1px solid var(--borde); }
.modal__cab h3 { margin: 0; font-size: 18px; font-weight: 800; }
.modal__cuerpo { padding: 20px; }
.modal__pie { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 0 20px 20px; }
@media (max-width: 640px) { .modal-fondo { place-items: end center; padding: 0; } .modal { border-radius: 22px 22px 0 0; max-height: 92dvh; } .modal__pie .btn { flex: 1; } }
@keyframes aparecer { from { opacity: 0; } to { opacity: 1; } }
.pin-grande { margin: 6px 0 14px; padding: 18px; border-radius: 16px; background: var(--negro); color: #fff; text-align: center; font-family: var(--mono); font-size: 40px; font-weight: 800; letter-spacing: .35em; }

.avisos { position: fixed; z-index: 90; left: 50%; bottom: 28px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; width: min(92vw, 460px); pointer-events: none; }
@media (max-width: 980px) { .avisos { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); } }
.aviso { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-radius: 14px; background: var(--negro); color: #fff; font-weight: 600; font-size: 14.5px; box-shadow: var(--sombra-2); animation: subir .2s ease-out; }
.aviso--error { background: var(--rojo-3); }
.aviso--ok .i { color: #4ade80; }
@keyframes subir { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Tablas (ajustes, bitácora, préstamos) */
.tabla-caja { overflow-x: auto; }
.tabla { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabla th { text-align: left; padding: 10px 12px; font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--texto-3); border-bottom: 1px solid var(--borde); white-space: nowrap; }
.tabla td { padding: 12px; border-bottom: 1px solid var(--borde); vertical-align: middle; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla .num { text-align: right; font-variant-numeric: tabular-nums; }
.vencido { color: var(--rojo); font-weight: 800; }

/* Reportes */
.reportes { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.reporte { display: flex; flex-direction: column; gap: 12px; padding: 20px; border-radius: var(--radio); background: var(--superficie); border: 1px solid var(--borde); box-shadow: var(--sombra); }
.reporte__icono { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--rojo-suave); color: var(--rojo); }
.reporte h3 { margin: 0; font-size: 16.5px; font-weight: 800; }
.reporte p { margin: 0; flex: 1; color: var(--texto-2); font-size: 14px; }
.reporte .acciones .btn { flex: 1; }

/* ---------- Vista previa de impresión ---------- */
.previa { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; background: #57575c; }
.previa__barra { display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; background: var(--negro); color: #fff; }
.previa__barra strong { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.previa__hojas { flex: 1; overflow: auto; padding: 24px 12px 48px; }
.previa__hojas > * { margin: 0 auto 20px; }
.hoja { width: 8.5in; max-width: 100%; min-height: 11in; padding: 0.55in 0.6in; background: #fff; color: #111; box-shadow: 0 10px 40px rgba(0,0,0,.35); font-size: 12px; line-height: 1.4; }

.doc__cab { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center; padding-bottom: 12px; }
.doc__libre { width: 118px; }
.doc__inst { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #333; }
.doc__sede { font-size: 11px; color: #555; font-weight: 600; }
.doc__titulo { margin: 4px 0 0; font-size: 19px; font-weight: 800; letter-spacing: -.01em; color: var(--rojo-2); text-transform: uppercase; }
.doc__fecha { text-align: right; font-size: 10.5px; color: #444; font-weight: 600; }
.doc__franja { height: 7px; margin-bottom: 14px; background: linear-gradient(var(--rojo) 0 4px, var(--amarillo) 4px 6px, #111 6px); }
.doc__texto { font-size: 12px; margin: 0 0 12px; text-align: justify; }
.doc__resumen { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.doc__resumen span { padding: 5px 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 11px; font-weight: 700; }
.doc__resumen b { color: var(--rojo-2); }
.doc h4 { margin: 16px 0 6px; font-size: 12.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.doc table { width: 100%; border-collapse: collapse; font-size: 10.5px; }
.doc th { background: #161616; color: #fff; text-align: left; padding: 6px 6px; font-weight: 700; font-size: 9.5px; text-transform: uppercase; letter-spacing: .04em; }
.doc td { padding: 5px 6px; border-bottom: 1px solid #e3e3e3; vertical-align: top; }
.doc td:first-child { white-space: nowrap; font-weight: 700; }
.doc tr:nth-child(even) td { background: #faf8f6; }
.doc .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.doc tfoot td { font-weight: 800; border-top: 2px solid #111; background: #fff !important; }
.doc thead { display: table-header-group; }
.doc tr { break-inside: avoid; }
.firmas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 54px; break-inside: avoid; }
.firmas--2 { grid-template-columns: repeat(2, 1fr); }
.firmas div { border-top: 1px solid #111; padding-top: 6px; text-align: center; font-size: 10.5px; font-weight: 700; }
.firmas small { display: block; font-weight: 500; color: #555; }
.doc__pie { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 26px; padding-top: 10px; border-top: 1px solid #ddd; font-size: 9.5px; color: #666; font-weight: 600; break-inside: avoid; }
.doc__pie img { height: 18px; width: auto; }

/* Etiquetas QR */
.etq-hoja { width: 8.5in; height: 11in; padding: 0.5in 0.1875in 0; background: #fff; display: grid; grid-template-columns: repeat(3, 2.625in); grid-auto-rows: 1in; column-gap: 0.125in; box-shadow: 0 10px 40px rgba(0,0,0,.35); }
.etq { width: 2.625in; height: 1in; display: flex; align-items: center; gap: 0.07in; padding: 0.06in 0.1in; overflow: hidden; color: #111; }
.etq__qr { width: 0.84in; height: 0.84in; flex: none; }
.etq__qr svg { width: 100%; height: 100%; display: block; }
.etq__txt { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.etq__marca { display: flex; align-items: center; gap: 4px; }
.etq__marca img { height: 0.17in; width: auto; }
.etq__marca span { font-size: 5.5pt; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #333; }
.etq__codigo { font-family: var(--mono); font-size: 11pt; font-weight: 800; letter-spacing: .02em; line-height: 1.1; }
.etq__nombre { font-size: 6.5pt; font-weight: 700; line-height: 1.15; max-height: 2.3em; overflow: hidden; }
.etq__lugar { font-size: 5.5pt; color: #555; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.etq-termica { width: 50mm; height: 25mm; background: #fff; display: flex; align-items: center; gap: 2mm; padding: 1.5mm 2mm; overflow: hidden; color: #000; box-shadow: 0 10px 40px rgba(0,0,0,.35); }
.etq-termica .etq__qr { width: 21mm; height: 21mm; }
.etq-termica .etq__codigo { font-size: 10pt; }

@media print {
  body.con-previa > *:not(.previa) { display: none !important; }
  body.con-previa { background: #fff; }
  .previa { position: static; background: #fff; display: block; }
  .previa__barra { display: none; }
  .previa__hojas { padding: 0; overflow: visible; }
  .previa__hojas > * { margin: 0; box-shadow: none; }
  .hoja { width: auto; min-height: 0; padding: 0; box-shadow: none; break-after: page; }
  .hoja:last-child { break-after: auto; }
  .etq-hoja { break-after: page; box-shadow: none; }
  .etq-termica { break-after: page; box-shadow: none; }
  .doc th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .doc__franja, .chip, .codigo { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Fotos: recuadro que abre la cámara, miniaturas en la lista y galería de bienes */
.ficha__foto--toma { cursor: pointer; border: 2px dashed var(--borde-2); }
.ficha__foto--toma:hover { border-color: var(--rojo); }
.ficha__foto [data-vista-foto] { width: 100%; height: 100%; display: grid; place-items: center; }
.ficha__foto [data-vista-foto] img { width: 100%; height: 100%; object-fit: cover; }
.ficha__foto-boton { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: rgba(17,17,17,.8); color: #fff; font-size: 13.5px; font-weight: 700; white-space: nowrap; }
.galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
@media (max-width: 640px) { .galeria { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.tarjeta-bien { display: flex; flex-direction: column; min-width: 0; overflow: hidden; background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); box-shadow: var(--sombra); color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.tarjeta-bien:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -20px rgba(17,17,17,.35); }
.tarjeta-bien__foto { position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center; align-content: center; gap: 6px; overflow: hidden; background: linear-gradient(135deg, var(--gris-suave), #e3e0dc); color: var(--texto-3); }
.tarjeta-bien__foto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tarjeta-bien__foto .i { width: 38px; height: 38px; }
.tarjeta-bien__foto small { font-size: 12px; font-weight: 700; }
.tarjeta-bien__cuerpo { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 12px 14px 14px; }
.tarjeta-bien__cuerpo b { font-size: 15px; line-height: 1.25; }
.tarjeta-bien__cuerpo small { overflow: hidden; color: var(--texto-2); font-size: 12.5px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.fila__icono img { width: 100%; height: 100%; object-fit: cover; }

/* Logos con movimiento 3D (Libre y PROAUDIH): relieve por capas, giro suave y destello */
.logo3d { display: inline-block; flex: none; line-height: 0; perspective: 900px; }
.logo3d__inclina { display: block; transform-style: preserve-3d; transition: transform .35s ease-out; }
.logo3d__giro { position: relative; display: block; transform-style: preserve-3d; animation: giro3d 7s ease-in-out infinite; }
.logo3d img { max-width: none; }
.logo3d__frente { position: relative; display: block; width: 100%; height: auto; transform: translateZ(0); }
.logo3d__capa { position: absolute; left: 0; top: 0; width: 100%; height: auto; transform: translateZ(calc(var(--z) * -1.4px)); filter: brightness(.58); }
.logo3d__brillo {
  position: absolute; inset: 0; pointer-events: none; transform: translateZ(1px);
  background: linear-gradient(105deg, transparent 38%, rgba(255,255,255,.95) 50%, transparent 62%) no-repeat;
  background-size: 260% 100%; animation: brillo3d 5.5s ease-in-out infinite;
  -webkit-mask: var(--mascara) center / 100% 100% no-repeat; mask: var(--mascara) center / 100% 100% no-repeat;
}
.logo3d--libre .logo3d__brillo { background-image: linear-gradient(105deg, transparent 38%, rgba(255,196,0,.95) 50%, transparent 62%); }
.logo3d--libre .logo3d__capa { filter: brightness(.78) sepia(.25); }
.logo3d--suave { --amp: 10deg; }
@keyframes giro3d { 0%, 100% { transform: rotateY(calc(var(--amp, 17deg) * -1)) rotateX(5deg); } 50% { transform: rotateY(var(--amp, 17deg)) rotateX(-4deg); } }
@keyframes brillo3d { 0% { background-position: 130% 0; } 55%, 100% { background-position: -30% 0; } }
@media (prefers-reduced-motion: reduce) { .logo3d__giro, .logo3d__brillo { animation: none; } }

/* Tamaños: PROAUDIH más grande en todas partes */
.entrada__logo { filter: none; width: min(440px, 80%); }
.entrada__logo .logo3d__frente { filter: drop-shadow(0 12px 30px rgba(0,0,0,.22)); }
.lateral__marca .logo3d { width: 108px; }
.lateral__pie .logo3d { width: 214px; margin-top: 10px; }
.barra-movil .logo3d { width: 60px; }
.creditos .logo3d { width: 190px; }
.creditos--grande { flex-wrap: wrap; gap: 10px 16px; font-size: 13px; }
.creditos--grande .logo3d { width: 250px; }
.logo3d--acerca { width: 150px; }
.lateral__marca .logo3d img, .lateral__pie .logo3d img, .barra-movil .logo3d img, .creditos .logo3d img { width: 100%; height: auto; margin: 0; }
.doc__pie img { height: 26px; }
@media (max-width: 640px) {
  .filtros { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filtros select { width: 100%; min-width: 0; font-size: 13px; padding-right: 26px; }
}
