/* public/css/system/amount.css */
/* Amount: one look for every amount in a list cell (Component::amount), with the
 * --table-amount-* tokens of @ensenyem/design-tokens (suite-components.css).
 *   .amount--muted      a secondary figure (group income and costs)
 *   .amount--positive   green: the sign means something (group profit)
 *   .amount--negative   red: a loss, or a limit passed (client yearly total)
 *   .amount-group       several amounts in one cell, split by .amount-group__sep
 * Tabular figures come from numeric.css (.amount); alignment from the column
 * (table.css, by data-col).
 */
@layer components {
    .amount {
        color: var(--table-amount-color);
        font-weight: var(--table-amount-weight);
        white-space: nowrap;
    }

    .amount--muted {
        color: var(--table-amount-muted-color);
        font-weight: var(--table-amount-muted-weight);
    }

    .amount--positive { color: var(--table-amount-positive-color); }
    .amount--negative { color: var(--table-amount-negative-color); }

    .amount-group {
        display: inline-flex;
        align-items: baseline;
        gap: var(--space-1);
        font-size: var(--text-xs);
        white-space: nowrap;
    }

    .amount-group__sep {
        color: var(--color-gray-400);
    }
}

/* public/css/system/badge.css */
/* Badge: the ERP's one status pill (Component::badge, Component::inlineStatus).
 *
 * Sizes, tint and the colours of the status variants are the --badge-* tokens of
 * @ensenyem/design-tokens (suite-components.css), shared with the CRM: change them in
 * the package. The private properties below are what variants and contexts reassign
 * (never override the declarations themselves):
 *   --_badge-tone   colour the background is tinted from
 *   --_badge-bg     background (defaults to the tone at --badge-tint)
 *   --_badge-fg     text colour (a dark step of the tone, AA on the tint)
 *   --_badge-height, --_badge-pad-x, --_badge-font, --_badge-tracking
 *
 * A context that restyles the badge lives HERE, in this layer: a legacy rule loses to
 * every declaration below, custom properties included.
 */
@layer components {
    .badge {
        --_badge-tone: var(--badge-neutral-tone);
        --_badge-bg: color-mix(in srgb, var(--_badge-tone) var(--badge-tint), transparent);
        --_badge-fg: var(--badge-neutral-fg);
        --_badge-height: var(--badge-height);
        --_badge-pad-x: var(--badge-padding-inline);
        --_badge-font: var(--badge-font-weight) var(--badge-font-size)/1 var(--font-family);
        --_badge-tracking: var(--badge-tracking);

        display: inline-flex;
        align-items: center;
        gap: var(--badge-gap);
        box-sizing: border-box;
        height: var(--_badge-height);
        padding: 0 var(--_badge-pad-x);
        border: 0;
        border-radius: var(--badge-radius);
        background: var(--_badge-bg);
        color: var(--_badge-fg);
        font: var(--_badge-font);
        /* After `font`, which resets it: figures keep their width in counters and amounts. */
        font-variant-numeric: tabular-nums;
        letter-spacing: var(--_badge-tracking);
        white-space: nowrap;
        vertical-align: middle;
        transition: background-color var(--transition-fast), color var(--transition-fast);
    }

    .badge--success { --_badge-tone: var(--badge-success-tone); --_badge-fg: var(--badge-success-fg); }
    .badge--danger  { --_badge-tone: var(--badge-danger-tone);  --_badge-fg: var(--badge-danger-fg); }
    .badge--warning { --_badge-tone: var(--badge-warning-tone); --_badge-fg: var(--badge-warning-fg); }
    .badge--info    { --_badge-tone: var(--badge-info-tone);    --_badge-fg: var(--badge-info-fg); }
    .badge--primary { --_badge-tone: var(--badge-brand-tone);   --_badge-fg: var(--badge-brand-fg); }
    /* neutral is also what default/secondary meant in older markup */
    .badge--neutral,
    .badge--default,
    .badge--secondary { --_badge-tone: var(--badge-neutral-tone); --_badge-fg: var(--badge-neutral-fg); }

    /* FUNDAE is a funding type, not a state: solid, so it reads apart from status pills. */
    .badge--fundae { --_badge-bg: var(--color-warning-500); --_badge-fg: #fff; }

    .badge--small {
        --_badge-height: var(--badge-small-height);
        --_badge-pad-x: var(--badge-small-padding-inline);
        --_badge-font: var(--badge-font-weight) var(--badge-small-font-size)/1 var(--font-family);
    }

    /* Email inbox «Plantilla» column: template names are long, and text-overflow never
       applies inside inline-flex, so the name was cut mid-letter. Text-only badge, so an
       inline-block with the badge height as line height ends in «…» (title = full name). */
    #email-table td[data-col="plantilla"] .badge {
        display: inline-block;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: var(--badge-height);
    }

    /* Contexts */

    /* Dense tables. */
    .table-interactive--compact .badge {
        --_badge-height: 1.25rem;
        --_badge-pad-x: 0.4rem;
        --_badge-font: var(--font-weight-semibold) 0.7rem/1 var(--font-family);
    }

    /* A badge that is also a choice (bonificación in a group's students table): the
       native select keeps the value and the change handlers, menu.css gives it the
       floating menu and the chevron. Locked (disabled) it is a plain badge. */
    select.badge {
        width: auto;
        min-height: 0;
        margin: 0;
        padding-right: var(--space-1);
        outline-offset: 1px;
        cursor: pointer;
    }

    select.badge::picker-icon {
        inline-size: 0.75rem;
        block-size: 0.75rem;
        background-color: currentColor;
    }

    select.badge:hover:not(:disabled) {
        --_badge-bg: color-mix(in srgb, var(--_badge-tone) 22%, transparent);
    }

    select.badge:disabled {
        padding-right: var(--_badge-pad-x);
        opacity: 1;
        cursor: default;
    }

    select.badge:disabled::picker-icon {
        display: none;
    }

    /* Funded by FUNDAE reads as the FUNDAE pill of the group list (info). */
    .matricula-bonificacion-select.badge:has(option:checked:not([value="no_bonifica"])) {
        --_badge-tone: var(--badge-info-tone);
        --_badge-fg: var(--badge-info-fg);
    }

    /* Session the attendance sheet opens on (Hoy / Próxima / Última, grupos/_asistencia_grupo.php):
       solid brand and uppercase, so it reads as a marker above «Clase N», not as a state. */
    .asistencia-sesion__foco.badge {
        --badge-bg: var(--color-brand-500);
        --badge-fg: #fff;
        --badge-height: 1rem;
        --badge-font: var(--font-weight-bold) var(--text-2xs)/1 var(--font-family);
        --badge-tracking: 0.04em;
        text-transform: uppercase;
    }

    /* Unread counter on the sidebar notification buttons (notification-bell.css positions it). */
    .notif-rail__badge.badge {
        --_badge-bg: var(--md-error);
        --_badge-fg: var(--md-on-error);
        --_badge-height: 16px;
        --_badge-pad-x: 4px;
        /* The rail's own face (notification-bell.css), which the counter always inherited. */
        --_badge-font: var(--font-weight-semibold) 11px/16px 'Roboto Flex', Roboto, system-ui, sans-serif;
    }

    /* Payment state of each enrolment in the group billing tab. */
    .matricula-payment-badge.badge {
        --_badge-font: var(--font-weight-bold) 0.68rem/1 var(--font-family);
        --_badge-tracking: 0.03em;
        text-transform: uppercase;
    }

    .badge__icon {
        display: inline-flex;
        align-items: center;
        font-size: 0.75em;
        line-height: 1;
    }

    /* Draws attention once when a status changes (added by JS, then removed). */
    .badge--pulse {
        animation: badge-pulse 1.5s ease-in-out;
    }

    @keyframes badge-pulse {
        0%, 100% { transform: scale(1); }
        25% { transform: scale(1.08); }
        50% { transform: scale(1); }
        75% { transform: scale(1.04); }
    }

    @media (prefers-reduced-motion: reduce) {
        .badge { transition: none; }
        .badge--pulse { animation: none; }
    }
}

/* public/css/system/button.css */
/* Button: the ERP's one button (Component::btn, .btn in hand-written markup).
 *
 * App Store idea: variants and sizes only reassign properties; the declarations
 * below never change. Every declaration reads a public hook first and falls back
 * to a private value (`--_btn-*`) that the base, the variants and the sizes set.
 *
 * Public hooks, for contexts (a container or a scoped rule, in any layer, legacy
 * included). The component never declares them, so a context always wins:
 *   --btn-bg, --btn-fg, --btn-border-color, --btn-border-width
 *   --btn-hover-bg, --btn-hover-fg, --btn-hover-border-color, --btn-pressed-bg
 *   --btn-min-height, --btn-padding, --btn-text-size
 *   --btn-width, --btn-min-width          (icon-only buttons)
 *   --btn-radius, --btn-gap, --btn-font-weight, --btn-icon-size  (tokens in design-tokens.css)
 *
 * `display` lives in the `reset` layer on purpose: showing and hiding a button
 * (`.hidden`, `[hidden]`, a collapsed sidebar) belongs to its context, so every
 * other rule beats it.
 */
@layer reset {
    .btn {
        display: inline-flex;
    }

    .btn[hidden] {
        display: none;
    }
}

@layer components {
    .btn {
        --_btn-height: var(--btn-height);
        --_btn-pad-x: var(--btn-padding-inline);
        --_btn-text-size: var(--btn-font-size);
        --_btn-bg: transparent;
        --_btn-fg: var(--btn-secondary-fg);
        --_btn-border-color: transparent;
        --_btn-hover-bg: var(--_btn-bg);
        --_btn-hover-fg: var(--_btn-fg);
        --_btn-hover-border-color: var(--_btn-border-color);
        /* Press darkens whatever the hover shows; no filter, so the label keeps its colour. */
        --_btn-pressed-bg: color-mix(in srgb, var(--btn-hover-bg, var(--btn-bg, var(--_btn-hover-bg))), black 6%);

        /* Positioning context for absolutely placed children (notification counters). */
        position: relative;
        align-items: center;
        justify-content: center;
        min-height: var(--btn-min-height, var(--_btn-height));
        padding: var(--btn-padding, 0 var(--_btn-pad-x));
        gap: var(--btn-gap);
        font-family: inherit;
        font-size: var(--btn-text-size, var(--_btn-text-size));
        font-weight: var(--btn-font-weight);
        line-height: 1.2;
        text-decoration: none;
        border: var(--btn-border-width, 1px) solid var(--btn-border-color, var(--_btn-border-color));
        border-radius: var(--btn-radius);
        background-color: var(--btn-bg, var(--_btn-bg));
        color: var(--btn-fg, var(--_btn-fg));
        cursor: pointer;
        box-shadow: none;
        transition: var(--transition-interactive);
    }

    .btn:hover {
        background-color: var(--btn-hover-bg, var(--btn-bg, var(--_btn-hover-bg)));
        border-color: var(--btn-hover-border-color, var(--btn-border-color, var(--_btn-hover-border-color)));
        color: var(--btn-hover-fg, var(--btn-fg, var(--_btn-hover-fg)));
    }

    .btn:active {
        background-color: var(--btn-pressed-bg, var(--_btn-pressed-bg));
    }

    .btn .material-symbols-outlined {
        font-size: var(--btn-icon-size);
    }

    .btn__icon {
        display: inline-flex;
        align-items: center;
    }

    /* --- Variants --------------------------------------------------------- */
    /* `header-primary` / `header-secondary` are aliases: Component::btn emits them
       for list headers, and they look like primary / secondary. */
    .btn--primary,
    .btn--header-primary {
        --_btn-bg: var(--btn-primary-bg);
        --_btn-border-color: var(--btn-primary-bg);
        --_btn-fg: var(--btn-primary-fg);
        --_btn-hover-bg: var(--btn-primary-hover-bg);
        --_btn-hover-border-color: var(--btn-primary-hover-bg);
        --_btn-pressed-bg: var(--btn-pressed-bg, var(--btn-primary-pressed-bg));
    }

    .btn--secondary,
    .btn--header-secondary {
        --_btn-bg: var(--btn-secondary-bg);
        --_btn-border-color: var(--btn-secondary-border);
        --_btn-fg: var(--btn-secondary-fg);
        --_btn-hover-bg: var(--btn-secondary-hover-bg);
        --_btn-pressed-bg: var(--btn-pressed-bg, var(--btn-secondary-pressed-bg));
    }

    .btn--success {
        --_btn-bg: var(--success-text);
        --_btn-border-color: var(--success-text);
        --_btn-fg: white;
    }

    .btn--danger {
        --_btn-bg: var(--btn-danger-bg);
        --_btn-fg: var(--btn-danger-fg);
        --_btn-hover-bg: var(--btn-danger-hover-bg);
        --_btn-pressed-bg: var(--btn-pressed-bg, var(--btn-danger-pressed-bg));
    }

    .btn--warning {
        --_btn-bg: var(--color-warning-600);
        --_btn-border-color: var(--color-warning-600);
        --_btn-fg: white;
    }

    /* Ghost: no fill but an outline that is always there. It is the table action
       button, and without the outline it did not read as a button until hovered. */
    .btn--ghost {
        --_btn-border-color: var(--btn-ghost-border);
        --_btn-fg: var(--btn-ghost-fg);
        --_btn-hover-bg: var(--btn-secondary-hover-bg);
        --_btn-hover-fg: var(--btn-secondary-fg);
        --_btn-pressed-bg: var(--btn-pressed-bg, var(--btn-secondary-pressed-bg));
    }

    /* Text: an inline action next to a field; no box, so it does not compete with it. */
    .btn--text {
        --_btn-fg: var(--btn-ghost-fg);
        --_btn-hover-bg: var(--btn-secondary-hover-bg);
        --_btn-hover-fg: var(--btn-secondary-fg);
    }

    /* Destructive action: `.btn--ghost.text-danger` is the «Borrar» pattern. */
    .btn.text-danger {
        --_btn-fg: var(--danger-600);
        --_btn-hover-bg: color-mix(in srgb, var(--danger-600) 8%, transparent);
        --_btn-hover-border-color: color-mix(in srgb, var(--danger-600) 35%, var(--btn-ghost-border));
        --_btn-hover-fg: var(--danger-700);
    }

    .btn--link {
        --_btn-fg: var(--primary-600);
        --_btn-height: 0;
        --_btn-pad-x: 0;
        text-decoration: underline;
    }

    .btn--outline-primary {
        --_btn-fg: var(--primary-600);
        --_btn-border-color: var(--primary-600);
        --_btn-hover-bg: color-mix(in srgb, var(--primary-600) 8%, transparent);
    }

    .btn--outline-secondary {
        --_btn-fg: var(--gray-600);
        --_btn-border-color: var(--gray-300);
    }

    .btn--outline-danger {
        --_btn-fg: var(--danger-text);
        --_btn-border-color: var(--danger-text);
        --_btn-hover-bg: color-mix(in srgb, var(--danger-text) 8%, transparent);
    }

    /* Data actions (Exportar / Importar) */
    .btn--data {
        --_btn-bg: var(--btn-data-bg);
        --_btn-fg: var(--btn-data-color);
        --_btn-border-color: var(--btn-data-border);
        --_btn-hover-bg: var(--btn-data-hover-bg);
        --_btn-hover-fg: var(--btn-data-hover-color);
        --_btn-hover-border-color: var(--btn-data-hover-border);
    }

    /* --- Sizes ------------------------------------------------------------ */
    .btn--small,
    .btn--sm {
        --_btn-height: var(--btn-height-small);
        --_btn-pad-x: var(--btn-padding-inline-small);
        --_btn-text-size: var(--btn-font-size-small);
    }

    /* Icon only: a circle as tall as the button, so a row of actions keeps its
       height whether a button has a label or not. */
    .btn--icon {
        --_btn-pad-x: 0;
        width: var(--btn-width, var(--_btn-height));
        min-width: var(--btn-min-width, var(--btn-width, var(--_btn-height)));
    }

    /* --- States ----------------------------------------------------------- */
    /* One disabled look, whatever marks it: the button keeps its role colours, dimmed. */
    .btn:disabled,
    .btn.is-disabled,
    .btn[aria-disabled="true"] {
        opacity: 0.5;
        pointer-events: none;
        cursor: default;
    }

    .btn.is-loading {
        pointer-events: none;
        opacity: 0.7;
    }

    .btn.is-loading .btn__icon {
        animation: spin 0.6s linear infinite;
    }
}

/* public/css/system/field.css */
/* Field: one look for every form control (Component::formGroup() and .form-control).
 *
 * Before 2026-11 the same row mixed text inputs at 41-43px (14px text, grey fill,
 * transparent border), selects at 50px (16px, white, visible border) and TomSelect
 * (removed since) at 39px: base `input[type=text]` beat `.form-control` on specificity
 * while select and textarea lost to it. App Store idea: one quiet white field with a hairline border; the
 * border darkens on hover, takes the brand colour on focus (the ring is system/focus.css).
 *
 * Errors show only when a field is marked (.is-invalid, aria-invalid) or the user has
 * touched it (:user-invalid), never on page load.
 */
@layer components {
    :is(.form-control, .form-group-premium .form-group__control > :is(input, select, textarea)):not(
        [type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="color"],
        [type="hidden"], [type="submit"], [type="button"], [type="reset"], [type="image"]
    ),
    .invoice-create-editor__fields :is(input:not([type="checkbox"], [type="radio"], [type="hidden"]), select, textarea),
    /* Composite widgets keep their own padding (room for their icons). */
    .form-group__control .autocomplete-input,
    .theme-selector__field {
        --field-border: var(--border-subtle);
        box-sizing: border-box;
        width: 100%;
        min-height: var(--field-height);
        margin: 0;
        border: 1px solid var(--field-border);
        border-radius: var(--radius-md);
        background-color: #fff;
        box-shadow: none;
        color: var(--text-strong);
        font: var(--font-weight-normal) var(--text-sm)/1.4 var(--font-family);
        transition: border-color var(--motion-hover), background-color var(--motion-hover);
    }

    :is(.form-control, .form-group-premium .form-group__control > :is(input, select, textarea)):not(
        [type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="color"],
        [type="hidden"], [type="submit"], [type="button"], [type="reset"], [type="image"]
    ),
    .invoice-create-editor__fields :is(input:not([type="checkbox"], [type="radio"], [type="hidden"]), select, textarea) {
        /* A wrapper that draws an icon or a unit over the field makes room for it by setting
           these (they inherit, so a legacy-layer wrapper can set them). */
        padding: 0 var(--field-pad-end, var(--space-3)) 0 var(--field-pad-start, var(--space-3));
    }

    .form-group__control .autocomplete-input {
        padding-block: 0;
    }

    /* Theme chips (cursos): the wrapper draws the field and the chips sit inside it,
       before the bare input, like a multiple search-select. */
    .theme-selector__field {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: var(--space-1);
        padding: var(--space-1) var(--space-8) var(--space-1) var(--space-1-5);
        cursor: text;
    }

    .theme-selector__field:hover {
        --field-border: var(--border-strong);
    }

    .theme-selector__field:has(> .theme-selector__input:focus) {
        --field-border: var(--color-brand-500);
    }

    .theme-selector__field > .theme-selector__input {
        flex: 1 1 4ch;
        min-width: 4ch;
        min-height: 1.75rem;
        margin: 0;
        padding: 0 var(--space-1);
        border: 0;
        background: transparent;
        color: var(--text-strong);
        font: inherit;
    }

    .theme-selector__input::placeholder {
        color: var(--text-subtle);
        opacity: 1;
    }

    :is(.form-control, .form-group-premium .form-group__control > :is(input, select, textarea)):is(textarea) {
        min-height: 5rem;
        padding-block: var(--space-2);
        line-height: var(--leading-ui);
    }

    :is(.form-control, .form-group-premium .form-group__control > select):is(select) {
        padding-right: var(--space-8);
    }

    :is(.form-control, .form-group-premium .form-group__control > :is(input, select, textarea))::placeholder {
        color: var(--text-subtle);
        opacity: 1;
    }

    :is(.form-control, .form-group-premium .form-group__control > :is(input, select, textarea)):hover:not(:disabled, [readonly]) {
        --field-border: var(--border-strong);
    }

    :is(.form-control, .form-group-premium .form-group__control > :is(input, select, textarea)):focus {
        --field-border: var(--color-brand-500);
    }

    :is(.form-control, .form-group-premium .form-group__control > :is(input, select, textarea)):is(:disabled, [readonly]) {
        background-color: var(--surface-muted);
        color: var(--text-muted);
    }

    :is(.form-control, .form-group-premium .form-group__control > :is(input, select, textarea)):disabled {
        cursor: not-allowed;
    }

    :is(.form-control, .form-group-premium .form-group__control > :is(input, select, textarea)):is(.is-invalid, [aria-invalid="true"], :user-invalid) {
        --field-border: var(--color-danger-500);
    }

    /* Input groups: the group draws the field, the inner control is borderless. */
    .input-group {
        border-color: var(--border-subtle);
        box-shadow: none;
    }

    .input-group:focus-within {
        border-color: var(--color-brand-500);
        box-shadow: none;
        outline: var(--focus-outline);
        outline-offset: 1px;
    }

    .input-group .form-control {
        border: 0;
        border-radius: 0;
    }

    .input-group .form-control:focus-visible {
        outline: none;
    }

    /* Labels, help and required mark of Component::formGroup() */
    .form-group__label {
        color: var(--text-muted);
        font: var(--font-weight-semibold) var(--text-xs)/1.3 var(--font-family);
        letter-spacing: 0;
        text-transform: none;
    }

    .form-group__required {
        margin-left: var(--space-0-5);
        color: var(--color-danger-600);
    }

    .form-group__help {
        color: var(--text-subtle);
        font: var(--type-callout);
    }

    /* File field: the same box as a text field, with the picker as a secondary button
       inside it and the chosen file name after it (the browser draws a bare grey button). */
    .form-group__control > input[type="file"] {
        box-sizing: border-box;
        width: 100%;
        min-height: var(--field-height);
        margin: 0;
        padding: var(--space-1) var(--space-3) var(--space-1) var(--space-1);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-md);
        background-color: #fff;
        color: var(--text-muted);
        font: var(--font-weight-normal) var(--text-sm)/1.4 var(--font-family);
        cursor: pointer;
        transition: border-color var(--motion-hover);
    }

    .form-group__control > input[type="file"]:hover:not(:disabled) {
        border-color: var(--border-strong);
    }

    .form-group__control > input[type="file"]::file-selector-button {
        min-height: var(--btn-height-small);
        margin-right: var(--space-3);
        padding: 0 var(--space-3);
        border: 1px solid var(--btn-secondary-border);
        border-radius: var(--btn-radius);
        background-color: var(--btn-secondary-bg);
        color: var(--btn-secondary-fg);
        font: var(--btn-font-weight) var(--btn-font-size)/1 var(--font-family);
        cursor: pointer;
        transition: background-color var(--motion-hover);
    }

    .form-group__control > input[type="file"]:hover:not(:disabled)::file-selector-button {
        background-color: var(--btn-secondary-hover-bg);
    }
}

/* public/css/system/focus.css */
/* Focus: ONE ring for every control, shown only when the keyboard moves focus
 * (:focus-visible), the way the App Store does it. Components keep their own focus
 * colour change (a field's border, a row's background) but never draw their own ring:
 * FocusContractTest rejects outline:none and box-shadow in focus rules.
 *
 * The ring is --focus-outline (design-tokens.css): 3px of the brand colour at 45 %.
 * It lives in `components`, above legacy, so legacy `outline: none` cannot hide it.
 */
@layer components {
    :focus-visible {
        outline: var(--focus-outline);
        outline-offset: 2px;
    }

    /* Fields sit in tight rows and inside cells: hug them closer. */
    input:focus-visible,
    select:focus-visible,
    textarea:focus-visible,
    [contenteditable]:focus-visible {
        outline-offset: 1px;
    }

    /* Inside containers that clip (scrollers, tab strips, collapsible menus, lists),
       an outer ring is cut: draw it inside instead. */
    tr:focus-visible,
    td:focus-visible,
    th:focus-visible,
    td .btn:focus-visible,
    .tab-item:focus-visible,
    .sidebar__submenu-link:focus-visible,
    .pagination-link:focus-visible {
        outline-offset: -3px;
    }

    /* Restyled choice chips hide their checkbox (opacity 0, still focusable): the ring
       goes on the visible label instead of the invisible input. */
    .status-filter-chip__option input:focus-visible,
    .segmented__item > input:focus-visible,
    .search-select--multiple > .search-select__input:focus-visible,
    .theme-selector__field > .theme-selector__input:focus-visible {
        outline: none;
    }

    /* A field with tokens: the ring goes around the whole field, not the bare caret. */
    .search-select--multiple:not(.dynamic-filter *):has(> .search-select__input:focus-visible),
    .theme-selector__field:has(> .theme-selector__input:focus-visible) {
        outline: var(--focus-outline);
        outline-offset: 1px;
    }

    .status-filter-chip__option:has(> input:focus-visible),
    .segmented__item:has(> input:focus-visible) {
        outline: var(--focus-outline);
        outline-offset: -2px;
    }

    /* A mouse click focuses without a ring (Safari/Chrome already do this for buttons;
       this extends it to links and [tabindex] elements). */
    :focus:not(:focus-visible) {
        outline: none;
    }
}

/* public/css/system/grid.css */
/* Grid: how fields sit inside a card and how cards sit inside a tab panel.
 *
 * App Store idea (Grid.svelte): a grid TYPE fixes the column count, repeat(N, 1fr), with
 * token gaps (20px between columns, 24px between rows). No auto-fit: with
 * `repeat(auto-fit, minmax(250px, 1fr))` (the legacy .general-card__grid) the column
 * count depends on the room left, so a field ends up a third of a row wide just because
 * one more column fitted. Baseline: Full HD (1920px) and wider; the ERP is desktop only.
 *
 *   Fields inside a card: Component::card($html, $title, $icon, '', ['bodyClass' => 'field-grid field-grid--2'])
 *     .field-grid--2 | --3 | --4     fixed column count
 *     .field-grid__span-2            a field two columns wide
 *     .field-grid__full              a field the whole row wide (rich text, galleries)
 *     Component::formGroup() takes the span as its class: formGroup('Label', $html, '', 'field-grid__full')
 *
 *   Cards inside a tab panel:
 *     .panel-grid--2 | --3           equal columns
 *     .panel-grid--main-aside        main column plus a side column half as wide
 *     .panel-grid__column            several cards stacked in one column
 *
 * A card grows with its fields: no max-height and no inner scroll region in a form.
 */
@layer components {
    .field-grid,
    .panel-grid {
        --grid-columns: 1;
        display: grid;
        grid-template-columns: repeat(var(--grid-columns), minmax(0, 1fr));
        align-items: start;
    }

    .field-grid {
        gap: var(--space-6) var(--space-5);
    }

    .panel-grid {
        gap: var(--space-5);
    }

    .field-grid--2,
    .panel-grid--2 {
        --grid-columns: 2;
    }

    .field-grid--3,
    .panel-grid--3 {
        --grid-columns: 3;
    }

    .field-grid--4 {
        --grid-columns: 4;
    }

    .panel-grid--main-aside {
        grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    }

    .field-grid > .field-grid__span-2 {
        grid-column: span 2;
    }

    .field-grid > .field-grid__full {
        grid-column: 1 / -1;
    }

    /* The grid owns the spacing: a field brings no margin of its own. */
    .field-grid > * {
        min-width: 0;
        margin: 0;
    }

    .panel-grid > *,
    .panel-grid__column > * {
        min-width: 0;
        margin: 0;
    }

    .panel-grid__column {
        display: flex;
        flex-direction: column;
        gap: var(--space-5);
    }

    /* A list inside a field (gallery rows): stacked; in a fit grid it scrolls on its own. */
    .field-grid__scroll {
        display: flex;
        flex-direction: column;
        gap: var(--space-2);
        margin-top: var(--space-2);
    }

    /* Rows keep their height: when the box is shorter the list scrolls, it never squeezes. */
    .field-grid__scroll > * {
        flex: none;
    }

    /* Fit: the whole tab shows at Full HD without a page scroll (a viewport-lock page).
       Opt in with .panel-grid--fit on the tab's grid; the active tab panel and the form
       around it pass the page body's height down to it. Inside, every .field-grid__grow
       field (rich text, a list) shares the room its card has left and scrolls its own
       content: a field may be shorter than its text, the page never scrolls.
       In fit, a one-column card body stacks as a flex column (a grid row cannot grow on
       its own); put side-by-side fields in a nested .field-grid--2 row. */
    .layout-page__body > :has(> .grupo-panel.is-active > .panel-grid--fit),
    .grupo-panel.is-active:has(> .panel-grid--fit) {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        min-height: 0;
    }

    .panel-grid--fit {
        flex: 1 1 auto;
        min-height: 0;
        grid-auto-rows: minmax(0, 1fr);
        align-items: stretch;
    }

    .panel-grid--fit > *,
    .panel-grid--fit .panel-grid__column > * {
        display: flex;
        flex-direction: column;
    }

    .panel-grid--fit > * {
        min-height: 0;
    }

    /* In a column, cards with a grow field take the room left, never less than their
       fixed part (labels, toolbars, the minimum of each scroll box). */
    .panel-grid--fit .panel-grid__column > * {
        flex: none;
    }

    .panel-grid--fit .panel-grid__column > :has(.field-grid__grow) {
        flex: 1 1 0;
    }

    /* Dense: the height goes to the fields, not to the chrome around them. */
    .panel-grid--fit .general-card__header {
        margin-bottom: var(--space-3);
        padding-bottom: var(--space-2);
    }

    .panel-grid--fit .general-card > .field-grid:not(.field-grid--2, .field-grid--3, .field-grid--4) {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-3);
    }

    .panel-grid--fit .field-grid > * {
        flex: none;
    }

    .panel-grid--fit .field-grid > .field-grid__grow,
    .panel-grid--fit .field-grid__grow > .form-group__control {
        display: flex;
        flex: 1 1 0;
        flex-direction: column;
    }

    .panel-grid--fit .field-grid__grow .ql-toolbar {
        flex: none;
    }

    /* The explicit height keeps the text out of the field's minimum size; flex-grow gives
       the box the room left. */
    .panel-grid--fit .field-grid__grow :is(.ql-container, .field-grid__scroll) {
        flex: 1 1 auto;
        height: 3.5rem;
        min-height: 3.5rem;
        overflow-y: auto;
    }

    .panel-grid--fit .field-grid__grow .ql-editor {
        height: auto;
        min-height: 100%;
        overflow-y: visible;
    }
}

/* public/css/system/icon-cell.css */
/* Icon cell: a decorative icon before a table value (Component::iconCell), shared with
 * the CRM. Look from the --table-icon-cell-* tokens of @ensenyem/design-tokens
 * (suite-components.css); change them in the package.
 *   .icon-cell--strong   a count (group students): the value in bold
 * Inline, so the cell's own text-align (center in counts) still places it.
 */
@layer components {
    .icon-cell {
        display: inline-flex;
        align-items: center;
        gap: var(--table-icon-cell-gap);
        vertical-align: middle;
        white-space: nowrap;
    }

    .icon-cell__icon {
        flex: none;
        color: var(--table-icon-cell-icon-color);
        font-size: var(--table-icon-cell-icon-size);
        line-height: 1;
    }

    .icon-cell--strong .icon-cell__value {
        color: var(--table-icon-cell-strong-color);
        font-weight: var(--table-icon-cell-strong-weight);
    }
}

/* public/css/system/menu.css */
/* Menu: the one floating list every chooser in the ERP opens (App Store `Menu`: a
 * trigger that opens a floating panel, first option focusable, keyboard friendly).
 *
 * Native selects (form fields, list filters, rule selects, badges that are a choice) use it through the
 * customizable select (appearance: base-select: Chrome, Edge, Safari 27+). Browsers
 * without it (Firefox today) keep the system menu, which still works and still matches
 * the field. No library, and the browser keeps the keyboard handling, form submission
 * and accessibility of a real <select>. The search field (search-select.js) shares the
 * panel and rows.
 *
 * Panel: white, hairline border, soft shadow, 12px radius, 4px inset.
 * Items: 32px rows, 6px radius, hover/focus tint, brand checkmark on the selected one.
 */
@layer components {
    :is(select.form-control, .form-group-premium .form-group__control > select, .dynamic-filter__select, .filters__pill-select, .email-rule__select, select.badge):not([multiple], [size]),
    :is(select.form-control, .form-group-premium .form-group__control > select, .dynamic-filter__select, .filters__pill-select, .email-rule__select, select.badge):not([multiple], [size])::picker(select) {
        appearance: base-select;
    }

    /* The trigger: label (the injected <button><selectedcontent>, see
       public/js/components/select-enhance.js) then the chevron, in a row. Long labels end
       in an ellipsis instead of pushing the chevron out. */
    :is(.form-control, .form-group-premium .form-group__control > select):is(select):not([multiple], [size]) {
        display: inline-flex;
        align-items: center;
        gap: var(--space-2);
        padding-right: var(--space-3);
        overflow: hidden;
        background-image: none;
        cursor: pointer;
    }

    select > .select-trigger {
        display: flex;
        flex: 1;
        align-items: center;
        min-width: 0;
        padding: 0;
        border: 0;
        background: none;
        color: inherit;
        font: inherit;
        text-align: start;
    }

    select > .select-trigger selectedcontent {
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* The chevron of the trigger */
    :is(select.form-control, .form-group-premium .form-group__control > select, .dynamic-filter__select, .filters__pill-select, .email-rule__select, select.badge)::picker-icon {
        content: "";
        flex: none;
        inline-size: 1rem;
        block-size: 1rem;
        background-color: var(--text-subtle);
        /* A thin chevron instead of the browser's triangle */
        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
        transition: rotate var(--motion-enter);
    }

    :is(select.form-control, .form-group-premium .form-group__control > select, .dynamic-filter__select, .filters__pill-select, .email-rule__select, select.badge):open::picker-icon {
        rotate: 180deg;
    }

    /* Filter chips read as «Label: value ×» and never had an arrow; rule selects drew
       their own with a background image, replaced by the menu's chevron. */
    .dynamic-filter__select::picker-icon {
        display: none;
    }

    .email-rule__select {
        padding-right: var(--space-3);
        background-image: none;
    }

    /* Sesiones pills and rule selects: a block or inline-block display put the chevron
       under the value. */
    :is(.filters__pill-select, .email-rule__select) {
        display: inline-flex;
        align-items: center;
        gap: var(--space-1);
        width: auto;
    }

    .filters__pill-select::picker-icon {
        inline-size: 0.875rem;
        block-size: 0.875rem;
    }

    /* The floating panel */
    :is(select.form-control, .form-group-premium .form-group__control > select, .dynamic-filter__select, .filters__pill-select, .email-rule__select, select.badge)::picker(select) {
        min-width: anchor-size(width);
        max-height: min(20rem, 60vh);
        margin-block: var(--space-1);
        padding: var(--space-1);
        border: var(--hairline);
        border-radius: var(--radius-lg);
        background: #fff;
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12), 0 1px 2px rgba(15, 23, 42, 0.06);
        overflow-y: auto;
        opacity: 0;
        translate: 0 -4px;
        transition:
            opacity var(--motion-exit),
            translate var(--motion-exit),
            display var(--motion-exit) allow-discrete,
            overlay var(--motion-exit) allow-discrete;
    }

    :is(select.form-control, .form-group-premium .form-group__control > select, .dynamic-filter__select, .filters__pill-select, .email-rule__select, select.badge):open::picker(select) {
        opacity: 1;
        translate: 0 0;
        transition:
            opacity var(--motion-enter),
            translate var(--motion-enter),
            display var(--motion-enter) allow-discrete,
            overlay var(--motion-enter) allow-discrete;
    }

    @starting-style {
        :is(select.form-control, .form-group-premium .form-group__control > select, .dynamic-filter__select, .filters__pill-select, .email-rule__select, select.badge):open::picker(select) {
            opacity: 0;
            translate: 0 -4px;
        }
    }

    /* Items */
    :is(select.form-control, .form-group-premium .form-group__control > select, .dynamic-filter__select, .filters__pill-select, .email-rule__select, select.badge) option {
        display: flex;
        align-items: center;
        gap: var(--space-2);
        min-height: 2rem;
        padding: 0 var(--space-2-5);
        border-radius: var(--radius-sm);
        color: var(--text-strong);
        font: var(--type-body);
        cursor: pointer;
    }

    :is(select.form-control, .form-group-premium .form-group__control > select, .dynamic-filter__select, .filters__pill-select, .email-rule__select, select.badge) option:is(:hover, :focus-visible) {
        background: var(--ink-5);
        outline: none;
    }

    :is(select.form-control, .form-group-premium .form-group__control > select, .dynamic-filter__select, .filters__pill-select, .email-rule__select, select.badge) option:checked {
        color: var(--color-brand-600);
        font-weight: var(--font-weight-semibold);
    }

    :is(select.form-control, .form-group-premium .form-group__control > select, .dynamic-filter__select, .filters__pill-select, .email-rule__select, select.badge) option::checkmark {
        order: 1;
        margin-left: auto;
        color: var(--color-brand-500);
    }

    :is(select.form-control, .form-group-premium .form-group__control > select, .dynamic-filter__select, .filters__pill-select, .email-rule__select, select.badge) option:disabled {
        color: var(--text-subtle);
        cursor: default;
    }

    :is(select.form-control, .form-group-premium .form-group__control > select, .dynamic-filter__select, .filters__pill-select, .email-rule__select, select.badge) optgroup {
        font: var(--font-weight-semibold) var(--text-caption)/1.3 var(--font-family);
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    /* The same panel and rows for the search field (search-select.js). */
    .search-select__panel {
        padding: var(--space-1);
        border: var(--hairline);
        border-radius: var(--radius-lg);
        background: #fff;
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12), 0 1px 2px rgba(15, 23, 42, 0.06);
    }

    .search-select__option {
        min-height: 2rem;
        display: flex;
        align-items: center;
        padding: 0 var(--space-2-5);
        border-radius: var(--radius-sm);
        color: var(--text-strong);
        font: var(--type-body);
    }

    .search-select__option.is-active {
        background: var(--ink-5);
        color: var(--text-strong);
    }

    .search-select__option[aria-selected="true"] {
        color: var(--color-brand-600);
        font-weight: var(--font-weight-semibold);
    }

    @media (prefers-reduced-motion: reduce) {
        :is(select.form-control, .form-group-premium .form-group__control > select, .dynamic-filter__select, .filters__pill-select, .email-rule__select, select.badge)::picker-icon {
            transition: none;
        }
    }
}

/* public/css/system/metric.css */
/* Metric: one look for every figure-with-label in the ERP.
 *   .kpi-card            dashboard cards (home/index.php, dashboard-widgets.js)
 *   .summary-stats-*     Component::stats() strips (group billing tab, client invoices)
 * Both read the same properties, so a label, a value, a trend and a sub-line look the
 * same wherever they appear. Header counters (.layout-page__header-stat-item) stay inline.
 *
 * App Store idea: quiet label, big tabular figure, colour only where it means something
 * (trend up/down, the icon tone). Metrics are not clickable, so no hover, except the
 * billing-tab ones that filter the table (.fact-stat-trigger).
 */
@layer components {
    .kpi-card,
    .summary-stats-item {
        --metric-tone: var(--color-gray-500);
        --metric-icon-size: 2rem;
        --metric-value-font: var(--font-weight-semibold) 1.25rem/1.15 var(--font-family);
    }

    /* Tones of the icon tile */
    .summary-stats-item--primary, .kpi-card__icon-wrap--brand  { --metric-tone: var(--color-brand-500); }
    .summary-stats-item--success, .kpi-card__icon-wrap--green  { --metric-tone: var(--color-success-500); }
    .summary-stats-item--warning, .kpi-card__icon-wrap--orange { --metric-tone: var(--color-warning-500); }
    .summary-stats-item--danger                                { --metric-tone: var(--color-danger-500); }
    .summary-stats-item--info, .kpi-card__icon-wrap--blue      { --metric-tone: var(--color-info-500); }

    .kpi-card__icon-wrap,
    .summary-stats-item__icon {
        flex: none;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: var(--metric-icon-size);
        height: var(--metric-icon-size);
        border-radius: var(--radius-md);
        background: color-mix(in srgb, var(--metric-tone) 12%, transparent);
        color: color-mix(in srgb, var(--metric-tone), #000 25%);
    }

    .kpi-card__icon-wrap .material-symbols-outlined,
    .summary-stats-item__icon .material-symbols-outlined {
        font-size: calc(var(--metric-icon-size) * 0.55);
    }

    .kpi-card__label,
    .summary-stats-item__label {
        margin: 0;
        color: var(--ink-2);
        font: var(--font-weight-semibold) var(--text-caption)/1.3 var(--font-family);
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .kpi-card__value,
    .summary-stats-item__value {
        margin: 0;
        color: var(--ink-1);
        font: var(--metric-value-font);
        font-variant-numeric: tabular-nums;
        letter-spacing: -0.01em;
        white-space: nowrap;
    }

    .kpi-card__secondary,
    .summary-stats-item__secondary {
        margin: 0;
        color: var(--ink-3);
        font: var(--type-callout);
        font-variant-numeric: tabular-nums;
    }

    .kpi-card__trend-row,
    .summary-stats-item__main-row {
        display: flex;
        align-items: baseline;
        flex-wrap: wrap;
        gap: var(--space-1) var(--space-2);
    }

    .kpi-card__trend,
    .summary-stats-item__trend {
        display: inline-flex;
        align-items: center;
        gap: var(--space-0-5);
        font: var(--font-weight-semibold) var(--text-xs)/1 var(--font-family);
        font-variant-numeric: tabular-nums;
    }

    .kpi-card__trend .material-symbols-outlined,
    .summary-stats-item__trend .material-symbols-outlined {
        font-size: var(--text-base);
    }

    .kpi-card__trend--up   { color: var(--color-success-700); }
    .kpi-card__trend--down { color: var(--color-danger-700); }

    /* Dashboard card */
    .kpi-card {
        --metric-icon-size: 2.75rem;
        --metric-value-font: var(--font-weight-semibold) 1.625rem/1.1 var(--font-family);
        position: relative;
        display: flex;
        align-items: flex-start;
        gap: var(--space-4);
        padding: var(--space-5);
        border: var(--hairline);
        border-radius: var(--radius-lg);
        background: #fff;
        box-shadow: none;
    }

    .kpi-card__body {
        display: flex;
        flex-direction: column;
        gap: var(--space-1);
        min-width: 0;
    }

    /* Dashboard edit mode (drag to reorder) */
    #dashboard-container.is-editing .kpi-card {
        border: 2px dashed var(--color-brand-300);
        cursor: grab;
    }

    #dashboard-container.is-editing .kpi-card:active {
        cursor: grabbing;
    }

    /* Same id as the edit-mode rule above, or its `border` shorthand wins. */
    #dashboard-container.is-editing .kpi-card.drag-over {
        border-color: var(--color-brand-500);
        background: var(--accent-tint);
    }

    /* Component::stats() strip: as many columns as fit, never an uneven wrap. */
    .summary-stats-container {
        display: flex;
        align-items: center;
        gap: var(--space-4);
        padding: var(--space-4) var(--space-5);
        border: var(--hairline);
        border-radius: var(--radius-lg);
        background: #fff;
    }

    .summary-stats-bar {
        flex: 1;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
        gap: var(--space-4) var(--space-6);
        min-width: 0;
        margin: 0;
        padding: 0;
        border: 0;
        background: none;
    }

    .summary-stats-item {
        display: flex;
        align-items: flex-start;
        gap: var(--space-3);
        min-width: 0;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: var(--radius-md);
        background: none;
        box-shadow: none;
    }

    .summary-stats-item__content {
        display: flex;
        flex-direction: column;
        gap: var(--space-0-5);
        min-width: 0;
    }

    .summary-stats-actions {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: var(--space-2);
        margin: 0;
        padding: 0 0 0 var(--space-4);
        border-left: var(--hairline);
    }

    /* Billing-tab metrics that filter the table below them. */
    .summary-stats-item.fact-stat-trigger {
        margin: calc(-1 * var(--space-1-5));
        padding: var(--space-1-5);
        cursor: pointer;
        transition: background-color var(--motion-hover);
    }

    .summary-stats-item.fact-stat-trigger:hover {
        background: var(--ink-5);
    }

    .summary-stats-item.fact-stat-trigger.fact-stat--active {
        background: var(--accent-tint);
        box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-brand-500) 20%, transparent);
    }
}

/* public/css/system/motion.css */
/* Motion: the ERP is calm on purpose (decided 2026-11, App Store conventions).
 *
 * Tokens live in design-tokens.css and say what the motion is for:
 *   --motion-hover   210ms ease-out          pointer arrives
 *   --motion-settle  140ms ease-out          pointer leaves, press
 *   --motion-enter   200ms --ease-standard   something appears or moves
 *   --motion-exit    140ms --ease-exit       something leaves (shorter, accelerates away)
 *   --motion-expand  280ms --ease-standard   panels, drawers, expand/collapse
 * Each token is duration + easing: write `transition: opacity var(--motion-enter)` and
 * never append an easing (two easings make the browser drop the whole declaration).
 * No overshoot curves, no ripple, press changes colour not size.
 */

/* Reduced motion wins over everything. It lives in `reset`, the FIRST layer: across
 * layers !important is reversed, so the first layer's !important beats every later
 * layer's !important and all unlayered CSS. */
@layer reset {
    @media (prefers-reduced-motion: reduce) {
        *,
        *::before,
        *::after {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
            transition-delay: 0s !important;
            scroll-behavior: auto !important;
        }
    }
}

/* Enter/exit templates. Entering uses --motion-enter, leaving the shorter --motion-exit.
 * `display`/`overlay` transition with allow-discrete keeps the element painted while it
 * leaves, and @starting-style gives the first frame of the entrance, so things hidden with
 * `hidden`, display:none or dialog.close() animate both ways without any JS. Browsers
 * without these features simply show and hide at once.
 * They move with `scale`/`translate`, never `transform`, so they compose with any
 * transform a component already uses for positioning. */
@layer components {
    /* Every native <dialog> and [popover]: no class needed. */
    dialog,
    [popover] {
        opacity: 0;
        scale: 0.98;
        transition:
            opacity var(--motion-exit),
            scale var(--motion-exit),
            display var(--motion-exit) allow-discrete,
            overlay var(--motion-exit) allow-discrete;
    }

    dialog[open],
    [popover]:popover-open {
        opacity: 1;
        scale: 1;
        transition:
            opacity var(--motion-enter),
            scale var(--motion-enter),
            display var(--motion-enter) allow-discrete,
            overlay var(--motion-enter) allow-discrete;
    }

    dialog::backdrop {
        opacity: 0;
        transition:
            opacity var(--motion-exit),
            display var(--motion-exit) allow-discrete,
            overlay var(--motion-exit) allow-discrete;
    }

    dialog[open]::backdrop {
        opacity: 1;
        transition:
            opacity var(--motion-enter),
            display var(--motion-enter) allow-discrete,
            overlay var(--motion-enter) allow-discrete;
    }

    @starting-style {
        dialog[open],
        [popover]:popover-open {
            opacity: 0;
            scale: 0.98;
        }

        dialog[open]::backdrop {
            opacity: 0;
        }
    }

    /* .motion-pop: menus, flyouts and popovers shown and hidden with the `hidden` attribute.
       --motion-offset sets where it comes from (default: 4px above); this layer never
       declares it, so a component's own value applies. */
    .motion-pop {
        transition:
            opacity var(--motion-exit),
            translate var(--motion-exit),
            display var(--motion-exit) allow-discrete;
    }

    .motion-pop:not([hidden]) {
        transition:
            opacity var(--motion-enter),
            translate var(--motion-enter),
            display var(--motion-enter) allow-discrete;
    }

    /* While leaving it is still painted, but must not take clicks: a double click on a
       confirm button would otherwise fire it again on the fading copy. */
    .motion-pop[hidden],
    .motion-fade[hidden],
    dialog:not([open]),
    [popover]:not(:popover-open) {
        pointer-events: none;
    }

    .motion-pop[hidden] {
        opacity: 0;
        translate: var(--motion-offset, 0 -4px);
    }

    /* .motion-fade: full-screen layers shown and hidden with `hidden` (no movement). */
    .motion-fade {
        transition:
            opacity var(--motion-exit),
            display var(--motion-exit) allow-discrete;
    }

    .motion-fade:not([hidden]) {
        transition:
            opacity var(--motion-enter),
            display var(--motion-enter) allow-discrete;
    }

    .motion-fade[hidden] {
        opacity: 0;
    }

    @starting-style {
        .motion-pop:not([hidden]) {
            opacity: 0;
            translate: var(--motion-offset, 0 -4px);
        }

        .motion-fade:not([hidden]) {
            opacity: 0;
        }
    }
}

/* public/css/system/numeric.css */
/* Tabular figures for amounts.
 *
 * Outfit, the ERP font, draws proportional figures by default ("1111" is 22 px wide,
 * "0000" 42 px), so a column of money zigzags. Tabular figures give every digit the
 * same width and amounts line up digit by digit.
 *
 * Money table columns are matched by data-col (the contract that column visibility and
 * ordering already use); tests/Unit/TabularAmountsContractTest.php fails when a view adds
 * a money column that is not listed here. Use `.num` for any new amount.
 */
@layer utilities {
    .num,
    .amount,
    input[type="number"],

    /* Money columns */
    td[data-col="importe"],
    td[data-col="total"],
    td[data-col="precio"],
    td[data-col="price"],
    td[data-col="price_presencial"],
    td[data-col="price_streaming"],
    td[data-col="tarifa"],
    td[data-col="coste"],
    td[data-col="costs"],
    td[data-col="pvp_hora"],
    td[data-col="acumulado"],
    td[data-col="discount"],
    td[data-col="billing"],

    /* Amounts outside tables: invoice form and preview */
    .invoice-preview__totals-value,
    .invoice-preview__totals-grand,
    .invoice-preview__line-value,
    .invoice-preview__line-input--amount,
    .invoice-line__subtotal,
    .invoice-summary__total,
    .price-field,

    /* Group billing tab */
    .fact-amount-cell,
    .fact-amount-main,
    .fact-amount-sub,
    .fact-detail-price,
    .fact-detail-price-inline,
    .fact-invoices-amount,
    .fact-alumnos__importe,
    .rg-importe,
    .master-cuota-importe,
    .fundae-pill--money,

    /* Counters, summaries and timers (moved here from their legacy sheets) */
    .count-chip__value,
    .count-chip--total,
    .billing-summary-grid__value,
    .billing-summary-band__row > dd,
    #email-panel-root .email-template-card__count,
    .email-variables__cuenta,
    .toast__queue,
    .asistencia-sticky--pct,
    .asistencia-sticky--total,

    /* KPIs and summaries */
    .stat-value,
    .rentability-value,
    .financial-value,
    .expandable-list__price {
        font-variant-numeric: tabular-nums;
    }
}

/* public/css/system/search-select.css */
/* Search select: the field of public/js/components/search-select.js. The input takes
 * the field look (system/field.css, it carries .form-control); the panel and its rows
 * are the shared menu (system/menu.css). Here: the chevron, the panel's place in the
 * top layer, its motion and the rows only this field has.
 */
@layer components {
    .search-select {
        position: relative;
        display: block;
        min-width: 0;
    }

    .search-select > .search-select__input {
        padding-right: var(--space-8);
        text-overflow: ellipsis;
        cursor: pointer;
    }

    .search-select.is-open > .search-select__input {
        cursor: text;
    }

    .search-select__chevron {
        position: absolute;
        top: 50%;
        right: var(--space-3);
        inline-size: 1rem;
        block-size: 1rem;
        margin-top: calc(-1 * var(--space-2));
        background-color: var(--text-subtle);
        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
        pointer-events: none;
        transition: rotate var(--motion-enter);
    }

    .search-select.is-open > .search-select__chevron {
        rotate: 180deg;
    }

    .search-select.is-disabled > .search-select__chevron {
        opacity: 0.5;
    }

    /* Multiple: every choice sits inside the field as a token («2026 ×»), so the wrapper
       draws the field box and the input is only the caret after the tokens. Four classes
       on the input beat field.css (0,3,1). */
    .search-select--multiple {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: var(--space-1);
        box-sizing: border-box;
        width: 100%;
        min-height: var(--field-height);
        padding: var(--space-1) var(--space-8) var(--space-1) var(--space-1-5);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-md);
        background-color: #fff;
        cursor: text;
        transition: border-color var(--motion-hover);
    }

    .search-select--multiple:hover:not(.is-disabled) {
        border-color: var(--border-strong);
    }

    .search-select--multiple:has(> .search-select__input:focus) {
        border-color: var(--color-brand-500);
    }

    .search-select--multiple.is-disabled {
        background-color: var(--surface-muted);
        cursor: not-allowed;
    }

    .search-select.search-select--multiple > .search-select__input.form-control {
        flex: 1 1 4ch;
        width: auto;
        min-width: 4ch;
        min-height: 1.75rem;
        height: auto;
        padding: 0 var(--space-1);
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    .search-select__tokens {
        display: contents;
    }

    .search-select__token {
        display: inline-flex;
        align-items: center;
        gap: var(--space-0-5);
        max-width: 100%;
        height: 1.5rem;
        padding: 0 var(--space-0-5) 0 var(--space-2);
        border-radius: var(--radius-full);
        background: var(--ink-5);
        color: var(--text-strong);
        font: var(--font-weight-semibold) var(--text-xs)/1 var(--font-family);
        white-space: nowrap;
    }

    .search-select__token-text {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .search-select__token-remove {
        flex: none;
        inline-size: 1rem;
        block-size: 1rem;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: var(--radius-full);
        background-color: transparent;
        color: var(--ink-2);
        cursor: pointer;
        transition: background-color var(--motion-hover), color var(--motion-hover);
    }

    .search-select__token-remove::before {
        content: "";
        display: block;
        inline-size: 100%;
        block-size: 100%;
        background-color: currentColor;
        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M5 5l6 6M11 5l-6 6' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") center / 0.75rem no-repeat;
    }

    .search-select__token-remove:hover:not(:disabled) {
        background-color: var(--ink-4);
        color: var(--ink-1);
    }

    .search-select__token-remove:disabled {
        display: none;
    }

    /* Top layer (popover): never clipped by a scroller, a card or a modal. */
    .search-select__panel {
        position: fixed;
        inset: auto;
        margin: 0;
        max-height: min(20rem, 50vh);
        overflow-y: auto;
        overscroll-behavior: contain;
        opacity: 0;
        translate: 0 -4px;
        transition:
            opacity var(--motion-exit),
            translate var(--motion-exit),
            display var(--motion-exit) allow-discrete,
            overlay var(--motion-exit) allow-discrete;
    }

    .search-select__panel.is-above {
        translate: 0 4px;
    }

    .search-select__panel:popover-open {
        opacity: 1;
        translate: 0 0;
        transition:
            opacity var(--motion-enter),
            translate var(--motion-enter),
            display var(--motion-enter) allow-discrete,
            overlay var(--motion-enter) allow-discrete;
    }

    @starting-style {
        .search-select__panel:popover-open {
            opacity: 0;
            translate: 0 -4px;
        }
    }

    .search-select__option {
        cursor: pointer;
        user-select: none;
    }

    .search-select__option > span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .search-select__option.is-placeholder {
        color: var(--text-muted);
    }

    .search-select__option[aria-selected="true"]::after {
        content: "";
        flex: none;
        inline-size: 1rem;
        block-size: 1rem;
        margin-left: auto;
        padding-left: var(--space-2);
        background-color: var(--color-brand-500);
        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
    }

    /* Three classes: beats the active row rule of menu.css. */
    .search-select__panel .search-select__option.is-create {
        color: var(--color-brand-600);
        font-weight: var(--font-weight-semibold);
    }

    .search-select__option[aria-disabled="true"] {
        color: var(--text-subtle);
        cursor: default;
    }

    .search-select__group {
        padding: var(--space-2) var(--space-2-5) var(--space-1);
        color: var(--text-muted);
        font: var(--font-weight-semibold) var(--text-caption)/1.3 var(--font-family);
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    .search-select__option.is-grouped {
        padding-left: var(--space-5);
    }

    .search-select__empty {
        padding: var(--space-2) var(--space-2-5);
        color: var(--text-muted);
        font: var(--type-body);
    }

    /* Contexts without a width of their own */
    .email-rule__curso .search-select {
        min-width: 14rem;
    }

    /* Filter chips («Año: 2026, 2025»): the field reads as the chip's value, like the
       single-choice chips (no box, no chevron); four classes beat field.css. */
    .dynamic-filter .search-select {
        display: inline-flex;
        align-items: center;
        min-width: 0;
    }

    .dynamic-filter .search-select > .search-select__input.form-control {
        field-sizing: content;
        width: auto;
        min-width: 3ch;
        max-width: 14rem;
        min-height: 0;
        height: auto;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        color: var(--text-strong);
        font: var(--font-weight-semibold) var(--text-xs)/1.2 var(--font-family);
    }

    .dynamic-filter .search-select > .search-select__input.form-control::placeholder {
        color: var(--text-strong);
    }

    .dynamic-filter .search-select.is-open > .search-select__input.form-control::placeholder {
        color: var(--text-subtle);
    }

    .dynamic-filter .search-select > .search-select__chevron {
        display: none;
    }

    /* A multiple chip («Año: 2026 × 2025 ×»): the tokens are the value, no field box. */
    .dynamic-filter .search-select--multiple {
        flex-wrap: nowrap;
        gap: var(--space-1);
        width: auto;
        min-height: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    .dynamic-filter .search-select--multiple .search-select__token {
        height: 1.25rem;
    }

    /* Closed with tokens, the empty search takes no room; open, the caret needs some. */
    .dynamic-filter .search-select--multiple:has(.search-select__token):not(.is-open) > .search-select__input.form-control {
        min-width: 1px;
    }

    /* In a chip the focus ring goes around the whole pill, not the bare text. */
    .dynamic-filter:has(> .search-select > .search-select__input:focus-visible) {
        outline: var(--focus-outline);
        outline-offset: 1px;
    }

    .dynamic-filter .search-select > .search-select__input:focus-visible {
        outline: none;
    }

    /* Phone prefix: a narrow field showing "+34"; four classes beat field.css. */
    .phone-input > .search-select > .search-select__input.form-control {
        padding-left: var(--space-2);
        padding-right: var(--space-6);
    }

    .phone-input > .search-select > .search-select__chevron {
        right: var(--space-2);
    }

    /* As tall as the rule selects around it; four classes beat field.css. */
    .email-rule__curso .search-select > .search-select__input.form-control {
        min-height: var(--layout-input-height, var(--field-height));
    }

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

/* The native select stays for the form and for existing code, out of sight. Utilities
   beat components, so field rules (width, height) cannot bring it back. */
@layer utilities {
    .search-select__native {
        position: absolute;
        width: 1px;
        min-width: 0;
        height: 1px;
        min-height: 0;
        appearance: none;
        margin: -1px;
        padding: 0;
        border: 0;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
        opacity: 0;
        pointer-events: none;
    }
}

/* public/css/system/segmented.css */
/* Segmented select: a short choice (2–4 options) as one row of segments, built by
 * public/js/components/segmented-select.js from <select data-segmented>.
 *
 * Same idea as the tab strips (tabs.css): a quiet track and one white pill that
 * slides to the chosen segment. The script writes the pill's position and width as
 * --segmented-x/-w; until it has (first paint), the chosen segment paints its own
 * pill so nothing jumps. Sized for the 28px filter chips.
 *
 * `.segmented--multi` is the same track for several choices at once (checkboxes).
 */
@layer components {
    .segmented {
        position: relative;
        display: inline-flex;
        align-items: center;
        padding: var(--segmented-pad);
        border-radius: var(--radius-full);
        background: var(--ink-5);
        vertical-align: middle;
    }

    .segmented::before {
        content: "";
        position: absolute;
        top: var(--segmented-pad);
        bottom: var(--segmented-pad);
        left: 0;
        width: var(--segmented-w, 0px);
        translate: var(--segmented-x, 0px) 0;
        border-radius: var(--radius-full);
        background: var(--segmented-pill-bg);
        box-shadow: var(--segmented-pill-shadow);
        opacity: 0;
        pointer-events: none;
    }

    .segmented[data-indicator-ready][data-indicator]::before {
        opacity: 1;
        transition: translate var(--motion-enter), width var(--motion-enter);
    }

    .segmented__item {
        position: relative;
        z-index: 1;
        display: inline-flex;
        align-items: center;
        height: 1.25rem;
        margin: 0;
        padding: 0 var(--space-1-5);
        border: 0;
        border-radius: var(--radius-full);
        background: transparent;
        box-shadow: none;
        color: var(--ink-2);
        font-family: inherit;
        font-size: var(--text-xs);
        font-weight: var(--font-weight-semibold);
        line-height: 1;
        letter-spacing: normal;
        text-transform: none;
        white-space: nowrap;
        cursor: pointer;
        transition: color var(--motion-hover);
    }

    .segmented__item:hover:not(:disabled) {
        color: var(--ink-1);
    }

    .segmented__item[aria-checked="true"] {
        color: var(--primary-700);
    }

    .segmented:not([data-indicator-ready]) .segmented__item[aria-checked="true"] {
        background: var(--segmented-pill-bg);
        box-shadow: var(--segmented-pill-shadow);
    }

    .segmented__item:disabled {
        opacity: 0.45;
        cursor: default;
    }

    /* Native inputs, no script. Multiple choice (grupos «Estado») uses checkboxes, so several
       segments can be on and each chosen one paints its own pill instead of one pill sliding.
       `.segmented--radio` is the same with radios inside a form (matrícula en masa): the
       browser handles arrows and posting the value. */
    :is(.segmented--multi, .segmented--radio) .segmented__item > input {
        position: absolute;
        opacity: 0;
        pointer-events: none;
    }

    :is(.segmented--multi, .segmented--radio) .segmented__item:has(> input:checked) {
        background: var(--segmented-pill-bg);
        box-shadow: var(--segmented-pill-shadow);
        color: var(--primary-700);
    }

    .segmented__item:has(> input:focus-visible) {
        outline: 2px solid var(--primary-500);
        outline-offset: 1px;
    }

    /* In a form row: as tall as the fields beside it (--field-height). */
    .segmented--field {
        --segmented-pad: 3px;
        display: flex;
        height: var(--field-height);
    }

    .segmented--field .segmented__item {
        flex: 1 1 0;
        justify-content: center;
        height: 100%;
        padding: 0 var(--space-4);
        font-size: var(--text-sm);
        transition: color var(--motion-hover), background-color var(--motion-settle), box-shadow var(--motion-settle);
    }

    /* In a filter chip the track sits flush with the chip's right edge. */
    .dynamic-filter:has(> .segmented) {
        padding-right: var(--space-0-5);
    }

    .dynamic-filter:has(> .segmented) > .dynamic-filter__remove {
        margin-right: var(--space-0-5);
    }
}

/* The native select stays for the form and for existing code, out of sight. */
@layer utilities {
    .segmented__native {
        position: absolute;
        width: 1px;
        min-width: 0;
        height: 1px;
        min-height: 0;
        appearance: none;
        margin: -1px;
        padding: 0;
        border: 0;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
        opacity: 0;
        pointer-events: none;
    }
}

/* public/css/system/table.css */
/* Table: the ERP's one table look (Component::listTable, Component::table, .table-interactive
 * and .table in hand-written markup).
 *
 * Same pattern as the button: the declarations below never change; contexts reassign
 * public hooks. The component never declares them, so a context always wins:
 *   --table-th-padding-block, --table-th-padding-inline   (header cells)
 *   --table-td-padding-block, --table-td-padding-inline   (body cells)
 *   --table-th-fg, --table-th-text-size, --table-td-text-size
 *   --table-row-hover-bg                                   (hovered row)
 *   --table-row-bar-color                                  (side bar of a clickable row)
 *   --table-divider-color                                  (line between body rows)
 * The wrapper reads --table-wrapper-border-width and its tokens (--table-wrapper-border,
 * -radius, -bg), which a context can reassign too.
 *
 * One header for every table: the list header (white, hairline shadow, UPPERCASE).
 * Densities: the list (default) and .table-interactive--compact (smaller text). They set
 * private values (--_table-*), never the declarations.
 */
@layer components {
    :is(.table, .table-interactive) {
        --_table-th-text-size: var(--text-xs);
        --_table-td-text-size: var(--text-sm);
    }

    .table-interactive--compact {
        --_table-th-text-size: var(--table-compact-header-font-size);
        --_table-td-text-size: var(--table-compact-cell-font-size);
    }

    .table-wrapper {
        border: var(--table-wrapper-border-width, 1px) solid var(--table-wrapper-border);
        border-radius: var(--table-wrapper-radius);
        background-color: var(--table-wrapper-bg);
    }

    :is(.table, .table-interactive) thead th {
        border-bottom: 1px solid var(--gray-200);
        background-color: var(--surface-header);
        box-shadow: 0 1px 0 rgb(15 23 42 / 4%);
        color: var(--table-th-fg, var(--gray-700));
        font-size: var(--table-th-text-size, var(--_table-th-text-size));
        font-weight: var(--font-weight-semibold);
        letter-spacing: 0.045em;
        text-transform: uppercase;
    }

    :is(.table, .table-interactive) tbody td {
        border-bottom: 1px solid var(--table-divider-color, var(--gray-100));
        font-size: var(--table-td-text-size, var(--_table-td-text-size));
    }

    :is(.table, .table-interactive) tbody tr:last-child td {
        border-bottom: none;
    }

    /* Header cells and the body cells of a plain .table follow the layout density
       (--layout-table-cell-* change inside .is-compact). */
    :where(.is-compact) :is(.table, .table-interactive) th {
        padding-block: var(--table-th-padding-block, var(--layout-table-cell-py));
        padding-inline: var(--table-th-padding-inline, var(--layout-table-cell-px));
    }

    :where(.is-compact) .table:not(.table-interactive) td {
        padding-block: var(--table-td-padding-block, var(--layout-table-cell-py));
        padding-inline: var(--table-td-padding-inline, var(--layout-table-cell-px));
    }

    .table-interactive td {
        padding-block: var(--table-td-padding-block, var(--space-2));
        padding-inline: var(--table-td-padding-inline, var(--space-3));
        vertical-align: middle;
    }

    .table-interactive tbody tr:hover {
        background: var(--table-row-hover-bg, var(--primary-50));
    }

    .table-interactive tbody tr[data-href]:is(:hover, :focus-visible) {
        background: var(--table-row-hover-bg, var(--primary-50));
        box-shadow: inset 3px 0 0 var(--table-row-bar-color, var(--primary-500));
    }

    .table-interactive tbody tr[data-href]:focus-visible {
        outline: 2px solid var(--primary-500);
        outline-offset: -2px;
    }

    /* Money columns: header and figures end-aligned, matched by data-col like the
       tabular figures in numeric.css. */
    :is(.table, .table-interactive) :is(th, td):is(
        [data-col="importe"], [data-col="total"], [data-col="precio"], [data-col="price"],
        [data-col="price_presencial"], [data-col="price_streaming"], [data-col="tarifa"],
        [data-col="coste"], [data-col="costs"], [data-col="pvp_hora"], [data-col="acumulado"]
    ) {
        text-align: end;
    }

    /* Sort indicator, one for every table: table-sort.js (or the server) adds
       .sortable-header to sortable headers and .sort-asc/.sort-desc to the active one. */
    .sortable-header:hover {
        background-color: var(--gray-100);
    }

    .sortable-header:focus-visible {
        outline: 2px solid var(--primary-500);
        outline-offset: -2px;
    }

    .sortable-header::after {
        content: "unfold_more";
        display: inline-block;
        margin-left: var(--space-1);
        font-family: 'Material Symbols Outlined';
        font-size: var(--text-sm);
        line-height: 1;
        vertical-align: middle;
        color: var(--gray-400);
        opacity: 0.7;
        transition: color 0.2s ease;
    }

    .sortable-header:hover::after {
        color: var(--gray-600);
        opacity: 1;
    }

    .sortable-header:is(.sort-asc, .sort-desc)::after {
        color: var(--primary-600);
        opacity: 1;
    }

    .sortable-header.sort-asc::after {
        content: "arrow_upward";
    }

    .sortable-header.sort-desc::after {
        content: "arrow_downward";
    }
}

/* public/css/system/tabs.css */
/* Tabs: ONE segmented control for every tab strip rendered by Component::tabs()
 * (nav.tabs-premium > button.tab-item, driven by public/js/components/tabs.js).
 *
 * App Store idea: a quiet track and a single white pill that slides to the selected
 * tab. tabs.js writes the pill's position and width as --tabs-indicator-x/-w; until
 * it has (no JS, first paint), the active tab paints its own pill so nothing jumps.
 * Arrow keys, Home and End move the selection (WAI-ARIA tabs pattern).
 */
@layer components {
    .tabs-premium {
        --tabs-pad: 3px;
        --tabs-radius: var(--radius-lg);
        position: relative;
        display: inline-flex;
        align-items: center;
        gap: var(--space-0-5);
        max-width: 100%;
        margin: 0;
        padding: var(--tabs-pad);
        border: 0;
        border-radius: var(--tabs-radius);
        background: var(--ink-5);
        overflow-x: auto;
        scrollbar-width: none;
    }

    .tabs-premium::before {
        content: "";
        position: absolute;
        top: var(--tabs-pad);
        bottom: var(--tabs-pad);
        left: 0;
        width: var(--tabs-indicator-w, 0px);
        translate: var(--tabs-indicator-x, 0px) 0;
        border-radius: calc(var(--tabs-radius) - var(--tabs-pad));
        background: #fff;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08), 0 0 0 0.5px var(--ink-4);
        opacity: 0;
        pointer-events: none;
    }

    .tabs-premium[data-indicator-ready]::before {
        opacity: 1;
        transition: translate var(--motion-enter), width var(--motion-enter);
    }

    .tab-item {
        position: relative;
        z-index: 1;
        flex: 0 0 auto;
        display: inline-flex;
        align-items: center;
        gap: var(--space-1-5);
        height: 2rem;
        padding: 0 var(--space-3-5);
        border: 0;
        border-radius: calc(var(--tabs-radius) - var(--tabs-pad));
        background: transparent;
        box-shadow: none;
        color: var(--ink-2);
        font: var(--type-headline);
        white-space: nowrap;
        cursor: pointer;
        transition: color var(--motion-hover), background-color var(--motion-hover);
    }

    .tab-item .material-symbols-outlined,
    .tab-item i {
        font-size: var(--text-base);
        opacity: 0.8;
    }

    .tab-item:hover {
        color: var(--ink-1);
    }

    .tab-item.is-active {
        color: var(--primary-700);
    }

    .tab-item.is-active .material-symbols-outlined,
    .tab-item.is-active i {
        opacity: 1;
    }

    /* Before tabs.js places the sliding pill (or without JS), the active tab paints it. */
    .tabs-premium:not([data-indicator-ready]) .tab-item.is-active {
        background: #fff;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08), 0 0 0 0.5px var(--ink-4);
    }

    .tab-item[hidden] {
        display: none;
    }

    /* Switching tabs: the new panel fades in quickly, without moving. */
    .grupo-panel.is-active,
    [data-tab-panel].is-active:not([hidden]) {
        animation: tab-panel-in var(--motion-enter);
    }

    @keyframes tab-panel-in {
        from { opacity: 0; }
    }
}

