/* CrediFast Admin Panel — brand v4 */

:root {
    --cf-primary: #00C896;
    --cf-primary-dim: rgba(0, 200, 150, 0.12);
    --cf-bg-deep: #05080f;
    --cf-bg-panel: #0A1628;
    --cf-bg-elevated: #111f35;
    --cf-border: rgba(255, 255, 255, 0.06);
    --cf-font: "Plus Jakarta Sans", system-ui, sans-serif;
    --cf-display: Poppins, "Plus Jakarta Sans", sans-serif;
}

/* Base typography */
.fi-panel-admin,
.fi-panel-admin .fi-body {
    font-family: var(--cf-font) !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.fi-body.fi-panel-admin:not(.fi-simple-layout) {
    background: var(--cf-bg-deep) !important;
}

/* Ambient mesh behind content */
.fi-panel-admin .fi-main-ctn {
    position: relative;
}

.fi-panel-admin .fi-main-ctn::before {
    content: "";
    position: fixed;
    inset: 0;
    left: 17rem;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 55% 45% at 85% 8%, rgba(0, 200, 150, 0.07) 0%, transparent 55%),
        radial-gradient(ellipse 40% 35% at 15% 75%, rgba(26, 140, 255, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse 30% 25% at 60% 50%, rgba(0, 200, 150, 0.03) 0%, transparent 45%);
}

.fi-panel-admin .fi-main {
    position: relative;
    z-index: 1;
}

/* Sidebar */
.fi-panel-admin .fi-sidebar {
    background: linear-gradient(180deg, #0c1a30 0%, #071018 55%, #050a12 100%) !important;
    border-right: 1px solid rgba(0, 200, 150, 0.1) !important;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.35);
}

.fi-panel-admin .fi-sidebar-header {
    padding: 1.15rem 1rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}

.fi-panel-admin .fi-sidebar-header .fi-logo {
    gap: 0.55rem !important;
}

.fi-panel-admin .fi-sidebar-header .fi-logo img {
    filter: drop-shadow(0 2px 10px rgba(0, 200, 150, 0.35));
}

.fi-panel-admin .fi-logo {
    font-family: var(--cf-display) !important;
    font-weight: 700 !important;
    font-size: 1.05rem !important;
    letter-spacing: -0.03em;
}

.fi-panel-admin .fi-logo span {
    background: linear-gradient(90deg, #e8fff8 0%, var(--cf-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Nav groups */
.fi-panel-admin .fi-sidebar-group-label {
    font-family: var(--cf-font) !important;
    font-size: 0.62rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.14em !important;
    text-transform: uppercase !important;
    color: rgba(0, 200, 150, 0.55) !important;
    padding-left: 0.15rem !important;
}

.fi-panel-admin .fi-sidebar-item-button {
    border-radius: 10px !important;
    font-weight: 500 !important;
    font-size: 0.875rem !important;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.fi-panel-admin .fi-sidebar-item-active > .fi-sidebar-item-button {
    background: linear-gradient(90deg, rgba(0, 200, 150, 0.18) 0%, rgba(0, 200, 150, 0.06) 100%) !important;
    color: var(--cf-primary) !important;
    box-shadow: inset 3px 0 0 var(--cf-primary);
}

.fi-panel-admin .fi-sidebar-item-button:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

.fi-panel-admin .fi-sidebar-item-icon {
    color: rgba(255, 255, 255, 0.45) !important;
}

.fi-panel-admin .fi-sidebar-item-active .fi-sidebar-item-icon {
    color: var(--cf-primary) !important;
}

/* Sidebar footer */
.cf-sidebar-footer {
    padding: 0.85rem 1rem 1rem;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.cf-sidebar-footer__tagline {
    font-family: var(--cf-display);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--cf-primary);
    margin: 0 0 0.2rem;
    opacity: 0.85;
}

.cf-sidebar-footer__meta {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.3);
    margin: 0;
}

/* Topbar */
.fi-panel-admin .fi-topbar {
    background: rgba(8, 16, 28, 0.88) !important;
    backdrop-filter: blur(16px) saturate(1.2);
    border-bottom: 1px solid rgba(0, 200, 150, 0.08) !important;
}

.fi-panel-admin .fi-topbar .fi-user-menu-trigger {
    border: 1px solid rgba(0, 200, 150, 0.2) !important;
    box-shadow: 0 0 0 2px rgba(0, 200, 150, 0.06);
}

/* Page headers */
.fi-panel-admin .fi-header-heading,
.fi-panel-admin .fi-page-header-heading {
    font-family: var(--cf-display) !important;
    font-weight: 700 !important;
    font-size: 1.65rem !important;
    letter-spacing: -0.03em !important;
    color: #f8fafc !important;
}

.fi-panel-admin .fi-header-subheading,
.fi-panel-admin .fi-page-header-subheading {
    font-size: 0.85rem !important;
    color: rgba(255, 255, 255, 0.45) !important;
}

/* Sections & cards */
.fi-panel-admin .fi-section,
.fi-panel-admin .fi-ta-ctn {
    background: linear-gradient(155deg, rgba(17, 31, 53, 0.65) 0%, rgba(10, 22, 40, 0.9) 100%) !important;
    border: 1px solid var(--cf-border) !important;
    border-radius: 14px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22) !important;
}

.fi-panel-admin .fi-section-header-heading {
    font-family: var(--cf-display) !important;
    font-weight: 600 !important;
    letter-spacing: -0.02em;
}

/* Stat cards — KPI */
.fi-panel-admin .fi-wi-stats-overview-stat {
    background: linear-gradient(145deg, rgba(22, 38, 62, 0.7) 0%, rgba(10, 22, 40, 0.92) 100%) !important;
    border: 1px solid var(--cf-border) !important;
    border-radius: 14px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28) !important;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
    position: relative;
}

.fi-panel-admin .fi-wi-stats-overview-stat::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 5rem;
    height: 5rem;
    background: radial-gradient(circle at 100% 0%, rgba(0, 200, 150, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.fi-panel-admin .fi-wi-stats-overview-stat:hover {
    border-color: rgba(0, 200, 150, 0.22) !important;
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 200, 150, 0.08) !important;
}

.fi-panel-admin .fi-wi-stats-overview-stat-label {
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    color: rgba(255, 255, 255, 0.55) !important;
    letter-spacing: 0.01em;
}

.fi-panel-admin .fi-wi-stats-overview-stat-value {
    font-family: var(--cf-display) !important;
    font-weight: 700 !important;
    font-size: 1.65rem !important;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
    color: #f1f5f9 !important;
}

.fi-panel-admin .fi-wi-stats-overview-stat-description {
    font-size: 0.72rem !important;
    color: rgba(255, 255, 255, 0.38) !important;
}

.fi-panel-admin .fi-wi-stats-overview-stat-chart {
    opacity: 0.9;
}

/* Chart widgets */
.fi-panel-admin .fi-wi-chart {
    background: linear-gradient(145deg, rgba(22, 38, 62, 0.55) 0%, rgba(10, 22, 40, 0.88) 100%) !important;
    border: 1px solid var(--cf-border) !important;
    border-radius: 14px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22) !important;
}

.fi-panel-admin .fi-wi-chart .fi-section-header-heading {
    font-family: var(--cf-display) !important;
    font-weight: 600 !important;
}

/* Buttons */
.fi-panel-admin .fi-btn-primary {
    font-weight: 600 !important;
    letter-spacing: 0.01em;
    box-shadow: 0 4px 14px rgba(0, 200, 150, 0.25) !important;
}

.fi-panel-admin .fi-btn-primary:hover {
    box-shadow: 0 6px 20px rgba(0, 200, 150, 0.35) !important;
}

/* Tables */
.fi-panel-admin .fi-ta-header-cell {
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.06em !important;
    text-transform: uppercase !important;
    color: rgba(255, 255, 255, 0.45) !important;
}

.fi-panel-admin .fi-ta-row:hover {
    background: rgba(0, 200, 150, 0.04) !important;
}

/* Custom widgets */
.fi-panel-admin .fi-wi-widget .cf-panel,
.fi-panel-admin .fi-wi-widget .cf-hero {
    border-radius: 16px;
}

/* Hero */
.cf-hero {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 1.5rem 2rem;
    padding: 1.65rem 1.85rem;
    background:
        linear-gradient(125deg, rgba(0, 200, 150, 0.1) 0%, transparent 40%),
        linear-gradient(180deg, rgba(14, 28, 48, 0.95) 0%, rgba(6, 12, 22, 0.98) 100%);
    border: 1px solid rgba(0, 200, 150, 0.18);
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    width: 100%;
    position: relative;
    overflow: hidden;
}

.cf-hero::before {
    content: "";
    position: absolute;
    top: -40%;
    right: -10%;
    width: 45%;
    height: 140%;
    background: radial-gradient(ellipse, rgba(0, 200, 150, 0.08) 0%, transparent 65%);
    pointer-events: none;
}

.cf-hero__saludo {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    color: rgba(0, 200, 150, 0.75);
    margin-bottom: 0.2rem;
    letter-spacing: 0.02em;
}

.cf-hero__name {
    font-family: var(--cf-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: #f9fafb;
    margin: 0;
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.cf-hero__date {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.42);
    margin: 0.4rem 0 0.85rem;
    text-transform: capitalize;
}

.cf-hero__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.cf-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.7rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: capitalize;
}

.cf-badge--scope {
    background: rgba(0, 200, 150, 0.15);
    color: #00C896;
    border: 1px solid rgba(0, 200, 150, 0.28);
}

.cf-badge--branch {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.22);
}

.cf-badge--role {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.cf-badge--muted {
    background: transparent;
    color: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.cf-hero__stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(5rem, 1fr));
    gap: 0.75rem;
    align-items: stretch;
}

.cf-hero-stat {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 5.5rem;
    padding: 0.9rem 1rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    text-align: center;
    backdrop-filter: blur(4px);
}

.cf-hero-stat__value {
    font-family: var(--cf-display);
    font-size: 1.55rem;
    font-weight: 700;
    color: #00C896;
    line-height: 1;
    letter-spacing: -0.02em;
}

.cf-hero-stat__label {
    font-size: 0.62rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.42);
    margin-top: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

/* Panels */
.cf-panel {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(145deg, rgba(22, 38, 62, 0.5) 0%, rgba(10, 22, 40, 0.88) 100%);
    border: 1px solid var(--cf-border);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
    height: 100%;
}

.cf-panel__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.cf-panel__title {
    font-family: var(--cf-display);
    font-size: 1rem;
    font-weight: 600;
    color: #f9fafb;
    margin: 0;
    letter-spacing: -0.02em;
}

.cf-panel__subtitle {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    margin: 0.15rem 0 0;
}

.cf-panel__pill {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    background: rgba(0, 200, 150, 0.12);
    color: #00C896;
    border: 1px solid rgba(0, 200, 150, 0.2);
    white-space: nowrap;
}

.cf-panel__pill--ai {
    background: rgba(139, 92, 246, 0.12);
    color: #a78bfa;
    border-color: rgba(139, 92, 246, 0.25);
}

/* Alerts */
.cf-alerts {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.cf-alert {
    display: flex;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.cf-alert__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    flex-shrink: 0;
}

.cf-alert--warning .cf-alert__icon { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.cf-alert--primary .cf-alert__icon { background: rgba(0, 200, 150, 0.15); color: #00C896; }
.cf-alert--info .cf-alert__icon { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.cf-alert--danger .cf-alert__icon { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

.cf-alert__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.cf-alert__title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #f3f4f6;
}

.cf-alert__count {
    font-family: var(--cf-display);
    font-size: 1rem;
    font-weight: 700;
    color: #00C896;
}

.cf-alert__detail {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
    margin: 0.2rem 0 0;
}

/* Briefing */
.cf-briefing {
    font-size: 0.85rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.72);
    margin: 0;
}

/* Activity */
.cf-activity {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.cf-activity__item {
    display: flex;
    gap: 0.85rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.cf-activity__item:last-child {
    border-bottom: none;
}

.cf-activity__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00C896;
    margin-top: 0.45rem;
    flex-shrink: 0;
    box-shadow: 0 0 8px rgba(0, 200, 150, 0.5);
}

.cf-activity__top {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.cf-activity__action {
    font-size: 0.85rem;
    font-weight: 500;
    color: #f3f4f6;
    text-transform: capitalize;
}

.cf-activity__time {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.35);
    white-space: nowrap;
}

.cf-activity__meta {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    margin: 0.15rem 0 0;
}

.cf-empty {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    margin: 0;
    padding: 0.5rem 0;
}

@media (max-width: 1024px) {
    .fi-panel-admin .fi-main-ctn::before {
        left: 0;
    }

    .cf-hero {
        grid-template-columns: 1fr;
    }

    .cf-hero__stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .cf-hero {
        padding: 1.25rem;
    }

    .cf-hero__stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .cf-hero-stat {
        min-width: 0;
    }
}
