/*
 * Auth shell — shared styles for authenticated app pages (admin, lists, etc.).
 *
 * Body is the full-bleed canvas: a single solid color (--canvas), with no
 * gradient, atmospheric wash or line pattern layered on it. Inside: fixed navbar
 * at top, glass sidebar at left, a workspace card holds the main content.
 *
 * Brand colors come from BrandingExtension (--color-*).
 * UI surface tokens come from theme-tokens.css (--frame, --surface, etc.).
 */

.auth-shell {
    --auth-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    /* Shared by the table header row and the current page in the pager, which must
       read as the same surface. One token so they cannot drift apart.
       The ink is --text at 80% alpha rather than full strength: pure --text (#101722)
       is heavier than this surface needs, and letting the header tint show through
       softens it without inventing a fixed grey. A flat #777 was the first idea and
       fails AA outright (2.47:1 light, 1.82:1 dark); at 80% it clears with room
       (6.47:1 and 5.65:1) because the alpha composites over the header tint, not
       over the page. */
    --table-header-bg: color-mix(in srgb, var(--color-primary) 50%, var(--frame));
    --table-header-text: color-mix(in srgb, var(--text) 80%, transparent);
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    /* --color-canvas is the optional flat background from SystemPreference
       (brand_canvas), scoped by BrandingExtension to [data-theme="light"] and only
       emitted when the field holds a valid hex. So an empty field — and the dark
       theme always — leaves this var undefined and the fallback takes over:
       --canvas, the 10% tint derived from --color-primary. */
    background: var(--color-canvas, var(--canvas));
    font-family: var(--auth-font);
    -webkit-font-smoothing: antialiased;
    transition: background 180ms ease, color 180ms ease;
}

/* Form controls (select, input, textarea, button) on Linux Chrome
   default to Roboto via the user-agent stylesheet rather than inheriting
   from the page. Force them to follow the auth-font so the system stays
   on Inter end-to-end (DESIGN.md: Inter is the workhorse, no second
   humanist sans competing for the same role). */
.auth-shell select,
.auth-shell input,
.auth-shell textarea,
.auth-shell button,
.auth-shell optgroup,
.auth-shell option {
    font-family: inherit;
}

/* Native <select> popup options inherit the listbox surface color from
 * the user-agent stylesheet. With color-scheme: dark Chrome paints them
 * dark, but Linux/Firefox renderers can still fall back to a system-light
 * background. Force themed surface explicitly so option text stays
 * legible when the dropdown opens. Applies on both shells (auth-shell
 * for logged-in pages and shell for public pages like /register/). */
.auth-shell option,
.auth-shell optgroup,
.shell option,
.shell optgroup {
    background-color: var(--frame-2);
    color: var(--text);
}

/* No decorative layers on the body. The atmospheric radial wash (::before) and
 * the 44px vertical line pattern (::after) were removed on purpose: the
 * authenticated canvas is one solid color, so color comes from the surfaces
 * (navbar, workspace card) and from brand accents, never from the backdrop. */

/* Navbar. Chrome surface, not a banner. The diagonal violet→coral 3-stop
 * gradient was painting brand color across the top edge AND blending with
 * the body's top-left radial through backdrop-filter, creating two violets at
 * different alphas at the navbar/body seam. Now a calm vertical glass surface;
 * brand color reaches the navbar via the brand-title block, nav-pill icons,
 * and the active-menu rail elsewhere — not the background. */
.auth-shell__navbar {
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, var(--surface-strong), var(--surface));
    backdrop-filter: blur(20px) saturate(1.1);
    -webkit-backdrop-filter: blur(20px) saturate(1.1);
}

[data-theme="light"] .auth-shell__navbar {
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.74),
        rgba(255, 255, 255, 0.5));
}

/* Brand block. Mirrors the public shell_topbar pattern (siteTitle + optional
 * siteSubtitle, dual light/dark logos) so the navbar identity stays in sync
 * with login and landing surfaces. */
.auth-shell__brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    text-decoration: none;
}

.auth-shell__brand:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
    border-radius: 10px;
}

.auth-shell__brand-logo {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
}

.auth-shell__brand-logo-img {
    display: block;
    /* A fixed height, not max-height: an SVG without width/height
       attributes has no intrinsic size and would collapse to 0x0. */
    height: 40px;
    width: auto;
    object-fit: contain;
}

.auth-shell__brand-logo-img--dark {
    display: none;
}

[data-theme="dark"] .auth-shell__brand-logo-img--light {
    display: none;
}

[data-theme="dark"] .auth-shell__brand-logo-img--dark {
    display: block;
}

.auth-shell__brand-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
    line-height: 1;
}

.auth-shell__brand-title {
    overflow: hidden;
    color: var(--text);
    font-size: 16px;
    font-weight: 850;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-shell__brand-subtitle {
    color: var(--muted);
    font-size: 11px;
    font-weight: 760;
    letter-spacing: 0.08em;
    line-height: 1.1;
    text-transform: uppercase;
}

/* Generic 38×38 icon-only button. Default radius is 10px to match the mobile
 * drawer toggle's structural-utility feel. The `--round` modifier upgrades the
 * shape to a full circle for navbar action chips that should read as personal,
 * tap-target affordances (account avatar trigger). Both variants share every
 * other property so they stay one component, two shapes. */
.auth-shell__icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text-soft);
    cursor: pointer;
    transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.auth-shell__icon-button--round {
    border-radius: 999px;
}

.auth-shell__icon-button:hover {
    border-color: var(--line-strong);
    background: var(--surface-strong);
    color: var(--text);
}

.auth-shell__icon-button:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

/* This file loads after Tailwind utilities, so the base `display: inline-flex`
 * above otherwise wins over `md:hidden` at the same specificity. The mobile
 * drawer toggle relies on `md:hidden` to disappear on desktop — re-assert it. */
@media (min-width: 768px) {
    .auth-shell__icon-button.md\:hidden {
        display: none;
    }
}

/* Navbar dropdowns (sponsor selector, system menu, user menu).
 * Trigger button + glass dropdown panel + token-driven items. Replaces the
 * legacy Tailwind grays that rendered invisible on the dark frame. */
.auth-shell__dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.auth-shell__dropdown-trigger:hover {
    background: var(--surface-strong);
    border-color: var(--line-strong);
    color: var(--text);
}

.auth-shell__dropdown-trigger:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

[data-theme="light"] .auth-shell__dropdown-trigger {
    background: rgba(255, 255, 255, 0.56);
    color: var(--text);
}

.auth-shell__dropdown-trigger-icon {
    color: var(--color-primary);
}

.auth-shell__dropdown-chevron {
    color: var(--muted);
}

.auth-shell__dropdown-panel {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: color-mix(in srgb, var(--frame) 92%, transparent);
    box-shadow:
        0 18px 44px color-mix(in srgb, var(--color-primary) 14%, rgba(0, 0, 0, 0.32)),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Confirm / prompt dialog, built in JS by flowbite_confirm_controller.js and
   therefore out of reach of the form theme. It used to paint itself with literal
   Tailwind (dark:bg-gray-700, no border, no backdrop-filter, 8px radius), which
   put a cold blue-grey box on top of a frame mixed from the sponsor's brand --
   and it shows on every delete confirmation in the application. Same surface
   treatment as __dropdown-panel above. LAR-443. */
.auth-shell__dialog-backdrop {
    background: color-mix(in srgb, var(--frame) 72%, rgba(0, 0, 0, 0.55));
}

.auth-shell__dialog {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: color-mix(in srgb, var(--frame) 92%, transparent);
    box-shadow:
        0 24px 60px color-mix(in srgb, var(--color-primary) 16%, rgba(0, 0, 0, 0.42)),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.auth-shell__dialog-title {
    color: var(--text);
    font-size: 17px;
    font-weight: 850;
}

.auth-shell__dialog-message {
    color: var(--text-soft);
    font-size: 14px;
    line-height: 1.55;
}

.auth-shell__dialog-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--text-soft);
    cursor: pointer;
    transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

.auth-shell__dialog-close:hover {
    background: var(--surface);
    border-color: var(--line);
    color: var(--text);
}

.auth-shell__dialog-error {
    color: var(--color-danger);
    font-size: 13px;
}

/* Separators for a dialog that carries a header and a footer -- the plan detail modal
   in medical-plan_controller.js, which had no dark variant at all and rendered as a
   white box on the dark theme. LAR-443. */
.auth-shell__dialog-header {
    border-bottom: 1px solid var(--line);
}

.auth-shell__dialog-footer {
    border-top: 1px solid var(--line);
}

/* Toasts, built in JS by flowbite_toast_controller.js. Same story as the dialog:
   the surface was dark:bg-gray-800 and the four states were bound to Tailwind's
   own green/red/yellow/blue rather than the semantic tokens. The states were at
   least the right hue -- unlike the badges -- but off the palette. LAR-443. */
.auth-shell__toast {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: color-mix(in srgb, var(--frame) 94%, transparent);
    color: var(--text-soft);
    box-shadow:
        0 18px 44px color-mix(in srgb, var(--color-primary) 12%, rgba(0, 0, 0, 0.34)),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.auth-shell__toast-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--text-soft);
    cursor: pointer;
    transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

.auth-shell__toast-close:hover {
    background: var(--surface);
    border-color: var(--line);
    color: var(--text);
}

.auth-shell__toast-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 10px;
}

.auth-shell__toast-icon--success { background: color-mix(in srgb, var(--color-success) 18%, transparent); color: var(--color-success); }
.auth-shell__toast-icon--danger  { background: color-mix(in srgb, var(--color-danger)  18%, transparent); color: var(--color-danger);  }
.auth-shell__toast-icon--warning { background: color-mix(in srgb, var(--color-warning) 18%, transparent); color: var(--color-warning); }
.auth-shell__toast-icon--info    { background: color-mix(in srgb, var(--color-info)    18%, transparent); color: var(--color-info);    }

/* The timer is a solid fill, so it takes the -strong siblings. */
.auth-shell__toast-timer--success { background: var(--color-success-strong); }
.auth-shell__toast-timer--danger  { background: var(--color-danger-strong);  }
.auth-shell__toast-timer--warning { background: var(--color-warning-strong); }
.auth-shell__toast-timer--info    { background: var(--color-info-strong);    }

[data-theme="light"] .auth-shell__dropdown-panel {
    background: rgba(255, 255, 255, 0.94);
    box-shadow:
        0 18px 38px color-mix(in srgb, var(--color-primary) 18%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.auth-shell__dropdown-item {
    display: block;
    padding: 10px 14px;
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 760;
    line-height: 1.3;
    text-decoration: none;
    transition: background-color 140ms ease, color 140ms ease;
}

.auth-shell__dropdown-item:hover {
    background: color-mix(in srgb, var(--color-primary) 10%, transparent);
    color: var(--text);
}

.auth-shell__dropdown-item-icon {
    flex: 0 0 auto;
    color: var(--color-primary);
}

.auth-shell__dropdown-header {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
}

.auth-shell__dropdown-header-name {
    color: var(--text);
    font-size: 13px;
    font-weight: 850;
    line-height: 1.3;
}

.auth-shell__dropdown-header-email {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
}

/* Dashboard variant of the workspace. The list/form variants are about a
 * single dense surface; the dashboard hosts multiple data-viz panels arranged
 * in an interior grid. The outer workspace gives the page its frame; the
 * inner panels carry the charts. */
.auth-shell__workspace--dashboard {
    padding: clamp(20px, 2.6vw, 32px);
    display: grid;
    gap: clamp(20px, 2.4vw, 28px);
}

.auth-shell__dashboard-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.auth-shell__dashboard-toolbar-label {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 760;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
}

/* Dashboard btn-primary: in-product primary spec (no halo ring, smaller
 * shadow), same as the form variant. The 6px halo + CTA-scale shadow stack
 * belongs on auth/landing surfaces, not on a "refresh" action inline with
 * a date input. */
.auth-shell__workspace--dashboard .btn-primary {
    background: linear-gradient(135deg,
        var(--color-primary),
        color-mix(in srgb, var(--color-primary) 88%, var(--frame)));
    border-color: color-mix(in srgb, var(--color-primary) 36%, transparent);
    box-shadow:
        0 10px 24px color-mix(in srgb, var(--color-primary) 16%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.auth-shell__workspace--dashboard .btn-primary:hover {
    transform: none;
    box-shadow:
        0 12px 28px color-mix(in srgb, var(--color-primary) 22%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.auth-shell__dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: clamp(16px, 1.8vw, 22px);
}

.auth-shell__dashboard-panel {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 16px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: color-mix(in srgb, var(--surface) 70%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

[data-theme="light"] .auth-shell__dashboard-panel {
    background: rgba(255, 255, 255, 0.62);
}

.auth-shell__dashboard-panel-title {
    margin: 0;
    color: var(--text);
    font-size: 14px;
    font-weight: 850;
    letter-spacing: 0.02em;
    line-height: 1.2;
}

.auth-shell__dashboard-panel-body {
    position: relative;
    min-height: 240px;
}

.auth-shell__dashboard-panel-body canvas {
    max-width: 100%;
    height: auto !important;
}

.auth-shell__dashboard-panel-empty {
    margin: 0;
    padding: 24px 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

/* Top-right nav pills */
.auth-shell__nav-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text-soft);
    background: var(--surface);
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.auth-shell__nav-pill:hover {
    background: var(--surface-strong);
    border-color: var(--line-strong);
    color: var(--text);
}

[data-theme="light"] .auth-shell__nav-pill {
    background: rgba(255, 255, 255, 0.56);
    color: var(--text);
}

.auth-shell__nav-pill .ux-icon,
.auth-shell__nav-pill svg {
    color: var(--color-primary);
}

.auth-shell__theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--surface-strong);
    color: var(--text);
    cursor: pointer;
    transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.auth-shell__theme-toggle svg {
    stroke-width: 1.75;
}

.auth-shell__login-link {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.auth-shell__login-link:hover {
    background: var(--surface-strong);
    border-color: var(--line-strong);
    color: var(--color-primary);
}

.auth-shell__login-link:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}

.auth-shell__theme-toggle:hover {
    border-color: var(--line-strong);
    background: var(--surface-strong);
    color: var(--color-primary);
    transform: translateY(-1px);
}

[data-theme="light"] .auth-shell__theme-toggle {
    background: rgba(255, 255, 255, 0.56);
}

/* Sidebar */
.auth-shell__sidebar {
    border-right: 1px solid var(--line);
    background: linear-gradient(180deg, var(--surface-strong), var(--surface));
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    color: var(--text);
}

[data-theme="light"] .auth-shell__sidebar {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.5));
}

/* Override sidebar menu items */
.auth-shell .menu-category h3 {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-shell aside#drawer-navigation a {
    min-height: 42px;
    padding: 0 12px !important;
    gap: 12px;
    border: 1px solid transparent !important;
    border-radius: 10px !important;
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 750;
    line-height: 1;
    transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

/*
 * Sidebar hover: solid background, not a translucent overlay. The sidebar is
 * a backdrop-blurred glass surface, so any rgba() hover stacks on top of
 * whatever the blur is currently showing through (workspace card, page bg).
 * That made the hover composite vary with scroll position and washed white
 * text out on lighter sections. A solid color-mix tone fixes the contrast
 * deterministically: the row always reads as a defined press surface.
 *
 * Both themes brand-tint the hover toward `--color-primary` so the press
 * surface previews the active state's color voice. Dark mode mixes the
 * brand into `--frame` (deep teal-black); light mode mixes it into the
 * cream frame. Different bases, same brand bloom.
 */
.auth-shell aside#drawer-navigation a:not(.menu-item-active):hover {
    color: var(--text);
    background: color-mix(in srgb, var(--color-primary) 14%, var(--frame));
    border-color: color-mix(in srgb, var(--color-primary) 32%, transparent) !important;
}

[data-theme="light"] .auth-shell aside#drawer-navigation a:not(.menu-item-active):hover {
    background: color-mix(in srgb, var(--color-primary) 18%, var(--frame));
    border-color: var(--line-strong) !important;
}

/* Active sidebar item: rail + background + icon all derive from --color-primary
 * for cohesion. The previous mix (rail=primary, bg=secondary, icon=secondary)
 * worked when primary/secondary harmonized in the same hue family but breaks
 * for sponsors with complementary palettes (e.g. orange primary + cyan
 * secondary). One brand voice, not two. */
.auth-shell aside#drawer-navigation a.menu-item-active,
.auth-shell .menu-item-active {
    position: relative;
    color: var(--text);
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--color-primary) 22%, transparent),
        color-mix(in srgb, var(--color-primary) 8%, transparent));
    border-color: var(--line) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 6px 18px color-mix(in srgb, var(--color-primary) 10%, transparent);
}

[data-theme="light"] .auth-shell aside#drawer-navigation a.menu-item-active,
[data-theme="light"] .auth-shell .menu-item-active {
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--color-primary) 12%, transparent),
        color-mix(in srgb, var(--color-primary) 4%, transparent));
}

/* Pending-count pill in the sidebar (e.g. "Aprobaciones 1"). It was a literal
   bg-red-500, the one Tailwind colour that survived on every screen because it
   lives in the menu. Kept as a solid attention pill -- the intent was never in
   question, only the hardcoded colour -- on --color-danger-strong, the fill
   sibling documented to clear AA under white text in both themes. LAR-443. */
.auth-shell__menu-badge {
    flex-shrink: 0;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--color-danger-strong);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.5;
}

.auth-shell aside#drawer-navigation a.menu-item-active svg,
.auth-shell .menu-item-active svg {
    color: var(--color-primary);
}

/* Active sidebar item: 4px brand-primary rail per DESIGN.md "Active Menu Rail"
 * spec — the only permitted side-stripe in the system, load-bearing as the
 * "you are here" signal. Inset top/bottom from the parent's 10px border-radius
 * so the rail sits cleanly inside; full pill radius for a finished edge. */
.auth-shell aside#drawer-navigation a.menu-item-active::before,
.auth-shell .menu-item-active::before {
    content: '';
    display: block;
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 4px;
    background: var(--color-primary);
    border-radius: 999px;
}

/* Main content + workspace.
 * The card was carrying its own radial bottom wash AND a vertical gradient
 * ending in secondary tint — three secondary washes stacked at the bottom
 * once the body's own wash was added. Now a calm glass surface; the body's
 * single radial below the card is the only chromatic atmosphere. Blur pulled
 * back from 40px (outside DESIGN.md 12-24px band) to 22px. */
.auth-shell__workspace {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: linear-gradient(180deg,
        var(--surface-strong),
        color-mix(in srgb, var(--surface) 70%, transparent));
    /* No var(--shadow) here. That token is a brand-tinted 90-110px blur offset
       34-42px down, so on a card this size it bled ~124px past the bottom edge
       and read as a colored haze leaking out of the card rather than as depth.
       The border plus the inset top highlight carry the edge instead. Other
       consumers of --shadow (flatpickr, dropdowns, admin-home) keep it: they are
       small floating surfaces where the spread stays inside its own footprint. */
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(22px) saturate(1.15);
    -webkit-backdrop-filter: blur(22px) saturate(1.15);
}

[data-theme="light"] .auth-shell__workspace {
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.66),
        rgba(255, 255, 255, 0.4));
}

/* Workspace top row (search + actions) */
.auth-shell__workspace-header {
    color: var(--text);
}

.auth-shell__search input {
    background: var(--field);
    border: 1px solid var(--line);
    color: var(--text);
}

.auth-shell__search input::placeholder {
    color: var(--muted);
}

.auth-shell__search input:focus {
    outline: none;
    border-color: var(--line-strong);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-secondary) 16%, transparent);
}

/* Table inside workspace */
.auth-shell__table-frame {
    /* Wide tables must be reachable: `overflow: hidden` here beat the
     * `overflow-x-auto` utility the templates already ask for (same specificity,
     * this file loads later), so the last columns of the transactions report —
     * "Aprobado por" and "Sincronizado" — were clipped with no way to scroll to
     * them. Keep the vertical clip so the rounded corners still crop the table. */
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    backdrop-filter: blur(12px);
}

[data-theme="light"] .auth-shell__table-frame {
    background: rgba(255, 255, 255, 0.62);
}

.auth-shell__table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    color: var(--text);
}

/* Header row: flat brand color at half strength, no gradient. The text cannot stay
   #ffffff: mixing the primary down to 50% lands on a pale tint in the light theme
   (#F7B092 with an orange brand), where white text falls to 1.81:1. The tokens on
   .auth-shell follow the theme instead — dark ink on the light tint, light ink on
   the dark one. The column separator follows the same logic: a fixed white rule was
   invisible on the light tint. */
.auth-shell__table thead th {
    height: 46px;
    padding: 0 18px;
    color: var(--table-header-text);
    background: var(--table-header-bg);
    font-weight: 900;
    text-align: left;
    text-transform: none;
    letter-spacing: 0;
}

.auth-shell__table thead th + th {
    border-left: 1px solid color-mix(in srgb, var(--text) 22%, transparent);
}

.auth-shell__table tbody td {
    height: 42px;
    padding: 12px 18px;
    border-top: 1px solid var(--line);
    color: var(--text-soft);
    font-size: 13px;
    vertical-align: middle;
}

.auth-shell__table tbody td + td {
    border-left: 1px solid var(--line);
}

/* El enlace de la primera columna que activa `page.row_link` reutiliza
   .auth-shell__row-link (definido mas abajo), la clase que ya usaban
   Aprobaciones y Cancelacion General para lo mismo. */

.auth-shell__table tbody tr {
    transition: background-color 120ms ease;
}

.auth-shell__table tbody tr:hover {
    background: var(--surface-strong);
}

/*
 * Subtotal ramp for nested aggregate tables (invoice detail, reports).
 *
 * Four escalating levels of emphasis. Built from the surface tokens so the ramp
 * stays monotonic in both themes and picks up the per-sponsor brand — the raw
 * Tailwind grays these replaced were gray-50/100/200 in light (monotonic) but
 * gray-700/600/800 in dark, where level 2 rendered LIGHTER than level 1 and the
 * hierarchy read backwards.
 *
 * The top level fills with the brand colour, so its text uses --cta-text for
 * contrast rather than a literal white.
 */
/*
 * Each level mixes progressively more brand colour into --frame. The frame is
 * opaque in both themes, so the result is deterministic: mixing in the brand
 * lightens against the dark frame and darkens against the light one, which is
 * the direction "more emphasis" needs in each theme.
 *
 * Do NOT build these from --surface / --surface-strong: those are translucent
 * (rgba white in dark, a transparent color-mix in light), and blending an opaque
 * colour into them collapses the alpha unpredictably — a first attempt that way
 * made level 3 render darker than level 1 in dark mode.
 */
.auth-shell__table tbody tr.auth-shell__table-row--sum-1 {
    background: color-mix(in srgb, var(--color-primary) 6%, var(--frame));
    font-weight: 800;
}

.auth-shell__table tbody tr.auth-shell__table-row--sum-2 {
    background: color-mix(in srgb, var(--color-primary) 12%, var(--frame));
    font-weight: 800;
}

.auth-shell__table tbody tr.auth-shell__table-row--sum-3 {
    background: color-mix(in srgb, var(--color-primary) 22%, var(--frame));
    font-weight: 850;
}

.auth-shell__table tbody tr.auth-shell__table-row--sum-total {
    background: var(--color-primary);
    font-weight: 900;
}

/* Cells inherit td colour, so the level colours are set on the cells too. */
.auth-shell__table tbody tr.auth-shell__table-row--sum-1 td,
.auth-shell__table tbody tr.auth-shell__table-row--sum-2 td,
.auth-shell__table tbody tr.auth-shell__table-row--sum-3 td {
    color: var(--text);
}

.auth-shell__table tbody tr.auth-shell__table-row--sum-total td {
    color: var(--cta-text);
}

/* Rule that separates an aggregate block from the rows above it. */
.auth-shell__table-row--rule td {
    border-top: 2px solid var(--line-strong);
}

/* Group label heading inside the workspace */
.auth-shell__group-heading {
    color: var(--text);
}

.auth-shell__group-heading svg,
.auth-shell__group-heading .ux-icon {
    color: var(--color-secondary);
}

[data-theme="light"] .auth-shell__group-heading svg,
[data-theme="light"] .auth-shell__group-heading .ux-icon {
    color: var(--color-primary);
}

/* Add / primary action button (CTA) */
.auth-shell__primary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 42px;
    padding: 0 18px;
    border: 1px solid color-mix(in srgb, var(--color-secondary) 42%, transparent);
    border-radius: 10px;
    background: linear-gradient(135deg,
        var(--color-primary),
        color-mix(in srgb, var(--color-primary) 88%, var(--frame)));
    color: #ffffff;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    text-decoration: none;
    box-shadow:
        0 14px 34px color-mix(in srgb, var(--color-primary) 24%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.auth-shell__primary-action:hover {
    transform: translateY(-1px);
    box-shadow:
        0 18px 40px color-mix(in srgb, var(--color-primary) 30%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

/* Pagination */
.auth-shell__pagination {
    display: inline-flex;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
}

[data-theme="light"] .auth-shell__pagination {
    background: rgba(255, 255, 255, 0.6);
}

.auth-shell__pagination a,
.auth-shell__pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 36px;
    padding: 0 12px;
    border-right: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
    font-weight: 850;
    text-decoration: none;
    transition: background-color 120ms ease, color 120ms ease;
}

.auth-shell__pagination a:hover {
    background: var(--surface-strong);
    color: var(--text);
}

.auth-shell__pagination a:last-child,
.auth-shell__pagination span:last-child {
    border-right: 0;
}

/* Current page: same surface as the table header it sits under, via the shared
   tokens. It used to be --color-primary at full strength with white text, which
   read as a stronger accent than the header above it. */
.auth-shell__pagination .active,
.auth-shell__pagination a.active {
    background: var(--table-header-bg);
    color: var(--table-header-text);
}

.auth-shell__pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 36px;
    padding: 0 6px;
    border-right: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
    font-weight: 850;
    user-select: none;
}

.auth-shell__pagination-ellipsis:last-child {
    border-right: 0;
}

.auth-shell__pagination-meta {
    color: var(--muted);
}

.auth-shell__pagination-meta strong {
    color: var(--text-soft);
    font-weight: 850;
}

/* Breadcrumb adjusted for shell */
.auth-shell .breadcrumb-trail a,
.auth-shell__breadcrumb-link {
    color: var(--text-soft);
    transition: color 180ms ease;
}

.auth-shell .breadcrumb-trail a:hover,
.auth-shell__breadcrumb-link:hover {
    color: var(--color-primary);
}

.auth-shell .breadcrumb-trail span,
.auth-shell__breadcrumb-current,
.auth-shell__breadcrumb-separator {
    color: var(--muted);
}

/* Empty / no-results state inside the table */
.auth-shell__empty-row td {
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
}

.auth-shell__empty {
    display: grid;
    align-items: center;
    justify-items: center;
    gap: 12px;
    padding: 56px 24px;
    color: var(--text-soft);
    text-align: center;
}

.auth-shell__empty-icon {
    width: 28px;
    height: 28px;
    color: var(--muted);
}

.auth-shell__empty-title {
    margin: 0;
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.4;
    text-wrap: balance;
}

.auth-shell__empty-clear {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    padding: 6px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 850;
    text-decoration: none;
    transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.auth-shell__empty-clear:hover {
    background: var(--surface-strong);
    border-color: var(--line-strong);
    color: var(--text);
}

/* Workspace, form variant.
 * Forms are tasks, not browsing. The radial brand wash and 40px saturated blur
 * earn their place on list/dashboard surfaces but compete with the inputs on a
 * tight edit form. Here the card recedes: a calm flat surface, glass blur in the
 * documented 12-24px band, and the inputs carry the page. The inset highlight +
 * ambient shadow stack stays — that's the project's voice, not the noise. */
.auth-shell__workspace--form {
    padding: clamp(24px, 3vw, 36px);
    /* Allow dropdown panels (multi-select, select2, flatpickr) to overflow
       the form container; the base workspace clips with overflow:hidden. */
    overflow: visible;
    background:
        linear-gradient(180deg,
            color-mix(in srgb, var(--surface) 92%, transparent),
            color-mix(in srgb, var(--surface) 64%, transparent));
    backdrop-filter: blur(20px) saturate(1.05);
    -webkit-backdrop-filter: blur(20px) saturate(1.05);
}

[data-theme="light"] .auth-shell__workspace--form {
    background:
        linear-gradient(180deg,
            rgba(255, 255, 255, 0.68),
            rgba(255, 255, 255, 0.42));
}

/* Labels inside a form: keep the heavy-weight rule (900 stays per DESIGN.md
 * Typography spec), shift color from --text-soft to --muted so the input value
 * leads the row instead of the label shouting over it. */
.auth-shell__workspace--form .auth-shell__label {
    color: var(--muted);
}

/* Quieter focus halo: 3px / 10% instead of 4px / 16%. The border-color shift
 * carries the focus signal; the halo is supporting evidence, not an announcement. */
.auth-shell__workspace--form .auth-shell__field:focus,
.auth-shell__workspace--form .auth-shell__field:focus-visible,
.auth-shell__workspace--form .auth-shell__multiselect-trigger:focus,
.auth-shell__workspace--form .auth-shell__multiselect-trigger:focus-visible {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-secondary) 10%, transparent);
}

/* Section dividers inside a form: drop uppercase + letter-spacing, soften weight. */
.auth-shell__workspace--form .auth-shell__form-section-title {
    margin: 32px 0 14px;
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: none;
}

/* Form submit: quieter than a list-page CTA — ambient + inset only, no halo
 * ring, because saving an edit is expected, not celebrated. The brand-primary
 * fill now comes from `.btn-primary` itself: until LAR-483 that base rule
 * filled from --color-cta, so this block had to restate the fill to reach the
 * in-product spec. Only the border tint and the halo-less shadow differ now. */
.auth-shell__workspace--form .btn-primary {
    border-color: color-mix(in srgb, var(--color-primary) 36%, transparent);
    box-shadow:
        0 10px 24px color-mix(in srgb, var(--color-primary) 16%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.auth-shell__workspace--form .btn-primary:hover {
    transform: none;
    box-shadow:
        0 12px 28px color-mix(in srgb, var(--color-primary) 22%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

/* Multi-step wizard indicator. Sits above the form fields and shows progress
 * through a Craue FormFlow. Token-driven so the brand tint flows through;
 * no literal blues/grays per DESIGN.md's Per-Sponsor Brand and
 * Tinted-Neutral rules. */
.auth-shell__wizard {
    margin-bottom: 24px;
}

.auth-shell__wizard-list {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
    justify-content: center;
}

.auth-shell__wizard-step {
    display: inline-flex;
    align-items: center;
    transition: opacity 200ms ease, color 200ms ease;
    opacity: 0.55;
    font-size: 14px;
}

.auth-shell__wizard-step.is-completed,
.auth-shell__wizard-step.is-current {
    opacity: 1;
}

.auth-shell__wizard-step.is-current {
    color: var(--color-primary);
    font-weight: 700;
}

.auth-shell__wizard-separator {
    opacity: 0.4;
    user-select: none;
}

.auth-shell__wizard-marker {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--field);
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.auth-shell__wizard-marker svg {
    width: 16px;
    height: 16px;
}

.auth-shell__wizard-step.is-completed .auth-shell__wizard-marker,
.auth-shell__wizard-step.is-current .auth-shell__wizard-marker {
    background: linear-gradient(135deg,
        var(--color-primary),
        color-mix(in srgb, var(--color-primary) 78%, var(--frame)));
    border-color: color-mix(in srgb, var(--color-primary) 42%, transparent);
    color: var(--cta-text);
}

.auth-shell__wizard-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.auth-shell__wizard-eyebrow {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    line-height: 1;
}

.auth-shell__wizard-step.is-current .auth-shell__wizard-eyebrow,
.auth-shell__wizard-step.is-completed .auth-shell__wizard-eyebrow {
    color: color-mix(in srgb, var(--color-primary) 70%, var(--text));
}

.auth-shell__wizard-label {
    margin-top: 4px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-soft);
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-shell__wizard-step.is-current .auth-shell__wizard-label {
    color: var(--text);
}

@media (max-width: 640px) {
    .auth-shell__wizard-list {
        flex-direction: column;
        gap: 6px;
    }

    .auth-shell__wizard-step + .auth-shell__wizard-step::before {
        display: none;
    }
}

/* Family-group selector — list of selectable cards used by the COB wizard
 * step 1 (and other primary/dependent pickers). Each row is a labelled
 * radio/checkbox with person details. Token-driven; no hardcoded blues. */
.auth-shell__family-group {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: color-mix(in srgb, var(--surface) 70%, transparent);
    overflow: hidden;
}

.auth-shell__family-group-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 14px 18px;
    cursor: pointer;
    border-top: 1px solid var(--line);
    transition: background-color 180ms ease, border-color 180ms ease;
}

.auth-shell__family-group-item:first-child {
    border-top: 0;
}

.auth-shell__family-group-item:hover {
    background: color-mix(in srgb, var(--surface-strong) 60%, transparent);
}

.auth-shell__family-group-item.is-active {
    background: color-mix(in srgb, var(--color-primary) 10%, var(--surface));
    border-top-color: color-mix(in srgb, var(--color-primary) 28%, transparent);
}

.auth-shell__family-group-item.is-active + .auth-shell__family-group-item {
    border-top-color: color-mix(in srgb, var(--color-primary) 28%, transparent);
}

.auth-shell__family-group-control {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.auth-shell__family-group-control .auth-shell__radio,
.auth-shell__family-group-control .auth-shell__checkbox {
    margin: 0;
    vertical-align: middle;
}

.auth-shell__family-group-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.5;
}

.auth-shell__family-group-item.is-active .auth-shell__family-group-body {
    color: var(--text);
}

.auth-shell__family-group-name {
    display: block;
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.3;
}

.auth-shell__family-group-name--muted {
    color: var(--muted);
    font-weight: 700;
}

.auth-shell__family-group-details {
    display: block;
    color: var(--text-soft);
}

.auth-shell__family-group-details small {
    display: block;
    font-size: 12px;
    color: inherit;
}

.auth-shell__family-group-details strong {
    color: var(--muted);
    font-weight: 800;
}

.auth-shell__family-group-item.is-active .auth-shell__family-group-details strong {
    color: color-mix(in srgb, var(--color-primary) 70%, var(--text));
}

/* Option grid — card-style picker used by step 1 of the dependent flow
 * (period selection) and any other "choose one of N" radio grid. Same
 * tokens as the family-group selector but laid out as a responsive grid. */
.auth-shell__option-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.auth-shell__option-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 160px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: color-mix(in srgb, var(--surface) 70%, transparent);
    color: var(--text-soft);
    cursor: pointer;
    transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.auth-shell__option-card:hover {
    background: color-mix(in srgb, var(--surface-strong) 60%, transparent);
    border-color: var(--line-strong);
}

.auth-shell__option-card.is-active {
    background: color-mix(in srgb, var(--color-primary) 10%, var(--surface));
    border-color: color-mix(in srgb, var(--color-primary) 38%, transparent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 18%, transparent);
}

.auth-shell__option-card.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

.auth-shell__option-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-shell__option-card-title {
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.3;
}

.auth-shell__option-card-detail {
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.5;
}

/* Prompt text shown above a confirmation field (qinetix_large_group_confirm).
 * Larger than auth-shell__help; replaces the prior h5 with hardcoded grays. */
.auth-shell__confirm-help {
    margin: 0 0 12px;
    color: var(--text);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
}

/* Form fields, labels, help text. Token-driven; no hardcoded grays. */
.auth-shell__field {
    display: block;
    width: 100%;
    min-height: 42px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--field);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    font-weight: 760;
    line-height: 1.4;
    transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.auth-shell__field::placeholder {
    color: var(--muted);
    opacity: 0.82;
}

.auth-shell__field:focus,
.auth-shell__field:focus-visible {
    outline: none;
    border-color: var(--line-strong);
    background: var(--surface-strong);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-secondary) 16%, transparent);
}

.auth-shell__field--inline {
    flex: 0 0 auto;
    width: auto;
    min-width: 180px;
}

/* Password reveal toggle — rendered by form/theme.html.twig password_widget.
 * The button overlays the trailing edge of the field, so the input reserves
 * room for it via --with-reveal. */
.auth-shell__password {
    position: relative;
    display: block;
    width: 100%;
}

.auth-shell__field--with-reveal {
    padding-inline-end: 44px;
}

.auth-shell__password-toggle {
    position: absolute;
    inset-block-start: 50%;
    inset-inline-end: 6px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: color 180ms ease, background-color 180ms ease;
}

.auth-shell__password-toggle:hover {
    color: var(--text);
    background: color-mix(in srgb, var(--muted) 14%, transparent);
}

.auth-shell__password-toggle:focus-visible {
    outline: 2px solid var(--color-secondary);
    outline-offset: 1px;
}

/* A disabled field must not offer a reveal affordance. */
.auth-shell__field--disabled ~ .auth-shell__password-toggle {
    display: none;
}

.auth-shell__field--textarea {
    min-height: 96px;
    padding-top: 12px;
    padding-bottom: 12px;
    line-height: 1.5;
    resize: vertical;
}

.auth-shell__field--select {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--text-soft) 50%),
        linear-gradient(135deg, var(--text-soft) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) 50%,
        calc(100% - 12px) 50%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 32px;
}

/* Native <select> dropdown popup styling. The collapsed control inherits
 * --surface and --text, but the opened option list is painted by the
 * browser using its own dark/light defaults — on some platforms
 * (notably Linux Chromium) the popup stays light even when color-scheme
 * resolves to dark. Apply tokens to <option> directly so the popup
 * matches the theme cross-platform. */
select.auth-shell__field option,
select.auth-shell__field optgroup {
    background-color: var(--frame);
    color: var(--text);
}

/* Currently-selected option uses brand primary so it stays visible
 * when the user hovers other options (the browser's hover style
 * otherwise visually dominates and the selection appears to vanish). */
select.auth-shell__field option:checked {
    background-color: var(--color-primary);
    color: var(--cta-text);
    font-weight: 600;
}

select.auth-shell__field option:hover {
    background-color: var(--surface-strong);
    color: var(--text);
}

/* The rules above are all a native popup accepts, and several browsers accept
 * none of them: the list is painted outside the page, so it keeps the OS
 * appearance — white sheet, system-blue highlight — no matter what the theme
 * says. That is why flatpickr matches the app and these do not: flatpickr is
 * HTML in the page, the native popup is not.
 *
 * `appearance: base-select` moves the popup into the DOM, where it becomes an
 * ordinary stylable box. Everything below is scoped to @supports, so browsers
 * without it keep exactly the behaviour above and nothing regresses. */
@supports (appearance: base-select) {
    select.auth-shell__field:not(.ts-hidden-accessible),
    select.auth-shell__field:not(.ts-hidden-accessible)::picker(select) {
        appearance: base-select;
    }

    /* The month picker inside the flatpickr header is a native <select> too,
     * so the calendar itself matched the theme while its own month list did
     * not. It gets the picker treatment and the option rules below, but not
     * the field metrics — it sizes itself to the calendar header. */
    .flatpickr-current-month .flatpickr-monthDropdown-months,
    .flatpickr-current-month .flatpickr-monthDropdown-months::picker(select) {
        appearance: base-select;
    }

    .flatpickr-current-month .flatpickr-monthDropdown-months::picker(select) {
        border: 1px solid var(--line);
        border-radius: 10px;
        padding: 6px;
        background: var(--frame-2);
        color: var(--text);
        box-shadow: var(--shadow);
        font-family: inherit;
    }

    .flatpickr-current-month .flatpickr-monthDropdown-months option {
        padding: 8px 12px;
        border-radius: 6px;
        background: transparent;
        color: var(--text);
    }

    .flatpickr-current-month .flatpickr-monthDropdown-months option:hover,
    .flatpickr-current-month .flatpickr-monthDropdown-months option:focus {
        background: var(--surface-strong);
    }

    .flatpickr-current-month .flatpickr-monthDropdown-months option:checked {
        background: var(--color-primary);
        color: var(--cta-text);
    }

    /* base-select turns the control into a button laid out as flex, which
     * drops the field's own metrics — restate them so the closed control is
     * indistinguishable from an input. */
    select.auth-shell__field:not(.ts-hidden-accessible) {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        min-height: 42px;
        padding: 10px 32px 10px 14px;
        border: 1px solid var(--line);
        border-radius: 10px;
        /* background-color, never the `background` shorthand: the caret of
         * --select is a pair of background-image gradients and the shorthand
         * would reset them, leaving every select without its arrow. */
        background-color: var(--field);
        color: var(--text);
        text-align: left;
    }

    /* The caret is already drawn by --select's background-image gradients, so
     * the picker's own icon would be a second arrow beside it. */
    select.auth-shell__field:not(.ts-hidden-accessible)::picker-icon {
        display: none;
    }

    select.auth-shell__field:not(.ts-hidden-accessible)::picker(select) {
        border: 1px solid var(--line);
        border-radius: 10px;
        padding: 6px;
        background: var(--frame-2);
        color: var(--text);
        box-shadow: var(--shadow);
        /* The picker is a top-layer box and does not inherit the page font. */
        font-family: inherit;
        font-size: 14px;
    }

    select.auth-shell__field:not(.ts-hidden-accessible) option {
        padding: 8px 12px;
        border-radius: 6px;
        background: transparent;
        color: var(--text);
        font-weight: 760;
    }

    /* :hover alone leaves keyboard users without a cue — the picker moves
     * focus through the options as you arrow down. */
    select.auth-shell__field:not(.ts-hidden-accessible) option:hover,
    select.auth-shell__field:not(.ts-hidden-accessible) option:focus {
        background: var(--surface-strong);
        color: var(--text);
    }

    select.auth-shell__field:not(.ts-hidden-accessible) option:checked {
        background: var(--color-primary);
        color: var(--cta-text);
    }

    /* Reserve the checkmark gutter only where it is drawn, so single-line
     * labels do not shift when the selection moves. */
    select.auth-shell__field:not(.ts-hidden-accessible) option::checkmark {
        margin-right: 8px;
        color: var(--cta-text);
    }
}

/* Date / datetime / time / month / week inputs render their own internal
 * widget on Chrome/WebKit. The plain `color` property doesn't reliably
 * propagate to the segments (mm/dd/yyyy) and separators, leaving low-contrast
 * native gray text on a light field. Force tokens via the vendor
 * pseudo-elements so the segments read at full --text contrast. */
.auth-shell__field[type="date"],
.auth-shell__field[type="datetime-local"],
.auth-shell__field[type="time"],
.auth-shell__field[type="month"],
.auth-shell__field[type="week"] {
    color-scheme: light dark;
}

.auth-shell__field[type="date"]::-webkit-datetime-edit,
.auth-shell__field[type="datetime-local"]::-webkit-datetime-edit,
.auth-shell__field[type="time"]::-webkit-datetime-edit,
.auth-shell__field[type="month"]::-webkit-datetime-edit,
.auth-shell__field[type="week"]::-webkit-datetime-edit,
.auth-shell__field[type="date"]::-webkit-datetime-edit-fields-wrapper,
.auth-shell__field[type="datetime-local"]::-webkit-datetime-edit-fields-wrapper,
.auth-shell__field[type="date"]::-webkit-datetime-edit-text,
.auth-shell__field[type="datetime-local"]::-webkit-datetime-edit-text,
.auth-shell__field[type="time"]::-webkit-datetime-edit-text,
.auth-shell__field[type="month"]::-webkit-datetime-edit-text,
.auth-shell__field[type="week"]::-webkit-datetime-edit-text,
.auth-shell__field[type="date"]::-webkit-datetime-edit-day-field,
.auth-shell__field[type="date"]::-webkit-datetime-edit-month-field,
.auth-shell__field[type="date"]::-webkit-datetime-edit-year-field,
.auth-shell__field[type="datetime-local"]::-webkit-datetime-edit-day-field,
.auth-shell__field[type="datetime-local"]::-webkit-datetime-edit-month-field,
.auth-shell__field[type="datetime-local"]::-webkit-datetime-edit-year-field,
.auth-shell__field[type="datetime-local"]::-webkit-datetime-edit-hour-field,
.auth-shell__field[type="datetime-local"]::-webkit-datetime-edit-minute-field,
.auth-shell__field[type="datetime-local"]::-webkit-datetime-edit-ampm-field,
.auth-shell__field[type="time"]::-webkit-datetime-edit-hour-field,
.auth-shell__field[type="time"]::-webkit-datetime-edit-minute-field,
.auth-shell__field[type="time"]::-webkit-datetime-edit-ampm-field,
.auth-shell__field[type="month"]::-webkit-datetime-edit-month-field,
.auth-shell__field[type="month"]::-webkit-datetime-edit-year-field,
.auth-shell__field[type="week"]::-webkit-datetime-edit-week-field,
.auth-shell__field[type="week"]::-webkit-datetime-edit-year-field {
    color: var(--text);
    font-weight: 760;
}

/* Empty placeholder segments (mm/dd/yyyy before user input) render with
 * --webkit-datetime-edit-*-field's :empty pseudo. Tint them toward --muted
 * so they read as placeholder, not as confirmed value. */
.auth-shell__field[type="date"]::-webkit-datetime-edit-day-field:empty,
.auth-shell__field[type="date"]::-webkit-datetime-edit-month-field:empty,
.auth-shell__field[type="date"]::-webkit-datetime-edit-year-field:empty,
.auth-shell__field[type="datetime-local"]::-webkit-datetime-edit-day-field:empty,
.auth-shell__field[type="datetime-local"]::-webkit-datetime-edit-month-field:empty,
.auth-shell__field[type="datetime-local"]::-webkit-datetime-edit-year-field:empty,
.auth-shell__field[type="datetime-local"]::-webkit-datetime-edit-hour-field:empty,
.auth-shell__field[type="datetime-local"]::-webkit-datetime-edit-minute-field:empty,
.auth-shell__field[type="time"]::-webkit-datetime-edit-hour-field:empty,
.auth-shell__field[type="time"]::-webkit-datetime-edit-minute-field:empty,
.auth-shell__field[type="month"]::-webkit-datetime-edit-month-field:empty,
.auth-shell__field[type="month"]::-webkit-datetime-edit-year-field:empty {
    color: var(--muted);
}

/* Flatpickr calendar — themed to design tokens. The picker is mounted by
 * assets/controllers/flatpickr_controller.js on EffectiveDateType inputs.
 * Default flatpickr CSS (imported via importmap) sets layout; rules below
 * override surface, text, and selection colors so the dropdown matches
 * the auth shell on light AND dark themes. */
.flatpickr-calendar {
    background: var(--frame-2);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
    color: var(--text);
    font-family: var(--auth-font, inherit);
}

.flatpickr-calendar.arrowTop::before {
    border-bottom-color: var(--line);
}

.flatpickr-calendar.arrowTop::after {
    border-bottom-color: var(--frame-2);
}

.flatpickr-calendar.arrowBottom::before {
    border-top-color: var(--line);
}

.flatpickr-calendar.arrowBottom::after {
    border-top-color: var(--frame-2);
}

.flatpickr-months,
.flatpickr-month,
.flatpickr-current-month,
.flatpickr-current-month input.cur-year,
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-monthSelect-months,
.flatpickr-monthSelect-month {
    background: transparent;
    color: var(--text);
}

.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year {
    color: var(--text);
    font-weight: 800;
}

.flatpickr-current-month .flatpickr-monthDropdown-months option {
    background: var(--frame-2);
    color: var(--text);
}

.flatpickr-prev-month svg,
.flatpickr-next-month svg {
    fill: var(--text-soft);
}

.flatpickr-prev-month:hover svg,
.flatpickr-next-month:hover svg {
    fill: var(--color-primary);
}

.flatpickr-weekdays,
.flatpickr-weekday,
span.flatpickr-weekday {
    background: transparent;
    color: var(--text-soft);
    font-weight: 800;
}

/* Prev/Next month chevron buttons — the host button's `color` is the
 * fallback when SVG fill: inherit chains up. Default flatpickr CSS
 * pins both to rgba(0,0,0,0.9) (specificity 0,2,0). Match that. */
.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    color: var(--text-soft);
    fill: var(--text-soft);
}

.flatpickr-months .flatpickr-prev-month svg,
.flatpickr-months .flatpickr-next-month svg,
.flatpickr-months .flatpickr-prev-month svg path,
.flatpickr-months .flatpickr-next-month svg path {
    fill: var(--text-soft);
}

.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg,
.flatpickr-months .flatpickr-prev-month:hover svg path,
.flatpickr-months .flatpickr-next-month:hover svg path {
    fill: var(--color-primary);
}

/* numInputWrapper up/down arrows are CSS triangles drawn via borders.
 * Default colors are rgba(0,0,0,0.9) — invisible on dark surfaces.
 * Re-color via the border-* properties that draw each triangle. */
.numInputWrapper span.arrowUp::after,
.flatpickr-current-month .numInputWrapper span.arrowUp::after {
    border-bottom-color: var(--text-soft);
}

.numInputWrapper span.arrowDown::after,
.flatpickr-current-month .numInputWrapper span.arrowDown::after {
    border-top-color: var(--text-soft);
}

.numInputWrapper:hover span.arrowUp::after,
.flatpickr-current-month .numInputWrapper:hover span.arrowUp::after {
    border-bottom-color: var(--text);
}

.numInputWrapper:hover span.arrowDown::after,
.flatpickr-current-month .numInputWrapper:hover span.arrowDown::after {
    border-top-color: var(--text);
}

.numInputWrapper span {
    border-color: var(--line);
}

.numInputWrapper span:hover {
    background: var(--surface-strong);
}

/* Month dropdown popup inside the flatpickr header. This is a native
 * <select> rendered by Chromium on Linux as a GTK popup that ignores
 * option backgrounds — apply tokens anyway for macOS / Windows users
 * (Linux limitation tracked in LAR-409). */
.flatpickr-current-month .flatpickr-monthDropdown-months {
    color: var(--text);
}

.flatpickr-current-month .flatpickr-monthDropdown-months option,
.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month {
    background-color: var(--frame-2);
    color: var(--text);
}

.flatpickr-day {
    color: var(--text-soft);
    border-radius: 8px;
    border-color: transparent;
}

.flatpickr-day:hover,
.flatpickr-day:focus,
.flatpickr-day.prevMonthDay:hover,
.flatpickr-day.nextMonthDay:hover {
    background: color-mix(in srgb, var(--surface-strong) 80%, transparent);
    border-color: transparent;
    color: var(--text);
}

.flatpickr-day.today {
    border-color: color-mix(in srgb, var(--color-primary) 40%, transparent);
    color: var(--text);
}

.flatpickr-day.today:hover {
    background: color-mix(in srgb, var(--color-primary) 18%, var(--surface));
    border-color: color-mix(in srgb, var(--color-primary) 50%, transparent);
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover,
.flatpickr-day.selected.today,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-monthSelect-month.selected {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--cta-text);
}

.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay,
.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
    color: color-mix(in srgb, var(--muted) 60%, transparent);
}

/* Month-select plugin: grid of clickable month names. */
.flatpickr-monthSelect-months {
    padding: 8px 12px;
}

.flatpickr-monthSelect-month {
    color: var(--text-soft);
    border-radius: 8px;
    margin: 4px;
    padding: 8px 0;
    font-weight: 700;
}

.flatpickr-monthSelect-month:hover {
    background: color-mix(in srgb, var(--surface-strong) 80%, transparent);
    color: var(--text);
}

.flatpickr-monthSelect-month.today {
    border: 1px solid color-mix(in srgb, var(--color-primary) 40%, transparent);
}

.auth-shell__field--error {
    border-color: color-mix(in srgb, var(--color-accent) 60%, transparent);
    background: color-mix(in srgb, var(--color-accent) 10%, var(--field));
}

.auth-shell__field--error:focus {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-accent) 18%, transparent);
}

.auth-shell__field--disabled,
.auth-shell__field:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.auth-shell__label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: 0;
}

.auth-shell__label--error {
    color: var(--color-accent);
}

/* Symfony marca con .required el label de todo campo obligatorio. Sin esta
 * regla la clase no pintaba nada y ningún formulario indicaba qué campos
 * hacían falta hasta que el servidor los rechazaba. */
.auth-shell__label.required::after {
    content: ' *';
    color: var(--color-accent);
    font-weight: 900;
}

/* Inline label modifier — used by checkbox_radio_label to sit next to a
 * checkbox/radio input inside Flowbite's `<div class="flex items-center mr-4">`
 * wrapper. Without this, the base block-level styles (display:block,
 * margin-bottom:8px) shift the text out of alignment with the input. */
.auth-shell__label--inline {
    display: inline-flex;
    align-items: center;
    margin: 0 0 0 8px;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
    user-select: none;
}

/* Subtle highlight on Flowbite's hardcoded `<div class="flex items-center mr-4">`
 * checkbox/radio chip when the option is selected. Keeps the checkbox–text
 * pair feeling like a single tappable region without us overriding the
 * vendor block. Scoped to wrappers that actually contain a checkbox/radio. */
.auth-shell__workspace--form .flex.items-center.mr-4:has(> input[type="checkbox"], > input[type="radio"]) {
    padding: 4px 10px 4px 6px;
    border-radius: 8px;
    transition: background-color 160ms ease;
}

.auth-shell__workspace--form .flex.items-center.mr-4:has(> input[type="checkbox"], > input[type="radio"]):hover {
    background: color-mix(in srgb, var(--surface-strong) 50%, transparent);
}

.auth-shell__workspace--form .flex.items-center.mr-4:has(> input[type="checkbox"]:checked, > input[type="radio"]:checked) {
    background: color-mix(in srgb, var(--color-primary) 10%, var(--surface));
}

.auth-shell__help {
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.45;
    max-width: 65ch;
}

.auth-shell__field-error {
    margin: 6px 0 0;
    color: var(--color-danger);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.45;
    max-width: 65ch;
}

/* Radio / checkbox in token-driven shape, replacing Flowbite's blue defaults. */
.auth-shell__radio,
.auth-shell__checkbox {
    width: 16px;
    height: 16px;
    border: 1px solid var(--line-strong);
    background: var(--field);
    accent-color: var(--color-primary);
    cursor: pointer;
}

.auth-shell__radio:focus-visible,
.auth-shell__checkbox:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

/*
 * Toggle switch track, replacing the literal Tailwind string the Flowbite bundle
 * emits from `class_input_switch` (default.html.twig:296). That string was
 * `bg-gray-200 dark:bg-gray-700 ... peer-focus:ring-blue-300 peer-checked:bg-blue-600`,
 * so every switch in the app rendered a neutral grey track that turned Tailwind
 * blue when checked, ignoring the sponsor brand entirely — the one control on a
 * form that still lit up blue. theme.html.twig overrides the block to emit this
 * class instead.
 *
 * Flowbite drives the states with Tailwind's `peer-*` variants; the markup puts
 * the `sr-only peer` input immediately before this div (switch_widget), so plain
 * sibling selectors reach the same states without needing the utilities.
 */
.auth-shell__switch {
    position: relative;
    flex: none;
    width: 44px;
    height: 24px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--surface-strong);
    transition: background-color 160ms ease, border-color 160ms ease;
}

.auth-shell__switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--muted);
    transition: transform 160ms ease, background-color 160ms ease;
}

.peer:checked ~ .auth-shell__switch {
    border-color: var(--color-primary);
    background: var(--color-primary);
}

.peer:checked ~ .auth-shell__switch::after {
    /* 44 − 18 − 2·2 border/gutter = 22px of travel. */
    transform: translateX(22px);
    background: var(--cta-text);
}

.peer:focus-visible ~ .auth-shell__switch {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

.peer:disabled ~ .auth-shell__switch {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Inline addon (e.g. @ prefix on email). Replaces Flowbite's gray-200 chip. */
.auth-shell__addon {
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-right: 0;
    border-radius: 10px 0 0 10px;
    background: var(--surface);
    color: var(--text-soft);
    font-size: 14px;
    font-weight: 800;
}

.auth-shell__addon + .auth-shell__field {
    border-radius: 0 10px 10px 0;
}

/* Collection widget: items + add/remove buttons. */
.auth-shell__collection-item {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    transition: border-color 180ms ease, background-color 180ms ease;
}

.auth-shell__collection-item + .auth-shell__collection-item {
    margin-top: 12px;
}

.auth-shell__collection-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    color: var(--muted);
    cursor: move;
    transition: background-color 180ms ease, color 180ms ease;
}

.auth-shell__collection-handle:hover {
    background: var(--surface-strong);
    color: var(--text-soft);
}

/* Multi-select dropdown trigger and panel. */
.auth-shell__multiselect-trigger {
    display: block;
    width: 100%;
    min-height: 42px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--field);
    color: var(--text);
    text-align: left;
    cursor: pointer;
    transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.auth-shell__multiselect-trigger:focus,
.auth-shell__multiselect-trigger:focus-visible {
    outline: none;
    border-color: var(--line-strong);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-secondary) 16%, transparent);
}

.auth-shell__multiselect-placeholder {
    color: var(--muted);
    font-size: 14px;
    font-weight: 760;
}

.auth-shell__multiselect-caret {
    color: var(--muted);
}

.auth-shell__multiselect-panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 10;
    overflow: auto;
    max-height: 240px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--frame);
    box-shadow:
        0 18px 44px rgba(0, 0, 0, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(18px);
}

[data-theme="light"] .auth-shell__multiselect-panel {
    background: rgba(255, 255, 255, 0.94);
    box-shadow:
        0 18px 38px color-mix(in srgb, var(--color-primary) 14%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

/* Search filter inside the multi-select panel. The wrapper carries the
 * separator so the input stays a plain field; both replace the literal
 * gray/white utilities that used to live in form/theme.html.twig. */
.auth-shell__multiselect-search-wrap {
    padding: 12px 12px 8px;
    border-bottom: 1px solid var(--line);
}

/* Mirrors .auth-shell__field but compact — it sits inside an already
 * bordered panel, so it needs less height than a top-level form field. */
.auth-shell__multiselect-search {
    display: block;
    width: 100%;
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--field);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.auth-shell__multiselect-search::placeholder {
    color: var(--muted);
    opacity: 0.82;
}

/* Focus ring uses --focus (derived from --color-primary), NOT
 * --color-secondary. Sponsors may set secondary to #FFFFFF (Berríos does),
 * which renders a white ring on the light theme's near-white panel — no
 * visible focus indicator, failing WCAG 2.1 AA. --focus is brand-tinted and
 * stays visible in both themes. .auth-shell__field:focus still has the
 * --color-secondary bug; see LAR-443 for the app-wide fix. */
.auth-shell__multiselect-search:focus,
.auth-shell__multiselect-search:focus-visible {
    outline: none;
    border-color: var(--line-strong);
    background: var(--surface-strong);
    box-shadow: 0 0 0 3px var(--focus);
}

/* Form-level row grouping headers (used by group_form_fields_by_row). */
.auth-shell__form-section-title {
    margin: 28px 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.auth-shell__form-section-title:first-child {
    margin-top: 0;
}

/* Row link inside table cells. Token-driven, no hardcoded blue.
 * Underline-on-hover so the link is identifiable without color alone. */
.auth-shell__row-link {
    color: var(--text);
    font-weight: 500;
    text-decoration: none;
    transition: color 140ms ease;
}

.auth-shell__row-link:hover {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth-shell__row-link:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Drag handle for a sortable table row (`page.row_sortable`). Mirrors
 * .ad-list__handle, which does the same job in the additional-detail cards, so
 * the two reorder affordances in the app look like the same thing. */
.auth-shell__row-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    cursor: grab;
    transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

.auth-shell__row-handle:hover {
    background: var(--surface-strong);
    border-color: var(--line);
    color: var(--text);
}

.auth-shell__row-handle:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

.auth-shell__row-handle:active {
    cursor: grabbing;
}

/* The placeholder SortableJS leaves where the row will land. Tinted with the
 * sponsor's own primary so the drop target reads as part of the brand, and
 * faded so it registers as a gap rather than as a row with content. */
.auth-shell__row--ghost {
    opacity: 0.4;
}

.auth-shell__row--ghost > td {
    background: color-mix(in srgb, var(--color-primary) 14%, transparent);
}

/* Container for a row's inline controls. Tight 2px gutter: these read as one
 * group ("order"), not as separate actions, so they sit closer than the 8px
 * the utility scale offers. */
.auth-shell__row-actions {
    display: flex;
    align-items: center;
    gap: 2px;
}

/* Icon-only control for a row's inline menu (`page.row_menu` in
 * shared/list.html.twig). Deliberately chrome-less: no border, no fill, so a
 * column of them reads as part of the row instead of a toolbar bolted onto it.
 *
 * .auth-shell__icon-button is the wrong component here — its bordered 38x38 box
 * was drawn for navbar chips, and repeated down a table it turns every row into
 * a strip of buttons that outweighs the data. */
.auth-shell__row-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: color 140ms ease, background-color 140ms ease;
}

.auth-shell__row-action:hover {
    color: var(--text);
    background: var(--surface-strong);
}

.auth-shell__row-action:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

/* Misma mezcla que .actions-menu__item--danger: el rojo puro no despega del
 * fondo en oscuro, y mezclarlo con --text lo hace flotar en los dos temas
 * porque --text se invierte con el tema. Se repite la formula en vez de
 * compartir clase para que un icono de 24px y un item de menu no queden
 * atados entre si. */
.auth-shell__row-action--danger {
    color: color-mix(in srgb, var(--color-danger) 62%, var(--text));
}

.auth-shell__row-action--danger:hover {
    color: color-mix(in srgb, var(--color-danger) 62%, var(--text));
    background: color-mix(in srgb, var(--color-danger) 14%, transparent);
}

.auth-shell__row-action--danger:active {
    background: color-mix(in srgb, var(--color-danger) 22%, transparent);
}

/* Disabled = the row is already at that end. Faded to --line (the hairline
 * color) so it reads as structure rather than as something to click, but still
 * present: removing it would shift the remaining arrow into the other one's
 * slot and the icons would stop lining up between rows. */
.auth-shell__row-action:disabled {
    color: var(--line);
    cursor: default;
}

.auth-shell__row-action:disabled:hover {
    background: transparent;
    color: var(--line);
}

/* Status badges. Pill, brand-tinted bg, brand-tinted text. The --pending
 * variant uses --color-highlight (gold) for "needs attention" semantics
 * across any sponsor palette. */
.auth-shell__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
}

.auth-shell__badge--pending {
    background: color-mix(in srgb, var(--color-highlight) 22%, transparent);
    color: var(--color-highlight);
    border: 1px solid color-mix(in srgb, var(--color-highlight) 36%, transparent);
}

/* Semantic, so they use the semantic tokens: these two answer "is this good or
   bad", a question the sponsor's brand colour cannot answer. Bound to
   --color-primary and --color-accent, "Activa" rendered orange on Berríos and
   only looked green where no brand was configured. --pending below was already
   correct. See LAR-443. */
.auth-shell__badge--success {
    gap: 4px;
    background: color-mix(in srgb, var(--color-success) 18%, transparent);
    color: var(--color-success);
    border: 1px solid color-mix(in srgb, var(--color-success) 32%, transparent);
}

.auth-shell__badge--danger {
    gap: 4px;
    background: color-mix(in srgb, var(--color-danger) 18%, transparent);
    color: var(--color-danger);
    border: 1px solid color-mix(in srgb, var(--color-danger) 32%, transparent);
}

/* Variante sin carga semantica, para etiquetar sin competir con los badges de
   estado (que son los que deben llamar la atencion). La usa el panel de Roles
   Asignados del detalle de administrador. */
.auth-shell__badge--neutral {
    background: var(--surface);
    color: var(--text-soft);
    border: 1px solid var(--line);
}

/* Approval / changes detail layout. The page hosts a primary header with the
 * person's identity, two semantic sections (pending / processed), and an
 * inline expand-collapse pattern for change details. Token-driven; replaces
 * the legacy bg-white / Tailwind-grays implementation. */
.auth-shell__workspace--changes {
    padding: clamp(20px, 2.6vw, 32px);
    display: grid;
    gap: clamp(20px, 2.4vw, 28px);
}

.auth-shell__changes-header {
    display: grid;
    gap: 6px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.auth-shell__changes-name {
    margin: 0;
    color: var(--text);
    font-size: 22px;
    font-weight: 900;
    line-height: 1.1;
}

.auth-shell__changes-meta {
    margin: 0;
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
}

.auth-shell__changes-meta-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 760;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-shell__changes-meta-value {
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 800;
}

.auth-shell__changes-section {
    display: grid;
    gap: 12px;
}

.auth-shell__changes-section-title {
    margin: 0;
    color: var(--text);
    font-size: 14px;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.auth-shell__table-col--narrow {
    width: 200px;
}

.auth-shell__changes-row {
    cursor: pointer;
    transition: background-color 140ms ease;
}

.auth-shell__changes-row:hover {
    background: var(--surface-strong);
}

.auth-shell__changes-row td.align-top {
    vertical-align: top;
}

.auth-shell__changes-row-date {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.auth-shell__changes-row-date-icon {
    color: var(--muted);
}

.auth-shell__changes-row-date-icon--processed {
    color: var(--color-primary);
}

.auth-shell__changes-row-body {
    display: grid;
    gap: 12px;
}

.auth-shell__changes-row-description {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.4;
}

.auth-shell__changes-detail {
    display: none;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: color-mix(in srgb, var(--surface) 60%, transparent);
}

.auth-shell__changes-detail.is-open {
    display: grid;
    gap: 14px;
}

/* El interior del detalle lo pinta el macro compartido `change_details`, que emite
 * clases modal-shell__detail-*; las variantes auth-shell__changes-detail-* que había
 * aquí quedaron sin usar al reutilizar ese macro (LAR-490). */

/* Al desplegar, el encabezado del detalle repite el texto de la fila: se oculta el
 * resumen, que es lo que hacía v3 (`toggleRow` alternaba .info y .extra-info). */
.auth-shell__changes-row-body:has(.auth-shell__changes-detail.is-open)
.auth-shell__changes-row-description {
    display: none;
}

.auth-shell__changes-footer {
    display: flex;
    justify-content: center;
    padding-top: 8px;
}

/* In-product primary spec for the "Ver más cambios" CTA on this page, same
 * principle as the form/dashboard variants: no halo, smaller ambient. */
.auth-shell__workspace--changes .btn-primary {
    background: linear-gradient(135deg,
        var(--color-primary),
        color-mix(in srgb, var(--color-primary) 88%, var(--frame)));
    border-color: color-mix(in srgb, var(--color-primary) 36%, transparent);
    box-shadow:
        0 10px 24px color-mix(in srgb, var(--color-primary) 16%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.auth-shell__workspace--changes .btn-primary:hover {
    transform: none;
    box-shadow:
        0 12px 28px color-mix(in srgb, var(--color-primary) 22%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

/* Action menu trigger inside table rows (knp_menu actions) */
.auth-shell__table .dropdown-toggle,
.auth-shell__table [data-dropdown-toggle] {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: var(--surface);
    font-size: 12px;
    font-weight: 850;
    cursor: pointer;
    transition: all 180ms ease;
}

.auth-shell__table .dropdown-toggle:hover,
.auth-shell__table [data-dropdown-toggle]:hover {
    color: var(--text);
    border-color: var(--line-strong);
    background: var(--surface-strong);
}

/* ============================================================
 * Modal shell — token-driven glass surface
 * Replaces the legacy bg-white/dark:bg-gray-800 modal scaffold.
 * Used by templates/shared/_modal.html.twig and modal_form.html.twig.
 * ============================================================ */
.modal-shell {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: clamp(16px, 5vh, 56px) 16px;
    overflow-y: auto;
    overflow-x: hidden;
}

.modal-shell.hidden {
    display: none;
}

.modal-shell__container {
    position: relative;
    width: 100%;
    max-width: 620px;
    margin: auto;
}

.modal-shell__container--md {
    max-width: 760px;
}

.modal-shell__container--lg {
    max-width: 920px;
}

.modal-shell__container--xl {
    max-width: 1080px;
}

.modal-shell__container--2xl {
    max-width: 1240px;
}

/*
 * Panel surface mirrors .auth-shell__workspace exactly so the modal reads
 * as the same kind of card the user already sees on view/list pages.
 * Drop shadow is plain black-with-alpha, layered for natural depth.
 */
.modal-shell__panel {
    position: relative;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: linear-gradient(180deg,
        var(--surface-strong),
        color-mix(in srgb, var(--surface) 70%, transparent));
    backdrop-filter: blur(22px) saturate(1.15);
    -webkit-backdrop-filter: blur(22px) saturate(1.15);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 2px 6px rgba(0, 0, 0, 0.18),
        0 18px 40px rgba(0, 0, 0, 0.32),
        0 56px 112px rgba(0, 0, 0, 0.42);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - clamp(32px, 10vh, 112px));
}

/* El velo que oscurece la pagina detras de un modal lo pinta Flowbite con sus
 * clases por defecto (bg-gray-900/50 dark:bg-gray-900/80) y su auto-init no
 * expone ningun data-attribute para cambiarlas —solo data-modal-backdrop,
 * placement y poco mas—. El mismo par esta ademas escrito a mano en
 * flowbite_confirm_controller.js y en shared/_session_timeout_modal.html.twig.
 *
 * gray-900 es #111827, un azul pizarra. Sobre el fondo oscuro tintado con el
 * color del patrono, arrastra toda la pagina hacia el azul mientras el modal
 * esta abierto. Se sustituye por el propio --frame para que el velo oscurezca
 * sin cambiar el tono de la marca.
 *
 * !important porque compite con una utilidad de Tailwind en el mismo elemento,
 * y el selector no puede ser mas especifico sin depender del orden de clases
 * que genera la libreria. Solo en oscuro: en claro el gris neutro sobre pagina
 * clara no desvia ningun tono. */
:root:not([data-theme="light"]) [class*="bg-gray-900"].fixed.inset-0 {
    background-color: color-mix(in srgb, var(--frame) 84%, transparent) !important;
}

/* En oscuro, --surface y --surface-strong son alfas BLANCOS
 * (rgba(255,255,255,.075/.12)): el panel solo se ve oscuro si el
 * backdrop-filter compone algo oscuro detras. Cuando esa composicion no ocurre
 * —y no ocurre de forma fiable: el velo del modal es un elemento fijo aparte, y
 * cualquier ancestro con filtro/transform cambia el backdrop root— el panel sale
 * palido con el texto blanco encima, ilegible.
 *
 * Una base opaca por debajo del cristal lo hace independiente de lo que haya
 * detras. Solo para oscuro: en claro los alfas son blancos sobre pagina clara,
 * que degrada bien, y el aspecto actual se conserva intacto. */
:root:not([data-theme="light"]) .modal-shell__panel {
    background:
        linear-gradient(180deg,
            var(--surface-strong),
            color-mix(in srgb, var(--surface) 70%, transparent)),
        var(--frame-2);
}

[data-theme="light"] .modal-shell__panel {
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.66),
        rgba(255, 255, 255, 0.4));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        0 2px 6px rgba(0, 0, 0, 0.06),
        0 14px 28px rgba(0, 0, 0, 0.10),
        0 48px 96px rgba(0, 0, 0, 0.16);
}

.modal-shell__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}

.modal-shell__title {
    margin: 0;
    color: var(--text);
    font-family: Inter, system-ui, sans-serif;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0;
}

.modal-shell__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text-soft);
    transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
    cursor: pointer;
}

.modal-shell__close:hover {
    background: var(--surface-strong);
    border-color: var(--line-strong);
    color: var(--text);
    transform: translateY(-1px);
}

.modal-shell__close:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--focus);
}

.modal-shell__close-icon {
    width: 16px;
    height: 16px;
}

.modal-shell__body {
    padding: 24px 24px 0;
    color: var(--text-soft);
    overflow-y: auto;
    flex: 1 1 auto;
}

.modal-shell__form-content {
    padding-bottom: 24px;
}

/* Delete-confirmation body, injected by form_modal_controller.js. The shell around
   it was already token-driven; only this fragment still painted itself with literal
   Tailwind (text-gray-400 icon, dark:bg-gray-700 cancel button, bg-red-600 confirm).
   LAR-443. */
.modal-shell__confirm {
    padding-bottom: 24px;
    text-align: center;
}

.modal-shell__confirm-icon {
    display: block;
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    color: var(--text-soft);
}

.modal-shell__confirm-message {
    margin-bottom: 20px;
    color: var(--text-soft);
    font-size: 16px;
    line-height: 1.5;
}

.modal-shell__confirm-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
}

/* Semantic colour for icons and short status text built as raw HTML in PHP -- list
   columns assembled in entities (MembershipImport, User, TimelineState) and in
   CrudRefreshableCell. Those fragments never pass through a Twig template, so the
   literal-count sweeps of this ticket never saw them; they were painting themselves
   with text-green-500 / text-yellow-500 / text-red-600 / text-gray-500. LAR-443. */
.status-ink--success { color: var(--color-success); }
.status-ink--danger  { color: var(--color-danger); }
.status-ink--warning { color: var(--color-warning); }
.status-ink--info    { color: var(--color-info); }
.status-ink--muted   { color: var(--text-soft); }

/* Native colour swatch in form/color_widget.html.twig, next to its hex text field.
   Both carried literal Tailwind (border-gray-300 / dark:border-gray-600 on the swatch,
   bg-gray-50 / dark:bg-gray-700 on the field), which is how the branding screen ended
   up as the worst offender measured: eight pickers, 24 computed Tailwind colours.
   LAR-443. */
.auth-shell__color-swatch {
    width: 48px;
    height: 40px;
    padding: 2px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--field);
    cursor: pointer;
}

.auth-shell__color-swatch:hover {
    border-color: var(--line-strong);
}

/* Rows added at runtime by collection_controller.js (additional detail lists and the
   other qinetix_collection fields). Built in JS, so out of reach of the form theme,
   and previously painted with bg-white / dark:bg-gray-800 and a gray-200 border --
   a cold card on a frame mixed from the sponsor's brand. LAR-443. */
.collection-item {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.collection-item-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    color: var(--text-soft);
    cursor: move;
    transition: background-color 180ms ease, color 180ms ease;
}

.collection-item-handle:hover {
    background: var(--surface-strong);
    color: var(--text);
}

/* Sortable's drop placeholder. */
.collection-item--ghost {
    background: color-mix(in srgb, var(--color-primary) 12%, transparent);
    border-style: dashed;
}

.modal-shell__footer {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0 -24px;
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--line);
    background: var(--surface-strong);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

@media (min-width: 640px) {
    .modal-shell__footer {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.modal-shell__footer-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

@media (min-width: 640px) {
    .modal-shell__footer-group {
        flex-direction: row;
        width: auto;
    }
}

/*
 * Backdrop: tint toward the frame but stay translucent enough that the
 * panel's outer drop shadow still reads. The blur carries the depth.
 */
[modal-backdrop] {
    background: color-mix(in srgb, var(--frame) 55%, transparent) !important;
    backdrop-filter: blur(10px) saturate(120%);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
}

[data-theme="light"] [modal-backdrop] {
    background: color-mix(in srgb, var(--frame) 60%, transparent) !important;
}

/* ============================================================
 * FilePond / S3 dropzone overrides
 * Vendor JS (qinetix/s3-upload-bundle dropzone_controller.js) injects
 * literal Tailwind utilities (bg-gray-50, focus:ring-blue-500) on the
 * FilePond root. We override here so the dropzone honors the per-sponsor
 * brand tokens and the project's tinted-neutral surfaces.
 * ============================================================ */
.modal-shell__body .filepond--root,
.auth-shell__workspace .filepond--root {
    background: var(--field);
    border: 1px dashed var(--line);
    border-radius: 10px;
    color: var(--text);
    margin-bottom: 0;
    transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.modal-shell__body .filepond--root:hover,
.auth-shell__workspace .filepond--root:hover {
    border-color: var(--line-strong);
}

.modal-shell__body .filepond--root.filepond--hopper-highlight,
.modal-shell__body .filepond--root:focus-within,
.auth-shell__workspace .filepond--root.filepond--hopper-highlight,
.auth-shell__workspace .filepond--root:focus-within {
    border-color: var(--line-strong);
    border-style: solid;
    background: var(--surface-strong);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-secondary) 16%, transparent);
}

.modal-shell__body .filepond--panel-root,
.auth-shell__workspace .filepond--panel-root {
    background: transparent;
    border-radius: 10px;
}

.modal-shell__body .filepond--drop-label,
.auth-shell__workspace .filepond--drop-label {
    color: var(--text-soft);
    font-family: Inter, system-ui, sans-serif;
    font-size: 13px;
    font-weight: 760;
}

.modal-shell__body .filepond--label-action,
.auth-shell__workspace .filepond--label-action {
    color: var(--color-primary);
    text-decoration-color: color-mix(in srgb, var(--color-primary) 50%, transparent);
    text-underline-offset: 2px;
    font-weight: 800;
}

.modal-shell__body .filepond--item-panel,
.auth-shell__workspace .filepond--item-panel {
    background: color-mix(in srgb, var(--color-primary) 22%, transparent);
}

.modal-shell__body .filepond--file,
.auth-shell__workspace .filepond--file {
    color: var(--text);
}

.modal-shell__body .filepond--file-info-main,
.auth-shell__workspace .filepond--file-info-main {
    font-weight: 800;
}

.modal-shell__body .filepond--file-info-sub,
.auth-shell__workspace .filepond--file-info-sub {
    color: var(--text-soft);
    opacity: 0.85;
}

.modal-shell__body .filepond--file-action-button,
.auth-shell__workspace .filepond--file-action-button {
    background: color-mix(in srgb, var(--frame) 60%, transparent);
    color: var(--text);
}

.modal-shell__body .filepond--file-action-button:hover,
.auth-shell__workspace .filepond--file-action-button:hover {
    background: color-mix(in srgb, var(--frame) 80%, transparent);
}

.modal-shell__body .filepond--progress-indicator,
.auth-shell__workspace .filepond--progress-indicator {
    color: var(--color-primary);
}

/* Timeline changes table — rendered inside .modal-shell__body by the
 * "Ver Cambios" modal. Token-driven; mirrors design-system surfaces
 * and semantic colors instead of hardcoded green/yellow/blue/red. */
.modal-shell__changes {
    padding-bottom: 24px;
}

.modal-shell__changes-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    font-size: 13px;
    color: var(--text-soft);
}

.modal-shell__changes-table thead th {
    padding: 10px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    background: color-mix(in srgb, var(--surface) 60%, transparent);
    border-bottom: 1px solid var(--line);
}

.modal-shell__changes-table tbody tr {
    transition: background-color 160ms ease;
    border-top: 1px solid var(--line);
}

.modal-shell__changes-table tbody tr:first-child {
    border-top: 0;
}

.modal-shell__changes-table tbody tr.is-synced {
    background: color-mix(in srgb, var(--color-success) 8%, transparent);
}

.modal-shell__changes-table tbody tr.is-pending {
    background: color-mix(in srgb, var(--color-warning) 8%, transparent);
}

.modal-shell__changes-table tbody tr:hover {
    background: color-mix(in srgb, var(--surface-strong) 60%, transparent);
}

.modal-shell__changes-table td {
    padding: 12px 14px;
    color: var(--text);
    vertical-align: top;
}

.modal-shell__changes-empty {
    padding: 24px;
    text-align: center;
    color: var(--muted);
}

.modal-shell__change-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--text) 8%, transparent);
    color: var(--muted);
    border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
}

.modal-shell__change-icon--success {
    background: color-mix(in srgb, var(--color-success) 14%, transparent);
    color: var(--color-success);
    border-color: color-mix(in srgb, var(--color-success) 30%, transparent);
}

.modal-shell__change-icon--danger {
    background: color-mix(in srgb, var(--color-danger) 14%, transparent);
    color: var(--color-danger);
    border-color: color-mix(in srgb, var(--color-danger) 30%, transparent);
}

.modal-shell__change-icon--info {
    background: color-mix(in srgb, var(--color-info) 14%, transparent);
    color: var(--color-info);
    border-color: color-mix(in srgb, var(--color-info) 30%, transparent);
}

.modal-shell__change-icon--warning {
    background: color-mix(in srgb, var(--color-warning) 14%, transparent);
    color: var(--color-warning);
    border-color: color-mix(in srgb, var(--color-warning) 30%, transparent);
}

.modal-shell__chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
}

.modal-shell__chip--success {
    background: color-mix(in srgb, var(--color-success) 14%, transparent);
    color: var(--color-success);
    border-color: color-mix(in srgb, var(--color-success) 32%, transparent);
}

.modal-shell__chip--warning {
    background: color-mix(in srgb, var(--color-warning) 14%, transparent);
    color: var(--color-warning);
    border-color: color-mix(in srgb, var(--color-warning) 32%, transparent);
}

.modal-shell__chip--danger {
    background: color-mix(in srgb, var(--color-danger) 14%, transparent);
    color: var(--color-danger);
    border-color: color-mix(in srgb, var(--color-danger) 32%, transparent);
}

/* El form envuelve el botón de sincronizar sin ocupar espacio propio, para que
   el botón siga siendo hijo directo del flex de la celda. */
.modal-shell__action-form {
    display: contents;
}

.modal-shell__action-link {
    font-size: 12px;
    font-weight: 700;
    color: var(--color-primary);
    text-decoration: none;
    transition: color 180ms ease;
    /* Ahora es un <button>: hay que apagar el estilo nativo para que siga
       leyéndose como el enlace que era. */
    padding: 0;
    border: 0;
    background: none;
    font-family: inherit;
    cursor: pointer;
}

.modal-shell__action-link:hover {
    color: color-mix(in srgb, var(--color-primary) 70%, var(--text));
    text-decoration: underline;
}

.modal-shell__action-link:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--focus);
    border-radius: 4px;
}

.modal-shell__rejection-note {
    margin-top: 6px;
    font-size: 11px;
    color: var(--muted);
}

/* Change-detail key/value list — used by the "Cambios procesados" modal
 * launched from person/view.html.twig via timeline_controller.js. Token
 * driven; replaces the prior Bootstrap row/col-sm-* grid. */
.modal-shell__detail-list {
    display: grid;
    grid-template-columns: minmax(140px, max-content) 1fr;
    column-gap: 24px;
    row-gap: 12px;
    margin: 0 0 4px;
    padding: 0;
}

.modal-shell__detail-list dt {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1.4;
    text-transform: uppercase;
}

.modal-shell__detail-list dd {
    margin: 0;
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    font-weight: 600;
}

.modal-shell__detail-list dd a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--color-primary);
    text-decoration: none;
}

.modal-shell__detail-list dd a:hover {
    text-decoration: underline;
}

.modal-shell__detail-meta {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
}

.modal-shell__detail-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.modal-shell__detail-status--success {
    background: color-mix(in srgb, var(--color-success) 14%, transparent);
    color: var(--color-success);
    border-color: color-mix(in srgb, var(--color-success) 32%, transparent);
}

.modal-shell__detail-status--danger {
    background: color-mix(in srgb, var(--color-danger) 14%, transparent);
    color: var(--color-danger);
    border-color: color-mix(in srgb, var(--color-danger) 32%, transparent);
}

/* Encabezado del detalle: «<timeline> <estado> <descripción>». Identifica el tipo
 * de cambio en la pantalla de aprobación, donde el detalle se despliega en línea
 * dentro de la fila y no dentro de un modal con título propio. */
.modal-shell__detail-heading {
    margin: 0 0 14px;
    color: var(--text);
    font-size: 15px;
    font-weight: 800;
    line-height: 1.4;
}

.modal-shell__detail-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.modal-shell__detail-section-title {
    margin: 0 0 10px;
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0;
}

/* `person_details` — el macro que pinta «Información del Dependiente» — sigue
 * emitiendo la rejilla Bootstrap de v2/v3 (.row / .col-sm-*), que v4 no estiliza:
 * sin esto, etiqueta y valor se apilan en una columna e indistinguibles entre sí.
 * Se acota al detalle del cambio porque `change_details` es su único invocador. */
.modal-shell__detail-section > .row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0 24px;
}

.modal-shell__detail-section .col-sm-6 > .row {
    display: grid;
    grid-template-columns: minmax(110px, 38%) 1fr;
    gap: 12px;
    align-items: baseline;
    padding: 6px 0;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 45%, transparent);
}

.modal-shell__detail-section .text-muted.small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.modal-shell__detail-section .col-sm-8 {
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    word-break: break-word;
}

.modal-shell__detail-section ul {
    margin: 0;
    padding-left: 18px;
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.6;
}

.modal-shell__detail-actions {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

/* ============================================================
 * Report index — list of available reports
 * Replaces the bg-white/gray Tailwind card grid with a token-driven
 * list that handles long Spanish translations, focus states, empty
 * permission state, and reduced-motion preferences.
 * ============================================================ */
.report-index__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--color-primary) 18%, transparent);
    color: var(--color-primary);
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
}

.report-index__list {
    list-style: none;
    margin: 0 16px 16px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    /* Isolate row hover/focus repaints from the rest of the page. */
    contain: layout style;
}

/* Ningun indice de reportes lleva cabecera —la repetia del breadcrumb—, asi que
   el margen superior que antes ponia el header lo pone aqui la propia lista.
   Las reglas del header se borraron al quedarse sin plantilla que las usara. */
.report-index__list--headerless {
    margin-top: 16px;
}

.report-index__item {
    margin: 0;
    padding: 0;
}

.report-index__link {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: var(--text-soft);
    text-decoration: none;
    transition:
        background-color 180ms cubic-bezier(0.22, 1, 0.36, 1),
        border-color 180ms cubic-bezier(0.22, 1, 0.36, 1),
        transform 180ms cubic-bezier(0.22, 1, 0.36, 1),
        color 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.report-index__link:hover {
    background: var(--surface-strong);
    border-color: var(--line);
    color: var(--text);
    transform: translateX(2px);
}

.report-index__link:focus-visible {
    outline: none;
    background: var(--surface-strong);
    border-color: var(--line-strong);
    color: var(--text);
    box-shadow: 0 0 0 3px var(--focus);
}

.report-index__link:active {
    transform: translateX(2px) scale(0.997);
}

.report-index__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--color-primary) 12%, transparent);
    color: var(--color-primary);
    flex-shrink: 0;
}

.report-index__link:hover .report-index__icon,
.report-index__link:focus-visible .report-index__icon {
    background: color-mix(in srgb, var(--color-primary) 20%, transparent);
}

.report-index__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.report-index__name {
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.3;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.report-index__description {
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 760;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.report-index__chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: var(--muted);
    opacity: 0.6;
    flex-shrink: 0;
    transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1), opacity 180ms ease, color 180ms ease;
}

.report-index__link:hover .report-index__chevron,
.report-index__link:focus-visible .report-index__chevron {
    color: var(--color-primary);
    opacity: 1;
    transform: translateX(2px);
}

.report-index__empty {
    padding: 56px 24px 64px;
}

.report-index__empty-help {
    margin: 0;
    max-width: 56ch;
    color: var(--muted);
    font-size: 13px;
    font-weight: 760;
    line-height: 1.55;
    text-wrap: pretty;
}

@media (prefers-reduced-motion: reduce) {
    .report-index__link,
    .report-index__chevron,
    .report-index__icon {
        transition: none;
    }

    .report-index__link:hover,
    .report-index__link:focus-visible,
    .report-index__link:active {
        transform: none;
    }

    .report-index__link:hover .report-index__chevron,
    .report-index__link:focus-visible .report-index__chevron {
        transform: none;
    }
}

/* ============================================================
 * Change password — token-driven authenticated form surface.
 * Replaces the Tailwind-default centered card that previously
 * overrode the body block and dropped the auth shell.
 * ============================================================ */
.change-password {
    padding: clamp(24px, 3vw, 36px);
}

.change-password__header {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 14px;
    align-items: center;
    margin-bottom: 18px;
}

.change-password__header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--color-primary) 14%, transparent);
    color: var(--color-primary);
}

.change-password__header-copy {
    min-width: 0;
}

.change-password__title {
    margin: 0 0 2px;
    color: var(--text);
    font-family: Inter, system-ui, sans-serif;
    font-size: 20px;
    font-weight: 850;
    line-height: 1.2;
}

.change-password__subtitle {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 760;
    line-height: 1.45;
    max-width: 60ch;
}

.change-password__force {
    display: grid;
    grid-template-columns: 22px 1fr;
    gap: 12px;
    align-items: start;
    margin: 8px 0 24px;
    padding: 14px 18px;
    border: 1px solid color-mix(in srgb, var(--color-accent) 38%, transparent);
    border-radius: 12px;
    background: color-mix(in srgb, var(--color-accent) 10%, transparent);
}

.change-password__force-icon {
    width: 22px;
    height: 22px;
    color: var(--color-accent);
}

.change-password__force-title {
    margin: 0 0 2px;
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
    line-height: 1.2;
}

.change-password__force-help {
    margin: 0;
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 760;
    line-height: 1.45;
}

.change-password__layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
    align-items: start;
}

@media (min-width: 880px) {
    .change-password__layout {
        grid-template-columns: minmax(0, 1fr) 280px;
    }
}

.change-password__form > form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.change-password__actions {
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
    margin-top: 8px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

@media (min-width: 640px) {
    .change-password__actions {
        flex-direction: row;
        justify-content: flex-end;
        align-items: center;
    }
}

/* Live requirement checklist. Shared by every password screen — the side column
 * on security/change_password.html.twig and the --inline variant that
 * form/theme.html.twig injects under each new-password field. */
.password-rules {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 18px;
    background: color-mix(in srgb, var(--surface) 60%, transparent);
}

/* Inline variant: sits between the new-password field and the confirm field, so
 * it has to read as a hint attached to the input rather than a standalone card. */
.password-rules--inline {
    margin-top: 10px;
    padding: 14px 16px;
}

.password-rules--inline .password-rules__title {
    margin-bottom: 10px;
    font-size: 10px;
}

.password-rules--inline .password-rules__list {
    gap: 7px;
}

/* Two columns from the width where a single column would leave the card lopsided. */
@media (min-width: 640px) {
    .password-rules--inline .password-rules__list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 18px;
    }
}

.password-rules--inline .password-rules__rule {
    font-size: 12px;
}

.password-rules__title {
    margin: 0 0 12px;
    color: var(--text);
    font-size: 11px;
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.password-rules__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.password-rules__rule {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-soft);
    font-size: 12.5px;
    font-weight: 760;
    line-height: 1.35;
    transition: color 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

.password-rules__rule.is-passing {
    color: var(--text);
}

/* Positioned slot holds both icons; absolute children overlap and swap via opacity. */
.password-rules__rule-icon-slot {
    position: relative;
    flex-shrink: 0;
    display: inline-block;
    width: 18px;
    height: 18px;
}

.password-rules__rule-icon {
    position: absolute;
    inset: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: opacity 220ms cubic-bezier(0.22, 1, 0.36, 1),
                transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* Defense in depth: pin SVG size in case the Tailwind w-/h- utility doesn't compile. */
.password-rules__rule-icon svg {
    width: 16px;
    height: 16px;
}

.password-rules__rule-icon--idle {
    color: var(--muted);
    opacity: 1;
    transform: scale(1);
}

.password-rules__rule-icon--passing {
    color: var(--color-primary);
    opacity: 0;
    transform: scale(0.85);
}

.password-rules__rule.is-passing .password-rules__rule-icon--idle {
    opacity: 0;
    transform: scale(0.85);
}

.password-rules__rule.is-passing .password-rules__rule-icon--passing {
    opacity: 1;
    transform: scale(1);
}

@media (prefers-reduced-motion: reduce) {
    .password-rules__rule,
    .password-rules__rule-icon {
        transition: none;
    }
    .password-rules__rule.is-passing .password-rules__rule-icon--idle,
    .password-rules__rule-icon--passing {
        transform: none;
    }
}

/* ============================================================
 * Profile workspace — employee dashboard / person view variant.
 * The page aggregates several macro-rendered sections (general info,
 * plan, dependents, pending/processed changes). The shared macros in
 * templates/macros/employee_profile.html.twig + person.html.twig
 * still emit Tailwind bg-white / gray-* utilities. The overrides
 * below scope a re-skin to the workspace, so the same macros can serve
 * admin and member views without forcing macro-level rewrites.
 *
 * The selector .auth-shell__workspace--profile beats Tailwind
 * single-class utilities on specificity (0,2,0 vs 0,1,0); no
 * !important needed.
 * ============================================================ */
.auth-shell__workspace--profile {
    padding: clamp(18px, 2.6vw, 30px);
    display: flex;
    flex-direction: column;
    gap: clamp(28px, 3.6vw, 44px);
}

/* The `person_general_info` macro wraps Información General in
   `bg-white rounded-xl shadow-sm border border-neutral-200`, a card
   pattern from before the dashboard was rebuilt around the
   `.employee-dashboard__panel` grammar (flat header + hairline rule
   + flat body). Plan Médico, Dependientes, Cambios Pendientes and
   Historial all use the panel grammar; Información General remained
   in the old card chrome and read as a card-in-card, with heavier
   weight than its siblings.

   Strip the card chrome inside the workspace so Información General
   joins the panel grammar. The workspace stays the only card; sections
   are siblings separated by hairline rules. */
.auth-shell__workspace--profile .bg-white.rounded-xl {
    background-color: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

[data-theme="light"] .auth-shell__workspace--profile .bg-white.rounded-xl {
    background-color: transparent;
    border: 0;
    box-shadow: none;
}

/* The macro emits the section header as `px-8 py-6 border-b
   border-neutral-200`. Reshape it to match `.employee-dashboard__
   panel-header`: flush left, 18px vertical pad, stronger themed
   underline so the section reads as a chapter start, not a list row. */
.auth-shell__workspace--profile .bg-white.rounded-xl > .px-8.py-6 {
    padding-left: 0;
    padding-right: 0;
    padding-top: 18px;
    padding-bottom: 18px;
    border-color: var(--line-strong);
}

/* The macro pads the body 32px on every side. Workspace already pads
   ~30px around; another 32px stacks dead air. Drop horizontal pad to
   match the panel-row rhythm; keep a small top breath under the
   header rule. */
.auth-shell__workspace--profile .bg-white.rounded-xl > .p-8 {
    padding: 24px 0 8px;
}

/* "Asegurado Principal" mini-card inside the Contacto column emits
   `p-4 bg-primary-50 rounded-lg border border-primary-200` — a third
   level of nested card. Demote to a tinted block aligned to the
   column rhythm so it reads as a labeled note, not a stacked tile. */
.auth-shell__workspace--profile .bg-primary-50 {
    padding: 12px 14px;
    background: color-mix(in srgb, var(--color-primary) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--color-primary) 22%, transparent);
    border-radius: 10px;
}

/* Buttons / chips that ship `bg-white` (Editar dependientes, rounded-lg
   ghost actions) keep a quiet surface treatment without the section-card
   blur. */
.auth-shell__workspace--profile .bg-white.rounded-lg,
.auth-shell__workspace--profile button.bg-white,
.auth-shell__workspace--profile a.bg-white {
    background-color: var(--surface);
}

/* The Plan Médico macro nests a second `bg-white rounded-xl` inside the
   first — DESIGN.md prohibits nested cards. Flatten the inner one so it
   reads as a region within the section, not a stacked surface. */
.auth-shell__workspace--profile .bg-white.rounded-xl .bg-white.rounded-xl {
    background-color: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

/* Workspace > nested empty-state container ships also `bg-white` along
   the way (auth-shell scopes the rule above) plus a `bg-gray-100` ring
   on the icon. Lift the icon ring to a quieter brand tint so empty states
   read as "intentional placeholder" not "ghost element". */
.auth-shell__workspace--profile .bg-gray-100.rounded-full {
    background-color: color-mix(in srgb, var(--color-primary) 10%, transparent);
}

/* Dependent rows: the macro paints each row as
   `bg-gray-50 rounded-lg border border-gray-200`, which read as a third
   card level inside the workspace. Reduce to a list-style row, hover
   tint, hairline top divider, so the workspace stays the only card in
   the page. The macro's `space-y-3` gap between rows is neutralized so
   the hairline reads as a continuous list rule, not a stack of
   separated tiles. */
.auth-shell__workspace--profile .bg-gray-50 {
    background-color: transparent;
    border-radius: 0;
}

.auth-shell__workspace--profile .space-y-3 > .bg-gray-50 {
    border-top: 1px solid var(--line);
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
}

.auth-shell__workspace--profile .space-y-3 > .bg-gray-50:first-child {
    border-top: 0;
}

.auth-shell__workspace--profile .space-y-3 > * + * {
    margin-top: 0;
}

.auth-shell__workspace--profile .bg-gray-100 {
    background-color: var(--surface-strong);
}

.auth-shell__workspace--profile .hover\:bg-gray-50:hover,
.auth-shell__workspace--profile .hover\:bg-gray-100:hover {
    background-color: var(--surface-strong);
}

/* Brand chip / avatar tints. */
.auth-shell__workspace--profile .bg-green-100 {
    background-color: color-mix(in srgb, var(--color-primary) 18%, transparent);
}

.auth-shell__workspace--profile .bg-amber-50,
.auth-shell__workspace--profile .hover\:bg-amber-50:hover {
    background-color: color-mix(in srgb, var(--color-highlight) 14%, transparent);
}

/* Active-tab background ("Seleccionar Plan") and Cambiar-plan hover surface.
   Without this rule the macro's `bg-green-50` / `hover:bg-green-50` falls
   through to raw Tailwind green-50, which doesn't honor per-sponsor brand. */
.auth-shell__workspace--profile .bg-green-50,
.auth-shell__workspace--profile .hover\:bg-green-50:hover {
    background-color: color-mix(in srgb, var(--color-primary) 12%, transparent);
}

.auth-shell__workspace--profile .bg-amber-100 {
    background-color: color-mix(in srgb, var(--color-highlight) 22%, transparent);
}

.auth-shell__workspace--profile .bg-blue-100 {
    background-color: color-mix(in srgb, var(--color-secondary) 18%, transparent);
}

.auth-shell__workspace--profile .bg-red-50,
.auth-shell__workspace--profile .hover\:bg-red-50:hover {
    background-color: color-mix(in srgb, var(--color-danger) 14%, transparent);
}

/* Text colors: gray scale -> token text/muted; brand greens/ambers/reds
   -> sponsor brand tokens. Non-brand status hues (blue) -> secondary. */
.auth-shell__workspace--profile .text-gray-900,
.auth-shell__workspace--profile .text-gray-800 {
    color: var(--text);
}

.auth-shell__workspace--profile .text-gray-700,
.auth-shell__workspace--profile .text-gray-600 {
    color: var(--text-soft);
}

.auth-shell__workspace--profile .text-gray-500,
.auth-shell__workspace--profile .text-gray-400 {
    color: var(--muted);
}

/* Macro labels via text-neutral-* (e.g. "Nombre", "Seguro Social"). The
   600 step on a dark frame reads as drift; pull it up to muted so labels
   sit above placeholder threshold without competing with values. */
.auth-shell__workspace--profile .text-neutral-900 {
    color: var(--text);
}

.auth-shell__workspace--profile .text-neutral-600 {
    color: var(--muted);
}

.auth-shell__workspace--profile .border-neutral-200 {
    border-color: var(--line);
}

.auth-shell__workspace--profile .hover\:text-gray-700:hover,
.auth-shell__workspace--profile .hover\:text-gray-900:hover {
    color: var(--text);
}

/* Brand inline text/icons. The macros use text-green-* for branded
   inline pieces (cost-detail $, "Cambiar plan", "Ver detalles", row
   links). Mapping straight to --color-primary collapses to near
   invisible on the dark frame when a sponsor's primary is dark
   (FirstBank navy #1A3458). Mix the brand with --text so the inline
   piece keeps brand voice but stays readable across the per-sponsor
   spectrum. Chip foregrounds (bg-X-100 + text-X-800) are handled by
   the compound rule below; their higher specificity wins. */
.auth-shell__workspace--profile .text-green-600,
.auth-shell__workspace--profile .text-green-700,
.auth-shell__workspace--profile .text-green-800,
.auth-shell__workspace--profile .hover\:text-green-600:hover,
.auth-shell__workspace--profile .hover\:text-green-700:hover {
    color: color-mix(in srgb, var(--color-primary) 50%, var(--text));
}

[data-theme="light"] .auth-shell__workspace--profile .text-green-600,
[data-theme="light"] .auth-shell__workspace--profile .text-green-700,
[data-theme="light"] .auth-shell__workspace--profile .text-green-800,
[data-theme="light"] .auth-shell__workspace--profile .hover\:text-green-600:hover,
[data-theme="light"] .auth-shell__workspace--profile .hover\:text-green-700:hover {
    color: var(--color-primary);
}

.auth-shell__workspace--profile .text-amber-500,
.auth-shell__workspace--profile .text-amber-600,
.auth-shell__workspace--profile .text-amber-700,
.auth-shell__workspace--profile .text-amber-800 {
    color: var(--color-highlight);
}

.auth-shell__workspace--profile .text-blue-700,
.auth-shell__workspace--profile .text-blue-800 {
    color: var(--color-secondary);
}

/* Destructive red is a SAFETY signal — it must read as "danger" regardless
   of how the sponsor configured `--color-accent`. FirstBank's accent is
   teal (#3FA796), which collapses cancel/destroy actions into the same
   hue family as primary brand. Using `--color-danger` (semantic, non-brand,
   fixed across themes) keeps the red/coral read intact. */
.auth-shell__workspace--profile .text-red-600,
.auth-shell__workspace--profile .text-red-700,
.auth-shell__workspace--profile .text-red-800,
.auth-shell__workspace--profile .hover\:text-red-700:hover {
    color: var(--color-danger);
}

.auth-shell__workspace--profile .bg-red-100 {
    background-color: color-mix(in srgb, var(--color-danger) 18%, transparent);
}

.auth-shell__workspace--profile .bg-red-100.text-red-800,
.auth-shell__workspace--profile .bg-red-100 .text-red-800 {
    color: var(--color-danger);
}

[data-theme="light"] .auth-shell__workspace--profile .bg-red-100.text-red-800,
[data-theme="light"] .auth-shell__workspace--profile .bg-red-100 .text-red-800 {
    color: var(--color-danger);
}

/* Chip text contrast safety net.
   The macros pair `bg-X-100` with `text-X-700/800`. With the brand-token
   mapping above, both bg and text resolve to the same brand color at
   different alphas, which collapses to invisible when a sponsor's
   brand-primary is dark (e.g. FirstBank navy #1A3458 on the deep
   teal-black frame). Force --text on chip foregrounds in dark mode so
   chips stay legible across the per-sponsor brand spectrum; the bg
   tint still carries the semantic. Light mode keeps brand-color text
   since the cream paper preserves contrast.
   Compound .X.Y selectors handle the same-element case (badges); the
   descendant .X .Y selectors handle the wrapper+inner-span case
   (dependent avatar initials). */
.auth-shell__workspace--profile .bg-green-100.text-green-800,
.auth-shell__workspace--profile .bg-green-100 .text-green-700,
.auth-shell__workspace--profile .bg-green-100 .text-green-800,
.auth-shell__workspace--profile .bg-blue-100.text-blue-800,
.auth-shell__workspace--profile .bg-blue-100 .text-blue-800,
.auth-shell__workspace--profile .bg-amber-100.text-amber-800,
.auth-shell__workspace--profile .bg-amber-100 .text-amber-800 {
    color: var(--text);
}

[data-theme="light"] .auth-shell__workspace--profile .bg-green-100.text-green-800,
[data-theme="light"] .auth-shell__workspace--profile .bg-green-100 .text-green-700,
[data-theme="light"] .auth-shell__workspace--profile .bg-green-100 .text-green-800 {
    color: var(--color-primary);
}

[data-theme="light"] .auth-shell__workspace--profile .bg-blue-100.text-blue-800,
[data-theme="light"] .auth-shell__workspace--profile .bg-blue-100 .text-blue-800 {
    color: var(--color-secondary);
}

[data-theme="light"] .auth-shell__workspace--profile .bg-amber-100.text-amber-800,
[data-theme="light"] .auth-shell__workspace--profile .bg-amber-100 .text-amber-800 {
    color: var(--color-highlight);
}

/* Red chips left to the dedicated --color-danger block above. */

/* Borders + dividers. */
.auth-shell__workspace--profile .border-gray-100,
.auth-shell__workspace--profile .border-gray-200 {
    border-color: var(--line);
}

.auth-shell__workspace--profile .border-gray-300,
.auth-shell__workspace--profile .hover\:border-gray-300:hover {
    border-color: var(--line-strong);
}

.auth-shell__workspace--profile .border-green-600 {
    border-color: var(--color-primary);
}

.auth-shell__workspace--profile .border-amber-200 {
    border-color: color-mix(in srgb, var(--color-highlight) 36%, transparent);
}

.auth-shell__workspace--profile .divide-gray-100 > * + *,
.auth-shell__workspace--profile .divide-gray-200 > * + * {
    border-color: var(--line);
}

/* The macros pair `bg-white` with `rounded-xl shadow-sm`; the inner-card
   block above already replaces both surface and shadow with the
   frosted-glass-lite treatment, so we let `rounded-xl` and `shadow-sm`
   land on top harmlessly. */

/* Primary CTA buttons emitted by the macros (bg-green-600 + hover green-700).
   These are "do the thing" actions (Añadir Dependiente, Seleccionar Plan).
   They anchor to --color-primary, like every other in-product primary
   button: a member should see the sponsor's brand on the actions inside the
   product. --color-cta is reserved for the landing CTA alone — it is the only
   button a visitor meets before knowing whose exchange this is (LAR-483).
   Before that ticket this block anchored to --color-cta, which made the
   sponsor's configured primary colour unable to reach these buttons. */
.auth-shell__workspace--profile a.bg-green-600,
.auth-shell__workspace--profile button.bg-green-600 {
    background: linear-gradient(135deg,
        var(--color-primary),
        color-mix(in srgb, var(--color-primary) 86%, var(--frame)));
    border: 1px solid color-mix(in srgb, var(--color-primary) 36%, transparent);
    color: var(--cta-text);
    box-shadow:
        0 12px 28px color-mix(in srgb, var(--color-primary) 22%, transparent),
        0 0 0 6px color-mix(in srgb, var(--color-primary) 8%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.auth-shell__workspace--profile a.bg-green-600:hover,
.auth-shell__workspace--profile button.bg-green-600:hover {
    transform: translateY(-1px);
    box-shadow:
        0 16px 32px color-mix(in srgb, var(--color-primary) 30%, transparent),
        0 0 0 7px color-mix(in srgb, var(--color-primary) 12%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

@media (prefers-reduced-motion: reduce) {
    .auth-shell__workspace--profile a.bg-green-600:hover,
    .auth-shell__workspace--profile button.bg-green-600:hover {
        transform: none;
    }
}

/* ============================================================
 * Macro typography normalization
 *
 * The macros (employee_profile.html.twig + person.html.twig) emit
 * Tailwind utilities that pre-date the design system: text-lg/font-medium
 * for field values (18px / 500), text-sm/font-medium for labels
 * (14px / 500), and font-display on section headings. The DESIGN.md
 * type scale is heavier and tighter (Title 20/800, Body-Strong 13/800,
 * Label-Caps 11/760/uppercase, no display font in product UI).
 *
 * Rather than rewrite both macros (which still serve admin views with
 * their own polish in flight), the rules below remap the macro classes
 * to the system scale, scoped to .auth-shell__workspace--profile so
 * non-employee surfaces are unaffected.
 * ============================================================ */

/* Section h2 (Información General, Plan Médico, Dependientes). The macro
   uses text-xl + font-display + font-bold OR text-xl + font-semibold.
   Both collapse to the system Title spec: Inter 20px / 800. */
.auth-shell__workspace--profile h2.font-display,
.auth-shell__workspace--profile h2.font-semibold {
    font-family: Inter, ui-sans-serif, system-ui, sans-serif;
    font-weight: 800;
    letter-spacing: 0;
}

/* Section icons adjacent to h2 (Información General's user, Plan Médico's
   heart, Dependientes' users). The macro paints them with text-primary-600
   or text-gray-400. Tailwind's primary-N shades are not generated, so
   text-primary-600 falls through to inherited white; text-gray-400 was
   already mapped to --muted by the color-override block above. Both
   read as drift against the .employee-dashboard__panel-title-icon
   pattern, which brand-tints every section icon. Re-qualify both
   utility classes here so the brand color wins on specificity. */
.auth-shell__workspace--profile div:has(> h2) > svg.text-gray-400,
.auth-shell__workspace--profile div:has(> h2) > svg.text-primary-600 {
    color: var(--color-primary);
}

/* Field labels rendered by person_general_info as
   `block text-sm font-medium text-neutral-600`. Drop to Label-Caps
   (DESIGN.md: 11px / 760 / 0.08em / uppercase) so labels sit above
   placeholder threshold without competing with values. */
.auth-shell__workspace--profile label.text-sm.font-medium {
    font-size: 11px;
    font-weight: 760;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
}

/* Group titles for the 3-column grid in person_general_info. They give the
   eye three landing points (Identidad / Empleo / Contacto) so the 11
   label-value rows underneath stop reading as a flat audit log. The
   tracked, brand-tinted line + hairline rule mirrors the workspace's
   existing column-divider grammar. */
.auth-shell__workspace--profile .person-general-info__group-title {
    margin: 0 0 18px;
    padding-bottom: 12px;
    color: var(--color-primary);
    font-size: 11px;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--line);
}

/* Vertical hairlines between the 3 groups on lg+ screens. Inserts a
   subtle divider so columns read as bound regions rather than three
   stacks of text floating in space. Stops at the breakpoint where
   the grid collapses to a single column (lg). */
@media (min-width: 1024px) {
    .auth-shell__workspace--profile .person-general-info__grid > div + div {
        position: relative;
    }

    .auth-shell__workspace--profile .person-general-info__grid > div + div::before {
        content: "";
        position: absolute;
        left: -16px;
        top: 0;
        bottom: 0;
        width: 1px;
        background: var(--line);
    }
}

/* Field values rendered as `text-neutral-900 font-medium text-lg`.
   Drop to Body-Strong (DESIGN.md: 13px / 800) so dense data stays
   readable without shouting. The macro's `text-lg` reads as a display
   choice from a different system; correct it here. */
.auth-shell__workspace--profile .text-lg.font-medium {
    font-size: 13px;
    font-weight: 800;
    line-height: 1.45;
}

/* Empty-state heading inside Plan Médico ("No ha seleccionado su plan").
   Macro emits `text-lg font-semibold`; bring to a Title-light step
   (16px / 850) so it reads as a heading distinct from the surrounding
   13px body but a clear step below the section h2. */
.auth-shell__workspace--profile h3.text-lg.font-semibold {
    font-size: 16px;
    font-weight: 850;
    line-height: 1.25;
}

/* Empty-state body copy. 14px is fine; weight bump to 760 matches the
   project Body scale instead of inherited 400. Width cap sits above the
   65-75ch rule from shared design laws (the macro already constrains
   with max-w-sm). */
.auth-shell__workspace--profile p.text-sm.text-gray-600 {
    font-weight: 760;
}

/* Inline action buttons emitted by the macros (Cancelar, Cambiar,
   Beneficiarios tab, Actualizar SSN, etc.) ship with text-sm font-medium
   = 14/500. The system spec for any pill/inline action is Body-Strong
   (13/800) so the visual weight matches the primary buttons sitting next
   to them. Excludes label.text-sm.font-medium since that already maps
   to Label-Caps above. */
.auth-shell__workspace--profile a.text-sm.font-medium,
.auth-shell__workspace--profile button.text-sm.font-medium {
    font-size: 13px;
    font-weight: 800;
}

/* Composition tier badge ("Individual", "Familiar") + status badges
   (Cancelado, SSN Requerido) emitted as inline-flex pills with
   text-xs font-medium = 12/500. Brand label scale is 12px / 900 with
   tighter line height; bring badges to that. */
.auth-shell__workspace--profile span.text-xs.font-medium {
    font-size: 12px;
    font-weight: 900;
    line-height: 1.2;
}

/* Effective-period inline label ("PERÍODO EFECTIVO") emitted as
   text-xs uppercase tracking-wider font-medium. Already uppercase from
   the Tailwind class; weight bump to match the Label-Caps spec. */
.auth-shell__workspace--profile p.text-xs.uppercase {
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.08em;
    line-height: 1.2;
}

/* Address block uses font-normal not-italic to override the macro's
   inherited weight. Keep italic suppressed but lift weight to body
   so the address reads coherent with surrounding 13/800 values. */
.auth-shell__workspace--profile address.font-normal {
    font-weight: 760;
}

/* Primary action buttons emitted by the macro carry no font-size class,
   so inherit 16px from html and font-medium (500). Bring to the system
   primary-button typography (13px / 800) per DESIGN.md button-primary. */
.auth-shell__workspace--profile a.bg-green-600,
.auth-shell__workspace--profile button.bg-green-600 {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0;
}

/* Cost-detail "$" trigger sitting between the composition tier badge
   and the dates column. Macro emits an icon-only round button with
   text-green-600, which collapses to a near-invisible mid-tone after
   the brand remap and reads as orphaned next to the "Individual" pill.
   Treat as a tonal chip: tinted brand surface + brand foreground, so
   it parses as an info trigger paired with the badge instead of a
   loose action floating in the title row. */
.auth-shell__workspace--profile [data-controller="medical-plan"] [data-controller="tooltip"] > button {
    width: auto;
    height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--color-primary) 18%, transparent);
    color: var(--text);
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
}

.auth-shell__workspace--profile [data-controller="medical-plan"] [data-controller="tooltip"] > button:hover {
    background: color-mix(in srgb, var(--color-primary) 28%, transparent);
    color: var(--text);
}

.auth-shell__workspace--profile [data-controller="medical-plan"] [data-controller="tooltip"] > button svg {
    width: 14px;
    height: 14px;
}

/* Duplicate primary CTA in the Dependientes empty state. The shared
   macro renders the same `bg-green-600` button in the section header
   and inside the empty-state hero, breaking the one-primary-CTA-per-
   screen rule (DESIGN.md primary-action). The header is the canonical
   primary; demote the inline empty-state CTA to a secondary outline
   so the eye lands on the header action and the empty state still
   reinforces the affordance without duplicating weight. Scoped via
   :has() so the demotion only fires inside the Dependientes empty
   state, not in the Plan Médico empty state (which has no header
   CTA and so the inline button must remain primary). */
.auth-shell__workspace--profile [data-controller="dependents"] .py-12 > a.bg-green-600 {
    background: transparent;
    border: 1px solid var(--line-strong);
    color: var(--text);
    box-shadow: none;
}

.auth-shell__workspace--profile [data-controller="dependents"] .py-12 > a.bg-green-600:hover {
    background: var(--surface-strong);
    color: var(--text);
    transform: none;
    box-shadow: none;
}

/* ============================================================
 * Profile header — workspace identity strip
 *
 * Avatar (initials) + "Mi Perfil" eyebrow + employee display name +
 * sponsor + period selector. Anchors the workspace as a profile
 * surface and gives the period selector a discoverable home so it
 * doesn't hide between data sections.
 *
 * Dynamic data, no hard-coding:
 *   - Long names truncate via CSS ellipsis with the full string in
 *     `title` for hover-reveal (set on the markup side).
 *   - Sponsor name follows the same rule.
 *   - Period selector is omitted when there's only one segment, so
 *     the header naturally collapses to identity-only.
 *   - At narrow widths the header stacks identity above period and
 *     the period select goes full width.
 * ============================================================ */
.profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(20px, 3vw, 36px);
    padding: 4px 0 24px;
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
}

/* Controles al extremo derecho de la cabecera, en columna: el menu de acciones
   arriba y el selector de periodo debajo. align-self evita centrar la columna
   contra el bloque de identidad, de modo que el menu queda a la altura del
   nombre en vez de flotar entre ambas lineas. */
.profile-header__controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    align-self: flex-start;
    gap: 14px;
}

/* Estado de la cuenta bajo el nombre, dentro del bloque de identidad. El
   margen lo separa del nombre del patrono, que usa gap 2px. */
.profile-header__status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.profile-header__status-label {
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 800;
}

.profile-header__identity {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
    flex: 1 1 auto;
}

.profile-header__avatar {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--color-primary) 28%, transparent),
        color-mix(in srgb, var(--color-secondary) 22%, transparent));
    border: 1px solid color-mix(in srgb, var(--color-primary) 36%, transparent);
    color: var(--color-primary);
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 0.02em;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 8px 22px color-mix(in srgb, var(--color-primary) 14%, transparent);
}

[data-theme="light"] .profile-header__avatar {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        0 6px 16px color-mix(in srgb, var(--color-primary) 12%, transparent);
}

.profile-header__copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.profile-header__eyebrow {
    margin: 0;
    color: var(--color-primary);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.12em;
    line-height: 1.1;
    text-transform: uppercase;
}

.profile-header__name {
    margin: 0;
    color: var(--text);
    font-size: clamp(22px, 2.6vw, 28px);
    font-weight: 850;
    line-height: 1.15;
    letter-spacing: -0.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-header__sponsor {
    margin: 2px 0 0;
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 760;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-header__period {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
    min-width: 240px;
    max-width: 100%;
}

.profile-header__period-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
}

.profile-header__period-icon {
    width: 14px;
    height: 14px;
    color: var(--color-primary);
}

.profile-header__period-select {
    width: 100%;
    min-width: 240px;
}

@media (max-width: 720px) {
    .profile-header {
        gap: 18px;
        padding-bottom: 18px;
    }
    .profile-header__period {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 480px) {
    .profile-header__avatar {
        width: 48px;
        height: 48px;
        border-radius: 14px;
        font-size: 18px;
    }
    .profile-header__identity {
        gap: 14px;
    }
}

/* Inline alert: SSN warning. Tinted highlight surface, no
   exclamation-iconography drama. The badge brand-tints to highlight. */
.employee-dashboard__alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border: 1px solid color-mix(in srgb, var(--color-highlight) 38%, transparent);
    border-radius: 12px;
    background: color-mix(in srgb, var(--color-highlight) 14%, transparent);
}

.employee-dashboard__alert-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--color-highlight);
}

.employee-dashboard__alert-body {
    margin: 0;
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 760;
    line-height: 1.5;
    max-width: 70ch;
}

/* Collapsible sections: pending changes, processed history.
   No card surface (the workspace is the only card). Header is a
   clickable row with a hairline rule below; expanded body flows
   underneath it. Matches the macro section pattern (heading + rule
   + content) so panels live as siblings to "Información General",
   "Plan Médico", "Dependientes", not as nested cards. */
.employee-dashboard__panel {
    border: 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.employee-dashboard__panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 18px 0;
    border: 0;
    border-bottom: 1px solid var(--line-strong);
    background: transparent;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background-color 180ms ease;
}

.employee-dashboard__panel-header:hover {
    background: transparent;
    color: var(--color-primary);
}

[data-theme="light"] .employee-dashboard__panel-header:hover {
    color: var(--color-primary);
}

.employee-dashboard__panel-header:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--color-primary) 50%, var(--text));
    outline-offset: 2px;
    border-radius: 4px;
}

.employee-dashboard__panel-title {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 0.01em;
    line-height: 1.2;
}

.employee-dashboard__panel-title-icon {
    color: var(--color-primary);
}

.employee-dashboard__panel-counter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--color-highlight) 22%, transparent);
    color: var(--color-highlight);
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
}

.employee-dashboard__panel-chevron {
    color: var(--muted);
    transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.employee-dashboard__panel-header[aria-expanded="true"] .employee-dashboard__panel-chevron {
    transform: rotate(180deg);
}

.employee-dashboard__panel-body {
    border-top: 0;
    padding-top: 16px;
}

.employee-dashboard__panel-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    transition: background-color 140ms ease;
}

.employee-dashboard__panel-row + .employee-dashboard__panel-row {
    border-top: 1px solid var(--line);
}

.employee-dashboard__panel-row:hover {
    background: transparent;
}

.employee-dashboard__panel-row-action {
    margin: 0 0 2px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 760;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
}

.employee-dashboard__panel-row-subject {
    margin: 0;
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.4;
}

.employee-dashboard__panel-row-aside {
    flex-shrink: 0;
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 700;
    text-align: right;
}

.employee-dashboard__panel-row-aside-label {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 760;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
}

.employee-dashboard__panel-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: color-mix(in srgb, var(--color-primary) 50%, var(--text));
    font-size: 12px;
    font-weight: 850;
    text-decoration: none;
    transition: color 180ms ease, transform 180ms ease;
}

[data-theme="light"] .employee-dashboard__panel-link {
    color: var(--color-primary);
}

.employee-dashboard__panel-link:hover {
    color: var(--text);
    transform: translateX(2px);
}

@media (prefers-reduced-motion: reduce) {
    .employee-dashboard__panel-chevron,
    .employee-dashboard__panel-link {
        transition: none;
    }
    .employee-dashboard__panel-link:hover {
        transform: none;
    }
}

/* Narrow-viewport rebalance. The macros render dense headers (icon +
   long Spanish title + counter pill + chevron/link) that compete for
   horizontal space below ~540px. Drop padding, shrink title scale, and
   stack the panel rows so subject and aside don't fight on the same
   line. */
@media (max-width: 540px) {
    .auth-shell__workspace--profile {
        padding: clamp(12px, 4vw, 20px);
        gap: 16px;
    }

    .employee-dashboard__panel-header {
        padding: 12px 14px;
        gap: 10px;
    }

    .employee-dashboard__panel-title {
        gap: 8px;
        font-size: 13px;
        line-height: 1.3;
    }

    .employee-dashboard__panel-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 12px 14px;
    }

    .employee-dashboard__panel-row-aside {
        text-align: left;
    }

    .employee-dashboard__panel-link {
        font-size: 11px;
        white-space: nowrap;
    }
}

/* ============================================================
 * Dashboard panel components — shared between the employee
 * dashboard (member-facing) and the admin person profile (rep).
 * Rules:
 *   - No nested cards. The auth-shell workspace is the only card.
 *     Panels live inline as siblings, separated by hairline rules.
 *   - All color goes through var(--color-primary / -secondary /
 *     -accent / -highlight) so per-sponsor branding holds.
 *   - No #fff or pure black; tinted neutrals only.
 * ============================================================ */

/* Right-aligned cluster in panel headers: action chips, links, etc. */
.employee-dashboard__panel-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Pill-shaped panel-header action chip. Ghost by default, with
   primary / cta / danger / warning variants. Replaces the legacy
   bg-white border + green-600 utility chains. */
.dashboard-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.dashboard-action:hover {
    background: var(--surface-strong);
    border-color: var(--line-strong);
    color: var(--text);
    transform: translateY(-1px);
}

.dashboard-action:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}

.dashboard-action--primary {
    background: color-mix(in srgb, var(--color-primary) 16%, transparent);
    border-color: color-mix(in srgb, var(--color-primary) 36%, transparent);
    color: var(--color-primary);
}

.dashboard-action--primary:hover {
    background: color-mix(in srgb, var(--color-primary) 26%, transparent);
    border-color: color-mix(in srgb, var(--color-primary) 56%, transparent);
    color: var(--color-primary);
}

.dashboard-action--cta {
    height: 36px;
    padding: 0 16px;
    background: var(--color-primary);
    border-color: color-mix(in srgb, var(--color-primary) 84%, #06120E);
    color: #FFFFFF;
    box-shadow:
        0 8px 22px color-mix(in srgb, var(--color-primary) 28%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
    font-weight: 850;
}

.dashboard-action--cta:hover {
    background: color-mix(in srgb, var(--color-primary) 88%, #06120E);
    color: #FFFFFF;
    box-shadow:
        0 12px 30px color-mix(in srgb, var(--color-primary) 38%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.dashboard-action--danger {
    color: color-mix(in srgb, var(--color-accent) 60%, var(--text));
    border-color: color-mix(in srgb, var(--color-accent) 30%, transparent);
}

.dashboard-action--danger:hover {
    background: color-mix(in srgb, var(--color-accent) 14%, transparent);
    border-color: color-mix(in srgb, var(--color-accent) 50%, transparent);
    color: var(--color-accent);
}

.dashboard-action--warning {
    background: color-mix(in srgb, var(--color-highlight) 14%, transparent);
    border-color: color-mix(in srgb, var(--color-highlight) 36%, transparent);
    color: color-mix(in srgb, var(--color-highlight) 50%, var(--text));
}

[data-theme="light"] .dashboard-action--warning {
    color: color-mix(in srgb, var(--color-highlight) 30%, var(--text));
}

.dashboard-action--warning:hover {
    background: color-mix(in srgb, var(--color-highlight) 24%, transparent);
    border-color: color-mix(in srgb, var(--color-highlight) 56%, transparent);
}

.dashboard-action__icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .dashboard-action__label--hide-narrow {
        display: none;
    }
}

/* Brand-tinted pill badge, replaces bg-N-100 text-N-800 utility chain. */
.dashboard-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 11px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--color-primary) 22%, transparent);
    border: 1px solid color-mix(in srgb, var(--color-primary) 44%, transparent);
    color: color-mix(in srgb, var(--color-primary) 88%, var(--text));
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.04em;
    line-height: 1;
    white-space: nowrap;
}

[data-theme="light"] .dashboard-badge {
    color: var(--color-primary);
}

.dashboard-badge--secondary {
    background: color-mix(in srgb, var(--color-secondary) 18%, transparent);
    border-color: color-mix(in srgb, var(--color-secondary) 38%, transparent);
    color: color-mix(in srgb, var(--color-secondary) 58%, var(--text));
}

[data-theme="light"] .dashboard-badge--secondary {
    color: var(--color-secondary);
}

.dashboard-badge--neutral {
    background: var(--surface);
    border-color: var(--line);
    color: var(--text-soft);
}

/* Same reasoning as .auth-shell__badge--danger: semantic state, semantic token. */
.dashboard-badge--danger {
    background: color-mix(in srgb, var(--color-danger) 14%, transparent);
    border-color: color-mix(in srgb, var(--color-danger) 38%, transparent);
    color: color-mix(in srgb, var(--color-danger) 70%, var(--text));
}

.dashboard-badge--warning {
    background: color-mix(in srgb, var(--color-highlight) 18%, transparent);
    border-color: color-mix(in srgb, var(--color-highlight) 40%, transparent);
    color: color-mix(in srgb, var(--color-highlight) 60%, var(--text));
}

.dashboard-badge__icon {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
}

/* Plan Médico — single product row inside the panel body. The row
   carries dense affordances (logo, plan name, tier badge, cost
   trigger, period dates, cancel pill); generous gaps between the
   left "what" cluster and the right "when + action" cluster keep
   them from reading as a single button strip. */
.dashboard-product {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(28px, 4vw, 48px);
    padding: 24px 0 12px;
    flex-wrap: wrap;
}

.dashboard-product--disabled {
    opacity: 0.55;
}

.dashboard-product__main {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
    flex: 1 1 320px;
}

.dashboard-product__carrier {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 130px;
    height: 56px;
    padding: 8px 12px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
}

.dashboard-product__carrier img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.dashboard-product__details {
    min-width: 0;
    flex: 1;
}

.dashboard-product__name {
    margin: 0 0 10px;
    color: var(--text);
    font-size: clamp(20px, 2.2vw, 24px);
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

.dashboard-product__name a {
    color: inherit;
    text-decoration: none;
    transition: color 180ms ease;
}

.dashboard-product__name a:hover {
    color: var(--color-primary);
}

.dashboard-product__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.dashboard-product__cost-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--color-primary) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--color-primary) 30%, transparent);
    color: var(--color-primary);
    cursor: pointer;
    transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.dashboard-product__cost-btn:hover {
    background: color-mix(in srgb, var(--color-primary) 24%, transparent);
    border-color: color-mix(in srgb, var(--color-primary) 50%, transparent);
    transform: translateY(-1px);
}

.dashboard-product__cost-btn svg {
    width: 14px;
    height: 14px;
}

.dashboard-product__addons {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 760;
    line-height: 1.4;
}

.dashboard-product__aside {
    display: flex;
    align-items: center;
    gap: clamp(20px, 2.6vw, 32px);
    flex-wrap: wrap;
    flex-shrink: 0;
}

.dashboard-product__period {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: right;
}

.dashboard-product__period-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 760;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
}

.dashboard-product__period-value {
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.4;
}

.dashboard-product__actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 720px) {
    .dashboard-product__period {
        text-align: left;
    }
}

/* Empty state inside a panel body — replaces the bg-gray-100 circle
   + heart-icon block. Centered, brand-tinted disc, single CTA. */
.dashboard-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px 24px 16px;
    gap: 10px;
}

.dashboard-empty--disabled {
    opacity: 0.55;
}

.dashboard-empty__icon {
    width: 56px;
    height: 56px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--color-primary) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--color-primary) 28%, transparent);
    color: var(--color-primary);
    margin-bottom: 4px;
}

.dashboard-empty__icon svg {
    width: 26px;
    height: 26px;
}

.dashboard-empty__title {
    margin: 0;
    color: var(--text);
    font-size: 16px;
    font-weight: 850;
    line-height: 1.2;
}

.dashboard-empty__body {
    margin: 0 0 6px;
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 760;
    line-height: 1.5;
    max-width: 44ch;
}

/* Inline informational chip — used for "Actualice el SSN" context
   inside the Dependientes header, replaces the bg-amber-50 utility chain. */
.dashboard-info-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--color-highlight) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--color-highlight) 38%, transparent);
    color: color-mix(in srgb, var(--color-highlight) 50%, var(--text));
    font-size: 12px;
    font-weight: 760;
    line-height: 1.3;
    max-width: 340px;
}

[data-theme="light"] .dashboard-info-chip {
    color: color-mix(in srgb, var(--color-highlight) 30%, var(--text));
}

.dashboard-info-chip__icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--color-highlight);
}

/* Dependent rows — replaces bg-gray-50 nested cards with inline,
   hairline-separated rows that hover-tint via var(--surface). */
.dashboard-dep-list {
    display: flex;
    flex-direction: column;
    padding: 4px 0 0;
}

.dashboard-dep-list--disabled {
    opacity: 0.55;
}

.dashboard-dep-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 12px;
    margin: 0 -12px;
    border-radius: 12px;
    transition: background-color 180ms ease;
    flex-wrap: wrap;
}

.dashboard-dep-row + .dashboard-dep-row {
    border-top: 1px solid var(--line);
}

.dashboard-dep-row:hover {
    background: var(--surface);
}

.dashboard-dep-row:hover .dashboard-dep-row__actions {
    opacity: 1;
}

.dashboard-dep-row__main {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1 1 280px;
}

.dashboard-dep-row__avatar {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--color-primary) 18%, transparent);
    border: 1px solid color-mix(in srgb, var(--color-primary) 32%, transparent);
    color: var(--color-primary);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.04em;
}

.dashboard-dep-row__avatar[data-state="inactive"] {
    background: var(--surface);
    border-color: var(--line);
    color: var(--muted);
}

.dashboard-dep-row__info {
    min-width: 0;
    flex: 1;
}

.dashboard-dep-row__title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.dashboard-dep-row__name {
    margin: 0;
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.3;
}

.dashboard-dep-row__name--clickable {
    cursor: pointer;
    transition: color 180ms ease;
}

.dashboard-dep-row__name--clickable:hover {
    color: var(--color-primary);
}

.dashboard-dep-row__dates {
    margin: 4px 0 0;
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 760;
    line-height: 1.4;
}

.dashboard-dep-row__actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 180ms ease;
}

@media (hover: none) {
    .dashboard-dep-row__actions {
        opacity: 1;
    }
}

@media (max-width: 540px) {
    .dashboard-dep-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .dashboard-dep-row__actions {
        opacity: 1;
        width: 100%;
        justify-content: flex-start;
    }
    .dashboard-product__actions {
        width: 100%;
        flex-wrap: wrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dashboard-action,
    .dashboard-product__cost-btn,
    .dashboard-product__name a,
    .dashboard-dep-row,
    .dashboard-dep-row__name--clickable,
    .dashboard-dep-row__actions {
        transition: none;
    }
    .dashboard-action:hover,
    .dashboard-product__cost-btn:hover {
        transform: none;
    }
}

/* ============================================================
 * Beneficiary tabs + grouped list. Used in person/beneficiaries.html.twig
 * and reusable for any entity with primary/contingent or per-coverage tabs.
 * Tokens come from theme-tokens.css so sponsor branding bleeds through.
 * ============================================================ */
.beneficiary-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 16px 24px 0 24px;
    border-bottom: 1px solid var(--line);
}

.beneficiary-tabs__tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease;
    border-radius: 8px 8px 0 0;
}

.beneficiary-tabs__tab:hover {
    color: var(--text);
    background: var(--surface);
}

.beneficiary-tabs__tab--active,
.beneficiary-tabs__tab[aria-selected="true"] {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

/* Role editor tabs (Miembros / Permisos) — active state driven by aria-selected,
   painted from the brand token. See role_tabs_controller.js / role/view.html.twig. */
.role-tab {
    border-bottom: 2px solid transparent;
    color: var(--text-soft);
    transition: color .15s ease, border-color .15s ease;
}

.role-tab[aria-selected="true"] {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.beneficiary-group + .beneficiary-group {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

.beneficiary-group__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.beneficiary-group__title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.beneficiary-group__title-icon {
    color: var(--muted);
}

.beneficiary-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.beneficiary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    transition: border-color 160ms ease, background-color 160ms ease;
}

.beneficiary-row:hover {
    background: var(--surface-strong);
    border-color: var(--line-strong);
}

.beneficiary-row__main {
    display: flex;
    align-items: center;
    gap: 24px;
    flex: 1;
    min-width: 0;
    flex-wrap: wrap;
}

.beneficiary-row__name {
    font-weight: 600;
    color: var(--text);
    min-width: 180px;
    flex: 1;
}

.beneficiary-row__field {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: var(--text-soft);
    white-space: nowrap;
}

.beneficiary-row__field--rel {
    min-width: 110px;
}

.beneficiary-row__field-icon {
    width: 14px;
    height: 14px;
    color: var(--muted);
}

.beneficiary-row__benefit {
    font-weight: 700;
    color: var(--color-primary);
    font-variant-numeric: tabular-nums;
    min-width: 60px;
    text-align: right;
}

.beneficiary-row__actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.beneficiary-actions-bar {
    margin-top: 8px;
    display: flex;
    justify-content: flex-start;
}

@media (max-width: 640px) {
    .beneficiary-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .beneficiary-row__actions {
        width: 100%;
        justify-content: flex-end;
    }
    .beneficiary-row__name {
        min-width: 0;
        width: 100%;
    }
}

/* ============================================================
 * COB (Coordination of Benefits) page — info card, plan cards,
 * detail modal. Used by templates/cob/view.html.twig in both
 * admin and employee contexts. Tokens come from theme-tokens.css
 * so sponsor branding bleeds through.
 * ============================================================ */
.cob-info {
    display: flex;
    gap: 16px;
    padding: 20px 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    align-items: flex-start;
}

.cob-info__icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--color-primary) 15%, transparent);
    color: var(--color-primary);
    border-radius: 10px;
}

.cob-info__icon svg {
    width: 20px;
    height: 20px;
}

.cob-info__copy {
    flex: 1;
    min-width: 0;
}

.cob-info__title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 6px 0;
}

.cob-info__body {
    color: var(--text-soft);
    font-size: 0.9375rem;
    line-height: 1.55;
    margin: 0;
}

.cob-info__tip {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-soft);
    font-size: 0.875rem;
    line-height: 1.5;
}

.cob-info__tip-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    color: var(--color-primary);
}

.cob-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.cob-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: border-color 160ms ease, transform 160ms ease, background-color 160ms ease;
}

.cob-card:hover {
    background: var(--surface-strong);
    border-color: var(--line-strong);
    transform: translateY(-1px);
}

.cob-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.cob-card__person {
    display: flex;
    gap: 12px;
    align-items: center;
    min-width: 0;
}

.cob-card__avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--color-primary) 18%, transparent);
    color: var(--color-primary);
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

.cob-card__avatar--sm {
    width: 36px;
    height: 36px;
    font-size: 0.8125rem;
}

.cob-card__person-copy {
    min-width: 0;
}

.cob-card__name {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
    /* Se parte en dos líneas: con ellipsis un nombre largo salía cortado
       ("Lourdes Fernan…") junto a la insignia. */
    overflow-wrap: anywhere;
}

.cob-card__role {
    margin: 2px 0 0 0;
    font-size: 0.8125rem;
    color: var(--muted);
}

.cob-card__details {
    margin: 0;
    padding: 12px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cob-card__detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 0.875rem;
    margin: 0;
}

.cob-card__detail dt {
    color: var(--muted);
}

.cob-card__detail dd {
    margin: 0;
    color: var(--text);
    font-weight: 500;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cob-card__detail-value--mono {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
    font-size: 0.8125rem;
}

.cob-card__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.cob-card__actions-aside {
    display: flex;
    gap: 6px;
    align-items: center;
}

.cob-actions-bar {
    margin-top: 8px;
    display: flex;
    justify-content: flex-start;
}

/* ---- Modal ---- */
.cob-modal {
    position: fixed;
    inset: 0;
    z-index: 70;
    overflow-y: auto;
}

.cob-modal.hidden {
    display: none;
}

.cob-modal__backdrop {
    position: fixed;
    inset: 0;
    background: rgba(8, 12, 22, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.cob-modal__container {
    position: relative;
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.cob-modal__panel {
    position: relative;
    width: 100%;
    max-width: 720px;
    background: var(--frame);
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

[data-theme="light"] .cob-modal__panel {
    background: var(--frame);
}

.cob-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--line);
    background: var(--frame-2);
}

.cob-modal__header-info {
    display: flex;
    gap: 12px;
    align-items: center;
}

.cob-modal__title {
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--text);
}

.cob-modal__subtitle {
    margin: 2px 0 0 0;
    font-size: 0.8125rem;
    color: var(--muted);
}

.cob-modal__close {
    background: transparent;
    border: 0;
    padding: 6px;
    border-radius: 8px;
    color: var(--muted);
    cursor: pointer;
    transition: background-color 160ms ease, color 160ms ease;
}

.cob-modal__close:hover {
    background: var(--surface);
    color: var(--text);
}

.cob-modal__body {
    padding: 22px;
    max-height: calc(100vh - 220px);
    overflow-y: auto;
}

.cob-modal__sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.cob-modal__section-title {
    margin: 0 0 12px 0;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.cob-modal__dl {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cob-modal__dl-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.875rem;
}

.cob-modal__dl-row dt {
    color: var(--muted);
}

.cob-modal__dl-row dd {
    margin: 0;
    color: var(--text);
    font-weight: 500;
    text-align: right;
}

.cob-modal__dl-value--mono {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
    font-size: 0.8125rem;
}

.cob-modal__chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cob-modal__empty {
    color: var(--muted);
    font-size: 0.875rem;
}

.cob-modal__footer {
    padding: 14px 22px;
    border-top: 1px solid var(--line);
    background: var(--frame-2);
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 540px) {
    .cob-card__details {
        gap: 10px;
    }
    .cob-modal__panel {
        margin: 16px;
    }
    .cob-modal__sections {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
 * Employee sidebar — variant of auth-shell__sidebar.
 * Identity card + slim nav for the member portal. The aside itself
 * inherits glass-surface / token treatment from .auth-shell__sidebar
 * above; this block adds the inner identity widget and nav layout.
 * Nav links pick up `aside#drawer-navigation a` rules already defined,
 * so no per-link styling is duplicated here.
 * ============================================================ */
.employee-sidebar__inner {
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
    overflow-y: auto;
    padding: 18px 12px 24px;
}

.employee-sidebar__identity {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--color-primary) 16%, transparent),
        color-mix(in srgb, var(--color-primary) 4%, transparent));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 6px 18px color-mix(in srgb, var(--color-primary) 12%, transparent);
}

[data-theme="light"] .employee-sidebar__identity {
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--color-primary) 12%, transparent),
        color-mix(in srgb, var(--color-primary) 3%, transparent));
}

.employee-sidebar__identity-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 999px;
    background: linear-gradient(135deg,
        var(--color-primary),
        color-mix(in srgb, var(--color-primary) 76%, var(--color-secondary)));
    color: #ffffff;
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 4px 12px color-mix(in srgb, var(--color-primary) 24%, transparent);
}

.employee-sidebar__identity-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.employee-sidebar__identity-name {
    margin: 0;
    color: var(--text);
    font-size: 13px;
    font-weight: 850;
    line-height: 1.25;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.employee-sidebar__identity-org {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    line-height: 1.2;
    text-transform: uppercase;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.employee-sidebar__section-label {
    margin: 4px 0 -4px;
    padding: 0 12px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
}

.employee-sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Nav links pick up the auth-shell aside link spec (height, padding,
   radius, hover, active rail). We only need to make them flex so the
   icon + label align horizontally. */
.employee-sidebar__nav a {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.employee-sidebar__nav a > span {
    flex: 1;
    min-width: 0;
}

/* Active-state contrast guards. The system rail + icon both use
   --color-primary; for dark-primary sponsors (FirstBank navy) on the
   teal-black frame, that collapses to near invisible. Use a brand-mix
   for dark mode so the "you are here" signal stays load-bearing across
   the per-sponsor brand spectrum. Light mode preserves brand-direct
   since cream paper has the contrast headroom. */
.employee-sidebar__nav a.menu-item-active::before {
    background: color-mix(in srgb, var(--color-primary) 60%, var(--text));
}

[data-theme="light"] .employee-sidebar__nav a.menu-item-active::before {
    background: var(--color-primary);
}

.employee-sidebar__nav a.menu-item-active svg {
    color: color-mix(in srgb, var(--color-primary) 50%, var(--text));
}

[data-theme="light"] .employee-sidebar__nav a.menu-item-active svg {
    color: var(--color-primary);
}

/* Focus rings: the global `*:focus-visible` rule uses --color-primary
   directly, which is invisible on the dark frame for dark-primary
   sponsors (FirstBank navy). Override inside the sidebar and dashboard
   workspace with a contrast-safe brand-mix outline so keyboard users
   always see where focus is. The CTA button gets explicit treatment
   because Tailwind's `bg-green-600` strips the default outline. */
.employee-sidebar a:focus-visible,
.auth-shell__workspace--profile a:focus-visible,
.auth-shell__workspace--profile button:focus-visible,
.auth-shell__workspace--profile select:focus-visible,
.auth-shell__workspace--profile input:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--color-primary) 50%, var(--text));
    outline-offset: 2px;
}

[data-theme="light"] .employee-sidebar a:focus-visible,
[data-theme="light"] .auth-shell__workspace--profile a:focus-visible,
[data-theme="light"] .auth-shell__workspace--profile button:focus-visible,
[data-theme="light"] .auth-shell__workspace--profile select:focus-visible,
[data-theme="light"] .auth-shell__workspace--profile input:focus-visible {
    outline-color: var(--color-primary);
}

/* CTA primary action: Tailwind's bg-green-600 + the macro-emitted
   `focus:ring-2 focus:ring-offset-2 focus:ring-green-500` resolve to
   navy ring colors on FirstBank's palette and become invisible. Force
   a high-contrast outline on top of the existing brand glow. */
.auth-shell__workspace--profile a.bg-green-600:focus-visible,
.auth-shell__workspace--profile button.bg-green-600:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: 3px;
}

/* Hover-only row actions reveal on keyboard focus.
   The dependents macro hides the per-row actions ("Actualizar SSN",
   "Cancelar") behind `opacity-0 group-hover:opacity-100`. The links
   stay in tab order, so a keyboard user can reach them but cannot see
   where focus is. Reveal the action group when any descendant gets
   keyboard focus, mirroring the hover behavior. */
.auth-shell__workspace--profile [data-dependents-target="item"]:focus-within .opacity-0 {
    opacity: 1;
}

/* ============================================================
   Employee — Demographics
   Member-facing dossier for the employee + their dependents.
   Mobile-first: a single-column dossier with stacked label/value
   pairs. At >= 640px the field grid splits to 2 columns; at >=
   1024px it becomes a 4-column row that suits the rep audience
   reading the same surface at a glance. Glass + tinted neutrals
   per DESIGN.md; no hex literals, no Tailwind teal.
   ============================================================ */
/* Demographics workspace — same panel grammar as the dashboard.
   Profile header + flat panels separated by hairline rules. The
   primary employee data lives in one panel; dependents live in
   another panel as a flat list, no nested cards. */
.employee-demographics {
    display: flex;
    flex-direction: column;
}

/* Field grid — used for both the primary and each dependent.
   Stacks on narrow widths, two-up at tablet, four-up on wide
   desktop with the address column allowed to grow. The grid uses
   no padding of its own; the surrounding panel-body or dossier
   block owns that. */
.employee-demographics__fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px 28px;
    margin: 0;
    padding: 22px 0 6px;
}

@media (min-width: 640px) {
    .employee-demographics__fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .employee-demographics__field--address {
        grid-column: 1 / -1;
    }
}

@media (min-width: 1100px) {
    .employee-demographics__fields {
        grid-template-columns:
            minmax(140px, 0.9fr)
            minmax(110px, 0.6fr)
            minmax(150px, 1fr)
            minmax(200px, 1.6fr);
        gap: 22px 32px;
    }
    .employee-demographics__field--address {
        grid-column: auto;
    }
}

.employee-demographics__field {
    min-width: 0;
}

.employee-demographics__field-label {
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 760;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
}

.employee-demographics__field-value {
    margin: 0;
    color: var(--text);
    font-size: 14px;
    font-weight: 760;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.employee-demographics__address {
    color: var(--text-soft);
}

.employee-demographics__address-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 8px;
    padding: 3px 10px 3px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--color-primary) 16%, transparent);
    color: var(--color-primary);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: 0.02em;
    line-height: 1.4;
}

.employee-demographics__address-tag-icon {
    width: 12px;
    height: 12px;
}

.employee-demographics__address-line {
    margin: 0;
    color: var(--text);
    font-size: 14px;
    font-weight: 760;
    line-height: 1.5;
}

.employee-demographics__address-line--muted {
    color: var(--muted);
    font-weight: 700;
}

/* Dependent dossier list inside the Dependientes panel body.
   Each dependent is a flat block with hairline rules between
   them; no individual card chrome. The first dependent doesn't
   need a top divider since the panel-header already provides one. */
.demographics-dossier-list {
    display: flex;
    flex-direction: column;
}

.demographics-dossier {
    display: flex;
    flex-direction: column;
    padding: 18px 0 4px;
    border-top: 1px solid var(--line);
}

.demographics-dossier:first-child {
    border-top: 0;
    padding-top: 8px;
}

/* Identity row inside a dependent dossier — avatar + name + role
   on the left, Editar action on the right. Mirrors the dashboard's
   .dashboard-dep-row pattern but adds room for the field grid below. */
.demographics-dossier__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.demographics-dossier__identity {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1 1 240px;
}

.demographics-dossier__avatar {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--color-secondary) 18%, transparent);
    border: 1px solid color-mix(in srgb, var(--color-secondary) 32%, transparent);
    color: var(--color-secondary);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.02em;
}

[data-theme="light"] .demographics-dossier__avatar {
    color: color-mix(in srgb, var(--color-secondary) 78%, var(--text));
}

.demographics-dossier__identity-copy {
    min-width: 0;
}

.demographics-dossier__name {
    margin: 0;
    color: var(--text);
    font-size: 15px;
    font-weight: 850;
    line-height: 1.25;
    letter-spacing: -0.005em;
    overflow-wrap: anywhere;
}

.demographics-dossier__role {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
}

.employee-demographics__field-empty {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    font-style: normal;
}

@media (max-width: 540px) {
    .demographics-dossier__head {
        gap: 10px;
    }
    .demographics-dossier__head .dashboard-action {
        width: 100%;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .demographics-dossier {
        transition: none;
    }
}

/* ============================================================
 * Report — view detail surface and filter card.
 *
 * Token-driven counterparts to the legacy bg-white/dark:bg-gray-800
 * Tailwind cards used by the older report templates. Mirrors the
 * structure of mi-view/report-index so the language stays uniform
 * across the workspace.
 *
 * report-view__list   — definition list of report metadata
 * report-view__filters — header form on a list-style report
 * report-view__pill   — token-driven status pill (replaces the
 *                       hardcoded bg-green-100 / bg-red-100 chips)
 * ============================================================ */
.report-view__head {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: clamp(20px, 2.4vw, 28px) clamp(20px, 2.4vw, 28px) 18px;
}

.report-view__head-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--color-primary) 14%, transparent);
    color: var(--color-primary);
    flex-shrink: 0;
}

.report-view__title {
    margin: 0;
    color: var(--text);
    font-size: 18px;
    font-weight: 850;
    line-height: 1.2;
}

.report-view__subtitle {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 760;
    line-height: 1.45;
}

.report-view__list {
    margin: 0;
    padding: 0 clamp(20px, 2.4vw, 28px);
    list-style: none;
    border-top: 1px solid var(--line);
}

.report-view__row {
    display: grid;
    grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.report-view__row:last-child {
    border-bottom: 0;
}

@media (max-width: 640px) {
    .report-view__row {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}

.report-view__label {
    margin: 0;
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 760;
    line-height: 1.45;
}

.report-view__value {
    margin: 0;
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.report-view__section {
    margin: 0;
    padding: 18px clamp(20px, 2.4vw, 28px) 6px;
    border-top: 1px solid var(--line);
    color: var(--text-soft);
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.report-view__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 18px clamp(20px, 2.4vw, 28px) clamp(20px, 2.4vw, 28px);
    border-top: 1px solid var(--line);
}

.report-view__pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 850;
    line-height: 1;
    background: color-mix(in srgb, var(--color-primary) 14%, transparent);
    color: var(--color-primary);
    border: 1px solid color-mix(in srgb, var(--color-primary) 26%, transparent);
}

.report-view__pill--success {
    background: color-mix(in srgb, var(--color-success) 18%, transparent);
    color: var(--color-success);
    border-color: color-mix(in srgb, var(--color-success) 32%, transparent);
}

.report-view__pill--danger {
    background: color-mix(in srgb, var(--color-danger) 18%, transparent);
    color: var(--color-danger);
    border-color: color-mix(in srgb, var(--color-danger) 32%, transparent);
}

/* Filter card on a report results page (transactions, COB, etc.).
 * Sits on top of an .auth-shell__workspace; the form fields render
 * via the auth-shell form theme so we only need layout glue here. */
.report-filters {
    padding: clamp(20px, 2.4vw, 28px);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* .form-section__header is the same block used by base.edit.html.twig to render
 * page.section_title / page.section_description, so a plain form card and the
 * transactions filter card carry an identical heading. */
.report-filters__header,
.form-section__header {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.form-section__header {
    margin-bottom: 24px;
}

.report-filters__header-icon,
.form-section__header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--color-primary) 14%, transparent);
    color: var(--color-primary);
}

.report-filters__header h2,
.form-section__header h2 {
    margin: 0;
    color: var(--text);
    font-size: 16px;
    font-weight: 850;
    line-height: 1.2;
}

.report-filters__header p,
.form-section__header p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 760;
    line-height: 1.45;
}

.report-filters__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 720px) {
    .report-filters__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1080px) {
    .report-filters__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.report-filters__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

/* Notice banner inside the workspace (info / warning).
 * Replaces the legacy bg-amber-100/border-amber-500 stripe so the
 * callout reads with the brand-tinted neutrals instead of fixed
 * Tailwind palette. */
.auth-shell__notice {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 14px 18px;
    border: 1px solid color-mix(in srgb, var(--color-primary) 32%, transparent);
    border-radius: 12px;
    background: color-mix(in srgb, var(--color-primary) 10%, transparent);
}

.auth-shell__notice--warning {
    border-color: color-mix(in srgb, var(--color-warning) 38%, transparent);
    background: color-mix(in srgb, var(--color-warning) 12%, transparent);
}

.auth-shell__notice--info {
    border-color: color-mix(in srgb, var(--color-info) 32%, transparent);
    background: color-mix(in srgb, var(--color-info) 10%, transparent);
}

/* Same shape as --warning, driven by the danger token. Added for status
 * messages on failed background operations, which previously used literal
 * red-50/red-900 Tailwind pairs. */
.auth-shell__notice--danger {
    border-color: color-mix(in srgb, var(--color-danger) 38%, transparent);
    background: color-mix(in srgb, var(--color-danger) 12%, transparent);
}

.auth-shell__notice-icon {
    width: 22px;
    height: 22px;
    color: var(--color-primary);
    flex-shrink: 0;
}

.auth-shell__notice--warning .auth-shell__notice-icon {
    color: var(--color-warning);
}

.auth-shell__notice--info .auth-shell__notice-icon {
    color: var(--color-info);
}

.auth-shell__notice-title {
    margin: 0 0 2px;
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
    line-height: 1.2;
}

.auth-shell__notice-help {
    margin: 0;
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 760;
    line-height: 1.5;
}

/* ============================================================
 * Tooltip — token-driven floating panel.
 *
 * Replaces the previous bg-white / border-gray-200 / shadow-xl
 * Tailwind chip used by the [data-controller="tooltip"] Stimulus
 * controller. The wrapper now reads the same brand-tinted neutrals
 * as the workspace, with a soft drop shadow that picks up the
 * sponsor's primary color (Tinted-Neutral Rule).
 *
 * Two body patterns ship with the tooltip:
 *   1. Price summary  — used by selection_tooltip (Total a Pagar).
 *   2. Person list    — used by person_details_tooltip (Principal,
 *                       Edad, SSN…).
 * Both are flat lists; the visual rhythm comes from divider lines
 * cut from --line / --line-strong, never from filled blocks.
 * ============================================================ */
.auth-shell__tooltip {
    position: relative;
    max-width: 320px;
    padding: 14px 16px;
    color: var(--text);
    background: color-mix(in srgb, var(--frame-2) 92%, transparent);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow:
        0 18px 48px color-mix(in srgb, var(--color-primary) 14%, rgba(0, 0, 0, 0.32)),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(18px) saturate(1.1);
    -webkit-backdrop-filter: blur(18px) saturate(1.1);
}

[data-theme="light"] .auth-shell__tooltip {
    background: rgba(255, 255, 255, 0.96);
    box-shadow:
        0 18px 48px color-mix(in srgb, var(--color-primary) 16%, rgba(20, 24, 32, 0.12)),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.auth-shell__tooltip-arrow {
    position: absolute;
    width: 0;
    height: 0;
}

.auth-shell__tooltip-arrow--top {
    bottom: 0;
    left: 50%;
    transform: translate(-50%, 100%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid color-mix(in srgb, var(--frame-2) 92%, transparent);
}

[data-theme="light"] .auth-shell__tooltip-arrow--top {
    border-top-color: rgba(255, 255, 255, 0.96);
}

.auth-shell__tooltip-arrow--bottom {
    top: 0;
    left: 50%;
    transform: translate(-50%, -100%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid color-mix(in srgb, var(--frame-2) 92%, transparent);
}

[data-theme="light"] .auth-shell__tooltip-arrow--bottom {
    border-bottom-color: rgba(255, 255, 255, 0.96);
}

.auth-shell__tooltip-arrow--left {
    right: 0;
    top: 50%;
    transform: translate(100%, -50%);
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 8px solid color-mix(in srgb, var(--frame-2) 92%, transparent);
}

[data-theme="light"] .auth-shell__tooltip-arrow--left {
    border-left-color: rgba(255, 255, 255, 0.96);
}

.auth-shell__tooltip-arrow--right {
    left: 0;
    top: 50%;
    transform: translate(-100%, -50%);
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid color-mix(in srgb, var(--frame-2) 92%, transparent);
}

[data-theme="light"] .auth-shell__tooltip-arrow--right {
    border-right-color: rgba(255, 255, 255, 0.96);
}

.auth-shell__tooltip-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-shell__tooltip-section {
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.auth-shell__tooltip-eyebrow {
    margin: 0 0 2px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.auth-shell__tooltip-strong {
    margin: 0;
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.3;
}

.auth-shell__tooltip-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-shell__tooltip-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    font-size: 13px;
    line-height: 1.4;
}

.auth-shell__tooltip-row--divider {
    padding-top: 8px;
    border-top: 1px solid var(--line);
}

.auth-shell__tooltip-row--divider-strong {
    padding-top: 10px;
    border-top: 1px solid var(--line-strong);
}

.auth-shell__tooltip-label {
    color: var(--muted);
    font-weight: 760;
}

.auth-shell__tooltip-value {
    color: var(--text);
    font-weight: 800;
}

.auth-shell__tooltip-value--credit {
    color: var(--color-success);
    font-weight: 850;
}

.auth-shell__tooltip-total {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.auth-shell__tooltip-total-label {
    margin: 0;
    color: var(--text);
    font-size: 13px;
    font-weight: 850;
    line-height: 1.2;
}

.auth-shell__tooltip-total-meta {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 760;
    line-height: 1.3;
}

.auth-shell__tooltip-total-value {
    color: var(--text);
    font-size: 16px;
    font-weight: 900;
    line-height: 1.1;
}

.auth-shell__tooltip-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-shell__tooltip-list-item {
    display: flex;
    gap: 10px;
    font-size: 13px;
    line-height: 1.4;
}

.auth-shell__tooltip-list-label {
    flex: 0 0 88px;
    color: var(--muted);
    font-weight: 800;
}

.auth-shell__tooltip-list-value {
    color: var(--text);
    font-weight: 760;
    overflow-wrap: anywhere;
}

.auth-shell__tooltip-empty {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 760;
    line-height: 1.45;
}

/* ============================================================
 * Selection disclaimers — token-driven agreement checkboxes
 * Used by templates/form/fields.html.twig
 * render_selection_disclaimers macro for SubscribeFlow step 7.
 * ============================================================ */
.selection-disclaimers {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.selection-disclaimers__item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: border-color 180ms ease, background-color 180ms ease;
}

.selection-disclaimers__item:hover {
    border-color: var(--line-strong);
    background: var(--surface-strong);
}

.selection-disclaimers__item:focus-within {
    border-color: var(--line-strong);
    box-shadow: 0 0 0 3px var(--focus);
}

.selection-disclaimers__checkbox {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.selection-disclaimers__text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
}

.selection-disclaimers__text p {
    margin: 0;
}

.selection-disclaimers__text--secondary {
    color: var(--text-soft);
}

/*
 * Link color: --color-primary (#1A3458 navy) is too dark for dark-mode
 * contrast. Use a lighter accessible blue and let dark mode override.
 */
.selection-disclaimers__link {
    color: #2563eb;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    font-weight: 600;
}

[data-theme="dark"] .selection-disclaimers__link {
    color: #93c5fd;
}

.selection-disclaimers__link:hover {
    text-decoration: none;
    filter: brightness(1.15);
}

/* ============================================================
 * Subscribe summary (SubscribeFlow step 7 Confirmación panel)
 * Theme-aware: uses [data-theme] CSS custom properties so the
 * panel responds to the global theme toggle (theme-toggle controller).
 * Replaces the legacy Tailwind bg-white + text-gray-* hardcoded
 * light scaffold that did not respond to dark mode.
 * ============================================================ */
.subscribe-summary {
    max-width: 56rem;
    margin: 0 auto;
    padding: 32px 16px;
}

.subscribe-summary__intro {
    text-align: center;
    margin-bottom: 32px;
}

.subscribe-summary__heading {
    margin: 0 0 12px;
    color: var(--text);
    font-size: 30px;
    font-weight: 700;
    line-height: 1.2;
}

.subscribe-summary__lead {
    margin: 0;
    color: var(--text-soft);
    font-size: 17px;
    line-height: 1.5;
}

.subscribe-summary__lead-emphasis {
    color: var(--text);
    font-weight: 600;
}

.subscribe-summary__panel {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    padding: 24px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.subscribe-summary__section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.subscribe-summary__section + .subscribe-summary__section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

.subscribe-summary__row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
}

@media (min-width: 640px) {
    .subscribe-summary__row {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
        align-items: baseline;
    }
}

.subscribe-summary__row--top-rule {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.subscribe-summary__label {
    color: var(--text-soft);
    font-weight: 500;
    font-size: 14px;
}

@media (min-width: 640px) {
    .subscribe-summary__label {
        text-align: right;
    }
}

.subscribe-summary__value {
    color: var(--text);
    font-size: 14px;
}

.subscribe-summary__value--strong {
    font-weight: 600;
}

.subscribe-summary__value-mark {
    color: var(--color-primary);
    margin-left: 4px;
}

.subscribe-summary__addons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

@media (min-width: 640px) {
    .subscribe-summary__addons {
        grid-column: 2;
    }
}

.subscribe-summary__addon {
    display: flex;
    align-items: center;
    color: var(--text-soft);
    font-size: 14px;
}

.subscribe-summary__addon-icon {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    color: var(--color-success, #4ECCA3);
}

.subscribe-summary__price {
    margin-top: 32px;
    padding: 24px;
    border-radius: 12px;
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--color-primary) 15%, var(--surface)),
        color-mix(in srgb, var(--color-primary) 25%, var(--surface)));
    border: 1px solid var(--line);
    text-align: center;
}

.subscribe-summary__price-label {
    color: var(--text-soft);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.subscribe-summary__price-value {
    color: var(--text);
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}

.subscribe-summary__price-interval {
    color: var(--text-soft);
    font-size: 14px;
}

/* TomSelect (Symfony UX Autocomplete) dropdown panel — the vendor CSS
 * loads AFTER auth-shell.css (asset-mapper resolves controllers.json
 * imports after our manifest) and paints background white / text
 * near-black with no theme-aware tokens. Override by selecting from
 * [data-theme] on <html> — the attribute is always present, so this
 * raises specificity (0,1,1) above the vendor's single-class rule
 * (0,1,0) in both light and dark themes without using !important. */
.ts-wrapper.auth-shell__field--select {
    background-image: none;
    padding-right: 0;
}
/* The vendor also paints a near-white linear-gradient on top of the background
 * colour via `.ts-wrapper.single .ts-control` (0,3,0) — the same specificity as
 * `[data-theme] .ts-wrapper .ts-control`, and it loads later, so it won. That is
 * why the autocompletes still looked like light-theme fields inside the dark
 * shell. Repeating the .single / .input-active classes takes us to (0,4,0) and
 * wins in both themes without !important. */
[data-theme] .ts-wrapper .ts-control,
[data-theme] .ts-wrapper.single .ts-control,
[data-theme] .ts-wrapper.single.input-active .ts-control {
    background: var(--field);
    background-image: none;
    color: var(--text);
    border-color: var(--line);
}
[data-theme] .ts-wrapper.focus .ts-control,
[data-theme] .ts-wrapper .ts-control:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--focus);
}
[data-theme] .ts-wrapper .ts-control input,
[data-theme] .ts-wrapper .ts-control input::placeholder {
    color: var(--text);
}
[data-theme] .ts-wrapper .ts-control .item {
    color: var(--text);
}
[data-theme] .ts-dropdown {
    background: var(--frame-2);
    color: var(--text);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}
[data-theme] .ts-dropdown .option,
[data-theme] .ts-dropdown .optgroup-header,
[data-theme] .ts-dropdown .no-results,
[data-theme] .ts-dropdown .create {
    color: var(--text);
}
[data-theme] .ts-dropdown .optgroup-header {
    color: var(--text-soft);
    background: var(--surface);
}
[data-theme] .ts-dropdown .active,
[data-theme] .ts-dropdown [data-selectable].option.active,
[data-theme] .ts-dropdown .option:hover {
    background: var(--surface-strong);
    color: var(--text);
}
[data-theme] .ts-dropdown .selected,
[data-theme] .ts-dropdown .active.selected {
    background: color-mix(in srgb, var(--color-primary) 28%, transparent);
    color: var(--text);
}
[data-theme] .ts-wrapper.plugin-clear_button .clear-button {
    color: var(--text-soft);
}
[data-theme] .ts-wrapper.plugin-clear_button .clear-button:hover {
    color: var(--text);
}


/* --- Toasts de flash -------------------------------------------------------
   Antes eran Flowbite puro: `bg-white`, `dark:bg-gray-800`, `text-gray-500` y
   los iconos en `bg-green-100 / bg-red-100 / bg-amber-100`. Eso los dejaba
   fuera del tema y de la marca del patrono — un toast blanco frio sobre las
   superficies tintadas del shell. Los tokens semanticos --color-success,
   --color-danger y --color-warning ya existian en theme-tokens.css sin que
   nadie los usara. */
.auth-shell__toast {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    /* Base OPACA. --surface es translucido (0.075 en oscuro, 7% del primario en
       claro): sirve para paneles dentro del layout, pero un toast flota sobre el
       contenido y dejaria verse lo que hay debajo. --frame-2 si es opaco en los
       dos temas y conserva el tinte de marca; --surface se superpone encima para
       mantener el mismo matiz que el resto de superficies. */
    background-color: var(--frame-2);
    background-image: linear-gradient(var(--surface), var(--surface));
    color: var(--text);
    box-shadow: 0 10px 30px rgb(0 0 0 / 0.18);
}

/* `useTransition` (closeable_controller) cierra el toast poniendole `.hidden`.
   Esa utilidad de Tailwind es `.hidden{display:none}`, un solo selector de clase
   igual que `.auth-shell__toast`, y auth-shell.css se carga despues de app.css,
   asi que el `display:flex` de arriba ganaba y el toast se quedaba en pantalla
   pese a haberse autocerrado. Con la utilidad no pasaba: Tailwind emite `.hidden`
   despues de `.flex`. */
.auth-shell__toast.hidden {
    display: none;
}

.auth-shell__toast--stacked {
    align-items: flex-start;
}

.auth-shell__toast-icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
}

/* Tinte al 10% y no mas: el glifo va del mismo token que el fondo, asi que
   cuanto mas saturado el chip, menos contraste queda entre ambos. A 10% mas un
   borde que lo perfila, el contraste en tema claro sube a 3.04 (success) y 3.46
   (danger); 'warning' se queda en 2.69 porque su token (#C68A1E) es claro de
   suyo sobre papel crema. Los tres mejoran lo que habia antes con Flowbite
   (2.07 / 3.08 / 1.93) y ninguno transmite informacion por si solo: cada toast
   lleva su texto y el icono ademas un <span class="sr-only">. */
.auth-shell__toast-icon--success {
    background: color-mix(in srgb, var(--color-success) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--color-success) 35%, transparent);
    color: var(--color-success);
}

.auth-shell__toast-icon--danger {
    background: color-mix(in srgb, var(--color-danger) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--color-danger) 35%, transparent);
    color: var(--color-danger);
}

.auth-shell__toast-icon--warning {
    background: color-mix(in srgb, var(--color-warning) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--color-warning) 35%, transparent);
    color: var(--color-warning);
}

.auth-shell__toast-body {
    margin-inline-start: 12px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}

.auth-shell__toast-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-inline-start: auto;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text-soft);
    cursor: pointer;
    transition: background-color 160ms ease, color 160ms ease;
}

.auth-shell__toast-close:hover {
    background: color-mix(in srgb, var(--text) 10%, transparent);
    color: var(--text);
}

.auth-shell__toast-close:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Barra de autocierre: solo la lleva 'success', que es el unico que se cierra
   solo a los 7 s. */
.auth-shell__toast-timer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    background: var(--color-success);
    transition: all 7000ms linear;
}
