/* Gesmendi — estilos propios. Sin estilos en línea: la CSP (style-src 'self') los bloquea. */

/* Source Sans 3 (SIL OFL), tipografía de AdminLTE 4, servida desde el propio sitio. */
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 400; font-display: swap; src: url("../lib/fonts/source-sans-3/source-sans-3-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 400; font-display: swap; src: url("../lib/fonts/source-sans-3/source-sans-3-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 600; font-display: swap; src: url("../lib/fonts/source-sans-3/source-sans-3-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 600; font-display: swap; src: url("../lib/fonts/source-sans-3/source-sans-3-latin-ext-600-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 700; font-display: swap; src: url("../lib/fonts/source-sans-3/source-sans-3-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 700; font-display: swap; src: url("../lib/fonts/source-sans-3/source-sans-3-latin-ext-700-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
/* =====================================================================
   Sistema visual de Gesmendi
   - Tokens en :root (color de la federación, superficies, radios, sombras).
   - Componentes propios con prefijo g- para no chocar con Bootstrap/AdminLTE.
   - Sin estilos en línea en el HTML: la CSP (style-src 'self') los bloquea.
   ===================================================================== */
:root {
    --g-brand: #1f6b45;
    --g-brand-600: #185a39;
    --g-brand-700: #12462c;
    --g-brand-050: #ecf5f0;
    --g-brand-100: #d3e9dc;
    --g-accent: #e07a1f;
    --g-ink: #1d2a24;
    --g-muted: #5f6f67;
    --g-line: #e3e8e5;
    --g-surface: #ffffff;
    --g-canvas: #f4f6f5;
    --g-radius: .75rem;
    --g-radius-sm: .5rem;
    --g-shadow: 0 1px 2px rgba(16, 40, 28, .06), 0 1px 3px rgba(16, 40, 28, .08);
    --g-shadow-lg: 0 10px 30px rgba(16, 40, 28, .10);

    /* Bootstrap: el color primario pasa a ser el de la federación */
    --bs-primary: var(--g-brand);
    --bs-primary-rgb: 31, 107, 69;
    --bs-link-color: var(--g-brand);
    --bs-link-color-rgb: 31, 107, 69;
    --bs-link-hover-color: var(--g-brand-700);
    --bs-body-color: var(--g-ink);
    --bs-border-color: var(--g-line);
    --bs-border-radius: var(--g-radius-sm);
    --bs-border-radius-lg: var(--g-radius);
    --bs-focus-ring-color: rgba(31, 107, 69, .25);

    /* Compatibilidad con clases anteriores */
    --gesmendi: var(--g-brand);
    --gesmendi-dark: var(--g-brand-700);
}

body { background: var(--g-canvas); -webkit-font-smoothing: antialiased; }
body.portal, body.auth { font-family: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }

h1, h2, h3, h4, h5, .h1, .h2, .h3, .h4, .h5 { color: var(--g-ink); font-weight: 600; letter-spacing: -.01em; }
.text-muted, .text-body-secondary { color: var(--g-muted) !important; }
.tabular { font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }

/* ---------- Botones ---------- */
.btn { font-weight: 600; border-radius: var(--g-radius-sm); }
.btn-primary, .btn-gesmendi {
    --bs-btn-bg: var(--g-brand); --bs-btn-border-color: var(--g-brand);
    --bs-btn-hover-bg: var(--g-brand-600); --bs-btn-hover-border-color: var(--g-brand-600);
    --bs-btn-active-bg: var(--g-brand-700); --bs-btn-active-border-color: var(--g-brand-700);
    --bs-btn-color: #fff; --bs-btn-hover-color: #fff; --bs-btn-active-color: #fff;
    --bs-btn-disabled-bg: var(--g-brand); --bs-btn-disabled-border-color: var(--g-brand);
}
.btn-accent {
    --bs-btn-bg: var(--g-accent); --bs-btn-border-color: var(--g-accent);
    --bs-btn-hover-bg: #c96a14; --bs-btn-hover-border-color: #c96a14;
    --bs-btn-color: #fff; --bs-btn-hover-color: #fff; --bs-btn-active-bg: #b35d10; --bs-btn-active-color: #fff;
}
.btn-soft {
    --bs-btn-bg: var(--g-brand-050); --bs-btn-border-color: var(--g-brand-050); --bs-btn-color: var(--g-brand-700);
    --bs-btn-hover-bg: var(--g-brand-100); --bs-btn-hover-border-color: var(--g-brand-100); --bs-btn-hover-color: var(--g-brand-700);
}
.btn-icon { width: 2.125rem; height: 2.125rem; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.form-control:focus, .form-select:focus { border-color: var(--g-brand); box-shadow: 0 0 0 .2rem var(--bs-focus-ring-color); }
.form-check-input:checked { background-color: var(--g-brand); border-color: var(--g-brand); }
.form-label { font-weight: 600; font-size: .9rem; margin-bottom: .35rem; }
.form-text { color: var(--g-muted); }

/* ---------- Tarjetas y tablas ---------- */
.card { border: 1px solid var(--g-line); border-radius: var(--g-radius); box-shadow: var(--g-shadow); }
.card-header { background: transparent; border-bottom: 1px solid var(--g-line); padding: .9rem 1.25rem; }
.card-header.d-flex::before, .card-header.d-flex::after { content: none; display: none; } /* el clearfix de AdminLTE descuadra justify-content */
.validation-summary-valid { display: none; }
.card-footer { background: #fafbfa; border-top: 1px solid var(--g-line); }
.card-title-sm { font-size: .95rem; font-weight: 600; margin: 0; display: flex; align-items: center; gap: .5rem; }
.card-title-sm .bi { color: var(--g-brand); }

.g-table { margin: 0; }
.g-table thead th {
    font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--g-muted);
    font-weight: 600; background: #f8faf9; border-bottom: 1px solid var(--g-line); white-space: nowrap; padding: .7rem 1rem;
}
.g-table td { padding: .75rem 1rem; vertical-align: middle; border-color: var(--g-line); }
.g-table tbody tr:hover { background: #f8fbf9; }
.g-table .cell-main { font-weight: 600; color: var(--g-ink); }
.g-table .cell-sub { display: block; font-size: .825rem; color: var(--g-muted); }
.g-table .row-actions { white-space: nowrap; text-align: right; }
.g-table a.row-link { color: inherit; text-decoration: none; }
.g-table a.row-link:hover .cell-main { color: var(--g-brand); text-decoration: underline; }

.g-avatar {
    width: 2.25rem; height: 2.25rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    background: var(--g-brand-050); color: var(--g-brand-700); font-weight: 700; font-size: .8rem; flex: none;
}

/* Etiquetas de estado */
.g-badge { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.g-badge-ok { background: #e3f4ea; color: #146c3c; }
.g-badge-warn { background: #fdf0de; color: #8a4b08; }
.g-badge-off { background: #eef0ef; color: #5f6f67; }
.g-badge-info { background: #e5f0fb; color: #1d5b94; }

/* ---------- Cabecera de página (la pinta el layout) ---------- */
.g-pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.g-pagehead h1 { font-size: 1.6rem; margin: .15rem 0 0; }
.g-pagehead .g-subtitle { color: var(--g-muted); margin: .25rem 0 0; }
.g-pagehead .breadcrumb { font-size: .82rem; margin: 0; --bs-breadcrumb-divider-color: #9aa8a1; }
.g-pagehead .breadcrumb a { color: var(--g-muted); text-decoration: none; }
.g-pagehead .breadcrumb a:hover { color: var(--g-brand); }
.g-pagehead .g-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
/* Cabecera antigua (pantallas aún no adaptadas) */
.page-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1.25rem; }
.page-header h1 { font-size: 1.5rem; margin: 0; }

/* Barra de búsqueda dentro de una tarjeta */
.g-toolbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; padding: .9rem 1.25rem; border-bottom: 1px solid var(--g-line); }
.g-search { position: relative; flex: 1 1 18rem; max-width: 28rem; }
.g-search .bi { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--g-muted); }
.g-search .form-control { padding-left: 2.3rem; }
.g-count { color: var(--g-muted); font-size: .875rem; }

/* Estado vacío */
.g-empty { text-align: center; padding: 3rem 1.5rem; color: var(--g-muted); }
.g-empty .g-empty-icon, .g-empty-icon { width: 3.5rem; height: 3.5rem; border-radius: 50%; background: var(--g-brand-050); color: var(--g-brand); display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem; margin-bottom: .75rem; }
.g-empty h2 { font-size: 1.05rem; margin-bottom: .25rem; }

/* Paginación */
.g-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; padding: .75rem 1.25rem; border-top: 1px solid var(--g-line); }
.pagination { --bs-pagination-active-bg: var(--g-brand); --bs-pagination-active-border-color: var(--g-brand); --bs-pagination-color: var(--g-ink); margin: 0; }

/* ---------- Indicadores del inicio ---------- */
.g-kpi { padding: 1.1rem 1.25rem; display: flex; flex-direction: row; gap: 1rem; align-items: flex-start; height: 100%; }
.g-kpi-icon { width: 2.75rem; height: 2.75rem; border-radius: .7rem; display: inline-flex; align-items: center; justify-content: center; font-size: 1.25rem; flex: none; background: var(--g-brand-050); color: var(--g-brand); }
.g-kpi-icon.accent { background: #fdf0e3; color: var(--g-accent); }
.g-kpi-icon.info { background: #e5f0fb; color: #1d5b94; }
.g-kpi-icon.muted { background: #eef0ef; color: #5f6f67; }
.g-kpi-label { font-size: .82rem; color: var(--g-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.g-kpi-value { font-size: 1.85rem; font-weight: 700; line-height: 1.1; color: var(--g-ink); font-variant-numeric: tabular-nums; }
.g-kpi-foot { font-size: .82rem; color: var(--g-muted); margin-top: .15rem; }

.g-hero {
    border-radius: var(--g-radius); color: #fff; padding: 1.5rem 1.75rem; margin-bottom: 1.5rem; position: relative; overflow: hidden;
    background: linear-gradient(120deg, var(--g-brand-700) 0%, var(--g-brand) 60%, #2f8a5b 100%);
}
.g-hero::after { content: ""; position: absolute; inset: auto -2% -1px -2%; height: 70%; background: url("../img/montes.svg") bottom / 100% auto no-repeat; opacity: .22; pointer-events: none; }
.g-hero h1 { color: #fff; font-size: 1.6rem; margin: 0; position: relative; }
.g-hero p { margin: .35rem 0 0; color: rgba(255, 255, 255, .85); position: relative; }
.g-hero .g-chip { position: relative; display: inline-flex; gap: .4rem; align-items: center; background: rgba(255, 255, 255, .16); border-radius: 999px; padding: .25rem .7rem; font-size: .85rem; font-weight: 600; }

.g-chart { width: 100%; height: 140px; display: block; }
.g-chart .bar { fill: var(--g-brand); opacity: .85; }
.g-chart .bar:hover { opacity: 1; }
.g-chart .bar.weekend { fill: #8fc2a5; }
.g-chart .axis { fill: var(--g-muted); font-size: 10px; }

.g-quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .75rem; }
.g-quick a { display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem; border: 1px solid var(--g-line); border-radius: var(--g-radius-sm); background: var(--g-surface); color: var(--g-ink); text-decoration: none; font-weight: 600; transition: border-color .15s, box-shadow .15s; }
.g-quick a:hover { border-color: var(--g-brand); box-shadow: var(--g-shadow); color: var(--g-brand-700); }
.g-quick a .bi { font-size: 1.15rem; color: var(--g-brand); }

/* ---------- Formularios por secciones ---------- */
.g-form-section { display: grid; grid-template-columns: minmax(0, 16rem) minmax(0, 1fr); gap: 1.5rem; padding: 1.5rem 1.25rem; border-bottom: 1px solid var(--g-line); }
.g-form-section:last-of-type { border-bottom: 0; }
.g-form-section h2 { font-size: 1rem; margin: 0 0 .3rem; }
.g-form-section p { color: var(--g-muted); font-size: .875rem; margin: 0; }
@media (max-width: 767.98px) { .g-form-section { grid-template-columns: 1fr; gap: .75rem; } }
.g-form-actions { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: space-between; gap: .75rem; padding: .9rem 1.25rem; background: rgba(255, 255, 255, .96); border-top: 1px solid var(--g-line); border-radius: 0 0 var(--g-radius) var(--g-radius); }
.card-form { max-width: 1040px; }

.field-validation-error { color: var(--bs-danger); font-size: .85em; display: block; margin-top: .25rem; }
.input-validation-error { border-color: var(--bs-danger); }

/* ---------- Avisos (toasts) ---------- */
.g-toasts { position: fixed; bottom: 1rem; right: 1rem; z-index: 1080; display: flex; flex-direction: column; gap: .5rem; }
.g-toasts .toast { border: 0; box-shadow: var(--g-shadow-lg); border-radius: var(--g-radius-sm); }
.g-toasts .toast.ok { border-left: 4px solid #1e8e4f; }
.g-toasts .toast.error { border-left: 4px solid var(--bs-danger); }

/* ---------- Panel de gestión (AdminLTE) ---------- */
.app-sidebar.sidebar-gesmendi { background: linear-gradient(180deg, var(--g-brand-700) 0%, #0f3a25 100%); }
.sidebar-gesmendi .sidebar-brand { border-bottom-color: rgba(255, 255, 255, .1); }
.sidebar-gesmendi .brand-link { display: flex; align-items: center; gap: .55rem; }
.sidebar-gesmendi .brand-logo { width: 1.9rem; height: 1.9rem; }
.sidebar-gesmendi .brand-text { font-weight: 700 !important; letter-spacing: .01em; }
.sidebar-gesmendi .sidebar-menu .nav-header { color: rgba(255, 255, 255, .45); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; padding-top: 1rem; }
.sidebar-gesmendi .sidebar-menu .nav-link { border-radius: var(--g-radius-sm); color: rgba(255, 255, 255, .82); }
.sidebar-gesmendi .sidebar-menu .nav-link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.sidebar-gesmendi .sidebar-menu .nav-link.active { background: rgba(255, 255, 255, .16); color: #fff; box-shadow: inset 3px 0 0 var(--g-accent); }
.sidebar-gesmendi .nav-treeview .nav-link .nav-icon { font-size: .45rem; }
.sidebar-gesmendi .nav-link.disabled { opacity: .5; }
.sidebar-gesmendi .nav-link.disabled p { white-space: normal; }
.sidebar-gesmendi .badge-pend { font-size: .62rem; font-weight: 600; background: rgba(255, 255, 255, .12); color: rgba(255, 255, 255, .7); border-radius: 999px; padding: .1rem .4rem; margin-left: .3rem; }
.app-header { border-bottom: 1px solid var(--g-line); box-shadow: none; }
.app-header .g-user { display: flex; align-items: center; gap: .55rem; font-weight: 600; color: var(--g-ink); }
.app-header .g-user small { display: block; color: var(--g-muted); font-weight: 400; font-size: .75rem; line-height: 1; }
.app-content { padding-top: 1.5rem; padding-bottom: 2rem; }
.app-footer { font-size: .82rem; color: var(--g-muted); background: transparent; border-top: 1px solid var(--g-line); }

/* ---------- Acceso (login y recuperación) ---------- */
.g-auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: var(--g-surface); }
.g-auth-art {
    position: relative; color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden;
    background: linear-gradient(160deg, #0f3a25 0%, var(--g-brand-700) 45%, var(--g-brand) 100%);
}
.g-auth-art::after { content: ""; position: absolute; left: -5%; right: -5%; bottom: -1px; height: 62%; background: url("../img/montes.svg") bottom / 110% auto no-repeat; opacity: .35; }
.g-auth-art .g-brand { display: flex; align-items: center; gap: .75rem; font-weight: 700; font-size: 1.15rem; position: relative; z-index: 1; }
.g-auth-art .g-brand img { width: 2.6rem; height: 2.6rem; }
.g-auth-art h2 { color: #fff; font-size: 2.1rem; line-height: 1.15; max-width: 26rem; position: relative; z-index: 1; }
.g-auth-art p { color: rgba(255, 255, 255, .8); max-width: 26rem; position: relative; z-index: 1; }
.g-auth-form { display: flex; align-items: center; justify-content: center; padding: 2.5rem 1.5rem; }
.g-auth-form .g-auth-box { width: 100%; max-width: 24rem; }
.g-auth-form h1 { font-size: 1.6rem; margin-bottom: .35rem; }
.g-auth-form .form-control { padding: .65rem .85rem; }
.g-auth-form .btn-lg { padding: .7rem 1rem; font-size: 1rem; }
.g-auth-foot { margin-top: 2rem; font-size: .82rem; color: var(--g-muted); }
@media (max-width: 991.98px) {
    .g-auth { grid-template-columns: 1fr; }
    .g-auth-art { padding: 1.5rem; min-height: 12rem; }
    .g-auth-art h2 { font-size: 1.4rem; margin: 1rem 0 0; }
    .g-auth-art p { display: none; }
}

/* ---------- Portal de federados ---------- */
.g-portal-header { background: var(--g-surface); border-bottom: 1px solid var(--g-line); }
.g-portal-header .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: .75rem; padding-bottom: .75rem; }
.g-portal-header .g-brand { display: flex; align-items: center; gap: .6rem; color: var(--g-ink); text-decoration: none; font-weight: 700; }
.g-portal-header .g-brand img { width: 2.2rem; height: 2.2rem; }
.g-portal-header .g-brand small { display: block; font-weight: 400; color: var(--g-muted); font-size: .78rem; }
.portal-main { max-width: 1080px; padding-top: 2rem; padding-bottom: 3rem; }
.portal-narrow { max-width: 720px; }
.g-portal-foot { color: var(--g-muted); font-size: .82rem; padding: 2rem 0; border-top: 1px solid var(--g-line); }

.g-licencia { border-radius: var(--g-radius); overflow: hidden; background: var(--g-surface); border: 1px solid var(--g-line); box-shadow: var(--g-shadow); }
.g-licencia-top { padding: 1.25rem 1.5rem; color: #fff; position: relative; overflow: hidden; background: linear-gradient(120deg, var(--g-brand-700), var(--g-brand)); }
.g-licencia-top::after { content: ""; position: absolute; right: -10%; bottom: -1px; width: 70%; height: 100%; background: url("../img/montes.svg") bottom right / contain no-repeat; opacity: .25; }
.g-licencia-top .g-lic-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; opacity: .8; position: relative; }
.g-licencia-top .g-lic-title { font-size: 1.5rem; font-weight: 700; position: relative; }
.g-licencia-body { padding: 1.25rem 1.5rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 1rem; }
.g-licencia > .card-footer { padding: .8rem 1.5rem; background: var(--g-canvas); border-top: 1px solid var(--g-line); }
.g-dato small { display: block; color: var(--g-muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.g-dato span { font-weight: 600; }

.g-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; }
.g-tile { display: flex; gap: .9rem; align-items: flex-start; padding: 1.1rem 1.2rem; background: var(--g-surface); border: 1px solid var(--g-line); border-radius: var(--g-radius); color: var(--g-ink); text-decoration: none; box-shadow: var(--g-shadow); transition: border-color .15s, transform .15s; }
a.g-tile:hover { border-color: var(--g-brand); transform: translateY(-1px); color: var(--g-ink); }
.g-tile .bi { font-size: 1.4rem; color: var(--g-brand); }
.g-tile strong { display: block; }
.g-tile span { color: var(--g-muted); font-size: .875rem; }
.g-tiles-stack { grid-template-columns: 1fr; gap: .75rem; }
.g-tile.disabled { opacity: .55; box-shadow: none; }

/* Selección por tarjetas (radio / checkbox) */
.g-step { margin-bottom: 1.75rem; }
.g-step-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .75rem; }
.g-step-num { width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--g-brand); color: #fff; font-weight: 700; font-size: .85rem; display: inline-flex; align-items: center; justify-content: center; }
.g-step-head h2 { font-size: 1.1rem; margin: 0; }
.g-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr)); gap: .75rem; }
.g-options-2 { grid-template-columns: 1fr 1fr; }
.g-option { position: relative; display: block; cursor: pointer; margin: 0; }
.g-option input { position: absolute; opacity: 0; pointer-events: none; }
.g-option .g-option-box { display: block; height: 100%; padding: .9rem 1rem .9rem 2.6rem; border: 1.5px solid var(--g-line); border-radius: var(--g-radius-sm); background: var(--g-surface); transition: border-color .15s, background .15s, box-shadow .15s; }
.g-option .g-option-box::before { content: ""; position: absolute; left: .95rem; top: 1.05rem; width: 1.05rem; height: 1.05rem; border: 2px solid #b6c3bc; border-radius: 50%; background: #fff; }
.g-option input[type=checkbox] + .g-option-box::before { border-radius: .3rem; }
.g-option:hover .g-option-box { border-color: #9cc5ad; }
.g-option input:checked + .g-option-box { border-color: var(--g-brand); background: var(--g-brand-050); box-shadow: 0 0 0 3px rgba(31, 107, 69, .12); }
.g-option input:checked + .g-option-box::before { border-color: var(--g-brand); background: var(--g-brand); box-shadow: inset 0 0 0 3px #fff; }
.g-option input[type=checkbox]:checked + .g-option-box::before { box-shadow: none; background: var(--g-brand) url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e") center / 100% no-repeat; }
.g-option input:focus-visible + .g-option-box { outline: 2px solid var(--g-brand); outline-offset: 2px; }
.g-option input:disabled + .g-option-box { cursor: default; background: #f7f9f8; }
.g-option .g-option-title { font-weight: 700; display: block; }
.g-option .g-option-desc { color: var(--g-muted); font-size: .85rem; display: block; margin-top: .15rem; }
.g-option .g-option-tag { position: absolute; top: .6rem; right: .7rem; }

.g-summary { position: sticky; top: 1.5rem; }
.g-summary .g-total { font-size: 2.1rem; font-weight: 700; color: var(--g-ink); font-variant-numeric: tabular-nums; line-height: 1.1; }
.g-summary .g-lines { list-style: none; padding: 0; margin: .75rem 0 0; font-size: .9rem; }
.g-summary .g-lines li { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem 0; border-bottom: 1px dashed var(--g-line); color: var(--g-muted); }
.g-summary .g-lines li span:last-child { color: var(--g-ink); font-variant-numeric: tabular-nums; }
.g-summary .g-secure { font-size: .8rem; color: var(--g-muted); display: flex; gap: .4rem; align-items: center; justify-content: center; margin-top: .75rem; }
.g-loading { opacity: .5; transition: opacity .15s; }

/* ---------- Avisos destacados, calendario de festivos y páginas de estado ---------- */
.g-callout { display: flex; gap: .9rem; align-items: center; padding: 1rem 1.25rem; border-radius: var(--g-radius); background: var(--g-brand-050); border: 1px solid var(--g-brand-100); }
.g-callout > .bi { font-size: 1.5rem; color: var(--g-brand); }
.g-callout strong { display: block; }
.g-callout strong::first-letter { text-transform: uppercase; }
.g-callout span { color: var(--g-muted); font-size: .9rem; }
.card-form-sm { max-width: 760px; }

.g-dates { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); gap: .75rem; padding: 1.25rem; }
.g-date { display: flex; flex-direction: column; align-items: center; padding: .75rem .5rem .6rem; border: 1px solid var(--g-line); border-radius: var(--g-radius-sm); background: var(--g-surface); color: var(--g-ink); text-decoration: none; transition: border-color .15s, transform .15s; }
.g-date:hover { border-color: var(--g-brand); transform: translateY(-1px); color: var(--g-ink); }
.g-date-day { font-size: 1.6rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.g-date-month { text-transform: uppercase; font-size: .75rem; font-weight: 700; letter-spacing: .06em; color: var(--g-brand); margin-top: .2rem; }
.g-date-week { font-size: .78rem; color: var(--g-muted); margin-top: .15rem; }
.g-date.past { opacity: .5; }
.g-date.next { border-color: var(--g-accent); box-shadow: 0 0 0 3px rgba(224, 122, 31, .15); }
.g-date.next .g-date-month { color: var(--g-accent); }

.g-status { max-width: 34rem; margin: 2rem auto; text-align: center; }
.g-status-code { font-size: 4.5rem; font-weight: 700; line-height: 1; color: var(--g-brand-100); letter-spacing: -.02em; }
.g-status h1 { font-size: 1.6rem; margin: .5rem 0 .75rem; }
.g-status p { color: var(--g-muted); }
.g-status-ref { font-size: .85rem; background: var(--g-canvas); padding: .25rem .5rem; border-radius: .35rem; }
@media (min-width: 992px) { .g-toolbar-filters { flex-wrap: nowrap; } }
.g-toolbar-filters .row { margin-top: 0; }
.g-toolbar .btn { white-space: nowrap; }
.form-control.mono { font-size: 1rem; }
@media (max-width: 575.98px) {
    .g-kpi { flex-direction: column; gap: .5rem; padding: .9rem 1rem; }
    .g-kpi-icon { width: 2.25rem; height: 2.25rem; font-size: 1.05rem; }
    .g-kpi-value { font-size: 1.45rem; }
    .g-kpi-label { font-size: .72rem; }
}

/* =====================================================================
   Comportamiento: spinners, carga por partes, parpadeo de cambios, búsqueda reactiva
   ===================================================================== */
/* Barra de progreso de navegación (solo aparece si la página tarda más de 150 ms) */
.g-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 2000; overflow: hidden; opacity: 0; transition: opacity .2s; pointer-events: none; }
.g-progress.on { opacity: 1; }
.g-progress::before { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; background: var(--g-accent); animation: g-progress 1.1s ease-in-out infinite; }
@keyframes g-progress { from { left: -40%; } to { left: 100%; } }

/* Botones y enlaces ocupados */
.is-busy { pointer-events: none; opacity: .85; }
.is-busy .g-btn-spin ~ .bi { display: none; }

/* Avisos de acciones en segundo plano */
.g-toasts .toast { min-width: 18rem; max-width: 26rem; }
.g-toasts .toast.ok .bi { color: #1e8e4f; }
.g-toasts .toast.error .bi { color: var(--bs-danger); }
.g-toasts .toast.info { border-left: 4px solid #1d5b94; }
.g-toasts .toast.info .bi { color: #1d5b94; }
@media (max-width: 575.98px) { .g-toasts { left: .75rem; right: .75rem; bottom: .75rem; } .g-toasts .toast { max-width: none; width: 100%; } }

/* Parpadeo de lo que acaba de cambiar */
@keyframes g-blink { 0%, 100% { box-shadow: 0 0 0 0 rgba(224, 122, 31, 0); background-color: transparent; } 20%, 60% { box-shadow: 0 0 0 4px rgba(224, 122, 31, .28); background-color: rgba(224, 122, 31, .12); } 40% { box-shadow: 0 0 0 4px rgba(224, 122, 31, .12); background-color: rgba(224, 122, 31, .05); } }
@keyframes g-blink-cell { 0%, 100% { box-shadow: inset 0 0 0 9999px rgba(224, 122, 31, 0); } 20%, 60% { box-shadow: inset 0 0 0 9999px rgba(224, 122, 31, .16); } 40% { box-shadow: inset 0 0 0 9999px rgba(224, 122, 31, .05); } }
.g-blink:not(tr) { animation: g-blink 2s ease-in-out 1; border-radius: var(--g-radius-sm); }
tr.g-blink > * { animation: g-blink-cell 2s ease-in-out 1; }
@media (prefers-reduced-motion: reduce) {
    .g-blink:not(tr), tr.g-blink > * { animation: none; outline: 2px solid var(--g-accent); outline-offset: -2px; }
    .g-progress::before { animation-duration: 3s; }
}

/* Carga por partes: esqueleto mientras llega el contenido */
.g-skel { position: relative; overflow: hidden; background: #e9eeeb; border-radius: var(--g-radius-sm); }
.g-skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .6), transparent); animation: g-shimmer 1.3s infinite; }
@keyframes g-shimmer { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .g-skel::after { animation: none; } }
.g-skel-kpi { height: 7.5rem; border-radius: var(--g-radius); }
.g-skel-block { height: 15rem; border-radius: var(--g-radius); }
.g-skel-line { height: .9rem; margin: .5rem 0; }
.g-loaded { animation: g-fade-in .25s ease-out; }
@keyframes g-fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.g-load-error { display: flex; align-items: center; justify-content: center; gap: .75rem; padding: 2rem 1rem; color: var(--g-muted); background: var(--g-surface); border: 1px dashed var(--g-line); border-radius: var(--g-radius); }
.g-load-error .bi { font-size: 1.4rem; }

/* Búsqueda reactiva */
[aria-busy="true"] { transition: opacity .15s; }
#resultados[aria-busy="true"], [data-live-region][aria-busy="true"] { opacity: .55; }
.g-search .g-search-spin { position: absolute; right: 2.4rem; top: 50%; margin-top: -.5rem; display: none; color: var(--g-brand); }
form.is-loading .g-search .g-search-spin { display: block; }
form.js-live .g-live-submit { display: none; }
.g-count .spinner-border { color: var(--g-brand); vertical-align: -.15em; }
.g-toolbar-sub { padding: .55rem 1.25rem; background: var(--g-canvas); }

/* Entorno de pruebas (Entorno:Aviso): etiqueta fija abajo a la izquierda, no tapa clics */
.g-env { position: fixed; left: .75rem; bottom: .75rem; z-index: 1070; display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .75rem; border-radius: 999px; background: #8a4b08; color: #fff; font-size: .8rem; font-weight: 600; box-shadow: var(--g-shadow-lg); pointer-events: none; }
@media print { .g-env { display: none; } }

/* Inicio: federados por club (columnas ordenables y fila de totales) */
.g-sort { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; display: inline-flex; align-items: center; gap: .3rem; cursor: pointer; }
.g-sort:hover, .g-sort:focus-visible { color: var(--g-brand); }
.g-sort::after { content: "\2195"; opacity: .35; font-size: .85em; }
th[aria-sort="ascending"] .g-sort::after { content: "\2191"; opacity: 1; }
th[aria-sort="descending"] .g-sort::after { content: "\2193"; opacity: 1; }
th[aria-sort] .g-sort { color: var(--g-ink); }
.g-clubes tfoot th, .g-clubes tfoot td { padding: .75rem 1rem; font-weight: 700; color: var(--g-brand-700); background: var(--g-brand-050); border-top: 2px solid var(--g-brand-100); border-bottom: 0; }
.g-clubes tbody td:first-child, .g-clubes thead th:first-child { min-width: 12rem; }
