/* ==========================================================================
   TorreC brand theme — design tokens + app shell + shared primitives.
   Controls are Syncfusion EJ2 (Fluent2 theme from the CDN, remapped onto these
   tokens in "EJ2 skin" below). The token values here are the single source of
   truth for the palette. The premium-pages layer (page frame, masthead, tiles,
   grid/dialog skin, loader) lives in torrec-pages.css, loaded after this file
   by _Layout and _LayoutPlatform — see docs/premium_pages_web_sprint_log.md.
   ========================================================================== */

:root {
  /* Brand */
  --torrec-teal:            #4A4541;
  --torrec-teal-hover:      #3A3633;
  --torrec-teal-rgb:        74, 69, 65;   /* --torrec-teal as r,g,b — for rgba() soft tints */
  /* Signature colour. Token names are historical: the palette is Grafito y barro since 2026-11-06 (after Cielo, Flow sage and Mist slate)
     (docs/plans/rebrand_flow_plan.md §0). Decorative only: white on #A39C95 is ~2.7:1, so text never
     sits on it; text-bearing fills use --torrec-teal-fill (#4A4541, 9.5:1 under white). */
  --torrec-cielo:           #A39C95;
  --torrec-cielo-rgb:       163, 156, 149;
  --torrec-on-sky:          #282523;   /* ink on the light sky band */
  --torrec-band-top:        #F0EEEB;   /* light sky band: login gate, landing hero, e-mail header */
  --torrec-band-mid:        #DEDAD6;
  --torrec-band-bottom:     #CAC6C1;
  --torrec-navy:            #282523;   /* login / landing CTA */
  --torrec-navy-hover:      #1E1C1A;
  --torrec-terracotta:      #C65D3B;

  /* Semantic */
  --torrec-success:         #2F8F6B;
  --torrec-warning:         #E0A32E;
  --torrec-warning-rgb:     224, 163, 46;      /* --torrec-warning as r,g,b — for rgba() soft tints */
  --torrec-error:           #C0392B;
  --torrec-error-rgb:       192, 57, 43;      /* --torrec-error as r,g,b — for rgba() soft tints */
  --torrec-error-tint:      rgba(var(--torrec-error-rgb), .12);
  --torrec-info:            #2A6FB0;

  /* Surfaces & text */
  --torrec-bg:              #F7F6F3;
  --torrec-surface:         #FFFFFF;
  --torrec-surface-2:       #F1EFEA;
  --torrec-border:          #E4E1DB;
  --torrec-text:            #1E2A2B;
  --torrec-text-muted:      #5C6768;

  --torrec-shadow:          0 1px 3px rgba(30, 42, 43, .08), 0 1px 2px rgba(30, 42, 43, .06);
  --torrec-shadow-float:    0 18px 48px -12px rgba(30, 42, 43, .28), 0 6px 16px rgba(30, 42, 43, .10);
  --torrec-radius:          10px;

  /* ---- Premium + motion pass (docs/premium_motion_sprint_log.md) ----------
     Everything below is new vocabulary layered on the palette above, not a new
     palette. The colour-bearing ones (elevation, scrim) get a dark value in BOTH
     dark blocks further down; the rest (type, radius, motion) are theme-neutral. */

  /* Type. Inter for UI/body (has true tabular figures), Manrope for display sizes.
     Loaded from Google Fonts in all three layouts; the system stack is the
     fallback, so a blocked CDN degrades to exactly what the portal used before. */
  --torrec-font-sans:       "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --torrec-font-display:    "Manrope", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --torrec-text-xs:         .75rem;     /* 12px — eyebrows, table headers, pills */
  --torrec-text-sm:         .875rem;    /* 14px — secondary text, table cells */
  --torrec-text-base:       1rem;       /* 16px — body */
  --torrec-text-md:         1.125rem;   /* 18px — card titles */
  --torrec-text-lg:         1.375rem;   /* 22px — section headings */
  --torrec-text-xl:         1.75rem;    /* 28px — page titles */
  --torrec-text-2xl:        2.125rem;   /* 34px — hero numbers */
  --torrec-text-3xl:        2.625rem;   /* 42px — login / landing display */
  --torrec-tracking-display: -.02em;    /* display sizes read tighter */
  --torrec-tracking-eyebrow: .12em;     /* uppercase micro-labels read looser */

  /* Radius scale. --torrec-radius (10px) stays the default; these name the
     steps the file was already writing as calc(var(--torrec-radius) ± Npx). */
  --torrec-radius-sm:       8px;
  --torrec-radius-md:       12px;
  --torrec-radius-lg:       16px;
  --torrec-radius-pill:     999px;

  /* Elevation scale. 1 = resting card, 2 = raised/hovered card, 3 = floating
     (menus, popovers). Ink is --torrec-text's rgb, as every ad-hoc shadow in
     this file already used. */
  --torrec-elev-1:          0 1px 2px rgba(30, 42, 43, .06), 0 1px 3px rgba(30, 42, 43, .07);
  --torrec-elev-2:          0 4px 10px rgba(30, 42, 43, .07), 0 10px 22px rgba(30, 42, 43, .07);
  --torrec-elev-3:          0 8px 18px rgba(30, 42, 43, .10), 0 18px 40px rgba(30, 42, 43, .12);

  /* Motion. Fast and ease-out; never linear, never elastic. Every animation that
     uses these is neutralised under prefers-reduced-motion further down. */
  --torrec-ease-out:        cubic-bezier(.2, .8, .2, 1);
  --torrec-dur-fast:        120ms;      /* press / hover feedback */
  --torrec-dur-base:        180ms;      /* state change (pills, menus) */
  --torrec-dur-enter:       360ms;      /* content entering */

  /* Filled-teal surfaces that carry WHITE content (EJ2 primary buttons, checked
     checkboxes, the pager's current page). Deliberately the same deep brand slate #4A4541
     in both palettes: the dark palette's pale #D2CBC4 under white text is
     ~1.8:1. Fluent2-dark makes the same call (a deep #115ea3 primary). The dark
     blocks restate these on purpose so the "every token has a dark value" rule
     holds; they are not a new colour, they are --torrec-teal/-hover's light values. */
  --torrec-teal-fill:       #4A4541;
  --torrec-teal-fill-hover: #3A3633;
  --torrec-on-fill:         #FFFFFF;

  /* Focus ring: one definition for every interactive control. */
  --torrec-focus-ring:      2px solid var(--torrec-teal);
  --torrec-focus-offset:    2px;

  /* Shell geometry (premium-pages sprint, Phase 0). ONE height for the header
     and the sidebar's brand block, so their bottom lines are the same y at
     every breakpoint. The accent bar is INSIDE the height, at its bottom.
     Stepped down for phones in the media query right after this block. */
  --torrec-header-h:        72px;
  --torrec-accent-h:        3px;
}
@media (max-width: 767.98px) {
  :root { --torrec-header-h: 62px; }
}

/* Dark palette — applied when the OS prefers dark and the user hasn't
   explicitly chosen light. The [data-theme] overrides below always win. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --torrec-teal:          #D2CBC4;
    --torrec-teal-hover:    #DCD5CE;
    --torrec-teal-rgb:      210, 203, 196;
    --torrec-cielo:         #D2CBC4;
    --torrec-cielo-rgb:     210, 203, 196;
    --torrec-terracotta:    #E07A4E;

    --torrec-success:       #45B98A;
    --torrec-warning:       #F0B54A;
    --torrec-warning-rgb:   240, 181, 74;
    --torrec-error:         #E36455;
    --torrec-error-rgb:     227, 100, 85;
    --torrec-error-tint:    rgba(var(--torrec-error-rgb), .18);
    --torrec-info:          #5B9BD8;

    /* Neutral warm-graphite ground (deliberately NOT teal-tinted) */
    --torrec-bg:            #161513;
    --torrec-surface:       #201F1D;
    --torrec-surface-2:     #2A2926;
    --torrec-border:        #383632;
    --torrec-text:          #EDECEA;
    --torrec-text-muted:    #A09E99;

    --torrec-shadow:        0 1px 3px rgba(0, 0, 0, .4), 0 1px 2px rgba(0, 0, 0, .3);
    --torrec-shadow-float:  0 18px 48px -12px rgba(0, 0, 0, .7), 0 6px 16px rgba(0, 0, 0, .45);

    /* Elevation on a dark ground: deeper black ink, since a teal-graphite
       shadow at light-mode opacity vanishes against #161513. */
    --torrec-elev-1:        0 1px 2px rgba(0, 0, 0, .35), 0 1px 3px rgba(0, 0, 0, .30);
    --torrec-elev-2:        0 4px 10px rgba(0, 0, 0, .35), 0 10px 22px rgba(0, 0, 0, .30);
    --torrec-elev-3:        0 8px 18px rgba(0, 0, 0, .45), 0 18px 40px rgba(0, 0, 0, .45);

    /* Theme-invariant on purpose; see the light block. */
    --torrec-teal-fill:       #4A4541;
    --torrec-teal-fill-hover: #3A3633;
    --torrec-on-fill:         #FFFFFF;
  }
}

/* Explicit user choice via the header toggle (wins in both directions). */
:root[data-theme="dark"] {
  --torrec-teal:            #D2CBC4;
  --torrec-teal-hover:      #DCD5CE;
  --torrec-teal-rgb:        210, 203, 196;
  --torrec-cielo:           #D2CBC4;
  --torrec-cielo-rgb:       210, 203, 196;
  --torrec-terracotta:      #E07A4E;
  --torrec-success:         #45B98A;
  --torrec-warning:         #F0B54A;
  --torrec-warning-rgb:     240, 181, 74;
  --torrec-error:           #E36455;
  --torrec-error-rgb:       227, 100, 85;
  --torrec-error-tint:      rgba(var(--torrec-error-rgb), .18);
  --torrec-info:            #5B9BD8;
  /* Neutral warm-graphite ground (deliberately NOT teal-tinted) */
  --torrec-bg:              #161513;
  --torrec-surface:         #201F1D;
  --torrec-surface-2:       #2A2926;
  --torrec-border:          #383632;
  --torrec-text:            #EDECEA;
  --torrec-text-muted:      #A09E99;
  --torrec-shadow:          0 1px 3px rgba(0, 0, 0, .4), 0 1px 2px rgba(0, 0, 0, .3);
  --torrec-shadow-float:    0 18px 48px -12px rgba(0, 0, 0, .7), 0 6px 16px rgba(0, 0, 0, .45);
  /* Keep in step with the prefers-color-scheme block above (duplicated on purpose). */
  --torrec-elev-1:          0 1px 2px rgba(0, 0, 0, .35), 0 1px 3px rgba(0, 0, 0, .30);
  --torrec-elev-2:          0 4px 10px rgba(0, 0, 0, .35), 0 10px 22px rgba(0, 0, 0, .30);
  --torrec-elev-3:          0 8px 18px rgba(0, 0, 0, .45), 0 18px 40px rgba(0, 0, 0, .45);
  /* Theme-invariant on purpose; see the light block. */
  --torrec-teal-fill:         #4A4541;
  --torrec-teal-fill-hover:   #3A3633;
  --torrec-on-fill:           #FFFFFF;
}

/* ---- App shell ---------------------------------------------------------- */

.torrec-cursor-spotlight {
  position: fixed;
  inset: 0;
  z-index: 4;
  overflow: hidden;
  pointer-events: none;
}
.torrec-cursor-spotlight__glow {
  position: absolute;
  inset: 0 auto auto 0;
  inline-size: 28rem;
  aspect-ratio: 1;
  background: radial-gradient(circle closest-side, rgba(var(--torrec-cielo-rgb), .12), transparent);
  opacity: 0;
}
.torrec-cursor-spotlight__borders { display: none; }
@supports (mask-image: none) or (-webkit-mask-image: none) {
  .torrec-cursor-spotlight__borders {
    --spotlight-border-mask: radial-gradient(circle var(--spotlight-border-reach) at var(--spotlight-x) var(--spotlight-y), #000, transparent);
    display: block;
    position: absolute;
    inset: 0;
    -webkit-mask-image: var(--spotlight-border-mask);
    mask-image: var(--spotlight-border-mask);
  }
  .torrec-cursor-spotlight__borders > span {
    position: absolute;
    inset: 0 auto auto 0;
    box-shadow: inset 0 0 0 1px rgba(var(--torrec-cielo-rgb), .72);
  }
}
@media print {
  .torrec-cursor-spotlight { display: none; }
}

/* Centered content column: 80% of the viewport (≈10% gutter each side).
   Widened on small screens so the gutters don't crowd narrow phones. */
.torrec-shell {
  width: 80%;
  margin-inline: auto;
}
@media (max-width: 768px) {
  .torrec-shell { width: 92%; }
}

html, body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--torrec-bg);
  color: var(--torrec-text);
  -webkit-font-smoothing: antialiased;
}

/* ---- Typography (premium + motion pass) ----------------------------------
   One sans for everything you read and click, one display face for the few
   things you look at (page titles, hero numbers). Bootstrap's --bs-body-font-
   family is pointed at the token too, so Bootstrap components follow without
   a second override. */
:root {
  --bs-body-font-family: var(--torrec-font-sans);
}
body {
  font-family: var(--torrec-font-sans);
  font-feature-settings: "cv11", "ss01";   /* Inter: single-storey a, open digits */
  text-rendering: optimizeLegibility;
}
h1, h2, .h1, .h2,
.torrec-display {
  font-family: var(--torrec-font-display);
  font-weight: 700;
  letter-spacing: var(--torrec-tracking-display);
}
h1, .h1 { font-size: var(--torrec-text-xl); line-height: 1.15; }
h2, .h2 { font-size: var(--torrec-text-lg); line-height: 1.2; }
/* Bootstrap's own scale (h1 2.5rem … h5 1.25rem) is louder than this portal
   needs and inverts once h1-h3 shrink, so h4-h6 are pinned to the same step
   down. Pages use "h5"/"h6" as section headings under an eyebrow. */
h3, .h3 { font-size: var(--torrec-text-md); font-weight: 600; letter-spacing: -.01em; }
h4, .h4 { font-size: 1.0625rem; font-weight: 600; }
h5, .h5 { font-size: var(--torrec-text-base); font-weight: 600; }
h6, .h6 { font-size: .9375rem; font-weight: 600; }
.torrec-brand__name { font-family: var(--torrec-font-display); }
/* Numbers that sit in columns or tiles line up digit for digit. */
.torrec-stat__value,
.torrec-metric__value,
.torrec-metric > strong,
.torrec-num {
  font-variant-numeric: tabular-nums;
}
/* Hero numbers read as display type, not as bold body text. */
.torrec-stat__value,
.torrec-metric--lg > strong,
.torrec-metric--lg .torrec-metric__value {
  font-family: var(--torrec-font-display);
  letter-spacing: var(--torrec-tracking-display);
}

/* Syncfusion: Fluent2 resolves every control's font through
   `font-family: var(--e-font-family)` = var(--e-font-name), var(--e-font-sans)
   (checked against fluent2.css 34.1.31: 65 rules use it; the only literal
   "Segoe UI" rules are inside the RichTextEditor/Spreadsheet, unused here).
   Repointing the variable is enough, and it is theme-proof: the ej2 <link> sits
   before this file in every layout, and the dark swap only changes its href. */
:root {
  --e-font-name: var(--torrec-font-sans);
}

/* Sticky footer: the content column grows to fill leftover space so the
   footer always sits at the viewport bottom, even on short pages. */
body > header { flex-shrink: 0; }
.torrec-main { flex: 1 0 auto; }

a { color: var(--torrec-teal); }
a:hover { color: var(--torrec-teal-hover); }

/* Header / navbar */
.torrec-navbar {
  background-color: var(--torrec-surface);
  border-bottom: 1px solid var(--torrec-border);
  box-shadow: var(--torrec-shadow);
  padding-block: 0.75rem; /* taller banner (Bootstrap default is 0.5rem) */
}

.torrec-brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--torrec-text);
}
.torrec-brand:hover { color: var(--torrec-text); }
.torrec-brand__icon { width: 48px; height: 48px; display: block; }
.torrec-brand__name { font-size: 1.15rem; }
.torrec-brand__name b { color: var(--torrec-terracotta); font-weight: 700; font-size: 1.28em; }

.torrec-navbar .nav-link {
  color: var(--torrec-text-muted);
  font-weight: 500;
  border-radius: 6px;
  padding-inline: .7rem;
}
.torrec-navbar .nav-link:hover,
.torrec-navbar .nav-link:focus { color: var(--torrec-teal); }
.torrec-navbar .nav-link.active {
  color: var(--torrec-teal);
  background-color: color-mix(in srgb, var(--torrec-teal) 10%, transparent);
}

/* Footer */
.torrec-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--torrec-border);
  color: var(--torrec-text-muted);
  background-color: var(--torrec-surface);
  font-size: .8rem;
  line-height: 1.15;
  padding-block: 4px; /* very thin strip */
}
.torrec-footer a { color: var(--torrec-text-muted); text-decoration: underline; }
.torrec-footer a:hover { color: var(--torrec-teal); }

/* Generic surface card for centered content within the main layout (e.g. the
   portal login form). Distinct from Syncfusion's e-card, which comes with
   built-in hover/selection states meant for clickable cards. */
.torrec-card {
  background-color: var(--torrec-surface);
  border: 1px solid var(--torrec-border);
  border-radius: var(--torrec-radius);
  box-shadow: var(--torrec-shadow);
  padding: 2rem;
}

/* A simple branded accent bar under the header, echoing the palette. */
.torrec-accentbar {
  height: 3px;
  background: linear-gradient(90deg, var(--torrec-teal) 0%, var(--torrec-teal) 62%, var(--torrec-terracotta) 62%, var(--torrec-terracotta) 100%);
}

/* ============================================================
   Shared page-title banner. One reusable class for every portal
   page's title + action-buttons row, in both the Complex and
   Platform tiers. Do not fork this per page — add torrec-page-header
   to the page's title row instead of writing a new bespoke block.
   ============================================================ */
main:has(.torrec-page-header) {
  position: relative;
  isolation: isolate;
}
main:has(.torrec-page-header)::before {
  content: "";
  position: absolute;
  inset: -1rem -.8rem auto;
  height: 220px;
  background:
    radial-gradient(ellipse 55% 55% at 16% 8%, rgba(var(--torrec-teal-rgb), .15), transparent 70%),
    radial-gradient(ellipse 42% 42% at 88% 16%, color-mix(in srgb, var(--torrec-cielo, #A39C95) 14%, transparent), transparent 74%);
  pointer-events: none;
  z-index: -1;
}
.torrec-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.15rem 1.25rem;
  margin-bottom: 1rem;
  border-radius: calc(var(--torrec-radius) + 2px);
  border: 1px solid color-mix(in srgb, var(--torrec-border) 75%, var(--torrec-teal) 25%);
  box-shadow: 0 8px 18px rgba(30, 42, 43, .08);
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-surface) 84%, var(--torrec-surface-2) 16%), var(--torrec-surface));
}
.torrec-page-header h1 {
  margin: 0;
  letter-spacing: -.01em;
}
.torrec-page-header .e-btn.e-primary {
  border-radius: 999px;
  padding-inline: 1rem;
  font-weight: 700;
  box-shadow: 0 8px 16px color-mix(in srgb, var(--torrec-teal) 22%, transparent);
}
.torrec-page-header .e-btn.e-flat {
  border-radius: 999px;
}
@media (max-width: 980px) {
  main:has(.torrec-page-header)::before { height: 180px; }
  .torrec-page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: .7rem;
    padding: 1rem;
  }
  .torrec-page-header > .d-flex {
    width: 100%;
    flex-wrap: wrap;
    gap: .5rem !important;
  }
}

/* ============================================================
   Platform admin dashboard
   ============================================================ */
.torrec-dash__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}
.torrec-dash__eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .72rem;
  font-weight: 600;
  color: var(--torrec-teal);
}
.torrec-dash__title {
  margin: .15rem 0 .35rem;
  color: var(--torrec-text);
}
.torrec-dash__subtitle {
  margin: 0;
  color: var(--torrec-text-muted);
}
.torrec-dash__who {
  opacity: .85;
}

/* Reusable surface card */
.torrec-card {
  background: var(--torrec-surface);
  border: 1px solid var(--torrec-border);
  border-radius: var(--torrec-radius);
  box-shadow: var(--torrec-shadow);
  padding: 1.25rem 1.35rem;
}
.torrec-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: .75rem;
}
.torrec-card__title {
  margin: 0;
  font-size: 1.05rem;
  color: var(--torrec-text);
}
.torrec-card__pills {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
}

/* Stat cards */
.torrec-dash__stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.torrec-stat {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .1rem;
  background: var(--torrec-surface);
  border: 1px solid var(--torrec-border);
  border-radius: var(--torrec-radius);
  box-shadow: var(--torrec-shadow);
  padding: 1.1rem 1.25rem;
  overflow: hidden;
}
/* A tile that links somewhere still reads as a tile, not as a paragraph of link text — the whole card
   is the target, so the underline and link colour would only fight the layout. Hover and focus carry
   the affordance instead, and focus stays visible for keyboard users. */
a.torrec-stat,
a.torrec-stat:hover,
a.torrec-stat:focus {
  text-decoration: none;
  color: inherit;
}
a.torrec-stat:hover {
  border-color: var(--torrec-teal);
}
a.torrec-stat:focus-visible {
  outline: 2px solid var(--torrec-teal);
  outline-offset: 2px;
}
/* Left accent stripe, tinted per card */
.torrec-stat::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--torrec-teal);
}
.torrec-stat--terracotta::before { background: var(--torrec-terracotta); }
/* Teal is already the default stripe; named explicitly so a view that says
   --teal is self-documenting rather than relying on the fallback. */
.torrec-stat--teal::before { background: var(--torrec-teal); }
/* Placeholder tile — no data wired yet */
.torrec-stat--muted::before { background: var(--torrec-border); }
.torrec-stat--muted .torrec-stat__value { color: var(--torrec-text-muted); }
/* Icon in a small tinted square, tinted to match the tile's stripe. */
.torrec-stat__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  margin-bottom: .55rem;
  border-radius: var(--torrec-radius-sm);
  background: rgba(var(--torrec-teal-rgb), .12);
  color: var(--torrec-teal);
  font-size: 1.05rem;
  line-height: 1;
}
.torrec-stat--terracotta .torrec-stat__icon {
  background: color-mix(in srgb, var(--torrec-terracotta) 14%, transparent);
  color: var(--torrec-terracotta);
}
.torrec-stat--muted .torrec-stat__icon {
  background: var(--torrec-surface-2);
  color: var(--torrec-text-muted);
}
.torrec-stat__value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.05;
  color: var(--torrec-text);
}
.torrec-stat__label {
  font-size: .9rem;
  color: var(--torrec-text);
}
.torrec-stat__detail {
  font-size: .8rem;
  color: var(--torrec-text-muted);
}

/* ==========================================================================
   SHARED PREMIUM PRIMITIVES  —  portal_design_system.md §3
   --------------------------------------------------------------------------
   The Cuotas page (Payments/FeeSchedules.cshtml) was the only page carrying
   the "premium" treatment, and every rule for it was locked behind a
   page-scoped selector. These classes are that same recipe, extracted once so
   every page composes it instead of re-hand-rolling the gradient/border/shadow
   under a new page name (which is how four different eyebrow rules happened).

   Composition only — no new color tokens. Everything below is built from the
   --torrec-* custom properties already defined at :root plus color-mix() and
   gradients, so all of it is theme-aware for free (§6).

   CSS is explicitly SHARED between the Platform and Complex tiers per
   CLAUDE.md § Platform vs. Complex Duplication — a class name carries no
   authorization decision. Views, controllers and facades stay duplicated.
   ========================================================================== */

/* ---- Panel: the gradient-bordered surface -------------------------------
   Generalizes Cuotas' __panel / __table-card / __hero-copy. Distinct from
   .torrec-card (flat surface, single border) — use .torrec-panel when the
   block should read as a premium surface, .torrec-card for plain content. */
.torrec-panel,
.torrec-hero__copy,
.torrec-hero__metrics {
  border: 1px solid color-mix(in srgb, var(--torrec-border) 76%, var(--torrec-teal) 24%);
  border-radius: calc(var(--torrec-radius) + 4px);
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-surface) 90%, var(--torrec-surface-2) 10%), var(--torrec-surface));
  box-shadow: 0 14px 26px rgba(30, 42, 43, .08);
}
.torrec-panel {
  padding: 1.1rem 1.15rem;
}
/* No padding: the child (a table, a grid) reaches the panel edge itself. */
.torrec-panel--flush {
  padding: 0;
  overflow: hidden;
}
/* Table container: pads the sides so the table "floats" inside the panel while
   its last row still meets the bottom edge. */
.torrec-panel--table {
  padding: .8rem .8rem 0;
  overflow: hidden;
}
/* Teal wash from the top-left corner — the hero-copy treatment, also useful on
   a single standout panel that has no hero above it. */
.torrec-panel--accent {
  background:
    radial-gradient(circle at top left, rgba(var(--torrec-teal-rgb), .08), transparent 42%),
    linear-gradient(180deg, color-mix(in srgb, var(--torrec-surface) 92%, var(--torrec-surface-2) 8%), var(--torrec-surface));
}
/* An empty/heads-up state that is not an error — Cuotas' __empty. */
.torrec-panel--warning {
  border-color: color-mix(in srgb, var(--torrec-warning) 42%, var(--torrec-border));
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-warning) 14%, transparent), color-mix(in srgb, var(--torrec-surface) 92%, transparent));
}

/* ---- Eyebrow: the uppercase micro-label --------------------------------
   ONE definition, two variants. Four independent near-duplicates existed
   before this (.torrec-dash__eyebrow, .torrec-reports__eyebrow,
   .torrec-payments-cuotas-page__eyebrow, .torrec-committee-*__eyebrow) with
   different sizes, weights and colors. The two still referenced by markup are
   kept as aliases on the variant matching what they rendered as, so no page
   changes appearance — but nothing new should use them. Use .torrec-eyebrow. */
.torrec-eyebrow {
  display: inline-block;
  margin: 0 0 .45rem;
  font-size: .68rem;
  line-height: 1;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--torrec-text-muted);
  font-weight: 700;
}
/* Teal instead of muted — reads louder, for a page's top-level hero. */
.torrec-eyebrow--accent,
.torrec-dash__eyebrow,
.torrec-reports__eyebrow {
  display: block;
  margin: 0 0 .35rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: .72rem;
  line-height: 1.1;
  font-weight: 700;
  color: var(--torrec-teal);
}

/* ---- Hero: the two-column intro band -----------------------------------
   Copy on the left, a metrics strip on the right. Collapses to one column at
   900px, and the metrics strip goes single-column at 700px — two steps, so the
   desktop-to-phone transition is not one jarring stack (§2). */
.torrec-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr);
  gap: 1rem;
  align-items: stretch;
}
/* Copy-heavy hero (a long subtitle, action buttons) — more room on the left. */
.torrec-hero--wide {
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, .95fr);
}
/* No metrics strip: the copy band spans the full width. */
.torrec-hero--solo {
  grid-template-columns: minmax(0, 1fr);
}
.torrec-hero__copy {
  padding: 1.2rem 1.3rem;
  background:
    radial-gradient(circle at top left, rgba(var(--torrec-teal-rgb), .08), transparent 42%),
    linear-gradient(180deg, color-mix(in srgb, var(--torrec-surface) 92%, var(--torrec-surface-2) 8%), var(--torrec-surface));
}
.torrec-hero__copy h1,
.torrec-hero__copy h2,
.torrec-hero__copy .torrec-hero__title {
  margin: 0;
  letter-spacing: -.02em;
}
.torrec-hero__copy p,
.torrec-hero__subtitle {
  margin: .55rem 0 0;
  color: var(--torrec-text-muted);
  line-height: 1.55;
}
.torrec-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: .95rem;
}
.torrec-hero__metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .8rem;
  padding: .8rem;
}
.torrec-hero__metrics--1 { grid-template-columns: minmax(0, 1fr); }
.torrec-hero__metrics--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.torrec-hero__metrics--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---- Metric: one stat tile ---------------------------------------------
   Generalized from .torrec-payments-metric. Accepts either bare span/strong
   children (Cuotas' markup) or explicit __label/__value elements.

   Deliberately NOT merged with the older flat .torrec-stat, which §3 floated
   as a maybe: .torrec-stat carries its own identity (left accent stripe, plus
   link/hover/focus states for tiles that navigate) and is used across ~10
   views in both tiers. Folding them together would be a large, unverifiable
   visual change for no gain, so the split is: .torrec-metric is the tile
   inside a hero strip, .torrec-stat is the standalone dashboard tile. */
.torrec-metric {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: .3rem;
  min-height: 110px;
  padding: .9rem .8rem;
  border-radius: calc(var(--torrec-radius) - 2px);
  border: 1px solid color-mix(in srgb, var(--torrec-border) 82%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-surface-2) 75%, var(--torrec-surface) 25%), var(--torrec-surface));
}
.torrec-metric > span:not(.torrec-metric__detail),
.torrec-metric__label {
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--torrec-text-muted);
  font-weight: 700;
}
.torrec-metric > strong,
.torrec-metric__value {
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--torrec-text);
  font-variant-numeric: tabular-nums;
}
/* Excluded from the `> span` label rule above — as a direct span child it would
   otherwise inherit that rule's uppercase/letter-spacing at higher specificity
   (0,1,1 beats 0,1,0) and render as a second label rather than a detail line. */
.torrec-metric__detail {
  font-size: .78rem;
  line-height: 1.3;
  letter-spacing: normal;
  text-transform: none;
  font-weight: 500;
  color: var(--torrec-text-muted);
}
/* Big-number variant, for a hero whose whole point is one or two large counts
   (the Committee pages were built this way before the primitives existed). */
.torrec-metric--lg > strong,
.torrec-metric--lg .torrec-metric__value {
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -.04em;
}
/* Draws the eye to the headline number of the strip — exactly one per hero. */
.torrec-metric--accent {
  background: linear-gradient(135deg, rgba(var(--torrec-teal-rgb), .12), rgba(var(--torrec-teal-rgb), .04));
}
.torrec-metric--warning {
  border-color: color-mix(in srgb, var(--torrec-warning) 40%, var(--torrec-border));
}
.torrec-metric--danger {
  border-color: color-mix(in srgb, var(--torrec-error) 40%, var(--torrec-border));
}
.torrec-metric--success {
  border-color: color-mix(in srgb, var(--torrec-success) 38%, var(--torrec-border));
}
/* A metrics strip used on its own, outside a hero. */
.torrec-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: .8rem;
}

/* ---- Section head: eyebrow-over-heading, hint on the right -------------- */
.torrec-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: .9rem;
}
/* Baseline-aligned variant, for a head sitting directly above a table. */
.torrec-section-head--baseline {
  align-items: end;
  margin-bottom: -.2rem;
}
.torrec-section-head h2,
.torrec-section-head h3,
.torrec-section-head .h6 {
  margin: 0;
  letter-spacing: -.02em;
}
.torrec-section-head .h6 {
  margin-top: .15rem;
  font-size: .98rem;
  letter-spacing: .01em;
}
/* The hint text gets its own muted card rather than running as loose copy. */
.torrec-section-head__hint,
.torrec-hint {
  margin: 0;
  padding: .7rem .9rem;
  border: 1px solid color-mix(in srgb, var(--torrec-border) 84%, transparent);
  border-radius: calc(var(--torrec-radius) - 1px);
  background: color-mix(in srgb, var(--torrec-surface) 94%, var(--torrec-surface-2) 6%);
  color: var(--torrec-text-muted);
  line-height: 1.5;
}
.torrec-hint {
  box-shadow: 0 6px 14px rgba(30, 42, 43, .06);
}

/* ---- Filter / form bar --------------------------------------------------
   The "row of labelled inputs plus one primary action" strip that Mensuales,
   Cuotas, Expenses, Incidents history and Packages each re-declared. */
.torrec-filterbar {
  padding: 1.1rem 1.15rem;
}
.torrec-filterbar__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: .8rem;
  align-items: end;
}
.torrec-filterbar__field--wide {
  min-width: 220px;
}
.torrec-filterbar .form-label,
.torrec-formpanel .form-label,
.torrec-filterbar__grid label,
.torrec-formpanel label {
  display: block;
  margin-bottom: .35rem;
  font-size: .73rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--torrec-text-muted);
  font-weight: 700;
}
.torrec-filterbar .e-input,
.torrec-formpanel .e-input {
  width: 100%;
  border-radius: 10px;
  border-color: color-mix(in srgb, var(--torrec-border) 72%, var(--torrec-teal) 28%);
  background: rgba(var(--torrec-teal-rgb), .015);
}
.torrec-filterbar__action {
  display: flex;
  align-items: end;
}
.torrec-filterbar__action .e-btn {
  width: 100%;
  min-height: 42px;
  border-radius: 999px;
  box-shadow: 0 8px 16px rgba(var(--torrec-teal-rgb), .18);
}

/* ---- Form panel --------------------------------------------------------- */
.torrec-formpanel {
  padding: 1.2rem 1.25rem;
}
.torrec-formpanel .e-btn {
  border-radius: 999px;
}
.torrec-formpanel .e-btn.e-primary {
  box-shadow: 0 8px 16px rgba(var(--torrec-teal-rgb), .18);
}
.torrec-formpanel .form-text {
  margin-top: .45rem;
  color: var(--torrec-text-muted);
  font-size: .82rem;
}
/* Checkbox rows read as their own soft chip rather than a bare tick. */
.torrec-formpanel .form-check {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-bottom: 0;
  padding: .55rem .7rem;
  border: 1px solid color-mix(in srgb, var(--torrec-border) 80%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--torrec-surface) 94%, var(--torrec-surface-2) 6%);
}
.torrec-formpanel .form-check-input {
  margin-top: 0;
}
.torrec-formpanel .form-check-label {
  margin-bottom: 0;
  color: var(--torrec-text);
  font-weight: 600;
}

/* ---- Pill button / action row ------------------------------------------- */
.torrec-btn-pill,
.torrec-actions .e-btn {
  border-radius: 999px;
}
.torrec-btn-pill.e-primary,
.torrec-actions .e-btn.e-primary {
  padding-inline: 1rem;
  font-weight: 700;
  box-shadow: 0 8px 16px color-mix(in srgb, var(--torrec-teal) 22%, transparent);
}
.torrec-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

/* ---- Table surfaces ----------------------------------------------------
   .torrec-tablewrap  — a plain .torrec-table inside a rounded premium surface.
   .torrec-gridwrap   — the same for an EJ2 Grid / Kanban / Scheduler, which
                        renders its own header, rows and pager.
   Both replace the identical recipe repeated across ~12 page-scoped blocks. */
.torrec-tablewrap,
.torrec-gridwrap {
  border: 1px solid color-mix(in srgb, var(--torrec-border) 76%, var(--torrec-teal) 24%);
  border-radius: calc(var(--torrec-radius) + 2px);
  overflow: hidden;
  background: var(--torrec-surface);
  box-shadow: 0 12px 24px rgba(30, 42, 43, .1);
}
.torrec-tablewrap table.torrec-table,
.torrec-panel--table table.torrec-table {
  margin-bottom: 0;
}
.torrec-tablewrap table.torrec-table thead th,
.torrec-panel--table table.torrec-table thead th {
  border-bottom: 1px solid var(--torrec-border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-surface-2) 58%, var(--torrec-surface) 42%), var(--torrec-surface));
  color: var(--torrec-text);
  font-weight: 700;
}
.torrec-tablewrap table.torrec-table tbody tr,
.torrec-panel--table table.torrec-table tbody tr {
  transition: background-color .2s ease;
}
.torrec-tablewrap table.torrec-table tbody tr:hover,
.torrec-panel--table table.torrec-table tbody tr:hover {
  background: color-mix(in srgb, var(--torrec-teal) 6%, var(--torrec-surface));
}
.torrec-tablewrap table.torrec-table tbody tr:last-child td {
  border-bottom: 0;
}
.torrec-gridwrap .e-grid {
  border: 0;
  border-radius: 0;
}
.torrec-gridwrap .e-gridheader {
  border-bottom: 1px solid var(--torrec-border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-surface-2) 60%, var(--torrec-surface) 40%), var(--torrec-surface));
}
.torrec-gridwrap .e-gridheader .e-headercell {
  color: var(--torrec-text);
  font-weight: 700;
}
.torrec-gridwrap .e-groupdroparea {
  border-bottom: 1px solid color-mix(in srgb, var(--torrec-border) 80%, transparent);
  background: color-mix(in srgb, var(--torrec-surface) 90%, var(--torrec-surface-2) 10%);
}
.torrec-gridwrap .e-groupcaptionrow {
  background: color-mix(in srgb, var(--torrec-teal) 8%, transparent);
}
.torrec-gridwrap .e-groupcaption {
  font-weight: 700;
  color: var(--torrec-text);
}
.torrec-gridwrap .e-row {
  transition: background-color .14s ease;
}
.torrec-gridwrap .e-row:hover {
  background: color-mix(in srgb, var(--torrec-teal) 7%, transparent);
}
.torrec-gridwrap .e-gridpager {
  border-top: 1px solid var(--torrec-border);
  background: color-mix(in srgb, var(--torrec-surface) 92%, var(--torrec-surface-2) 8%);
}

/* Caps a long table's height and pins its header, so a roster of hundreds of
   rows scrolls in place instead of growing the page without bound. */
.torrec-scroll-y {
  max-height: 65vh;
  overflow-y: auto;
}
.torrec-scroll-y table.torrec-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}
/* Wide tables at narrow widths: scroll the table, never the page body. */
.torrec-scroll-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ---- Table system (premium + motion pass) ---------------------------------
   THE RULE: every data table is
     <div class="torrec-tablewrap torrec-scroll-x"> <table class="torrec-table">…</table> </div>
   (or sits in a .torrec-scroll-x inside a .torrec-panel--table). The WRAPPER is
   the visual surface — border, radius, shadow — and, being a block, it is exactly
   as wide as the content column. A genuinely wider table scrolls sideways INSIDE
   that card; it never paints past the column. Before this, three pages put the
   card recipe on the <table> itself, and a <table> grows to its min-content
   width, so on /packages the "card" ran ~120px past the filter card above it.

   Never put a display utility (d-flex, d-grid, d-block…) on a <td>/<th>.
   display:flex !important stops the cell being a table cell; the browser wraps
   it in an anonymous cell box, and its borders and height stop lining up with
   the rest of the row. Put .torrec-row-actions INSIDE the cell instead.

   Columns are styled by class (.torrec-col-*), never by nth-child — an
   nth-child rule silently restyles the wrong column the day one is added. */

/* .torrec-tablewrap sets overflow:hidden (so the radius clips the header
   gradient); .torrec-scroll-x, declared after it at equal specificity, already
   wins for overflow-x. Stated once more at higher specificity so the combination
   cannot be broken by someone reordering the file: the result must be
   overflow-x:auto (scrolls) + overflow-y:hidden (corners still clip). */
.torrec-tablewrap.torrec-scroll-x,
.torrec-gridwrap.torrec-scroll-x {
  overflow-x: auto;
  overflow-y: hidden;
}
.torrec-tablewrap.torrec-scroll-y {
  overflow-y: auto;
}
/* A short preview (the unit/part generators): the confirm button under it must
   stay on screen. */
.torrec-scroll-y--short {
  max-height: 320px;
}

/* Base rhythm for every .torrec-table. :where() keeps this at 0,1,0 so any
   existing page-scoped table rule still wins — this only fills in tables that
   had no cell padding at all (the bare ones inside .torrec-panel--table). */
.torrec-table {
  border-collapse: collapse;
  font-size: var(--torrec-text-sm);
}
.torrec-table :where(th, td) {
  padding: .72rem .9rem;
  vertical-align: middle;
  border-bottom: 1px solid color-mix(in srgb, var(--torrec-border) 70%, transparent);
}
.torrec-table :where(thead th) {
  font-size: var(--torrec-text-xs);
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--torrec-text-muted);
  text-align: start;
}
.torrec-table :where(tbody tr:last-child td) {
  border-bottom: 0;
}

/* Column utilities — put them on the <th> AND its <td>s. */
.torrec-col-nowrap { white-space: nowrap; }
/* Amounts, counts, money: right-aligned, fixed-width figures so columns line up. */
.torrec-col-num {
  white-space: nowrap;
  text-align: end;
  font-variant-numeric: tabular-nums;
}
/* Dates/times: one line, fixed-width figures, quieter than the row's subject. */
.torrec-col-date {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--torrec-text-muted);
}
/* The row's subject (unit, name): one weight up. */
.torrec-col-strong { font-weight: 600; }
.torrec-col-muted { color: var(--torrec-text-muted); }
/* Free text: wraps normally but never squeezes into a one-word-per-line ribbon,
   and never stretches a row into a paragraph either. */
.torrec-col-text {
  min-width: 12rem;
  max-width: 28rem;
  overflow-wrap: anywhere;
}
/* Right-aligned, one line, as narrow as its content allows (width:1% is the
   shrink-to-fit idiom for a table column). */
.torrec-col-actions {
  width: 1%;
  white-space: nowrap;
  text-align: end;
}
/* A reason line under a row's button (Invoices: the PAC error, a disabled
   button's why) wraps under the button instead of stretching the column. */
.torrec-col-actions small {
  display: block;
  min-width: 12rem;
  white-space: normal;
}
/* A header cell for a column with no visible label (the actions column) still
   needs an accessible name; .visually-hidden comes from Bootstrap. */

/* Row actions: the flex container lives INSIDE the cell, never on it. */
.torrec-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: .35rem;
  flex-wrap: nowrap;
  vertical-align: middle;
}
.torrec-row-actions > form {
  display: inline-flex;
  margin: 0;
}
.torrec-row-actions .e-btn.e-small {
  border-radius: var(--torrec-radius-pill);
  padding-inline: .8rem;
}

/* Icon-only button: a square 32px target used for unambiguous row actions and
   for the overflow ("⋯") trigger. Always paired with aria-label + title. */
.torrec-iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--torrec-radius-pill);
  background: transparent;
  color: var(--torrec-text-muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--torrec-dur-fast) var(--torrec-ease-out),
              color var(--torrec-dur-fast) var(--torrec-ease-out),
              border-color var(--torrec-dur-fast) var(--torrec-ease-out),
              transform var(--torrec-dur-fast) var(--torrec-ease-out);
}
.torrec-iconbtn:hover,
.torrec-iconbtn[aria-expanded="true"] {
  background: color-mix(in srgb, var(--torrec-teal) 10%, transparent);
  border-color: color-mix(in srgb, var(--torrec-teal) 22%, transparent);
  color: var(--torrec-teal);
}
.torrec-iconbtn:active { transform: scale(.97); }
.torrec-iconbtn:focus-visible {
  outline: var(--torrec-focus-ring);
  outline-offset: var(--torrec-focus-offset);
}

/* Overflow menu. site.js ("Row action menus") moves the open menu to <body> and
   positions it with position:fixed from the trigger's rect, because a menu left
   inside the table would be clipped by the scroll wrapper's overflow. The markup
   contract:
     <div class="torrec-rowmenu" data-torrec-rowmenu>
       <button class="torrec-iconbtn" data-torrec-rowmenu-trigger aria-haspopup="menu"
               aria-expanded="false" aria-label="…" title="…">…</button>
       <div class="torrec-rowmenu__menu" role="menu" hidden>
         <a class="torrec-rowmenu__item" role="menuitem" href="…">…</a>
       </div>
     </div> */
.torrec-rowmenu { display: inline-flex; }
.torrec-rowmenu__menu {
  position: fixed;
  z-index: 1060;               /* above the drawer (1041) and the assistant (1045) */
  min-width: 11rem;
  max-width: min(18rem, calc(100vw - 16px));
  padding: .3rem;
  border: 1px solid color-mix(in srgb, var(--torrec-border) 80%, var(--torrec-teal) 20%);
  border-radius: var(--torrec-radius-md);
  background: var(--torrec-surface);
  box-shadow: var(--torrec-elev-3);
  transform-origin: top right;
}
.torrec-rowmenu__menu[hidden] { display: none; }
.torrec-rowmenu__menu[data-placement="above"] { transform-origin: bottom right; }
.torrec-rowmenu__item {
  display: flex;
  align-items: center;
  gap: .6rem;
  width: 100%;
  padding: .5rem .65rem;
  border: 0;
  border-radius: var(--torrec-radius-sm);
  background: transparent;
  color: var(--torrec-text);
  font: inherit;
  font-size: var(--torrec-text-sm);
  text-align: start;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.torrec-rowmenu__item > .bi {
  width: 1rem;
  color: var(--torrec-text-muted);
}
.torrec-rowmenu__item:hover,
.torrec-rowmenu__item:focus-visible {
  outline: none;
  background: color-mix(in srgb, var(--torrec-teal) 9%, transparent);
  color: var(--torrec-teal);
}
.torrec-rowmenu__item:hover > .bi,
.torrec-rowmenu__item:focus-visible > .bi { color: var(--torrec-teal); }
.torrec-rowmenu__menu > form { margin: 0; }

/* Status pill: one line, never wraps, colour from the semantic tokens. The ink
   is mixed 50/50 with --torrec-text so it stays >= 4.5:1 on its own tint in
   BOTH palettes (pure --torrec-warning on a light surface is ~2:1). */
.torrec-status {
  --torrec-status-hue: var(--torrec-text-muted);
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .18rem .6rem;
  border: 1px solid color-mix(in srgb, var(--torrec-status-hue) 30%, transparent);
  border-radius: var(--torrec-radius-pill);
  background: color-mix(in srgb, var(--torrec-status-hue) 12%, var(--torrec-surface));
  color: color-mix(in srgb, var(--torrec-status-hue) 50%, var(--torrec-text));
  font-size: var(--torrec-text-xs);
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  vertical-align: middle;
  transition: background-color var(--torrec-dur-base) var(--torrec-ease-out),
              color var(--torrec-dur-base) var(--torrec-ease-out),
              border-color var(--torrec-dur-base) var(--torrec-ease-out);
}
.torrec-status::before {
  content: "";
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--torrec-status-hue);
}
/* An icon in place of the dot. */
.torrec-status--icon::before { content: none; }
.torrec-status--success { --torrec-status-hue: var(--torrec-success); }
.torrec-status--warning { --torrec-status-hue: var(--torrec-warning); }
.torrec-status--error,
.torrec-status--danger  { --torrec-status-hue: var(--torrec-error); }   /* --danger: the view models' variant name */
.torrec-status--info    { --torrec-status-hue: var(--torrec-info); }
.torrec-status--accent  { --torrec-status-hue: var(--torrec-teal); }
.torrec-status--neutral { --torrec-status-hue: var(--torrec-text-muted); }
.torrec-status + .torrec-status { margin-left: .3rem; }

/* Photo thumbnail inside a row: fixed 40px height so a photo never sets the
   row height, soft frame so it reads as an object rather than a hole. */
.torrec-thumb {
  display: block;
  height: 40px;
  width: auto;
  max-width: 72px;
  object-fit: cover;
  border: 1px solid var(--torrec-border);
  border-radius: var(--torrec-radius-sm);
  box-shadow: var(--torrec-elev-1);
}
/* Square avatar-style variant (pets). */
.torrec-thumb--sq {
  width: 32px;
  height: 32px;
}
.torrec-thumb-link { display: inline-block; border-radius: var(--torrec-radius-sm); }
/* Thumbnail + label on one line inside a cell. */
.torrec-cell-media {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
}
.torrec-thumb-link:focus-visible {
  outline: var(--torrec-focus-ring);
  outline-offset: var(--torrec-focus-offset);
}

/* A short, muted label whose long explanation lives in a tooltip (title=) —
   e.g. "Sin foto" for "Sin foto (dispositivo no disponible)". */
.torrec-cell-note {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  white-space: nowrap;
  color: var(--torrec-text-muted);
}
.torrec-cell-note[title] { cursor: help; }

/* ---- Stacked "card rows" on phones -----------------------------------------
   Opt-in with .torrec-table--stack plus a data-label on every <td>. Below 640px
   each row becomes a mini card and each cell shows its column name in front of
   its value, so a seven-column roster is readable without sideways scrolling.
   Same markup at every width — nothing is duplicated. */
@media (max-width: 640px) {
  .torrec-table--stack,
  .torrec-table--stack tbody,
  .torrec-table--stack tr,
  .torrec-table--stack td {
    display: block;
    width: 100%;
  }
  /* The header row is replaced by the per-cell labels; kept for screen readers. */
  .torrec-table--stack thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .torrec-table--stack tbody tr {
    padding: .4rem 0;
    border-bottom: 1px solid var(--torrec-border);
  }
  .torrec-table--stack tbody tr:last-child { border-bottom: 0; }
  /* display:flex on a <td> is fine HERE only: in stacked mode nothing is a
     table box any more (every level above is display:block), so there is no
     row for the cell to fall out of. */
  .torrec-table--stack tbody td {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    min-width: 0;
    max-width: none;
    padding: .3rem .9rem;
    border-bottom: 0;
    text-align: end;
    white-space: normal;
  }
  .torrec-table--stack tbody td[data-label]::before {
    content: attr(data-label);
    flex: 0 0 auto;
    max-width: 45%;
    font-size: var(--torrec-text-xs);
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--torrec-text-muted);
    text-align: start;
  }
  /* The actions cell spans the card's width under the values. */
  .torrec-table--stack tbody td.torrec-col-actions {
    width: 100%;
    justify-content: flex-end;
    padding-top: .5rem;
  }
  /* The phone safety net (further down, 700px) forces `main .torrec-scroll-x
     table.torrec-table { display: table }` at 0,2,2. A stacked table must stay
     display:block, so this outranks it (0,2,3) regardless of file order. */
  html main table.torrec-table.torrec-table--stack {
    display: block;
    overflow-x: visible;
  }
}

/* The login screen renders inside the full portal layout rather than _LayoutBare,
   so it needs the auth card's width cap without the bare layout's centring shell. */
.torrec-auth-standalone {
  width: 400px;
  max-width: 100%;
  margin-top: 2rem;
}

@media (max-width: 480px) {
  .torrec-auth-standalone {
    width: 100%;
    margin-top: .5rem;
  }
}

/* ---- Narrow column ------------------------------------------------------
   A single-purpose form (MFA enrol, password reset, an invite) should not
   stretch to a 1200px content column — the eye has to travel the full width
   for a two-field form. Caps and centres the page's own stack instead of each
   such view inventing its own max-width. */
.torrec-narrow {
  width: 100%;
  max-width: 640px;
  margin-inline: auto;
}
.torrec-narrow--wide {
  max-width: 860px;
}

/* ---- Ambient page glow -------------------------------------------------
   The two soft radial washes behind a page's top band. Eight pages had already
   hand-rolled this identical ::before under their own selector (reports index,
   both dashboards, payments statement, payments issuance, account, voting
   detail, community, incidents board, committee); each one also had to remember
   `position: relative; isolation: isolate` on the parent or the z-index:-1
   layer escaped behind the page background. One class instead.

   isolation:isolate is what keeps z-index:-1 inside this element's stacking
   context — without it the glow paints behind <body> and disappears. */
.torrec-glow {
  position: relative;
  isolation: isolate;
}
.torrec-glow::before {
  content: "";
  position: absolute;
  inset: -1rem -.8rem auto;
  height: 220px;
  background:
    radial-gradient(ellipse 55% 55% at 16% 8%, rgba(var(--torrec-teal-rgb), .15), transparent 70%),
    radial-gradient(ellipse 42% 42% at 88% 16%, color-mix(in srgb, var(--torrec-cielo, #A39C95) 14%, transparent), transparent 74%);
  pointer-events: none;
  z-index: -1;
}
.torrec-glow--tall::before { height: 250px; }

@media (max-width: 900px) {
  .torrec-glow::before {
    inset: -.8rem -.5rem auto;
    height: 180px;
  }
}

/* ---- Page stack --------------------------------------------------------
   A premium page is a vertical stack of hero + panels with one consistent
   gutter, rather than each block carrying its own margin-bottom. */
.torrec-stack {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.torrec-stack--tight {
  gap: .9rem;
}

/* ---- Responsive steps for the primitives -------------------------------
   Two breakpoints on purpose (§2): the hero grid collapses before the metrics
   grid does, so desktop-to-phone is a gradient rather than one jarring stack. */
@media (max-width: 900px) {
  .torrec-hero,
  .torrec-hero--wide {
    grid-template-columns: minmax(0, 1fr);
  }
  .torrec-hero__metrics--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .torrec-stack { gap: 1rem; }
  /* Same equal-specificity ordering trap as the panel variants above: --tight is
     declared earlier, so the blanket gap would win here without this. Unused in any
     view today, re-asserted so it is not a trap for whoever reaches for it first. */
  .torrec-stack--tight { gap: .8rem; }
  .torrec-hero__copy { padding: 1rem; }
  .torrec-hero__metrics,
  .torrec-hero__metrics--2,
  .torrec-hero__metrics--4 {
    grid-template-columns: minmax(0, 1fr);
  }
  .torrec-metric {
    min-height: 0;
  }
  .torrec-metrics {
    grid-template-columns: minmax(0, 1fr);
  }
  .torrec-panel,
  .torrec-filterbar,
  .torrec-formpanel {
    padding: .9rem;
  }
  /* Re-assert the variants: they are equal-specificity single-class rules declared
     EARLIER in the file, so the blanket .torrec-panel padding above would otherwise
     win here and a table panel would lose its flush bottom edge. */
  .torrec-panel--table {
    padding: .7rem .7rem 0;
  }
  .torrec-panel--flush {
    padding: 0;
  }
  .torrec-filterbar__grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .torrec-filterbar__field--wide {
    min-width: 0;
  }
  .torrec-section-head,
  .torrec-section-head--baseline {
    flex-direction: column;
    align-items: flex-start;
  }
  /* Button rows grow to fill the width instead of shrinking to their labels — a
     .5rem-gap row of pills at 360px leaves each one too small to hit reliably.
     `1 1 45%` is what makes this adapt to the count rather than always stacking:
     one button spans the row, two split it, and a five-button toolbar (Units)
     lands two-up instead of becoming five full-width slabs. */
  .torrec-actions {
    width: 100%;
  }
  .torrec-actions > .e-btn,
  .torrec-actions > a,
  .torrec-actions > form,
  .torrec-actions > form > .e-btn {
    flex: 1 1 45%;
    min-width: 45%;
    justify-content: center;
    text-align: center;
  }
  .torrec-actions > form > .e-btn {
    width: 100%;
  }
  /* Tables that cannot usefully reflow scroll sideways inside their surface. */
  .torrec-tablewrap,
  .torrec-panel--table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .torrec-card {
    padding: .9rem;
  }
}

/* Chart + nav grid */
.torrec-dash__grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
  align-items: start;
}
.torrec-dash__navtitle {
  margin: 0 0 .75rem;
  font-size: 1.05rem;
  color: var(--torrec-text);
}

/* Navigation cards */
.torrec-navcard {
  display: flex;
  align-items: center;
  gap: .85rem;
  background: var(--torrec-surface);
  border: 1px solid var(--torrec-border);
  border-radius: var(--torrec-radius);
  box-shadow: var(--torrec-shadow);
  padding: .9rem 1rem;
  margin-bottom: .75rem;
  text-decoration: none;
  color: var(--torrec-text);
  transition: border-color .15s ease, transform .15s ease;
}
.torrec-navcard:hover {
  border-color: var(--torrec-teal);
  transform: translateY(-1px);
  color: var(--torrec-text);
  text-decoration: none;
}
/* Icon in a soft teal circle. Was an emoji at 1.35rem; Bootstrap Icons now, so
   the colour comes from the palette and matches across OSes (an emoji's
   artwork differs per platform and ignores the theme). Two page-scoped rules
   below already drew this circle for the dashboards; it is the default now. */
.torrec-navcard__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: rgba(var(--torrec-teal-rgb), .12);
  color: var(--torrec-teal);
  font-size: 1.1rem;
  line-height: 1;
}
.torrec-navcard__body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}
.torrec-navcard__title {
  font-weight: 600;
}
.torrec-navcard__desc {
  font-size: .82rem;
  color: var(--torrec-text-muted);
}
.torrec-navcard__arrow {
  color: var(--torrec-teal);
  font-size: 1.1rem;
}

/* Reports index page. The glow, head band, eyebrow and title are now the shared
   .torrec-glow / .torrec-hero / .torrec-eyebrow primitives, applied in the view;
   .torrec-reports__eyebrow itself survives only as an alias in the shared eyebrow
   rule, for any markup still referencing it. What is left here is the catalog's
   own 2-up card grid, which is genuinely specific to this page. */
.torrec-reports__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .9rem;
}

.torrec-reports__card {
  position: relative;
  margin-bottom: 0;
  min-height: 112px;
  border: 1px solid color-mix(in srgb, var(--torrec-border) 80%, var(--torrec-teal) 20%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-surface) 90%, var(--torrec-surface-2) 10%), var(--torrec-surface));
  box-shadow: 0 8px 18px rgba(30, 42, 43, .08);
}

.torrec-reports__card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: var(--torrec-radius) 0 0 var(--torrec-radius);
  background: linear-gradient(180deg, var(--torrec-teal), color-mix(in srgb, var(--torrec-teal) 55%, var(--torrec-terracotta) 45%));
}

.torrec-reports__card .torrec-navcard__icon {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--torrec-teal);
  background: rgba(var(--torrec-teal-rgb), .12);
}

.torrec-reports__card .torrec-navcard__title {
  font-size: .98rem;
}

.torrec-reports__card .torrec-navcard__desc {
  line-height: 1.35;
}

.torrec-reports__card .torrec-navcard__arrow {
  font-size: 1.2rem;
  opacity: .9;
}

.torrec-reports__card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--torrec-teal) 42%, var(--torrec-border));
  box-shadow: 0 12px 24px rgba(30, 42, 43, .11);
}


@media (max-width: 980px) {
  .torrec-reports__grid {
    grid-template-columns: 1fr;
  }
}

/* Reports index fallback (older running markup). Scoped by page structure so
   other torrec-navcard lists keep their current layout. */
main:has(> h1 + .torrec-dash__nav) {
  position: relative;
  isolation: isolate;
}

main:has(> h1 + .torrec-dash__nav)::before {
  content: "";
  position: absolute;
  inset: -1rem -.7rem auto;
  height: 220px;
  background:
    radial-gradient(ellipse 55% 55% at 16% 8%, rgba(var(--torrec-teal-rgb), .15), transparent 70%),
    radial-gradient(ellipse 42% 42% at 88% 16%, color-mix(in srgb, var(--torrec-cielo, #A39C95) 14%, transparent), transparent 74%);
  pointer-events: none;
  z-index: -1;
}

main:has(> h1 + .torrec-dash__nav) > h1 {
  margin-bottom: 1rem;
  padding: 1.2rem 1.25rem;
  border-radius: calc(var(--torrec-radius) + 2px);
  border: 1px solid color-mix(in srgb, var(--torrec-border) 75%, var(--torrec-teal) 25%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-surface) 84%, var(--torrec-surface-2) 16%), var(--torrec-surface));
  box-shadow: 0 8px 16px rgba(30, 42, 43, .07);
  letter-spacing: -.01em;
}

main:has(> h1 + .torrec-dash__nav) > .torrec-dash__nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .9rem;
}

main:has(> h1 + .torrec-dash__nav) > .torrec-dash__nav .torrec-navcard {
  position: relative;
  margin-bottom: 0;
  min-height: 112px;
  border: 1px solid color-mix(in srgb, var(--torrec-border) 80%, var(--torrec-teal) 20%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-surface) 90%, var(--torrec-surface-2) 10%), var(--torrec-surface));
  box-shadow: 0 8px 18px rgba(30, 42, 43, .08);
}

main:has(> h1 + .torrec-dash__nav) > .torrec-dash__nav .torrec-navcard::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: var(--torrec-radius) 0 0 var(--torrec-radius);
  background: linear-gradient(180deg, var(--torrec-teal), color-mix(in srgb, var(--torrec-teal) 55%, var(--torrec-terracotta) 45%));
}

main:has(> h1 + .torrec-dash__nav) > .torrec-dash__nav .torrec-navcard .torrec-navcard__icon {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--torrec-teal);
  background: rgba(var(--torrec-teal-rgb), .12);
}

main:has(> h1 + .torrec-dash__nav) > .torrec-dash__nav .torrec-navcard .torrec-navcard__title {
  font-size: .98rem;
}

main:has(> h1 + .torrec-dash__nav) > .torrec-dash__nav .torrec-navcard .torrec-navcard__desc {
  line-height: 1.35;
}

main:has(> h1 + .torrec-dash__nav) > .torrec-dash__nav .torrec-navcard .torrec-navcard__arrow {
  font-size: 1.2rem;
  opacity: .9;
}

main:has(> h1 + .torrec-dash__nav) > .torrec-dash__nav .torrec-navcard:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--torrec-teal) 42%, var(--torrec-border));
  box-shadow: 0 12px 24px rgba(30, 42, 43, .11);
}

@media (max-width: 980px) {
  main:has(> h1 + .torrec-dash__nav) > .torrec-dash__nav {
    grid-template-columns: 1fr;
  }
}

/* Same fallback, but for the live DOM where H1 sits inside a bootstrap flex header div. */
main:has(> .d-flex.justify-content-between.align-items-center.mb-3 + .torrec-dash__nav) {
  position: relative;
  isolation: isolate;
}

main:has(> .d-flex.justify-content-between.align-items-center.mb-3 + .torrec-dash__nav)::before {
  content: "";
  position: absolute;
  inset: -1rem -.7rem auto;
  height: 220px;
  background:
    radial-gradient(ellipse 55% 55% at 16% 8%, rgba(var(--torrec-teal-rgb), .15), transparent 70%),
    radial-gradient(ellipse 42% 42% at 88% 16%, color-mix(in srgb, var(--torrec-cielo, #A39C95) 14%, transparent), transparent 74%);
  pointer-events: none;
  z-index: -1;
}

main:has(> .d-flex.justify-content-between.align-items-center.mb-3 + .torrec-dash__nav) > .d-flex.justify-content-between.align-items-center.mb-3 {
  margin-bottom: 1rem !important;
  padding: 1.2rem 1.25rem;
  border-radius: calc(var(--torrec-radius) + 2px);
  border: 1px solid color-mix(in srgb, var(--torrec-border) 75%, var(--torrec-teal) 25%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-surface) 84%, var(--torrec-surface-2) 16%), var(--torrec-surface));
  box-shadow: 0 8px 16px rgba(30, 42, 43, .07);
}

main:has(> .d-flex.justify-content-between.align-items-center.mb-3 + .torrec-dash__nav) > .d-flex.justify-content-between.align-items-center.mb-3 > h1 {
  margin: 0;
  letter-spacing: -.01em;
}

main:has(> .d-flex.justify-content-between.align-items-center.mb-3 + .torrec-dash__nav) > .torrec-dash__nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .9rem;
}

main:has(> .d-flex.justify-content-between.align-items-center.mb-3 + .torrec-dash__nav) > .torrec-dash__nav .torrec-navcard {
  position: relative;
  margin-bottom: 0;
  min-height: 112px;
  border: 1px solid color-mix(in srgb, var(--torrec-border) 80%, var(--torrec-teal) 20%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-surface) 90%, var(--torrec-surface-2) 10%), var(--torrec-surface));
  box-shadow: 0 8px 18px rgba(30, 42, 43, .08);
}

main:has(> .d-flex.justify-content-between.align-items-center.mb-3 + .torrec-dash__nav) > .torrec-dash__nav .torrec-navcard::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: var(--torrec-radius) 0 0 var(--torrec-radius);
  background: linear-gradient(180deg, var(--torrec-teal), color-mix(in srgb, var(--torrec-teal) 55%, var(--torrec-terracotta) 45%));
}

main:has(> .d-flex.justify-content-between.align-items-center.mb-3 + .torrec-dash__nav) > .torrec-dash__nav .torrec-navcard .torrec-navcard__icon {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--torrec-teal);
  background: rgba(var(--torrec-teal-rgb), .12);
}

main:has(> .d-flex.justify-content-between.align-items-center.mb-3 + .torrec-dash__nav) > .torrec-dash__nav .torrec-navcard .torrec-navcard__title {
  font-size: .98rem;
}

main:has(> .d-flex.justify-content-between.align-items-center.mb-3 + .torrec-dash__nav) > .torrec-dash__nav .torrec-navcard .torrec-navcard__desc {
  line-height: 1.35;
}

main:has(> .d-flex.justify-content-between.align-items-center.mb-3 + .torrec-dash__nav) > .torrec-dash__nav .torrec-navcard .torrec-navcard__arrow {
  font-size: 1.2rem;
  opacity: .9;
}

main:has(> .d-flex.justify-content-between.align-items-center.mb-3 + .torrec-dash__nav) > .torrec-dash__nav .torrec-navcard:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--torrec-teal) 42%, var(--torrec-border));
  box-shadow: 0 12px 24px rgba(30, 42, 43, .11);
}

@media (max-width: 980px) {
  main:has(> .d-flex.justify-content-between.align-items-center.mb-3 + .torrec-dash__nav) > .torrec-dash__nav {
    grid-template-columns: 1fr;
  }
}

/* Events page fallback (live DOM) — header banner now handled by .torrec-page-header */
main:has(> #Schedule) #eventFormPanel {
  border: 1px solid color-mix(in srgb, var(--torrec-border) 75%, var(--torrec-teal) 25%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-surface) 90%, var(--torrec-surface-2) 10%), var(--torrec-surface));
  box-shadow: 0 10px 18px rgba(30, 42, 43, .08);
}

main:has(> #Schedule) #Schedule {
  border: 1px solid color-mix(in srgb, var(--torrec-border) 75%, var(--torrec-teal) 25%);
  border-radius: calc(var(--torrec-radius) + 2px);
  overflow: hidden;
  background: var(--torrec-surface);
  box-shadow: 0 12px 24px rgba(30, 42, 43, .1);
}

/* Box around today's date in Edge (2026-11-06): when a Schedule cell takes focus in keyboard mode
   (:focus-visible), Chromium draws a 2px focus outline around it; Firefox does not. Cells keep EJ2's own
   selected-cell highlight for keyboard users, so the browser outline on a cell adds nothing. */
main:has(> #Schedule) #Schedule td:focus,
main:has(> #Schedule) #Schedule th:focus,
main:has(> #Schedule) #Schedule .e-date-header-wrap :focus {
  outline: none;
}
/* Header/grid columns out of line (the jog under "Vie 6" in Edge, 2026-11-06): EJ2 pads the date header by
   the browser's DEFAULT scrollbar width (14px here), but torrec-pages.css gives everything in <main> a thin
   scrollbar (10px in Chromium). The 4-5px difference spreads across the columns, so by Friday the header
   divider sits ~4px left of the grid's. The grid gets the default scrollbar back so the two always match. */
main:has(> #Schedule) #Schedule .e-content-wrap {
  scrollbar-width: auto;
}
/* EJ2 colours today's header with its fixed light-mode primary (#4A4541), which almost disappears in dark
   mode. The brand token flips with the theme. */
main:has(> #Schedule) #Schedule .e-header-cells.e-current-day {
  color: var(--torrec-teal);
}
main:has(> #Schedule) #Schedule .e-schedule-toolbar {
  border-bottom: 1px solid var(--torrec-border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-surface-2) 65%, var(--torrec-surface) 35%), var(--torrec-surface));
}

main:has(> #Schedule) #Schedule .e-toolbar .e-tbar-btn {
  border-radius: 999px;
}

main:has(> #Schedule) #Schedule .e-toolbar-item.e-views .e-tbar-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--torrec-text-muted);
  font-weight: 600;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}

main:has(> #Schedule) #Schedule .e-toolbar-item.e-views .e-tbar-btn:hover {
  border-color: color-mix(in srgb, var(--torrec-teal) 30%, var(--torrec-border));
  background: rgba(var(--torrec-teal-rgb), .08);
  color: var(--torrec-teal);
}

main:has(> #Schedule) #Schedule .e-toolbar-item.e-views.e-active-view .e-tbar-btn {
  color: #fff;
}

main:has(> #Schedule) #Schedule .e-toolbar-item.e-day.e-active-view .e-tbar-btn {
  background: linear-gradient(135deg, #4c8fd6, #2a6fb0);
  border-color: #2a6fb0;
}

main:has(> #Schedule) #Schedule .e-toolbar-item.e-week.e-active-view .e-tbar-btn {
  background: linear-gradient(135deg, var(--torrec-teal), var(--torrec-teal-hover));
  border-color: var(--torrec-teal-hover);
}

/* Light theme only: keep Week label high-contrast on the teal active pill. */
:root[data-theme="light"] main:has(> #Schedule) #Schedule .e-toolbar-item.e-week.e-active-view .e-tbar-btn {
  color: #ffffff !important;
}

:root[data-theme="light"] main:has(> #Schedule) #Schedule .e-toolbar-item.e-week.e-active-view .e-tbar-btn .e-tbar-btn-text {
  color: #ffffff !important;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) main:has(> #Schedule) #Schedule .e-toolbar-item.e-week.e-active-view .e-tbar-btn {
    color: #ffffff !important;
  }

  :root:not([data-theme="dark"]) main:has(> #Schedule) #Schedule .e-toolbar-item.e-week.e-active-view .e-tbar-btn .e-tbar-btn-text {
    color: #ffffff !important;
  }
}

main:has(> #Schedule) #Schedule .e-toolbar-item.e-month.e-active-view .e-tbar-btn {
  background: linear-gradient(135deg, color-mix(in srgb, var(--torrec-terracotta) 88%, #d8785a), var(--torrec-terracotta));
  border-color: var(--torrec-terracotta);
}

main:has(> #Schedule) #Schedule .e-toolbar .e-tbar-btn.e-active,
main:has(> #Schedule) #Schedule .e-toolbar .e-tbar-btn:hover {
  background: rgba(var(--torrec-teal-rgb), .11);
  color: var(--torrec-teal);
}

main:has(> #Schedule) #Schedule .e-date-header-wrap table col,
main:has(> #Schedule) #Schedule .e-content-wrap table col {
  border-right: 1px solid color-mix(in srgb, var(--torrec-border) 80%, transparent);
}

/* Complex + platform dashboard: the head band, ambient glow and stats padding
   are now the shared .torrec-glow / .torrec-hero / .torrec-panel primitives
   applied in both Dashboard/Index.cshtml files. Only the stats row's own
   surround is left here, since it wraps view components rather than a panel. */
.torrec-dash__stats {
  padding: .85rem;
  border-radius: calc(var(--torrec-radius) + 4px);
  border: 1px solid color-mix(in srgb, var(--torrec-border) 82%, transparent);
  background: color-mix(in srgb, var(--torrec-surface) 90%, var(--torrec-surface-2) 10%);
  box-shadow: 0 8px 16px rgba(30, 42, 43, .06);
}

@media (max-width: 900px) {
  .torrec-dash__stats { padding: .7rem; }
}

/* Unit detail/edit page premium shell (header banner now handled by .torrec-page-header) */
main > .torrec-unit-edit-page .torrec-unit-edit-page__flash {
  margin-bottom: .85rem;
}

main > .torrec-unit-edit-page .torrec-unit-edit-page__validation ul {
  margin: 0 0 .85rem;
}

main > .torrec-unit-edit-page .torrec-unit-edit-page__base-form {
  max-width: 620px;
  margin-bottom: .9rem;
  border-color: color-mix(in srgb, var(--torrec-border) 76%, var(--torrec-teal) 24%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-surface) 90%, var(--torrec-surface-2) 10%), var(--torrec-surface));
}

main > .torrec-unit-edit-page .torrec-unit-edit-page__base-form label,
main > .torrec-unit-edit-page .torrec-unit-edit-page__panel label {
  margin-bottom: .35rem;
  font-size: .73rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--torrec-text-muted);
  font-weight: 700;
}

main > .torrec-unit-edit-page .torrec-unit-edit-page__base-form .e-btn,
main > .torrec-unit-edit-page .torrec-unit-edit-page__deactivate .e-btn,
main > .torrec-unit-edit-page .torrec-unit-edit-page__inline-form .e-btn {
  border-radius: 999px;
}

main > .torrec-unit-edit-page .torrec-unit-edit-page__base-form .e-btn.e-primary,
main > .torrec-unit-edit-page .torrec-unit-edit-page__inline-form .e-btn.e-primary {
  box-shadow: 0 8px 16px rgba(var(--torrec-teal-rgb), .18);
}

main > .torrec-unit-edit-page .torrec-unit-edit-page__deactivate {
  margin-bottom: 1rem !important;
}

main > .torrec-unit-edit-page .torrec-unit-edit-page__panel {
  max-width: 760px;
  border-color: color-mix(in srgb, var(--torrec-border) 76%, var(--torrec-teal) 24%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-surface) 92%, var(--torrec-surface-2) 8%), var(--torrec-surface));
}

main > .torrec-unit-edit-page .torrec-unit-edit-page__panel .torrec-table {
  margin-bottom: 0;
}

main > .torrec-unit-edit-page .torrec-unit-edit-page__panel .torrec-table thead th {
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-surface-2) 58%, var(--torrec-surface) 42%), var(--torrec-surface));
}

main > .torrec-unit-edit-page .torrec-unit-edit-page__panel .torrec-table tbody tr:hover {
  background: color-mix(in srgb, var(--torrec-teal) 6%, var(--torrec-surface));
}

main > .torrec-unit-edit-page .torrec-unit-edit-page__part-select {
  min-width: 280px;
}

/* Element picker: search box grows; each result is a whole-row checkbox label. */
main > .torrec-unit-edit-page .torrec-unit-parts-picker__search {
  flex: 1 1 220px;
}

main > .torrec-unit-edit-page .torrec-unit-parts-picker__search .e-input {
  width: 100%;
}

main > .torrec-unit-edit-page .torrec-unit-parts-picker__item label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .3rem .6rem;
  margin: 0;
  cursor: pointer;
  /* The page's form labels are eyebrow-styled (uppercase, letter-spaced); a result row is content, not a caption. */
  text-transform: none;
  letter-spacing: normal;
  font-size: .9rem;
}

main > .torrec-unit-edit-page .torrec-unit-parts-picker__item .form-check-input {
  margin: 0;
}

main > .torrec-unit-edit-page .torrec-unit-primary-form {
  margin: 0;
}

@media (max-width: 700px) {
  main > .torrec-unit-edit-page .torrec-unit-edit-page__base-form,
  main > .torrec-unit-edit-page .torrec-unit-edit-page__panel {
    max-width: 100%;
    padding: .9rem;
  }

  main > .torrec-unit-edit-page .torrec-unit-edit-page__part-select,
  main > .torrec-unit-edit-page .torrec-unit-parts-picker__search {
    min-width: 0;
    width: 100%;
  }
}

/* /units/parts — "Asignado a" column + holders dialog */
.torrec-parts-holders__link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--torrec-teal);
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.torrec-parts-holders__link:hover,
.torrec-parts-holders__link:focus-visible {
  text-decoration: underline;
}

.torrec-parts-holders__list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 60vh;
  overflow-y: auto;
}

.torrec-parts-holders__list li {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  padding: .45rem 0;
  border-bottom: 1px solid var(--torrec-border);
}

.torrec-parts-holders__list li:last-child {
  border-bottom: 0;
}

.torrec-parts-holders__list a {
  color: var(--torrec-teal);
}

/* Incidents board premium shell — header banner now handled by .torrec-page-header */
main:has(> #incidentsKanban) > .torrec-alert.mb-3 {
  border: 1px solid color-mix(in srgb, var(--torrec-warning) 40%, var(--torrec-border));
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-warning) 14%, transparent), color-mix(in srgb, var(--torrec-surface) 92%, transparent));
}

main:has(> #incidentsKanban) #incidentResolvePanel {
  border: 1px solid color-mix(in srgb, var(--torrec-border) 74%, var(--torrec-teal) 26%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-surface) 90%, var(--torrec-surface-2) 10%), var(--torrec-surface));
  box-shadow: 0 10px 22px rgba(30, 42, 43, .1);
}

main:has(> #incidentsKanban) #incidentResolvePanel .e-btn {
  border-radius: 999px;
}

/* The board's outer surface is .torrec-gridwrap, applied on the element itself in
   Incidents/Index.cshtml. Only the Kanban's internals are styled below. */

main:has(> #incidentsKanban) #incidentsKanban .e-kanban-header {
  border-bottom: 1px solid var(--torrec-border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-surface-2) 60%, var(--torrec-surface) 40%), var(--torrec-surface));
}

main:has(> #incidentsKanban) #incidentsKanban .e-header-cells {
  position: relative;
  padding-block: .2rem;
}

main:has(> #incidentsKanban) #incidentsKanban .e-header-cells[data-key="Open"] {
  background: color-mix(in srgb, var(--torrec-info) 11%, transparent);
}

main:has(> #incidentsKanban) #incidentsKanban .e-header-cells[data-key="InProgress"] {
  background: color-mix(in srgb, var(--torrec-warning) 14%, transparent);
}

main:has(> #incidentsKanban) #incidentsKanban .e-header-cells[data-key="Resolved"] {
  background: color-mix(in srgb, var(--torrec-success) 14%, transparent);
}

main:has(> #incidentsKanban) #incidentsKanban .e-header-cells[data-key="Closed"] {
  background: color-mix(in srgb, var(--torrec-text-muted) 12%, transparent);
}

main:has(> #incidentsKanban) #incidentsKanban .e-header-text {
  font-weight: 700;
  color: var(--torrec-text);
}

main:has(> #incidentsKanban) #incidentsKanban .e-content-row {
  background: color-mix(in srgb, var(--torrec-surface) 88%, var(--torrec-surface-2) 12%);
}

main:has(> #incidentsKanban) #incidentsKanban .e-content-cells {
  padding: .55rem .45rem;
  border-right: 1px solid color-mix(in srgb, var(--torrec-border) 82%, transparent);
}

main:has(> #incidentsKanban) #incidentsKanban .e-content-cells[data-key="Open"] {
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-info) 6%, transparent), transparent 40%);
}

main:has(> #incidentsKanban) #incidentsKanban .e-content-cells[data-key="InProgress"] {
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-warning) 7%, transparent), transparent 40%);
}

main:has(> #incidentsKanban) #incidentsKanban .e-content-cells[data-key="Resolved"] {
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-success) 7%, transparent), transparent 40%);
}

main:has(> #incidentsKanban) #incidentsKanban .e-content-cells[data-key="Closed"] {
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-text-muted) 5%, transparent), transparent 40%);
}

main:has(> #incidentsKanban) #incidentsKanban .e-card-wrapper {
  gap: .55rem;
}

main:has(> #incidentsKanban) #incidentsKanban .e-card {
  border-radius: 11px;
  border: 1px solid color-mix(in srgb, var(--torrec-border) 82%, var(--torrec-teal) 18%);
  box-shadow: 0 6px 14px rgba(30, 42, 43, .08);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}

main:has(> #incidentsKanban) #incidentsKanban .e-card:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--torrec-teal) 34%, var(--torrec-border));
  box-shadow: 0 10px 18px rgba(30, 42, 43, .11);
}

main:has(> #incidentsKanban) #incidentsKanban .e-card.e-dropping {
  outline: 2px dashed color-mix(in srgb, var(--torrec-teal) 50%, transparent);
  outline-offset: 1px;
}

main:has(> #incidentsKanban) .torrec-inc-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .65rem;
}

main:has(> #incidentsKanban) .torrec-inc-summary__item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .65rem;
  padding: .55rem .75rem;
  border-radius: 10px;
  border: 1px solid var(--torrec-border);
  background: color-mix(in srgb, var(--torrec-surface) 90%, var(--torrec-surface-2) 10%);
  box-shadow: 0 4px 10px rgba(30, 42, 43, .06);
}

main:has(> #incidentsKanban) .torrec-inc-summary__item--open {
  border-color: color-mix(in srgb, var(--torrec-info) 35%, var(--torrec-border));
}

main:has(> #incidentsKanban) .torrec-inc-summary__item--inprogress {
  border-color: color-mix(in srgb, var(--torrec-warning) 45%, var(--torrec-border));
}

main:has(> #incidentsKanban) .torrec-inc-summary__item--resolved {
  border-color: color-mix(in srgb, var(--torrec-success) 40%, var(--torrec-border));
}

main:has(> #incidentsKanban) .torrec-inc-summary__item--closed {
  border-color: color-mix(in srgb, var(--torrec-text-muted) 35%, var(--torrec-border));
}

main:has(> #incidentsKanban) .torrec-inc-summary__label {
  font-size: .78rem;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--torrec-text-muted);
  font-weight: 700;
}

main:has(> #incidentsKanban) .torrec-inc-summary__count {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--torrec-text);
  line-height: 1;
}

@media (max-width: 980px) {
  main:has(> #incidentsKanban)::before {
    inset: -.8rem -.5rem auto;
    height: 180px;
  }

  main:has(> #incidentsKanban) .torrec-inc-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  main:has(> #incidentsKanban) #incidentsKanban .e-content-cells {
    padding: .4rem .3rem;
  }

  main:has(> #incidentsKanban) #incidentsKanban .e-card-wrapper {
    gap: .4rem;
  }

  main:has(> #incidentsKanban) #incidentsKanban .e-card {
    border-radius: 9px;
    box-shadow: 0 4px 9px rgba(30, 42, 43, .07);
  }
}

@media (max-width: 620px) {
  main:has(> #incidentsKanban) .torrec-inc-summary {
    grid-template-columns: 1fr;
  }
}

/* ---------------------------------------------------------------------------
   Incidents — status donut above the Kanban (Incidents/Index.cshtml).
   Text and legend on the left, the EJ2 donut on the right; stacks on phones.
   Slice gradients: the view emits one <linearGradient id="torrecIncDonut{Status}">
   per status; the rules below swap each slice's flat fill (the exact hex the
   facade sent as pointColorMapping) for it. CSS `fill` wins over the SVG fill
   attribute. Keep these hexes in step with IncidentsFacade.StatusSliceColors.
   --------------------------------------------------------------------------- */
.torrec-inc-donut__defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.torrec-inc-donut {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  align-items: center;
  gap: 1.25rem;
  padding: 1.1rem 1.35rem;
  border: 1px solid color-mix(in srgb, var(--torrec-border) 78%, var(--torrec-teal) 22%);
  background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--torrec-teal) 9%, transparent) 0%, transparent 55%),
    var(--torrec-surface);
  box-shadow: 0 10px 24px rgba(30, 42, 43, .07);
}

.torrec-inc-donut__title {
  margin: .15rem 0 .85rem;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--torrec-text);
}

.torrec-inc-donut__legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .45rem;
  max-width: 340px;
}

.torrec-inc-donut__row {
  display: grid;
  grid-template-columns: .75rem 3.4rem minmax(0, 1fr) auto;
  align-items: center;
  gap: .6rem;
  padding: .3rem .55rem;
  border-radius: 9px;
  transition: background-color .15s ease;
}

.torrec-inc-donut__row:hover {
  background: color-mix(in srgb, var(--slice-color) 9%, transparent);
}

.torrec-inc-donut__swatch {
  width: .75rem;
  height: .75rem;
  border-radius: 50%;
  background: linear-gradient(135deg, color-mix(in srgb, var(--slice-color) 62%, #fff) 0%, var(--slice-color) 55%, color-mix(in srgb, var(--slice-color) 78%, #000) 100%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--slice-color) 18%, transparent);
}

.torrec-inc-donut__pct {
  font-size: 1.15rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--torrec-text);
  text-align: right;
}

.torrec-inc-donut__caption {
  color: var(--torrec-text-muted);
  font-weight: 600;
}

.torrec-inc-donut__count {
  font-size: .8rem;
  font-variant-numeric: tabular-nums;
  color: var(--torrec-text-muted);
}

.torrec-inc-donut__row--zero {
  opacity: .55;
}

.torrec-inc-donut__empty {
  margin: 0;
  color: var(--torrec-text-muted);
}

.torrec-inc-donut__chart {
  position: relative;
  min-height: 230px;
}

.torrec-inc-donut__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.torrec-inc-donut__total {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--torrec-text);
}

.torrec-inc-donut__total-label {
  margin-top: .2rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--torrec-text-muted);
}

/* No incidents in the window: a quiet empty ring instead of a chart. */
.torrec-inc-donut__center--empty::before {
  content: "";
  position: absolute;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  border: 22px solid color-mix(in srgb, var(--torrec-text-muted) 14%, transparent);
}

#incidentStatusDonut path[fill="#2A6FB0" i] { fill: url(#torrecIncDonutOpen); }
#incidentStatusDonut path[fill="#E0A32E" i] { fill: url(#torrecIncDonutInProgress); }
#incidentStatusDonut path[fill="#2F8F6B" i] { fill: url(#torrecIncDonutResolved); }
#incidentStatusDonut path[fill="#7D8889" i] { fill: url(#torrecIncDonutClosed); }

@media (max-width: 720px) {
  .torrec-inc-donut {
    grid-template-columns: 1fr;
  }

  .torrec-inc-donut__legend {
    max-width: none;
  }
}

/* ---------------------------------------------------------------------------
   Incidents — lifecycle stepper on the detail page (Incidents/Detail.cshtml).
   EJ2 Stepper DOM: .e-step-container per step, carrying e-step-completed /
   e-step-inprogress / e-step-notstarted; .e-indicator is the circle; the track
   is .e-stepper-progressbar > .e-progressbar-value. Done steps are success
   green, the current one is the teal accent with a soft halo, pending ones are
   outlined. A Closed incident tints the whole line green: it is finished.
   --------------------------------------------------------------------------- */
.torrec-inc-progress {
  padding-bottom: .9rem;
}

.torrec-inc-progress .torrec-inc-stepper {
  margin: .6rem .25rem .15rem;
}

.torrec-inc-stepper.e-stepper .e-step-container .e-indicator {
  width: 40px;
  height: 40px;
  font-size: 1.05rem;
  border-width: 2px;
  transition: background-color .25s ease, border-color .25s ease, box-shadow .25s ease, color .25s ease;
}

.torrec-inc-stepper.e-stepper .e-step-container.e-step-completed .e-indicator {
  background: linear-gradient(135deg, color-mix(in srgb, var(--torrec-success) 70%, #fff) 0%, var(--torrec-success) 70%);
  border-color: var(--torrec-success);
  color: #fff;
}

.torrec-inc-stepper.e-stepper .e-step-container.e-step-inprogress .e-indicator {
  background: linear-gradient(135deg, color-mix(in srgb, var(--torrec-teal) 70%, #fff) 0%, var(--torrec-teal) 70%);
  border-color: var(--torrec-teal);
  color: #fff;
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--torrec-teal) 18%, transparent);
  animation: torrec-inc-step-pulse 2.4s ease-in-out infinite;
}

.torrec-inc-stepper.e-stepper .e-step-container.e-step-notstarted .e-indicator {
  background: var(--torrec-surface);
  border-color: color-mix(in srgb, var(--torrec-text-muted) 40%, var(--torrec-border));
  color: var(--torrec-text-muted);
}

.torrec-inc-stepper.e-stepper .e-step-container .e-step-label-container .e-label {
  font-weight: 600;
  color: var(--torrec-text-muted);
}

.torrec-inc-stepper.e-stepper .e-step-container.e-step-completed .e-label {
  color: var(--torrec-text);
}

.torrec-inc-stepper.e-stepper .e-step-container.e-step-inprogress .e-label {
  font-weight: 800;
  color: var(--torrec-teal);
}

.torrec-inc-stepper.e-stepper .e-stepper-progressbar {
  background-color: color-mix(in srgb, var(--torrec-text-muted) 22%, transparent);
}

.torrec-inc-stepper.e-stepper .e-stepper-progressbar .e-progressbar-value {
  background: linear-gradient(90deg, var(--torrec-success) 0%, color-mix(in srgb, var(--torrec-success) 55%, var(--torrec-teal)) 100%);
}

.torrec-inc-stepper--closed.e-stepper .e-stepper-progressbar .e-progressbar-value {
  background: var(--torrec-success);
}

/* Read-only: nothing here is clickable, so nothing should look it. */
.torrec-inc-stepper.e-stepper .e-step-container,
.torrec-inc-stepper.e-stepper .e-step-container * {
  cursor: default;
}

.torrec-inc-progress__hint {
  margin: .5rem 0 0;
  text-align: center;
  font-size: .9rem;
  color: var(--torrec-text-muted);
}

@keyframes torrec-inc-step-pulse {
  0%, 100% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--torrec-teal) 18%, transparent); }
  50%      { box-shadow: 0 0 0 10px color-mix(in srgb, var(--torrec-teal) 6%, transparent); }
}

@media (prefers-reduced-motion: reduce) {
  .torrec-inc-stepper.e-stepper .e-step-container.e-step-inprogress .e-indicator {
    animation: none;
  }
}

@media (max-width: 620px) {
  .torrec-inc-stepper.e-stepper .e-step-container .e-indicator {
    width: 32px;
    height: 32px;
    font-size: .9rem;
  }

  .torrec-inc-stepper.e-stepper .e-step-container .e-label {
    font-size: .78rem;
  }
}

/* Documents page premium shell — header banner now handled by .torrec-page-header */
/* The sweep hint is the shared .torrec-hint now. */

main > .torrec-documents-page > #docsUploadPanel {
  margin: 0 auto 1rem;
  max-width: 760px;
  border: 1px solid color-mix(in srgb, var(--torrec-border) 76%, var(--torrec-teal) 24%);
  border-radius: calc(var(--torrec-radius) + 2px);
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-surface) 90%, var(--torrec-surface-2) 10%), var(--torrec-surface));
  box-shadow: 0 12px 24px rgba(30, 42, 43, .1);
}

main > .torrec-documents-page > #docsUploadPanel .e-input-group,
main > .torrec-documents-page > #docsUploadPanel input[type="file"],
main > .torrec-documents-page > #docsUploadPanel textarea,
main > .torrec-documents-page > #docsUploadPanel input[type="text"] {
  max-width: 560px;
}

main > .torrec-documents-page > #docsUploadPanel .e-btn {
  border-radius: 999px;
}

main > .torrec-documents-page > #documentsGrid .e-gridheader {
  border-bottom: 1px solid var(--torrec-border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-surface-2) 60%, var(--torrec-surface) 40%), var(--torrec-surface));
}

main > .torrec-documents-page > #documentsGrid .e-gridheader .e-headercell {
  color: var(--torrec-text);
  font-weight: 700;
}

main > .torrec-documents-page > #documentsGrid .e-row:hover {
  background: color-mix(in srgb, var(--torrec-teal) 7%, transparent);
}

main > .torrec-documents-page > #documentsGrid .e-gridpager {
  border-top: 1px solid var(--torrec-border);
  background: color-mix(in srgb, var(--torrec-surface) 92%, var(--torrec-surface-2) 8%);
}

@media (max-width: 980px) {
  main > .torrec-documents-page > #docsUploadPanel {
    max-width: 100%;
  }
}

/* Units page premium shell — header banner now handled by .torrec-page-header */
main:has(> #unitsGrid) > #unitsGrid .e-gridheader {
  border-bottom: 1px solid var(--torrec-border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-surface-2) 60%, var(--torrec-surface) 40%), var(--torrec-surface));
}

main:has(> #unitsGrid) > #unitsGrid .e-groupdroparea {
  border-bottom: 1px solid color-mix(in srgb, var(--torrec-border) 80%, transparent);
  background: color-mix(in srgb, var(--torrec-surface) 90%, var(--torrec-surface-2) 10%);
}

main:has(> #unitsGrid) > #unitsGrid .e-groupcaptionrow {
  background: color-mix(in srgb, var(--torrec-teal) 8%, transparent);
}

main:has(> #unitsGrid) > #unitsGrid .e-groupcaption {
  font-weight: 700;
  color: var(--torrec-text);
}

main:has(> #unitsGrid) > #unitsGrid .e-row:hover {
  background: color-mix(in srgb, var(--torrec-teal) 7%, transparent);
}

main:has(> #unitsGrid) > #unitsGrid .e-gridpager {
  border-top: 1px solid var(--torrec-border);
  background: color-mix(in srgb, var(--torrec-surface) 92%, var(--torrec-surface-2) 8%);
}


/* Towers premium shell — header banner now handled by .torrec-page-header */
main > .torrec-towers-page__grid-wrap .e-grid {
  border: 0;
  border-radius: 0;
}

main > .torrec-towers-page__grid-wrap .e-gridheader {
  border-bottom: 1px solid var(--torrec-border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-surface-2) 60%, var(--torrec-surface) 40%), var(--torrec-surface));
}

main > .torrec-towers-page__grid-wrap .e-row:hover {
  background: color-mix(in srgb, var(--torrec-teal) 7%, transparent);
}

main > .torrec-towers-page__grid-wrap .e-gridpager {
  border-top: 1px solid var(--torrec-border);
  background: color-mix(in srgb, var(--torrec-surface) 92%, var(--torrec-surface-2) 8%);
}

/* Unit generation premium shell */
/* No max-width (#193): spans the masthead's width, like every other form page. */
main > .torrec-unit-generate-page .torrec-unit-generate-page__form {
  padding: 1.25rem;
  border: 1px solid color-mix(in srgb, var(--torrec-border) 76%, var(--torrec-teal) 24%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-surface) 90%, var(--torrec-surface-2) 10%), var(--torrec-surface));
  box-shadow: 0 12px 24px rgba(30, 42, 43, .08);
}

main > .torrec-unit-generate-page .torrec-unit-generate-page__filters {
  align-items: end;
}

main > .torrec-unit-generate-page label {
  margin-bottom: .35rem;
  display: block;
  font-size: .72rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--torrec-text-muted);
  font-weight: 700;
}

main > .torrec-unit-generate-page .e-btn {
  border-radius: 999px;
}

main > .torrec-unit-generate-page .torrec-unit-generate-page__preview {
  margin-top: .75rem;
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--torrec-border) 76%, var(--torrec-teal) 24%);
  border-radius: calc(var(--torrec-radius) + 2px);
  background: color-mix(in srgb, var(--torrec-surface) 96%, var(--torrec-surface-2) 4%);
}

main > .torrec-unit-generate-page .torrec-table thead th {
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-surface-2) 58%, var(--torrec-surface) 42%), var(--torrec-surface));
}

main > .torrec-unit-generate-page .torrec-row--danger td {
  background: rgba(220, 38, 38, .04);
}

/* Unit parts pages premium shell (parts grid + part types table) — header banner now handled by .torrec-page-header */
main:has(> #partsGrid) > #partsGrid .e-gridheader {
  border-bottom: 1px solid var(--torrec-border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-surface-2) 60%, var(--torrec-surface) 40%), var(--torrec-surface));
}

main:has(> #partsGrid) > #partsGrid .e-groupdroparea {
  border-bottom: 1px solid color-mix(in srgb, var(--torrec-border) 80%, transparent);
  background: color-mix(in srgb, var(--torrec-surface) 90%, var(--torrec-surface-2) 10%);
}

main:has(> #partsGrid) > #partsGrid .e-groupcaptionrow {
  background: color-mix(in srgb, var(--torrec-teal) 8%, transparent);
}

main:has(> #partsGrid) > #partsGrid .e-groupcaption {
  font-weight: 700;
  color: var(--torrec-text);
}

main:has(> #partsGrid) > #partsGrid .e-row:hover {
  background: color-mix(in srgb, var(--torrec-teal) 7%, transparent);
}

main:has(> #partsGrid) > #partsGrid .e-gridpager {
  border-top: 1px solid var(--torrec-border);
  background: color-mix(in srgb, var(--torrec-surface) 92%, var(--torrec-surface-2) 8%);
}

main > .torrec-parttypes-page {
  position: relative;
  isolation: isolate;
}

/* The parttypes table now sits in the shared .torrec-tablewrap.torrec-scroll-x
   ("Table system"), which replaces the card-on-the-<table> recipe and its
   980px display:block fallback that used to live here. */

/* Residents page premium shell — header banner now handled by .torrec-page-header */
main > .torrec-residents-page > form.mb-3.d-flex.gap-2 {
  margin-bottom: .8rem !important;
  max-width: 520px !important;
  padding: .5rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--torrec-border) 80%, transparent);
  background: color-mix(in srgb, var(--torrec-surface) 90%, var(--torrec-surface-2) 10%);
  box-shadow: 0 6px 14px rgba(30, 42, 43, .06);
}

main > .torrec-residents-page > form.mb-3.d-flex.gap-2 .e-input-group {
  border-radius: 999px;
  overflow: hidden;
}

main > .torrec-residents-page > form.mb-3.d-flex.gap-2 .e-btn {
  border-radius: 999px;
  padding-inline: .9rem;
}

main > .torrec-residents-page > #residentsGrid .e-gridheader {
  border-bottom: 1px solid var(--torrec-border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-surface-2) 60%, var(--torrec-surface) 40%), var(--torrec-surface));
}

main > .torrec-residents-page > #residentsGrid .e-row:hover {
  background: color-mix(in srgb, var(--torrec-teal) 7%, transparent);
}

main > .torrec-residents-page > #residentsGrid .e-gridpager {
  border-top: 1px solid var(--torrec-border);
  background: color-mix(in srgb, var(--torrec-surface) 92%, var(--torrec-surface-2) 8%);
}

@media (max-width: 980px) {
  main > .torrec-residents-page > form.mb-3.d-flex.gap-2 {
    max-width: 100% !important;
    border-radius: 12px;
    flex-wrap: wrap;
  }
}

/* Staff page premium shell — header banner now handled by .torrec-page-header */
main:has(> #staffGrid) > form.mb-3.d-flex.gap-2 {
  margin-bottom: .8rem !important;
  max-width: 520px !important;
  padding: .5rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--torrec-border) 80%, transparent);
  background: color-mix(in srgb, var(--torrec-surface) 90%, var(--torrec-surface-2) 10%);
  box-shadow: 0 6px 14px rgba(30, 42, 43, .06);
}

main:has(> #staffGrid) > form.mb-3.d-flex.gap-2 .e-input-group {
  border-radius: 999px;
  overflow: hidden;
}

main:has(> #staffGrid) > form.mb-3.d-flex.gap-2 .e-btn {
  border-radius: 999px;
  padding-inline: .9rem;
}

main:has(> #staffGrid) > #staffGrid .e-gridheader {
  border-bottom: 1px solid var(--torrec-border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-surface-2) 60%, var(--torrec-surface) 40%), var(--torrec-surface));
}

main:has(> #staffGrid) > #staffGrid .e-groupdroparea {
  border-bottom: 1px solid color-mix(in srgb, var(--torrec-border) 80%, transparent);
  background: color-mix(in srgb, var(--torrec-surface) 90%, var(--torrec-surface-2) 10%);
}

main:has(> #staffGrid) > #staffGrid .e-groupcaptionrow {
  background: color-mix(in srgb, var(--torrec-teal) 8%, transparent);
}

main:has(> #staffGrid) > #staffGrid .e-groupcaption {
  font-weight: 700;
  color: var(--torrec-text);
}

main:has(> #staffGrid) > #staffGrid .e-row:hover {
  background: color-mix(in srgb, var(--torrec-teal) 7%, transparent);
}

main:has(> #staffGrid) > #staffGrid .e-gridpager {
  border-top: 1px solid var(--torrec-border);
  background: color-mix(in srgb, var(--torrec-surface) 92%, var(--torrec-surface-2) 8%);
}

@media (max-width: 980px) {
  main:has(> #staffGrid) > form.mb-3.d-flex.gap-2 {
    max-width: 100% !important;
    border-radius: 12px;
    flex-wrap: wrap;
  }
}

/* Visitors page premium shell — header banner now handled by .torrec-page-header */
main > .torrec-visitors-page > form.mb-3.d-flex.gap-2.align-items-end {
  margin: 0 auto .9rem !important;
  padding: .95rem 1rem;
  width: 100%;
  max-width: 360px;
  display: flex;
  justify-content: center;
  border-radius: calc(var(--torrec-radius) + 2px);
  border: 1px solid color-mix(in srgb, var(--torrec-border) 80%, transparent);
  background: color-mix(in srgb, var(--torrec-surface) 92%, var(--torrec-surface-2) 8%);
  box-shadow: 0 10px 20px rgba(30, 42, 43, .08);
}

main > .torrec-visitors-page > form.mb-3.d-flex.gap-2.align-items-end > div {
  width: min(220px, 100%);
}

main > .torrec-visitors-page > form.mb-3.d-flex.gap-2.align-items-end label {
  color: var(--torrec-text-muted);
  font-size: .84rem;
  font-weight: 600;
}

main > .torrec-visitors-page > form.mb-3.d-flex.gap-2.align-items-end .e-input {
  width: 100%;
  min-height: 42px;
  border-radius: 12px;
}

/* The visitors table now sits in the shared .torrec-tablewrap.torrec-scroll-x
   ("Table system"); its photo thumbnails use .torrec-thumb. */

/* Residents profile: the three read-only sections were capped with inline
   style="max-width:Npx" per section. Capped here instead so the cap releases on a
   phone — an inline width cannot be overridden without !important. */
main > .torrec-residents-page .torrec-residents-profile__section,
main .torrec-residents-profile__section {
  max-width: 720px;
}

@media (max-width: 700px) {
  main .torrec-residents-profile__section {
    max-width: 100%;
  }
}

/* Residents form premium shell — header banner now handled by .torrec-page-header */
/* No max-width (#193): the form spans the same width as the masthead above it, like the staff and vendor forms. */
main > .torrec-residents-page .torrec-residents-page__form {
  padding: 1.25rem;
  border: 1px solid color-mix(in srgb, var(--torrec-border) 76%, var(--torrec-teal) 24%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-surface) 90%, var(--torrec-surface-2) 10%), var(--torrec-surface));
  box-shadow: 0 12px 24px rgba(30, 42, 43, .08);
}

main > .torrec-residents-page .torrec-residents-page__form label {
  margin-bottom: .35rem;
  display: block;
  font-size: .72rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--torrec-text-muted);
  font-weight: 700;
}

main > .torrec-residents-page .torrec-residents-page__form .form-text {
  margin-top: .45rem;
  color: var(--torrec-text-muted);
  font-size: .82rem;
}

main > .torrec-residents-page .torrec-residents-page__form .e-btn {
  border-radius: 999px;
}

main > .torrec-residents-page .torrec-residents-page__checkbox {
  padding: .55rem .65rem;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--torrec-border) 80%, transparent);
  background: color-mix(in srgb, var(--torrec-surface) 94%, var(--torrec-surface-2) 6%);
}

main > .torrec-residents-page .torrec-residents-page__actions {
  margin-bottom: 0 !important;
}

@media (max-width: 980px) {
  main > .torrec-residents-page .torrec-residents-page__form {
    padding: 1rem;
  }
}

/* Pets form premium shell — same treatment as .torrec-residents-page__form above. */
/* No max-width (#193), same as the residents form. */
main > .torrec-pets-page .torrec-pets-page__form {
  padding: 1.25rem;
  border: 1px solid color-mix(in srgb, var(--torrec-border) 76%, var(--torrec-teal) 24%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-surface) 90%, var(--torrec-surface-2) 10%), var(--torrec-surface));
  box-shadow: 0 12px 24px rgba(30, 42, 43, .08);
}

main > .torrec-pets-page .torrec-pets-page__form label {
  margin-bottom: .35rem;
  display: block;
  font-size: .72rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--torrec-text-muted);
  font-weight: 700;
}

main > .torrec-pets-page .torrec-pets-page__form .e-btn {
  border-radius: 999px;
}

main > .torrec-pets-page .torrec-pets-page__actions {
  margin-bottom: 0 !important;
}

@media (max-width: 980px) {
  main > .torrec-pets-page .torrec-pets-page__form {
    padding: 1rem;
  }
}

@media (max-width: 980px) {
  main > .torrec-visitors-page > form.mb-3.d-flex.gap-2.align-items-end {
    width: 100%;
    max-width: 100%;
  }

}

/* Packages page premium shell — header banner now handled by .torrec-page-header */
main > .torrec-packages-page > form.mb-3.d-flex.gap-2.align-items-end.flex-wrap {
  margin-bottom: 1rem !important;
  padding: 1rem 1.05rem;
  gap: 1rem !important;
  border-radius: calc(var(--torrec-radius) + 2px);
  border: 1px solid color-mix(in srgb, var(--torrec-border) 80%, transparent);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--torrec-surface) 94%, var(--torrec-surface-2) 6%), var(--torrec-surface)),
    radial-gradient(circle at top right, color-mix(in srgb, var(--torrec-teal) 8%, transparent), transparent 35%);
  box-shadow: 0 10px 20px rgba(30, 42, 43, .08);
  align-items: flex-end;
}

main > .torrec-packages-page > form.mb-3.d-flex.gap-2.align-items-end.flex-wrap > div {
  min-width: 180px;
  flex: 0 0 auto;
}

main > .torrec-packages-page > form.mb-3.d-flex.gap-2.align-items-end.flex-wrap > div:last-child {
  min-width: auto;
}

main > .torrec-packages-page > form.mb-3.d-flex.gap-2.align-items-end.flex-wrap label {
  color: var(--torrec-text-muted);
  font-size: .84rem;
  font-weight: 600;
}

main > .torrec-packages-page > form.mb-3.d-flex.gap-2.align-items-end.flex-wrap .e-input,
main > .torrec-packages-page > form.mb-3.d-flex.gap-2.align-items-end.flex-wrap .form-check-input {
  border-radius: 12px;
}

main > .torrec-packages-page > form.mb-3.d-flex.gap-2.align-items-end.flex-wrap .e-input {
  min-height: 42px;
  padding-inline: .8rem;
}

main > .torrec-packages-page > form.mb-3.d-flex.gap-2.align-items-end.flex-wrap .form-check {
  display: flex;
  align-items: center;
  min-height: 40px;
  margin-bottom: 0 !important;
  padding: .45rem .7rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--torrec-border) 82%, transparent);
  background: color-mix(in srgb, var(--torrec-surface) 94%, var(--torrec-surface-2) 6%);
}

main > .torrec-packages-page > form.mb-3.d-flex.gap-2.align-items-end.flex-wrap .form-check-label {
  margin-left: .45rem;
  color: var(--torrec-text);
  font-weight: 600;
}

main > .torrec-packages-page > form.mb-3.d-flex.gap-2.align-items-end.flex-wrap .form-check-input {
  margin-top: 0;
}

main > .torrec-packages-page > form.mb-3.d-flex.gap-2.align-items-end.flex-wrap .e-btn.e-primary {
  border-radius: 999px;
  padding-inline: 1.05rem;
  min-height: 42px;
  box-shadow: 0 8px 16px rgba(var(--torrec-teal-rgb), .22);
  font-weight: 700;
}

/* The table's surface, column styling (nowrap/date/strong) and status pills now
   come from the shared "Table system" (.torrec-tablewrap + .torrec-col-* +
   .torrec-status). The card recipe that used to sit on the <table> here is what
   made it run past the column, and its nth-child rules restyled by position. */

@media (max-width: 980px) {
  main > .torrec-packages-page > form.mb-3.d-flex.gap-2.align-items-end.flex-wrap {
    padding: .9rem;
    width: 100%;
  }

  main > .torrec-packages-page > form.mb-3.d-flex.gap-2.align-items-end.flex-wrap > div {
    min-width: 100%;
  }

  main > .torrec-packages-page > form.mb-3.d-flex.gap-2.align-items-end.flex-wrap .form-check {
    width: 100%;
  }

}

/* Pills */
.torrec-pill {
  display: inline-flex;
  align-items: center;
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  background: var(--torrec-surface-2);
  color: var(--torrec-text-muted);
}
.torrec-pill--success { color: var(--torrec-success); }
.torrec-pill--warning { color: var(--torrec-warning); }
.torrec-pill--danger { color: var(--torrec-error); }
.torrec-pill--info { color: var(--torrec-info); }
.torrec-pill--ai {
  margin-left: .5rem;
  color: var(--torrec-teal);
  background: var(--torrec-surface-2);
}

/* Payments statement page premium shell */
main > .torrec-payments-statement-page {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

main > .torrec-payments-statement-page::before {
  content: "";
  position: absolute;
  inset: -1rem -.8rem auto;
  height: 250px;
  background:
    radial-gradient(ellipse 56% 56% at 12% 8%, rgba(var(--torrec-teal-rgb), .16), transparent 72%),
    radial-gradient(ellipse 45% 45% at 90% 14%, color-mix(in srgb, var(--torrec-cielo, #A39C95) 13%, transparent), transparent 76%);
  pointer-events: none;
  z-index: -1;
}

main > .torrec-payments-statement-page .torrec-payments-statement-page__head {
  margin-bottom: 0;
  gap: .9rem;
  border: 1px solid color-mix(in srgb, var(--torrec-border) 72%, var(--torrec-teal) 28%);
  border-radius: calc(var(--torrec-radius) + 6px);
  box-shadow: 0 14px 30px rgba(30, 42, 43, .1);
  background:
    radial-gradient(circle at top left, rgba(var(--torrec-teal-rgb), .12), transparent 42%),
    linear-gradient(180deg, color-mix(in srgb, var(--torrec-surface) 88%, var(--torrec-surface-2) 12%), var(--torrec-surface));
}

main > .torrec-payments-statement-page .torrec-payments-statement-page__switcher {
  padding: .6rem .7rem;
  border: 1px solid color-mix(in srgb, var(--torrec-border) 78%, transparent);
  border-radius: calc(var(--torrec-radius) - 2px);
  background: color-mix(in srgb, var(--torrec-surface) 92%, var(--torrec-surface-2) 8%);
}

main > .torrec-payments-statement-page .torrec-payments-statement-page__switcher .form-label {
  font-size: .72rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--torrec-text-muted);
  font-weight: 700;
}

main > .torrec-payments-statement-page .torrec-payments-statement-page__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

main > .torrec-payments-statement-page .torrec-payments-statement-page__stat {
  border-radius: calc(var(--torrec-radius) + 2px);
  border-color: color-mix(in srgb, var(--torrec-border) 76%, var(--torrec-teal) 24%);
  box-shadow: 0 12px 24px rgba(30, 42, 43, .09);
}

main > .torrec-payments-statement-page .torrec-payments-statement-page__stat--total {
  background:
    linear-gradient(135deg, rgba(var(--torrec-teal-rgb), .14), rgba(var(--torrec-teal-rgb), .04)),
    var(--torrec-surface);
}

main > .torrec-payments-statement-page .torrec-payments-statement-page__breakdown-note {
  margin-top: .4rem;
  line-height: 1.45;
}

main > .torrec-payments-statement-page .torrec-payments-statement-page__gateway-note {
  margin-bottom: 0;
}

main > .torrec-payments-statement-page .torrec-payments-statement-page__section {
  margin: 0;
  padding: 1rem 1.05rem;
  border-radius: calc(var(--torrec-radius) + 4px);
  border-color: color-mix(in srgb, var(--torrec-border) 75%, var(--torrec-teal) 25%);
  box-shadow: 0 14px 28px rgba(30, 42, 43, .1);
}

main > .torrec-payments-statement-page .torrec-payments-statement-page__section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: .85rem;
}

main > .torrec-payments-statement-page .torrec-payments-statement-page__section-head h2 {
  margin: 0;
  letter-spacing: -.01em;
}

main > .torrec-payments-statement-page .torrec-payments-statement-page__pay-hint,
main > .torrec-payments-statement-page .torrec-payments-statement-page__empty {
  margin: 0;
  padding: .85rem .95rem;
  border: 1px solid color-mix(in srgb, var(--torrec-border) 84%, transparent);
  border-radius: calc(var(--torrec-radius) - 2px);
  background: color-mix(in srgb, var(--torrec-surface) 94%, var(--torrec-surface-2) 6%);
}

/* ============================================================
   Card grid — replaces the old per-section <table>. Centered inside the
   section wrapper: fixed-width columns plus justify-content:center keeps a
   handful of cards centered rather than left-hugging a 6-wide track.
   ============================================================ */
main > .torrec-payments-statement-page .torrec-payments-statement-page__grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(140px, 190px));
  justify-content: center;
  gap: .85rem;
}

main > .torrec-payments-statement-page .torrec-payments-statement-page__card {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  padding: .9rem 1rem;
  border: 1px solid color-mix(in srgb, var(--torrec-border) 78%, transparent);
  border-radius: calc(var(--torrec-radius) - 1px);
  background: color-mix(in srgb, var(--torrec-surface) 96%, var(--torrec-surface-2) 4%);
  box-shadow: 0 6px 14px rgba(30, 42, 43, .06);
  min-height: 118px;
}

main > .torrec-payments-statement-page .torrec-payments-statement-page__card--paid {
  border-color: color-mix(in srgb, var(--torrec-success) 32%, var(--torrec-border));
}

main > .torrec-payments-statement-page .torrec-payments-statement-page__card--overdue {
  border-color: color-mix(in srgb, var(--torrec-warning) 40%, var(--torrec-border));
}

main > .torrec-payments-statement-page .torrec-payments-statement-page__card--blocked,
main > .torrec-payments-statement-page .torrec-payments-statement-page__card--waived {
  opacity: .72;
}

main > .torrec-payments-statement-page .torrec-payments-statement-page__card--dispute-open {
  border-color: color-mix(in srgb, var(--torrec-warning) 45%, var(--torrec-border));
}

main > .torrec-payments-statement-page .torrec-payments-statement-page__card--more {
  align-items: center;
  justify-content: center;
  color: var(--torrec-text-muted);
  font-weight: 600;
  font-size: .85rem;
  background: color-mix(in srgb, var(--torrec-surface-2) 60%, var(--torrec-surface) 40%);
}

main > .torrec-payments-statement-page .torrec-payments-statement-page__card-main {
  font-weight: 700;
  line-height: 1.25;
}

main > .torrec-payments-statement-page .torrec-payments-statement-page__card-sub {
  font-size: .8rem;
  color: var(--torrec-text-muted);
}

main > .torrec-payments-statement-page .torrec-payments-statement-page__card-amount {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  font-weight: 700;
  font-size: 1.05rem;
  margin-top: auto;
}

main > .torrec-payments-statement-page .torrec-payments-statement-page__card-late {
  font-size: .78rem;
  color: var(--torrec-warning);
}

main > .torrec-payments-statement-page .torrec-payments-statement-page__card-foot {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
}

main > .torrec-payments-statement-page .torrec-payments-statement-page__type-pill {
  font-size: .72rem;
  letter-spacing: .03em;
  align-self: flex-start;
}

main > .torrec-payments-statement-page .torrec-payments-statement-page__type-pill--fine {
  border: 1px solid color-mix(in srgb, var(--torrec-warning) 36%, transparent);
  color: var(--torrec-warning);
}

main > .torrec-payments-statement-page .torrec-payments-statement-page__type-pill--charge {
  border: 1px solid color-mix(in srgb, var(--torrec-teal) 28%, transparent);
  color: var(--torrec-teal);
}

/* ============================================================
   The shared Pay/Paid/Dispute dialog
   ============================================================ */
.torrec-payments-statement-page__dialog-title {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: .75rem;
}

.torrec-payments-statement-page__rail-picker {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-bottom: .9rem;
}

.torrec-payments-statement-page__rail-option {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  padding: .5rem .65rem;
  border: 1px solid color-mix(in srgb, var(--torrec-border) 80%, transparent);
  border-radius: calc(var(--torrec-radius) - 2px);
}

.torrec-payments-statement-page__rail-option--disabled {
  opacity: .6;
}

.torrec-payments-statement-page__paid-detail {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .3rem .75rem;
  margin: 0;
}

.torrec-payments-statement-page__paid-detail dt {
  color: var(--torrec-text-muted);
  font-size: .8rem;
}

.torrec-payments-statement-page__paid-detail dd {
  margin: 0;
  font-weight: 600;
}

/* "Datos fiscales" accordion on the resident statement. */
.torrec-fiscal-card__summary {
  display: flex;
  align-items: center;
  gap: .75rem;
  cursor: pointer;
  list-style: none;
}

.torrec-fiscal-card__summary::-webkit-details-marker { display: none; }

.torrec-fiscal-card__summary > span:first-child {
  display: flex;
  flex-direction: column;
  margin-right: auto;
}

.torrec-fiscal-card__title { margin: 0; }

.torrec-fiscal-card__chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: rgba(var(--torrec-teal-rgb), .1);
  color: var(--torrec-teal);
  transition: transform .2s, background-color .15s;
}

.torrec-fiscal-card__summary:hover .torrec-fiscal-card__chevron { background: rgba(var(--torrec-teal-rgb), .2); }

.torrec-fiscal-card__summary:focus-visible {
  outline: 2px solid var(--torrec-teal);
  outline-offset: 4px;
  border-radius: var(--torrec-radius);
}

.torrec-fiscal-card__accordion[open] .torrec-fiscal-card__chevron { transform: rotate(180deg); }

.torrec-fiscal-card__body { margin-top: .75rem; }

.torrec-fiscal-card__edit {
  display: flex;
  justify-content: flex-end;
  margin-bottom: .5rem;
}

@media (prefers-reduced-motion: reduce) {
  .torrec-fiscal-card__chevron { transition: none; }
}

/* Document actions (receipt PDF / XML / proof): pill buttons with a round icon badge. */
.torrec-doc-actions {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-top: 1rem;
}

.torrec-doc-btn {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .4rem 1rem .4rem .4rem;
  border: 1px solid var(--torrec-border);
  border-radius: 999px;
  background: var(--torrec-surface);
  color: var(--torrec-text);
  font-size: var(--torrec-text-sm);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, box-shadow .15s, transform .15s;
}

.torrec-doc-btn[hidden] { display: none; }

.torrec-doc-btn:hover {
  border-color: var(--torrec-teal);
  background: rgba(var(--torrec-teal-rgb), .06);
  color: var(--torrec-teal-hover);
  box-shadow: var(--torrec-shadow);
  text-decoration: none;
}

.torrec-doc-btn:active { transform: scale(.985); }

.torrec-doc-btn:focus-visible {
  outline: 2px solid var(--torrec-teal);
  outline-offset: 2px;
}

.torrec-doc-btn__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: rgba(var(--torrec-teal-rgb), .12);
  color: var(--torrec-teal);
  transition: background-color .15s, color .15s;
}

.torrec-doc-btn:hover .torrec-doc-btn__icon {
  background: var(--torrec-teal);
  color: #fff;
}

.torrec-doc-btn--primary {
  border-color: var(--torrec-teal);
  background: var(--torrec-teal);
  color: #fff;
}

.torrec-doc-btn--primary .torrec-doc-btn__icon {
  background: rgba(255, 255, 255, .2);
  color: #fff;
}

.torrec-doc-btn--primary:hover {
  background: var(--torrec-teal-hover);
  border-color: var(--torrec-teal-hover);
  color: #fff;
}

.torrec-doc-btn--primary:hover .torrec-doc-btn__icon {
  background: rgba(255, 255, 255, .3);
}

.torrec-payments-statement-page__pay-action {
  display: flex;
  align-items: end;
}

.torrec-payments-statement-page__pay-action .e-btn {
  width: 100%;
  min-height: 40px;
  border-radius: 999px;
  box-shadow: 0 10px 18px rgba(var(--torrec-teal-rgb), .2);
}

@media (max-width: 1180px) {
  main > .torrec-payments-statement-page .torrec-payments-statement-page__grid {
    grid-template-columns: repeat(4, minmax(140px, 190px));
  }
}

@media (max-width: 980px) {
  main > .torrec-payments-statement-page::before {
    inset: -.8rem -.5rem auto;
    height: 190px;
  }

  main > .torrec-payments-statement-page .torrec-payments-statement-page__stats {
    grid-template-columns: 1fr;
  }

  main > .torrec-payments-statement-page .torrec-payments-statement-page__grid {
    grid-template-columns: repeat(3, minmax(140px, 190px));
  }

  main > .torrec-payments-statement-page .torrec-payments-statement-page__switcher {
    width: 100%;
    align-items: flex-start !important;
    flex-direction: column;
  }
}

@media (max-width: 700px) {
  main > .torrec-payments-statement-page .torrec-payments-statement-page__section {
    padding: .9rem;
  }

  main > .torrec-payments-statement-page .torrec-payments-statement-page__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  main > .torrec-payments-statement-page .torrec-payments-statement-page__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Payments premium shell */
main:has(> .torrec-payments-chrome) {
  position: relative;
  isolation: isolate;
}

main:has(> .torrec-payments-chrome)::before {
  content: "";
  position: absolute;
  inset: -1rem -.8rem auto;
  height: 240px;
  background:
    radial-gradient(ellipse 56% 56% at 14% 8%, rgba(var(--torrec-teal-rgb), .14), transparent 70%),
    radial-gradient(ellipse 45% 45% at 88% 14%, color-mix(in srgb, var(--torrec-cielo, #A39C95) 14%, transparent), transparent 75%);
  pointer-events: none;
  z-index: -1;
}

/* Cobranza navigation, row 1: three groups by what the administrator is doing. Row 2 (the pill
   tabbar below) only ever holds the active group's tabs. Fee schedules moved to a header button. */
main > .torrec-payments-chrome .torrec-payments-chrome__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1rem;
  margin: .3rem 0 0;
  font-size: .82rem;
  color: var(--torrec-text-muted);
}
main > .torrec-payments-chrome .torrec-payments-chrome__meta strong { color: var(--torrec-teal); font-weight: 700; }
main > .torrec-payments-chrome .torrec-payments-chrome__meta a { color: var(--torrec-text-muted); text-decoration: underline; text-underline-offset: 2px; }
main > .torrec-payments-chrome .torrec-payments-chrome__meta a:hover { color: var(--torrec-text); }

main > .torrec-payments-chrome .torrec-payments-chrome__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
}
main > .torrec-payments-chrome .torrec-payments-chrome__setup {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-weight: 700;
  color: var(--torrec-text-muted);
}
main > .torrec-payments-chrome .torrec-payments-chrome__setup.active { color: var(--torrec-teal); }

main > .torrec-payments-chrome .torrec-payments-groups {
  display: flex;
  gap: .25rem;
  padding: .3rem;
  margin-bottom: .75rem;
  border: 1px solid var(--torrec-border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--torrec-surface) 80%, var(--torrec-surface-2) 20%);
  width: fit-content;
  max-width: 100%;
}
main > .torrec-payments-chrome .torrec-payments-groups__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 38px;
  padding: .45rem 1.15rem;
  border-radius: 999px;
  color: var(--torrec-text-muted);
  font-weight: 700;
  font-size: .9rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .14s ease, color .14s ease, box-shadow .14s ease;
}
main > .torrec-payments-chrome .torrec-payments-groups__link:hover,
main > .torrec-payments-chrome .torrec-payments-groups__link:focus-visible {
  color: var(--torrec-text);
  background: var(--torrec-surface);
  text-decoration: none;
}
main > .torrec-payments-chrome .torrec-payments-groups__link.active {
  color: #fff;
  background: var(--torrec-teal);
  box-shadow: 0 6px 14px rgba(var(--torrec-teal-rgb), .25);
}

/* Count badges: on the "Por revisar" group and on each of its tabs. */
.torrec-payments-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 .4rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
}
.torrec-payments-badge--warning { background: var(--torrec-warning); }
.torrec-payments-badge--danger { background: var(--torrec-error); }
main > .torrec-payments-chrome .torrec-tabbar__link .torrec-payments-badge { margin-left: .4rem; }
main > .torrec-payments-chrome .torrec-payments-groups__link.active .torrec-payments-badge {
  box-shadow: 0 0 0 2px var(--torrec-teal);
}

@media (max-width: 700px) {
  /* Phones: the three groups become an even segmented control across the full width. */
  main > .torrec-payments-chrome .torrec-payments-groups { width: 100%; }
  main > .torrec-payments-chrome .torrec-payments-groups__link {
    flex: 1 1 0;
    min-width: 0;
    padding-inline: .5rem;
    font-size: .82rem;
  }
  main > .torrec-payments-chrome .torrec-payments-groups__link .bi { display: none; }
}

main > .torrec-payments-chrome .torrec-payments-chrome__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-bottom: 1.2rem !important;
}

main > .torrec-payments-chrome .torrec-tabbar__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: .42rem .95rem;
  border-radius: 999px;
  border: 1px solid var(--torrec-border);
  background: color-mix(in srgb, var(--torrec-surface) 88%, var(--torrec-surface-2) 12%);
  color: var(--torrec-text-muted);
  text-decoration: none;
  font-weight: 700;
  font-size: .82rem;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease, color .14s ease, background-color .14s ease;
}

main > .torrec-payments-chrome .torrec-tabbar__link:hover,
main > .torrec-payments-chrome .torrec-tabbar__link:focus {
  color: var(--torrec-text);
  border-color: color-mix(in srgb, var(--torrec-teal) 34%, var(--torrec-border));
  box-shadow: 0 6px 14px rgba(30, 42, 43, .09);
  transform: translateY(-1px);
  text-decoration: none;
}

main > .torrec-payments-chrome .torrec-tabbar__link.active {
  color: var(--torrec-teal);
  border-color: color-mix(in srgb, var(--torrec-teal) 45%, var(--torrec-border));
  background: color-mix(in srgb, var(--torrec-teal) 13%, var(--torrec-surface));
  box-shadow: 0 8px 16px rgba(var(--torrec-teal-rgb), .15);
}

main > .torrec-payments-chrome + .torrec-payments-mensuales-page {
  position: relative;
  z-index: 1;
}

/* The matrix itself. Filters, the surrounding surface, the height cap and the sticky
   header are now .torrec-filterbar / .torrec-tablewrap / .torrec-scroll-y, applied in
   the view; only the cell-level treatment is specific to this table. */

/* Row text stays smaller than the header so up to 12 month columns fit without crowding; the header
   keeps its normal size since it only ever holds one short label per column. */
main > .torrec-payments-chrome + .torrec-payments-mensuales-page .torrec-payments-mensuales-page__table-card table.torrec-table tbody td {
  padding: 1.05rem .9rem;
  vertical-align: top;
  font-size: .82rem;
}

main > .torrec-payments-chrome + .torrec-payments-mensuales-page .torrec-payments-mensuales-page__cell-amount {
  font-weight: 600;
  margin-bottom: .25rem;
}

main > .torrec-payments-chrome + .torrec-payments-mensuales-page .torrec-payments-mensuales-page__status-btn {
  border: none;
  cursor: pointer;
}

main > .torrec-payments-chrome + .torrec-payments-mensuales-page .torrec-payments-mensuales-page__status-btn:hover {
  background: color-mix(in srgb, var(--torrec-success) 18%, var(--torrec-surface-2));
}

/* Phones: a month cell that also carries a late-fee line and a waive button needs its
   own minimum so the column does not collapse to one character per line inside the
   horizontal scroller. */
@media (max-width: 700px) {
  main > .torrec-payments-chrome + .torrec-payments-mensuales-page .torrec-payments-mensuales-page__table-card table.torrec-table tbody td {
    padding: .7rem .6rem;
    min-width: 88px;
  }

  main > .torrec-payments-chrome + .torrec-payments-mensuales-page .torrec-payments-mensuales-page__table-card table.torrec-table thead th {
    min-width: 88px;
  }
}

/* The paid-charge detail dialog — same shape as AccountStatement's own paid panel. Shared (unscoped)
   because the EJ2 Dialog widget renders its content outside `main`, and both the Monthly matrix and
   the Unit Charges list use this exact same dialog shape for their "paid" rows. */
.torrec-payments-page__dialog-title {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: .75rem;
}

.torrec-payments-page__paid-detail {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .3rem .75rem;
  margin: 0;
}

.torrec-payments-page__paid-detail dt {
  color: var(--torrec-text-muted);
  font-size: .8rem;
}

.torrec-payments-page__paid-detail dd {
  margin: 0;
  font-weight: 600;
}

@media (max-width: 700px) {
  /* The group's sub-tabs (row 2), stacked full-width, would push navigation above the
     content on every Cobranza page. One horizontally scrollable row instead: the
     active tab is already filled teal, so where you are stays obvious, and a
     swipeable tab strip is the expected phone idiom for routed tabs. */
  main > .torrec-payments-chrome .torrec-payments-chrome__tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: .45rem;
    padding-bottom: .3rem;
  }

  main > .torrec-payments-chrome .torrec-payments-chrome__tabs::-webkit-scrollbar {
    display: none;
  }

  main > .torrec-payments-chrome .torrec-tabbar__link {
    flex: 0 0 auto;
  }

}

/* Attempt review: the reject form pairs a free-text reason with its button, so the
   input must be allowed to grow rather than collapsing to its intrinsic width beside
   the accept form. On a phone .torrec-actions stacks the two forms full-width, and the
   reason field follows. */
main > .torrec-payments-attempt-page .torrec-payments-attempt-page__reject {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  flex: 1 1 260px;
}

main > .torrec-payments-attempt-page .torrec-payments-attempt-page__reject .e-input {
  flex: 1 1 160px;
  min-width: 140px;
}

/* Receipt dialog: an iframe rather than an <img>, because a comprobante upload accepts PDF as well as
   image (AccountStatement's own upload input: image/png,image/jpeg,image/webp,application/pdf) — an
   iframe renders both via the browser's native PDF viewer, an <img> would silently show nothing for a
   PDF receipt. */
.torrec-payments-attempt-page__receipt-frame {
  width: 100%;
  height: 75vh;
  border: 0;
  border-radius: var(--torrec-radius-sm, .5rem);
  background: #fff;
}

/* Image viewer (GitHub #137) — site.js torrecImageViewer. Full window, dark, above EJ2 dialogs (1050+)
   and toasts (1060), because it is opened FROM the receipt dialog. The photo is transformed with CSS
   (translate/rotate/scale) from its centre; the stage clips it. */
.torrec-imgview {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: flex;
  flex-direction: column;
  background: rgba(10, 12, 14, .94);
  color: #fff;
}
.torrec-imgview[hidden] { display: none; }
html.torrec-imgview-open { overflow: hidden; }
.torrec-imgview__bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: .25rem;
  padding: .5rem .75rem;
  background: rgba(0, 0, 0, .45);
}
.torrec-imgview__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font-size: 1.15rem;
  text-decoration: none;
  cursor: pointer;
}
.torrec-imgview__btn:hover,
.torrec-imgview__btn:focus-visible { background: rgba(255, 255, 255, .16); color: #fff; outline: none; }
.torrec-imgview__btn:last-child { margin-left: .5rem; }
.torrec-imgview__zoom {
  min-width: 3.5rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: .9rem;
  opacity: .85;
}
.torrec-imgview__stage {
  position: relative;
  flex: 1 1 auto;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: none;   /* pinch and drag are ours, not the page's */
  user-select: none;
}
.torrec-imgview__stage:active { cursor: grabbing; }
.torrec-imgview__img {
  max-width: none;
  max-height: none;
  flex: 0 0 auto;
  transform-origin: center center;
  will-change: transform;
  background: #fff;     /* a transparent PNG screenshot stays readable on the dark backdrop */
  box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
}
.torrec-imgview__hint {
  padding: .4rem .75rem .6rem;
  text-align: center;
  font-size: .8rem;
  opacity: .7;
}

/* Review page: the receipt thumbnail in the side panel, a click away from the zoom viewer (#137). */
.torrec-payments-receiptthumb {
  position: relative;
  display: block;
  width: 100%;
  margin: .75rem 0 .5rem;
  padding: 0;
  border: 1px solid var(--torrec-border, rgba(0, 0, 0, .12));
  border-radius: var(--torrec-radius-sm, .5rem);
  background: #fff;
  overflow: hidden;
  cursor: zoom-in;
}
.torrec-payments-receiptthumb[hidden] { display: none; }
.torrec-payments-receiptthumb img {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: contain;
}
.torrec-payments-receiptthumb__hint {
  position: absolute;
  right: .5rem;
  bottom: .5rem;
  padding: .2rem .55rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, .65);
  color: #fff;
  font-size: .75rem;
}

/* Blog / community attachments opt into the viewer with data-torrec-zoom: say so with the cursor. */
a[data-torrec-zoom] { cursor: zoom-in; }

/* Disputes: the inline resolve form (note + uphold + reject) in the last cell.
   Was a bare `d-flex gap-2 flex-wrap`, which at any width let the note input
   collapse to its intrinsic size between the two buttons. */
main > .torrec-payments-disputes-page .torrec-payments-disputes-page__resolve {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  min-width: 260px;
}

main > .torrec-payments-disputes-page .torrec-payments-disputes-page__resolve .e-input {
  flex: 1 1 140px;
  min-width: 120px;
}

/* Unit Charges — the same EJ2 grid pattern as Units/Staff (paging + tower grouping), for the same
   reason: a flat, one-row-per-charge list scales the same way a flat one-row-per-unit list does.
   The grid's surround, header gradient, row hover and pager are now .torrec-gridwrap. */
main > .torrec-payments-unit-charges-page .torrec-payments-unit-charges-page__status-btn {
  border: none;
  cursor: default;
}

main > .torrec-payments-unit-charges-page .torrec-payments-unit-charges-page__status-btn[data-clickable="true"] {
  cursor: pointer;
}

main > .torrec-payments-unit-charges-page .torrec-payments-unit-charges-page__status-btn[data-clickable="true"]:hover {
  background: color-mix(in srgb, var(--torrec-success) 18%, var(--torrec-surface-2));
}

/* Payments issuance page. The glow, the two panels, their field labels and the
   pill submit are now .torrec-glow / .torrec-panel / .torrec-formpanel, applied in
   the view. Only the equal-height pairing and the hint spacing are left. */
.torrec-payments-issuance-page {
  margin-top: .25rem;
}

.torrec-payments-issuance-page__panel {
  height: 100%;
}

.torrec-payments-issuance-page__hint {
  margin-bottom: 1rem;
}

/* Expenses page premium shell — header banner now handled by .torrec-page-header */
.torrec-expenses-page__flash {
  margin-bottom: .85rem;
}

main > .torrec-expenses-page .torrec-expenses-page__stats {
  margin-bottom: 1rem !important;
}

main > .torrec-expenses-page .torrec-expenses-page__form {
  padding: 1.1rem 1.15rem;
  border-color: color-mix(in srgb, var(--torrec-border) 76%, var(--torrec-teal) 24%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-surface) 90%, var(--torrec-surface-2) 10%), var(--torrec-surface));
}

main > .torrec-expenses-page .torrec-expenses-page__form .form-label {
  margin-bottom: .35rem;
  font-size: .73rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--torrec-text-muted);
  font-weight: 700;
}

main > .torrec-expenses-page .torrec-expenses-page__form .e-input {
  width: 100%;
}

main > .torrec-expenses-page .torrec-expenses-page__form .e-btn {
  min-height: 38px;
  border-radius: 999px;
  box-shadow: 0 8px 16px rgba(var(--torrec-teal-rgb), .18);
}

/* The table card is the shared .torrec-tablewrap now (see "Table system"). */

@media (max-width: 700px) {
  main > .torrec-expenses-page .torrec-expenses-page__form {
    padding: .9rem;
  }
}

/* Expense categories page premium shell */
/* header banner now handled by .torrec-page-header */
.torrec-expense-categories-page__flash {
  margin-bottom: .85rem;
}

main > .torrec-expense-categories-page .torrec-expense-categories-page__reserve-warning {
  border-color: color-mix(in srgb, var(--torrec-warning) 42%, var(--torrec-border));
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-warning) 14%, transparent), color-mix(in srgb, var(--torrec-surface) 92%, transparent));
}

main > .torrec-expense-categories-page .torrec-expense-categories-page__form {
  padding: 1.1rem 1.15rem;
  border-color: color-mix(in srgb, var(--torrec-border) 76%, var(--torrec-teal) 24%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-surface) 90%, var(--torrec-surface-2) 10%), var(--torrec-surface));
}

main > .torrec-expense-categories-page .torrec-expense-categories-page__form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: .8rem;
  align-items: end;
}

main > .torrec-expense-categories-page .torrec-expense-categories-page__name-field {
  min-width: 220px;
}

main > .torrec-expense-categories-page .torrec-expense-categories-page__form .form-label {
  margin-bottom: .35rem;
  font-size: .73rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--torrec-text-muted);
  font-weight: 700;
}

main > .torrec-expense-categories-page .torrec-expense-categories-page__form .e-input {
  width: 100%;
}

main > .torrec-expense-categories-page .torrec-expense-categories-page__form-action {
  display: flex;
  align-items: end;
}

main > .torrec-expense-categories-page .torrec-expense-categories-page__form-action .e-btn {
  width: 100%;
  min-height: 38px;
  border-radius: 999px;
  box-shadow: 0 8px 16px rgba(var(--torrec-teal-rgb), .18);
}

main > .torrec-expense-categories-page .torrec-expense-categories-page__root {
  padding: 1rem 1.1rem;
  border-color: color-mix(in srgb, var(--torrec-border) 78%, var(--torrec-teal) 22%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-surface) 92%, var(--torrec-surface-2) 8%), var(--torrec-surface));
}

main > .torrec-expense-categories-page .torrec-expense-categories-page__root-actions .e-btn {
  border-radius: 999px;
}

main > .torrec-expense-categories-page .torrec-expense-categories-page__children {
  padding-left: 1.1rem;
}

main > .torrec-expense-categories-page .torrec-expense-categories-page__children li {
  padding: .12rem 0;
}

/* Plain <details> disclosure for Rename — no dialog, no JS. summary::marker is suppressed since the
   e-btn class already reads as a clickable control on its own. */
main > .torrec-expense-categories-page .torrec-expense-categories-page__rename summary,
main > .torrec-payments-mensuales-page .torrec-payments-mensuales-page__record-cash summary {
  list-style: none;
  cursor: pointer;
}

main > .torrec-expense-categories-page .torrec-expense-categories-page__rename summary::-webkit-details-marker,
main > .torrec-payments-mensuales-page .torrec-payments-mensuales-page__record-cash summary::-webkit-details-marker {
  display: none;
}

main > .torrec-expense-categories-page .torrec-expense-categories-page__rename-form,
main > .torrec-payments-mensuales-page .torrec-payments-mensuales-page__record-cash-form {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  max-width: 260px;
}

@media (max-width: 700px) {
  main > .torrec-expense-categories-page .torrec-expense-categories-page__form {
    padding: .9rem;
  }

  main > .torrec-expense-categories-page .torrec-expense-categories-page__form-grid {
    grid-template-columns: 1fr;
  }

  main > .torrec-expense-categories-page .torrec-expense-categories-page__name-field {
    min-width: 0;
  }

  main > .torrec-expense-categories-page .torrec-expense-categories-page__root {
    padding: .9rem;
  }

  main > .torrec-expense-categories-page .torrec-expense-categories-page__root .d-flex.justify-content-between.align-items-center {
    align-items: flex-start !important;
    flex-direction: column;
    gap: .5rem;
  }
}

/* Payments fee schedule (/payments/cuotas) ---------------------------------
   The page that originated the premium treatment. Everything that used to live
   here as a page-scoped rule is now a shared primitive (see §3 block above):
   __panel/__hero-copy/__hero-metrics -> .torrec-panel / .torrec-hero__*,
   __eyebrow -> .torrec-eyebrow, .torrec-payments-metric -> .torrec-metric,
   __section-head/__form-head/__preview-head -> .torrec-section-head,
   __form/__form-grid/__note-field/__form-action -> .torrec-filterbar*,
   __table-card -> .torrec-panel--table, __table-scroll -> .torrec-scroll-y,
   __empty -> .torrec-panel--warning, page wrapper -> .torrec-stack.

   What remains is only what is genuinely specific to this page. */

/* The Cobranza chrome sits above the page in normal flow; the decorative glow
   behind it is painted by main:has(> .torrec-payments-chrome)::before, so the
   page body needs to stack above it. .torrec-stack already carries z-index:1;
   this keeps the rule discoverable from the page's own selector. */
main > .torrec-payments-chrome + .torrec-payments-cuotas-page {
  position: relative;
  z-index: 1;
}

/* The per-unit preview footer restates the grand total, so it should read as
   heavy as the metric tile that shows it in the hero. */
main > .torrec-payments-chrome + .torrec-payments-cuotas-page tfoot td {
  border-top: 1px solid color-mix(in srgb, var(--torrec-border) 70%, var(--torrec-teal) 30%);
  background: color-mix(in srgb, var(--torrec-surface-2) 45%, var(--torrec-surface));
}

/* Empty state (chart with no data) */
.torrec-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--torrec-text-muted);
}
/* Icon in a tinted circle, centred above the title (was a bare emoji). */
.torrec-empty__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto .85rem;
  border-radius: 50%;
  background: rgba(var(--torrec-teal-rgb), .12);
  color: var(--torrec-teal);
  font-size: 1.5rem;
  line-height: 1;
  opacity: .7;
}
.torrec-empty__title {
  margin: 0 0 .25rem;
  font-weight: 600;
  color: var(--torrec-text);
}
.torrec-empty__hint {
  margin: 0;
  font-size: .85rem;
}

@media (max-width: 900px) {
  .torrec-dash__stats { grid-template-columns: repeat(2, 1fr); }
  .torrec-dash__grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .torrec-dash__stats { grid-template-columns: 1fr; }
}

/* ---- Header-right group (theme toggle + user menu) ---------------------- */
.torrec-headerbar {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-left: auto;
}

/* ---- User menu dropdown -------------------------------------------------- */
.torrec-usermenu__toggle {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  height: 38px;
  padding-inline: .75rem;
  border: 1px solid var(--torrec-border);
  border-radius: 8px;
  background: var(--torrec-surface-2);
  color: var(--torrec-text);
  font-weight: 500;
  font-size: .9rem;
  max-width: 220px;
}
.torrec-usermenu__toggle:hover { border-color: var(--torrec-teal); color: var(--torrec-teal); }
.torrec-usermenu__email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.torrec-usermenu__menu {
  background: var(--torrec-surface);
  border: 1px solid var(--torrec-border);
  box-shadow: var(--torrec-shadow);
}
.torrec-usermenu__menu .dropdown-item {
  color: var(--torrec-text);
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: .5rem 1rem;
}
.torrec-usermenu__menu .dropdown-item:hover {
  background: var(--torrec-surface-2);
  color: var(--torrec-teal);
}

/* Complex switcher flyout. The main menu carries ONE row ("Complejo · <active> ›"); the full list is a
   submenu that opens beside it (to the LEFT — the user menu hugs the right edge of the header), so the
   dropdown stays the same height whether the person has two complexes or forty. The list scrolls past
   ~8 rows instead of growing. Under 576px there is no room beside the menu, so the flyout expands inline
   below the row instead. */
.torrec-usermenu__menu { min-width: 15rem; }
.torrec-usermenu__flyoutrow { position: relative; }
.torrec-usermenu__flyoutbtn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.torrec-usermenu__flyoutrow.is-open > .torrec-usermenu__flyoutbtn {
  background: var(--torrec-surface-2);
  color: var(--torrec-teal);
}
.torrec-usermenu__flyout-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.torrec-usermenu__flyout-label {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--torrec-text-muted);
}
.torrec-usermenu__flyout-current {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.torrec-usermenu__flyoutbtn .bi { flex: 0 0 auto; color: var(--torrec-text-muted); }
.torrec-usermenu__flyout {
  display: none;
  position: absolute;
  top: -.5rem;
  /* 2px overlap rather than a gap, so the pointer never crosses dead space on its way over. */
  right: calc(100% - 2px);
  min-width: 14rem;
  max-width: 20rem;
  padding: .25rem 0;
  background: var(--torrec-surface);
  border: 1px solid var(--torrec-border);
  border-radius: var(--torrec-radius);
  box-shadow: var(--torrec-shadow);
}
.torrec-usermenu__flyoutrow.is-open > .torrec-usermenu__flyout { display: block; }
.torrec-usermenu__flyoutfilter { padding: .35rem .6rem .25rem; }
.torrec-usermenu__flyoutlist {
  max-height: 18rem;
  overflow-y: auto;
  padding-block: .15rem;
}
.torrec-usermenu__flyoutlist form { margin: 0; }
.torrec-usermenu__flyoutlist .dropdown-item {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.torrec-usermenu__complex--active { color: var(--torrec-teal) !important; font-weight: 600; opacity: 1; }
.torrec-usermenu__flyoutempty {
  margin: 0;
  padding: .5rem 1rem .75rem;
  font-size: .85rem;
  color: var(--torrec-text-muted);
}
@media (max-width: 575.98px) {
  .torrec-usermenu__flyout {
    position: static;
    max-width: none;
    margin: .15rem .5rem .35rem;
    box-shadow: none;
  }
  .torrec-usermenu__flyoutbtn .bi { transition: transform .15s ease; }
  .torrec-usermenu__flyoutrow.is-open > .torrec-usermenu__flyoutbtn .bi { transform: rotate(90deg); }
}

/* Theme item inside the user menu: shows the option it switches TO. */
.torrec-usermenu__theme .torrec-theme-opt--to-light { display: none; }
.torrec-usermenu__theme .torrec-theme-opt--to-dark { display: inline; }
:root[data-theme="dark"] .torrec-usermenu__theme .torrec-theme-opt--to-dark { display: none; }
:root[data-theme="dark"] .torrec-usermenu__theme .torrec-theme-opt--to-light { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .torrec-usermenu__theme .torrec-theme-opt--to-dark { display: none; }
  :root:not([data-theme="light"]) .torrec-usermenu__theme .torrec-theme-opt--to-light { display: inline; }
}

/* ---- Account page -------------------------------------------------------- */
.torrec-account {
  position: relative;
  isolation: isolate;
}

.torrec-account::before {
  content: "";
  position: absolute;
  inset: -.9rem -.75rem auto;
  height: 210px;
  background:
    radial-gradient(ellipse 55% 55% at 12% 8%, rgba(var(--torrec-teal-rgb), .14), transparent 72%),
    radial-gradient(ellipse 44% 44% at 88% 12%, color-mix(in srgb, var(--torrec-cielo, #A39C95) 14%, transparent), transparent 74%);
  pointer-events: none;
  z-index: -1;
}

.torrec-account__head h1 {
  margin: .15rem 0 .35rem;
  letter-spacing: -.01em;
}
.torrec-account__head {
  padding: 1.2rem 1.25rem;
  border: 1px solid color-mix(in srgb, var(--torrec-border) 76%, var(--torrec-teal) 24%);
  border-radius: calc(var(--torrec-radius) + 2px);
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-surface) 86%, var(--torrec-surface-2) 14%), var(--torrec-surface));
  box-shadow: 0 8px 18px rgba(30, 42, 43, .08);
  margin-bottom: 1.5rem;
}
.torrec-back-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .5rem 1rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--torrec-teal) 30%, var(--torrec-border) 70%);
  background: color-mix(in srgb, var(--torrec-teal) 10%, var(--torrec-surface) 90%);
  color: var(--torrec-teal);
  font-weight: 600;
  font-size: .85rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s ease, box-shadow .15s ease, transform .15s ease;
}
.torrec-back-btn:hover {
  background: color-mix(in srgb, var(--torrec-teal) 18%, var(--torrec-surface) 82%);
  box-shadow: 0 4px 10px rgba(30, 42, 43, .12);
  color: var(--torrec-teal);
  transform: translateX(-2px);
}
.torrec-back-btn i {
  font-size: .9rem;
}
.torrec-account__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  align-items: start;
}
.torrec-account__pwform {
  max-width: 380px;
}

.torrec-account .torrec-card {
  border-radius: calc(var(--torrec-radius) + 2px);
  border: 1px solid color-mix(in srgb, var(--torrec-border) 84%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-surface) 92%, var(--torrec-surface-2) 8%), var(--torrec-surface));
  box-shadow: 0 12px 24px rgba(30, 42, 43, .1);
}

.torrec-account .torrec-card__head {
  margin-bottom: .95rem;
}

.torrec-account .torrec-card__title {
  letter-spacing: -.01em;
}
/* Profile avatar — image when set, teal initials disc as the fallback. */
.torrec-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 1rem;
  background: color-mix(in srgb, var(--torrec-teal) 14%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--torrec-border);
}
.torrec-avatar__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.torrec-avatar__initials {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--torrec-teal);
  line-height: 1;
}
/* Compact avatar for the header, beside the user menu. */
.torrec-avatar--sm {
  width: 34px;
  height: 34px;
  margin-bottom: 0;
  flex: 0 0 auto;
}
.torrec-avatar--sm .torrec-avatar__initials {
  font-size: .8rem;
}
.torrec-avatar-block {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.torrec-avatar-block .torrec-avatar {
  margin-bottom: 0;
  flex: 0 0 auto;
}
.torrec-avatar-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .35rem;
}

.torrec-avatar-actions .e-btn {
  border-radius: 999px;
}
.torrec-avatar-status {
  font-size: .8rem;
  color: var(--torrec-text-muted);
}
@media (max-width: 768px) {
  .torrec-account__grid { grid-template-columns: 1fr; }
}

/* Definition list for read-only profile fields */
.torrec-deflist {
  margin: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .4rem 1.25rem;
}
.torrec-deflist dt {
  color: var(--torrec-text-muted);
  font-size: .85rem;
  font-weight: 600;
}
.torrec-deflist dd {
  margin: 0;
  color: var(--torrec-text);
}

.torrec-field-label {
  color: var(--torrec-text-muted);
  font-size: .85rem;
  font-weight: 600;
  margin: 0 0 .5rem;
}

/* Segmented theme selector (account preferences) */
.torrec-themeopts {
  display: inline-flex;
  border: 1px solid var(--torrec-border);
  border-radius: 999px;
  overflow: hidden;
  background: color-mix(in srgb, var(--torrec-surface) 90%, var(--torrec-surface-2) 10%);
}
.torrec-themeopt {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .5rem .9rem;
  border: 0;
  background: var(--torrec-surface);
  color: var(--torrec-text-muted);
  cursor: pointer;
  font-weight: 600;
  font-size: .9rem;
}
.torrec-themeopt + .torrec-themeopt {
  border-left: 1px solid var(--torrec-border);
}
.torrec-themeopt:hover { color: var(--torrec-teal); }
.torrec-themeopt.active {
  background: color-mix(in srgb, var(--torrec-teal) 12%, transparent);
  color: var(--torrec-teal);
}

.torrec-account .e-input-group,
.torrec-account .form-select {
  border-radius: 12px;
}

.torrec-account .form-select {
  border-color: var(--torrec-border);
}

.torrec-account .e-btn.e-primary {
  border-radius: 999px;
  box-shadow: 0 8px 16px rgba(var(--torrec-teal-rgb), .2);
}

.torrec-account .d-flex.gap-2 {
  flex-wrap: wrap;
}

/* ---- Voting detail ------------------------------------------------------- */
/* Ambient wash: now the shared .torrec-glow, applied in Voting/Detail.cshtml. */

.torrec-voting-detail__datetime {
  margin: .3rem 0 0;
  color: var(--torrec-text-muted);
  font-size: .9rem;
}

.torrec-voting-detail__story,
.torrec-voting-detail__results,
.torrec-voting-detail__attendance {
  border: 1px solid color-mix(in srgb, var(--torrec-border) 78%, var(--torrec-teal) 22%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-surface) 92%, var(--torrec-surface-2) 8%), var(--torrec-surface));
  box-shadow: 0 10px 22px rgba(30, 42, 43, .06);
}

.torrec-voting-detail__description {
  margin: 0;
  color: var(--torrec-text-muted);
  line-height: 1.7;
  white-space: pre-wrap;
}

.torrec-voting-detail__media {
  margin-top: 1rem;
}

.torrec-voting-detail__chart-wrap {
  padding: .4rem .15rem .2rem;
  border-radius: calc(var(--torrec-radius) + 2px);
  background: color-mix(in srgb, var(--torrec-surface) 90%, var(--torrec-surface-2) 10%);
}

/* Surface and scrolling come from .torrec-tablewrap.torrec-scroll-x ("Table system"). */
.torrec-voting-detail__table-wrap {
  margin-top: 1rem;
}

.torrec-voting-detail__table {
  margin-bottom: 0;
}

.torrec-voting-detail__table thead th {
  background: color-mix(in srgb, var(--torrec-surface-2) 50%, var(--torrec-surface));
  color: var(--torrec-text-muted);
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.torrec-voting-detail__hint,
.torrec-voting-detail__empty-text {
  margin: 0 0 1rem;
  color: var(--torrec-text-muted);
}

/* Success/status banner */
.torrec-alert {
  border-radius: var(--torrec-radius);
  padding: .75rem 1rem;
  margin-bottom: 1.25rem;
  font-size: .9rem;
}
.torrec-alert--success {
  background: color-mix(in srgb, var(--torrec-success) 14%, transparent);
  color: var(--torrec-success);
  border: 1px solid color-mix(in srgb, var(--torrec-success) 40%, transparent);
}
.torrec-alert--warning {
  background: color-mix(in srgb, var(--torrec-warning) 16%, transparent);
  color: var(--torrec-text);
  border: 1px solid color-mix(in srgb, var(--torrec-warning) 45%, transparent);
}
.torrec-alert--warning a { font-weight: 600; }
.torrec-alert--danger {
  background: color-mix(in srgb, var(--torrec-error) 14%, transparent);
  color: var(--torrec-error);
  border: 1px solid color-mix(in srgb, var(--torrec-error) 40%, transparent);
}
/* Was referenced by Blog/Community/Voting but never defined, so an info alert
   rendered as unstyled body text inside a bare box — .torrec-alert on its own
   carries no background, border or colour. Uses the existing --torrec-info. */
.torrec-alert--info {
  background: color-mix(in srgb, var(--torrec-info) 12%, transparent);
  color: var(--torrec-text);
  border: 1px solid color-mix(in srgb, var(--torrec-info) 38%, transparent);
}
.torrec-alert--info a { color: var(--torrec-info); font-weight: 600; }

/* ---- Community feed ------------------------------------------------------ */
/* The ambient wash is now the shared .torrec-glow, applied in Community/Index.cshtml. */

.torrec-community__feed {
  display: block;
}

.torrec-community__list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.torrec-community__post {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid color-mix(in srgb, var(--torrec-border) 78%, var(--torrec-teal) 22%);
  border-radius: calc(var(--torrec-radius) + 2px);
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-surface) 92%, var(--torrec-surface-2) 8%), var(--torrec-surface));
  box-shadow: 0 10px 24px rgba(30, 42, 43, .06);
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.torrec-community__post:hover {
  border-color: color-mix(in srgb, var(--torrec-teal) 45%, var(--torrec-border));
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(30, 42, 43, .08);
}

.torrec-community__post-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}

.torrec-community__badge {
  display: inline-flex;
  align-items: center;
  padding: .28rem .6rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--torrec-teal) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--torrec-teal) 28%, var(--torrec-border));
  color: var(--torrec-teal);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.torrec-community__meta {
  color: var(--torrec-text-muted);
  font-size: .8rem;
}

.torrec-community__title {
  font-size: clamp(1.15rem, 1.5vw, 1.45rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--torrec-text);
  text-decoration: none;
}

.torrec-community__title:hover,
.torrec-community__title:focus {
  color: var(--torrec-teal);
  text-decoration: none;
}

.torrec-community__body {
  color: var(--torrec-text-muted);
  line-height: 1.7;
  white-space: pre-line;
}

.torrec-community__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
  padding-top: .2rem;
  border-top: 1px solid color-mix(in srgb, var(--torrec-border) 80%, transparent);
  color: var(--torrec-text-muted);
  font-size: .82rem;
}

.torrec-community__link {
  color: var(--torrec-teal);
  font-weight: 600;
  text-decoration: none;
}

.torrec-community__link:hover,
.torrec-community__link:focus {
  text-decoration: underline;
}

.torrec-community__empty {
  padding: 2rem 1.25rem;
  border: 1px dashed color-mix(in srgb, var(--torrec-border) 82%, var(--torrec-teal) 18%);
  border-radius: calc(var(--torrec-radius) + 2px);
  background: color-mix(in srgb, var(--torrec-surface) 94%, var(--torrec-surface-2) 6%);
  color: var(--torrec-text-muted);
  text-align: center;
}

@media (max-width: 980px) {
  .torrec-account__head {
    padding: 1rem;
  }

  .torrec-themeopts {
    width: 100%;
    max-width: 100%;
    border-radius: 12px;
  }

  .torrec-themeopt {
    justify-content: center;
    flex: 1 1 0;
  }
}

/* Inline field-level validation message, used next to a single input or a
   posted-list section (e.g. Settings' hours-of-operation groups). */
.torrec-field-error {
  display: block;
  color: var(--torrec-error);
  font-size: .85rem;
  font-weight: 600;
  margin-top: .25rem;
}

/* ---- Shell A: platform admin full-width banner nav ----------------------- */
.torrec-banner {
  background: var(--torrec-surface);
  border-bottom: 1px solid var(--torrec-border);
}
.torrec-banner__items {
  display: flex;
  justify-content: space-evenly;
}
.torrec-banner__item {
  flex: 1;
  text-align: center;
  padding-block: .85rem;
  color: var(--torrec-text-muted);
  font-weight: 600;
  font-size: .92rem;
  border-bottom: 3px solid transparent;
}
.torrec-banner__item:hover {
  color: var(--torrec-teal);
  text-decoration: none;
}
.torrec-banner__item.active {
  color: var(--torrec-teal);
  border-bottom-color: var(--torrec-teal);
}
/* Grouped items: a Bootstrap dropdown whose toggle wears the same tab look as a plain
   item. The group, not the button, takes the flex share so the strip stays even. */
.torrec-banner__group {
  flex: 1;
  display: flex;
}
.torrec-banner__toggle {
  width: 100%;
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  cursor: pointer;
}
.torrec-banner__toggle.active { border-bottom-color: var(--torrec-teal); }
.torrec-banner__toggle[aria-expanded="true"] { color: var(--torrec-teal); }
.torrec-banner__caret {
  font-size: .7rem;
  margin-left: .2rem;
  display: inline-block;
  transition: transform .15s ease;
}
.torrec-banner__toggle[aria-expanded="true"] .torrec-banner__caret { transform: rotate(180deg); }
.torrec-banner__menu {
  min-width: 14rem;
  margin-top: 0 !important;
  padding: .35rem;
  border: 1px solid var(--torrec-border);
  border-radius: var(--torrec-radius);
  background: var(--torrec-surface);
  box-shadow: 0 12px 28px rgba(30, 42, 43, .16);
}
.torrec-banner__menu .dropdown-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem .75rem;
  border-radius: calc(var(--torrec-radius) - 2px);
  color: var(--torrec-text);
  font-size: .92rem;
  font-weight: 500;
}
.torrec-banner__menu .dropdown-item .bi {
  width: 1.1rem;
  text-align: center;
  color: var(--torrec-text-muted);
}
.torrec-banner__menu .dropdown-item:hover,
.torrec-banner__menu .dropdown-item:focus {
  background-color: var(--torrec-surface-2);
  color: var(--torrec-teal);
}
.torrec-banner__menu .dropdown-item.active,
.torrec-banner__menu .dropdown-item:active {
  background-color: color-mix(in srgb, var(--torrec-teal) 10%, transparent);
  color: var(--torrec-teal);
  font-weight: 600;
}
.torrec-banner__menu .dropdown-item:hover .bi,
.torrec-banner__menu .dropdown-item.active .bi { color: var(--torrec-teal); }

/* ---- Shell B: left sidebar nav (complex admin, staff, residents) --------- */
/* Default (no sidebar — login, privacy, errors): a centered column, same as
   .torrec-shell, so those pages stay centered on the viewport. */
.torrec-layout {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  width: 80%;
  margin-inline: auto;
}
/* With the sidebar present (authenticated portal), the shell spans the viewport
   and centers as a unit — nav and content move together rather than the nav
   hugging the left edge while the content column strands whitespace on the right.

   The cap is the shell's own natural width, so the two behaviours meet exactly
   instead of fighting: below it the shell is full-width and .torrec-layout__content
   never reaches its own 1200px cap, so it fills the row; at or above it the shell
   stops growing and the content lands on 1200px precisely. Either way no free
   space is left over inside, and the only leftover is the margin split evenly. */
.torrec-layout--with-sidebar {
  width: 100%;
  max-width: calc(240px + 1.5rem + 1200px + 3rem); /* sidebar + gap + content cap + l/r padding */
  margin-inline: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}
.torrec-sidebar {
  flex: 0 0 240px;
  border-right: 1px solid var(--torrec-border);
  min-height: 60vh;
}
.torrec-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding-right: .75rem;
}
/* A group bundles a section header with its items; the header is omitted for the
   headerless top block (Dashboard). Spacing between groups is what reads as the divider. */
.torrec-sidebar__group {
  display: flex;
  flex-direction: column;
  gap: .1rem;
}
.torrec-sidebar__group + .torrec-sidebar__group {
  margin-top: .6rem;
  padding-top: .6rem;
  border-top: 1px solid var(--torrec-border);
}
.torrec-sidebar__group-label {
  padding: .2rem .75rem;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--torrec-text-muted);
}
.torrec-sidebar__item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: .7rem;
  padding: .55rem .75rem;
  border-radius: var(--torrec-radius);
  color: var(--torrec-text-muted);
  text-decoration: none;
  /* Reserve the left edge for the active accent so nothing shifts when it appears. */
  border-left: 3px solid transparent;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.torrec-sidebar__item:hover {
  background-color: var(--torrec-surface-2);
  color: var(--torrec-text);
}
.torrec-sidebar__item.active {
  color: var(--torrec-teal);
  background-color: color-mix(in srgb, var(--torrec-teal) 10%, transparent);
  border-left-color: var(--torrec-teal);
}
.torrec-sidebar__icon {
  flex: 0 0 auto;
  width: 1.25rem;
  font-size: 1.15rem;
  line-height: 1;
  text-align: center;
}
.torrec-sidebar__label { font-size: .9rem; line-height: 1.2; }
.torrec-dash__welcome { margin-top: 1.25rem; }
.torrec-layout__content {
  flex: 1;
  min-width: 0;
}
.torrec-layout--with-sidebar .torrec-layout__content {
  max-width: 1200px;
}
/* ---- Portal-wide phone safety net ---------------------------------------
   Three classes of mobile breakage recur across ~75 places in the view tree.
   Fixing each site individually would mean touching 75 files — and, worse,
   would leave the next page added to the portal with the same defects. These
   three rules cover the pattern instead. Per-page breakpoints still do the
   real layout work; this is the floor beneath them.
   ------------------------------------------------------------------------- */
@media (max-width: 700px) {
  /* 1. Inline width caps. ~23 form controls and panels carry
        style="max-width:Npx" (280 to 640px), which at a 360px viewport is
        either a no-op or actively wrong. An inline style beats every
        stylesheet rule, so releasing it needs !important — the alternative is
        editing 23 inline attributes that would drift apart again. Scoped to
        <main> so it cannot reach the nav chrome or a fixed-position widget. */
  main [style*="max-width"] {
    max-width: 100% !important;
  }

  /* 2. Non-wrapping flex rows. Bootstrap's .d-flex sets display:flex but no
        flex-wrap, so ~51 `d-flex gap-2` rows (a label beside a field, two
        buttons beside a text input) overflow rather than wrapping at phone
        width. .flex-nowrap is respected — where a row explicitly asked not to
        wrap, that is a decision, not an omission. */
  main .d-flex:not(.flex-nowrap) {
    flex-wrap: wrap;
  }

  /* 3. Tables with no scroll container. Several .torrec-table instances sit
        directly in a panel or page with nothing to scroll them, so a six-column
        table pushes the page body sideways — the one thing a phone layout must
        never do. display:block is what makes overflow-x apply to a <table> at
        all; the row groups still lay out as a table inside it. This is the same
        treatment the Packages, Visitors and PartTypes pages already had, applied
        to the rest.

        Tables already inside a .torrec-scroll-x/-y wrapper are excluded: they
        have a proper scroll container, and switching them to display:block
        would break the position:sticky header that .torrec-scroll-y relies on. */
  main table.torrec-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  main .torrec-scroll-x table.torrec-table,
  main .torrec-scroll-y table.torrec-table,
  main .table-responsive table.torrec-table {
    display: table;
    overflow-x: visible;
  }
}

/* ---- Mobile navigation drawer (both shells) -----------------------------
   Below 768px neither nav shell fits. Shell B stacked its ~15-item sidebar
   above the content, so every page opened with a full screen of nav before any
   content; Shell A flexed 6 evenly-sized banner items into a 360px row, where
   "Complejos"/"Proveedores" wrap and the strip reads as broken.

   Both become the same off-canvas drawer: the existing nav element is promoted
   to a fixed, translated-out panel, and a hamburger in the header slides it in.
   The nav MARKUP is untouched — Shell B keeps rendering _SidebarNav (so item
   order, permission gating and active states stay in exactly one place) and
   Shell A keeps its inline banner links. Only the box they live in changes.

   UPDATE: Shell B (_Layout) has since moved to the Syncfusion ejs-sidebar —
   see wwwroot/css/portal-sidebar.css and wwwroot/js/portal-sidebar.js. It no
   longer renders .torrec-sidebar / [data-torrec-nav-toggle], so the Shell B
   rules in this block are dormant; Shell A (_LayoutPlatform's banner) still
   uses this drawer unchanged. The original concern stands and shaped that
   implementation: the ejs-sidebar carries only literal attributes and no event
   bindings, so it cannot emit a malformed property into the shared
   <ejs-scripts> block (frontend_architecture_design.md §11).

   Original rationale: deliberately NOT the Syncfusion Sidebar, which §7 offers.
   This lives in _Layout/_LayoutPlatform, so an ejs-sidebar constructor here
   joins the single inline <ejs-scripts> block on EVERY authenticated page — and
   one bad attribute in that block takes down every EJ2 widget site-wide. With
   no browser this weekend that blast radius is not worth a widget's worth of
   polish: a transform + a class toggle cannot break EJ2 at all.
   ------------------------------------------------------------------------- */

/* Hamburger — only ever visible where the drawer exists. */
.torrec-navtoggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-right: .35rem;
  padding: 0;
  border: 1px solid var(--torrec-border);
  border-radius: 10px;
  background: var(--torrec-surface-2);
  color: var(--torrec-text);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}
.torrec-navtoggle:hover,
.torrec-navtoggle:focus-visible {
  border-color: var(--torrec-teal);
  color: var(--torrec-teal);
}

/* Dimmer behind the open drawer. Kept out of the layout entirely on desktop so
   it can never intercept a click there. */
.torrec-navscrim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1040;
  background: rgba(30, 42, 43, .5);
  opacity: 0;
  transition: opacity .2s ease;
  border: 0;
  padding: 0;
}

/* Drawer head: the panel covers the page, so it carries its own title + close.
   Hidden on desktop, where the nav is just part of the page. */
.torrec-navdrawer__head {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .75rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--torrec-border);
}
.torrec-navdrawer__title {
  font-weight: 700;
  font-size: .78rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--torrec-text-muted);
}
.torrec-navdrawer__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--torrec-border);
  border-radius: 999px;
  background: var(--torrec-surface-2);
  color: var(--torrec-text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.torrec-navdrawer__close:hover,
.torrec-navdrawer__close:focus-visible {
  border-color: var(--torrec-teal);
  color: var(--torrec-teal);
}

@media (max-width: 768px) {
  .torrec-navtoggle { display: inline-flex; }
  .torrec-navscrim { display: block; }
  .torrec-navdrawer__head { display: flex; }

  /* Scrim and drawer are inert until opened — visibility, not just opacity, so
     nothing under a closed drawer is clickable and nothing inside it is
     reachable by Tab. */
  .torrec-navscrim { visibility: hidden; }
  body.torrec-nav-open .torrec-navscrim { visibility: visible; opacity: 1; }

  /* Shell B — the complex sidebar becomes the drawer. */
  /* align-items:stretch, not the desktop flex-start: in a column flex container flex-start sizes the content
     column to its fit-content width, which a table's min-content (even inside a .torrec-scroll-x) pushes past
     the viewport once a page has rows. Stretch pins it to the container so the tables scroll inside themselves
     (issue #25). */
  .torrec-layout { flex-direction: column; align-items: stretch; gap: 1rem; width: 92%; }
  .torrec-layout--with-sidebar { width: 100%; padding-left: 1rem; padding-right: 1rem; }
  .torrec-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1041;
    flex-basis: auto;
    width: min(304px, 86vw);
    min-height: 0;
    padding: 1rem .8rem calc(1rem + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--torrec-surface);
    border-right: 1px solid var(--torrec-border);
    transform: translateX(-100%);
    transition: transform .22s ease;
  }
  body.torrec-nav-open .torrec-sidebar {
    transform: translateX(0);
    box-shadow: 12px 0 34px rgba(30, 42, 43, .28);
  }
  .torrec-sidebar__nav { padding-right: 0; }
  /* Roomier rows: a .55rem-tall row is a ~34px target, under the 44px minimum. */
  .torrec-sidebar__item { padding: .7rem .8rem; }
  .torrec-sidebar__label { font-size: .95rem; }
  .torrec-sidebar__icon { font-size: 1.2rem; }

  /* Shell A — the platform banner becomes the same drawer, stacked. */
  .torrec-banner {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1041;
    width: min(304px, 86vw);
    padding: 1rem .8rem calc(1rem + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    overscroll-behavior: contain;
    border-bottom: 0;
    border-right: 1px solid var(--torrec-border);
    transform: translateX(-100%);
    transition: transform .22s ease;
  }
  body.torrec-nav-open .torrec-banner {
    transform: translateX(0);
    box-shadow: 12px 0 34px rgba(30, 42, 43, .28);
  }
  .torrec-banner__items {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: .15rem;
    width: 100%;
  }
  .torrec-banner__item {
    flex: 0 0 auto;
    text-align: left;
    padding: .7rem .8rem;
    border-bottom: 0;
    border-left: 3px solid transparent;
    border-radius: var(--torrec-radius);
    font-size: .95rem;
  }
  .torrec-banner__item:hover {
    background-color: var(--torrec-surface-2);
  }
  .torrec-banner__item.active {
    border-bottom-color: transparent;
    border-left-color: var(--torrec-teal);
    background-color: color-mix(in srgb, var(--torrec-teal) 10%, transparent);
  }
  /* In the drawer the dropdown groups render expanded: the toggle becomes a section
     label and the menu sits inline under it, so no tap is spent opening a group. */
  .torrec-banner__group {
    flex: 0 0 auto;
    flex-direction: column;
    margin-top: .6rem;
    padding-top: .6rem;
    border-top: 1px solid var(--torrec-border);
  }
  .torrec-banner__toggle,
  .torrec-banner__toggle.active {
    pointer-events: none;
    padding: .2rem .8rem;
    border-left-color: transparent;
    background: none;
    font-size: .68rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--torrec-text-muted);
  }
  .torrec-banner__caret { display: none; }
  .torrec-banner__menu {
    display: block;
    position: static !important;
    transform: none !important;
    min-width: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: none;
  }
  .torrec-banner__menu .dropdown-item {
    padding: .7rem .8rem;
    font-size: .95rem;
    border-left: 3px solid transparent;
    border-radius: var(--torrec-radius);
  }
  .torrec-banner__menu .dropdown-item.active { border-left-color: var(--torrec-teal); }
  /* Plain items that follow a group (Reports) get the same divider, so the groups read as sections. */
  .torrec-banner__group + .torrec-banner__item {
    margin-top: .6rem;
    padding-top: .6rem;
    border-top: 1px solid var(--torrec-border);
  }

  /* The page must not scroll behind an open drawer. */
  body.torrec-nav-open {
    overflow: hidden;
  }

  /* The assistant launcher is fixed at z-index 1045, above both the scrim (1040)
     and the drawer (1041), so it would otherwise float over an open drawer. */
  body.torrec-nav-open .torrec-assistant__launcher,
  body.torrec-nav-open .torrec-assistant__panel {
    display: none;
  }

  /* Header: brand shrinks so hamburger + brand + user menu fit at 360px. */
  .torrec-brand__icon { width: 38px; height: 38px; }
  .torrec-brand__name { font-size: 1rem; }
  .torrec-usermenu__toggle { max-width: 132px; padding-inline: .5rem; }
}

/* Very narrow: the display name is the first thing to go — the avatar beside it
   already identifies the session, and the name reappears inside the dropdown. */
@media (max-width: 420px) {
  .torrec-brand__name { display: none; }
  .torrec-usermenu__email { display: none; }
  .torrec-usermenu__toggle { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .torrec-sidebar,
  .torrec-banner,
  .torrec-navscrim {
    transition: none;
  }
}

/* ---- Validation messages -------------------------------------------------
   ASP.NET emits these classes from asp-validation-for / asp-validation-summary,
   and jQuery unobtrusive validation reuses them client-side. Nothing styled
   them, so a rejected field produced small unstyled black text under a
   full-width control — present in the DOM but easy to miss entirely, which
   reads as "the form silently did nothing". --torrec-error is theme-aware, so
   these track light and dark automatically. */
.field-validation-error {
  display: block;
  margin-top: .25rem;
  font-size: .875rem;
  color: var(--torrec-error);
}

/* Applied to the bare input; EJ2 wraps its own inputs, so catch the wrapper too. */
.input-validation-error,
.e-input-group:has(.input-validation-error) {
  border-color: var(--torrec-error) !important;
}

.validation-summary-errors {
  background: color-mix(in srgb, var(--torrec-error) 14%, transparent);
  color: var(--torrec-error);
  border: 1px solid color-mix(in srgb, var(--torrec-error) 40%, transparent);
  border-radius: .5rem;
  padding: .75rem 1rem;
  margin-bottom: 1rem;
}
.validation-summary-errors ul {
  margin: 0;
  padding-left: 1.25rem;
}
.validation-summary-valid {
  display: none;
}

/* ---- EJ2 dropdown popups -------------------------------------------------
   EJ2 appends the popup to <body>, not next to its input, and its default
   width of 100% therefore resolves against the body rather than the field.
   Every dropdown in the app uses cssClass="w-100" inside a max-width:560px
   form, so without this cap the open list spans the whole viewport while the
   closed control is 560px wide.

   Kept as CSS rather than a popupWidth="" attribute on each component on
   purpose: a bad tag-helper attribute throws during EJ2 initialization and
   degrades every control on the page to a plain text input. Styling cannot. */
.e-ddl.e-popup {
  max-width: 560px;
}

/* Narrow viewports: the form itself is no longer 560px, so track it instead. */
@media (max-width: 600px) {
  .e-ddl.e-popup {
    max-width: 100%;
  }
}

/* ---- EJ2 date/time popups never inherit a width class --------------------
   EJ2 copies a picker's cssClass onto its popup too. With cssClass="w-100",
   Bootstrap's `.w-100 { width: 100% !important }` stretched the calendar popup
   to the whole body; EJ2 then right-aligned that 1400px popup to the input,
   which put its left edge — and the calendar sitting there — off-screen
   (left: -860px). What showed was an empty white panel (Reportes, 2026-10-12).
   The calendar has its own fixed width, so the popup must size to it. */
.e-datepicker.e-popup-wrapper.w-100,
.e-datetimepicker.e-popup-wrapper.w-100,
.e-timepicker.e-popup.w-100,
.e-daterangepicker.e-popup.w-100 {
  width: auto !important;
}

/* ---- EJ2 skin: Fluent2 → TorreC --------------------------------------------
   Grids, inputs, dropdowns, dialogs and buttons rendered as stock Fluent2 (a
   Microsoft-blue primary, square-ish corners, flat popups). Fluent2 34.1.31 is
   driven by --color-sf-* custom properties on :root (read from the CDN file,
   not guessed), so most of the skin is a remap of those onto TorreC tokens.
   Two properties make this safe:
     - Only the PRIMARY family is remapped. Fluent2 never consumes it as an
       rgb() tuple (it does for border/text/danger, which are left alone), so a
       var() or color-mix() value is valid everywhere it lands.
     - Surfaces/text are NOT remapped. Those must stay paired with whichever
       Fluent2 sheet (light or dark) is loaded, or text loses contrast.
   The ej2 <link> precedes this file in all three layouts, so these :root
   declarations win at equal specificity in both the light and dark sheets. */
:root {
  --color-sf-primary:                  var(--torrec-teal-fill);
  --color-sf-primary-bg-color:         var(--torrec-teal-fill);
  --color-sf-primary-border-color:     var(--torrec-teal-fill);
  --color-sf-primary-bg-color-hover:   var(--torrec-teal-fill-hover);
  --color-sf-primary-border-color-hover: var(--torrec-teal-fill-hover);
  --color-sf-primary-bg-color-focus:   var(--torrec-teal-fill-hover);
  --color-sf-primary-bg-color-pressed: var(--torrec-teal-fill-hover);
  --color-sf-primary-bg-color-selected: var(--torrec-teal-fill-hover);
  --color-sf-primary-text-color:       var(--torrec-on-fill);
  --color-sf-primary-outline:          var(--torrec-teal);
  --color-sf-primary-darker:           var(--torrec-teal-fill-hover);
  --color-sf-primary-light:            color-mix(in srgb, var(--torrec-teal) 32%, var(--torrec-surface));
  --color-sf-primary-lighter:          color-mix(in srgb, var(--torrec-teal) 10%, var(--torrec-surface));
}

/* Buttons: softer corners, one weight up, fast press feedback. */
.e-btn,
.e-css.e-btn {
  border-radius: var(--torrec-radius-sm);
  font-weight: 600;
  transition: background-color var(--torrec-dur-fast) var(--torrec-ease-out),
              border-color var(--torrec-dur-fast) var(--torrec-ease-out),
              color var(--torrec-dur-fast) var(--torrec-ease-out),
              box-shadow var(--torrec-dur-base) var(--torrec-ease-out),
              transform var(--torrec-dur-fast) var(--torrec-ease-out);
}
.e-btn:not(:disabled):active,
.e-css.e-btn:not(:disabled):active {
  transform: scale(.98);
}
.e-btn.e-flat:not(.e-primary):not(:disabled):hover {
  background-color: color-mix(in srgb, var(--torrec-teal) 9%, transparent);
  color: var(--torrec-teal);
}
.e-btn:focus-visible,
.e-css.e-btn:focus-visible {
  outline: var(--torrec-focus-ring);
  outline-offset: var(--torrec-focus-offset);
}

/* Inputs: the same radius as buttons and a soft teal halo on focus (on top of
   Fluent2's own focus border, which the primary remap already turns teal). */
.e-input-group,
.e-input-group.e-control-wrapper,
.e-float-input,
.e-float-input.e-control-wrapper,
input.e-input,
textarea.e-input,
select.e-input {
  border-radius: var(--torrec-radius-sm);
}
/* Dark mode: tell the browser the page is dark, so native controls (select, the file picker button, the date
   icon) draw dark internals. Without it Chromium (Edge) paints the select's text dim on our dark surface;
   Firefox compensates on its own, so the bug only showed in Edge (2026-11-06). */
:root[data-theme="dark"] { color-scheme: dark; }
/* An explicit light choice must say so: left at `normal`, the root would fall back to the head's color-scheme meta. */
:root[data-theme="light"] { color-scheme: light; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { color-scheme: dark; }
}
:root[data-theme="dark"] select.e-input {
  color: var(--torrec-text);
  -webkit-text-fill-color: var(--torrec-text);
  background-color: var(--torrec-surface);
}
:root[data-theme="dark"] select.e-input option { color: var(--torrec-text); background-color: var(--torrec-surface); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) select.e-input {
    color: var(--torrec-text);
    -webkit-text-fill-color: var(--torrec-text);
    background-color: var(--torrec-surface);
  }
  :root:not([data-theme="light"]) select.e-input option { color: var(--torrec-text); background-color: var(--torrec-surface); }
}
.e-input-group.e-input-focus,
.e-input-group.e-control-wrapper.e-input-focus,
.e-float-input.e-input-focus,
input.e-input:focus,
textarea.e-input:focus,
select.e-input:focus {
  box-shadow: 0 0 0 3px rgba(var(--torrec-teal-rgb), .16);
}

/* Grid: header weight, a teal selection wash instead of Fluent grey. */
.e-grid .e-headercelldiv {
  font-weight: 600;
}
.e-grid td.e-active,
.e-grid .e-rowcell.e-active {
  background-color: color-mix(in srgb, var(--torrec-teal) 10%, var(--torrec-surface));
}

/* Floating surfaces: one radius and one elevation step for every popup. */
.e-dialog {
  border-radius: var(--torrec-radius-lg);
  box-shadow: var(--torrec-elev-3);
}
.e-ddl.e-popup,
.e-dropdownbase.e-popup,
.e-datepicker.e-popup-wrapper,
.e-datetimepicker.e-popup-wrapper,
.e-timepicker.e-popup {
  border-radius: var(--torrec-radius-md);
  box-shadow: var(--torrec-elev-3);
  overflow: hidden;
}
.e-toast-container .e-toast {
  border-radius: var(--torrec-radius-md);
  box-shadow: var(--torrec-elev-3);
}
.e-pager .e-currentitem,
.e-pager .e-numericitem {
  border-radius: var(--torrec-radius-sm);
}

/* ---- AI assistant (complex portal) ---------------------------------------
   A launcher pinned bottom-right plus a docked panel hosting EJ2's
   AIAssistView. Both are fixed-position so the assistant is reachable from
   any portal page without each view reserving space for it.

   Rendered only by Views/Shared/_AiAssistant.cshtml, which the platform
   layout deliberately does not include — see CLAUDE.md
   § Platform vs. Complex Duplication. */
.torrec-assistant__launcher {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1045;          /* above content, below EJ2 dialogs (1050+) */
  width: 3.25rem;
  height: 3.25rem;
  border: none;
  border-radius: 50%;
  background: var(--torrec-teal);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  box-shadow: var(--torrec-shadow-float);
  cursor: pointer;
  transition: background-color .15s ease, transform .15s ease;
}
.torrec-assistant__launcher:hover {
  background: var(--torrec-teal-hover);
  transform: translateY(-1px);
}
.torrec-assistant__launcher--open {
  background: var(--torrec-text-muted);
}

.torrec-assistant__panel {
  --assistant-ink: #302823;
  --assistant-copper: #ce8e6c;
  --assistant-accent: color-mix(in srgb, var(--torrec-text) 70%, var(--assistant-copper));
  --assistant-paper: color-mix(in srgb, var(--torrec-bg) 96%, var(--assistant-copper));
  --assistant-rule: color-mix(in srgb, var(--torrec-text) 15%, var(--assistant-paper));
  position: fixed;
  right: 1.25rem;
  bottom: 5.25rem;        /* clears the launcher */
  z-index: 1045;
  display: flex;
  flex-direction: column;
  width: min(30rem, calc(100% - 2.5rem));
  height: min(39rem, calc(100dvh - 6.5rem));
  overflow: hidden;
  border: 1px solid var(--assistant-rule);
  border-radius: 1.5rem 1.5rem .5rem 1.5rem;
  background: var(--assistant-paper);
  color: var(--torrec-text);
  box-shadow: 0 24px 56px -16px rgb(48 40 35 / 46%), 0 4px 12px rgb(48 40 35 / 14%);
}
.torrec-assistant__panel[hidden] {
  display: none;
}
.torrec-assistant__panel:focus {
  outline: none;
}

.torrec-assistant__head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .7rem;
  padding: .65rem 1rem;
  border-bottom: 2px solid var(--assistant-copper);
  background: var(--assistant-ink);
  color: #fff6ee;
}
.torrec-assistant__mark {
  display: grid;
  place-items: center;
  width: 2rem;
  aspect-ratio: 1;
  border: 1px solid rgb(206 142 108 / 60%);
  border-radius: .55rem;
  color: #f3ba98;
}
.torrec-assistant__title {
  margin: 0;
  color: inherit;
  font: 700 .95rem/1.2 var(--torrec-font-display);
  overflow-wrap: anywhere;
}
.torrec-assistant__close {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid rgb(255 246 238 / 22%);
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: .875rem;
  cursor: pointer;
}
.torrec-assistant__close:hover {
  background: rgb(255 246 238 / 14%);
}
.torrec-assistant__close:focus-visible {
  outline: 2px solid #f3ba98;
  outline-offset: 2px;
}

/* AIAssistView sizes itself to its host, so the host takes the leftover height. */
#torrecAssistant {
  flex: 1 1 0;
  min-height: 0;
  border: 0;
  background: transparent;
  font-family: var(--torrec-font-sans);
}
#torrecAssistant .e-view-container,
#torrecAssistant .e-footer:not(.e-footer-template) {
  width: calc(100% - 2rem);
}
#torrecAssistant .e-views {
  overscroll-behavior: contain;
}
#torrecAssistant .e-banner-view {
  margin: 0;
}

.torrec-assistant__banner {
  padding: .5rem 0 1rem;
}
.torrec-assistant__illustration {
  position: relative;
  display: grid;
  place-items: end center;
  height: clamp(6rem, 24dvh, 12rem);
  margin: 0 0 1.5rem;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid #684c3d;
  border-radius: .85rem .85rem .2rem .2rem;
  background:
    linear-gradient(90deg, rgb(243 186 152 / 12%) 1px, transparent 1px) center / 1.25rem 1.25rem,
    linear-gradient(rgb(243 186 152 / 12%) 1px, transparent 1px) center / 1.25rem 1.25rem,
    radial-gradient(ellipse at 50% 95%, #775443, var(--assistant-ink) 75%);
  color: #f3ba98;
}
.torrec-assistant__illustration::before,
.torrec-assistant__illustration::after {
  position: absolute;
  z-index: -1;
  bottom: -40%;
  left: 50%;
  width: 74%;
  aspect-ratio: 1;
  border: 1px solid rgb(243 186 152 / 50%);
  border-radius: 50%;
  transform: translateX(-50%);
  content: "";
}
.torrec-assistant__illustration::after {
  width: 60%;
  border-style: dashed;
  border-color: rgb(243 186 152 / 32%);
}
.torrec-assistant__illustration .bi {
  position: absolute;
  top: 12%;
  left: 65%;
  font-size: clamp(1.25rem, 5dvh, 2rem);
  line-height: 1;
}
.torrec-assistant__towers,
.torrec-assistant__towers::before,
.torrec-assistant__towers::after {
  border: 1px solid var(--assistant-copper);
  border-bottom: 0;
  border-radius: .18rem .18rem 0 0;
  background:
    repeating-linear-gradient(0deg, transparent 0 6px, rgb(243 186 152 / 38%) 6px 7px) center / 65% 100% no-repeat,
    linear-gradient(105deg, #815c48, #3e3029 72%);
}
.torrec-assistant__towers {
  position: relative;
  width: 16%;
  height: 68%;
}
.torrec-assistant__towers::before,
.torrec-assistant__towers::after {
  position: absolute;
  z-index: -1;
  bottom: 0;
  width: 76%;
  content: "";
}
.torrec-assistant__towers::before {
  right: 88%;
  height: 72%;
}
.torrec-assistant__towers::after {
  left: 88%;
  height: 48%;
}
.torrec-assistant__banner-title {
  max-width: 16ch;
  margin: 0 0 .65rem;
  color: var(--torrec-text);
  font: 700 clamp(1.65rem, 1.35rem + 1.4vw, 2.3rem)/1.08 var(--torrec-font-display);
  letter-spacing: -.045em;
  text-wrap: balance;
}
.torrec-assistant__banner-body {
  max-width: 40ch;
  margin: 0;
  color: var(--torrec-text-muted);
  font-size: .875rem;
  line-height: 1.6;
}

#torrecAssistant,
#torrecAssistant > *,
#torrecAssistant [class*="e-"] {
  min-width: 0;
  max-width: 100%;
}

/* `clip`, not `hidden`, and the distinction is load-bearing. When one axis is
   `visible` and the other is `hidden`, CSS computes the visible axis to `auto` —
   so `overflow-x: hidden` silently turned every element these broad substring
   selectors touch (.e-content, .e-content-body, .e-view-container, .e-footer …)
   into a vertical scroll container, which is where the assistant's extra
   scrollbars came from. `clip` is exempt from that promotion: paired with a
   visible axis both values stay put, and on the transcript pane — which really
   does scroll vertically — it still computes to `hidden` exactly as before. */
#torrecAssistant,
#torrecAssistant [class*="content"],
#torrecAssistant [class*="view"],
#torrecAssistant [class*="footer"] {
  overflow-x: clip;
}

/* Keep the footer's stock padding. EJ2 measures the toolbar again after the first send,
   and extra padding can displace the attachment icon during that reflow. */
#torrecAssistant .e-footer:not(.e-footer-template) {
  margin-bottom: 1rem;
  border: 1px solid var(--assistant-rule);
  border-radius: 1rem 1rem .45rem 1rem;
  background: var(--torrec-surface);
}
#torrecAssistant .e-footer.e-footer-focused {
  border-color: var(--assistant-accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--assistant-copper) 45%, transparent);
}
#torrecAssistant .e-footer.e-footer-focus-wave-effect::before,
#torrecAssistant .e-footer.e-footer-focus-wave-effect::after {
  content: none;
}
#torrecAssistant .e-assist-textarea {
  background: transparent;
  color: var(--torrec-text);
  font-size: 1rem;
}
#torrecAssistant .e-assist-textarea:empty::before {
  color: var(--torrec-text-muted);
}
/* Scoped to the attachment icon specifically, not the broader `.e-icons` font class —
   `.e-assist-send` also carries `.e-icons`, and a bare `.e-icons` selector here would
   out-specificity the white-on-teal color the send button gets below. */
#torrecAssistant .e-footer .e-footer-icons-wrapper .e-assist-attachment-icon {
  color: var(--assistant-accent);
}

/* Keep the stock toolbar geometry so attachment and send fit through each reflow. */
#torrecAssistant .e-assist-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: .55rem;
  color: #fff6ee;
  background: var(--assistant-ink);
}
#torrecAssistant .e-assist-send:hover {
  background: #594538;
}
#torrecAssistant .e-assist-send.disabled {
  background: var(--torrec-surface-2);
  color: var(--torrec-text-muted);
}
#torrecAssistant :is(.e-assist-send, .e-tbar-btn):focus-visible {
  outline: 2px solid var(--assistant-copper);
  outline-offset: -2px;
}

/* The footer icon row occasionally renders in EJ2's horizontal-scroll ("e-hscroll") layout even
   though attach + send always fit comfortably (see repairSendButtonIfMissing() in assistant.js for
   the related JS-side bug, where this same layout mode sometimes drops the send button entirely).
   There's never actually anything to scroll to — two icons, plenty of width — so both nav arrows
   only get in the way. Hide them and reclaim the 28px-per-side gutter the base theme reserves for
   them (`.e-hscroll:not(.e-scroll-device) { padding: 0 28px }`) so the icons sit where they would
   without the hscroll wrapper at all. */
#torrecAssistant .e-hscroll .e-scroll-nav {
  display: none;
}
#torrecAssistant .e-hscroll:not(.e-scroll-device) {
  padding-left: 0;
  padding-right: 0;
}

#torrecAssistant .e-content-container {
  font-size: .875rem;
  overflow-wrap: anywhere;
}
#torrecAssistant .e-prompt-text {
  padding: .55rem .85rem;
  border: 0;
  border-radius: .85rem .85rem .2rem .85rem;
  background: var(--assistant-ink);
  color: #fff6ee;
}
#torrecAssistant .e-output-icon {
  flex: 0 0 1.875rem;
  margin-inline: 0 .45rem;
  border-radius: .5rem;
  background-color: color-mix(in srgb, var(--assistant-copper) 25%, var(--assistant-paper));
  color: var(--assistant-accent);
}
#torrecAssistant .e-output-container .e-content-body {
  padding: .7rem .8rem;
  border: 1px solid var(--assistant-rule);
  border-radius: .2rem .85rem .85rem .85rem;
  background: var(--torrec-surface);
  color: var(--torrec-text);
  line-height: 1.6;
}
#torrecAssistant :is(.e-footer, .e-content-footer, .e-prompt-toolbar) :is(.e-toolbar, .e-toolbar-items) {
  background: transparent;
}

/* Markdown in replies. AIAssistView converts the response string from Markdown to HTML itself
   (toSafeHtml in assistant.js only escapes raw tags — `#`, `**`, `-` pass straight through), so
   whenever the model answers with a heading the transcript gets a real <h1>/<h2> at the browser's
   full page-heading size: a 2rem+ "Adeudos pendientes" in a 24rem panel. It looked random because
   it tracks the model's formatting choice — structured, data-heavy answers (the ones that follow a
   tool call) are the ones it tends to put headings on. Clamp every heading to body-ish sizes and
   tighten the block spacing so a formatted answer reads like the plain ones. */
#torrecAssistant .e-output-container :is(h1, h2, h3, h4, h5, h6) {
  margin: .75rem 0 .35rem;
  font-weight: 600;
  line-height: 1.35;
}
#torrecAssistant .e-output-container :is(h1, h2) {
  font-size: 15px;
}
#torrecAssistant .e-output-container h3 {
  font-size: 14px;
}
#torrecAssistant .e-output-container :is(h4, h5, h6) {
  font-size: 13px;
}
#torrecAssistant .e-output-container :is(h1, h2, h3, h4, h5, h6):first-child {
  margin-top: 0;
}
#torrecAssistant .e-output-container :is(p, ul, ol, table, pre, blockquote) {
  margin: 0 0 .5rem;
  font-size: inherit;
}
#torrecAssistant .e-output-container :is(ul, ol) {
  padding-left: 1.25rem;
}
#torrecAssistant .e-output-container table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
}
#torrecAssistant .e-output-container :is(th, td) {
  padding: .25rem .5rem;
  border: 1px solid var(--torrec-border);
}
#torrecAssistant .e-output-container :is(code, pre) {
  font-size: 12px;
}

/* Keep a gutter at either edge and room for the launcher below the sheet. */
@media (max-width: 575.98px) {
  .torrec-assistant__panel {
    right: .75rem;
    left: .75rem;
    bottom: 5rem;
    width: auto;
    height: min(39rem, calc(100dvh - 6rem));
  }
}

@media (max-height: 560px) {
  .torrec-assistant__banner {
    padding-bottom: .5rem;
  }
  .torrec-assistant__illustration {
    height: clamp(3rem, 16dvh, 5rem);
    margin-bottom: .75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  #torrecAssistant .e-views {
    scroll-behavior: auto;
  }
}

/* Report detail: the chart panel gets a touch less side padding than a text
   panel so the SVG's own margins do not read as double padding. The EJ2 chart
   renders at a fixed pixel height set at construction, which CSS cannot change
   — 340px is workable on a phone but is worth a look at actual width. */
.torrec-reports-detail__chart {
  padding: .8rem .6rem;
}

@media (max-width: 700px) {
  .torrec-reports-detail__chart {
    padding: .5rem .25rem;
  }
}

/* Report grid cells showing an amount owed rather than "Pagado" — see MorosidadByUnitReportHandler. */
.torrec-cell--owed {
  background-color: var(--torrec-error-tint);
}

/* Report grids whose cells hold sentences (package label audit): wrapped onto taller rows, slightly
   smaller, so the reason is read instead of cut off with an ellipsis. Paired with allowTextWrap on the
   grid (Reports/Detail.cshtml). */
.torrec-report-grid--wrap .e-rowcell {
  font-size: .8125rem;
  line-height: 1.35;
  white-space: normal;
  vertical-align: top;
}

/* Package label audit report — a mismatch nobody has reviewed yet. Red by owner decision; the cell's
   text stays neutral ("Pendiente"), the colour carries the urgency. */
.torrec-cell--alert {
  background-color: var(--torrec-error-tint);
  color: var(--torrec-error);
  font-weight: 600;
}

/* Events Scheduler — the "hours of operation" band, applied per weekday via renderCell (events.js)
   since EJ2's own workHours highlight is a single daily range with no day-of-week variation. Own
   class rather than reusing an EJ2 internal one — undocumented and not worth depending on. */
/* Grafito y barro (2026-11-06): graphite for normal hours, terracotta (not the off-palette amber) for
   holidays. Both tokens flip in dark mode, so the tints follow. The legend swatches
   (torrec-page-areas.css .torrec-evtx-swatch--*) use the -swatch variants, which are denser so a 14px chip
   still reads the same as a whole column. */
:root {
  --torrec-evt-hours-tint:          color-mix(in srgb, var(--torrec-teal) 11%, transparent);
  --torrec-evt-hours-swatch:        color-mix(in srgb, var(--torrec-teal) 26%, transparent);
  --torrec-evt-holiday-tint:        color-mix(in srgb, var(--torrec-terracotta) 13%, transparent);
  --torrec-evt-holiday-swatch:      color-mix(in srgb, var(--torrec-terracotta) 32%, transparent);
}
.torrec-scheduler-operating-hours {
  background-color: var(--torrec-evt-hours-tint) !important;
}
.torrec-scheduler-holiday-hours {
  background-color: var(--torrec-evt-holiday-tint) !important;
}

/* ---- Incidents Kanban cards --------------------------------------------
   The card body is built in incidents.js (cardTemplate) rather than as an EJ2
   string template, so decrypted titles reach the page as textContent. These
   classes only style what that function produces. */
.torrec-inc-card {
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.torrec-inc-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
.torrec-inc-card__category {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--torrec-text-muted);
}
.torrec-inc-card__priority {
  font-size: .72rem;
  font-weight: 700;
  padding: .1rem .45rem;
  border-radius: 999px;
  border: 1px solid var(--torrec-border);
  color: var(--torrec-text-muted);
  white-space: nowrap;
}
.torrec-inc-card__priority--urgent {
  color: var(--torrec-error);
  border-color: color-mix(in srgb, var(--torrec-error) 45%, transparent);
  background: var(--torrec-error-tint);
}
.torrec-inc-card__priority--high {
  color: var(--torrec-warning);
  border-color: color-mix(in srgb, var(--torrec-warning) 45%, transparent);
  background: rgba(var(--torrec-warning-rgb), .12);
}
.torrec-inc-card__title {
  font-weight: 600;
  color: var(--torrec-text);
  overflow-wrap: anywhere;
}
.torrec-inc-card__unit {
  font-size: .82rem;
  color: var(--torrec-text-muted);
}
.torrec-inc-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  font-size: .78rem;
  color: var(--torrec-text-muted);
}

/* The incidents forms' inline width caps are released by the portal-wide phone
   safety net above. What is specific here is the field ROWS: the outcome radios and
   the fee/expense pairs are `d-flex gap-3 flex-wrap`, so they do wrap — but at 360px
   they wrap to two-per-row plus an orphan, which reads worse than a clean column. */
@media (max-width: 700px) {
  #incidentResolvePanel .e-input,
  #incidentReportPanel .e-input,
  #incidentEditPanel .e-input {
    width: 100%;
  }

  #incidentResolvePanel .d-flex.gap-3,
  #incidentReportPanel .d-flex.gap-3,
  #incidentEditPanel .d-flex.gap-3 {
    flex-direction: column;
    gap: .75rem !important;
  }
}

/* ---- Incidents: the phone board ----------------------------------------
   One of these two is always display:none. The EJ2 Kanban is unusable below
   768px (four columns, ~85px of card each), so it is replaced outright by a
   stacked status-grouped list rather than squeezed — see the renderMobileBoard
   comment in incidents.js and portal_design_system.md §7. */
.torrec-inc-mobile {
  display: none;
}

.torrec-inc-mobile__group + .torrec-inc-mobile__group {
  margin-top: 1rem;
}

.torrec-inc-mobile__group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .5rem;
  padding: .5rem .75rem;
  border-radius: var(--torrec-radius);
  border: 1px solid var(--torrec-border);
  background: color-mix(in srgb, var(--torrec-surface) 90%, var(--torrec-surface-2) 10%);
}

/* Same status tinting the Kanban headers carry, so the two boards read as the
   same board seen at two sizes. */
.torrec-inc-mobile__group--open .torrec-inc-mobile__group-head {
  background: color-mix(in srgb, var(--torrec-info) 11%, var(--torrec-surface));
  border-color: color-mix(in srgb, var(--torrec-info) 35%, var(--torrec-border));
}
.torrec-inc-mobile__group--inprogress .torrec-inc-mobile__group-head {
  background: color-mix(in srgb, var(--torrec-warning) 14%, var(--torrec-surface));
  border-color: color-mix(in srgb, var(--torrec-warning) 45%, var(--torrec-border));
}
.torrec-inc-mobile__group--resolved .torrec-inc-mobile__group-head {
  background: color-mix(in srgb, var(--torrec-success) 14%, var(--torrec-surface));
  border-color: color-mix(in srgb, var(--torrec-success) 40%, var(--torrec-border));
}
.torrec-inc-mobile__group--closed .torrec-inc-mobile__group-head {
  background: color-mix(in srgb, var(--torrec-text-muted) 12%, var(--torrec-surface));
  border-color: color-mix(in srgb, var(--torrec-text-muted) 35%, var(--torrec-border));
}

.torrec-inc-mobile__group-label {
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--torrec-text-muted);
}

.torrec-inc-mobile__group-count {
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1;
  color: var(--torrec-text);
}

.torrec-inc-mobile__card {
  padding: .8rem .85rem;
  border-radius: 11px;
  border: 1px solid color-mix(in srgb, var(--torrec-border) 82%, var(--torrec-teal) 18%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-surface) 92%, var(--torrec-surface-2) 8%), var(--torrec-surface));
  box-shadow: 0 6px 14px rgba(30, 42, 43, .08);
}

.torrec-inc-mobile__card + .torrec-inc-mobile__card {
  margin-top: .55rem;
}

.torrec-inc-mobile__actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .65rem;
  padding-top: .6rem;
  border-top: 1px solid color-mix(in srgb, var(--torrec-border) 75%, transparent);
}

.torrec-inc-mobile__open {
  border-radius: 999px;
  flex: 0 0 auto;
}

/* The select is the touch replacement for dragging, so it takes the rest of the
   row and keeps a 44px target. */
.torrec-inc-mobile__status {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 40px;
  border-radius: 10px;
}

.torrec-inc-mobile__empty {
  margin: 0;
  padding: .6rem .75rem;
  color: var(--torrec-text-muted);
  font-size: .88rem;
}

@media (max-width: 768px) {
  .torrec-inc-mobile { display: block; }
  .torrec-inc-board--desktop { display: none; }
}

/* "+N more — view all" in a Kanban column header. A column is capped
   server-side, so this is the only route to the rest of it. */
.torrec-inc-more {
  font-size: .78rem;
  font-weight: 600;
  margin-left: .5rem;
  white-space: nowrap;
}

/* The incident detail page's photo/video gallery. */
.torrec-inc-media {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.torrec-inc-media__item {
  width: 160px;
  height: 120px;
  object-fit: cover;
  border-radius: .375rem;
  border: 1px solid var(--torrec-border);
}

/* Every row in /incidents/all navigates to that incident's detail page on click. */
#incidentsGrid .e-row {
  cursor: pointer;
}

/* Incidents history (/incidents/all). The filter bar, its field labels, the pill
   apply button and the grid's surface are .torrec-filterbar / .torrec-gridwrap,
   applied in the view. This page keeps a tighter minimum on its filter columns than
   the primitive's 170px default — seven short selects read better four-up. */
main > .torrec-incidents-all-page > .torrec-incidents-all-page__filters .torrec-incidents-all-page__filter-grid {
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: .85rem .8rem;
}

main > .torrec-incidents-all-page > .torrec-incidents-all-page__alert {
  border: 1px solid color-mix(in srgb, var(--torrec-warning) 42%, var(--torrec-border));
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-warning) 14%, transparent), color-mix(in srgb, var(--torrec-surface) 92%, transparent));
}

main > .torrec-incidents-all-page > .torrec-incidents-all-page__grid-wrap {
  border: 1px solid color-mix(in srgb, var(--torrec-border) 76%, var(--torrec-teal) 24%);
  border-radius: calc(var(--torrec-radius) + 2px);
  overflow: hidden;
  background: var(--torrec-surface);
  box-shadow: 0 12px 24px rgba(30, 42, 43, .1);
}

main > .torrec-incidents-all-page > .torrec-incidents-all-page__grid-wrap #incidentsGrid .e-gridheader {
  border-bottom: 1px solid var(--torrec-border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-surface-2) 60%, var(--torrec-surface) 40%), var(--torrec-surface));
}

main > .torrec-incidents-all-page > .torrec-incidents-all-page__grid-wrap #incidentsGrid .e-gridheader .e-headercell {
  font-weight: 700;
  color: var(--torrec-text);
}

main > .torrec-incidents-all-page > .torrec-incidents-all-page__grid-wrap #incidentsGrid .e-content {
  background: color-mix(in srgb, var(--torrec-surface) 90%, var(--torrec-surface-2) 10%);
}

main > .torrec-incidents-all-page > .torrec-incidents-all-page__grid-wrap #incidentsGrid .e-row {
  transition: background-color .14s ease;
}

main > .torrec-incidents-all-page > .torrec-incidents-all-page__grid-wrap #incidentsGrid .e-row:hover {
  background: color-mix(in srgb, var(--torrec-teal) 7%, var(--torrec-surface));
}

main > .torrec-incidents-all-page > .torrec-incidents-all-page__grid-wrap #incidentsGrid .e-gridpager {
  border-top: 1px solid var(--torrec-border);
  background: color-mix(in srgb, var(--torrec-surface) 86%, var(--torrec-surface-2) 14%);
}

@media (max-width: 700px) {
  main > .torrec-incidents-all-page > .torrec-incidents-all-page__filters .torrec-incidents-all-page__filter-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: .75rem;
  }
}

/* ---- Settings page (header banner now handled by .torrec-page-header) -- */
.torrec-settings-page {
  max-width: 980px;
}

.torrec-settings-page__form {
  counter-reset: torrec-settings-section;
  display: flex;
  flex-direction: column;
  gap: 1.05rem;
}

.torrec-settings-page__section {
  position: relative;
  overflow: hidden;
  padding: 1.3rem 1.4rem;
  border-radius: calc(var(--torrec-radius) + 2px);
  backdrop-filter: saturate(125%);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  animation: torrec-settings-rise .25s ease both;
}

.torrec-settings-page__section:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(30, 42, 43, .08), var(--torrec-shadow);
  border-color: color-mix(in srgb, var(--torrec-teal) 25%, var(--torrec-border));
}

.torrec-settings-page__section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: var(--torrec-radius) var(--torrec-radius) 0 0;
  background: linear-gradient(90deg, var(--torrec-teal) 0%, color-mix(in srgb, var(--torrec-teal) 55%, var(--torrec-terracotta) 45%) 62%, var(--torrec-terracotta) 100%);
}

.torrec-settings-page__section::after {
  counter-increment: torrec-settings-section;
  content: "0" counter(torrec-settings-section);
  position: absolute;
  top: .7rem;
  right: .8rem;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: .73rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--torrec-teal);
  border: 1px solid color-mix(in srgb, var(--torrec-teal) 35%, var(--torrec-border));
  background: color-mix(in srgb, var(--torrec-teal) 10%, var(--torrec-surface));
}

.torrec-settings-page__field-grid {
  max-width: 580px;
}

.torrec-settings-page__subsection {
  margin: 1.2rem 0 .75rem;
  padding-top: .9rem;
  border-top: 1px solid var(--torrec-border);
  font-size: 1rem;
  color: var(--torrec-text);
}

.torrec-settings-page__subsection::before {
  content: "";
  display: inline-block;
  width: .55rem;
  height: .55rem;
  margin-right: .5rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--torrec-teal) 55%, var(--torrec-terracotta));
  vertical-align: .05rem;
}

.torrec-settings-page__field-grid .torrec-settings-page__subsection:first-of-type {
  margin-top: .15rem;
  padding-top: 0;
  border-top: 0;
}

.torrec-settings-page__section-title {
  margin: .15rem 0 1rem;
  padding-bottom: .7rem;
  border-bottom: 1px solid var(--torrec-border);
  font-size: 1.06rem;
  letter-spacing: .01em;
  font-weight: 700;
}

.torrec-settings-page__field {
  display: grid;
  gap: .45rem;
}

.torrec-settings-page__label {
  font-size: .88rem;
  font-weight: 600;
  color: var(--torrec-text-muted);
}

.torrec-settings-page__actions {
  position: sticky;
  bottom: 1rem;
  z-index: 2;
  width: fit-content;
  padding: .55rem;
  border: 1px solid color-mix(in srgb, var(--torrec-border) 70%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--torrec-surface) 82%, transparent);
  backdrop-filter: blur(8px);
  box-shadow: var(--torrec-shadow);
}

.torrec-settings-page__submit {
  min-width: 200px;
  font-weight: 700;
  letter-spacing: .01em;
  border-radius: 999px;
  padding-inline: 1.1rem;
  box-shadow: 0 8px 18px rgba(var(--torrec-teal-rgb), .22);
}

.torrec-settings-page__add-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border: 1px dashed color-mix(in srgb, var(--torrec-teal) 50%, var(--torrec-border) 50%);
  border-radius: 999px;
  color: var(--torrec-teal);
  padding-inline: 1rem;
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}

.torrec-settings-page__add-btn::before {
  content: "+";
  font-weight: 700;
  line-height: 1;
}

.torrec-settings-page__add-btn:hover {
  border-style: solid;
  background: rgba(var(--torrec-teal-rgb), .08);
  transform: translateY(-1px);
}

.torrec-settings-page .operating-hours-group,
.torrec-settings-page .holiday-row {
  border-left: 4px solid color-mix(in srgb, var(--torrec-teal) 45%, transparent);
  border: 1px solid color-mix(in srgb, var(--torrec-border) 82%, var(--torrec-teal) 18%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-surface) 86%, var(--torrec-surface-2) 14%), var(--torrec-surface));
  box-shadow: 0 6px 14px rgba(30, 42, 43, .07);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.torrec-settings-page .operating-hours-group:hover,
.torrec-settings-page .holiday-row:hover {
  border-color: color-mix(in srgb, var(--torrec-teal) 30%, var(--torrec-border));
  box-shadow: 0 10px 20px rgba(30, 42, 43, .1);
}

.torrec-settings-page__collection {
  position: relative;
  padding-left: .25rem;
}

.torrec-settings-page__collection::before {
  content: "";
  position: absolute;
  left: .45rem;
  top: .25rem;
  bottom: .25rem;
  width: 1px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-teal) 45%, transparent), color-mix(in srgb, var(--torrec-border) 75%, transparent));
}

.torrec-settings-page__days {
  margin-inline: -.05rem;
}

.torrec-settings-page__day-toggle {
  cursor: pointer;
  padding: .28rem .55rem;
  border: 1px solid var(--torrec-border);
  border-radius: 999px;
  background: var(--torrec-surface-2);
  font-size: .82rem;
  color: var(--torrec-text);
  transition: border-color .15s ease, background-color .15s ease;
}

.torrec-settings-page__day-toggle:hover {
  border-color: color-mix(in srgb, var(--torrec-teal) 35%, var(--torrec-border));
  background: color-mix(in srgb, var(--torrec-teal) 10%, var(--torrec-surface-2));
}

.torrec-settings-page__day-toggle input {
  margin-top: 0;
}

.torrec-settings-page__time-row {
  border-top: 1px dashed var(--torrec-border);
  padding-top: .85rem;
}

/* A row that failed validation on the last post. Paired with an inline
   .torrec-field-error inside the same row, so the colour is reinforcement and
   never the only signal. */
.torrec-settings-page .operating-hours-group.torrec-settings-page__row--invalid,
.torrec-settings-page .holiday-row.torrec-settings-page__row--invalid {
  border-color: color-mix(in srgb, var(--torrec-error) 55%, var(--torrec-border));
  box-shadow: 0 6px 14px color-mix(in srgb, var(--torrec-error) 14%, transparent);
}

/* Explanatory line above a collection (e.g. how to express hours that cross
   midnight) — guidance, not an error, so it stays muted. */
.torrec-settings-page__hint {
  color: var(--torrec-text-muted);
  font-size: .85rem;
  margin-bottom: .75rem;
  max-width: 68ch;
}

/* <input type="time"> renders with the browser's own clock affordance; this only
   keeps its metrics in line with the .e-input fields beside it. */
.torrec-settings-page__time-input {
  font-variant-numeric: tabular-nums;
}

.torrec-settings-page__time-input:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.torrec-settings-page__closed-toggle {
  white-space: nowrap;
}

.torrec-settings-page__time-field label {
  color: var(--torrec-text-muted);
  font-size: .82rem;
  font-weight: 600;
}

.torrec-settings-page__remove-btn {
  padding-inline: .85rem;
  border: 1px solid color-mix(in srgb, var(--torrec-error) 32%, var(--torrec-border));
  color: var(--torrec-error);
  border-radius: 999px;
  transition: background-color .15s ease, transform .15s ease;
}

.torrec-settings-page__remove-btn:hover {
  background: color-mix(in srgb, var(--torrec-error) 12%, transparent);
  transform: translateY(-1px);
}

@keyframes torrec-settings-rise {
  from {
    opacity: .85;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .torrec-settings-page__section {
    animation: none;
    transition: none;
  }

  .torrec-settings-page__add-btn,
  .torrec-settings-page__remove-btn {
    transition: none;
  }
}

@media (max-width: 768px) {
  .torrec-settings-page__section {
    padding: 1rem;
  }

  .torrec-settings-page__section::after {
    top: .62rem;
    right: .62rem;
    width: 1.8rem;
    height: 1.8rem;
    font-size: .68rem;
  }

  .torrec-settings-page__field-grid {
    max-width: 100%;
  }

  .torrec-settings-page__actions {
    width: 100%;
    bottom: .6rem;
    justify-content: stretch;
  }

  .torrec-settings-page__submit {
    width: 100%;
    min-width: 0;
  }

  .torrec-settings-page__day-toggle {
    padding: .24rem .5rem;
  }
}

/* Fallback selectors for a running app instance that still serves the older
   compiled Settings view markup. Scoped by unique settings IDs to avoid bleed. */
main form:has(#operatingHoursGroups):has(#holidaysList) {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

main form:has(#operatingHoursGroups):has(#holidaysList) > div:first-of-type {
  position: relative;
  padding: 1.2rem 1.25rem;
  border-radius: calc(var(--torrec-radius) + 2px);
  border: 1px solid color-mix(in srgb, var(--torrec-border) 78%, var(--torrec-teal) 22%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-surface) 84%, var(--torrec-surface-2) 16%), var(--torrec-surface));
  box-shadow: 0 8px 16px rgba(30, 42, 43, .07);
}

main form:has(#operatingHoursGroups):has(#holidaysList) > div:first-of-type::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: var(--torrec-radius) var(--torrec-radius) 0 0;
  background: linear-gradient(90deg, var(--torrec-teal) 0%, color-mix(in srgb, var(--torrec-teal) 55%, var(--torrec-terracotta) 45%) 62%, var(--torrec-terracotta) 100%);
}

main form:has(#operatingHoursGroups):has(#holidaysList) h2.h5.mt-4 {
  display: flex;
  align-items: center;
  gap: .55rem;
}

main form:has(#operatingHoursGroups):has(#holidaysList) h2.h5.mt-4::before {
  content: "";
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--torrec-teal) 40%, var(--torrec-border));
  background: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--torrec-teal) 20%, white), color-mix(in srgb, var(--torrec-teal) 70%, var(--torrec-terracotta)));
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--torrec-surface) 80%, transparent);
}

main form:has(#operatingHoursGroups):has(#holidaysList) > h2.h5.mt-4 {
  margin-top: .55rem !important;
  margin-bottom: .15rem;
  padding-bottom: .65rem;
  border-bottom: 1px solid var(--torrec-border);
  font-weight: 700;
}

main form:has(#operatingHoursGroups):has(#holidaysList) > h2.h5.mt-4::before {
  width: 1.35rem;
  height: 1.35rem;
}

main form:has(#operatingHoursGroups):has(#holidaysList) #operatingHoursAddButton,
main form:has(#operatingHoursGroups):has(#holidaysList) #holidaysAddButton {
  border: 1px dashed color-mix(in srgb, var(--torrec-teal) 50%, var(--torrec-border) 50%);
  border-radius: 999px;
  color: var(--torrec-teal);
  padding-inline: 1rem;
}

main form:has(#operatingHoursGroups):has(#holidaysList) #operatingHoursAddButton:hover,
main form:has(#operatingHoursGroups):has(#holidaysList) #holidaysAddButton:hover {
  border-style: solid;
  background: rgba(var(--torrec-teal-rgb), .08);
}

main form:has(#operatingHoursGroups):has(#holidaysList) .operating-hours-group,
main form:has(#operatingHoursGroups):has(#holidaysList) .holiday-row {
  border: 1px solid color-mix(in srgb, var(--torrec-border) 82%, var(--torrec-teal) 18%);
  border-left: 4px solid color-mix(in srgb, var(--torrec-teal) 45%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-surface) 86%, var(--torrec-surface-2) 14%), var(--torrec-surface));
  box-shadow: 0 6px 14px rgba(30, 42, 43, .07);
}

main form:has(#operatingHoursGroups):has(#holidaysList) .operating-hours-group .d-flex.flex-wrap.gap-3.align-items-end,
main form:has(#operatingHoursGroups):has(#holidaysList) .holiday-row .d-flex.flex-wrap.gap-3.align-items-end {
  border-top: 1px dashed var(--torrec-border);
  padding-top: .85rem;
}

main form:has(#operatingHoursGroups):has(#holidaysList) .operating-hours-group .d-flex.flex-wrap.gap-3.mb-3 label {
  padding: .28rem .55rem;
  border: 1px solid var(--torrec-border);
  border-radius: 999px;
  background: var(--torrec-surface-2);
  font-size: .82rem;
}

main form:has(#operatingHoursGroups):has(#holidaysList) .operating-hours-group button.e-btn.e-flat,
main form:has(#operatingHoursGroups):has(#holidaysList) .holiday-row button.e-btn.e-flat {
  color: var(--torrec-error);
  border: 1px solid color-mix(in srgb, var(--torrec-error) 32%, var(--torrec-border));
  border-radius: 999px;
  padding-inline: .85rem;
}

main form:has(#operatingHoursGroups):has(#holidaysList) button.e-btn.e-primary[type="submit"] {
  border-radius: 999px;
  padding-inline: 1.1rem;
  box-shadow: 0 8px 18px rgba(var(--torrec-teal-rgb), .22);
  font-weight: 700;
}

main form:has(#operatingHoursGroups):has(#holidaysList) > div.mb-4.d-flex.gap-2 {
  position: sticky;
  bottom: .9rem;
  z-index: 3;
  width: fit-content;
  padding: .5rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--torrec-border) 72%, transparent);
  background: color-mix(in srgb, var(--torrec-surface) 82%, transparent);
  backdrop-filter: blur(8px);
  box-shadow: var(--torrec-shadow);
}

@media (max-width: 768px) {
  main form:has(#operatingHoursGroups):has(#holidaysList) > div.mb-4.d-flex.gap-2 {
    width: 100%;
    bottom: .55rem;
  }

  main form:has(#operatingHoursGroups):has(#holidaysList) button.e-btn.e-primary[type="submit"] {
    width: 100%;
  }
}

/* ============================================================
   Notifications — /notifications, /notifications/preferences
   ============================================================ */
.torrec-notif-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.torrec-notif-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .9rem 1rem;
  border: 1px solid var(--torrec-border);
  border-radius: var(--torrec-radius);
  background: var(--torrec-surface);
}

.torrec-notif-item--unread {
  background: color-mix(in srgb, var(--torrec-teal) 6%, var(--torrec-surface));
  border-color: color-mix(in srgb, var(--torrec-teal) 30%, var(--torrec-border));
}

.torrec-notif-item__dot {
  flex: none;
  width: .5rem;
  height: .5rem;
  margin-top: .4rem;
  border-radius: 50%;
  background: var(--torrec-teal);
}

.torrec-notif-item__dot--hidden {
  visibility: hidden;
}

.torrec-notif-item__body {
  flex: 1 1 auto;
  min-width: 0;
}

.torrec-notif-item__title {
  font-weight: 600;
  margin-bottom: .15rem;
}

.torrec-notif-item__text {
  color: var(--torrec-text-muted);
  margin-bottom: .35rem;
}

.torrec-notif-item__meta {
  font-size: .8rem;
  color: var(--torrec-text-muted);
}

.torrec-notif-item__actions {
  flex: none;
  display: flex;
  gap: .35rem;
}

.torrec-notif-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--torrec-text-muted);
}

.torrec-notif-pager__summary {
  padding: .5rem 1rem 0;
  margin: 0;
  font-size: .8rem;
  color: var(--torrec-text-muted);
}

.torrec-notif-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  padding: 1rem;
}

.torrec-notif-pager__page {
  font-size: .85rem;
  color: var(--torrec-text-muted);
}

.torrec-notif-prefs-table {
  width: 100%;
  border-collapse: collapse;
}

.torrec-notif-prefs-table th,
.torrec-notif-prefs-table td {
  padding: .6rem .75rem;
  border-bottom: 1px solid var(--torrec-border);
  text-align: center;
}

.torrec-notif-prefs-table th:first-child,
.torrec-notif-prefs-table td:first-child {
  text-align: left;
}

.torrec-notif-prefs-table .torrec-notif-prefs-comingsoon {
  font-size: .75rem;
  color: var(--torrec-text-muted);
}

.torrec-committee-roster__row {
  display: flex;
  justify-content: space-between;
  padding: .5rem 0;
  border-bottom: 1px solid var(--torrec-border);
}

.torrec-committee-selected {
  background-color: rgba(var(--torrec-teal-rgb), .18) !important;
}

/* -------------------------------------------------------------------------
   Committee pages
   ------------------------------------------------------------------------- */
.torrec-committee-page {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

main:has(.torrec-committee-page)::before {
  height: 240px;
}

/* The hero band, its metric tiles, the panel surface and the panel head are now the
   shared .torrec-hero / .torrec-metric(--lg) / .torrec-panel / .torrec-section-head
   primitives, applied in the three Committee views. This was a complete private copy
   of that vocabulary — the fourth in this file — and reconciling it is step zero of
   portal_design_system.md §3. What stays below is genuinely Committee-specific: the
   digest's two-column layout, the roster rows, and the dual-listbox picker. */
.torrec-committee-panel {
  padding: 1.35rem;
}

.torrec-committee-panel__actions {
  justify-content: flex-end;
  margin-top: 1rem;
}

.torrec-committee-table-wrap {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--torrec-border);
}

.torrec-committee-table thead th {
  background: var(--torrec-surface-2);
  text-transform: uppercase;
  font-size: .74rem;
  letter-spacing: .08em;
}

.torrec-committee-table tbody tr:hover {
  background: color-mix(in srgb, rgba(var(--torrec-teal-rgb), .07) 75%, transparent);
}

.torrec-committee-empty {
  padding: 2.5rem 1rem;
}

.torrec-committee-roster {
  margin: 0;
}

.torrec-committee-roster--compact {
  display: grid;
  gap: .7rem;
}

.torrec-committee-roster__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .85rem 0;
  border-bottom: 1px solid var(--torrec-border);
}

.torrec-committee-roster__row:last-child {
  border-bottom: 0;
}

.torrec-committee-roster__identity {
  display: flex;
  align-items: center;
  gap: .85rem;
  min-width: 0;
}

.torrec-committee-roster__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--torrec-teal), var(--torrec-terracotta));
  color: #fff;
  font-weight: 800;
  flex-shrink: 0;
}

.torrec-committee-roster__name {
  display: block;
  font-weight: 700;
}

.torrec-committee-roster__unit {
  display: block;
  color: var(--torrec-text-muted);
  font-size: .92rem;
}

.torrec-committee-digest__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, .95fr);
  gap: 1rem;
  align-items: start;
}

.torrec-committee-stack {
  display: grid;
  gap: 1rem;
}

.torrec-committee-digest__links,
.torrec-committee-digest__links-card {
  display: grid;
  gap: .75rem;
}

.torrec-navcard--committee {
  align-items: center;
}

.torrec-committee-picker {
  height: 100%;
  padding: 1rem;
  border-radius: calc(var(--torrec-radius) + 2px);
  border: 1px solid var(--torrec-border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-surface) 88%, var(--torrec-surface-2) 12%), var(--torrec-surface));
}

.torrec-committee-picker--accent {
  border-color: color-mix(in srgb, var(--torrec-teal) 35%, var(--torrec-border));
  box-shadow: inset 0 1px 0 rgba(var(--torrec-teal-rgb), .06);
}

.torrec-committee-picker__search {
  width: 100%;
  margin-bottom: .75rem;
}

.torrec-committee-hidden {
  display: none !important;
}

.torrec-committee-search-results {
  list-style: none;
  margin: 0 0 .5rem;
  padding: 0;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--torrec-border);
  border-radius: var(--torrec-radius);
}

.torrec-committee-search-results__item {
  padding: .6rem .85rem;
  cursor: pointer;
  border-bottom: 1px solid var(--torrec-border);
}

.torrec-committee-search-results__item:last-child {
  border-bottom: 0;
}

.torrec-committee-search-results__item:hover {
  background: color-mix(in srgb, rgba(var(--torrec-teal-rgb), .12) 75%, transparent);
}

.torrec-committee-manage__form {
  display: grid;
  gap: 1.15rem;
}

.torrec-committee-manage-page__actions {
  display: flex;
  justify-content: flex-end;
  gap: .75rem;
  flex-wrap: wrap;
}

@media (max-width: 992px) {
  .torrec-committee-digest__layout {
    grid-template-columns: 1fr;
  }

  .torrec-committee-roster__row {
    align-items: flex-start;
  }
}

@media (max-width: 768px) {
  main:has(.torrec-committee-page)::before {
    height: 180px;
  }

  .torrec-committee-panel,
  .torrec-committee-picker {
    padding: 1rem;
  }

  .torrec-committee-roster__row {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==========================================================================
   FOCUS + MOTION  (premium + motion pass, docs/premium_motion_sprint_log.md)
   --------------------------------------------------------------------------
   Last in the file on purpose: these are cross-cutting states layered on top
   of every component above.

   Motion rules: it explains, it doesn't decorate. 120-220ms for feedback,
   <= 320ms for entrances, ease-out (--torrec-ease-out), never linear or
   elastic, 4-12px of travel, 0.97-0.98 press scale. Only opacity and transform
   are animated (plus colour on a handful of single elements). EVERY keyframe
   animation lives inside `prefers-reduced-motion: no-preference`, so a user
   who asked for less motion gets none of it, and the final state is always
   the element's normal style (fill-mode backwards, never forwards: a leftover
   transform would make the element a containing block for fixed children).
   ========================================================================== */

/* ---- Focus rings ----------------------------------------------------------
   One visible ring for every keyboard-reachable control that does not already
   draw its own. :focus-visible only, so a mouse click never shows it. */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible,
.torrec-sidebar__item:focus-visible,
.torrec-banner__item:focus-visible,
.torrec-navcard:focus-visible,
.torrec-navtoggle:focus-visible,
.torrec-navdrawer__close:focus-visible {
  outline: var(--torrec-focus-ring);
  outline-offset: var(--torrec-focus-offset);
}
/* Menu items show focus as their highlighted row (set in "Table system"). */
.torrec-rowmenu__item:focus-visible { outline: none; }

/* ---- Hover lift for cards that ARE links ----------------------------------
   A tile that navigates rises 2px and gains one elevation step; pressing it
   settles it back. Cards that are not links never move. */
a.torrec-stat,
a.torrec-navcard,
a.torrec-metric,
a.torrec-panel {
  transition: transform var(--torrec-dur-base) var(--torrec-ease-out),
              box-shadow var(--torrec-dur-base) var(--torrec-ease-out),
              border-color var(--torrec-dur-base) var(--torrec-ease-out);
}
a.torrec-stat:hover,
a.torrec-navcard:hover,
a.torrec-metric:hover,
a.torrec-panel:hover {
  transform: translateY(-2px);
  box-shadow: var(--torrec-elev-2);
}
a.torrec-stat:active,
a.torrec-navcard:active,
a.torrec-metric:active,
a.torrec-panel:active {
  transform: translateY(0) scale(.99);
  transition-duration: var(--torrec-dur-fast);
}

/* ---- Keyframes -------------------------------------------------------------- */
@keyframes torrec-rise {
  from { opacity: 0; transform: translateY(14px); }
}
@keyframes torrec-fade {
  from { opacity: 0; }
}
@keyframes torrec-pop {
  from { opacity: 0; transform: scale(.96); }
}
@keyframes torrec-indicator {
  from { border-left-color: transparent; background-color: transparent; }
}

@media (prefers-reduced-motion: no-preference) {
  /* No page-enter motion (owner, 2026-11-13). The whole-page stagger (main >
     blocks rising from opacity 0) and the cross-document View Transition both
     left the content column blank for a few frames on EVERY navigation: a blink
     between pages. Pages now paint at once; Chrome's paint holding keeps the old
     page up until the new one is ready. Don't bring either back without
     recording a page change frame by frame first. */
  /* Kept from the View Transition days: the header sits above the content
     column so the user-menu dropdown is never painted under <main>'s panels. */
  .torrec-navbar  { position: relative; z-index: 1030; }

  /* Bootstrap buttons: the same quick press the EJ2 buttons and icon buttons
     already have, so every button on a page answers a click the same way. */
  .btn {
    transition: color .15s ease-in-out, background-color .15s ease-in-out,
                border-color .15s ease-in-out, box-shadow .15s ease-in-out,
                transform var(--torrec-dur-fast) var(--torrec-ease-out);
  }
  .btn:not(:disabled):not(.disabled):active { transform: scale(.97); }

  /* Server-rendered alerts arrive with the page: slide + fade in. */
  .torrec-alert {
    animation: torrec-rise var(--torrec-dur-base) var(--torrec-ease-out) backwards;
  }

  /* Sign-in: the card rises into place and the logo settles a beat later. The
     first thing anyone sees, so it gets the full 320ms entrance and no more. */
  .torrec-auth-card {
    animation: torrec-rise 320ms var(--torrec-ease-out) backwards;
  }
  .torrec-auth-brand .torrec-brand__icon {
    animation: torrec-pop 320ms var(--torrec-ease-out) 60ms backwards;
  }

  /* Row overflow menu: scales up from its trigger's corner. */
  .torrec-rowmenu__menu.is-open {
    animation: torrec-pop var(--torrec-dur-base) var(--torrec-ease-out);
  }

  /* Sidebar / banner: the active item's accent draws in on arrival. */
  .torrec-sidebar__item.active {
    animation: torrec-indicator 220ms var(--torrec-ease-out);
  }

  /* The off-canvas drawer and its scrim already slide/fade (drawer block);
     give them the shared curve instead of the generic `ease`. */
  .torrec-sidebar,
  .torrec-banner,
  .torrec-navscrim {
    transition-timing-function: var(--torrec-ease-out);
  }
}

/* Reduced motion: nothing above runs (it is all inside no-preference), and
   the transform-based hover/press feedback flattens to colour-only. */
@media (prefers-reduced-motion: reduce) {
  a.torrec-stat,
  a.torrec-navcard,
  a.torrec-metric,
  a.torrec-panel,
  .torrec-iconbtn,
  .e-btn,
  .e-css.e-btn {
    transition-property: background-color, border-color, color;
  }
  a.torrec-stat:hover,
  a.torrec-navcard:hover,
  a.torrec-metric:hover,
  a.torrec-panel:hover,
  a.torrec-stat:active,
  a.torrec-navcard:active,
  a.torrec-metric:active,
  a.torrec-panel:active,
  .torrec-iconbtn:active,
  .e-btn:not(:disabled):active,
  .e-css.e-btn:not(:disabled):active {
    transform: none;
  }
}

/* ==========================================================================
   CARD PAYMENTS + AUTOPAY (docs/plans/stripe_payments_build_plan.md)
   Resident: the statement's card option, the return page, "Pago automático".
   Admin: /settings/online-payments, the Cobranza card tabs. Platform: /platform/cards.
   Built on the shared primitives (panel, hero, metric, status) and tokens only,
   so dark mode follows the theme with no page-specific overrides.
   ========================================================================== */

/* ---- Two-column split used by the autopay and online-payments pages ------ */
.torrec-autopay-page__split,
.torrec-online-payments__split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: 1rem;
  align-items: start;
}

/* ---- Definition-list facts (amount, attempts, dates) --------------------- */
.torrec-autopay-page__facts,
.torrec-online-payments__facts,
.torrec-card-return__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .6rem;
  margin: 0;
}
.torrec-autopay-page__facts > div,
.torrec-online-payments__facts > div,
.torrec-card-return__facts > div {
  padding: .65rem .75rem;
  border: 1px solid color-mix(in srgb, var(--torrec-border) 82%, transparent);
  border-radius: var(--torrec-radius-sm);
  background: color-mix(in srgb, var(--torrec-surface-2) 55%, var(--torrec-surface));
}
.torrec-autopay-page__facts dt,
.torrec-online-payments__facts dt,
.torrec-card-return__facts dt {
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--torrec-text-muted);
  font-weight: 700;
}
.torrec-autopay-page__facts dd,
.torrec-online-payments__facts dd,
.torrec-card-return__facts dd {
  margin: .2rem 0 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--torrec-text);
}

/* ---- The saved card: a small, quiet card visual -------------------------- */
.torrec-paycard {
  --torrec-paycard-a: #363431;
  --torrec-paycard-b: #4A4541;
  position: relative;
  max-width: 340px;
  aspect-ratio: 1.586;
  padding: 1.1rem 1.2rem;
  border-radius: 16px;
  color: #fff;
  background:
    radial-gradient(circle at 85% 15%, rgba(255, 255, 255, .18), transparent 40%),
    linear-gradient(135deg, var(--torrec-paycard-a), var(--torrec-paycard-b));
  box-shadow: var(--torrec-elev-2);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.torrec-paycard::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -60px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .06);
}
.torrec-paycard--visa { --torrec-paycard-a: #1a2b6d; --torrec-paycard-b: #2f56c9; }
.torrec-paycard--mastercard { --torrec-paycard-a: #3a1f12; --torrec-paycard-b: #c65d3b; }
.torrec-paycard--amex { --torrec-paycard-a: #282624; --torrec-paycard-b: #2f8f6b; }
.torrec-paycard__top { display: flex; justify-content: space-between; align-items: center; }
.torrec-paycard__chip {
  width: 38px;
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(135deg, #e9d48c, #b8963c);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15);
}
.torrec-paycard__brand {
  font-family: var(--torrec-font-display);
  font-weight: 800;
  letter-spacing: .02em;
  font-size: 1.05rem;
}
.torrec-paycard__number {
  font-family: var(--torrec-font-display);
  font-size: 1.25rem;
  letter-spacing: .14em;
  font-variant-numeric: tabular-nums;
}
.torrec-paycard__bottom {
  display: flex;
  justify-content: space-between;
  font-size: .78rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .9;
}

/* ---- Blockers, terms, consent ------------------------------------------- */
.torrec-autopay-page__blockers,
.torrec-online-payments__checks,
.torrec-online-payments__know,
.torrec-cardlist-alerts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .7rem;
}
.torrec-autopay-page__blockers li,
.torrec-online-payments__know li {
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr);
  gap: .6rem;
  align-items: start;
}
.torrec-autopay-page__blockers li > i,
.torrec-online-payments__know li > i {
  font-size: 1.15rem;
  color: var(--torrec-teal);
  line-height: 1.4;
}
.torrec-autopay-page__blockers li {
  padding: .8rem .9rem;
  border: 1px solid color-mix(in srgb, var(--torrec-warning) 30%, var(--torrec-border));
  border-radius: var(--torrec-radius-sm);
  background: color-mix(in srgb, var(--torrec-warning) 7%, var(--torrec-surface));
}
.torrec-autopay-page__blockers li > i { color: var(--torrec-warning); }
.torrec-autopay-page__terms {
  margin: 0 0 1rem;
  padding-left: 1.15rem;
  display: grid;
  gap: .45rem;
  line-height: 1.5;
}
.torrec-autopay-page__terms li::marker { color: var(--torrec-teal); }
.torrec-autopay-page__consent {
  padding-top: .9rem;
  border-top: 1px dashed color-mix(in srgb, var(--torrec-border) 90%, transparent);
}
.torrec-autopay-page__check {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  font-weight: 600;
  margin-bottom: .45rem;
  cursor: pointer;
}
.torrec-autopay-page__check input { margin-top: .25rem; width: 1.05rem; height: 1.05rem; accent-color: var(--torrec-teal); }
.torrec-autopay-page__danger,
.torrec-online-payments__danger { color: var(--torrec-error) !important; }

/* ---- The month, as a timeline -------------------------------------------- */
.torrec-autopay-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .8rem;
  counter-reset: none;
}
.torrec-autopay-timeline li {
  position: relative;
  display: grid;
  gap: .35rem;
  padding: .85rem .9rem .9rem;
  border-radius: var(--torrec-radius-sm);
  border: 1px solid color-mix(in srgb, var(--torrec-border) 80%, var(--torrec-teal) 20%);
  background: linear-gradient(180deg, rgba(var(--torrec-teal-rgb), .06), transparent 70%);
  line-height: 1.45;
  font-size: var(--torrec-text-sm);
}
.torrec-autopay-timeline li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 1.35rem;
  right: -.8rem;
  width: .8rem;
  height: 2px;
  background: color-mix(in srgb, var(--torrec-teal) 50%, transparent);
}
.torrec-autopay-timeline__day {
  font-family: var(--torrec-font-display);
  font-weight: 800;
  color: var(--torrec-teal);
  letter-spacing: -.01em;
}
.torrec-autopay-timeline__end {
  border-color: color-mix(in srgb, var(--torrec-warning) 40%, var(--torrec-border)) !important;
  background: linear-gradient(180deg, color-mix(in srgb, var(--torrec-warning) 10%, transparent), transparent 70%) !important;
}
.torrec-autopay-timeline__end .torrec-autopay-timeline__day { color: color-mix(in srgb, var(--torrec-warning) 75%, var(--torrec-text)); }

/* ---- Online payments: steps and readiness checks ------------------------- */
.torrec-online-payments__steps {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  gap: .55rem;
  counter-reset: torrec-step;
}
.torrec-online-payments__steps li {
  counter-increment: torrec-step;
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  column-gap: .7rem;
  align-items: center;
}
.torrec-online-payments__steps li::before {
  content: counter(torrec-step);
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: rgba(var(--torrec-teal-rgb), .12);
  color: var(--torrec-teal);
  font-weight: 800;
}
.torrec-online-payments__steps span { color: var(--torrec-text-muted); font-size: var(--torrec-text-sm); }
.torrec-online-payments__checks li {
  display: flex;
  gap: .55rem;
  align-items: flex-start;
  line-height: 1.45;
}
.torrec-online-payments__checks li.is-ok i { color: var(--torrec-success); }
.torrec-online-payments__checks li.is-no i { color: var(--torrec-warning); }
.torrec-online-payments__checks { margin-bottom: .9rem; }

/* ---- Card payments list: alert rows -------------------------------------- */
.torrec-cardlist-alerts li {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .8rem;
  align-items: baseline;
  padding: .7rem .85rem;
  border-radius: var(--torrec-radius-sm);
  background: color-mix(in srgb, var(--torrec-surface) 80%, transparent);
  border: 1px solid color-mix(in srgb, var(--torrec-border) 85%, transparent);
}

/* ---- Statement dialog: the card option ----------------------------------- */
.torrec-card-pay__note {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  padding: .7rem .8rem;
  border-radius: var(--torrec-radius-sm);
  background: rgba(var(--torrec-teal-rgb), .07);
  border: 1px solid rgba(var(--torrec-teal-rgb), .22);
  font-size: var(--torrec-text-sm);
  line-height: 1.45;
}
.torrec-card-pay__note i { color: var(--torrec-teal); font-size: 1.1rem; }
.torrec-card-pay { margin-top: .4rem; }

/* ---- Return page ---------------------------------------------------------- */
.torrec-card-return {
  display: grid;
  place-items: center;
  padding: 1.5rem 0 2.5rem;
}
.torrec-card-return__panel {
  width: min(560px, 100%);
  text-align: center;
  padding: 2rem 1.6rem 1.6rem;
}
.torrec-card-return__icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto .9rem;
  border-radius: 50%;
  font-size: 2rem;
  background: rgba(var(--torrec-teal-rgb), .1);
  color: var(--torrec-teal);
}
.torrec-card-return[data-state="Paid"] .torrec-card-return__icon { background: color-mix(in srgb, var(--torrec-success) 14%, transparent); color: var(--torrec-success); }
.torrec-card-return[data-state="Released"] .torrec-card-return__icon { background: var(--torrec-surface-2); color: var(--torrec-text-muted); }
.torrec-card-return[data-state="NeedsReview"] .torrec-card-return__icon { background: color-mix(in srgb, var(--torrec-warning) 16%, transparent); color: var(--torrec-warning); }
.torrec-card-return__spinner {
  display: inline-block;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid rgba(var(--torrec-teal-rgb), .25);
  border-top-color: var(--torrec-teal);
  animation: torrec-card-spin .9s linear infinite;
}
@keyframes torrec-card-spin { to { transform: rotate(360deg); } }
.torrec-card-return__title {
  font-size: var(--torrec-text-xl);
  letter-spacing: var(--torrec-tracking-display);
  margin: .2rem 0 .5rem;
}
.torrec-card-return__lead { color: var(--torrec-text-muted); line-height: 1.55; margin: 0 auto 1.1rem; max-width: 44ch; }
.torrec-card-return__facts { text-align: left; margin-bottom: 1rem; }
.torrec-card-return .torrec-hero__actions { justify-content: center; }
.torrec-card-return__note { margin: 1rem 0 0; }
@media (prefers-reduced-motion: reduce) {
  .torrec-card-return__spinner { animation-duration: 2.4s; }
}

/* ---- Settings: the link card to online payments -------------------------- */
.torrec-settings-page__link-card {
  display: flex;
  gap: .9rem;
  align-items: center;
  margin-bottom: 1rem;
  color: var(--torrec-text);
  text-decoration: none;
}
.torrec-settings-page__link-card > i:first-child { font-size: 1.5rem; color: var(--torrec-teal); }
.torrec-settings-page__link-card:hover { color: var(--torrec-text); box-shadow: var(--torrec-elev-2); }

/* ---- Responsive steps ------------------------------------------------------ */
@media (max-width: 900px) {
  .torrec-autopay-page__split,
  .torrec-online-payments__split { grid-template-columns: minmax(0, 1fr); }
  .torrec-autopay-timeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .torrec-autopay-timeline li:not(:last-child)::after { display: none; }
}
@media (max-width: 520px) {
  .torrec-autopay-timeline { grid-template-columns: minmax(0, 1fr); }
  .torrec-paycard { max-width: 100%; }
}

/* Bootstrap's .text-muted is a fixed dark grey (rgba(33,37,41,.75)) that this theme never re-maps (the app switches
   themes with data-theme, not data-bs-theme), so in dark mode it all but disappears. Re-map it app-wide. */
.text-muted { color: var(--torrec-text-muted) !important; }

/* On a phone the card pages' tables (recent charges, admin lists) used to set the page's minimum width and push the
   whole layout ~12px past the viewport. Let the cells wrap and tighten them instead of scrolling the page. */
@media (max-width: 575px) {
    .torrec-cards-scope .torrec-table th,
    .torrec-cards-scope .torrec-table td { white-space: normal; padding-left: .5rem; padding-right: .5rem; }
}
