/* CondoSmart — brand tokens, fonts, menu, rail, phone tab bar.
   Visual reference: docs/superpowers/specs/2026-11-30-condosmart-maqueta/ (shell.css, main.html). */

/* ── Fonts (vendored: static/vendor/ibm-plex-2.0.0, OFL-1.1) ── */
@font-face{font-family:"IBM Plex Sans";font-style:normal;font-weight:400;font-display:swap;src:url("../vendor/ibm-plex-2.0.0/IBMPlexSans-Regular-Latin1.fb118ecf9cac.woff2") format("woff2")}
@font-face{font-family:"IBM Plex Sans";font-style:normal;font-weight:500;font-display:swap;src:url("../vendor/ibm-plex-2.0.0/IBMPlexSans-Medium-Latin1.f2a35703194f.woff2") format("woff2")}
@font-face{font-family:"IBM Plex Sans";font-style:normal;font-weight:600;font-display:swap;src:url("../vendor/ibm-plex-2.0.0/IBMPlexSans-SemiBold-Latin1.dece60e1d19f.woff2") format("woff2")}
@font-face{font-family:"IBM Plex Serif";font-style:normal;font-weight:400;font-display:swap;src:url("../vendor/ibm-plex-2.0.0/IBMPlexSerif-Regular-Latin1.17c42b54019e.woff2") format("woff2")}
@font-face{font-family:"IBM Plex Serif";font-style:normal;font-weight:500;font-display:swap;src:url("../vendor/ibm-plex-2.0.0/IBMPlexSerif-Medium-Latin1.49e75b048bd4.woff2") format("woff2")}

/* ── Tokens (fixed CondoSmart brand; no dark mode) ── */
:root{
  --brand:#0f6b63;
  --bg:#f4f6f9;--surface:#ffffff;--ink:#0f1b2d;--muted:#5b6b80;
  --line:#dde3ea;--line-strong:#b4c0ce;--icon:#46566c;
  --side:#0d2b36;--side-ink:#e6edf3;--side-muted:#9fb1c2;--side-line:rgba(195,208,224,.42);
  --ok:#1f7a55;--ok-fill:#2f9a6a;--warn:#a16207;--warn-fill:#eab308;--bad:#b91c1c;--bad-fill:#dc2626;
  --font-sans:"IBM Plex Sans",system-ui,-apple-system,"Segoe UI",sans-serif;
  --font-serif:"IBM Plex Serif",Georgia,serif;
  --ease:cubic-bezier(.25,1,.5,1);
  color-scheme:light;
}
html,body{background:var(--bg)}
body{font-family:var(--font-sans);color:var(--ink)}

/* ── Sidebar (all roles of base.html) ── */
:root{--side-w:276px}
html[data-rail]{--side-w:72px}
.cs-side{position:fixed;inset:0 auto 0 0;z-index:40;width:var(--side-w);display:flex;flex-direction:column;gap:12px;
  padding:16px 12px 0;background:var(--side);color:var(--side-ink);overflow:hidden;view-transition-name:vt-side}
.cs-main{min-width:0;view-transition-name:vt-main}
@media (min-width:901px){.cs-side{transform:none!important}.cs-main{padding-left:var(--side-w)}}
.cs-side .ic,.cs-side svg{fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round}

.cs-logo{display:flex;align-items:center;gap:10px;padding:2px 6px;color:#fff;text-decoration:none;font-weight:600;font-size:17px;letter-spacing:-.01em}
.cs-logo-ic{display:grid;place-items:center;width:30px;height:30px;flex:none;border-radius:6px;background:var(--brand);color:#fff}
.cs-logo-wm em{font-style:normal;color:#7fd1c5}

.cs-find-w{padding:0}
.cs-find{position:relative}
.cs-find svg{position:absolute;left:10px;top:50%;transform:translateY(-50%);width:16px;height:16px;color:var(--side-muted)}
.cs-find-in{width:100%;height:34px;padding:0 10px 0 32px;border-radius:7px;border:1px solid rgba(255,255,255,.14);background:rgba(255,255,255,.07);color:#fff;font:inherit;font-size:14px}
.cs-find-in::placeholder{color:var(--side-muted)}
.cs-find-in:focus{outline:2px solid rgba(127,209,197,.45);border-color:#7fd1c5}

.cs-nav{flex:1;min-height:0;overflow-y:auto;margin:0 -12px;padding:2px 12px 12px;display:flex;flex-direction:column;gap:2px}
.cs-nav p{padding:12px 8px 4px;font-size:12px;font-weight:500;letter-spacing:.02em;color:var(--side-muted);text-transform:none}
.cs-side .sidebar-link,.cs-side .resident-nav-link,.cs-side .grp-solo a{display:flex;align-items:center;gap:10px;min-height:34px;padding:6px 8px;border-radius:7px;
  font-size:14.5px;font-weight:500;color:var(--side-ink);background:transparent;text-decoration:none}
.cs-side .sidebar-link:hover,.cs-side .resident-nav-link:hover,.grp-h:hover{background:rgba(255,255,255,.07);color:#fff}
.cs-side .sidebar-link.active,.cs-side .resident-nav-link.active{background:rgba(127,209,197,.16);color:#fff}
/* icon + fine vertical rule (CondoSmart icon rule) */
.cs-side .sidebar-link>svg,.cs-side .resident-nav-link>svg,.grp-h>.ic,.grp-solo a>svg{width:18px;height:18px;flex:none;padding-right:9px;box-sizing:content-box;border-right:1px solid var(--side-line);color:#c3d0e0}

.grp{display:block}
/* hidden by the menu search (never by touching x-show's style.display) */
.cs-side [data-q-oculto]{display:none!important}
.grp[hidden]{display:none}
.grp-h{display:flex;align-items:center;gap:10px;width:100%;min-height:34px;padding:6px 8px;border:0;border-radius:7px;background:transparent;
  color:var(--side-ink);font:inherit;font-size:14.5px;font-weight:500;text-align:left;cursor:pointer}
.grp-t{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.grp-chev{margin-left:auto;width:16px;height:16px;color:var(--side-muted);transition:transform .2s var(--ease)}
.grp.open .grp-chev{transform:rotate(90deg)}
.grp-b{display:grid;grid-template-rows:0fr;transition:grid-template-rows .24s var(--ease)}
.grp.open .grp-b{grid-template-rows:1fr}
.grp-in{overflow:hidden;min-height:0;visibility:hidden;transition:visibility 0s .24s}
.grp.open .grp-in{visibility:visible;transition-delay:0s}  /* closed groups: no focus, not read */
.grp.open .grp-in{padding:2px 0 6px}
.grp-in .sidebar-link{min-height:30px;padding:4px 8px 4px 46px;font-size:13.5px;font-weight:400;color:var(--side-muted)}
.grp-in .sidebar-link>svg{display:none}
.grp-in .sidebar-link.active{color:#fff;font-weight:500}
.nav-badge{margin-left:auto;font-size:12.5px;font-weight:600;color:var(--warn-fill);background:none;padding:0}
.grp-dot{display:none;width:7px;height:7px;border-radius:50%;background:var(--warn-fill);flex:none}
/* Plataforma (super admin) keeps its own header style */
.grp-plataforma .sidebar-group{color:var(--side-muted)}

.rail-btn{display:flex;align-items:center;gap:10px;margin:0 -12px;padding:10px 20px;border:0;border-top:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.03);color:var(--side-ink);font:inherit;font-size:13.5px;cursor:pointer}
.rail-btn:hover{background:rgba(255,255,255,.07)}
.rail-btn .ic{width:18px;height:18px;flex:none;transition:transform .2s var(--ease)}
@media (max-width:900px){.rail-btn{display:none}}

.cs-me{position:relative;margin:0 -12px;padding:10px 12px 12px;border-top:1px solid rgba(255,255,255,.08)}
.cs-me-btn{display:flex;align-items:center;gap:10px;width:100%;padding:6px;border:0;border-radius:8px;background:transparent;color:var(--side-ink);cursor:pointer;text-align:left}
.cs-me-btn:hover{background:rgba(255,255,255,.07)}
.cs-av{display:grid;place-items:center;width:34px;height:34px;flex:none;border-radius:50%;background:rgba(255,255,255,.14);color:#fff;font-weight:600;font-size:14px}
.cs-me-t{flex:1;min-width:0}
.cs-me-n{font-weight:600;font-size:14px;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cs-me-r{font-size:12.5px;color:var(--side-muted);text-transform:capitalize}
.cs-me-menu{position:absolute;left:12px;right:12px;bottom:calc(100% - 4px);padding:6px;border-radius:10px;background:var(--surface);
  border:1px solid var(--line);box-shadow:0 8px 24px rgba(15,27,45,.18);z-index:5}

/* ── Icon rail (desktop, html[data-rail]) ── */
@media (min-width:901px){
  html[data-rail] .cs-logo-wm,html[data-rail] .cs-find-w,html[data-rail] .grp-chev,html[data-rail] .grp-b,
  html[data-rail] .cs-me-btn>svg,html[data-rail] .cs-nav p,html[data-rail] .nav-badge{display:none}
  /* labels stay in the accessibility tree (visually hidden), tooltips come from menu.js */
  html[data-rail] .grp-t,html[data-rail] .rail-t,html[data-rail] .cs-me-t{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
  html[data-rail] .cs-side .sidebar-link,html[data-rail] .cs-side .resident-nav-link,html[data-rail] .grp-h,html[data-rail] .grp-solo a{font-size:0;gap:0;justify-content:center}
  html[data-rail] .cs-side .sidebar-link>svg,html[data-rail] .cs-side .resident-nav-link>svg,html[data-rail] .grp-h>.ic,html[data-rail] .grp-solo a>svg{padding-right:0;border-right:0}
  html[data-rail] .grp-h{position:relative}
  html[data-rail] .grp.has-badge .grp-dot{display:block;position:absolute;top:7px;right:13px;box-shadow:0 0 0 2px var(--side)}
  html[data-rail] .rail-btn{justify-content:center;padding:10px 0}
  html[data-rail] .rail-btn .ic{transform:rotate(180deg)}
  html[data-rail] .cs-me-btn{justify-content:center}
}

/* ── Phone (< 901 px): tab bar per role + «Más» bottom sheet (the same <aside>) ── */
.tabbar{display:none}
.cs-main header button[aria-label="Abrir menú"]{display:none}  /* «Más» replaces the hamburger */
@media (max-width:900px){
  .tabbar{display:flex;position:fixed;left:0;right:0;bottom:0;z-index:29;height:calc(64px + env(safe-area-inset-bottom,0px));
    padding-bottom:env(safe-area-inset-bottom,0px);background:var(--surface);border-top:1px solid var(--line)}
  .tabbar-in{display:contents}
  .tab{flex:1;min-width:0;position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
    border:0;background:none;color:var(--muted);font:inherit;font-size:11.5px;font-weight:500;text-decoration:none;cursor:pointer}
  .tab .ic{fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round}
  .tab[aria-current=page]{color:var(--brand)}
  .tab-t{max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:0 2px}
  .tab-n{position:absolute;top:7px;left:calc(50% + 6px);min-width:17px;padding:0 4px;border-radius:99px;background:#fee2e2;color:#b91c1c;font-size:10.5px;font-weight:600;line-height:17px;text-align:center}
  .cs-main{padding-bottom:calc(68px + env(safe-area-inset-bottom,0px))}
  html.capa-abierta .tabbar{display:none}  /* an open panel or dialog owns the screen (its buttons sit at the bottom) */
  .cs-side{top:auto;bottom:0;left:0;right:0;width:auto;height:auto;max-height:84svh;border-radius:16px 16px 0 0;view-transition-name:none}
  .cs-side.-translate-x-full{transform:translateY(105%)!important}
  .cs-side.translate-x-0{transform:none!important}
}

/* ── Page band (all pages of base.html / resident_base.html; the dashboard keeps its own .dash-band) ──
   Continuous light-teal strip flush with the top and the menu: menu group (eyebrow), serif title, intro, actions. */
.cs-banda{display:flex;align-items:flex-start;gap:10px 24px;flex-wrap:wrap;background:#e4efec;padding:16px 16px 18px}
@media (min-width:640px){.cs-banda{padding:18px 24px 20px}}
@media (min-width:901px){.cs-banda{padding:20px 32px 22px}}
.cs-banda--centrada{display:block}
.cs-banda--centrada>.cs-banda-fila{display:flex;align-items:flex-start;gap:10px 24px;flex-wrap:wrap;max-width:64rem;margin:0 auto}
.cs-banda-menu{display:none;align-items:center;justify-content:center;width:40px;height:40px;margin:-4px -4px 0 -8px;border:0;border-radius:6px;background:transparent;color:var(--ink);cursor:pointer}
.cs-banda-menu:hover{background:rgba(15,107,99,.08)}
@media (max-width:900px){.cs-banda-menu{display:inline-flex}}
.cs-banda-txt{flex:1 1 320px;min-width:0}
.cs-eyebrow{margin:0 0 4px;font-size:12px;line-height:16px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--brand)}
.cs-banda h1{margin:0;font-family:var(--font-serif);font-size:clamp(22px,2vw,28px);line-height:1.25;font-weight:500;letter-spacing:-.02em;color:var(--ink)}
.cs-banda h1:empty{display:none}
.cs-banda .page-intro{margin:6px 0 0;max-width:75ch;font-size:14px;line-height:1.5;color:var(--muted);background:none;border:0;padding:0;border-radius:0;box-shadow:none}
.cs-banda-acciones{display:flex;flex-wrap:wrap;gap:8px;align-items:center;align-self:center}
.cs-banda-acciones:empty{display:none}
.cs-main .page-intro{color:var(--muted)}

/* ── View transition of the rail: no cross-fades (any fade made the page blink) ── */
::view-transition-group(*){animation-duration:.34s;animation-timing-function:var(--ease);overflow:hidden}
::view-transition-group(vt-side){background:var(--side)}
::view-transition-image-pair(*){isolation:auto}
::view-transition-old(*){animation:none;opacity:0}
::view-transition-new(*){animation:none;opacity:1;width:auto;height:auto;mix-blend-mode:normal}
::view-transition-old(root),::view-transition-new(root){animation:none}

@media (prefers-reduced-motion:reduce){
  .cs-side,.cs-side *{transition:none!important}
  ::view-transition-group(*){animation:none}
}

/* ══ Common CondoSmart style for every screen (cards, tables, status tags, figures, info boxes) ══
   Adapts the pieces the screens already use (Tailwind classes) to the approved look; it does not add
   or move content. Scoped to the content column; the dashboard has its own stylesheet. */

/* Cards: straighter corners, fine line, no heavy shadows */
.cs-main :is(.rounded-xl,.rounded-2xl).border{border-radius:6px;border-color:var(--line)}
.cs-main :is(.rounded-xl,.rounded-2xl).border:is(.shadow,.shadow-sm,.shadow-md){box-shadow:none}

/* Big figures: IBM Plex Serif, regular weight (as on the dashboard) */
.cs-main :is(.text-2xl,.text-3xl).font-bold,.cs-main :is(.text-2xl,.text-3xl).font-semibold{
  font-family:var(--font-serif);font-weight:400;letter-spacing:-.02em}

/* Table headers and small section labels: sentence case, muted, no tracking */
.cs-main thead{background:transparent}
.cs-main thead th{text-transform:none;letter-spacing:0;font-size:13px;font-weight:500;color:var(--muted)}
.cs-main :is(p,span,h2,h3,h4,label,div).uppercase:not(button *){text-transform:none;letter-spacing:.005em;font-size:13.5px}
/* sortable column headers carry the uppercase on a button inside the th */
.cs-main thead :is(th,th *).uppercase,.cs-main thead th :is(button,a,span){text-transform:none;letter-spacing:0}
.cs-main tbody tr{border-color:#e8ecf1}
.cs-main :is(.divide-y,.divide-gray-100,.divide-gray-200)>*{border-color:#e8ecf1}

/* Normal states («Activo», «Activa»): quiet, brand dot + gray text; only the exception (inactive) stands out. */
.cs-main .estado-normal:not([style*="display: none"]){background:transparent!important;padding-left:0!important;color:var(--icon)!important;display:inline-flex!important;align-items:center;white-space:nowrap}
.cs-main .estado-normal::before{content:"";display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--brand);margin-right:6px;flex:none}
/* Raw Tailwind greens (text) follow the success token, so there is one green next to the brand teal. */
.cs-main :is(.text-green-500,.text-green-600,.text-green-700,.text-green-800,.text-green-900,.text-emerald-600,.text-emerald-700){color:var(--ok)!important}
.cs-main :is(.border-green-100,.border-green-200,.border-green-300){border-color:#c6e0d3!important}
.cs-main .bg-green-50:not([class*="text-"]){background-color:#eef6f2!important}

/* Status tags (no fills at all): green/gray/blue/purple/red = dot + word, yellow/orange = small yellow
   triangle. Only real tags: an exact bg-*-50/100 class (not hover:bg-…) on a pill / one-line shape
   (rounded-full, py-0.5, py-px). Notices, chat bubbles and rows keep their background.
   Number badges (fixed w-/h- size) are left as they are. */
.cs-main [class*="text-"]:is([class~="rounded-full"],[class~="py-0.5"],[class~="py-px"]):not(button,a,select,input,label):not([class*=" h-"]):not([class^="h-"]):not([style*="display: none"]):is(
  [class~="bg-green-100"],[class~="bg-green-50"],[class~="bg-emerald-100"],[class~="bg-gray-100"],[class~="bg-slate-100"],
  [class~="bg-blue-100"],[class~="bg-indigo-100"],[class~="bg-sky-100"],[class~="bg-purple-100"],[class~="bg-violet-100"]){
  background:transparent!important;padding-left:0!important;box-shadow:none;display:inline-flex!important;align-items:center;white-space:nowrap}
.cs-main [class*="text-"]:is([class~="rounded-full"],[class~="py-0.5"],[class~="py-px"]):not(button,a,select,input,label):not([class*=" h-"]):not([class^="h-"]):not([style*="display: none"]):is(
  [class~="bg-green-100"],[class~="bg-green-50"],[class~="bg-emerald-100"],[class~="bg-gray-100"],[class~="bg-slate-100"],
  [class~="bg-blue-100"],[class~="bg-indigo-100"],[class~="bg-sky-100"],[class~="bg-purple-100"],[class~="bg-violet-100"])::before{
  content:"";display:inline-block;width:7px;height:7px;border-radius:50%;background:currentColor;margin-right:6px;vertical-align:1px;flex:none}
.cs-main [class*="text-"]:is([class~="rounded-full"],[class~="py-0.5"],[class~="py-px"]):not(button,a,select,input,label):not([class*=" h-"]):not([class^="h-"]):not([style*="display: none"]):is([class~="bg-green-100"],[class~="bg-green-50"],[class~="bg-emerald-100"]){color:var(--ok)!important}
.cs-main [class*="text-"]:is([class~="rounded-full"],[class~="py-0.5"],[class~="py-px"]):not(button,a,select,input,label):not([class*=" h-"]):not([class^="h-"]):not([style*="display: none"]):is([class~="bg-gray-100"],[class~="bg-slate-100"]){color:var(--muted)!important}
.cs-main [class*="text-"]:is([class~="rounded-full"],[class~="py-0.5"],[class~="py-px"]):not(button,a,select,input,label):not([class*=" h-"]):not([class^="h-"]):not([style*="display: none"]):is([class~="bg-blue-100"],[class~="bg-indigo-100"],[class~="bg-sky-100"]){color:var(--brand)!important}
.cs-main [class*="text-"]:is([class~="rounded-full"],[class~="py-0.5"],[class~="py-px"]):not(button,a,select,input,label):not([class*=" h-"]):not([class^="h-"]):not([style*="display: none"]):is([class~="bg-yellow-100"],[class~="bg-amber-100"],[class~="bg-orange-100"]){
  background:transparent!important;padding-left:0!important;color:#854d0e!important;box-shadow:none;display:inline-flex!important;align-items:center;white-space:nowrap}
.cs-main [class*="text-"]:is([class~="rounded-full"],[class~="py-0.5"],[class~="py-px"]):not(button,a,select,input,label):not([class*=" h-"]):not([class^="h-"]):not([style*="display: none"]):is([class~="bg-yellow-100"],[class~="bg-amber-100"],[class~="bg-orange-100"])::before{
  content:"";display:inline-block;width:10px;height:9px;margin-right:6px;vertical-align:0;flex:none;background:var(--warn-fill);
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M6 .8 11.6 10.9H.4z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M6 .8 11.6 10.9H.4z'/%3E%3C/svg%3E") center/contain no-repeat}
.cs-main [class*="text-"]:is([class~="rounded-full"],[class~="py-0.5"],[class~="py-px"]):not(button,a,select,input,label):not([class*=" h-"]):not([class^="h-"]):not([style*="display: none"]):is([class~="bg-red-100"],[class~="bg-rose-100"]){
  background:transparent!important;padding-left:0!important;color:var(--bad)!important;box-shadow:none!important;display:inline-flex!important;align-items:center;white-space:nowrap}
.cs-main [class*="text-"]:is([class~="rounded-full"],[class~="py-0.5"],[class~="py-px"]):not(button,a,select,input,label):not([class*=" h-"]):not([class^="h-"]):not([style*="display: none"]):is([class~="bg-red-100"],[class~="bg-rose-100"])::before{
  content:"";display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--bad-fill);margin-right:6px;vertical-align:1px;flex:none}
/* Solid counters/badges (white text on a strong color) become the same soft style */
.cs-main .text-white:is(.bg-green-500,.bg-green-600,.bg-emerald-500,.bg-emerald-600):not(button):not(a){background:transparent!important;color:var(--ok)!important}
.cs-main .text-white:is(.bg-red-500,.bg-red-600):not(button):not(a){background:transparent!important;color:var(--bad)!important;box-shadow:none!important}
.cs-main .text-white:is(.bg-orange-500,.bg-orange-600,.bg-yellow-500,.bg-amber-500):not(button):not(a){background:transparent!important;color:#a16207!important;font-weight:600}

/* Weights: no 700 in the content. Emphasis is 600; figures in serif 400; in-page titles serif 500 */
.cs-main main :is(.font-bold,.font-extrabold,strong,b){font-weight:600}
.cs-main main :is(.text-lg,.text-xl).font-bold:not(h1,h2,h3,h4,.font-mono){font-family:var(--font-serif);font-weight:400;letter-spacing:-.01em}
.cs-main main :is(h1,h2).font-bold{font-family:var(--font-serif);font-weight:500;letter-spacing:-.01em}
/* Fields outside panels: same 6px corners as the cards */
.cs-main :is(input,select,textarea).rounded-lg{border-radius:6px}
/* Purple/violet tags (dot + word, already transparent) take the neutral ink; no purple in the palette */
.cs-main [class*="text-"]:is([class~="rounded-full"],[class~="py-0.5"],[class~="py-px"]):not(button,a,select,input,label):not([class*=" h-"]):not([class^="h-"]):not([style*="display: none"]):is([class~="bg-purple-100"],[class~="bg-violet-100"]){color:#46566c!important}
.cs-main :is(.text-blue-500,.text-blue-900,.text-indigo-700,.text-indigo-800,.text-sky-700){color:var(--brand)}
.cs-main :is(.text-purple-600,.text-purple-700,.text-purple-800,.text-violet-700,.text-violet-800){color:#46566c}
.cs-main :is(.bg-blue-500,.bg-indigo-500){background-color:var(--brand)}
.cs-main :is(.bg-purple-500,.bg-violet-500){background-color:#46566c}
.cs-main :is(.border-blue-300,.border-indigo-300,.border-purple-200,.border-purple-300){border-color:#c3d6d1}

/* Buttons: one accent (brand teal; red only for destructive actions), 6px corners like the cards */
.cs-main :is(button,a):is(.bg-green-500,.bg-green-600,.bg-green-700,.bg-emerald-500,.bg-emerald-600,.bg-amber-500,.bg-amber-600,.bg-orange-500,.bg-orange-600,.bg-yellow-500,.bg-yellow-600){background-color:var(--brand)!important;color:#fff}
.cs-main :is(button,a):is(.bg-green-500,.bg-green-600,.bg-green-700,.bg-emerald-500,.bg-emerald-600,.bg-amber-500,.bg-amber-600,.bg-orange-500,.bg-orange-600,.bg-yellow-500,.bg-yellow-600):hover:not(:disabled){background-color:#0b5750!important}
.cs-main :is(button,a,input,select,textarea):is(.rounded-lg,.rounded-xl){border-radius:6px}
.cs-auth-bg :is(button,a,input):is(.rounded-lg,.rounded-xl){border-radius:6px}

/* Old blue accents → CondoSmart green; blue info boxes → soft teal */
.cs-main :is(.text-blue-600,.text-blue-700,.text-blue-800,.text-indigo-600){color:var(--brand)}
.cs-main :is(.bg-blue-600,.bg-indigo-600){background-color:var(--brand)}
.cs-main :is(.bg-blue-50,.bg-indigo-50){background-color:#eef5f3}
.cs-main :is(.border-blue-100,.border-blue-200,.border-indigo-200){border-color:#c3d6d1}

/* Sign-in pages (login, forgot / reset password): CondoSmart petrol instead of the old navy-blue */
.cs-auth-bg{background:linear-gradient(135deg,#0b2430 0%,#0d2b36 45%,#0f3a40 100%)}
.cs-auth-sub{color:#7fd1c5}
/* Access screens: two-color wordmark (as in the menu), serif title inside the card, 6px corners */
.cs-auth-logo{border-radius:6px}
.cs-auth-marca{font-size:24px;font-weight:600;color:#fff;letter-spacing:-.01em}
.cs-auth-marca span{color:#5ec4b2}
.cs-auth-tarjeta{border-radius:6px}
.cs-auth-titulo{font-family:var(--font-serif);font-weight:500;font-size:22px;line-height:1.25;color:var(--ink)}
.cs-auth-bg h1.font-bold{font-weight:600}  /* the wordmark, as in the menu */
/* The app paints html light gray; on sign-in pages the page must stay petrol below the first screen too. */
html:has(.cs-auth-bg){background:#0b2430 linear-gradient(135deg,#0b2430 0%,#0d2b36 45%,#0f3a40 100%) fixed}
html:has(.cs-auth-bg) .cs-auth-bg{background:transparent}

/* Convenio simulator (planes_pago.html, static/js/simulador_convenio.js) */
.sim{border:1px solid #e5e7eb;border-radius:6px;padding:12px;background:#fff}
.sim-titulo{font-family:'IBM Plex Serif',Georgia,serif;font-size:1rem;font-weight:400;color:#111827;margin:0 0 8px}
.sim-calculando{font-size:.75rem;color:#6b7280}
.sim-viejo{opacity:.55;transition:opacity .15s ease-out}
.sim-cifras{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-bottom:10px}
.sim-cifra{display:flex;flex-direction:column;gap:1px;min-width:0}
.sim-cifra-etq{font-size:.7rem;color:#6b7280}
.sim-cifra-val{font-family:'IBM Plex Serif',Georgia,serif;font-weight:400;font-size:1.15rem;color:#111827;font-variant-numeric:tabular-nums}
.sim-cifra-nota{font-size:.68rem;color:#6b7280}
.sim-leyenda{display:flex;flex-wrap:wrap;gap:12px;font-size:.7rem;color:#4b5563;margin-bottom:4px}
.sim-ley{display:inline-flex;align-items:center;gap:6px}
.sim-ley::before{content:"";width:16px;height:0;border-top:2px solid var(--brand)}
.sim-ley-sin::before{border-top:2px dashed #9ca3af}
.sim-grafica{display:block;width:100%;height:170px;overflow:visible}
.sim-grafica .sim-base{stroke:#e5e7eb;stroke-width:1}
.sim-grafica .sim-linea{fill:none;stroke-width:2.25;vector-effect:non-scaling-stroke;stroke-linejoin:round;stroke-linecap:round}
.sim-grafica .sim-con{stroke:var(--brand)}
.sim-grafica .sim-sin{stroke:#9ca3af;stroke-dasharray:5 4}
.sim-grafica text{font-size:11px;fill:#6b7280;font-family:'IBM Plex Sans',system-ui,sans-serif}
.sim-grafica .sim-valor{font-weight:600;fill:#6b7280}
.sim-grafica .sim-valor-con{fill:var(--brand)}
.sim-meses{width:100%;font-size:.7rem;font-variant-numeric:tabular-nums;border-collapse:collapse;margin-top:8px;white-space:nowrap}
.sim-meses th{text-align:right;font-weight:500;color:#6b7280;padding:4px 6px;border-bottom:1px solid #e5e7eb}
.sim-meses td{text-align:right;padding:3px 6px;border-bottom:1px solid #f3f4f6}
.sim-meses th:first-child,.sim-meses td:first-child{text-align:left}
@media (max-width:480px){.sim-cifras{grid-template-columns:1fr 1fr}.sim-cifra:last-child{grid-column:1/-1}}
.sim-meses .sim-entra{font-weight:600;color:#111827}
.sim-meses .sim-gris{color:#9ca3af}
.sim-grafica .sim-meses text,.sim-grafica g.sim-meses text{font-size:12px;fill:#4b5563}

/* ── Auditoría (templates/web/admin/auditoria.html) ── */
.aud-barra{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:20px}
.aud-cuenta{margin-left:auto;font-size:13px;color:var(--muted)}
.aud-dia{margin-bottom:24px}
.aud-dia-t{font-family:var(--font-sans)!important;font-size:12px!important;font-weight:600!important;color:var(--muted);margin:0 0 8px;padding-bottom:6px;border-bottom:1px solid var(--line)}
.aud-lista{background:var(--surface);border:1px solid var(--line);border-radius:6px}
.aud-fila{padding:14px 16px}
.aud-fila + .aud-fila{border-top:1px solid var(--line)}
.aud-cab{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:4px 16px}
.aud-accion{display:inline-flex;align-items:center;font-size:14px;font-weight:600;color:var(--ink)}
.aud-accion::before{content:"";width:7px;height:7px;border-radius:50%;background:var(--brand);margin-right:8px;flex:none}
.aud-accion--delicada{color:var(--bad)}
.aud-accion--delicada::before{background:var(--bad-fill)}
.aud-meta{font-size:12px;color:var(--muted)}
.aud-desc{font-size:14px;color:#334155;margin-top:4px;padding-left:15px}
.aud-motivo{font-size:12px;color:var(--muted);margin-top:4px;padding-left:15px}
.aud-motivo > span:first-child{font-weight:600;color:var(--icon)}
.aud-ver{margin:6px 0 0 15px;font-size:13px}
.aud-detalle{margin:10px 0 0 15px;padding:12px 14px;background:var(--bg);border-radius:6px;font-size:12px;color:#334155}
.aud-datos{display:grid;gap:4px}
.aud-dato{display:grid;grid-template-columns:minmax(120px,220px) 1fr;gap:12px}
.aud-dato dt{color:var(--muted)}
.aud-dato dd{color:var(--ink);overflow-wrap:anywhere}
.aud-dato[data-grupo] dt{font-weight:600;color:var(--icon);margin-top:6px}
.aud-n1{padding-left:14px}.aud-n2{padding-left:28px}.aud-n3,.aud-n4{padding-left:42px}
@media (max-width:640px){
  .aud-cuenta{margin-left:0;width:100%}
  .aud-dato{grid-template-columns:1fr;gap:0}
  .aud-dato dd{margin-bottom:4px}
}

/* ── Carga inicial (templates/web/admin/carga_inicial*.html) ── */
.ci-estado{border:1px solid var(--line);background:var(--surface);border-radius:6px;padding:12px 16px;margin-bottom:20px}
.ci-estado-t{display:flex;align-items:center;font-size:14px;font-weight:600;color:var(--ink)}
.ci-estado-t::before{content:"";width:7px;height:7px;border-radius:50%;background:var(--brand);margin-right:8px;flex:none}
.ci-estado--aviso .ci-estado-t::before{width:10px;height:9px;border-radius:0;background:var(--warn-fill);
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M6 .8 11.6 10.9H.4z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M6 .8 11.6 10.9H.4z'/%3E%3C/svg%3E") center/contain no-repeat}
.ci-estado--neutro .ci-estado-t::before{background:var(--line-strong)}
.ci-estado-d{font-size:13px;color:var(--muted);margin-top:4px;padding-left:15px}
.ci-enlace{color:var(--brand);text-decoration:underline;text-underline-offset:2px}
.ci-pasos{list-style:none;margin:0;padding:0;background:var(--surface);border:1px solid var(--line);border-radius:6px}
.ci-paso{display:flex;gap:14px;padding:20px}
.ci-paso + .ci-paso{border-top:1px solid var(--line)}
.ci-num{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:50%;border:1.5px solid var(--brand);color:var(--brand);font-size:12px;font-weight:600;flex:none;background:var(--surface)}
.ci-num svg{width:14px;height:14px}
.ci-num--hecho{background:var(--brand);color:#fff}
.ci-num--inactivo{border-color:var(--line-strong);color:var(--muted)}
.ci-cuerpo{flex:1;min-width:0;display:grid;gap:12px;align-content:start}
.ci-cuerpo > .btn{justify-self:start}
.ci-titulo{font-family:var(--font-sans)!important;font-size:14px!important;font-weight:600!important;color:var(--ink);line-height:26px}
.ci-titulo--inactivo{color:var(--muted)}
.ci-ayuda{font-size:12px;color:var(--muted);margin-top:4px}
.ci-soltar{display:flex;align-items:center;gap:12px;padding:18px 16px;border:1.5px dashed var(--line-strong);border-radius:6px;cursor:pointer;font-size:13px;color:var(--muted);transition:border-color .15s var(--ease),background-color .15s var(--ease)}
.ci-soltar svg{width:28px;height:28px;color:var(--icon);flex:none}
.ci-soltar strong{font-weight:600;color:var(--ink)}
.ci-soltar:hover,.ci-soltar--activo{border-color:var(--brand);background:#eef6f4}
.ci-soltar:focus-within{outline:2px solid var(--brand);outline-offset:2px}
.ci-archivo{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;padding:10px 12px;border:1px solid var(--line);border-radius:6px;font-size:13px}
.ci-archivo svg{width:20px;height:20px;color:var(--icon);flex:none}
.ci-archivo-n{font-weight:600;color:var(--ink);overflow-wrap:anywhere}
.ci-archivo-t{color:var(--muted)}
.ci-archivo .btn-enlace{margin-left:auto}
.ci-aviso{border-radius:6px;padding:8px 12px;font-size:13px;border:1px solid}
.ci-aviso--ok{background:#eef6f2;border-color:#c6e0d3;color:var(--ok)}
.ci-aviso--mal{background:#fef2f2;border-color:#fecaca;color:var(--bad)}
.ci-sub{font-size:12px;font-weight:600;color:var(--icon);margin-bottom:6px}
.ci-resumen{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:4px 16px}
.ci-resumen > div{display:flex;justify-content:space-between;gap:8px;padding:5px 0;border-bottom:1px solid var(--line);font-size:13px}
.ci-resumen dt{color:var(--muted)}
.ci-resumen dd{font-family:var(--font-serif);color:var(--ink)}
.ci-resumen .ci-cero dt,.ci-resumen .ci-cero dd{color:#9aa6b5}
.ci-errores{border:1px solid var(--line);border-radius:6px}
.ci-grupo + .ci-grupo{border-top:1px solid var(--line)}
.ci-grupo summary{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 10px;padding:10px 12px;cursor:pointer;font-size:13px;font-weight:600;color:var(--ink)}
.ci-grupo-h{font-weight:400;font-size:12px;color:var(--muted);font-family:ui-monospace,monospace}
.ci-grupo-n{margin-left:auto;font-weight:600;font-size:12px;color:var(--bad)}
.ci-th{background:var(--bg);font-size:12px;font-weight:600;color:var(--muted)}
.ci-totales{display:flex;flex-wrap:wrap;gap:6px 24px;font-size:13px;color:var(--muted);margin-bottom:12px}
.ci-totales strong{font-family:var(--font-serif);font-weight:400;color:var(--ink)}
@media (max-width:640px){
  .ci-paso{padding:16px 14px;gap:10px}
  .ci-resumen{grid-template-columns:1fr}
}

/* ── Disabled buttons: neutral gray, never a faded brand color (opacity on teal gave an off-palette green) ── */
:is(button,a).btn:disabled,button:disabled[class*="disabled:opacity"]{opacity:1!important;cursor:not-allowed}
:is(.btn-primario,.btn-peligro,.btn-exito):disabled,
button:disabled:is([class~="bg-primary-500"],[class~="bg-primary-600"],[class~="bg-primary-700"],[class~="bg-primary-800"],[class~="bg-red-500"],[class~="bg-red-600"],[class~="bg-red-700"],[class~="bg-red-800"],[class~="bg-green-500"],[class~="bg-green-600"],[class~="bg-green-700"],[class~="bg-green-800"],[class~="bg-emerald-500"],[class~="bg-emerald-600"],[class~="bg-emerald-700"],[class~="bg-emerald-800"],[class~="bg-amber-500"],[class~="bg-amber-600"],[class~="bg-amber-700"],[class~="bg-amber-800"],[class~="bg-orange-500"],[class~="bg-orange-600"],[class~="bg-orange-700"],[class~="bg-orange-800"],[class~="bg-yellow-500"],[class~="bg-yellow-600"],[class~="bg-yellow-700"],[class~="bg-yellow-800"],[class~="bg-indigo-500"],[class~="bg-indigo-600"],[class~="bg-indigo-700"],[class~="bg-indigo-800"],[class~="bg-blue-500"],[class~="bg-blue-600"],[class~="bg-blue-700"],[class~="bg-blue-800"],[class~="bg-teal-500"],[class~="bg-teal-600"],[class~="bg-teal-700"],[class~="bg-teal-800"],[class~="bg-sky-500"],[class~="bg-sky-600"],[class~="bg-sky-700"],[class~="bg-sky-800"],[class~="bg-purple-500"],[class~="bg-purple-600"],[class~="bg-purple-700"],[class~="bg-purple-800"],[class~="bg-violet-500"],[class~="bg-violet-600"],[class~="bg-violet-700"],[class~="bg-violet-800"],[class~="bg-rose-500"],[class~="bg-rose-600"],[class~="bg-rose-700"],[class~="bg-rose-800"]){background:#e8ecf1!important;color:#8a97a8!important;border-color:#e8ecf1!important;box-shadow:none!important}
:is(.btn-primario,.btn-peligro,.btn-exito):disabled svg,button:disabled:is([class~="bg-primary-500"],[class~="bg-primary-600"],[class~="bg-primary-700"],[class~="bg-primary-800"],[class~="bg-red-500"],[class~="bg-red-600"],[class~="bg-red-700"],[class~="bg-red-800"],[class~="bg-green-500"],[class~="bg-green-600"],[class~="bg-green-700"],[class~="bg-green-800"],[class~="bg-emerald-500"],[class~="bg-emerald-600"],[class~="bg-emerald-700"],[class~="bg-emerald-800"],[class~="bg-amber-500"],[class~="bg-amber-600"],[class~="bg-amber-700"],[class~="bg-amber-800"],[class~="bg-orange-500"],[class~="bg-orange-600"],[class~="bg-orange-700"],[class~="bg-orange-800"],[class~="bg-yellow-500"],[class~="bg-yellow-600"],[class~="bg-yellow-700"],[class~="bg-yellow-800"],[class~="bg-indigo-500"],[class~="bg-indigo-600"],[class~="bg-indigo-700"],[class~="bg-indigo-800"],[class~="bg-blue-500"],[class~="bg-blue-600"],[class~="bg-blue-700"],[class~="bg-blue-800"],[class~="bg-teal-500"],[class~="bg-teal-600"],[class~="bg-teal-700"],[class~="bg-teal-800"],[class~="bg-sky-500"],[class~="bg-sky-600"],[class~="bg-sky-700"],[class~="bg-sky-800"],[class~="bg-purple-500"],[class~="bg-purple-600"],[class~="bg-purple-700"],[class~="bg-purple-800"],[class~="bg-violet-500"],[class~="bg-violet-600"],[class~="bg-violet-700"],[class~="bg-violet-800"],[class~="bg-rose-500"],[class~="bg-rose-600"],[class~="bg-rose-700"],[class~="bg-rose-800"]) svg{color:#8a97a8}
.btn-secundario:disabled,button:disabled:is([class~="bg-white"],[class~="bg-gray-50"],[class~="bg-primary-50"],[class~="bg-red-50"],[class~="bg-green-50"],[class~="bg-indigo-50"]){background:#fff!important;color:#9aa6b5!important;border-color:#e2e7ed!important}

/* ── Configuración del condominio (templates/web/admin/configuracion.html) ── */
.cfg-hoja{max-width:64rem;background:var(--surface);border:1px solid var(--line);border-radius:6px;padding:0 24px}
.cfg-seccion{display:grid;grid-template-columns:minmax(180px,260px) 1fr;gap:16px 40px;padding:24px 0}
.cfg-seccion + .cfg-seccion{border-top:1px solid var(--line)}
.cfg-cab h2{font-family:var(--font-sans)!important;font-size:14px!important;font-weight:600!important;color:var(--ink)}
.cfg-cab p{font-size:13px;color:var(--muted);margin-top:4px;line-height:1.45}
.cfg-campos{display:grid;grid-template-columns:1fr 1fr;gap:16px 20px;align-content:start}
.cfg-ancho{grid-column:1 / -1}
.cfg-campo{display:grid;gap:6px;align-content:start;min-width:0}
.cfg-campo > label{font-size:13px;font-weight:500;color:var(--icon)}
.cfg-campo :is(input:not([type=checkbox]),select,textarea){width:100%;min-height:40px;border:1px solid var(--line-strong);border-radius:6px;padding:8px 12px;font-size:14px;color:var(--ink);background:var(--surface)}
.cfg-campo textarea{min-height:160px;line-height:1.5}
.cfg-campo :is(input,select,textarea):focus{outline:2px solid var(--brand);outline-offset:-1px;border-color:var(--brand)}
.cfg-campo [aria-invalid="true"]{border-color:var(--bad)}
.cfg-campo .cfg-corto{max-width:120px}
.cfg-ayuda{display:block;font-size:12px;color:var(--muted);line-height:1.45}
.cfg-afijo{display:flex;align-items:stretch}
.cfg-afijo > span{display:inline-flex;align-items:center;padding:0 10px;border:1px solid var(--line-strong);background:var(--bg);color:var(--muted);font-size:14px;border-radius:6px 0 0 6px;border-right:0}
.cfg-afijo > input{border-radius:0 6px 6px 0!important;min-width:0}
.cfg-afijo--sufijo > span{border-radius:0 6px 6px 0;border-right:1px solid var(--line-strong);border-left:0}
.cfg-afijo--sufijo > input{border-radius:6px 0 0 6px!important}
.cfg-casilla{display:flex;align-items:flex-start;gap:10px;cursor:pointer}
.cfg-casilla input{width:18px;height:18px;margin-top:1px;accent-color:var(--brand);flex:none}
.cfg-casilla-t{display:block;font-size:14px;font-weight:500;color:var(--ink);margin-bottom:2px}
.cfg{padding-bottom:96px}
.cfg-cuenta{display:flex;flex-wrap:wrap;gap:4px 20px;font-size:12px;color:var(--muted);padding:14px 0 18px;border-top:1px solid var(--line)}
.cfg-barra{position:fixed;left:16px;right:16px;bottom:20px;margin:0 auto;z-index:40;display:flex;align-items:center;gap:10px;
  max-width:640px;padding:10px 12px 10px 16px;background:var(--side);color:var(--side-ink);border-radius:6px;box-shadow:0 8px 24px rgba(13,43,54,.25)}
.cfg-barra p{flex:1;font-size:13px}
.cfg-barra .cfg-barra-mal{color:#fecaca}
.cfg-barra .btn-secundario{background:transparent;color:var(--side-ink);border-color:rgba(230,237,243,.35)}
.cfg-barra .btn-secundario:hover:not(:disabled){background:rgba(255,255,255,.08)}
@media (min-width:901px){ .cfg-barra{left:calc(var(--side-w) + 16px)} }
@media (max-width:760px){
  .cfg-hoja{padding:0 16px}
  .cfg-seccion{grid-template-columns:1fr;gap:12px;padding:20px 0}
  .cfg-campos{grid-template-columns:1fr}
  .cfg-campo :is(input:not([type=checkbox]),select,textarea){font-size:16px;min-height:44px}
  .cfg-barra{bottom:84px;flex-wrap:wrap}
  .cfg-barra p{flex-basis:100%}
}

/* ── Torres y unidades (templates/web/admin/torres.html) ── */
.tor-card{background:var(--surface);border:1px solid var(--line);border-radius:6px;padding:14px 16px;cursor:pointer;transition:border-color .15s var(--ease),background-color .15s var(--ease)}
.tor-card:hover{border-color:var(--line-strong)}
.tor-card--sel,.tor-card--sel:hover{border-color:var(--brand);background:#eef6f4}
.tor-card:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
.tor-h2{font-family:var(--font-sans)!important;font-size:15px!important;font-weight:600!important;color:var(--ink)}

/* ── Page-level form fields and filters (outside panels): the same measures as inside panels
   (capas.css «Fields inside layers»): 40px tall and 14px text on desktop; 44px and 16px on phones
   (iOS zooms into anything smaller). Colors, corners and fonts already follow the line. ── */
.cs-main main :is(input:not([type=checkbox],[type=radio],[type=file],[type=range],[type=color],[type=hidden],[type=submit],[type=button],[type=reset],[type=image]),select):not(.capa *):not(.sr-only){min-height:40px;padding-top:7px;padding-bottom:7px;font-size:14px;line-height:1.4;box-sizing:border-box}
.cs-main main textarea:not(.capa *){font-size:14px;line-height:1.5}
@media (max-width:640px){
  .cs-main main :is(input:not([type=checkbox],[type=radio],[type=file],[type=range],[type=color],[type=hidden],[type=submit],[type=button],[type=reset],[type=image]),select):not(.capa *):not(.sr-only){min-height:44px;font-size:16px}
  .cs-main main textarea:not(.capa *){font-size:16px}
}
/* Buttons sitting in the same row as a page field (filters bar: search · select · «Más filtros») match its height */
.cs-main main :is(div,form):not(.capa *):has(> :is(input:not([type=checkbox],[type=radio],[type=hidden],[type=file]),select)) > :is(button,a.btn):not([class*="absolute"]){min-height:40px}
@media (max-width:640px){
  .cs-main main :is(div,form):not(.capa *):has(> :is(input:not([type=checkbox],[type=radio],[type=hidden],[type=file]),select)) > :is(button,a.btn):not([class*="absolute"]){min-height:44px}
}

/* ── Operación ── */
/* Tareas: column dots from the palette, plain counters */
.tar-punto{width:9px;height:9px;border-radius:50%;flex:none;background:var(--line-strong)}
.tar-punto--en_progreso{background:var(--brand)}
.tar-punto--completada{background:var(--ok-fill)}
.tar-punto--vencida{background:var(--bad-fill)}
.tar-cuenta{font-size:12px;font-weight:600;color:var(--muted)}
/* Quiet destructive action repeated on cards: gray text, red only on hover/focus */
.btn-quitar{flex:none;padding:6px 10px;font-size:12px;font-weight:500;color:var(--muted);background:transparent;border:0;border-radius:6px;cursor:pointer}
.btn-quitar:hover,.btn-quitar:focus-visible{color:var(--bad);background:#fef2f2}

/* ── Readable text everywhere ──
   Content text never goes below 12px, and never in the pale grays (gray-400 / gray-300 gave ~2.5:1 contrast):
   secondary text uses the muted token (≈5:1). Icons, disabled controls and placeholders keep their own tone. */
.cs-main main :is(p,span,td,th,dd,dt,li,small,time,label,div,a,button).text-gray-400:not(svg):not([disabled]){color:var(--muted)}
.cs-main main :is(p,span,td,dd,li,small,time,div).text-gray-300:not(svg){color:var(--muted)}
/* Required marks and small red text: the readable red token (red-500 is only 3.8:1) */
.cs-main main :is(span,p,small).text-red-500{color:var(--bad)}
/* Morosidad level markers: triangle for levels 1–2, red dot for level 3 */
.mor-nivel{display:flex;align-items:center;gap:6px}
.mor-nivel::before{content:"";flex:none;width:10px;height:9px;background:var(--warn-fill);
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M6 .8 11.6 10.9H.4z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M6 .8 11.6 10.9H.4z'/%3E%3C/svg%3E") center/contain no-repeat}
.mor-nivel--3::before{width:7px;height:7px;border-radius:50%;background:var(--bad-fill);-webkit-mask:none;mask:none}
.cs-main main :is(.text-\[9px\],.text-\[10px\],.text-\[11px\]){font-size:12px!important}
.sim-cifra-etq,.sim-cifra-nota,.sim-leyenda,.sim-meses{font-size:12px}

/* Categories / types (kind of announcement, vote, template…): plain text, never a colored status tag */
.cs-main .cat{display:inline-block;padding:0!important;background:transparent!important;font-size:12px;font-weight:500;color:var(--muted)!important;white-space:nowrap}
.cs-main .cat--alerta{color:var(--bad)!important;font-weight:600}

/* ── Mensajería: the chat panel is as tall as its content and grows with the thread up to the window;
   then only the history scrolls (header and reply box stay put). The ticket list scrolls on its own. ── */
.msj{align-items:flex-start}
.msj-lista{max-height:calc(100vh - 10.5rem);position:sticky;top:1rem}
.msj-chat{max-height:calc(100vh - 10.5rem);position:sticky;top:1rem}
.msj-hilo{max-height:calc(100vh - 10.5rem);min-height:0}
.msj-mensajes{flex:0 1 auto;min-height:0;overflow-y:auto}
.msj-vacio{min-height:240px}

/* ── Reportes ── */
/* Budget light: palette dots (same size as status dots) */
.sem-punto{display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--line-strong);flex:none}
.sem-punto--verde{background:var(--ok-fill)}
.sem-punto--amarillo{background:var(--warn-fill)}
.sem-punto--rojo{background:var(--bad-fill)}
/* Balance sheet blocks: neutral header, title + total */
.bal-cab{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;background:var(--bg);border-bottom:1px solid var(--line)}
.bal-cab h3{font-family:var(--font-sans)!important;font-size:14px!important;font-weight:600!important;color:var(--ink)}
.bal-cab span{font-family:var(--font-serif);font-size:15px;color:var(--ink)}

/* ── Figures in tables ──
   Same-width digits so decimals line up; regular weight (bold only for totals rows and the last «Total»
   column); zeros muted. Big KPI figures elsewhere keep the serif. */
.cs-main main table :is(td,th){font-variant-numeric:tabular-nums}
.cs-main main table td.text-right:not(:last-child):is(.font-semibold,.font-bold,.font-medium){font-weight:400}
.cs-main main table :is(tfoot td,tr.bg-gray-50 td){font-weight:600}
.cs-main main table td.cifra-cero{color:#8a97a8;font-weight:400}
.cs-main main table .tabla-nota{caption-side:top;text-align:right;font-size:12px;color:var(--muted);padding:0 4px 8px}

/* ── Gastos ── */
.egr-concepto{min-width:14rem}
.egr-concepto p:first-child{font-weight:500}
.egr-cuenta{max-width:16rem}
.egr-tabs{overflow-x:auto;scrollbar-width:none;flex-wrap:nowrap}
.egr-tabs::-webkit-scrollbar{display:none}
.egr-detalle{display:grid;gap:12px}
.egr-detalle > div{display:grid;grid-template-columns:120px 1fr;gap:12px;font-size:14px}
.egr-detalle dt{color:var(--muted)}
.egr-detalle dd{color:var(--ink);overflow-wrap:anywhere}
/* Egresos on phones: each row becomes a compact card (date · amount on top, concept, account, state + action) */
@media (max-width:640px){
  .egr-tabla thead{display:none}
  .egr-tabla,.egr-tabla tbody{display:block}
  .egr-tabla tr{display:grid;grid-template-columns:1fr auto;gap:2px 12px;padding:12px 14px}
  .egr-tabla td{display:block;padding:0!important;border:0}
  .egr-tabla td:nth-child(1){grid-column:1;grid-row:1}
  .egr-tabla td:nth-child(4){grid-column:2;grid-row:1;text-align:right}
  .egr-tabla td:nth-child(2){grid-column:1 / -1;min-width:0}
  .egr-tabla td:nth-child(3){grid-column:1 / -1;max-width:none}
  .egr-tabla td:nth-child(5){grid-column:1;text-align:left!important;margin-top:4px}
  .egr-tabla td:nth-child(6){grid-column:2;align-self:end}
}

/* «Activar» (re-enable) is not destructive: brand on hover instead of red */
.btn-quitar--activar:hover,.btn-quitar--activar:focus-visible{color:var(--brand);background:#eef6f4}

/* Super admin «Gestionando <condominio>» badge in the dark sidebar: brand teal, not blue */
.cs-gestionando{background:rgba(94,196,178,.16);border:1px solid rgba(94,196,178,.45)}
/* `.cs-nav p` (menu section labels: muted gray + padding) would win over single-class rules, so scope them */
.cs-nav .cs-gestionando p{padding:0;letter-spacing:0}
.cs-nav .cs-gestionando .cs-gestionando-t{color:#9fd8cc;font-size:11.5px;margin-bottom:3px}
.cs-nav .cs-gestionando .cs-gestionando-n{color:#fff;font-size:13px;font-weight:600}
.cs-gestionando-btn{color:#9fd8cc;padding:4px;border-radius:6px}.cs-gestionando-btn:hover,.cs-gestionando-btn:focus-visible{color:#fff;background:rgba(94,196,178,.2)}
.cs-gestionando-btn svg{width:16px;height:16px}

/* Conexiones de IA on phones: each connection as a small card (name + dates, «Revocar» on the right) */
@media (max-width:639px){
  .ia-tabla thead{display:none}
  .ia-tabla tbody tr{display:grid;grid-template-columns:1fr auto;column-gap:12px;row-gap:2px;padding:12px 16px}
  .ia-tabla tbody td{padding:0!important;grid-column:1}
  .ia-tabla tbody td:nth-child(2),.ia-tabla tbody td:nth-child(3){font-size:13px}
  .ia-tabla tbody td:nth-child(2)::before{content:"Conectado: "}
  .ia-tabla tbody td:nth-child(3)::before{content:"Último uso: "}
  .ia-tabla tbody td:nth-child(4){grid-column:2;grid-row:1 / span 3;align-self:center}
}

/* Checkboxes, radios and ranges: the brand teal, not the browser's default blue (Tailwind's text-primary-600 on
   an <input type=checkbox> needs a forms plugin the app doesn't load, so it never applied). */
html{accent-color:var(--brand)}
input[type=checkbox],input[type=radio]{width:16px;height:16px;cursor:pointer;flex:none}
