/**
 * SIGEM — tema claro / oscuro
 * Se aplica sobre Filament v3 (clase .dark en <html>).
 */

:root {
    /* Paleta SIGEM360 — navy + cyan + pasteles (sin verdes) */
    --gpmd-navy: #002D56;
    --gpmd-navy-deep: #001F3F;
    --gpmd-forest: #0077C8;          /* acento principal (alias histórico) */
    --gpmd-forest-deep: #00AEEF;     /* cian logo */
    --gpmd-mint: #E8F4FC;            /* pastel de sección */
    --gpmd-ink: #0B1F3A;
    --gpmd-muted: #5B6B7C;
    --gpmd-line: #D5E4F2;
    --gpmd-soft: #F3F8FC;
    --gpmd-card: #ffffff;
    --gpmd-shadow: 0 8px 28px rgba(0, 45, 86, 0.07);
    --gpmd-hero-from: #00AEEF;
    --gpmd-hero-via: #0077C8;
    --gpmd-hero-to: #002D56;
    --gpmd-sidebar: #002D56;
    --gpmd-sidebar-text: #E8F4FC;
    --gpmd-sidebar-muted: #9BB4CC;
    --gpmd-sidebar-active: rgba(0, 174, 239, 0.22);
    --gpmd-section-accent: #0077C8;
}

html.dark {
    --gpmd-navy: #7DD3FC;
    --gpmd-navy-deep: #38BDF8;
    --gpmd-forest: #38BDF8;
    --gpmd-forest-deep: #7DD3FC;
    --gpmd-mint: #0B1F3A;
    --gpmd-ink: #E8F4FC;
    --gpmd-muted: #94A3B8;
    --gpmd-line: #1E3A5F;
    --gpmd-soft: #071525;
    --gpmd-card: #0B1F3A;
    --gpmd-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
    --gpmd-hero-from: #0B4F8A;
    --gpmd-hero-via: #003A6B;
    --gpmd-hero-to: #001F3F;
    --gpmd-sidebar: #001526;
    --gpmd-sidebar-text: #E8F4FC;
    --gpmd-sidebar-muted: #7A93AB;
    --gpmd-sidebar-active: rgba(0, 174, 239, 0.28);
    --gpmd-section-accent: #38BDF8;
}

/* ---------- Dashboard GPMD ---------- */

.gpmd-dash {
    font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
    color: var(--gpmd-ink);
    display: grid;
    gap: 1.25rem;
}

.gpmd-dash__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.gpmd-dash__brand {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    min-width: 0;
}

.gpmd-dash__logo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #ffffff;
    border-radius: 1rem;
    padding: 0.65rem 0.9rem;
    border: 1px solid var(--gpmd-line);
    box-shadow: var(--gpmd-shadow);
    min-width: 9.5rem;
    min-height: 4.75rem;
}

.gpmd-dash__logo {
    display: block;
    height: 3.75rem;
    width: auto;
    max-width: min(42vw, 13rem);
    object-fit: contain;
    margin: 0 auto;
}

html.dark .gpmd-dash__logo-wrap {
    background: #ffffff;
    border-color: rgba(148, 163, 184, 0.28);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.gpmd-kicker {
    margin: 0 0 0.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gpmd-muted);
}

.gpmd-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--gpmd-ink);
}

.gpmd-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--gpmd-forest-deep) 0%, var(--gpmd-forest) 100%);
    color: #fff !important;
    font-size: 0.875rem;
    font-weight: 700;
    padding: 0.7rem 1.1rem;
    box-shadow: 0 10px 24px rgba(0, 119, 200, 0.25);
    text-decoration: none !important;
}

html.dark .gpmd-btn-primary {
    color: #001F3F !important;
    background: linear-gradient(180deg, #7DD3FC 0%, #38BDF8 100%);
    box-shadow: 0 10px 24px rgba(56, 189, 248, 0.2);
}

.gpmd-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.gpmd-kpi {
    background: var(--gpmd-card);
    border: 1px solid var(--gpmd-line);
    border-radius: 1.35rem;
    padding: 1.25rem;
    box-shadow: var(--gpmd-shadow);
    min-height: 190px;
    display: flex;
    flex-direction: column;
    color: var(--gpmd-ink);
}

.gpmd-kpi--hero {
    background: linear-gradient(145deg, var(--gpmd-hero-from) 0%, var(--gpmd-hero-via) 55%, var(--gpmd-hero-to) 100%);
    border: none;
    color: #fff;
    box-shadow: 0 16px 40px rgba(0, 119, 200, 0.28);
}

html.dark .gpmd-kpi--hero {
    color: #E8F4FC;
}

.gpmd-kpi__icon {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 0.9rem;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.14);
    margin-bottom: 1rem;
}

.gpmd-kpi__icon--muted {
    background: var(--gpmd-soft);
    color: var(--gpmd-forest);
}

.gpmd-kpi__label {
    margin: 0;
    font-size: 0.9rem;
    color: inherit;
    opacity: 0.85;
    font-weight: 500;
}

.gpmd-kpi:not(.gpmd-kpi--hero) .gpmd-kpi__label {
    color: var(--gpmd-muted);
}

.gpmd-kpi__value-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0.55rem 0 1rem;
}

.gpmd-kpi__value {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
}

.gpmd-pill {
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.28rem 0.55rem;
}

.gpmd-pill--light {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.gpmd-pill--success {
    background: var(--gpmd-mint);
    color: var(--gpmd-forest);
}

.gpmd-kpi__footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.78rem;
    opacity: 0.9;
}

.gpmd-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--gpmd-ink) !important;
    font-weight: 700;
    text-decoration: none !important;
}

.gpmd-link--light {
    color: #fff !important;
}

.gpmd-link__btn {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: rgba(17, 24, 39, 0.06);
    font-size: 0.75rem;
}

html.dark .gpmd-link__btn {
    background: rgba(248, 250, 252, 0.08);
}

.gpmd-link--light .gpmd-link__btn {
    background: rgba(255, 255, 255, 0.16);
}

.gpmd-mid-grid {
    display: grid;
    grid-template-columns: 0.9fr 1.4fr;
    gap: 1rem;
}

.gpmd-card {
    background: var(--gpmd-card);
    border: 1px solid var(--gpmd-line);
    border-radius: 1.35rem;
    padding: 1.2rem;
    box-shadow: var(--gpmd-shadow);
    color: var(--gpmd-ink);
}

.gpmd-card__head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.gpmd-card__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--gpmd-ink);
}

.gpmd-card__sub {
    margin: 0.2rem 0 0;
    color: var(--gpmd-muted);
    font-size: 0.82rem;
}

.gpmd-wallet {
    display: grid;
    gap: 0.75rem;
}

.gpmd-wallet__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 0.9rem;
    border-radius: 1rem;
    background: var(--gpmd-soft);
}

.gpmd-wallet__left,
.gpmd-wallet__right,
.gpmd-activity {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.gpmd-wallet__right {
    flex-direction: column;
    align-items: end;
    gap: 0.25rem;
}

.gpmd-dot {
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 999px;
    display: inline-block;
}

.gpmd-dot--green { background: #16a34a; }
.gpmd-dot--yellow { background: #f59e0b; }
.gpmd-dot--red { background: #f43f5e; }
.gpmd-dot--gray { background: #9ca3af; }

.gpmd-wallet__name {
    margin: 0;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--gpmd-ink);
}

.gpmd-wallet__hint,
.gpmd-wallet__value {
    margin: 0;
}

.gpmd-wallet__hint {
    color: var(--gpmd-muted);
    font-size: 0.75rem;
}

.gpmd-wallet__value {
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--gpmd-ink);
}

.gpmd-status {
    font-size: 0.68rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 0.18rem 0.45rem;
}

.gpmd-status--on {
    background: var(--gpmd-mint);
    color: var(--gpmd-forest);
}

.gpmd-status--green {
    background: #dcfce7;
    color: #166534;
}

.gpmd-status--off {
    background: var(--gpmd-soft);
    color: var(--gpmd-muted);
    border: 1px solid var(--gpmd-line);
}

.gpmd-toggle {
    display: inline-flex;
    background: var(--gpmd-soft);
    border-radius: 999px;
    padding: 0.2rem;
    gap: 0.15rem;
    border: 1px solid var(--gpmd-line);
}

.gpmd-toggle__btn {
    border: 0;
    background: transparent;
    border-radius: 999px;
    padding: 0.4rem 0.8rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--gpmd-muted);
    cursor: pointer;
}

.gpmd-toggle__btn.is-active {
    background: var(--gpmd-card);
    color: var(--gpmd-ink);
    box-shadow: var(--gpmd-shadow);
}

html.dark .gpmd-toggle__btn.is-active {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.gpmd-chart__plot {
    min-height: 260px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
    align-items: end;
    gap: 1rem;
    padding: 0.5rem 0.25rem 0;
}

.gpmd-chart__col {
    position: relative;
    display: grid;
    gap: 0.55rem;
    justify-items: center;
}

.gpmd-chart__track {
    width: 100%;
    max-width: 52px;
    height: 210px;
    border-radius: 999px;
    background: var(--gpmd-soft);
    border: 1px solid var(--gpmd-line);
    display: flex;
    align-items: end;
    overflow: hidden;
}

.gpmd-chart__bar {
    width: 100%;
    border-radius: 999px;
    background: linear-gradient(180deg, #BAE6FD 0%, #7DD3FC 100%);
    transition: height 0.25s ease;
}

.gpmd-chart__bar.is-highlight {
    background: linear-gradient(180deg, #38BDF8 0%, #0077C8 100%);
    box-shadow: 0 10px 24px rgba(0, 119, 200, 0.28);
}

.gpmd-chart__label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gpmd-muted);
}

.gpmd-chart__tooltip {
    position: absolute;
    top: 0;
    transform: translateY(-8px);
    background: #0f172a;
    color: #fff;
    border-radius: 0.9rem;
    padding: 0.65rem 0.8rem;
    min-width: 120px;
    z-index: 5;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

html.dark .gpmd-chart__tooltip {
    background: #f8fafc;
    color: #0f172a;
}

.gpmd-chart__tooltip p,
.gpmd-chart__tooltip span {
    margin: 0;
    font-size: 0.68rem;
    opacity: 0.75;
}

.gpmd-chart__tooltip strong {
    display: block;
    margin: 0.15rem 0;
    font-size: 1rem;
}

.gpmd-dept-stack {
    display: grid;
    gap: 1rem;
}

.gpmd-dept-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.gpmd-dept-split__title {
    margin: 0 0 0.65rem;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gpmd-muted);
}

.gpmd-dept-empty {
    margin: 0;
    color: var(--gpmd-muted);
    font-size: 0.82rem;
    padding: 0.75rem;
    border-radius: 0.9rem;
    background: var(--gpmd-soft);
}

.gpmd-axis--inline {
    margin-bottom: 0.65rem;
}

.gpmd-axis--transversal {
    border-color: #BAE6FD;
    background: var(--gpmd-mint);
}

html.dark .gpmd-axis--transversal {
    border-color: #0B4F8A;
}

.gpmd-axes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.85rem;
}

.gpmd-axis {
    background: var(--gpmd-card);
    border: 1px solid var(--gpmd-line);
    border-radius: 1.1rem;
    padding: 1rem;
}

.gpmd-axis__code {
    margin: 0;
    color: var(--gpmd-forest);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.gpmd-axis__name {
    margin: 0.35rem 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gpmd-ink);
}

.gpmd-axis__meta {
    margin: 0;
    color: var(--gpmd-muted);
    font-size: 0.8rem;
    font-weight: 600;
}

.gpmd-table-tools {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.gpmd-search {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    background: var(--gpmd-soft);
    border-radius: 999px;
    padding: 0.55rem 0.85rem;
    color: var(--gpmd-muted);
    min-width: 210px;
    border: 1px solid var(--gpmd-line);
}

.gpmd-search input {
    border: 0;
    outline: 0;
    background: transparent;
    width: 100%;
    font-size: 0.82rem;
    color: var(--gpmd-ink);
}

.gpmd-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid var(--gpmd-line);
    border-radius: 999px;
    padding: 0.55rem 0.9rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--gpmd-ink) !important;
    text-decoration: none !important;
    background: var(--gpmd-card);
}

.gpmd-table-wrap {
    overflow-x: auto;
}

.gpmd-table {
    width: 100%;
    border-collapse: collapse;
}

.gpmd-table th {
    text-align: left;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gpmd-muted);
    padding: 0.75rem 0.4rem;
    border-bottom: 1px solid var(--gpmd-line);
}

.gpmd-table td {
    padding: 0.95rem 0.4rem;
    border-bottom: 1px solid var(--gpmd-line);
    font-size: 0.88rem;
    vertical-align: middle;
    color: var(--gpmd-ink);
}

.gpmd-activity__icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.75rem;
    background: var(--gpmd-mint);
    color: var(--gpmd-forest);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.gpmd-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    padding: 0.28rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--gpmd-soft);
    color: var(--gpmd-muted);
    border: 1px solid var(--gpmd-line);
}

.gpmd-badge i {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 999px;
    background: currentColor;
    display: inline-block;
}

.gpmd-badge--success { background: var(--gpmd-mint); color: var(--gpmd-forest); border-color: transparent; }
.gpmd-badge--warning { background: #fffbeb; color: #b45309; border-color: transparent; }
.gpmd-badge--danger { background: #fff1f2; color: #e11d48; border-color: transparent; }
.gpmd-badge--muted { background: var(--gpmd-soft); color: var(--gpmd-muted); }

html.dark .gpmd-badge--warning { background: #451a03; color: #fbbf24; }
html.dark .gpmd-badge--danger { background: #4c0519; color: #fb7185; }

.gpmd-empty {
    text-align: center;
    color: var(--gpmd-muted);
    padding: 2rem 0.5rem !important;
}

.gpmd-empty a {
    color: var(--gpmd-forest);
    font-weight: 700;
}

[x-cloak] { display: none !important; }

@media (max-width: 1100px) {
    .gpmd-kpi-grid,
    .gpmd-mid-grid,
    .gpmd-dept-split {
        grid-template-columns: 1fr;
    }
}

/* ---------- Utilidades de páginas custom ---------- */

.gpmd-surface {
    background: var(--gpmd-card);
    border: 1px solid var(--gpmd-line);
    color: var(--gpmd-ink);
    box-shadow: var(--gpmd-shadow);
}

.gpmd-muted-text {
    color: var(--gpmd-muted);
}

.gpmd-label {
    color: var(--gpmd-muted);
}

.gpmd-input {
    background: var(--gpmd-card);
    border-color: var(--gpmd-line);
    color: var(--gpmd-ink);
}

html.dark .gpmd-input {
    background: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

/* ---------- Panel Filament · refinamiento claro/oscuro ---------- */

.fi-body {
    --gpmd-panel-tint: color-mix(in srgb, var(--gpmd-forest) 4%, transparent);
}

.fi-simple-main,
.fi-main {
    background-image:
        radial-gradient(ellipse 80% 50% at 0% -10%, var(--gpmd-panel-tint), transparent 55%),
        radial-gradient(ellipse 60% 40% at 100% 0%, color-mix(in srgb, var(--gpmd-forest) 3%, transparent), transparent 50%);
}

html.dark .fi-simple-main,
html.dark .fi-main {
    background-image:
        radial-gradient(ellipse 80% 50% at 0% -10%, rgba(56, 189, 248, 0.06), transparent 55%),
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(0, 119, 200, 0.08), transparent 50%);
}

.fi-sidebar {
    border-right-color: var(--gpmd-line) !important;
}

.fi-topbar {
    backdrop-filter: blur(8px);
}

html.dark .fi-topbar {
    background: rgba(11, 18, 32, 0.85) !important;
    border-bottom-color: #1e293b !important;
}

.fi-sidebar-item-button:hover {
    background: color-mix(in srgb, var(--gpmd-forest) 10%, transparent) !important;
}

html.dark .fi-sidebar-item-button:hover {
    background: rgba(56, 189, 248, 0.12) !important;
}

.fi-header-heading {
    letter-spacing: -0.02em;
}

/* Login */
.fi-simple-layout .fi-logo,
.fi-simple-layout .fi-simple-page-content {
    color: var(--gpmd-ink);
}

.fi-simple-main {
    background-color: var(--gpmd-soft);
}

html.dark .fi-simple-main {
    background-color: #020617;
}

/* Tablas / inputs custom dentro del panel */
.fi-input,
select.fi-input,
input.fi-input {
    color: inherit;
}

html.dark select.fi-input,
html.dark input.fi-input {
    background-color: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

html.dark select.fi-input option {
    background-color: #0f172a;
    color: #f1f5f9;
}

/* Semáforo dots — contraste en oscuro */
html.dark .gpmd-dot--green { background: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.25); }
html.dark .gpmd-dot--yellow { background: #fbbf24; box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.2); }
html.dark .gpmd-dot--red { background: #fb7185; box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.2); }
html.dark .gpmd-dot--gray { background: #94a3b8; }

html.dark .gpmd-status--green {
    background: rgba(74, 222, 128, 0.18);
    color: #86efac;
}

/* Toggle dashboard en oscuro */
html.dark .gpmd-toggle__btn.is-active {
    background: #1e293b;
    color: #f1f5f9;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

html.dark .gpmd-chart__track {
    background: #1e293b;
}

html.dark .gpmd-chart__tooltip {
    background: #f8fafc;
    color: #0f172a;
}

/* ---------- Conmutador de tema (topbar / login) ---------- */

.gpmd-theme-switcher {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    border-radius: 999px;
    border: 1px solid var(--gpmd-line);
    background: var(--gpmd-card);
    padding: 0.15rem;
    box-shadow: var(--gpmd-shadow);
}


.gpmd-theme-switcher .fi-theme-switcher {
    display: inline-grid;
    grid-auto-flow: column;
    gap: 0.15rem;
}

.gpmd-theme-switcher .fi-theme-switcher-btn {
    border-radius: 999px !important;
    width: 2rem;
    height: 2rem;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

.gpmd-theme-switcher .fi-theme-switcher-btn.fi-active {
    background: color-mix(in srgb, var(--gpmd-forest) 14%, transparent) !important;
    color: var(--gpmd-forest) !important;
}

html.dark .gpmd-theme-switcher .fi-theme-switcher-btn.fi-active {
    background: rgba(56, 189, 248, 0.18) !important;
    color: #7DD3FC !important;
}

.fi-simple-main .gpmd-theme-bar {
    margin-inline: auto;
}

.gpmd-theme-switcher__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.gpmd-theme-switcher__btn:hover {
    color: #0077C8;
    background: #E8F4FC;
}

html.dark .gpmd-theme-switcher__btn:hover {
    color: #7DD3FC;
    background: rgba(56, 189, 248, 0.12);
}

.gpmd-theme-switcher__btn.is-active {
    color: #0077C8 !important;
    background: #D6EEFB !important;
}

html.dark .gpmd-theme-switcher__btn.is-active {
    color: #7DD3FC !important;
    background: rgba(56, 189, 248, 0.2) !important;
}

/* ---------- Utilidades semánticas (válidas claro/oscuro) ---------- */
/* Filament no incluye slate/cyan de Tailwind; usamos variables del tema. */

.gpmd-surface {
    background: var(--gpmd-card) !important;
    border: 1px solid var(--gpmd-line) !important;
    color: var(--gpmd-ink) !important;
    box-shadow: var(--gpmd-shadow);
}

.gpmd-surface-soft {
    background: var(--gpmd-soft) !important;
    color: var(--gpmd-ink) !important;
}

.gpmd-text {
    color: var(--gpmd-ink) !important;
}

.gpmd-text-muted {
    color: var(--gpmd-muted) !important;
}

.gpmd-text-strong {
    color: var(--gpmd-ink) !important;
    font-weight: 600;
}

.gpmd-link-accent,
a.gpmd-link-accent {
    color: var(--gpmd-forest) !important;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.gpmd-link-accent:hover {
    opacity: 0.85;
}

.gpmd-divider {
    border-color: var(--gpmd-line) !important;
}

.gpmd-row-line {
    border-bottom: 1px solid var(--gpmd-line) !important;
}

.gpmd-field {
    background: var(--gpmd-card) !important;
    border: 1px solid var(--gpmd-line) !important;
    color: var(--gpmd-ink) !important;
    border-radius: 0.5rem;
}

html.dark .gpmd-field {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

.gpmd-field option {
    background: var(--gpmd-card);
    color: var(--gpmd-ink);
}

html.dark .gpmd-field option {
    background: #0f172a;
    color: #f1f5f9;
}

.gpmd-tile {
    border-radius: 0.75rem;
    border: 1px solid var(--gpmd-line);
    background: var(--gpmd-card);
    color: var(--gpmd-ink);
    padding: 1rem;
    box-shadow: var(--gpmd-shadow);
}

.gpmd-tile__label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gpmd-muted);
}

.gpmd-tile__value {
    margin-top: 0.25rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gpmd-ink);
}

.gpmd-nav-card {
    display: block;
    border-radius: 1rem;
    border: 1px solid var(--gpmd-line);
    background: var(--gpmd-card);
    color: var(--gpmd-ink);
    padding: 1.25rem;
    box-shadow: var(--gpmd-shadow);
    text-decoration: none !important;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.gpmd-nav-card:hover {
    border-color: var(--gpmd-forest);
    box-shadow: 0 10px 28px rgba(0, 119, 200, 0.12);
}

.gpmd-nav-card__title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gpmd-ink);
}

.gpmd-nav-card:hover .gpmd-nav-card__title {
    color: var(--gpmd-forest);
}

.gpmd-nav-card__body {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--gpmd-muted);
    line-height: 1.5;
}

.gpmd-nav-card__cta {
    margin-top: 1rem;
    display: inline-flex;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gpmd-forest);
}

.gpmd-hero-admin {
    border-radius: 1rem;
    padding: 2rem 1.5rem;
    color: #E8F4FC;
    background: linear-gradient(135deg, var(--gpmd-hero-from), var(--gpmd-hero-via) 55%, var(--gpmd-hero-to));
    box-shadow: var(--gpmd-shadow);
}

.gpmd-hero-admin__kicker {
    margin: 0;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.9;
}

.gpmd-hero-admin__title {
    margin: 0.5rem 0 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.gpmd-hero-admin__body {
    margin: 0.5rem 0 0;
    max-width: 42rem;
    font-size: 0.875rem;
    line-height: 1.6;
    opacity: 0.95;
}

.gpmd-hero-admin__steps {
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.gpmd-hero-admin__steps li {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.25rem 0.75rem;
}

.gpmd-table-theme {
    width: 100%;
    font-size: 0.875rem;
    color: var(--gpmd-ink);
    border-collapse: collapse;
}

.gpmd-table-theme th {
    text-align: left;
    color: var(--gpmd-muted);
    border-bottom: 1px solid var(--gpmd-line);
    padding: 0.5rem 0.75rem 0.5rem 0;
    font-weight: 600;
}

.gpmd-table-theme td {
    border-bottom: 1px solid var(--gpmd-line);
    padding: 0.5rem 0.75rem 0.5rem 0;
    color: var(--gpmd-ink);
    vertical-align: top;
}

.gpmd-obs-box {
    border-radius: 0.5rem;
    border: 1px solid var(--gpmd-line);
    background: var(--gpmd-soft);
    color: var(--gpmd-ink);
    padding: 0.75rem;
}

.gpmd-danger-text {
    color: #e11d48;
    font-size: 0.75rem;
}

html.dark .gpmd-danger-text {
    color: #fb7185;
}

/* Status pills del dashboard */
.gpmd-status--on {
    background: var(--gpmd-mint);
    color: var(--gpmd-forest);
}

.gpmd-status--off {
    background: var(--gpmd-soft);
    color: var(--gpmd-muted);
}

/* Secciones Filament: asegurar contraste de texto custom dentro */
.fi-section .gpmd-text,
.fi-section .gpmd-text-muted,
.fi-wi-stats-overview-stat-value {
    /* no-op anchor */
}

/* Prose en guías */
.gpmd-prose {
    color: var(--gpmd-ink);
}

.gpmd-prose :is(p, li, strong, em, code) {
    color: inherit;
}

html.dark .gpmd-prose {
    color: #e2e8f0;
}

html.dark .gpmd-prose a {
    color: #7DD3FC;
}

/* ---------- Login SIGEM (split + wave) ---------- */

.fi-body:has(.gpmd-login) {
    background: #ffffff !important;
}

.fi-body:has(.gpmd-login) .fi-main,
.fi-body:has(.gpmd-login) {
    background-image: none !important;
}

.gpmd-login {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
    background: #ffffff;
}

.gpmd-login__brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: clamp(2.5rem, 6vw, 4rem) clamp(2rem, 5vw, 4.5rem);
    padding-right: clamp(3.5rem, 7vw, 5.5rem);
    color: #ffffff;
    background: linear-gradient(160deg, #1BA3E0 0%, #0077C8 48%, #005A9E 100%);
    isolation: isolate;
    overflow: hidden;
    text-align: center;
}

.gpmd-login__brand-inner {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 26rem;
    animation: gpmd-login-rise 0.7s ease both;
}

.gpmd-login__welcome {
    margin: 0 0 1.35rem;
    font-size: clamp(1.35rem, 2.4vw, 1.85rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #ffffff;
}

.gpmd-login__logo-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(13rem, 24vw, 17rem);
    height: clamp(13rem, 24vw, 17rem);
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 18px 40px rgba(0, 31, 63, 0.28);
    padding: 1.35rem;
    margin: 0 auto;
}

.gpmd-login__brand-logo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.gpmd-login__brand-name {
    margin: 1.15rem 0 0;
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ffffff;
}

.gpmd-login__brand-lead {
    margin: 0.9rem 0 0;
    font-size: 0.98rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.92);
    max-width: 28rem;
}

.gpmd-login__brand-foot {
    position: absolute;
    left: clamp(1.5rem, 4vw, 2.5rem);
    bottom: 1.5rem;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.82);
}

.gpmd-login__wave {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.gpmd-login__wave-svg {
    position: absolute;
    display: block;
}

.gpmd-login__wave-svg--side {
    top: 0;
    right: -1px;
    width: clamp(4.5rem, 8vw, 6.5rem);
    height: 100%;
}

.gpmd-login__wave-svg--bottom {
    display: none;
    left: 0;
    bottom: -1px;
    width: 100%;
    height: 4.5rem;
}

.gpmd-login__wave-layer--a { fill: rgba(232, 244, 252, 0.55); }
.gpmd-login__wave-layer--b { fill: rgba(186, 230, 253, 0.7); }
.gpmd-login__wave-layer--c { fill: #ffffff; }

.gpmd-login__panel {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #ffffff;
    color: #0f172a;
}

html.dark .gpmd-login__panel {
    background: #0b1220;
    color: #e2e8f0;
}

.gpmd-login__panel-top {
    display: flex;
    justify-content: flex-end;
    padding: 1.1rem 1.35rem 0;
}

.gpmd-login__panel-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 1.5rem 2rem;
}

.gpmd-login__card {
    width: 100%;
    max-width: 24rem;
    padding: 0.25rem 0.15rem;
    background: transparent;
    border: 0;
    box-shadow: none;
    animation: gpmd-login-rise 0.8s ease both;
}

.gpmd-login__panel-foot {
    margin: 0;
    padding: 0 1.5rem 1.35rem;
    text-align: center;
    font-size: 0.78rem;
    color: #64748b;
}

html.dark .gpmd-login__panel-foot {
    color: #94a3b8;
}

.gpmd-login-form__header {
    margin-bottom: 1.75rem;
    text-align: center;
}

.gpmd-login-form__welcome {
    margin: 0 0 0.35rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #0077C8;
}

html.dark .gpmd-login-form__welcome {
    color: #38BDF8;
}

.gpmd-login-form__heading {
    margin: 0;
    font-size: clamp(1.55rem, 2.5vw, 1.9rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #0f172a;
}

html.dark .gpmd-login-form__heading {
    color: #f8fafc;
}

.gpmd-login-form__subheading {
    margin: 0.55rem 0 0;
    font-size: 0.92rem;
    line-height: 1.5;
    color: #64748b;
}

html.dark .gpmd-login-form__subheading {
    color: #94a3b8;
}

.gpmd-login-form .fi-fo-field-wrp {
    gap: 0.4rem;
}

.gpmd-login-form .fi-fo-field-wrp-label span {
    font-weight: 700 !important;
    color: #0f172a !important;
}

html.dark .gpmd-login-form .fi-fo-field-wrp-label span {
    color: #e2e8f0 !important;
}

.gpmd-login-form .fi-input-wrp {
    border-radius: 0.95rem !important;
    background: #eef3f8 !important;
    border-color: transparent !important;
    box-shadow: none !important;
    min-height: 2.9rem;
}

html.dark .gpmd-login-form .fi-input-wrp {
    background: #152033 !important;
}

.gpmd-login-form .fi-input {
    font-size: 0.95rem !important;
}

.gpmd-login-form .fi-btn {
    min-height: 3rem;
    border-radius: 999px !important;
    font-weight: 700 !important;
    font-size: 0.98rem !important;
    box-shadow: 0 10px 24px rgba(0, 119, 200, 0.28) !important;
}

.gpmd-login-form .fi-ac-btn-action {
    width: 100%;
}

@keyframes gpmd-login-rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 960px) {
    .gpmd-login {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .gpmd-login__brand {
        min-height: 38vh;
        padding: 2.25rem 1.5rem 4.25rem;
        justify-content: center;
    }

    .gpmd-login__brand-foot {
        display: none;
    }

    .gpmd-login__wave-svg--side {
        display: none;
    }

    .gpmd-login__wave-svg--bottom {
        display: block;
    }

    .gpmd-login__panel {
        min-height: auto;
        margin-top: -1.5rem;
    }

    .gpmd-login__panel-main {
        padding: 0.5rem 1.25rem 1.75rem;
        align-items: flex-start;
    }

    .gpmd-login__logo-circle {
        width: 11.5rem;
        height: 11.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gpmd-login__brand-inner,
    .gpmd-login__card {
        animation: none !important;
    }
}

/* ---------- Sidebar SIGEM · profesional + animaciones ---------- */

.fi-layout {
    align-items: stretch !important;
}

.fi-sidebar {
    position: sticky !important;
    top: 0 !important;
    align-self: flex-start !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    background:
        radial-gradient(ellipse 120% 70% at 0% 0%, rgba(0, 174, 239, 0.22), transparent 55%),
        linear-gradient(180deg, #003A6B 0%, #002D56 42%, #001F3F 100%) !important;
    background-attachment: local !important;
    border-right: 1px solid rgba(0, 174, 239, 0.2) !important;
    box-shadow: 8px 0 28px rgba(0, 31, 63, 0.18);
}

.fi-sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent 55%);
    opacity: 0.5;
    z-index: 0;
}

.fi-sidebar > * {
    position: relative;
    z-index: 1;
}

/* Cabecera blanca unificada con el sidebar (bloque de marca) */
.fi-sidebar .fi-sidebar-header {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    flex: 0 0 auto !important;
    border-bottom: 0 !important;
    background: linear-gradient(180deg, #ffffff 0%, #F3F8FC 100%) !important;
    padding: 1.15rem 0.85rem 1.25rem !important;
    min-height: 6.25rem;
    box-shadow:
        inset 0 -1px 0 rgba(0, 119, 200, 0.12),
        0 10px 24px rgba(0, 31, 63, 0.18);
    animation: gpmd-sidebar-header-in 0.55s ease both;
}

.fi-sidebar .fi-sidebar-header::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -10px;
    height: 10px;
    background: linear-gradient(180deg, rgba(0, 31, 63, 0.16), transparent);
    pointer-events: none;
}

.fi-sidebar .fi-sidebar-header > div:first-child,
.fi-sidebar .fi-sidebar-header a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 1 1 auto !important;
    min-width: 0;
    text-decoration: none !important;
}

.fi-sidebar .fi-logo,
.fi-sidebar .fi-sidebar-header a {
    color: #001F3F !important;
}

/* Logo sin “caja flotante”: el fondo blanco es toda la cabecera */
.fi-sidebar .fi-logo:not(.hidden) {
    display: block;
    height: auto !important;
    max-height: 4.6rem !important;
    width: auto !important;
    max-width: min(100%, 13rem);
    object-fit: contain;
    margin-inline: auto;
    border-radius: 0;
    background: transparent;
    padding: 0;
    box-shadow: none;
    border: 0;
    transition: transform 0.35s ease, filter 0.35s ease;
    animation: gpmd-sidebar-logo-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.fi-sidebar .fi-sidebar-header a:hover .fi-logo:not(.hidden),
.fi-sidebar .fi-logo:not(.hidden):hover {
    transform: scale(1.03);
    filter: drop-shadow(0 6px 14px rgba(0, 119, 200, 0.22));
}

.fi-sidebar .fi-sidebar-header .fi-icon-btn {
    position: absolute !important;
    right: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    color: #0077C8 !important;
    background: rgba(0, 119, 200, 0.08) !important;
    border-radius: 0.65rem !important;
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease !important;
}

.fi-sidebar .fi-sidebar-header .fi-icon-btn:hover {
    background: rgba(0, 119, 200, 0.16) !important;
    color: #002D56 !important;
    transform: translateY(-50%) scale(1.06) !important;
}

/* Navegación: crece y hace scroll interno sin cortar el fondo */
.fi-sidebar .fi-sidebar-nav {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    padding-top: 0.85rem !important;
    padding-bottom: 1.25rem !important;
    scrollbar-width: thin;
    scrollbar-color: rgba(125, 211, 252, 0.45) transparent;
}

.fi-sidebar .fi-sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.fi-sidebar .fi-sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(125, 211, 252, 0.4);
    border-radius: 999px;
}

.fi-sidebar .fi-sidebar-group {
    margin-bottom: 0.55rem;
}

.fi-sidebar .fi-sidebar-group-label {
    color: rgba(155, 180, 204, 0.95) !important;
    letter-spacing: 0.1em !important;
    font-size: 0.68rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    padding-inline: 0.85rem !important;
    margin-bottom: 0.2rem !important;
    opacity: 0;
    animation: gpmd-sidebar-item-in 0.45s ease both;
    animation-delay: 0.08s;
}

.fi-sidebar .fi-sidebar-group .fi-icon-btn {
    color: rgba(155, 180, 204, 0.9) !important;
    transition: color 0.2s ease, background 0.2s ease !important;
}

.fi-sidebar .fi-sidebar-group .fi-icon-btn:hover {
    color: #7DD3FC !important;
}

.fi-sidebar .fi-sidebar-item {
    opacity: 0;
    animation: gpmd-sidebar-item-in 0.45s ease both;
}

.fi-sidebar .fi-sidebar-item:nth-child(1) { animation-delay: 0.05s; }
.fi-sidebar .fi-sidebar-item:nth-child(2) { animation-delay: 0.09s; }
.fi-sidebar .fi-sidebar-item:nth-child(3) { animation-delay: 0.13s; }
.fi-sidebar .fi-sidebar-item:nth-child(4) { animation-delay: 0.17s; }
.fi-sidebar .fi-sidebar-item:nth-child(5) { animation-delay: 0.21s; }
.fi-sidebar .fi-sidebar-item:nth-child(6) { animation-delay: 0.25s; }
.fi-sidebar .fi-sidebar-item:nth-child(7) { animation-delay: 0.29s; }
.fi-sidebar .fi-sidebar-item:nth-child(8) { animation-delay: 0.33s; }
.fi-sidebar .fi-sidebar-item:nth-child(9) { animation-delay: 0.37s; }
.fi-sidebar .fi-sidebar-item:nth-child(10) { animation-delay: 0.41s; }

.fi-sidebar .fi-sidebar-item-button {
    position: relative !important;
    margin-inline: 0.55rem !important;
    border-radius: 0.8rem !important;
    overflow: hidden;
    transition:
        background 0.25s ease,
        color 0.25s ease,
        transform 0.25s ease,
        box-shadow 0.25s ease !important;
}

.fi-sidebar .fi-sidebar-item-button::before {
    content: '';
    position: absolute;
    left: 0;
    top: 18%;
    bottom: 18%;
    width: 3px;
    border-radius: 999px;
    background: #00AEEF;
    opacity: 0;
    transform: scaleY(0.4);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.fi-sidebar .fi-sidebar-item-button,
.fi-sidebar .fi-sidebar-item-button .fi-sidebar-item-label,
.fi-sidebar .fi-sidebar-item-button .fi-sidebar-item-icon,
.fi-sidebar .fi-sidebar-item-grouped-border {
    color: var(--gpmd-sidebar-text) !important;
}

.fi-sidebar .fi-sidebar-item-button .fi-sidebar-item-icon {
    transition: transform 0.25s ease, color 0.25s ease !important;
}

.fi-sidebar .fi-sidebar-item-button:hover {
    background: rgba(0, 174, 239, 0.16) !important;
    transform: translateX(3px);
    box-shadow: 0 8px 18px rgba(0, 31, 63, 0.18);
}

.fi-sidebar .fi-sidebar-item-button:hover::before {
    opacity: 1;
    transform: scaleY(1);
}

.fi-sidebar .fi-sidebar-item-button:hover .fi-sidebar-item-icon {
    transform: scale(1.08);
    color: #7DD3FC !important;
}

/* Ítem activo */
.fi-sidebar .fi-sidebar-item-button[aria-current="page"],
.fi-sidebar .fi-sidebar-item-button.fi-active,
.fi-sidebar .fi-sidebar-item.fi-active > .fi-sidebar-item-button,
.fi-sidebar li.fi-sidebar-item[aria-current="page"] > .fi-sidebar-item-button {
    background: linear-gradient(90deg, #ffffff 0%, #E8F4FC 100%) !important;
    box-shadow: 0 10px 22px rgba(0, 31, 63, 0.22);
    transform: translateX(2px);
}

.fi-sidebar .fi-sidebar-item-button[aria-current="page"]::before,
.fi-sidebar .fi-sidebar-item-button.fi-active::before,
.fi-sidebar .fi-sidebar-item.fi-active > .fi-sidebar-item-button::before,
.fi-sidebar li.fi-sidebar-item[aria-current="page"] > .fi-sidebar-item-button::before {
    opacity: 1;
    transform: scaleY(1);
    background: #0077C8;
    box-shadow: 0 0 12px rgba(0, 174, 239, 0.65);
    animation: gpmd-sidebar-active-pulse 2.4s ease-in-out infinite;
}

.fi-sidebar .fi-sidebar-item-button[aria-current="page"],
.fi-sidebar .fi-sidebar-item-button[aria-current="page"] *,
.fi-sidebar .fi-sidebar-item-button.fi-active,
.fi-sidebar .fi-sidebar-item-button.fi-active *,
.fi-sidebar .fi-sidebar-item.fi-active > .fi-sidebar-item-button,
.fi-sidebar .fi-sidebar-item.fi-active > .fi-sidebar-item-button *,
.fi-sidebar li.fi-sidebar-item[aria-current="page"] > .fi-sidebar-item-button,
.fi-sidebar li.fi-sidebar-item[aria-current="page"] > .fi-sidebar-item-button * {
    color: #002D56 !important;
}

.fi-sidebar .fi-sidebar-item-button[aria-current="page"] svg,
.fi-sidebar .fi-sidebar-item-button.fi-active svg,
.fi-sidebar .fi-sidebar-item.fi-active > .fi-sidebar-item-button svg {
    color: #0077C8 !important;
    stroke: currentColor;
}

html.dark .fi-sidebar {
    background:
        radial-gradient(ellipse 120% 70% at 0% 0%, rgba(0, 174, 239, 0.18), transparent 55%),
        linear-gradient(180deg, #001526 0%, #00101c 100%) !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
}

html.dark .fi-sidebar .fi-sidebar-header {
    background: linear-gradient(180deg, #ffffff 0%, #E8F4FC 100%) !important;
}

html.dark .fi-sidebar .fi-sidebar-item-button[aria-current="page"],
html.dark .fi-sidebar .fi-sidebar-item-button.fi-active,
html.dark .fi-sidebar .fi-sidebar-item.fi-active > .fi-sidebar-item-button {
    background: linear-gradient(90deg, #ffffff 0%, #E8F4FC 100%) !important;
}

html.dark .fi-sidebar .fi-sidebar-item-button[aria-current="page"],
html.dark .fi-sidebar .fi-sidebar-item-button[aria-current="page"] *,
html.dark .fi-sidebar .fi-sidebar-item-button.fi-active,
html.dark .fi-sidebar .fi-sidebar-item-button.fi-active * {
    color: #002D56 !important;
}

@keyframes gpmd-sidebar-header-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes gpmd-sidebar-logo-in {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes gpmd-sidebar-item-in {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes gpmd-sidebar-active-pulse {
    0%, 100% { box-shadow: 0 0 8px rgba(0, 174, 239, 0.35); }
    50% { box-shadow: 0 0 16px rgba(0, 174, 239, 0.8); }
}

@media (prefers-reduced-motion: reduce) {
    .fi-sidebar .fi-sidebar-header,
    .fi-sidebar .fi-logo:not(.hidden),
    .fi-sidebar .fi-sidebar-group-label,
    .fi-sidebar .fi-sidebar-item,
    .fi-sidebar .fi-sidebar-item-button::before {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }

    .fi-sidebar .fi-sidebar-item-button,
    .fi-sidebar .fi-sidebar-item-button .fi-sidebar-item-icon,
    .fi-sidebar .fi-sidebar-header .fi-icon-btn,
    .fi-sidebar .fi-logo:not(.hidden) {
        transition: none !important;
    }
}

/* Contenido principal pastel */
.fi-main,
.fi-main-ctn {
    background: var(--gpmd-soft) !important;
}

.fi-topbar {
    background: rgba(243, 248, 252, 0.92) !important;
    border-bottom: 1px solid var(--gpmd-line) !important;
    backdrop-filter: blur(10px);
}

html.dark .fi-topbar {
    background: rgba(7, 21, 37, 0.9) !important;
    border-bottom-color: var(--gpmd-line) !important;
}

/* Secciones Filament más diferenciadas */
.fi-section,
.fi-wi-widget,
.fi-ta-ctn,
.fi-fo-component-ctn > .fi-section {
    border-radius: 1rem !important;
}

.fi-section > .fi-section-content-ctn,
.fi-section-content-ctn {
    background: var(--gpmd-card) !important;
    border: 1px solid var(--gpmd-line) !important;
    border-radius: 1rem !important;
    box-shadow: var(--gpmd-shadow) !important;
    /* no overflow:hidden — recorta los selects/dropdowns de Filament */
    overflow: visible;
}

.fi-section-header {
    background: linear-gradient(90deg, var(--gpmd-mint) 0%, rgba(255,255,255,0.4) 100%) !important;
    border-bottom: 1px solid var(--gpmd-line) !important;
    border-left: 4px solid var(--gpmd-section-accent) !important;
    padding-inline-start: 0.85rem !important;
}

html.dark .fi-section-header {
    background: linear-gradient(90deg, rgba(0, 119, 200, 0.18) 0%, transparent 100%) !important;
}

.fi-section-header-heading {
    color: var(--gpmd-navy) !important;
    font-weight: 700 !important;
}

html.dark .fi-section-header-heading {
    color: var(--gpmd-ink) !important;
}

/* Tablas: cabecera pastel */
.fi-ta-header-ctn,
.fi-ta-header {
    background: var(--gpmd-mint) !important;
    border-bottom: 1px solid var(--gpmd-line) !important;
}

.fi-ta-header-cell {
    color: var(--gpmd-navy) !important;
}

html.dark .fi-ta-header-cell {
    color: var(--gpmd-ink) !important;
}

/* Página heading */
.fi-header-heading {
    color: var(--gpmd-navy) !important;
}

html.dark .fi-header-heading {
    color: var(--gpmd-ink) !important;
}

/* Botón primario más cian */
.fi-btn.fi-color-primary {
    box-shadow: 0 8px 20px rgba(0, 119, 200, 0.25);
}

.gpmd-hero-admin {
    background: linear-gradient(135deg, #00AEEF, #0077C8 55%, #002D56) !important;
    color: #E8F4FC !important;
}

/* Chart bars azules */
.gpmd-chart__bar {
    background: linear-gradient(180deg, #BAE6FD 0%, #7DD3FC 100%) !important;
}

.gpmd-chart__bar.is-highlight {
    background: linear-gradient(180deg, #38BDF8 0%, #0077C8 100%) !important;
    box-shadow: 0 10px 24px rgba(0, 119, 200, 0.28) !important;
}

.gpmd-axis--transversal {
    border-color: #7DD3FC !important;
    background: var(--gpmd-mint) !important;
}

html.dark .gpmd-btn-primary {
    color: #001F3F !important;
    background: linear-gradient(180deg, #7DD3FC 0%, #38BDF8 100%) !important;
}

/* ---------- Transiciones de página (SPA) ---------- */

.fi-main,
.fi-main-ctn,
.fi-page,
.fi-simple-page {
    transition:
        opacity 0.28s ease,
        transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
        filter 0.28s ease;
    will-change: opacity, transform;
}

.gpmd-page-enter {
    animation: gpmd-page-enter 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

html.gpmd-navigating .fi-main,
html.gpmd-navigating .fi-main-ctn,
html.gpmd-navigating .fi-page,
html.gpmd-navigating .fi-simple-page {
    opacity: 0.35;
    transform: translateY(10px) scale(0.992);
    filter: saturate(0.92);
    pointer-events: none;
}

/* Barra de progreso superior al navegar */
html.gpmd-navigating::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 100%;
    z-index: 9999;
    transform-origin: left center;
    background: linear-gradient(90deg, #00AEEF, #0077C8 55%, #38BDF8);
    animation: gpmd-nav-progress 0.85s ease-in-out infinite;
    box-shadow: 0 0 12px rgba(0, 174, 239, 0.55);
}

/* Suaviza tablas, secciones y cards al entrar */
.gpmd-page-enter .fi-section,
.gpmd-page-enter .fi-ta-ctn,
.gpmd-page-enter .fi-wi-stats-overview,
.gpmd-page-enter .gpmd-dash,
.gpmd-page-enter .gpmd-card,
.gpmd-page-enter .gpmd-kpi,
.gpmd-page-enter .gpmd-surface {
    animation: gpmd-page-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.gpmd-page-enter .fi-section:nth-child(2),
.gpmd-page-enter .gpmd-kpi:nth-child(2),
.gpmd-page-enter .gpmd-card:nth-child(2) { animation-delay: 0.05s; }
.gpmd-page-enter .fi-section:nth-child(3),
.gpmd-page-enter .gpmd-kpi:nth-child(3),
.gpmd-page-enter .gpmd-card:nth-child(3) { animation-delay: 0.1s; }
.gpmd-page-enter .fi-section:nth-child(4),
.gpmd-page-enter .gpmd-kpi:nth-child(4),
.gpmd-page-enter .gpmd-card:nth-child(4) { animation-delay: 0.15s; }

@keyframes gpmd-page-enter {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes gpmd-page-rise {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes gpmd-nav-progress {
    0% { transform: scaleX(0.08); opacity: 0.75; }
    50% { transform: scaleX(0.72); opacity: 1; }
    100% { transform: scaleX(1); opacity: 0.85; }
}

@media (prefers-reduced-motion: reduce) {
    .fi-main,
    .fi-main-ctn,
    .fi-page,
    .fi-simple-page,
    .gpmd-page-enter,
    .gpmd-page-enter .fi-section,
    .gpmd-page-enter .fi-ta-ctn,
    .gpmd-page-enter .gpmd-dash,
    .gpmd-page-enter .gpmd-card,
    .gpmd-page-enter .gpmd-kpi,
    .gpmd-page-enter .gpmd-surface {
        animation: none !important;
        transition: none !important;
        transform: none !important;
        opacity: 1 !important;
        filter: none !important;
    }

    html.gpmd-navigating::before {
        display: none !important;
    }
}
