/* =========================================================
   Fraccionamiento · hoja de estilos
   Tema "Lavanda y crema": cálido, claro y amable, como un
   residencial bien cuidado. Morado tenue + verde salvia.
   ========================================================= */
:root {
  --lav: #7C6BAE;        /* principal: lavanda tenue */
  --lav-700: #5B4B8A;    /* textos y enlaces sobre claro */
  --lav-300: #C3B8E0;
  --lav-100: #E6DFF3;
  --lav-50: #F3F0F9;
  --salvia: #6F9C82;     /* acento: jardín */
  --salvia-50: #EAF3EE;
  --arena: #F7F4EF;      /* fondo crema */
  /* alias usados por algunas plantillas */
  --jac: var(--lav); --jac-700: var(--lav-700); --jac-300: var(--lav-300); --jac-50: var(--lav-50);
  --ink: #2E2840;
  --bg: var(--arena);
  --surface: #FFFFFF;
  --surface-2: #FBFAF8;
  --surface-3: #F4F1F8;
  --line: #E9E5EE;
  --line-2: #DCD6E5;
  --text: #2A2433;
  --muted: #6E6779;
  --tenue: #A29BAD;
  --ok: #3E8A66;   --ok-50: #E7F3EC;
  --warn: #B4741E; --warn-50: #FBF1DF;
  --bad: #BF4F5C;  --bad-50: #FBEAEC;
  --r-lg: 20px; --r: 14px; --r-sm: 10px;
  --shadow: 0 1px 2px rgba(46, 40, 64, .04), 0 8px 24px -14px rgba(46, 40, 64, .18);
  --shadow-lg: 0 24px 60px -20px rgba(46, 40, 64, .35);
  --f-titulo: "Fraunces", Georgia, serif;
  --f-display: "Plus Jakarta Sans", system-ui, sans-serif;
  --f-body: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --side: 256px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--f-body); -webkit-font-smoothing: antialiased; }
a { color: var(--lav-700); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
h1 { font-family: var(--f-titulo); font-size: 2.1rem; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
h2 { font-size: 1.06rem; font-weight: 700; color: var(--ink); }
h3 { font-size: 1rem; font-weight: 600; }
p { margin: 0 0 .6em; }
small, .muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; font-weight: 700; }
:focus-visible { outline: 3px solid var(--lav-300); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
svg.lucide { width: 18px; height: 18px; stroke-width: 1.9; flex-shrink: 0; }
.grow { flex: 1; min-width: 0; }
::selection { background: var(--lav-100); }

/* ---------------- Estructura ---------------- */
.app { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; transition: grid-template-columns .26s cubic-bezier(.23, 1, .32, 1); }
.cuerpo { min-width: 0; }

/* Menú lateral: panel flotante de vidrio oscuro, con íconos en mosaicos de color por sección */
.side {
  --t: #B6A8E6;
  position: sticky; top: 12px; height: calc(100vh - 24px); margin: 12px 0 12px 12px; padding: 14px 12px 12px;
  display: flex; flex-direction: column; overflow: hidden; border-radius: 26px; color: #E4DEEF;
  background: linear-gradient(180deg, rgba(64, 54, 90, .97) 0%, rgba(42, 36, 60, .98) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), inset 0 0 0 1px rgba(255, 255, 255, .05), 0 0 0 1px rgba(46, 40, 64, .06), 0 28px 50px -28px rgba(46, 40, 64, .7);
  --arbol-trazo: #E4DCF5; --arbol-hoja: #B9D3C2; --anillo: #CFC4E8;
}
.side-top { display: flex; align-items: center; gap: 6px; padding: 2px 2px 14px; }
.brand { display: flex; align-items: center; gap: 11px; padding: 4px; color: #fff; min-width: 0; flex: 1; border-radius: 14px; }
.brand:hover { text-decoration: none; }
.brand .logo { width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 0 1px rgba(233, 193, 122, .35), 0 0 18px -2px rgba(233, 193, 122, .45); }
.brand-txt { min-width: 0; }
.arbol-logo { width: 100%; height: 100%; display: block; border-radius: 50%; }
.arbol-grande { width: 100%; height: auto; display: block; }
.brand b { font-family: var(--f-titulo); font-size: 1.1rem; font-weight: 600; line-height: 1.1; display: block; color: #fff; }
.brand small { color: #B9B0CC; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; }
.side-toggle {
  width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; cursor: pointer;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); color: #CFC6E2;
  transition: background .15s, transform .16s var(--ease-out);
}
.side-toggle:active { transform: scale(.94); }
.side-toggle svg.lucide { width: 16px; height: 16px; transition: transform .26s var(--ease-out); }
.side-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; margin: 0 -6px; padding: 0 6px 8px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .15) transparent; }

.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 12px; font-weight: 500; font-size: .92rem; }
.nav a:hover { text-decoration: none; }
.nav-sec { margin: 14px 10px 6px; font-size: .66rem; color: #9F96B5; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; }
.nav-sec:first-child { margin-top: 2px; }
.side .nav { display: grid; gap: 2px; }
.side .nav.s2 { --t: #86C9A2; } .side .nav.s3 { --t: #EBB872; } .side .nav.s4 { --t: #EC93A2; }
.side .nav a {
  position: relative; display: flex; align-items: center; gap: 11px; padding: 6px 8px; border-radius: 14px;
  color: #DCD5E9; font-weight: 500; font-size: .9rem; white-space: nowrap;
  transition: background .15s, color .15s, transform .16s var(--ease-out);
}
.side .nav a:active { transform: scale(.98); }
.nav-ico {
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; color: var(--t);
  background: linear-gradient(150deg, color-mix(in srgb, var(--t) 30%, transparent), color-mix(in srgb, var(--t) 14%, transparent)); box-shadow: inset 0 1px 0 color-mix(in srgb, var(--t) 40%, transparent), inset 0 0 0 1px color-mix(in srgb, var(--t) 26%, transparent);
  transition: background .2s, color .2s, box-shadow .2s;
}
.nav-ico svg.lucide { width: 17px; height: 17px; }
.nav-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.side .nav a:hover { text-decoration: none; }
.side .nav a.on { background: rgba(255, 255, 255, .1); color: #fff; font-weight: 600; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); }
.side .nav a.on .nav-ico {
  color: #fff; background: linear-gradient(150deg, var(--t), color-mix(in srgb, var(--t) 62%, #2E2840));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 6px 14px -6px var(--t);
}
@media (hover: hover) and (pointer: fine) {
  .side .nav a:hover:not(.on) { background: rgba(255, 255, 255, .055); color: #fff; }
  .side .nav a:hover:not(.on) .nav-ico { background: color-mix(in srgb, var(--t) 34%, transparent); }
  .side-toggle:hover { background: rgba(255, 255, 255, .12); color: #fff; }
}
.cuenta-foro { background: var(--salvia); color: #fff; font-size: .7rem; font-weight: 700; border-radius: 99px; padding: 1px 7px; min-width: 20px; text-align: center; }

.side .yo {
  display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 10px; border-radius: 18px;
  background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07);
}
.yo-salir { display: contents; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--lav-100); color: var(--lav-700);
  display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex-shrink: 0;
}
a.avatar:hover { text-decoration: none; box-shadow: 0 0 0 3px var(--lav-100); }
.side a.avatar:hover { box-shadow: 0 0 0 3px rgba(255, 255, 255, .18); }
.yo .who { flex: 1; min-width: 0; font-size: .78rem; line-height: 1.3; color: #B9B0CC; white-space: nowrap; overflow: hidden; }
.yo .who b { color: #fff; display: block; font-size: .85rem; overflow: hidden; text-overflow: ellipsis; }
.yo .btn { color: #B9B0CC; }
.yo .btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }

/* Menú contraído (sólo escritorio): queda la columna de mosaicos y el nombre sale como globo */
.side-tip { display: none; }
@media (min-width: 861px) {
  body.side-mini { --side: 92px; }
  .side-mini .side { padding: 14px 10px 10px; }
  .side-mini .side-top { flex-direction: column; gap: 10px; }
  .side-mini .brand { flex: none; padding: 2px; }
  .side-mini .brand-txt, .side-mini .who, .side-mini .side-arbol { display: none; }
  .side-mini .side-toggle svg.lucide { transform: rotate(180deg); }
  .side-mini .nav-sec { font-size: 0; height: 1px; margin: 10px 14px; background: rgba(255, 255, 255, .1); }
  .side-mini .nav-sec:first-child { display: none; }
  .side-mini .side .nav a { justify-content: center; padding: 5px; }
  .side-mini .nav-ico { width: 40px; height: 40px; border-radius: 13px; }
  .side-mini .side .nav a.on { background: none; box-shadow: none; }
  .side-mini .nav-txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .side-mini .cuenta-foro { position: absolute; top: 1px; right: 6px; min-width: 18px; padding: 0 5px; font-size: .64rem; box-shadow: 0 0 0 2px #3A3150; }
  .side-mini .side .yo { flex-direction: column; padding: 8px 4px; gap: 6px; }
  .side-tip {
    display: block; position: fixed; z-index: 120; pointer-events: none; transform: translateY(-50%);
    padding: 6px 11px; border-radius: 10px; background: #2E2840; color: #fff; font-size: .82rem; font-weight: 600; white-space: nowrap;
    box-shadow: 0 10px 24px -10px rgba(46, 40, 64, .6), inset 0 0 0 1px rgba(255, 255, 255, .08);
    transition: opacity .12s ease-out, transform .14s var(--ease-out);
  }
  .side-tip[hidden] { display: block !important; opacity: 0; transform: translate(-4px, -50%); }
}
@media (prefers-reduced-motion: reduce) { .app, .side-toggle svg.lucide, .side-tip { transition: none; } }

.main { min-width: 0; padding: 6px clamp(16px, 2.5vw, 40px) 60px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin: 6px 0 0; max-width: 64ch; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Barra superior: en escritorio sólo campanita y perfil; en celular, menú completo */
.topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 50; padding: 12px clamp(16px, 2.5vw, 40px) 6px; }
.topbar .solo-movil { display: none; }
.bottom-nav, .drawer-bg { display: none; }

/* ---------------- Campanita de avisos ---------------- */
.campana-wrap { position: relative; }
.campana {
  position: relative; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); color: var(--lav-700); box-shadow: var(--shadow); transition: box-shadow .2s;
}
.campana:hover { box-shadow: 0 0 0 4px var(--lav-50), var(--shadow); }
.campana svg.lucide { width: 19px; height: 19px; }
.campana.hay svg { animation: tilin 3s ease-in-out infinite; transform-origin: 50% 10%; }
.campana .badge {
  position: absolute; top: -4px; right: -5px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px;
  background: var(--bad); color: #fff; font-size: .7rem; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg);
}
@keyframes tilin { 0%, 76%, 100% { transform: rotate(0); } 80% { transform: rotate(12deg); } 86% { transform: rotate(-10deg); } 92% { transform: rotate(5deg); } }
.avisos-panel {
  position: absolute; right: 0; top: calc(100% + 10px); width: min(380px, calc(100vw - 24px)); z-index: 95;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-lg); animation: entra .18s ease-out;
}
.avisos-panel > header { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.avisos-panel > header b { font-family: var(--f-titulo); font-size: 1.2rem; color: var(--ink); }
.avisos-lista { max-height: min(420px, 65vh); overflow-y: auto; }
.avisos-lista .cargando { padding: 18px; margin: 0; }
.avisos-items { list-style: none; margin: 0; padding: 6px; }
.avisos-items a { display: flex; gap: 12px; padding: 10px; border-radius: 12px; color: var(--text); }
.avisos-items a:hover { background: var(--lav-50); text-decoration: none; }
.avisos-items .ico { width: 36px; height: 36px; }
.avisos-items a.mal .ico { background: var(--bad-50); color: var(--bad); }
.avisos-items b { display: block; font-weight: 600; font-size: .9rem; }
.avisos-items small { font-size: .82rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.avisos-items time { font-size: .72rem; color: var(--lav); font-weight: 600; }
.avisos-vacio { padding: 30px 16px; text-align: center; display: grid; gap: 4px; justify-items: center; }
.avisos-vacio svg.lucide { width: 30px; height: 30px; color: var(--lav-300); }

/* ---------------- Árbol de la vida y hojas que caen ---------------- */
.side > *:not(.side-deco) { position: relative; z-index: 1; }
.side .hojas-caen { opacity: .7; }
.side-deco { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.side-arbol { position: absolute; left: -70px; bottom: -60px; width: 340px; opacity: .14; }

.hojas-caen { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.hojas-caen i { position: absolute; left: var(--x); top: -40px; width: var(--s); height: calc(var(--s) * 1.4); animation: caer var(--d) linear var(--r) infinite; }
.hojas-caen i svg { width: 100%; height: 100%; display: block; animation: mecer 3.4s ease-in-out infinite alternate; }
.hojas-caen .t1 { fill: #C9BDE6; --vena: rgba(91, 75, 138, .3); }
.hojas-caen .t2 { fill: #A9C9B4; --vena: rgba(62, 110, 85, .3); }
.hojas-caen .t3 { fill: #E4DCF3; --vena: rgba(91, 75, 138, .25); }
.hojas-caen.menu { opacity: .3; }
.hojas-caen.login i { z-index: 1; }
@keyframes caer {
  0%   { top: -8%;  transform: translateX(0) rotate(0deg); opacity: 0; }
  8%   { opacity: 1; }
  50%  { transform: translateX(var(--w)) rotate(140deg); }
  92%  { opacity: 1; }
  100% { top: 104%; transform: translateX(calc(var(--w) * -0.4)) rotate(300deg); opacity: 0; }
}
@keyframes mecer { from { transform: rotate(-24deg); } to { transform: rotate(24deg); } }

/* ---------------- Tarjetas y rejillas ---------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head p { margin: 2px 0 0; color: var(--muted); font-size: .86rem; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); }
.split .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1500px) { .split .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.g22 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.stack > * + * { margin-top: 18px; }
.grid > .card + .card { margin-top: 0; }

/* Indicadores */
.stat { padding: 16px 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.stat .lbl { font-size: .82rem; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.stat .lbl svg { width: 26px; height: 26px; padding: 5px; border-radius: 8px; background: var(--lav-50); color: var(--lav); }
.stat.ok .lbl svg { background: var(--ok-50); color: var(--ok); }
.stat.bad .lbl svg { background: var(--bad-50); color: var(--bad); }
.stat.warn .lbl svg { background: var(--warn-50); color: var(--warn); }
.stat .val { font-size: clamp(1.15rem, 1.6vw, 1.45rem); overflow-wrap: anywhere; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; color: var(--ink); letter-spacing: -.01em; }
.stat.ok .val { color: var(--ok); } .stat.bad .val { color: var(--bad); } .stat.warn .val { color: var(--warn); }
.stat small { color: var(--muted); font-size: .78rem; display: block; margin-top: 4px; }

/* ---------------- Tarjetas protagonistas: mi saldo y el fondo ---------------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; margin-bottom: 18px; }
.hero.uno { grid-template-columns: minmax(0, 1fr); }
.saldo, .fondo { position: relative; overflow: hidden; border-radius: 24px; padding: 26px 26px 22px; isolation: isolate; }
.saldo {
  background: linear-gradient(140deg, #8A79BC 0%, #7462A8 55%, #5F4F91 100%); color: #fff;
  box-shadow: 0 18px 40px -22px rgba(91, 75, 138, .8);
  --arbol-trazo: #fff; --arbol-hoja: #fff; --anillo: rgba(255, 255, 255, .9);
}
.saldo.al-corriente .saldo-arbol { opacity: .45; }
.saldo.al-corriente { background: linear-gradient(140deg, #7FAE93 0%, #649A7C 55%, #4E8267 100%); box-shadow: 0 18px 40px -22px rgba(62, 110, 85, .8); }
.saldo-arbol { position: absolute; right: -50px; top: -50px; width: 280px; z-index: -1; opacity: .6; pointer-events: none; }
.saldo .hojas-caen { z-index: -1; opacity: .5; }
.saldo .hojas-caen i { fill: #fff; }
.saldo .depto { font-size: .86rem; color: rgba(255, 255, 255, .85); display: flex; align-items: center; gap: 8px; }
.saldo .monto, .fondo .monto {
  font-family: var(--f-titulo); font-size: clamp(2.5rem, 6vw, 3.4rem); font-weight: 600; line-height: 1; margin: 14px 0 8px;
  font-variant-numeric: lining-nums tabular-nums; letter-spacing: -.02em;
}
.saldo .estado { font-size: .98rem; color: #fff; max-width: 46ch; }
.saldo .detalle { display: flex; gap: 22px; margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .25); flex-wrap: wrap; font-size: .84rem; color: rgba(255, 255, 255, .8); }
.saldo .detalle b { display: block; color: #fff; font-size: 1.02rem; font-variant-numeric: tabular-nums; }
.saldo .btns { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.saldo .btn { background: #fff; color: var(--lav-700); box-shadow: none; }
.saldo.al-corriente .btn { color: #3E6E55; }
.saldo .btn:hover { background: #F5F2FB; }
.saldo .btn.sec { background: rgba(255, 255, 255, .16); color: #fff; border-color: rgba(255, 255, 255, .3); }
.saldo .btn.sec:hover { background: rgba(255, 255, 255, .26); }
.fondo { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.fondo::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: linear-gradient(90deg, var(--lav), var(--salvia)); }
.fondo .depto { font-size: .86rem; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.fondo .depto svg { color: var(--salvia); }
.fondo .monto { color: var(--ink); }
.fondo .monto.t-bad { color: var(--bad); }
.fondo .estado { font-size: .92rem; color: var(--muted); max-width: 46ch; }
.fondo-top { display: flex; gap: 16px; align-items: flex-start; }
.fondo-arbol { width: 118px; height: 118px; flex-shrink: 0; margin-left: auto; border-radius: 50%; box-shadow: 0 12px 30px -12px rgba(46, 40, 64, .55), 0 0 0 6px var(--lav-50); }
.fondo-anio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.fondo-anio span { display: block; font-size: .78rem; color: var(--muted); }
.fondo-anio b { font-size: 1.02rem; font-variant-numeric: tabular-nums; }
.fondo .uso { margin-top: 14px; display: grid; gap: 6px; }
.fondo .uso small b { color: var(--lav-700); }

/* ---------------- Botones ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border-radius: 12px; border: 1px solid transparent; cursor: pointer;
  font: 600 .9rem/1.2 var(--f-body); background: var(--lav); color: #fff; white-space: nowrap;
  transition: background .15s, box-shadow .15s, transform .05s; box-shadow: 0 6px 14px -8px rgba(91, 75, 138, .7);
}
.btn:hover { background: var(--lav-700); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.sec { background: var(--surface); color: var(--text); border-color: var(--line-2); box-shadow: none; }
.btn.sec:hover { background: var(--lav-50); border-color: var(--lav-300); }
.btn.ghost { background: transparent; color: var(--lav-700); box-shadow: none; }
.btn.ghost:hover { background: var(--lav-50); }
.btn.ok { background: var(--ok); } .btn.ok:hover { background: #33734F; }
.btn.bad { background: var(--bad); } .btn.bad:hover { background: #A2414D; }
.btn.danger-ghost { background: transparent; color: var(--bad); box-shadow: none; }
.btn.danger-ghost:hover { background: var(--bad-50); }
.btn.sm { padding: 6px 11px; font-size: .82rem; border-radius: 9px; }
.btn.icon { padding: 7px; }
.btn.block { width: 100%; }

/* ---------------- Chips ---------------- */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: .76rem; font-weight: 600; background: var(--lav-50); color: var(--lav-700); white-space: nowrap; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.ok { background: var(--ok-50); color: var(--ok); }
.chip.bad { background: var(--bad-50); color: var(--bad); }
.chip.warn { background: var(--warn-50); color: var(--warn); }
.chip.gris { background: #F0EEF2; color: var(--muted); }
.chip.plain::before { display: none; }

/* ---------------- Tablas (se vuelven tarjetas en celular) ---------------- */
.tabla-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table.t { width: 100%; border-collapse: collapse; font-size: .9rem; }
.t th { text-align: left; font-weight: 600; color: var(--muted); font-size: .78rem; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr:hover { background: var(--surface-2); }
.t .r { text-align: right; } .t .c { text-align: center; }
.t td.r { font-variant-numeric: tabular-nums; white-space: nowrap; }
.t .sub { display: block; color: var(--muted); font-size: .8rem; }
.t tfoot td { font-weight: 700; border-top: 2px solid var(--line); border-bottom: 0; }
.raw td, .raw th { font-size: .82rem; padding: 7px 9px; white-space: nowrap; }
.raw td { border-right: 1px solid var(--line); }

/* ---------------- Formularios ---------------- */
.f { display: grid; gap: 14px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.l { display: grid; gap: 5px; font-size: .86rem; font-weight: 600; color: var(--text); }
.l .hint { font-weight: 400; color: var(--muted); font-size: .8rem; }
input, select, textarea {
  font: inherit; color: inherit; width: 100%; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--surface-2); transition: border .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--tenue); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--lav); box-shadow: 0 0 0 4px var(--lav-50); background: #fff; }
textarea { min-height: 80px; resize: vertical; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--lav); }
.check { display: flex; align-items: center; gap: 9px; font-size: .9rem; cursor: pointer; }
.drop {
  border: 2px dashed var(--lav-300); border-radius: var(--r); padding: 20px; text-align: center;
  background: var(--lav-50); cursor: pointer; display: grid; gap: 4px; place-items: center; color: var(--lav-700); transition: background .15s;
}
.drop:hover, .drop.has { background: var(--lav-100); }
.drop input { display: none; }
.drop .nombre { font-size: .84rem; color: var(--text); word-break: break-all; }
.drop svg.lucide { width: 26px; height: 26px; }

/* ---------------- Pestañas / filtros ---------------- */
.tabs { display: flex; gap: 4px; padding: 4px; background: #EDEAF2; border-radius: 14px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 7px 13px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: .86rem; white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { background: #fff; color: var(--lav-700); box-shadow: 0 1px 3px rgba(46, 40, 64, .12); }
.tabs .n { background: var(--lav); color: #fff; border-radius: 99px; padding: 0 7px; font-size: .74rem; }
.filtros { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.filtros select { width: auto; min-width: 150px; }

/* ---------------- Listas ---------------- */
.lista { list-style: none; margin: 0; padding: 0; }
.lista li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.lista li:last-child { border-bottom: 0; }
.lista .grow b { display: block; font-weight: 600; }
.lista .grow small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; background: var(--lav-50); color: var(--lav-700); }
.ico.ok { background: var(--ok-50); color: var(--ok); }
.ico.bad { background: var(--bad-50); color: var(--bad); }
.ico.warn { background: var(--warn-50); color: var(--warn); }
.foro-mini a.grow { color: var(--text); }
.foro-mini a.grow:hover { text-decoration: none; color: var(--lav-700); }
.foro-mini .hace { flex-shrink: 0; font-size: .74rem; }
.fecha-cal { width: 52px; flex-shrink: 0; border-radius: 12px; overflow: hidden; text-align: center; border: 1px solid var(--line); background: #fff; }
.fecha-cal span { display: block; background: var(--lav); color: #fff; font-size: .7rem; font-weight: 700; padding: 2px 0; text-transform: capitalize; }
.fecha-cal b { display: block; font-family: var(--f-titulo); font-size: 1.4rem; padding: 2px 0 3px; color: var(--ink); }

/* Barra de progreso */
.barra { height: 8px; border-radius: 99px; background: #EEEBF2; overflow: hidden; }
.barra i { display: block; height: 100%; border-radius: 99px; background: var(--lav); }
.barra.ok i { background: var(--salvia); }
.barra.bad i { background: #D88A93; }
.barra.oro i { background: linear-gradient(90deg, var(--lav), var(--salvia)); }

/* Gráfica de barras */
.chart { display: flex; align-items: flex-end; gap: 10px; height: 170px; padding-top: 10px; }
.chart .m { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; border-radius: 10px; }
.chart .bars { display: flex; gap: 3px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.chart .bars i { width: 42%; max-width: 20px; border-radius: 6px 6px 2px 2px; background: var(--lav); min-height: 2px; }
.chart .bars i.e { background: var(--lav-300); }
.chart small { font-size: .74rem; text-transform: capitalize; }
.leyenda { display: flex; gap: 14px; font-size: .8rem; color: var(--muted); }
.leyenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--lav); margin-right: 5px; vertical-align: -1px; }
.leyenda i.e { background: var(--lav-300); }

/* ---------------- Avisos flotantes ---------------- */
.flashes { position: fixed; top: 16px; right: 16px; z-index: 99; display: grid; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.flash {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--ink); color: #fff;
  box-shadow: var(--shadow-lg); font-size: .9rem; animation: entra .25s ease-out;
}
.flash.ok svg { color: #9FDCBD; } .flash.error svg { color: #F4A9B1; } .flash.warning svg { color: #F2CC85; }
.flash button { margin-left: auto; background: none; border: 0; color: #B9B0CC; cursor: pointer; padding: 0; }
@keyframes entra { from { opacity: 0; transform: translateY(-6px); } }
.nota { padding: 12px 14px; border-radius: var(--r); background: var(--lav-50); color: var(--lav-700); font-size: .88rem; display: flex; gap: 10px; align-items: flex-start; }
.nota.warn { background: var(--warn-50); color: #7A4F12; }
.nota.bad { background: var(--bad-50); color: #8A3440; }
.nota.ok { background: var(--ok-50); color: #2C6648; }
.vacio { text-align: center; padding: 36px 16px; color: var(--muted); }
.vacio svg.lucide { width: 34px; height: 34px; color: var(--lav-300); margin-bottom: 8px; }
.vacio b { display: block; color: var(--text); font-size: 1rem; margin-bottom: 4px; }

/* ---------------- Modales (<dialog>) ---------------- */
dialog {
  border: 0; border-radius: 22px; padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 40px);
  box-shadow: var(--shadow-lg); color: var(--text); background: #fff;
}
dialog::backdrop { background: rgba(46, 40, 64, .45); backdrop-filter: blur(3px); }
dialog[open] { animation: entra .2s ease-out; }
dialog h2 { font-family: var(--f-titulo); font-size: 1.4rem; font-weight: 600; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 0; }
.dlg-body { padding: 16px 20px 20px; }
.dlg-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }

/* ---------------- Permisos ---------------- */
.card .nav a { color: var(--text); }
.card .nav a svg { color: var(--lav); }
.card .nav a:hover { background: var(--lav-50); color: var(--text); }
.card .nav a.on { background: var(--lav); color: #fff; box-shadow: none; }
.card .nav a.on svg { color: #fff; }
.card .nav a.on small { color: #EAE4F6; }
.perm-mod { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: #fff; }
.perm-mod > header { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.perm-mod > header svg { color: var(--lav); }
.perm-mod > header b { flex: 1; }
.perm-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: .9rem; }
.perm-row:last-child { border-bottom: 0; }
.perm-row .desc { flex: 1; }
.perm-row .desc small { display: block; font-family: ui-monospace, monospace; font-size: .72rem; }
.switch { position: relative; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: #D9D4E1; border-radius: 99px; transition: .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.switch input:checked + span { background: var(--lav); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 3px solid var(--lav-300); outline-offset: 2px; }
.tri { display: inline-flex; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; flex-shrink: 0; }
.tri label { padding: 5px 10px; font-size: .78rem; font-weight: 600; cursor: pointer; color: var(--muted); border-left: 1px solid var(--line-2); }
.tri label:first-child { border-left: 0; }
.tri input { display: none; }
.tri input:checked + label { background: var(--lav-50); color: var(--lav-700); }
.tri input[value=si]:checked + label { background: var(--ok-50); color: var(--ok); }
.tri input[value=no]:checked + label { background: var(--bad-50); color: var(--bad); }
.hereda { font-size: .75rem; color: var(--muted); white-space: nowrap; }

/* ---------------- Estado de cuenta general (sábana) ---------------- */
.sabana-card { padding: 0; overflow: hidden; }
.sabana-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.desliza { display: none; margin: 0; padding: 10px 16px 0; font-size: .8rem; color: var(--muted); }
table.sabana { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .86rem; font-variant-numeric: tabular-nums; }
.sabana th { font-size: .76rem; font-weight: 600; color: var(--muted); padding: 12px 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
.sabana th.anual-h { color: var(--lav-700); }
.sabana th.hoy { color: var(--lav-700); box-shadow: inset 0 -2px 0 var(--lav); }
.sabana td { padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); }
.sabana tbody tr:hover td { background: var(--surface-2); }
.sabana .r { text-align: right; } .sabana .c { text-align: center; }
.sabana .sub { display: block; font-size: .74rem; color: var(--muted); font-weight: 400; max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.sabana .fija { position: sticky; left: 0; z-index: 2; min-width: 150px; padding-left: 18px; box-shadow: 1px 0 0 var(--line); }
.sabana th.fija { z-index: 3; }
.sabana td.celda { padding: 4px 3px; min-width: 58px; }
.celda { font-size: .78rem; font-weight: 600; }
.sabana td.pagado { background: var(--ok-50); color: var(--ok); }
.sabana td.vencido { background: var(--bad-50); color: var(--bad); }
.sabana td.parcial { background: var(--warn-50); color: #8A5A0E; }
.sabana td.por_vencer { background: #F3F1F6; color: var(--muted); font-weight: 500; }
.sabana td.vacia { color: #CBC6D3; }
.sabana tbody td.celda { border-left: 2px solid var(--surface); border-right: 2px solid var(--surface); }
.sabana tfoot td { background: var(--surface-2); border-bottom: 0; border-top: 2px solid var(--line); font-size: .8rem; }
.sabana td.c-saldo { font-weight: 700; padding-right: 18px; }
.sabana th:last-child { padding-right: 18px; }
.t-ok { color: var(--ok); } .t-bad { color: var(--bad); } .t-warn { color: var(--warn); }
.leyenda-sabana { display: flex; gap: 12px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin-left: auto; }
.leyenda-sabana span { display: inline-flex; align-items: center; gap: 5px; }
.leyenda-sabana i { width: 18px; height: 14px; border-radius: 4px; display: inline-grid; place-items: center; font-style: normal; font-size: .7rem; font-weight: 700; }
.leyenda-sabana i.pagado { background: var(--ok-50); color: var(--ok); }
.leyenda-sabana i.parcial { background: var(--warn-50); }
.leyenda-sabana i.vencido { background: var(--bad-50); }
.leyenda-sabana i.por_vencer { background: #F3F1F6; }
.leyenda-sabana i.vacia { background: #fff; border: 1px solid var(--line); color: #CBC6D3; }
.periodo-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.periodo-form label { display: grid; gap: 4px; font-size: .78rem; font-weight: 600; color: var(--muted); }
.periodo-form select { width: auto; min-width: 120px; }

/* ---------------- Cuotas ---------------- */
.seg { display: inline-flex; padding: 4px; background: #EDEAF2; border-radius: 14px; gap: 4px; width: fit-content; }
.seg input { position: absolute; opacity: 0; width: 0; }
.seg span { display: block; padding: 8px 16px; border-radius: 10px; font-weight: 600; font-size: .88rem; color: var(--muted); cursor: pointer; }
.seg input:checked + span { background: #fff; color: var(--lav-700); box-shadow: 0 1px 3px rgba(46, 40, 64, .12); }
.seg input:focus-visible + span { outline: 3px solid var(--lav-300); }
.deptos-check { max-height: 200px; overflow: auto; border: 1px solid var(--line-2); border-radius: 12px; padding: 10px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; font-weight: 400; }

/* ---------------- Departamentos ---------------- */
.nuevo-dueno { display: grid; gap: 12px; padding: 14px; border-radius: var(--r); background: var(--lav-50); border: 1px solid var(--lav-100); }

/* ---------------- Catálogos ---------------- */
.cat-layout { grid-template-columns: 275px minmax(0, 1fr); }
.cat-menu { padding: 10px; position: sticky; top: 70px; }
.cat-menu .nav-sec { color: var(--tenue); }
.cat-menu .nav a small { color: var(--muted); font-size: .76rem; }
.iconos { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.iconos input { position: absolute; opacity: 0; width: 0; }
.iconos span { display: grid; place-items: center; height: 42px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; color: var(--muted); background: #fff; }
.iconos input:checked + span { border-color: var(--lav); background: var(--lav-50); color: var(--lav-700); box-shadow: 0 0 0 2px var(--lav-50); }
.iconos input:focus-visible + span { outline: 3px solid var(--lav-300); }
details.ayuda { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; background: var(--surface-2); font-size: .9rem; }
details.ayuda summary { cursor: pointer; font-weight: 600; color: var(--lav-700); }
details.ayuda ol { margin: 10px 0 6px; padding-left: 20px; }
details.ayuda li { margin-bottom: 4px; }
.campos { font-size: .82rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.campos code { background: var(--lav-50); color: var(--lav-700); padding: 2px 7px; border-radius: 6px; font-size: .8rem; }
.guardar-fijo { position: sticky; bottom: 16px; display: flex; justify-content: flex-end; z-index: 5; }
.guardar-fijo .btn { padding: 12px 20px; box-shadow: var(--shadow-lg); }
.preview-correo { width: 100%; height: 560px; border: 1px solid var(--line); border-radius: var(--r); background: #F4F3F8; }

/* ---------------- Finanzas generales ---------------- */
.anios { display: flex; gap: 6px; flex-wrap: wrap; }
.anios select { width: auto; min-width: 110px; background: #fff; }
.chart.doce { height: 200px; gap: 6px; }
.chart.doce .bars i { width: 44%; }
.chart .bars i.g, .leyenda i.g { background: #E2A1A9; }
.chart .bars i.n, .leyenda i.n { background: var(--salvia); }
.chart .m.sel { background: var(--lav-50); }
.chart .m.sel small { color: var(--lav-700); font-weight: 700; }
.chart .m a { display: contents; color: inherit; }
.chart .m:hover { background: var(--surface-2); }
.cat-gasto { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 10px 8px; margin: 0 -8px; border-bottom: 1px solid var(--line); color: inherit; border-radius: 10px; }
.cat-gasto:last-child { border-bottom: 0; }
a.cat-gasto:hover { text-decoration: none; background: var(--surface-2); }
.cat-gasto .barra { grid-column: 1 / -1; height: 6px; }
.cat-gasto.on { background: var(--lav-50); }
.cat-gasto.on b { color: var(--lav-700); }
#finanzas, #lista { scroll-margin-top: 70px; }

/* ---------------- Foro ---------------- */
.foro-head { margin-bottom: 14px; }
.fijados { display: grid; gap: 6px; margin-bottom: 12px; }
.fijado-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 14px; background: #FFF8EC; border: 1px solid #F1E2C4; color: #6B5122; font-size: .88rem; }
.fijado-item svg { color: #C08A2E; margin-top: 2px; }
.fijado-item:hover { text-decoration: none; border-color: #E2C68F; }
.chat {
  position: relative; display: flex; flex-direction: column; height: calc(100vh - 210px); min-height: 340px;
  border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: #FCFBF9; box-shadow: var(--shadow);
}
.chat-lista { position: relative; flex: 1; overflow-y: auto; padding: 16px clamp(10px, 2vw, 22px) 10px; overscroll-behavior: contain; }
.ver-antes { display: flex; margin: 0 auto 10px; width: fit-content; }
.dia-sep, .sep-nuevos { display: flex; justify-content: center; margin: 16px 0 10px; position: relative; }
.dia-sep span { font-size: .74rem; font-weight: 600; color: var(--muted); background: #fff; border: 1px solid var(--line); padding: 3px 12px; border-radius: 99px; }
.sep-nuevos::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid #E8B4BB; }
.sep-nuevos span { font-size: .72rem; font-weight: 700; color: var(--bad); background: #FCFBF9; padding: 0 10px; position: relative; text-transform: uppercase; letter-spacing: .06em; }
.msj { display: flex; gap: 10px; align-items: flex-end; margin-top: 12px; max-width: min(720px, 88%); }
.msj.seguido { margin-top: 3px; }
.msj.seguido > .avatar { visibility: hidden; height: 0; }
.msj.seguido header { display: none; }
.msj > .avatar { width: 32px; height: 32px; font-size: .8rem; }
.msj.admin > .avatar { background: var(--salvia); color: #fff; }
.burbuja { background: #fff; border: 1px solid var(--line); border-radius: 18px 18px 18px 6px; padding: 8px 12px 6px; min-width: 120px; box-shadow: 0 1px 2px rgba(46, 40, 64, .05); }
.msj.mio { margin-left: auto; flex-direction: row-reverse; }
.msj.mio > .avatar { display: none; }
.msj.mio .burbuja { background: var(--lav-50); border-color: var(--lav-100); border-radius: 18px 18px 6px 18px; }
.msj.fijado .burbuja { box-shadow: 0 0 0 2px #EBD3A4; }
.msj.resalta .burbuja { animation: resalta 2.2s ease-out; }
@keyframes resalta { 0%, 40% { box-shadow: 0 0 0 3px var(--lav-300); } }
.burbuja header { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 2px; }
.burbuja header b { font-size: .84rem; color: var(--lav-700); }
.tag { font-size: .68rem; font-weight: 600; color: var(--muted); background: #F1EEF4; padding: 1px 7px; border-radius: 99px; display: inline-flex; gap: 3px; align-items: center; }
.tag.oro { color: #fff; background: var(--salvia); }
.tag svg.lucide { width: 11px; height: 11px; }
.burbuja .texto { overflow-wrap: anywhere; font-size: .94rem; line-height: 1.45; }
.burbuja .texto a { text-decoration: underline; }
.burbuja .foto { display: block; margin: 6px 0 2px; }
.burbuja .foto img { display: block; max-width: min(320px, 100%); max-height: 320px; border-radius: 12px; object-fit: cover; }
.burbuja footer { display: flex; align-items: center; justify-content: flex-end; gap: 2px; margin-top: 2px; }
.burbuja footer form { display: contents; }
.burbuja time { font-size: .7rem; color: var(--tenue); margin-right: 4px; }
.mini { background: none; border: 0; padding: 3px; border-radius: 6px; color: var(--tenue); cursor: pointer; display: grid; place-items: center; opacity: 0; transition: opacity .15s; }
.mini svg.lucide { width: 14px; height: 14px; }
.msj:hover .mini, .mini:focus-visible { opacity: 1; }
.mini:hover { color: var(--lav-700); background: var(--lav-50); }
.chat-vacio { margin: auto; }
.nuevos-abajo { position: absolute; left: 50%; transform: translateX(-50%); bottom: 82px; display: flex; gap: 6px; align-items: center;
  background: var(--lav); color: #fff; border: 0; border-radius: 99px; padding: 7px 14px; font: 600 .8rem var(--f-body); cursor: pointer; box-shadow: var(--shadow-lg); }
.chat-form { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--line); background: #fff; }
.adjuntar { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; cursor: pointer; color: var(--lav-700); flex-shrink: 0; background: var(--lav-50); }
.adjuntar:hover { background: var(--lav-100); }
.adjuntar input { display: none; }
.escribir { flex: 1; min-width: 0; display: grid; gap: 6px; }
.escribir textarea { min-height: 42px; max-height: 160px; resize: none; padding: 10px 14px; border-radius: 14px; line-height: 1.4; }
.adjunto { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted); }
.adjunto img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; }
.adjunto span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adjunto .mini { opacity: 1; }
.enviar { width: 46px; height: 42px; padding: 0; border-radius: 12px; flex-shrink: 0; }
.chat-solo-leer { display: flex; gap: 8px; align-items: center; justify-content: center; padding: 14px; margin: 0; border-top: 1px solid var(--line); font-size: .88rem; }

/* ---------------- Visitantes ---------------- */
.camara { position: relative; border-radius: 16px; overflow: hidden; background: #000; margin-bottom: 12px; aspect-ratio: 4 / 3; }
.camara video { width: 100%; height: 100%; object-fit: cover; display: block; }
.camara .mira { position: absolute; inset: 18% 22%; border: 3px solid rgba(255, 255, 255, .9); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .35); }
.escaner-nota { margin: 12px 0 0; font-size: .88rem; }
.codigo-form { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.codigo-fila { display: flex; gap: 8px; }
.codigo-fila input::placeholder { letter-spacing: normal; text-transform: none; font-weight: 400; font-size: .95rem; }
.codigo-fila input { text-transform: uppercase; letter-spacing: .25em; font-weight: 700; font-size: 1.1rem; }
.pase-wrap { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 22px; align-items: start; }
.pase { background: #fff; border-radius: 26px; overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.pase > header { display: flex; align-items: center; gap: 12px; padding: 18px 20px; color: #fff; background: linear-gradient(135deg, #8A79BC, #5F4F91); }
.pase > header .logo { width: 44px; height: 44px; flex-shrink: 0; }
.pase > header b { display: block; font-family: var(--f-titulo); font-size: 1.15rem; font-weight: 600; }
.pase > header small { color: rgba(255, 255, 255, .85); }
.pase-qr { position: relative; padding: 18px 34px 4px; }
.qr-svg { width: 100%; height: auto; display: block; }
.pase.inactivo .qr-svg { opacity: .18; filter: grayscale(1); }
.sello { position: absolute; inset: 0; display: grid; place-items: center; }
.sello .chip { font-size: 1rem; padding: 8px 16px; }
.pase-codigo { text-align: center; color: var(--muted); font-size: .85rem; }
.pase-codigo b { display: block; font-size: 1.7rem; letter-spacing: .3em; color: var(--lav-700); margin-top: 2px; padding-left: .3em; }
.pase-datos { margin: 14px 20px 0; padding: 12px 0 0; border-top: 1px dashed var(--line-2); display: grid; gap: 8px; }
.pase-datos div { display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; }
.pase-datos dt { color: var(--muted); }
.pase-datos dd { margin: 0; font-weight: 600; text-align: right; }
.pase-pie { text-align: center; font-size: .8rem; color: var(--muted); margin: 14px 20px 18px; }
.cuenta { font-size: .95rem; margin: 0 0 14px; padding: 10px 12px; border-radius: 12px; background: var(--ok-50); color: #2C6648; }
.cuenta.t-bad { background: var(--bad-50); color: var(--bad); }
.veredicto { display: flex; gap: 14px; align-items: center; padding: 18px 20px; border-radius: 20px; margin-bottom: 18px; color: #fff; background: var(--tenue); box-shadow: var(--shadow); }
.veredicto svg.lucide { width: 38px; height: 38px; flex-shrink: 0; }
.veredicto b { display: block; font-size: 1.3rem; font-family: var(--f-titulo); font-weight: 600; }
.veredicto small { color: rgba(255, 255, 255, .9); font-size: .92rem; }
.veredicto.vigente { background: linear-gradient(135deg, #5FA27F, #3E8A66); }
.veredicto.programada { background: linear-gradient(135deg, #8A79BC, #6B5AA0); }
.veredicto.adentro, .veredicto.salio { background: linear-gradient(135deg, #8B8696, #6E6779); }
.veredicto.vencida, .veredicto.cancelada { background: linear-gradient(135deg, #D06A75, #B4434F); }
.visitante { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.avatar.grande { width: 60px; height: 60px; font-size: 1.5rem; }
.datos-visita { margin: 0; display: grid; gap: 0; }
.datos-visita div { display: grid; grid-template-columns: 190px 1fr; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.datos-visita dt { color: var(--muted); display: flex; gap: 8px; align-items: center; font-size: .88rem; }
.datos-visita dt svg { width: 16px; height: 16px; color: var(--lav); }
.datos-visita dd { margin: 0; font-size: 1rem; }
.ine-drop { padding: 26px 16px; }
.ine-prev { max-width: 100%; max-height: 220px; border-radius: 10px; margin-top: 8px; }
.ine-foto { width: 100%; max-height: 360px; object-fit: contain; border-radius: 14px; background: var(--surface-3); display: block; }


/* Ficha "mi departamento" en el Inicio */
.mi-depto { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.dchip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; background: #fff; border: 1px solid var(--line); font-size: .85rem; color: var(--text); box-shadow: 0 1px 2px rgba(46, 40, 64, .05); }
.dchip svg.lucide { width: 15px; height: 15px; color: var(--lav); }
.dchip.fuerte { background: var(--lav); border-color: var(--lav); color: #fff; font-weight: 700; }
.dchip.fuerte svg.lucide { color: #fff; }
.dchip.aviso { background: var(--warn-50); border-color: transparent; color: #7A4F12; }
.dchip.aviso svg.lucide { color: var(--warn); }

/* ---------------- Login ---------------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art {
  color: #fff; padding: 44px 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
  background: radial-gradient(60% 50% at 50% 44%, #5C4C8C 0%, #3F3463 45%, #251F38 100%);
}
.login-arbol { position: relative; z-index: 1; width: min(470px, 82%, 56vh); margin: -10px auto; pointer-events: none; }
.login-arbol img { width: 100%; height: auto; display: block; mix-blend-mode: screen; animation: respira 7s ease-in-out infinite; }
@keyframes respira { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.12); } }
.login-brand { padding: 0; position: relative; z-index: 2; }
.login-brand small { color: rgba(255, 255, 255, .8); }
.login-texto { position: relative; z-index: 2; text-align: center; }
.login-art .pie { position: relative; z-index: 2; font-size: .82rem; color: rgba(255, 255, 255, .8); text-align: center; margin: 0; }
.logo-form { width: 64px; height: 64px; margin-bottom: 14px; border-radius: 50%; box-shadow: 0 10px 24px -10px rgba(46, 40, 64, .6); }
.login-art h1 { font-size: clamp(2.1rem, 3.5vw, 3rem); margin: 0 auto 8px; max-width: 16ch; color: #fff; }
.login-art p { color: rgba(255, 255, 255, .88); max-width: 40ch; margin: 0 auto; font-size: 1rem; }
.login-form { display: grid; place-items: center; padding: 32px 20px; background: var(--arena); }
.login-form .box { width: min(400px, 100%); background: #fff; padding: 32px 30px; border-radius: 24px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.login-form h2 { font-family: var(--f-titulo); font-size: 2rem; font-weight: 600; margin-bottom: 4px; }
.login-art .hojas-caen .t1 { fill: #F1D49A; } .login-art .hojas-caen .t2 { fill: #C9BDE6; } .login-art .hojas-caen .t3 { fill: #E2B66A; }
.login-art h1 { text-shadow: 0 2px 20px rgba(0, 0, 0, .3); }

/* ---------------- Impresión y hojas claras ---------------- */
body.claro { background: #fff; }
@media print {
  .side, .topbar, .bottom-nav, .no-print, .flashes { display: none !important; }
  .app { display: block; } .main { padding: 0; }
  .card { box-shadow: none; border: 0; padding: 0; }
  body { background: #fff; }
}

/* ---------------- Responsivo ---------------- */
@media (max-width: 1180px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1080px) {
  .cat-layout { grid-template-columns: 1fr; }
  .cat-menu { position: static; }
  .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .pase-wrap { grid-template-columns: minmax(0, 1fr); }
  .pase { max-width: 420px; margin: 0 auto; width: 100%; }
  .datos-visita div { grid-template-columns: 1fr; gap: 2px; }
  .veredicto b { font-size: 1.15rem; }
  :root { --side: 0px; }
  body { padding-bottom: 76px; }
  .app { display: block; }
  .side {
    position: fixed; left: 10px; top: 10px; bottom: 10px; height: auto; margin: 0; width: min(290px, calc(100vw - 56px)); z-index: 80;
    transform: translateX(calc(-100% - 16px)); transition: transform .32s cubic-bezier(.32, .72, 0, 1); padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
  .side-toggle { display: none; }
  body.drawer-open .side { transform: none; }
  body.drawer-open .drawer-bg { display: block; position: fixed; inset: 0; background: rgba(46, 40, 64, .4); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); z-index: 70; animation: entra .2s ease-out; }
  .topbar { background: rgba(247, 244, 239, .92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .topbar .solo-movil { display: flex; }
  .topbar .grow { display: none; }
  .logo-mini { width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; box-shadow: 0 4px 10px -4px rgba(46, 40, 64, .6); }
  .topbar b { font-family: var(--f-titulo); color: var(--ink); font-weight: 600; flex: 1; font-size: 1.12rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
  .campana { width: 38px; height: 38px; }
  .avisos-panel { position: fixed; left: 12px; right: 12px; top: 62px; width: auto; }
  .bottom-nav {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav a, .bottom-nav button {
    display: grid; justify-items: center; gap: 2px; padding: 6px 2px; color: var(--muted); font: 600 .68rem var(--f-body);
    background: none; border: 0; border-radius: 12px; cursor: pointer; position: relative;
  }
  .bottom-nav a.on { color: var(--lav-700); background: var(--lav-50); }
  .bottom-nav a:hover { text-decoration: none; }
  .bottom-nav svg.lucide { width: 21px; height: 21px; }
  .bottom-nav .punto { position: absolute; top: 4px; left: calc(50% + 7px); width: 9px; height: 9px; border-radius: 50%; background: var(--bad); border: 2px solid #fff; }
  .main { padding: 16px 14px 30px; }
  h1 { font-size: 1.75rem; }
  .page-head { margin-bottom: 16px; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn, .page-head .actions form { flex: 1; }
  .anios select { width: 100%; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .card { padding: 16px; border-radius: 18px; }
  .tabla-wrap { margin: 0 -16px; padding: 0 16px; }
  .flashes { top: auto; bottom: 84px; right: 12px; left: 12px; max-width: none; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { padding: 24px 22px 28px; }
  .login-arbol { width: min(270px, 70vw); margin: 0 auto -6px; }
  .login-art h1 { font-size: 1.8rem; }
  .login-art .hojas-caen i:nth-child(n+10) { display: none; }
  .login-art .pie { display: none; }
  .login-form { padding: 20px 14px 32px; }
  .login-form .box { padding: 24px 20px; margin-top: -22px; position: relative; z-index: 3; }
  .login-form .logo-form { display: none; }
  .fondo-arbol { width: 72px; height: 72px; box-shadow: 0 8px 20px -10px rgba(46, 40, 64, .55), 0 0 0 4px var(--lav-50); }
  .saldo, .fondo { padding: 22px 20px 20px; border-radius: 22px; }
  .saldo-arbol { width: 190px; right: -46px; top: -36px; }
  .chart.doce { height: 170px; gap: 3px; }
  .chart.doce small { font-size: .62rem; }
  .foro-head p { display: none; }
  .foro-head { margin-bottom: 10px; }
  .fijado-item span { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .main:has(.chat) { padding-bottom: 0; }
  .chat { min-height: 340px; margin: 0 -14px; border-radius: 0; border-left: 0; border-right: 0; }
  .msj { max-width: 92%; }
  .mini { opacity: .7; }
  .nuevos-abajo { bottom: 76px; }

  /* Tablas → tarjetas */
  table.t.resp thead { display: none; }
  table.t.resp, .t.resp tbody, .t.resp tr, .t.resp td { display: block; width: 100%; }
  .t.resp tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .t.resp tr:last-child { border-bottom: 0; }
  .t.resp td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; flex-wrap: wrap; }
  .t.resp td::before { content: attr(data-l); color: var(--muted); font-size: .82rem; text-align: left; flex-shrink: 0; }
  .t.resp td.titulo { display: block; text-align: left; font-size: .98rem; padding-bottom: 6px; }
  .t.resp td.titulo::before { display: none; }
  .t.resp td.acc { justify-content: flex-end; padding-top: 8px; }
  .t.resp td.acc::before { display: none; }
  .t.resp td:empty { display: none; }
  .t.resp td .sub { flex-basis: 100%; text-align: right; }
  .t.resp td.titulo .sub { text-align: left; }
  .t.resp tfoot { display: block; }
  .t.resp tbody tr:hover { background: none; }
  .desliza { display: block; }
  .sabana .fija { min-width: 116px; padding-left: 12px; }
  .sabana .sub { max-width: 110px; }
  .leyenda-sabana { margin-left: 0; width: 100%; }
  .grid.totales { grid-template-columns: 1fr 1fr; gap: 10px; }
  .periodo-form label { flex: 1; }
  .periodo-form select { min-width: 0; width: 100%; }
}
@media (max-width: 480px) {
  .g4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .g4 .stat, .g22 .stat { min-width: 0; }
  .g22 { gap: 10px; }
  .stat { padding: 12px 14px; }
  .stat .val { font-size: 1.15rem; }
  .fondo-anio { grid-template-columns: 1fr 1fr; }
  .fondo-anio > div:last-child { grid-column: 1 / -1; }
}
/* ---------------- Paquetería ---------------- */
:root { --ease-out: cubic-bezier(.23, 1, .32, 1); --ease-in-out: cubic-bezier(.77, 0, .175, 1); }
@keyframes paq-entra { from { opacity: 0; transform: translateY(6px); } }
@keyframes paq-zoom { from { opacity: 0; transform: scale(.96); } }
@keyframes paq-sacude { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
@keyframes paq-linea { from { top: 8%; } to { top: 92%; } }

.paq-inicio { margin-bottom: 18px; }
.paq-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.paq-item {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); animation: paq-entra .32s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 45ms);
}
.paq-item .grow { min-width: 0; }
.paq-item .grow b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.paq-item .grow small { display: block; }
.paq-ico { width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; display: grid; place-items: center; background: var(--lav-50); color: var(--lav-700); }
.paq-ico svg.lucide { width: 22px; height: 22px; }
.paq-ico.ok { background: var(--ok-50); color: var(--ok); }
.paq-item.viejo .paq-ico { background: var(--warn-50); color: var(--warn); }

/* Presionar se siente: escala corta y rápida, sólo en este módulo */
.paq-item .btn, .dlg-qr .btn, #dlg-paq .btn, #dlg-entrega .btn, .paq-tabla .btn, .paq-aviso .btn { transition: background .15s, box-shadow .15s, transform .16s var(--ease-out); }
.paq-item .btn:active, #dlg-paq .btn:active, #dlg-entrega .btn:active, .paq-tabla .btn:active, .paq-aviso .btn:active { transform: scale(.97); }

/* Código QR del vecino */
.dlg-qr { width: min(380px, calc(100vw - 24px)); }
.qr-ayuda { margin: 0 0 14px; font-size: .88rem; }
.qr-caja { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 10px; animation: paq-zoom .28s var(--ease-out) .04s both; }
.qr-caja svg { display: block; width: 100%; height: auto; }
.codigo-grande {
  margin-top: 14px; text-align: center; font: 700 2.1rem/1 var(--f-body); letter-spacing: .14em; color: var(--ink);
  font-variant-numeric: tabular-nums; animation: paq-entra .3s var(--ease-out) .1s both;
}
.codigo-grande span { display: inline-block; width: .4em; }
.qr-pie { margin: 10px 0 0; text-align: center; font-size: .82rem; color: var(--muted); }

/* Lista de recepción */
/* Pestañas: ícono arriba, texto abajo (Todas · Hoy · Sin recoger · En bodega · Entregado) */
.paq-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-bottom: 1px solid var(--line); margin: -4px -4px 16px; }
.paq-tabs a {
  position: relative; display: grid; justify-items: center; gap: 4px; padding: 10px 4px 12px; color: var(--muted);
  font-size: .8rem; font-weight: 600; text-align: center; border-radius: 10px 10px 0 0; transition: color .15s, background .15s;
}
.paq-tabs a:hover { color: var(--text); background: var(--lav-50); text-decoration: none; }
.paq-tabs a:active .ico { transform: scale(.92); }
.paq-tabs a.on { color: var(--lav-700); }
.paq-tabs a::after {
  content: ""; position: absolute; left: 22%; right: 22%; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0;
  background: var(--lav); transform: scaleX(0); transition: transform .22s var(--ease-out);
}
.paq-tabs a.on::after { transform: scaleX(1); }
.paq-tabs .ico { position: relative; display: grid; place-items: center; transition: transform .16s var(--ease-out); }
.paq-tabs .ico svg.lucide { width: 22px; height: 22px; }
.paq-tabs .n { position: absolute; top: -7px; left: 14px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--lav); color: #fff; font-size: .68rem; line-height: 18px; animation: paq-zoom .22s var(--ease-out); }
.paq-tabs .txt { line-height: 1.2; }

.paq-buscar { position: relative; display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
.paq-resultados { margin: 0 0 12px; font-size: .86rem; color: var(--muted); animation: paq-entra .22s var(--ease-out); }
.paq-buscar svg.lucide { position: absolute; left: 12px; width: 18px; height: 18px; color: var(--tenue); pointer-events: none; }
.paq-buscar input[name=q] { padding-left: 40px; flex: 1; min-width: 0; }

/* Recordatorio: pasar a bodega */
.paq-aviso { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 14px; border-radius: var(--r); background: var(--warn-50); border: 1px solid rgba(201, 138, 46, .25); animation: paq-entra .26s var(--ease-out); }
.paq-aviso .grow { min-width: 0; }
.paq-aviso b { display: block; font-size: .9rem; }
.paq-aviso small { display: block; font-size: .8rem; color: var(--muted); }
.paq-ico.warn { background: #fff; color: var(--warn); }
.chip.bodega svg.lucide { width: 13px; height: 13px; }
.paq-lugar { display: inline-flex; align-items: center; gap: 3px; color: var(--lav-700); font-weight: 600; }
.paq-lugar svg.lucide { width: 13px; height: 13px; }
.qr-bodega { margin: -4px 0 12px; }
.tag.bodega { background: var(--warn-50); color: var(--warn); margin-right: 4px; }

.paq-celda { display: flex; align-items: center; gap: 12px; }
.paq-mini { width: 42px; height: 42px; flex-shrink: 0; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: var(--lav-50); color: var(--lav-300); object-fit: cover; }
.paq-mini img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s var(--ease-out); }
.paq-mini:hover img { transform: scale(1.06); }
.paq-mini svg.lucide { width: 20px; height: 20px; }
.paq-tabla tr.viejo td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.paq-obs { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.paq-foot { flex-wrap: wrap; }

/* Entrega: escáner y confirmación */
.paso.entra { animation: paq-entra .26s var(--ease-out); }
.scan { position: relative; aspect-ratio: 1 / 1; max-height: 52vh; margin: 0 auto 14px; border-radius: 18px; overflow: hidden; background: #1E1928; }
.scan video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-marco {
  position: absolute; inset: 16%; border-radius: 18px; border: 2px solid rgba(255, 255, 255, .9);
  box-shadow: 0 0 0 999px rgba(30, 25, 40, .38); transition: border-color .2s, transform .25s var(--ease-out);
}
.scan-linea { position: absolute; left: 8%; right: 8%; height: 2px; border-radius: 2px; background: var(--lav-300); box-shadow: 0 0 12px var(--lav-300); animation: paq-linea 1.8s var(--ease-in-out) infinite alternate; }
.scan-txt { position: absolute; left: 0; right: 0; bottom: 10px; margin: 0; text-align: center; color: #fff; font-size: .84rem; font-weight: 600; text-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.scan.ok .scan-marco { border-color: #8FD3AE; transform: scale(.96); }
.scan.ok .scan-linea { display: none; }
.codigo-input { font: 700 1.7rem/1.2 var(--f-body) !important; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; padding-left: .4em !important; }
.codigo-input.sacude { animation: paq-sacude .32s var(--ease-out); }
.codigo-input[aria-invalid=true] { border-color: var(--bad); }
.campo-error.sacude { animation: paq-sacude .32s var(--ease-out); }
/* Buscador de vecinos */
.buscador { display: grid; gap: 6px; min-width: 0; }
.buscador-campo { position: relative; }
.buscador-campo svg.lucide { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.buscador-campo input { padding-left: 40px; }
.buscador-campo input::-webkit-search-cancel-button { cursor: pointer; }
.buscador-lista {
  list-style: none; margin: 0; padding: 4px; max-height: 248px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); box-shadow: var(--shadow); transform-origin: top; animation: paq-lista .18s var(--ease-out);
}
@keyframes paq-lista { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.buscador-lista [role=option] { display: flex; align-items: center; gap: 10px; padding: 8px 10px; min-height: 44px; border-radius: 10px; cursor: pointer; transition: background .12s; }
.buscador-lista [role=option] .grow { min-width: 0; }
.buscador-lista [role=option] b { display: block; font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.buscador-lista [role=option][aria-selected=true], .buscador-lista [role=option]:hover { background: var(--lav-50); }
.buscador-lista .avatar, .vecino-elegido .avatar { width: 32px; height: 32px; flex-shrink: 0; font-size: .85rem; }
.buscador-vacio p { margin: 0; }
.buscador-vacio { padding: 12px; font-size: .86rem; color: var(--muted); display: grid; gap: 8px; justify-items: start; }
.vecino-elegido { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--ok); background: var(--ok-50); border-radius: var(--r); animation: paq-zoom .22s var(--ease-out); }
.vecino-elegido .grow { min-width: 0; }
.vecino-elegido b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vecino-elegido small { display: block; color: #2C6648; }
.vecino-elegido .avatar { background: #fff; color: var(--ok); }
#dlg-paq .seg { width: 100%; } #dlg-paq .seg label { flex: 1; text-align: center; }
.campo-error { margin: -6px 0 0; color: var(--bad); font-size: .84rem; font-weight: 600; }
.entrega-depto { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r); background: var(--ok-50); }
.entrega-depto small { display: block; color: #2C6648; }
.entrega-depto b { font-size: 1.25rem; color: var(--ink); }
.entrega-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.entrega-lista li { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; animation: paq-entra .28s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 50ms + 60ms); }
.entrega-lista .check { gap: 10px; }
.entrega-lista .grow { min-width: 0; }
.entrega-lista .grow b { display: block; font-size: .88rem; }
.entrega-lista .grow small { display: block; font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entrega-lista .paq-mini { width: 38px; height: 38px; }

/* Bitácora de paquetería */
.dlg-bitacora { width: min(520px, calc(100vw - 24px)); }
.bit-resumen { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r); background: var(--lav-50); margin-bottom: 16px; }
.bit-resumen .grow { min-width: 0; }
.bit-resumen b { display: block; }
.bit-resumen small { display: block; font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bitacora { list-style: none; margin: 0; padding: 0; position: relative; }
.bitacora li { position: relative; display: flex; gap: 12px; padding: 0 0 18px; animation: paq-entra .28s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 55ms); }
.bitacora li:not(:last-child)::before { content: ""; position: absolute; left: 15px; top: 34px; bottom: 2px; width: 2px; background: var(--line); border-radius: 2px; }
.bitacora li:last-child { padding-bottom: 0; }
.bitacora b { display: block; font-size: .92rem; }
.bitacora small { display: block; font-size: .8rem; color: var(--muted); }
.bit-detalle { display: inline-block; margin-top: 4px; font-size: .82rem; padding: 2px 8px; border-radius: 8px; background: #F4F2F7; }
.bit-vacia { color: var(--muted); font-size: .88rem; }
.bit-punto { width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: var(--lav-50); color: var(--lav-700); }
.bit-punto svg.lucide { width: 16px; height: 16px; }
.bit-a_bodega .bit-punto { background: var(--warn-50); color: var(--warn); }
.bit-a_recepcion .bit-punto { background: #EEF0F7; color: #4A5A8A; }
.bit-entregado .bit-punto { background: var(--ok-50); color: var(--ok); }
.bit-eliminado .bit-punto { background: var(--bad-50); color: var(--bad); }
.bit-cargando { display: flex; gap: 6px; justify-content: center; padding: 28px 0; }
.bit-cargando span { width: 8px; height: 8px; border-radius: 50%; background: var(--lav-300); animation: bit-pulso 1s var(--ease-in-out) infinite; }
.bit-cargando span:nth-child(2) { animation-delay: .15s; } .bit-cargando span:nth-child(3) { animation-delay: .3s; }
@keyframes bit-pulso { 0%, 100% { opacity: .3; transform: scale(.8); } 50% { opacity: 1; transform: scale(1); } }

.volver { display: inline-flex; align-items: center; gap: 4px; font-size: .84rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.volver svg.lucide { width: 16px; height: 16px; transition: transform .16s var(--ease-out); }
.volver:hover svg.lucide { transform: translateX(-3px); }
.bit-filtros { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 12px; align-items: end; }
.bit-filtros-acc { display: flex; gap: 8px; }
.bit-filtros select, .bit-filtros input { height: 44px; }
.nowrap { white-space: nowrap; }
.bit-dia { animation: paq-entra .3s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 50ms); }
.bit-lista { list-style: none; margin: 0; padding: 0; }
.bit-lista li { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-top: 1px solid var(--line); }
.bit-lista li:first-child { border-top: 0; }
.bit-lista time { width: 44px; flex-shrink: 0; font-variant-numeric: tabular-nums; font-size: .84rem; color: var(--muted); font-weight: 600; }
.bit-lista .grow { min-width: 0; font-size: .9rem; }
.bit-lista small { display: block; font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bit-folio { font: inherit; font-weight: 700; color: var(--lav-700); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-decoration-color: var(--lav-300); text-underline-offset: 3px; }
.bit-folio:hover { text-decoration-color: currentColor; }
.bit-folio.tachado { color: var(--muted); text-decoration: line-through; cursor: default; }
@media (max-width: 900px) { .bit-filtros { grid-template-columns: 1fr 1fr; } .bit-filtros-acc { grid-column: 1 / -1; } .bit-filtros-acc .btn { flex: 1; } }

/* Visor de fotos de paquetes */
.dlg-foto { width: min(760px, calc(100vw - 24px)); overflow: hidden; }
.dlg-foto[open] { animation: paq-zoom .22s var(--ease-out); }
.dlg-foto .dlg-head { padding-bottom: 12px; }
.dlg-foto h2 { font-size: 1.15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foto-marco { background: #1E1928; display: grid; place-items: center; min-height: 240px; max-height: calc(100vh - 200px); }
.foto-marco img { max-width: 100%; max-height: calc(100vh - 200px); object-fit: contain; display: block; transition: opacity .2s var(--ease-out); }
.foto-marco.cargando img { opacity: 0; }
.foto-marco.cargando { background: #1E1928 linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .06) 50%, transparent 70%) 0 0 / 200% 100%; animation: paq-brillo 1.1s linear infinite; }
@keyframes paq-brillo { to { background-position: -200% 0; } }
.foto-pie { display: flex; justify-content: flex-end; padding: 12px 20px 16px; }
/* Foto del paquete: cámara o archivo */
#dlg-paq .f, #dlg-entrega .f, #dlg-dev .f { grid-template-columns: minmax(0, 1fr); }  /* nombres largos no ensanchan el modal */
#dlg-paq, #dlg-entrega { overflow-x: hidden; }
.foto-paq { min-width: 0; border: 1.5px dashed var(--lav-300); border-radius: var(--r); background: var(--lav-50); padding: 14px; }
.foto-vacia { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; }
.foto-vacia > svg.lucide { width: 26px; height: 26px; color: var(--lav-700); }
.foto-vacia b { display: block; color: var(--lav-700); font-size: .9rem; }
.foto-vacia small { display: block; font-size: .8rem; }
.foto-botones { grid-column: 1 / -1; display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.foto-botones .btn { flex: 1 1 140px; }
.foto-lista { display: flex; align-items: center; gap: 12px; animation: paq-entra .26s var(--ease-out); }
.foto-lista img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex-shrink: 0; animation: paq-zoom .28s var(--ease-out); }
.foto-lista .grow { min-width: 0; }
.foto-lista .grow b { display: block; font-size: .9rem; color: var(--ok); }
.foto-lista .grow small { display: block; font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.solo-tactil { display: none !important; }
@media (pointer: coarse) { .solo-tactil { display: inline-flex !important; } }

@media (max-width: 600px) {
  .solo-escritorio { display: none; }
  .paq-item { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px 12px; }
  .paq-item .btn { grid-column: 1 / -1; width: 100%; padding: 11px 16px; }
  .paq-tabs { margin-left: -8px; margin-right: -8px; }
  .paq-tabs a { font-size: .7rem; padding: 8px 2px 10px; }
  .paq-tabs .ico svg.lucide { width: 20px; height: 20px; }
  .paq-aviso { flex-wrap: wrap; }
  .paq-aviso .btn { width: 100%; }
  .paq-foot .grow { display: none; }
  .paq-foot .btn { flex: 1 1 auto; }
}

/* ---------------- Vacaciones ---------------- */
.txt-warn { color: var(--warn); font-weight: 600; }
.vac-saldo {
  display: grid; gap: 14px; padding: 22px 24px; margin-bottom: 18px; border-radius: var(--r); color: #fff;
  background: linear-gradient(135deg, #6F5BA7, #8C79C2); box-shadow: var(--shadow); animation: paq-entra .32s var(--ease-out);
}
.vac-saldo-main { display: grid; gap: 2px; }
.vac-saldo-lbl { display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; opacity: .9; }
.vac-saldo-lbl svg.lucide { width: 18px; height: 18px; }
.vac-num { font: 700 3.2rem/1 var(--f-titulo, inherit); font-variant-numeric: tabular-nums; }
.vac-saldo-sub { font-size: .88rem; opacity: .9; }
.vac-saldo .vac-barra { background: rgba(255, 255, 255, .22); }
.vac-saldo .vac-barra .u { background: #fff; }
.vac-saldo .vac-barra .p { background: rgba(255, 255, 255, .55); }
.vac-saldo .vac-leyenda { color: #fff; }
.vac-saldo .dot.u { background: #fff; }
.vac-saldo .dot.p { background: rgba(255, 255, 255, .55); }
.vac-saldo .dot.d { background: rgba(255, 255, 255, .22); border-color: rgba(255, 255, 255, .5); }

/* Barra usados + por autorizar (anima con transform, no con width) */
.vac-barra { position: relative; display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--lav-50); }
.vac-barra.sm { height: 6px; margin-top: 8px; }
.vac-barra span { height: 100%; width: calc(var(--w) * 1%); transform-origin: left; animation: vac-llena .5s var(--ease-out) both; }
.vac-barra .u { background: var(--lav); }
.vac-barra .p { background: var(--lav-300); animation-delay: .08s; }
@keyframes vac-llena { from { transform: scaleX(0); } }
.vac-leyenda { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .82rem; color: var(--muted); }
.vac-leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.u { background: var(--lav); } .dot.p { background: var(--lav-300); } .dot.d { background: var(--lav-50); border: 1px solid var(--line); }
.dot.f { background: var(--warn-50); border: 1px solid var(--warn); }

.vac-split { align-items: start; }
.vac-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.vac-sol { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; animation: paq-entra .28s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 45ms); }
.vac-sol.pendiente { border-left: 3px solid var(--warn); }
.vac-sol.aprobada { border-left: 3px solid var(--ok); }
.vac-sol.rechazada, .vac-sol.cancelada { opacity: .8; }
.vac-sol-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.vac-sol-top .grow { min-width: 0; }
.vac-sol-top b { display: block; }
.vac-sol-top small { display: block; font-size: .82rem; color: var(--muted); }
.vac-sol-top small b { display: inline; color: var(--text); }
.vac-coment { margin: 8px 0 0; font-size: .86rem; font-style: italic; color: var(--muted); }
.vac-quien { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; font-size: .82rem; color: var(--muted); }
.vac-quien svg.lucide { width: 15px; height: 15px; flex-shrink: 0; }
.vac-sol form { margin-top: 8px; }
.vac-cruce { margin: 10px 0 0; }
.vac-sol .btn, .vac-saldos .btn, #dlg-pedir .btn, #dlg-rechazar .btn, #dlg-cancelar .btn { transition: background .15s, transform .16s var(--ease-out); }
.vac-sol .btn:active, #dlg-pedir .btn:active, #dlg-rechazar .btn:active, #dlg-cancelar .btn:active { transform: scale(.97); }

.vac-calc { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--lav-50); font-size: .88rem; transition: background .2s, color .2s; }
.vac-calc.bien { background: var(--ok-50); color: #2C6648; }
.vac-calc.mal { background: var(--bad-50); color: var(--bad); }

.vac-festivos { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.vac-festivos li { display: flex; align-items: center; gap: 12px; font-size: .9rem; }
.vac-festivos .grow small { display: block; font-size: .78rem; color: var(--muted); text-transform: capitalize; }
.vac-fecha { width: 42px; height: 42px; flex-shrink: 0; border-radius: 10px; display: grid; place-content: center; text-align: center; background: var(--warn-50); color: var(--warn); line-height: 1.05; }
.vac-fecha b { font-size: 1.05rem; } .vac-fecha small { font-size: .66rem; text-transform: uppercase; font-weight: 600; }

.vac-saldos { list-style: none; margin: 0; padding: 0; }
.vac-saldos li { padding: 10px 0; border-top: 1px solid var(--line); animation: paq-entra .26s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 40ms); }
.vac-saldos li:first-child { border-top: 0; padding-top: 0; }
.vac-saldos-top { display: flex; align-items: center; gap: 10px; }
.vac-saldos-top .grow { min-width: 0; }
.vac-saldos-top a { color: inherit; }
.vac-saldos-top small { display: block; font-size: .8rem; color: var(--muted); }
.vac-disp { display: grid; justify-items: end; line-height: 1.1; }
.vac-disp b { font-size: 1.3rem; color: var(--lav-700); font-variant-numeric: tabular-nums; }
.vac-disp small { font-size: .7rem; color: var(--muted); }
.vac-mini { display: block; margin-top: 4px; font-size: .76rem; color: var(--muted); }
.vac-filtro select { min-width: 200px; }

/* Panel admin: vigilantes a la izquierda, calendario a la derecha */
.vac-panel { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(0, 1.9fr); gap: 18px; align-items: start; margin-bottom: 18px; }
.vac-panel > .card { margin: 0; }
@media (max-width: 1000px) { .vac-panel { grid-template-columns: 1fr; } }
a.stat.vac-stat-link { color: inherit; text-decoration: none; transition: transform .16s var(--ease-out), box-shadow .2s; }
a.stat.vac-stat-link:active { transform: scale(.98); }

.vac-vigs .vac-saldos li { padding: 4px 0 10px; }
.vac-vig {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; margin: 0 -8px; border: 0; border-radius: 12px;
  background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; text-decoration: none;
  transition: background .15s, transform .16s var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { .vac-vig:hover { background: var(--lav-50); text-decoration: none; } }
.vac-vig:active { transform: scale(.98); }
.vac-vig .grow { min-width: 0; }
.vac-vig b { display: block; }
.vac-vig small { display: block; font-size: .8rem; color: var(--muted); }
.vac-vig .avatar { width: 36px; height: 36px; flex-shrink: 0; }
.vac-vig-ir { width: 18px; height: 18px; color: var(--tenue); flex-shrink: 0; transition: transform .16s var(--ease-out); }
.vac-vig:hover .vac-vig-ir { transform: translateX(2px); }
.vac-vigs .vac-barra.sm { margin: 4px 0 0 46px; }
.con-pend .avatar { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--warn); }
.vac-aviso {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; padding: 2px 9px 2px 7px; border-radius: 99px;
  background: var(--warn-50); color: var(--warn); font-size: .76rem; font-weight: 700; animation: paq-zoom .24s var(--ease-out) .15s both;
}
.vac-aviso i { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }

/* Vigilantes: datos pendientes */
.vig-aviso-top { margin: 0 0 16px; }
.vig-card.incompleto { box-shadow: inset 3px 0 0 var(--warn), var(--shadow-sm, 0 1px 2px rgba(0,0,0,.04)); }
.vig-falta { margin-top: 10px; border: 0; font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer; transition: transform .16s var(--ease-out), background .15s; }
button.vig-falta:hover { background: #F7E3C8; }
button.vig-falta:active { transform: scale(.97); }
.vig-con-usuario { width: 13px; height: 13px; vertical-align: -2px; color: var(--ok); }

/* Tipos de solicitud: vacaciones · permiso · incapacidad */
:root { --t-vac: var(--lav); --t-per: #3F7FB8; --t-per-50: #E8F1FA; --t-inc: #C0505C; --t-inc-50: #FBEBED; }
.vac-tipos { width: 100%; }
.vac-tipos label { flex: 1; text-align: center; }
.vac-tipos span { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 100%; }
.vac-tipos svg.lucide { width: 16px; height: 16px; }
.vac-tipo { display: inline-block; margin-bottom: 2px; padding: 1px 7px; border-radius: 6px; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; background: var(--lav-50); color: var(--lav-700); }
.vac-tipo.permiso { background: var(--t-per-50); color: var(--t-per); }
.vac-tipo.incapacidad { background: var(--t-inc-50); color: var(--t-inc); }
.vcal-dia.propia.permiso { background: var(--t-per-50); color: var(--t-per); }
.vcal-dia.propia.incapacidad { background: var(--t-inc-50); color: var(--t-inc); }
.cal-vig.permiso { background: var(--t-per); }
.cal-vig.incapacidad { background: var(--t-inc); }
.cal-vig.pendiente.permiso { background: #fff; color: var(--t-per); border-color: var(--t-per); }
.cal-vig.pendiente.incapacidad { background: #fff; color: var(--t-inc); border-color: var(--t-inc); }
.dot.per { background: var(--t-per); } .dot.inc { background: var(--t-inc); }
.vac-leyenda svg.lucide { width: 14px; height: 14px; }
.vac-saldo .vac-sep { padding-left: 14px; border-left: 1px solid rgba(255, 255, 255, .3); }
.vac-comprobante { display: block; cursor: pointer; padding: 12px; transition: background .15s, border-color .15s; }
.vac-comprobante[hidden] { display: none; }
.vac-comprobante.listo { border-style: solid; border-color: var(--ok); background: var(--ok-50); }
.vac-comprobante.listo b, .vac-comprobante.listo svg.lucide { color: var(--ok); }
.vac-comprobante .foto-vacia { grid-template-columns: auto 1fr; }
.vac-comprobante:focus-within { box-shadow: 0 0 0 3px var(--lav-50); }
.vac-nota { margin: 0; font-size: .8rem; }
.vac-pedir-acc .btn[type=submit] span { pointer-events: none; }
@media (max-width: 480px) { .vac-tipos span { flex-direction: column; gap: 2px; font-size: .78rem; } }

/* Tarjeta de vigilantes: buscador y límite de 5 */
.vac-buscar { position: relative; margin-bottom: 10px; }
.vac-buscar svg.lucide { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--tenue); pointer-events: none; }
.vac-buscar input { width: 100%; padding-left: 38px; }
.vac-saldos li[hidden] { display: none; }
.vac-sin-res { margin: 8px 0 0; font-size: .86rem; color: var(--muted); text-align: center; }
.vac-ver-todos { width: 100%; margin-top: 6px; justify-content: center; }

/* Historial en modal */
.dlg-historial { width: min(640px, calc(100vw - 24px)); }
.hist-filtro { display: block; margin-bottom: 12px; }
.hist-filtro select { width: 100%; }
.vac-hist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.vac-hist li { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; animation: paq-entra .2s var(--ease-out); }
.vac-hist li[hidden] { display: none; }
.vac-hist li.aprobada { border-left: 3px solid var(--ok); }
.vac-hist li.pendiente { border-left: 3px solid var(--warn); }
.vac-hist li.rechazada, .vac-hist li.cancelada { opacity: .8; }
.vac-hist-top { display: flex; align-items: center; gap: 10px; }
.vac-hist-top .grow { min-width: 0; }
.vac-hist-top b { display: block; font-size: .92rem; }
.vac-hist-top small { display: block; font-size: .8rem; color: var(--muted); }
.vac-hist .vac-quien, .vac-hist .vac-coment { font-size: .8rem; margin-top: 6px; }
.vac-hist .vac-pend-acc { justify-content: flex-start; margin-top: 6px; }
.vac-vigs .card-head { align-items: flex-start; }
.dlg-vig-sub { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 12px; font-size: .86rem; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Ventana del vigilante con sus pendientes */
.dlg-vig { width: min(520px, calc(100vw - 24px)); }
.dlg-vig-quien { display: flex; align-items: center; gap: 12px; min-width: 0; }
.dlg-vig-quien small { display: block; font-size: .82rem; color: var(--muted); }
.dlg-vig-quien .avatar { width: 40px; height: 40px; }
.vac-pend { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.vac-pend li { border: 1px solid var(--line); border-left: 3px solid var(--warn); border-radius: var(--r); padding: 12px 14px; animation: paq-entra .26s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 50ms + 60ms); }
.vac-pend-fechas { display: flex; align-items: center; gap: 8px; }
.vac-pend-fechas > svg.lucide { width: 16px; height: 16px; color: var(--tenue); }
.vac-pend-fechas .vac-fecha { background: var(--lav-50); color: var(--lav-700); }
.vac-pend-fechas .grow { margin-left: 6px; }
.vac-pend-fechas .grow b { display: block; }
.vac-pend-fechas .grow small { display: block; font-size: .78rem; color: var(--muted); }
.vac-pend-acc { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.vac-pend-acc .btn { transition: background .15s, transform .16s var(--ease-out); }
.vac-pend-acc .btn:active { transform: scale(.97); }
.vac-rechazo { margin-top: 10px; display: grid; gap: 4px; animation: paq-entra .2s var(--ease-out); }
.vac-rechazo[hidden] { display: none; }
@media (max-width: 600px) { .vac-pend-acc > *, .vac-pend-acc form .btn { flex: 1; width: 100%; } }

/* Calendario */
.cal { display: grid; gap: 4px; }
.cal-dias, .cal-semana { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dias span { text-align: center; font-size: .74rem; font-weight: 700; color: var(--muted); padding-bottom: 2px; }
.cal-dia { min-height: 74px; padding: 5px; border-radius: 10px; background: #FAF9FC; border: 1px solid transparent; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-dia.fuera { opacity: .35; }
.cal-dia.hoy { border-color: var(--lav); background: #fff; }
.cal-dia.hoy .cal-num { background: var(--lav); color: #fff; }
.cal-dia.festivo { background: var(--warn-50); }
.cal-num { align-self: flex-start; min-width: 22px; height: 22px; padding: 0 4px; border-radius: 99px; display: grid; place-items: center; font-size: .78rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.cal-fest { font-size: .64rem; line-height: 1.2; color: var(--warn); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-vig { font-size: .68rem; font-weight: 600; padding: 1px 6px; border-radius: 6px; background: var(--lav); color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-vig.pendiente { background: #fff; color: var(--lav-700); border: 1px dashed var(--lav-300); }

/* Calendario para elegir vacaciones (vigilante) */
.vcal { border: 1px solid var(--line); border-radius: var(--r); padding: 10px; display: grid; gap: 6px; }
.vcal-head { display: flex; align-items: center; justify-content: space-between; }
.vcal-head b { text-transform: capitalize; font-size: .95rem; }
.vcal .cal-dias { gap: 2px; }
.vcal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.vcal-dia {
  position: relative; height: 40px; border: 0; border-radius: 10px; background: transparent; font: 600 .88rem/1 var(--f-body);
  color: var(--text); cursor: pointer; font-variant-numeric: tabular-nums; transition: background .12s, transform .12s var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { .vcal-dia:not(:disabled):hover { background: var(--lav-50); } }
.vcal-dia:not(:disabled):active { transform: scale(.94); }
.vcal-dia.fuera { opacity: .35; }
.vcal-dia.hoy { box-shadow: inset 0 0 0 1.5px var(--lav-300); }
.vcal-dia:disabled { color: #C2BDCB; cursor: not-allowed; background: transparent; }
.vcal-dia.festivo { color: var(--warn); background: var(--warn-50); }
.vcal-dia.festivo:disabled { opacity: .55; }
.vcal-dia.propia { background: var(--lav-50); color: var(--lav-700); text-decoration: line-through; opacity: 1; }
.vcal-dia.comp::after { content: ""; position: absolute; left: 50%; bottom: 5px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: #D07A2B; }
.vcal-dia.sel { background: var(--lav-50); color: var(--lav-700); border-radius: 0; }
.vcal-dia.sel.festivo { background: var(--warn-50); color: var(--warn); }
.vcal-dia.ini, .vcal-dia.fin { background: var(--lav); color: #fff; border-radius: 10px; animation: paq-zoom .18s var(--ease-out); }
.vcal-dia.ini.sel:not(.fin) { border-radius: 10px 0 0 10px; }
.vcal-dia.fin.sel:not(.ini) { border-radius: 0 10px 10px 0; }
.vcal-ayuda { margin: 2px 0 0; font-size: .84rem; color: var(--muted); text-align: center; }
.dot.sel { background: var(--lav); } .dot.c { background: #D07A2B; } .dot.ya { background: var(--lav-50); border: 1px solid var(--lav-300); }
.vac-top { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: 18px; align-items: start; margin-bottom: 18px; }
.vac-top > .card, .vac-lado > * { margin: 0; }
.vac-lado { display: grid; gap: 18px; }
/* Saldo arriba, a todo lo ancho: número a la izquierda, barra a la derecha */
.vac-saldo.arriba { grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 32px; padding: 20px 24px; }
.vac-saldo.arriba .vac-saldo-main { grid-row: span 2; padding-right: 32px; border-right: 1px solid rgba(255, 255, 255, .25); }
.vac-saldo.arriba .vac-barra { align-self: end; }
.vac-saldo.arriba .vac-leyenda { align-self: start; }
@media (max-width: 700px) {
  .vac-saldo.arriba { grid-template-columns: 1fr; }
  .vac-saldo.arriba .vac-saldo-main { grid-row: auto; padding-right: 0; border-right: 0; }
}
.vac-pedir { animation: paq-entra .3s var(--ease-out); }
.vac-pedir-cuerpo { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 16px; align-items: start; }
.vac-pedir-campos { display: grid; gap: 12px; }
.vac-pedir-acc { display: flex; justify-content: flex-end; gap: 8px; }
.vac-solo-movil { display: none; }
@media (max-width: 900px) { .vac-solo-movil { display: inline-flex; } }

/* Rango elegido: dos «boletos» legibles en lugar de inputs de fecha */
.vac-rango { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.vac-rango-dia { padding: 10px 12px; border-radius: 12px; background: var(--lav-50); min-width: 0; }
.vac-rango-dia small { display: block; font-size: .74rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.vac-rango-dia b { display: block; font-size: 1.02rem; color: var(--lav-700); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vac-rango-dia b.vacio { color: var(--muted); font-weight: 500; font-size: .9rem; text-transform: none; }
.vac-rango-dia b.cambia { animation: vac-cambia .18s var(--ease-out); }
@keyframes vac-cambia { from { opacity: 0; transform: translateY(4px); } }
.vac-rango-flecha svg.lucide { width: 18px; height: 18px; color: var(--tenue); }
.vac-pedir-acc .btn[type=submit]:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* Mis solicitudes en la columna lateral: más compacta */
.vac-mis .card-head { margin-bottom: 10px; }
.vac-lista.compacta { gap: 8px; }
.vac-lista.compacta .vac-sol { padding: 10px 12px; }
.vac-lista.compacta .vac-sol-top b { font-size: .92rem; }
.vac-lista.compacta .vac-quien, .vac-lista.compacta .vac-coment { font-size: .78rem; margin-top: 6px; }
.vac-lista.compacta .vac-sol form { margin-top: 4px; }
.vac-mas { margin-top: 8px; }
.vac-mas summary { cursor: pointer; font-size: .84rem; font-weight: 600; color: var(--lav-700); padding: 6px 2px; list-style: none; }
.vac-mas summary::-webkit-details-marker { display: none; }
.vac-mas summary::before { content: "›"; display: inline-block; margin-right: 6px; transition: transform .18s var(--ease-out); }
.vac-mas[open] summary::before { transform: rotate(90deg); }
.vac-mas[open] .vac-lista { animation: paq-entra .22s var(--ease-out); }
.vac-pedir-acc .btn { transition: background .15s, transform .16s var(--ease-out); }
.vac-pedir-acc .btn:active { transform: scale(.97); }
@media (max-width: 900px) { .vac-top { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .vac-pedir-acc .btn[type=submit] { flex: 1; } }

/* Catálogo */
.vac-tabla { display: grid; gap: 6px; max-width: 420px; }
.vac-tabla-head, .vac-tabla-fila { display: grid; grid-template-columns: 1fr 1fr 36px; gap: 8px; align-items: center; }
.vac-tabla-head { font-size: .78rem; font-weight: 700; color: var(--muted); }
.vac-tabla-fila.nueva { animation: paq-entra .22s var(--ease-out); }
.vac-nuevo-festivo { display: grid; grid-template-columns: 180px 1fr auto; gap: 10px; align-items: end; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }

@media (max-width: 700px) {
  .vac-num { font-size: 2.6rem; }
  .vac-saldo { padding: 18px; }
  .cal-dia { min-height: 54px; padding: 3px; }
  .cal-vig { font-size: 0; height: 6px; padding: 0; border-radius: 3px; }
  .cal-fest { display: none; }
  .vac-nuevo-festivo { grid-template-columns: 1fr; }
  .vac-sol-top .actions { width: 100%; }
  .vac-sol-top .actions > * { flex: 1; }
  .vac-sol-top .actions .btn { width: 100%; }
  .vac-filtro select { min-width: 0; max-width: 170px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .hojas-caen i { top: calc(var(--x) * .85); transform: rotate(25deg); }
}