/* ══════════════════════════════════════════════════════════════════════════
   KEP360 Finance — Minimalista Premium Panel CSS
   Paleta: Indigo (#6366f1) | Linear.app / Vercel Dashboard style
   Variables definidas en theme.css y sobrescritas por theme-vars.blade.php
   ══════════════════════════════════════════════════════════════════════════ */

/* ─── Login Page ─────────────────────────────────────────────────────────── */

.erp-login-shell {
    position: relative;
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(0, 1.04fr) minmax(27rem, 0.82fr);
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 16%, rgb(99 102 241 / 0.18), transparent 30rem),
        radial-gradient(circle at 88% 74%, rgb(16 185 129 / 0.1), transparent 28rem),
        linear-gradient(135deg, rgb(3 7 18) 0%, rgb(10 10 20) 58%, rgb(5 5 15) 100%);
    color: rgb(248 250 252);
}

.erp-login-shell::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(90deg, rgb(255 255 255 / 0.03) 1px, transparent 1px),
        linear-gradient(rgb(255 255 255 / 0.025) 1px, transparent 1px);
    background-size: 4rem 4rem;
    mask-image: linear-gradient(135deg, black, transparent 70%);
    pointer-events: none;
}

.erp-login-brand,
.erp-login-panel {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.erp-login-brand {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    justify-content: space-between;
    isolation: isolate;
    overflow: hidden;
    padding: clamp(2rem, 4.4vw, 4.25rem);
    background:
        radial-gradient(circle at 22% 20%, rgb(99 102 241 / 0.22), transparent 24rem),
        linear-gradient(135deg, rgb(10 10 20), rgb(4 4 12));
}

.erp-login-brand::before,
.erp-login-brand::after,
.erp-login-brand__image,
.erp-login-brand__wash {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.erp-login-brand::before {
    content: '';
    z-index: -1;
    background: linear-gradient(90deg, transparent 0%, transparent 54%, rgb(3 3 12 / 0.76) 82%, rgb(3 3 12 / 0.98) 100%);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    mask-image: linear-gradient(90deg, transparent 0%, transparent 55%, black 86%);
}

.erp-login-brand::after {
    content: '';
    z-index: -1;
    background:
        radial-gradient(ellipse at 38% 48%, transparent 0%, transparent 45%, rgb(0 0 0 / 0.32) 78%, rgb(0 0 0 / 0.66) 100%),
        linear-gradient(90deg, transparent 0%, rgb(0 0 8 / 0.12) 50%, rgb(0 0 8 / 0.9) 100%);
}

.erp-login-brand__image {
    z-index: -3;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    filter: saturate(0.96) contrast(1.06) brightness(0.72);
    opacity: 0.8;
    transform: scale(1.018);
}

.erp-login-brand__wash {
    z-index: -2;
    background:
        linear-gradient(90deg, rgb(0 0 8 / 0.52), rgb(10 10 30 / 0.38) 46%, rgb(0 0 8 / 0.86) 100%),
        linear-gradient(180deg, rgb(0 0 8 / 0.66), rgb(10 10 30 / 0.18) 46%, rgb(0 0 8 / 0.76)),
        radial-gradient(circle at 32% 46%, rgb(99 102 241 / 0.08), transparent 24rem);
}

.erp-login-shell--fallback-hero .erp-login-brand__wash {
    background:
        radial-gradient(circle at 22% 18%, rgb(99 102 241 / 0.28), transparent 26rem),
        radial-gradient(circle at 76% 78%, rgb(16 185 129 / 0.13), transparent 24rem),
        linear-gradient(135deg, rgb(10 10 20), rgb(4 4 12));
}

.erp-login-brand__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.erp-login-logo-lockup,
.erp-login-card__brand {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 1rem;
}

.erp-login-logo {
    display: flex;
    width: 3.5rem;
    height: 3.5rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid rgb(255 255 255 / 0.16);
    border-radius: 999px;
    background: rgb(99 102 241 / 0.2);
    color: white;
    font-size: 0.95rem;
    font-weight: 800;
    box-shadow: 0 1.25rem 3rem rgb(0 0 0 / 0.3);
    backdrop-filter: blur(14px);
}

.erp-login-logo img {
    width: 78%;
    height: 78%;
    object-fit: contain;
    object-position: center;
}

.erp-login-logo--card {
    width: 3rem;
    height: 3rem;
    border-radius: 0.875rem;
    background: rgb(99 102 241 / 0.08);
    box-shadow: none;
    border-color: rgb(99 102 241 / 0.2);
}

.erp-login-logo-lockup p {
    margin: 0;
    overflow-wrap: anywhere;
    color: white;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.25rem;
}

.erp-login-logo-lockup span,
.erp-login-hero span,
.erp-login-card__header p,
.erp-login-card__footer,
.erp-login-register {
    color: rgb(71 85 105);
}

.erp-login-brand .erp-login-logo-lockup span,
.erp-login-hero span {
    color: rgb(148 163 184);
}

.erp-login-logo-lockup span,
.erp-login-hero span,
.erp-login-card__header p {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.erp-login-brand .fi-theme-switcher {
    border: 1px solid rgb(255 255 255 / 0.18);
    border-radius: 999px;
    background: rgb(255 255 255 / 0.1);
    padding: 0.25rem;
    backdrop-filter: blur(14px);
}

.erp-login-brand .fi-theme-switcher-btn { color: rgb(203 213 225); }
.erp-login-brand .fi-theme-switcher-btn:hover { background: rgb(255 255 255 / 0.14); }

.erp-login-hero {
    max-width: 36rem;
    padding-block: clamp(3rem, 10vh, 7rem);
}

.erp-login-hero h1 {
    margin: 0.85rem 0 0;
    max-width: 18ch;
    color: white;
    font-size: clamp(2.35rem, 3.8vw, 3.75rem);
    font-weight: 750;
    line-height: 1.04;
}

.erp-login-hero p {
    margin: 1.1rem 0 0;
    max-width: 31rem;
    color: rgb(148 163 184);
    font-size: 0.98rem;
    line-height: 1.72;
}

.erp-login-panel {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: clamp(1.25rem, 4vw, 4rem);
}

.erp-login-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgb(3 3 12 / 0.76), rgb(3 3 12 / 0.96));
    pointer-events: none;
}

.erp-login-card {
    position: relative;
    z-index: 1;
    width: min(100%, 29rem);
    border: 1px solid rgb(255 255 255 / 0.14);
    border-radius: 1rem;
    background: rgb(255 255 255 / 0.96);
    padding: clamp(1.5rem, 3vw, 2.35rem);
    box-shadow: 0 1.75rem 5rem rgb(0 0 0 / 0.38);
    -webkit-backdrop-filter: blur(22px);
    backdrop-filter: blur(22px);
}

.dark .erp-login-card {
    border-color: rgb(255 255 255 / 0.08);
    background: rgb(15 15 30 / 0.88);
    box-shadow: 0 1.75rem 5rem rgb(0 0 0 / 0.5);
}

.erp-login-card__header {
    display: grid;
    gap: 1.25rem;
    margin-bottom: 2.25rem;
}

.erp-login-card__brand > div:last-child { min-width: 0; }

.erp-login-card__header h2 {
    margin: 0.35rem 0 0;
    color: rgb(15 23 42);
    font-size: clamp(1.65rem, 3vw, 2.15rem);
    font-weight: 800;
    line-height: 1.15;
}

.dark .erp-login-card__header h2 { color: white; }

.erp-login-form {
    display: grid;
    gap: 1.25rem;
}

.erp-login-form .fi-fo-field-wrp-label span,
.erp-login-form .fi-checkbox-input + span {
    font-weight: 700;
}

.erp-login-form .fi-input-wrp { border-radius: 0.75rem; }
.erp-login-form .fi-input-wrp input { min-height: 2.875rem; }
.erp-login-form .fi-btn { min-height: 3rem; border-radius: 0.75rem; font-weight: 800; }

.erp-login-register {
    margin: -1rem 0 1.5rem;
    font-size: 0.875rem;
}

.erp-login-card__footer {
    margin-top: 1.75rem;
    border-top: 1px solid rgb(15 23 42 / 0.08);
    padding-top: 1rem;
    font-size: 0.8125rem;
    line-height: 1.4;
}

.dark .erp-login-card__footer { border-top-color: rgb(255 255 255 / 0.1); }

.erp-login-status {
    border: 1px solid rgb(245 158 11 / 0.35);
    border-radius: 8px;
    background: rgb(245 158 11 / 0.1);
    color: #92400e;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.4;
    padding: 0.75rem 0.875rem;
}

.dark .erp-login-status {
    border-color: rgb(251 191 36 / 0.35);
    background: rgb(251 191 36 / 0.12);
    color: #fde68a;
}

/* ─── Sidebar Refinements ────────────────────────────────────────────────── */

.fi-sidebar {
    border-right: 1px solid var(--erp-sidebar-border, var(--erp-border-color));
}

/* Safe-area para notch */
@supports (padding: max(0px)) {
    .fi-sidebar { padding-bottom: max(0px, env(safe-area-inset-bottom)); }
    .fi-topbar { padding-top: max(0px, env(safe-area-inset-top)); }
}

/* ─── Topbar ─────────────────────────────────────────────────────────────── */

.fi-topbar .fi-icon-btn,
.fi-topbar .fi-btn,
.fi-user-menu-trigger {
    border-radius: var(--erp-radius-xs) !important;
}

/* Avatar con ring accent */
.fi-avatar {
    border: 2px solid var(--erp-border-color);
    box-shadow: 0 0 0 2px var(--erp-accent-soft, rgba(99,102,241,0.15));
    border-radius: 50%;
    width: 34px !important;
    height: 34px !important;
}

/* ─── Dashboard: Bienvenida / Welcome ───────────────────────────────────── */

.erp-welcome {
    border-radius: var(--erp-radius-lg) !important;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 45%, #1e40af 100%) !important;
    box-shadow: 0 20px 50px rgb(99 102 241 / 0.25) !important;
    min-height: 8rem;
}

.dark .erp-welcome {
    background: linear-gradient(135deg, #0d0b20 0%, #1e1b4b 45%, #0f2660 100%) !important;
    box-shadow: 0 24px 60px rgb(0 0 0 / 0.4) !important;
}

/* Light mode welcome sobrescritura */
html:not(.dark) .erp-welcome {
    isolation: isolate;
    border: 1px solid rgb(99 102 241 / 0.2) !important;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 47%, #ede9fe 100%) !important;
    box-shadow: 0 1px 0 rgb(255 255 255 / 0.9), 0 20px 50px rgb(99 102 241 / 0.12) !important;
    color: rgb(30 27 75);
}

html:not(.dark) .erp-welcome h1,
html:not(.dark) .erp-welcome .text-white {
    color: #1e1b4b !important;
}

html:not(.dark) .erp-welcome p,
html:not(.dark) .erp-welcome span {
    color: #3730a3 !important;
}

html:not(.dark) .erp-welcome .text-slate-300,
html:not(.dark) .erp-welcome .text-slate-400 {
    color: #4338ca !important;
}

html:not(.dark) .erp-welcome .bg-white\/5 {
    border: 1px solid rgb(99 102 241 / 0.2);
    background: rgb(255 255 255 / 0.6) !important;
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.8), 0 4px 12px rgb(99 102 241 / 0.08);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

html:not(.dark) .erp-welcome .ring-white\/10 {
    --tw-ring-color: rgb(99 102 241 / 0.15) !important;
}

html:not(.dark) .erp-welcome .bg-amber-500\/20 { background: rgb(180 83 9 / 0.1) !important; }
html:not(.dark) .erp-welcome .text-amber-200 { color: rgb(146 64 14) !important; }
html:not(.dark) .erp-welcome .bg-blue-500\/20 { background: rgb(99 102 241 / 0.1) !important; }
html:not(.dark) .erp-welcome .text-blue-200 { color: #3730a3 !important; }

/* ─── Quick Action Cards ─────────────────────────────────────────────────── */

.erp-action-card {
    border-radius: var(--erp-radius) !important;
    background: var(--erp-card-bg) !important;
    border: 1px solid var(--erp-border-color) !important;
    box-shadow: var(--erp-shadow-sm) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease !important;
    position: relative;
    overflow: hidden;
}

.erp-action-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--erp-shadow-md) !important;
    border-color: color-mix(in srgb, var(--erp-accent) 40%, var(--erp-border-color)) !important;
}

.erp-action-card:focus-visible {
    outline: 2px solid var(--erp-accent);
    outline-offset: 2px;
}

/* ─── Financial Stats Cards ──────────────────────────────────────────────── */

.fi-wi-stats-overview-stat {
    position: relative;
    overflow: hidden;
    border-radius: var(--erp-radius) !important;
    border: 1px solid var(--erp-border-color) !important;
    background: var(--erp-card-bg) !important;
    box-shadow: var(--erp-shadow-sm) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fi-wi-stats-overview-stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--erp-shadow-md) !important;
}

/* Borde superior 3px semántico */
.fi-wi-stats-overview-stat::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: var(--erp-accent, #6366f1);
    pointer-events: none;
}

.fi-wi-stats-overview-stat:nth-child(3n+1)::before { background: #10b981; }
.fi-wi-stats-overview-stat:nth-child(3n+2)::before { background: #ef4444; }
.fi-wi-stats-overview-stat:nth-child(3n)::before   { background: #6366f1; }

.fi-wi-stats-overview-stat-value {
    font-size: clamp(1.35rem, 2vw, 1.75rem) !important;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: var(--erp-text) !important;
    overflow-wrap: anywhere;
}

.fi-wi-stats-overview-stat-label,
.fi-wi-stats-overview-stat-description {
    color: var(--erp-muted) !important;
    line-height: 1.35 !important;
}

/* ─── Operations Panel ───────────────────────────────────────────────────── */

.erp-ops-panel {
    border-radius: var(--erp-radius) !important;
    background: var(--erp-card-bg) !important;
    border: 1px solid var(--erp-border-color) !important;
    box-shadow: var(--erp-shadow-sm) !important;
    padding: 1.25rem;
    overflow: hidden;
    contain: paint;
}

.erp-ops-panel,
.erp-ops-panel *,
.erp-ops-panel ::before,
.erp-ops-panel ::after {
    min-width: 0;
}

.erp-ops-grid {
    width: 100%;
    overflow-x: clip;
}

/* ─── Section Kicker (label uppercase) ──────────────────────────────────── */

.erp-section-kicker {
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--erp-muted);
}

/* ─── Metric Values ──────────────────────────────────────────────────────── */

.erp-metric-value {
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 2.25rem;
    font-variant-numeric: tabular-nums;
    color: var(--erp-text);
    overflow-wrap: anywhere;
    word-break: normal;
}

/* ─── Mini Metric / Status Tile / Workload Row ───────────────────────────── */

.erp-mini-metric,
.erp-status-tile,
.erp-workload-row {
    border-radius: var(--erp-radius-sm);
    background: color-mix(in srgb, var(--erp-card-bg) 80%, var(--erp-page-bg));
    border: 1px solid var(--erp-border-color);
}

.erp-mini-metric { padding: 0.875rem; }

.erp-mini-metric span,
.erp-status-tile span,
.erp-workload-row span {
    font-size: 0.8125rem;
    color: var(--erp-muted);
}

.erp-mini-metric strong {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.9375rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--erp-text);
}

.erp-status-tile,
.erp-workload-row {
    display: flex;
    min-height: 3rem;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0.875rem;
}

.erp-status-tile strong,
.erp-workload-row strong {
    font-size: 0.9375rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--erp-text);
    overflow-wrap: anywhere;
    word-break: normal;
}

.erp-status-dot {
    width: 0.625rem;
    height: 0.625rem;
    flex: 0 0 auto;
    border-radius: 9999px;
}

.erp-status-tile span:nth-child(2) { flex: 1 1 auto; }

/* ─── Approval Rows ──────────────────────────────────────────────────────── */

.erp-approval-row {
    display: flex;
    min-height: 4.75rem;
    align-items: center;
    gap: 0.875rem;
    border-radius: var(--erp-radius-sm);
    border: 1px solid var(--erp-border-color);
    background: color-mix(in srgb, var(--erp-card-bg) 80%, var(--erp-page-bg));
    padding: 0.875rem;
    transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.erp-approval-row:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--erp-accent) 35%, var(--erp-border-color));
    background: var(--erp-card-bg);
}

.erp-approval-row__icon {
    display: flex;
    width: 2.5rem;
    height: 2.5rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: var(--erp-radius-xs);
    background: color-mix(in srgb, var(--erp-accent) 12%, transparent);
    color: var(--erp-accent);
}

/* ─── Dashboard Alert Cards ──────────────────────────────────────────────── */

.erp-dashboard-alerts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.875rem;
    align-items: stretch;
}

.erp-dashboard-alert {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.875rem;
    min-height: 5rem;
    padding: 1rem;
    border: 1px solid var(--erp-border-color);
    border-radius: var(--erp-radius-sm);
    background: var(--erp-card-bg);
    transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
    min-width: 0;
}

.erp-dashboard-alert:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--erp-accent) 30%, var(--erp-border-color));
    box-shadow: var(--erp-shadow-md);
}

.erp-dashboard-alert-icon {
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--erp-radius-xs);
    background: color-mix(in srgb, var(--erp-accent) 10%, transparent);
    color: var(--erp-accent);
    flex-shrink: 0;
}

.erp-dashboard-alert-label {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--erp-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.erp-dashboard-alert-description {
    margin-top: 0.125rem;
    font-size: 0.75rem;
    color: var(--erp-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.erp-dashboard-alert-value {
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--erp-text);
    line-height: 1;
}

.erp-dashboard-alert-content { min-width: 0; }

.erp-dashboard-alert-metrics {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--erp-border-color);
}

.erp-dashboard-alert-metrics span {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--erp-muted);
}

.erp-dashboard-alert-metrics strong {
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    color: var(--erp-text);
}

/* Semantic alert types */
.erp-dashboard-alert-success .erp-dashboard-alert-icon { background: rgb(16 185 129 / 0.12); color: #10b981; }
.erp-dashboard-alert-warning .erp-dashboard-alert-icon { background: rgb(245 158 11 / 0.12); color: #f59e0b; }
.erp-dashboard-alert-danger  .erp-dashboard-alert-icon { background: rgb(239 68 68 / 0.12);  color: #ef4444; }
.erp-dashboard-alert-info    .erp-dashboard-alert-icon { background: rgb(59 130 246 / 0.12);  color: #3b82f6; }

/* ─── Quick Actions Container ────────────────────────────────────────────── */

.erp-quick-actions {
    border-radius: var(--erp-radius) !important;
    background: var(--erp-card-bg) !important;
    border: 1px solid var(--erp-border-color) !important;
    box-shadow: var(--erp-shadow-sm) !important;
}

/* ─── Section / Card general ─────────────────────────────────────────────── */

.erp-card,
.erp-section,
.erp-dashboard-card {
    border: 1px solid var(--erp-border-color);
    border-radius: var(--erp-radius);
    background: var(--erp-card-bg);
    box-shadow: var(--erp-shadow-sm);
    padding: 1.25rem;
}

.erp-soft-panel {
    border: 1px solid var(--erp-border-color);
    border-radius: var(--erp-radius-sm);
    background: color-mix(in srgb, var(--erp-card-bg) 80%, var(--erp-page-bg));
    padding: 0.875rem;
}

.erp-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--erp-border-color);
    padding-bottom: 0.875rem;
}

/* ─── Page layout ────────────────────────────────────────────────────────── */

.fi-body {
    color: var(--erp-text);
    background: var(--erp-page-bg);
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

.fi-main {
    background: transparent !important;
    padding-block: clamp(1rem, 2vw, 1.5rem) 2rem !important;
}

.fi-page { gap: 1rem !important; }
.fi-header { margin-bottom: 0.25rem; }

.fi-header-heading {
    color: var(--erp-text);
    font-weight: 800 !important;
    letter-spacing: 0 !important;
}

/* ─── Table ──────────────────────────────────────────────────────────────── */

.fi-ta-ctn {
    -webkit-overflow-scrolling: touch;
}

.fi-ta-content {
    overflow-x: auto;
    scrollbar-width: thin;
}

.fi-ta-table {
    min-width: 46rem;
}

.fi-ta-header-cell {
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

/* ─── Theme Preview (Settings UI) ───────────────────────────────────────── */

.erp-theme-preview {
    display: grid;
    grid-template-columns: minmax(9rem, 13rem) 1fr;
    overflow: hidden;
    border: 1px solid var(--preview-border);
    border-radius: var(--erp-radius-sm);
    background: var(--preview-page-bg);
    box-shadow: var(--erp-shadow-md);
}

.erp-theme-preview__sidebar {
    display: grid;
    gap: 0.5rem;
    align-content: start;
    min-height: 15rem;
    background: var(--preview-sidebar-bg);
    color: var(--preview-sidebar-text);
    padding: 1rem;
}

.erp-theme-preview__brand {
    margin-bottom: 0.5rem;
    font-weight: 800;
}

.erp-theme-preview__item {
    border-radius: var(--erp-radius-xs);
    padding: 0.55rem 0.75rem;
    color: var(--preview-sidebar-text);
    font-size: 0.875rem;
    font-weight: 600;
}

.erp-theme-preview__item.is-active {
    background: var(--preview-sidebar-active-bg);
    color: white;
}

.erp-theme-preview__item.is-hover {
    background: var(--preview-sidebar-hover-bg);
    color: var(--preview-primary);
}

.erp-theme-preview__main { min-width: 0; }

.erp-theme-preview__topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: var(--preview-topbar-bg);
    border-bottom: 1px solid var(--preview-border);
    padding: 0.875rem 1rem;
    color: var(--preview-primary);
    font-weight: 800;
}

.erp-theme-preview__topbar button {
    border-radius: var(--erp-radius-xs);
    background: var(--preview-primary);
    color: white;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 800;
}

.erp-theme-preview__content { padding: 1rem; }

.erp-theme-preview__card {
    border: 1px solid var(--preview-border);
    border-radius: var(--erp-radius-xs);
    background: var(--preview-card-bg);
    padding: 1rem;
}

.erp-theme-preview__card-title { color: var(--preview-primary); font-weight: 800; }

.erp-theme-preview__card-line {
    width: 70%;
    height: 0.5rem;
    margin-block: 0.875rem;
    border-radius: 999px;
    background: var(--preview-secondary);
}

.erp-theme-preview__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.erp-theme-preview__badges span {
    border-radius: 999px;
    padding: 0.3rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 700;
}

.erp-theme-preview__badges .success { color: var(--preview-success); background: color-mix(in srgb, var(--preview-success) 12%, white); }
.erp-theme-preview__badges .warning { color: var(--preview-warning); background: color-mix(in srgb, var(--preview-warning) 12%, white); }
.erp-theme-preview__badges .danger  { color: var(--preview-danger);  background: color-mix(in srgb, var(--preview-danger)  12%, white); }
.erp-theme-preview__badges .info    { color: var(--preview-info);    background: color-mix(in srgb, var(--preview-info)    12%, white); }

/* ─── Locale switcher en user menu ───────────────────────────────────────── */

.fi-user-menu form button {
    width: 100%;
    text-align: start;
}

.fi-user-menu [x-cloak] { display: none !important; }

/* ─── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 1279px) {
    .erp-dashboard-alerts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1023px) {
    .fi-topbar-open-sidebar-btn,
    .fi-icon-btn,
    .fi-btn {
        min-height: 2.5rem;
        min-width: 2.5rem;
    }

    .fi-main-ctn { padding-inline: 0.75rem; }

    .fi-wi-stats-overview-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.75rem !important;
    }

    .erp-welcome { padding: 1.25rem !important; }
    .erp-action-card { padding: 1rem !important; }

    .fi-sidebar {
        max-width: min(100vw, 20rem);
    }

    .fi-sidebar-close-overlay {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background-color: rgb(10 10 15 / 0.5);
    }

    .fi-wi-stats-overview-stat,
    .fi-wi-stats-overview-stat:hover {
        transform: none;
    }

    .fi-main { padding-inline: 0.875rem !important; }
    .fi-page { gap: 0.875rem !important; }

    .fi-section,
    .fi-ta-ctn,
    .fi-wi-chart,
    .fi-wi-table { border-radius: var(--erp-radius-sm) !important; }

    .fi-ta-table { min-width: 42rem; }
    .fi-fo-component-ctn { gap: 0.875rem !important; }

    .erp-approval-row { align-items: flex-start; }
    .erp-ops-panel { border-radius: var(--erp-radius-sm); padding: 1rem; }

    .erp-dashboard-alert {
        grid-template-columns: auto minmax(0, 1fr) minmax(2.5rem, auto);
        min-height: 4.5rem;
        padding: 0.875rem;
    }

    .erp-dashboard-alert-icon { width: 2.25rem; height: 2.25rem; }

    .fi-ta-content {
        margin-inline: -0.75rem;
        padding-inline: 0.75rem;
    }

    html:not(.dark) .fi-sidebar {
        box-shadow: 14px 0 40px rgb(0 0 0 / 0.08);
    }
}

@media (max-width: 767px) {
    .fi-main { padding-inline: 0.75rem !important; }

    .fi-header { gap: 0.75rem !important; }

    .fi-header-actions,
    .fi-ta-header-toolbar,
    .fi-ta-actions { align-items: stretch !important; }

    .fi-header-actions .fi-btn,
    .fi-ta-header-toolbar .fi-btn { justify-content: center; }

    .fi-wi-stats-overview-stat { min-height: auto; }
}

@media (max-width: 640px) {
    html, body, .fi-body, .fi-layout, .fi-main-ctn {
        max-width: 100%;
        overflow-x: hidden;
    }

    .fi-wi-stats-overview-stats {
        grid-template-columns: 1fr !important;
    }

    .fi-ta-header-toolbar {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .fi-header-heading { font-size: 1.25rem !important; }

    .fi-main { padding-inline: 0.625rem !important; }

    .fi-topbar { min-height: 3.75rem; }

    .fi-section,
    .fi-ta-ctn,
    .fi-wi-chart,
    .fi-wi-table,
    .erp-ops-panel,
    .erp-quick-actions,
    .erp-dashboard-alert {
        border-radius: var(--erp-radius-sm) !important;
    }

    .erp-ops-panel { padding: 0.875rem; }

    .erp-metric-value { font-size: 1.5rem; line-height: 2rem; }

    .erp-dashboard-alerts { grid-template-columns: 1fr; }

    .erp-status-tile,
    .erp-workload-row {
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.75rem;
    }

    .erp-status-tile strong,
    .erp-workload-row strong { text-align: end; }

    .erp-ops-panel,
    .erp-mini-metric,
    .erp-status-tile,
    .erp-workload-row {
        transform: none;
        animation: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .erp-card,
    .erp-section,
    .erp-dashboard-card,
    .erp-ops-panel,
    .erp-quick-actions { padding: 1rem; }

    .erp-theme-preview { grid-template-columns: 1fr; }
    .erp-theme-preview__sidebar { min-height: auto; }

    html:not(.dark) .erp-welcome { border-radius: var(--erp-radius) !important; }
}

@media (max-width: 480px) {
    .fi-main { padding-inline: 0.5rem !important; }
    .fi-ta-table { min-width: 38rem; }
    .erp-login-card { padding: 1.25rem; }
    .erp-dashboard-alert { gap: 0.625rem; }
}

@media (max-width: 380px) {
    .erp-ops-panel { padding: 0.875rem; }
    .erp-status-tile, .erp-workload-row { flex-wrap: wrap; }
    .erp-status-tile strong,
    .erp-workload-row strong { width: 100%; text-align: start; }
}

/* Login responsive */
@media (max-width: 1023px) {
    .erp-login-shell { grid-template-columns: 1fr; }
    .erp-login-brand, .erp-login-panel { min-height: auto; }
    .erp-login-brand { padding: 1.5rem; }
    .erp-login-brand__image { opacity: 0.4; filter: saturate(0.86) contrast(1.02) brightness(0.64); }
    .erp-login-brand::before { -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
    .erp-login-hero { padding-block: 2.75rem 1.5rem; }
    .erp-login-hero h1 { max-width: 20ch; font-size: 2.6rem; line-height: 1.06; }
    .erp-login-panel { align-items: flex-start; padding: 1rem 1.5rem 2rem; }
    .erp-login-card { width: min(100%, 34rem); }
}

@media (max-width: 640px) {
    .erp-login-brand__top { align-items: flex-start; }
    .erp-login-brand .fi-theme-switcher { display: none; }
    .erp-login-brand__image { display: none; }
    .erp-login-brand::before { -webkit-backdrop-filter: none; backdrop-filter: none; }
    .erp-login-logo-lockup { gap: 0.875rem; }
    .erp-login-logo { width: 2.875rem; height: 2.875rem; }
    .erp-login-logo--card { width: 2.75rem; height: 2.75rem; border-radius: 0.75rem; }
    .erp-login-hero { padding-block: 2.5rem 1.25rem; }
    .erp-login-hero h1 { font-size: 2.05rem; }
    .erp-login-hero p { font-size: 0.92rem; line-height: 1.6; }
    .erp-login-panel { padding: 1rem; }
    .erp-login-card { border-radius: 0.875rem; box-shadow: 0 1rem 2.75rem rgb(0 0 0 / 0.18); }
    .erp-login-card__brand { align-items: flex-start; }
    .erp-login-card__header { margin-bottom: 1.75rem; }
}

/* Desktop: sidebar collapsible */
@media (min-width: 1024px) {
    .fi-main-ctn:not(.fi-main-ctn-sidebar-open) .fi-main { max-width: 100%; }
}

/* ══════════════════════════════════════════════════════════════════════════
   Chatbot FAQ flotante — KEP360 Finance
   ══════════════════════════════════════════════════════════════════════════ */

.erp-chatbot-root {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
}

/* ── Botón flotante ────────────────────────────────────────────────────── */

.erp-chatbot-fab {
    position: relative;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 50%;
    background: #6366f1;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgb(99 102 241 / 0.45), 0 2px 8px rgb(0 0 0 / 0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    animation: erp-chatbot-pulse 3s ease-in-out infinite;
    flex-shrink: 0;
}

.erp-chatbot-fab:hover {
    background: #5558e8;
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgb(99 102 241 / 0.55), 0 3px 12px rgb(0 0 0 / 0.22);
}

.erp-chatbot-fab--active {
    animation: none;
    background: #4f46e5;
    transform: scale(1);
}

.erp-chatbot-fab__icon {
    width: 1.5rem;
    height: 1.5rem;
    transition: transform 0.2s ease;
}

.erp-chatbot-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    animation: erp-chatbot-badge-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes erp-chatbot-pulse {
    0%, 100% { box-shadow: 0 4px 20px rgb(99 102 241 / 0.45), 0 0 0 0 rgb(99 102 241 / 0.35); }
    50%       { box-shadow: 0 4px 20px rgb(99 102 241 / 0.45), 0 0 0 10px rgb(99 102 241 / 0); }
}

@keyframes erp-chatbot-badge-pop {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

/* ── Popup ─────────────────────────────────────────────────────────────── */

.erp-chatbot-popup {
    width: 340px;
    height: 460px;
    border-radius: 16px;
    background: var(--erp-surface, #fff);
    box-shadow:
        0 20px 60px rgb(0 0 0 / 0.18),
        0 8px 24px rgb(0 0 0 / 0.10),
        0 0 0 1px rgb(99 102 241 / 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
}

/* Animación Alpine.js slideUp */
[x-cloak] { display: none !important; }

.erp-chatbot-enter        { transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1); }
.erp-chatbot-enter-start  { opacity: 0; transform: scale(0.85) translateY(12px); }
.erp-chatbot-enter-end    { opacity: 1; transform: scale(1) translateY(0); }
.erp-chatbot-leave        { transition: opacity 0.18s ease, transform 0.18s ease; }
.erp-chatbot-leave-start  { opacity: 1; transform: scale(1) translateY(0); }
.erp-chatbot-leave-end    { opacity: 0; transform: scale(0.9) translateY(8px); }

/* ── Header ────────────────────────────────────────────────────────────── */

.erp-chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    background: linear-gradient(135deg, #6366f1, #818cf8);
    color: #fff;
    flex-shrink: 0;
}

.erp-chatbot-header__left {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.erp-chatbot-avatar {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: rgb(255 255 255 / 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.erp-chatbot-avatar svg {
    width: 1.125rem;
    height: 1.125rem;
    color: #fff;
}

.erp-chatbot-header__name {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
    margin: 0;
}

.erp-chatbot-header__status {
    font-size: 0.7rem;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin: 0;
}

.erp-chatbot-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4ade80;
    display: inline-block;
    animation: erp-chatbot-status-blink 2s ease-in-out infinite;
}

@keyframes erp-chatbot-status-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

.erp-chatbot-header__close {
    background: rgb(255 255 255 / 0.15);
    border: none;
    color: #fff;
    border-radius: 8px;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease;
    flex-shrink: 0;
}

.erp-chatbot-header__close:hover {
    background: rgb(255 255 255 / 0.28);
}

/* ── Mensajes ──────────────────────────────────────────────────────────── */

.erp-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.875rem 0.875rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: rgb(99 102 241 / 0.25) transparent;
}

.erp-chatbot-messages::-webkit-scrollbar { width: 4px; }
.erp-chatbot-messages::-webkit-scrollbar-thumb { background: rgb(99 102 241 / 0.25); border-radius: 4px; }

.erp-chatbot-msg-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.erp-chatbot-msg-row--bot  { align-items: flex-start; }
.erp-chatbot-msg-row--user { align-items: flex-end; }

.erp-chatbot-bubble {
    max-width: 82%;
    padding: 0.5rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8125rem;
    line-height: 1.55;
    word-break: break-word;
    animation: erp-chatbot-bubble-in 0.2s ease both;
}

@keyframes erp-chatbot-bubble-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.erp-chatbot-bubble--bot {
    background: var(--erp-muted-bg, #f1f5f9);
    color: var(--erp-text, #1e293b);
    border-bottom-left-radius: 4px;
}

.erp-chatbot-bubble--user {
    background: #6366f1;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.erp-chatbot-msg-time {
    font-size: 0.65rem;
    color: var(--erp-text-muted, #94a3b8);
    padding-inline: 4px;
}

/* Typing indicator */
.erp-chatbot-typing {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 0.6rem 0.875rem;
    min-width: 3.5rem;
}

.erp-chatbot-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #94a3b8;
    display: inline-block;
    animation: erp-chatbot-dot 1.2s ease-in-out infinite;
}

.erp-chatbot-typing span:nth-child(2) { animation-delay: 0.2s; }
.erp-chatbot-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes erp-chatbot-dot {
    0%, 80%, 100% { transform: scale(0.75); opacity: 0.4; }
    40%           { transform: scale(1); opacity: 1; }
}

/* ── Preguntas rápidas ─────────────────────────────────────────────────── */

.erp-chatbot-quickreplies {
    padding: 0.5rem 0.875rem 0.25rem;
    flex-shrink: 0;
    border-top: 1px solid var(--erp-border, #e2e8f0);
}

.erp-chatbot-quickreplies__label {
    font-size: 0.67rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--erp-text-muted, #94a3b8);
    margin: 0 0 0.375rem;
}

.erp-chatbot-quickreplies__grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    max-height: 7rem;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgb(99 102 241 / 0.2) transparent;
}

.erp-chatbot-chip {
    font-size: 0.72rem;
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
    border: 1.5px solid rgb(99 102 241 / 0.35);
    background: rgb(99 102 241 / 0.06);
    color: #6366f1;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
    white-space: nowrap;
    line-height: 1.4;
}

.erp-chatbot-chip:hover {
    background: rgb(99 102 241 / 0.14);
    border-color: #6366f1;
    transform: translateY(-1px);
}

/* ── Input ─────────────────────────────────────────────────────────────── */

.erp-chatbot-inputbar {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding: 0.625rem 0.75rem;
    border-top: 1px solid var(--erp-border, #e2e8f0);
    flex-shrink: 0;
    background: var(--erp-surface, #fff);
}

.erp-chatbot-input {
    flex: 1;
    font-size: 0.8125rem;
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    border: 1.5px solid var(--erp-border, #e2e8f0);
    background: var(--erp-muted-bg, #f8fafc);
    color: var(--erp-text, #1e293b);
    outline: none;
    transition: border-color 0.15s ease;
    min-width: 0;
}

.erp-chatbot-input:focus {
    border-color: #6366f1;
    background: var(--erp-surface, #fff);
}

.erp-chatbot-input::placeholder { color: var(--erp-text-muted, #94a3b8); }

.erp-chatbot-send {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: #6366f1;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s ease, transform 0.1s ease;
}

.erp-chatbot-send:hover:not(:disabled) {
    background: #5558e8;
    transform: scale(1.08);
}

.erp-chatbot-send:disabled {
    background: #c7d2fe;
    cursor: not-allowed;
}

/* ── Dark mode ─────────────────────────────────────────────────────────── */

.dark .erp-chatbot-popup {
    background: rgb(15 23 42 / 0.98);
    box-shadow:
        0 20px 60px rgb(0 0 0 / 0.45),
        0 8px 24px rgb(0 0 0 / 0.3),
        0 0 0 1px rgb(99 102 241 / 0.2);
}

.dark .erp-chatbot-bubble--bot {
    background: rgb(30 41 59);
    color: #e2e8f0;
}

.dark .erp-chatbot-chip {
    background: rgb(99 102 241 / 0.12);
    border-color: rgb(99 102 241 / 0.4);
    color: #a5b4fc;
}

.dark .erp-chatbot-chip:hover {
    background: rgb(99 102 241 / 0.22);
}

.dark .erp-chatbot-input {
    background: rgb(30 41 59);
    border-color: rgb(51 65 85);
    color: #e2e8f0;
}

.dark .erp-chatbot-input:focus {
    border-color: #818cf8;
    background: rgb(30 41 59);
}

.dark .erp-chatbot-inputbar,
.dark .erp-chatbot-quickreplies {
    border-top-color: rgb(51 65 85);
    background: rgb(15 23 42 / 0.98);
}

.dark .erp-chatbot-typing span { background: #475569; }
.dark .erp-chatbot-badge { border-color: rgb(15 23 42); }

/* ── Burbuja emergente (modo oscuro) ───────────────────────────────────── */
.dark .kep-bubble {
    background: #1e1b4b !important;
    border-left-color: #818cf8 !important;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4) !important;
}

.dark .kep-bubble p {
    color: #e2e8f0 !important;
}

.dark .kep-bubble-arrow {
    border-top-color: #1e1b4b !important;
}

/* ── Responsive móvil ──────────────────────────────────────────────────── */

@media (max-width: 480px) {
    .erp-chatbot-root {
        bottom: 1rem;
        right: 1rem;
    }

    .erp-chatbot-popup {
        width: calc(100vw - 2rem);
        height: 420px;
        border-radius: 14px;
    }
}

/* ══════════════════════════════════════
   KEP360 PREMIUM UI - SIDEBAR & TOPBAR
   ══════════════════════════════════════ */

/* ANIMACIONES */
@keyframes kep-border-flow {
    0%   { background-position: 0% 0%; }
    100% { background-position: 0% 200%; }
}
@keyframes kep-rainbow {
    0%   { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}
@keyframes kep-shimmer-top {
    0%   { left: -100%; }
    100% { left: 200%; }
}
@keyframes kep-active-glow {
    0%, 100% { box-shadow: inset 3px 0 0 #6366f1, 0 0 10px rgba(99,102,241,0.1); }
    50%       { box-shadow: inset 3px 0 0 #818cf8, 0 0 20px rgba(99,102,241,0.2); }
}
@keyframes kep-notif-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239,68,68,0.5); }
    50%       { transform: scale(1.1); box-shadow: 0 0 0 4px rgba(239,68,68,0); }
}

/* ══════════════
   SIDEBAR OSCURO
   ══════════════ */
.dark nav.fi-sidebar-nav,
.dark [class*="fi-sidebar"] nav,
.dark .fi-sidebar {
    background: linear-gradient(
        180deg,
        #08080f 0%,
        #0a0a1a 50%,
        #070710 100%
    ) !important;
    border-right: none !important;
}

/* Borde derecho vía box-shadow — ver sección LAYOUT VISUAL al final */
.dark .fi-sidebar::after,
.dark nav.fi-sidebar-nav::after { display: none !important; }

/* ══════════════
   SIDEBAR CLARO
   ══════════════ */
nav.fi-sidebar-nav,
[class*="fi-sidebar"] nav,
.fi-sidebar {
    background: linear-gradient(
        180deg,
        #ffffff 0%,
        #f8f8ff 50%,
        #f3f3ff 100%
    ) !important;
}

/* Borde derecho vía box-shadow — ver sección LAYOUT VISUAL al final */
.fi-sidebar::after,
nav.fi-sidebar-nav::after { display: none !important; }

/* ══════════════
   LOGO ÁREA
   ══════════════ */
.dark .fi-sidebar-header {
    background: linear-gradient(135deg, #0a0a1f 0%, #0d0d22 100%) !important;
    border-bottom: 1px solid rgba(99,102,241,0.2) !important;
}
.fi-sidebar-header {
    background: linear-gradient(135deg, #eef2ff 0%, #e8e8ff 100%) !important;
    border-bottom: 1px solid rgba(99,102,241,0.15) !important;
}

/* ══════════════════
   ITEMS MENÚ OSCURO
   ══════════════════ */
.dark .fi-sidebar-item > a,
.dark .fi-sidebar-item > button,
.dark li[class*="fi-sidebar-item"] > a {
    color: #94a3b8 !important;
    border-radius: 10px !important;
    margin: 1px 6px !important;
    transition: all 0.2s ease !important;
}
.dark .fi-sidebar-item > a:hover,
.dark .fi-sidebar-item > button:hover,
.dark li[class*="fi-sidebar-item"] > a:hover {
    background: rgba(99,102,241,0.12) !important;
    color: #c4b5fd !important;
    transform: translateX(4px) !important;
}

/* Item activo oscuro */
.dark .fi-sidebar-item-active > a,
.dark li[class*="fi-active"] > a,
.dark [aria-current="page"] {
    background: rgba(99,102,241,0.18) !important;
    color: #a5b4fc !important;
    font-weight: 600 !important;
    animation: kep-active-glow 3s ease-in-out infinite !important;
}

/* ══════════════════
   ITEMS MENÚ CLARO
   ══════════════════ */
.fi-sidebar-item > a,
.fi-sidebar-item > button,
li[class*="fi-sidebar-item"] > a {
    color: #64748b !important;
    border-radius: 10px !important;
    margin: 1px 6px !important;
    transition: all 0.2s ease !important;
}
.fi-sidebar-item > a:hover,
.fi-sidebar-item > button:hover {
    background: rgba(99,102,241,0.08) !important;
    color: #4f46e5 !important;
    transform: translateX(4px) !important;
}

/* Item activo claro */
.fi-sidebar-item-active > a,
li[class*="fi-active"] > a,
:not(.dark) [aria-current="page"] {
    background: rgba(99,102,241,0.1) !important;
    color: #4f46e5 !important;
    font-weight: 600 !important;
    box-shadow: inset 3px 0 0 #6366f1 !important;
}

/* Labels de grupos */
.dark .fi-sidebar-group-label {
    color: #374151 !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    letter-spacing: 0.12em !important;
    text-transform: uppercase !important;
}
.fi-sidebar-group-label {
    color: #94a3b8 !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    letter-spacing: 0.12em !important;
    text-transform: uppercase !important;
}

/* ══════════════
   TOPBAR OSCURO
   ══════════════ */
.dark header.fi-topbar,
.dark .fi-topbar,
.dark div[class*="fi-topbar"] {
    background: linear-gradient(135deg, #06060e 0%, #090916 100%) !important;
    position: relative !important;
    overflow: visible !important;
}

/* Borde inferior arcoíris topbar oscuro */
.dark header.fi-topbar::after,
.dark .fi-topbar::after {
    content: '' !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 1px !important;
    background: linear-gradient(
        90deg,
        transparent,
        #6366f1,
        #8b5cf6,
        #06b6d4,
        #8b5cf6,
        #6366f1,
        transparent
    ) !important;
    background-size: 200% 100% !important;
    animation: kep-rainbow 3s linear infinite !important;
}

/* Shimmer topbar oscuro */
.dark header.fi-topbar::before,
.dark .fi-topbar::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: -100% !important;
    width: 40% !important;
    height: 100% !important;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(99,102,241,0.06),
        transparent
    ) !important;
    animation: kep-shimmer-top 6s ease-in-out infinite !important;
    pointer-events: none !important;
    z-index: 1 !important;
}

/* ══════════════
   TOPBAR CLARO
   ══════════════ */
header.fi-topbar,
.fi-topbar,
div[class*="fi-topbar"] {
    background: #ffffff !important;
    position: relative !important;
    box-shadow: 0 1px 0 rgba(99,102,241,0.1) !important;
}

/* Borde inferior claro */
header.fi-topbar::after,
.fi-topbar::after {
    content: '' !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 1px !important;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(99,102,241,0.5),
        rgba(139,92,246,0.7),
        rgba(99,102,241,0.5),
        transparent
    ) !important;
    background-size: 200% 100% !important;
    animation: kep-rainbow 3s linear infinite !important;
}

/* ══════════════════
   AVATAR TOPBAR
   ══════════════════ */
.dark .fi-topbar img[class*="rounded"],
.dark .fi-avatar,
.dark [class*="avatar"] img {
    border: 2px solid rgba(99,102,241,0.6) !important;
    border-radius: 50% !important;
    box-shadow: 0 0 12px rgba(99,102,241,0.4) !important;
}
.fi-topbar img[class*="rounded"],
.fi-avatar,
[class*="avatar"] img {
    border: 2px solid rgba(99,102,241,0.3) !important;
    border-radius: 50% !important;
}

/* ══════════════════
   NOTIFICACIONES
   ══════════════════ */
.dark .fi-notification-count,
.dark [class*="badge"] {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    box-shadow: 0 0 8px rgba(239,68,68,0.6) !important;
    animation: kep-notif-pulse 2s ease-in-out infinite !important;
}
.fi-notification-count,
[class*="badge"] {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    box-shadow: 0 0 6px rgba(239,68,68,0.4) !important;
    animation: kep-notif-pulse 2s ease-in-out infinite !important;
}

/* ══════════════════
   FONDO PRINCIPAL
   ══════════════════ */
.dark .fi-main,
.dark main {
    background: #07070f !important;
}
.fi-main,
main:not([class*="simple"]) {
    background: #f5f5fb !important;
}

/* ══════════════════
   CARDS Y SECCIONES
   ══════════════════ */
.dark .fi-section,
.dark .fi-card,
.dark [class*="fi-wi"] {
    background: rgba(12,12,24,0.95) !important;
    border: 1px solid rgba(99,102,241,0.12) !important;
    border-radius: 14px !important;
    transition: all 0.25s ease !important;
}
.dark .fi-section:hover,
.dark .fi-card:hover {
    border-color: rgba(99,102,241,0.3) !important;
    box-shadow: 0 4px 24px rgba(99,102,241,0.12) !important;
    transform: translateY(-2px) !important;
}
.fi-section,
.fi-card,
[class*="fi-wi"] {
    background: #ffffff !important;
    border: 1px solid rgba(99,102,241,0.1) !important;
    border-radius: 14px !important;
    transition: all 0.25s ease !important;
}
.fi-section:hover,
.fi-card:hover {
    border-color: rgba(99,102,241,0.25) !important;
    box-shadow: 0 4px 20px rgba(99,102,241,0.08) !important;
    transform: translateY(-2px) !important;
}

/* ══════════════════
   TABLAS
   ══════════════════ */
.dark .fi-ta-header-cell {
    background: rgba(8,8,20,0.95) !important;
    color: #475569 !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 0.06em !important;
    text-transform: uppercase !important;
    border-bottom: 1px solid rgba(99,102,241,0.15) !important;
}
.fi-ta-header-cell {
    background: #f8f8ff !important;
    color: #94a3b8 !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 0.06em !important;
    text-transform: uppercase !important;
}
.dark .fi-ta-row:hover td {
    background: rgba(99,102,241,0.05) !important;
}
.fi-ta-row:hover td {
    background: rgba(99,102,241,0.03) !important;
}

/* ══════════════════
   BOTONES
   ══════════════════ */
.fi-btn-primary,
button[class*="fi-btn"][class*="primary"] {
    background: linear-gradient(135deg, #6366f1, #4f46e5) !important;
    border: none !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
}
.fi-btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5, #3730a3) !important;
    box-shadow: 0 4px 20px rgba(99,102,241,0.4) !important;
    transform: translateY(-1px) !important;
}

/* ══════════════════
   INPUTS/FORMS
   ══════════════════ */
.dark .fi-input,
.dark input[class*="fi-"],
.dark textarea[class*="fi-"],
.dark select[class*="fi-"] {
    background: rgba(10,10,24,0.8) !important;
    border-color: rgba(99,102,241,0.2) !important;
    color: #e2e8f0 !important;
    border-radius: 8px !important;
}
.dark .fi-input:focus,
.dark input[class*="fi-"]:focus {
    border-color: rgba(99,102,241,0.6) !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15) !important;
}
.fi-input:focus,
input[class*="fi-"]:focus {
    border-color: rgba(99,102,241,0.5) !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1) !important;
}

/* ══════════════════
   SCROLLBAR GLOBAL
   ══════════════════ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
.dark ::-webkit-scrollbar-thumb {
    background: rgba(99,102,241,0.3);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: rgba(99,102,241,0.2);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(99,102,241,0.5);
}

/* ══════════════════
   FIX LOGIN SIN SCROLL
   ══════════════════ */
body:has(.fi-simple-layout) {
    overflow: hidden !important;
    height: 100vh !important;
}
.fi-simple-layout {
    overflow: hidden !important;
    height: 100vh !important;
    position: relative !important;
}

/* ══════════════════════════════════════════════════════════════════════════
   TOPBAR & SIDEBAR — PREMIUM v2
   DARK  → Mundial 2026: fondo animado + borde tricolor + shimmer sutil
   LIGHT → Premium SaaS: blanco puro + sombra suave + borde indigo estático
   ══════════════════════════════════════════════════════════════════════════ */

/* ─── Keyframes exclusivos v2 ────────────────────────────────────────────── */
@keyframes kep2-mundial-bg {
    0%   { background-position: 0% 50%;   }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%;   }
}
@keyframes kep2-mundial-border {
    0%   { background-position:   0% 50%; }
    100% { background-position: 200% 50%; }
}
@keyframes kep2-shimmer {
    0%   { transform: translateX(-150%); }
    100% { transform: translateX(400%);  }
}
@keyframes kep2-sidebar-border {
    0%   { background-position: 50% 0%;   }
    100% { background-position: 50% 200%; }
}

/* ══════════════════════════════════════
   TOPBAR MODO OSCURO — Mundial 2026
   ══════════════════════════════════════ */
.dark .fi-topbar,
.dark header.fi-topbar {
    /* Mezcla sutil de azul oscuro / verde foresta / rojo apagado → colores host 2026 */
    background: linear-gradient(
        135deg,
        #07071a 0%,
        #0a130a 22%,
        #13080a 44%,
        #07071a 66%,
        #0a0a16 88%,
        #07071a 100%
    ) !important;
    background-size: 400% 400% !important;
    animation: kep2-mundial-bg 12s ease infinite !important;
    border-bottom: none !important;
    box-shadow:
        0 1px 0 rgba(0,0,0,0.7),
        0 4px 28px rgba(0,0,0,0.45) !important;
    position: relative !important;
    overflow-x: clip !important;   /* clips shimmer en x sin afectar overflow-y */
    overflow-y: visible !important; /* dropdown del usuario debe poder abrirse */
}

/* Shimmer diagonal sutil */
.dark .fi-topbar::before,
.dark header.fi-topbar::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 28% !important;
    height: 100% !important;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,0.032),
        transparent
    ) !important;
    animation: kep2-shimmer 9s ease-in-out infinite !important;
    pointer-events: none !important;
    z-index: 1 !important;
}

/* Borde inferior tricolor animado: USA · MEX · CAN */
.dark .fi-topbar::after,
.dark header.fi-topbar::after {
    content: '' !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 2px !important;
    background: linear-gradient(
        90deg,
        #b22234 0%,       /* USA rojo    */
        #ffffff 12%,      /* USA blanco  */
        #3c3b6e 22%,      /* USA azul    */
        #006847 33%,      /* MEX verde   */
        #ffffff 44%,      /* MEX blanco  */
        #ce1126 55%,      /* MEX rojo    */
        #ff0000 66%,      /* CAN rojo    */
        #ffffff 77%,      /* CAN blanco  */
        #ff0000 88%,      /* CAN rojo    */
        #b22234 100%
    ) !important;
    background-size: 200% 100% !important;
    animation: kep2-mundial-border 5s linear infinite !important;
}

/* Texto topbar oscuro */
.dark .fi-topbar,
.dark header.fi-topbar {
    color: #cbd5e1 !important;
}

/* ══════════════════════════════════════
   TOPBAR MODO CLARO — Premium SaaS
   ══════════════════════════════════════ */
.fi-topbar,
header.fi-topbar {
    background: #ffffff !important;
    border-bottom: none !important;
    box-shadow:
        0 1px 0 rgba(99,102,241,0.09),
        0 2px 10px rgba(0,0,0,0.05) !important;
    position: relative !important;
    overflow-x: clip !important;   /* clips shimmer en x sin afectar overflow-y */
    overflow-y: visible !important; /* dropdown del usuario debe poder abrirse */
}

/* Sin shimmer en modo claro */
.fi-topbar::before,
header.fi-topbar::before {
    display: none !important;
    animation: none !important;
}

/* Borde inferior indigo degradado estático */
.fi-topbar::after,
header.fi-topbar::after {
    content: '' !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 1px !important;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(99,102,241,0.35) 20%,
        rgba(139,92,246,0.55) 50%,
        rgba(99,102,241,0.35) 80%,
        transparent 100%
    ) !important;
    animation: none !important;
}

/* ─── Avatar ──────────────────────────────────────────────────────────────── */
/* Oscuro: anillo dorado (Mundial trophy) */
.dark .fi-topbar .fi-avatar,
.dark .fi-topbar [class*="avatar"] img,
.dark .fi-topbar img[class*="rounded-full"],
.dark .fi-topbar img[class*="rounded"] {
    border: 2px solid rgba(255,215,0,0.55) !important;
    box-shadow: 0 0 14px rgba(255,215,0,0.28) !important;
    border-radius: 50% !important;
}
/* Claro: anillo indigo sutil */
.fi-topbar .fi-avatar,
.fi-topbar [class*="avatar"] img,
.fi-topbar img[class*="rounded-full"],
.fi-topbar img[class*="rounded"] {
    border: 2px solid rgba(99,102,241,0.3) !important;
    box-shadow: 0 0 8px rgba(99,102,241,0.12) !important;
    border-radius: 50% !important;
}

/* ─── Badge / Notificaciones ─────────────────────────────────────────────── */
/* Oscuro: rojo neón con pulso */
.dark .fi-notification-count,
.dark .fi-topbar [class*="badge"],
.dark header [class*="notification-count"] {
    background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
    color: #fff !important;
    border: 1px solid rgba(255,255,255,0.18) !important;
    box-shadow: 0 0 10px rgba(220,38,38,0.65) !important;
    animation: kep-notif-pulse 2.2s ease-in-out infinite !important;
    font-size: 9px !important;
    font-weight: 700 !important;
    border-radius: 20px !important;
    min-width: 16px !important;
    height: 16px !important;
    padding: 0 3px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}
/* Claro: rojo sólido limpio */
.fi-notification-count,
.fi-topbar [class*="badge"],
header [class*="notification-count"] {
    background: #ef4444 !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 2px 6px rgba(239,68,68,0.3) !important;
    animation: none !important;
    font-size: 9px !important;
    font-weight: 700 !important;
    border-radius: 20px !important;
    min-width: 16px !important;
    height: 16px !important;
    padding: 0 3px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* ─── Hover botones topbar ───────────────────────────────────────────────── */
.dark .fi-topbar button:hover,
.dark header.fi-topbar button:hover {
    background: rgba(255,255,255,0.07) !important;
    border-radius: 8px !important;
    transition: background 0.18s ease !important;
}
.fi-topbar button:hover,
header.fi-topbar button:hover {
    background: rgba(99,102,241,0.07) !important;
    border-radius: 8px !important;
    transition: background 0.18s ease !important;
}

/* ══════════════════════════════════════
   SIDEBAR MODO OSCURO — Deep Space
   ══════════════════════════════════════ */
.dark .fi-sidebar,
.dark nav.fi-sidebar-nav,
.dark [class*="fi-sidebar"] nav {
    background: linear-gradient(
        180deg,
        #06060f 0%,
        #08081a 45%,
        #060612 100%
    ) !important;
    border-right: none !important;
}

/* Borde derecho vía box-shadow — ver sección LAYOUT VISUAL al final */

/* Header logo oscuro */
.dark .fi-sidebar-header {
    background: linear-gradient(135deg, #04040e 0%, #07071e 100%) !important;
    border-bottom: 1px solid rgba(99,102,241,0.18) !important;
}

/* Menú items oscuro */
.dark .fi-sidebar-item > a,
.dark .fi-sidebar-item > button,
.dark li[class*="fi-sidebar-item"] > a {
    color: #94a3b8 !important;
    border-radius: 10px !important;
    margin: 1px 6px !important;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease !important;
}
.dark .fi-sidebar-item > a:hover,
.dark .fi-sidebar-item > button:hover,
.dark li[class*="fi-sidebar-item"] > a:hover {
    background: rgba(99,102,241,0.12) !important;
    color: #c4b5fd !important;
    transform: translateX(4px) !important;
}
.dark .fi-sidebar-item-active > a,
.dark li[class*="fi-active"] > a,
.dark [aria-current="page"] {
    background: linear-gradient(
        90deg,
        rgba(99,102,241,0.22) 0%,
        rgba(99,102,241,0.07) 100%
    ) !important;
    color: #a5b4fc !important;
    font-weight: 600 !important;
    box-shadow: inset 3px 0 0 #6366f1 !important;
    animation: kep-active-glow 3s ease-in-out infinite !important;
}

/* Group labels oscuro */
.dark .fi-sidebar-group-label {
    color: #2d3a52 !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    letter-spacing: 0.12em !important;
    text-transform: uppercase !important;
}

/* Badge items sidebar oscuro */
.dark .fi-sidebar-item [class*="badge"],
.dark li[class*="fi-sidebar-item"] [class*="badge"] {
    background: rgba(99,102,241,0.18) !important;
    color: #a5b4fc !important;
    border: 1px solid rgba(99,102,241,0.32) !important;
    box-shadow: none !important;
    animation: none !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    border-radius: 20px !important;
    padding: 1px 6px !important;
}

/* ══════════════════════════════════════
   SIDEBAR MODO CLARO — Premium White
   ══════════════════════════════════════ */
.fi-sidebar,
nav.fi-sidebar-nav,
[class*="fi-sidebar"] nav {
    background: linear-gradient(
        180deg,
        #ffffff   0%,
        #fafafe  55%,
        #f5f5fd 100%
    ) !important;
    border-right: none !important;
}

/* Borde derecho vía box-shadow — ver sección LAYOUT VISUAL al final */

/* Header logo claro */
.fi-sidebar-header {
    background: linear-gradient(135deg, #eef0ff 0%, #e8eaff 100%) !important;
    border-bottom: 1px solid rgba(99,102,241,0.11) !important;
}

/* Menú items claro */
.fi-sidebar-item > a,
.fi-sidebar-item > button,
li[class*="fi-sidebar-item"] > a {
    color: #475569 !important;
    border-radius: 10px !important;
    margin: 1px 6px !important;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease !important;
}
.fi-sidebar-item > a:hover,
.fi-sidebar-item > button:hover,
li[class*="fi-sidebar-item"] > a:hover {
    background: rgba(99,102,241,0.07) !important;
    color: #4338ca !important;
    transform: translateX(3px) !important;
}
.fi-sidebar-item-active > a,
li[class*="fi-active"] > a,
:not(.dark) [aria-current="page"] {
    background: linear-gradient(
        90deg,
        rgba(99,102,241,0.1)  0%,
        rgba(99,102,241,0.03) 100%
    ) !important;
    color: #4338ca !important;
    font-weight: 600 !important;
    box-shadow: inset 3px 0 0 #6366f1 !important;
    animation: none !important;
}

/* Group labels claro */
.fi-sidebar-group-label {
    color: #94a3b8 !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    letter-spacing: 0.12em !important;
    text-transform: uppercase !important;
}

/* Badge items sidebar claro */
.fi-sidebar-item [class*="badge"],
li[class*="fi-sidebar-item"] [class*="badge"] {
    background: rgba(99,102,241,0.09) !important;
    color: #6366f1 !important;
    border: 1px solid rgba(99,102,241,0.22) !important;
    box-shadow: none !important;
    animation: none !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    border-radius: 20px !important;
    padding: 1px 6px !important;
}

/* ══════════════════════════════════════════════════════════════════════════
   LAYOUT VISUAL — Sidebar box-shadow + Topbar sticky nativo
   No se sobreescribe position: Filament/Alpine manejan el toggle y sticky.
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Keyframe borde sidebar via box-shadow ────────────────────────────── */
@keyframes kep-sidebar-glow {
    0%, 100% {
        box-shadow:
            inset -2px 0 0 rgba(99,102,241,0.50),
            inset -14px 0 28px rgba(99,102,241,0.05);
    }
    50% {
        box-shadow:
            inset -2px 0 0 rgba(139,92,246,0.80),
            inset -14px 0 36px rgba(139,92,246,0.10);
    }
}

/* ── Topbar: sticky nativo, sin forzar fixed ─────────────────────────── */
.fi-topbar,
header.fi-topbar {
    position: sticky !important;
    top: 0 !important;
    z-index: 20 !important;
}

/* ── Sidebar ::after desactivado (causaba línea flotante) ────────────── */
.fi-sidebar::after,
.dark .fi-sidebar::after,
nav.fi-sidebar-nav::after,
.dark nav.fi-sidebar-nav::after {
    display: none !important;
    content: none !important;
    animation: none !important;
}

/* ── Borde derecho animado via box-shadow (no afecta layout) ─────────── */
.dark .fi-sidebar,
.dark aside.fi-sidebar {
    animation: kep-sidebar-glow 3s ease-in-out infinite !important;
}
.fi-sidebar,
aside.fi-sidebar {
    box-shadow: inset -1px 0 0 rgba(99,102,241,0.18) !important;
    animation: none !important;
}

/* ══════════════════════════════════════════════════════════════════════════
   BADGES — Colores premium, diferenciados dark / light
   Eliminamos el rojo chillón; danger → violeta, resto mantenido elegante
   ══════════════════════════════════════════════════════════════════════════ */

/* ── DARK MODE ───────────────────────────────────────────────────────────── */
.dark .fi-badge-color-danger,
.dark [class*="fi-badge-color-danger"] {
    background: rgba(124,58,237,0.18) !important;
    color: #a78bfa !important;
    border: 1px solid rgba(124,58,237,0.35) !important;
    box-shadow: none !important;
}
.dark .fi-badge-color-warning,
.dark [class*="fi-badge-color-warning"] {
    background: rgba(217,119,6,0.18) !important;
    color: #fcd34d !important;
    border: 1px solid rgba(217,119,6,0.35) !important;
    box-shadow: none !important;
}
.dark .fi-badge-color-success,
.dark [class*="fi-badge-color-success"] {
    background: rgba(16,185,129,0.18) !important;
    color: #6ee7b7 !important;
    border: 1px solid rgba(16,185,129,0.35) !important;
    box-shadow: none !important;
}
.dark .fi-badge-color-info,
.dark [class*="fi-badge-color-info"] {
    background: rgba(59,130,246,0.18) !important;
    color: #93c5fd !important;
    border: 1px solid rgba(59,130,246,0.35) !important;
    box-shadow: none !important;
}
.dark .fi-badge-color-primary,
.dark [class*="fi-badge-color-primary"] {
    background: rgba(99,102,241,0.18) !important;
    color: #a5b4fc !important;
    border: 1px solid rgba(99,102,241,0.35) !important;
    box-shadow: none !important;
}
.dark .fi-badge-color-gray,
.dark [class*="fi-badge-color-gray"] {
    background: rgba(100,116,139,0.18) !important;
    color: #94a3b8 !important;
    border: 1px solid rgba(100,116,139,0.25) !important;
    box-shadow: none !important;
}

/* ── LIGHT MODE ──────────────────────────────────────────────────────────── */
.fi-badge-color-danger,
[class*="fi-badge-color-danger"] {
    background: rgba(124,58,237,0.10) !important;
    color: #7c3aed !important;
    border: 1px solid rgba(124,58,237,0.25) !important;
    box-shadow: none !important;
}
.fi-badge-color-warning,
[class*="fi-badge-color-warning"] {
    background: rgba(217,119,6,0.10) !important;
    color: #b45309 !important;
    border: 1px solid rgba(217,119,6,0.25) !important;
    box-shadow: none !important;
}
.fi-badge-color-success,
[class*="fi-badge-color-success"] {
    background: rgba(16,185,129,0.10) !important;
    color: #059669 !important;
    border: 1px solid rgba(16,185,129,0.25) !important;
    box-shadow: none !important;
}
.fi-badge-color-info,
[class*="fi-badge-color-info"] {
    background: rgba(59,130,246,0.10) !important;
    color: #2563eb !important;
    border: 1px solid rgba(59,130,246,0.25) !important;
    box-shadow: none !important;
}
.fi-badge-color-primary,
[class*="fi-badge-color-primary"] {
    background: rgba(99,102,241,0.10) !important;
    color: #4f46e5 !important;
    border: 1px solid rgba(99,102,241,0.25) !important;
    box-shadow: none !important;
}
.fi-badge-color-gray,
[class*="fi-badge-color-gray"] {
    background: rgba(100,116,139,0.10) !important;
    color: #64748b !important;
    border: 1px solid rgba(100,116,139,0.18) !important;
    box-shadow: none !important;
}

/* ══════════════════════════════════════════════════════════════════════════
   BADGES — Override correcto para Filament 3
   ─────────────────────────────────────────────────────────────────────────
   Filament genera: class="fi-badge fi-color-custom bg-custom-50
     text-custom-600 ring-custom-600/10 dark:bg-custom-400/10
     dark:text-custom-400 dark:ring-custom-400/30 fi-color-{color}"
   con style="--c-50:var(--danger-50);--c-400:var(--danger-400);--c-600:..."

   Los colores vienen de variables --c-50/400/600 en el inline style.
   !important en custom properties sí overridea inline styles (CSS cascade).
   Una sola regla cubre light Y dark automáticamente.
   ══════════════════════════════════════════════════════════════════════════ */

/* ── danger → violeta ───────────────────────────────────────────────────── */
.fi-badge.fi-color-danger {
    --c-50:  246, 243, 255 !important;   /* violet-50  → bg light        */
    --c-400: 167, 139, 250 !important;   /* violet-400 → bg/texto dark   */
    --c-600: 124,  58, 237 !important;   /* violet-600 → texto light     */
}

/* ── warning → ámbar ────────────────────────────────────────────────────── */
.fi-badge.fi-color-warning {
    --c-50:  255, 251, 235 !important;   /* amber-50  */
    --c-400: 251, 191,  36 !important;   /* amber-400 */
    --c-600: 217, 119,   6 !important;   /* amber-600 */
}

/* ── success → esmeralda ────────────────────────────────────────────────── */
.fi-badge.fi-color-success {
    --c-50:  236, 253, 245 !important;   /* emerald-50  */
    --c-400:  52, 211, 153 !important;   /* emerald-400 */
    --c-600:   5, 150, 105 !important;   /* emerald-600 */
}

/* ── primary → indigo ───────────────────────────────────────────────────── */
.fi-badge.fi-color-primary {
    --c-50:  238, 242, 255 !important;   /* indigo-50  */
    --c-400: 129, 140, 248 !important;   /* indigo-400 */
    --c-600:  79,  70, 229 !important;   /* indigo-600 */
}

/* ── info → cielo ───────────────────────────────────────────────────────── */
.fi-badge.fi-color-info {
    --c-50:  240, 249, 255 !important;   /* sky-50  */
    --c-400:  56, 189, 248 !important;   /* sky-400 */
    --c-600:   2, 132, 199 !important;   /* sky-600 */
}

/* ── Tipografía + reset (gray usa Tailwind hardcoded, no variables) ─────── */
.fi-badge {
    font-size: 11px !important;
    font-weight: 600 !important;
    padding: 2px 10px !important;
    border-radius: 20px !important;
    animation: none !important;
    line-height: 1.4 !important;
    box-shadow: none !important;
}

/* ══════════════════════════════════════════════════════════════════════════
   BADGES — Fondo sólido + texto blanco
   background !important gana sobre bg-custom-50 (Tailwind class sin !important)
   ══════════════════════════════════════════════════════════════════════════ */
.fi-badge.fi-color-danger  { background: #7c3aed !important; color: #fff !important; }
.fi-badge.fi-color-warning { background: #d97706 !important; color: #fff !important; }
.fi-badge.fi-color-success { background: #059669 !important; color: #fff !important; }
.fi-badge.fi-color-primary { background: #4f46e5 !important; color: #fff !important; }
.fi-badge.fi-color-info    { background: #0284c7 !important; color: #fff !important; }
.fi-badge.fi-color-gray    { background: #475569 !important; color: #fff !important; }

/* ══════════════════════════════════════════════════════════════════════════
   BADGE NOTIFICACIÓN TOPBAR — posición correcta ambos modos
   ══════════════════════════════════════════════════════════════════════════ */

/* Contenedor del botón necesita position:relative para anclar el badge */
.fi-topbar button,
header.fi-topbar button {
    position: relative !important;
}

/* Badge: esquina superior derecha del botón */
.fi-topbar [class*="badge"],
header.fi-topbar [class*="badge"],
.fi-topbar .fi-notifications-badge,
.fi-topbar span[class*="fi-badge"] {
    position: absolute !important;
    top: -4px !important;
    right: -4px !important;
    left: auto !important;
    bottom: auto !important;
    z-index: 10 !important;
    min-width: 18px !important;
    height: 18px !important;
    border-radius: 20px !important;
    font-size: 9px !important;
    font-weight: 700 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 4px !important;
    color: #fff !important;
    /* background se hereda de fi-color-X o del default abajo */
}

/* Dark: borde que separa el badge del fondo oscuro del topbar */
.dark .fi-topbar [class*="badge"],
.dark header.fi-topbar [class*="badge"],
.dark .fi-topbar span[class*="fi-badge"] {
    background: #dc2626 !important;
    border: 2px solid #08081a !important;
}

/* Light: borde blanco sobre fondo claro */
.fi-topbar [class*="badge"]:not(.fi-badge),
header.fi-topbar [class*="badge"]:not(.fi-badge) {
    background: #dc2626 !important;
    border: 2px solid #ffffff !important;
}
