/*
 | ConsultCRM — Branded admin theme
 | White-label: everything keys off Filament's --primary-* brand ramp,
 | so it re-colors automatically when a buyer changes their brand color.
 | Loaded on every panel page via FilamentAsset::register() — no build step.
 */

:root {
    --ca-radius: 0.9rem;
    --ca-radius-sm: 0.6rem;
    --ca-shadow: 0 1px 2px rgba(24, 24, 27, .04), 0 8px 24px -12px rgba(24, 24, 27, .12);
    --ca-shadow-lg: 0 1px 2px rgba(24, 24, 27, .05), 0 18px 40px -20px rgba(24, 24, 27, .22);
    --ca-sidebar: linear-gradient(180deg, #0f172a 0%, #111827 55%, #0b1220 100%);
}

/* ------------------------------------------------------------------ *
 * Page canvas
 * ------------------------------------------------------------------ */
.fi-body,
.fi-main-ctn {
    background-color: rgb(var(--gray-50));
    background-image:
        radial-gradient(60rem 60rem at 110% -10%, rgba(var(--primary-500), .06), transparent 55%),
        radial-gradient(50rem 50rem at -10% 0%, rgba(var(--primary-500), .05), transparent 50%);
}
.dark .fi-body,
.dark .fi-main-ctn {
    background-color: rgb(var(--gray-950));
    background-image:
        radial-gradient(60rem 60rem at 110% -10%, rgba(var(--primary-500), .10), transparent 55%);
}
.fi-main {
    max-width: 90rem;
}

/* ------------------------------------------------------------------ *
 * Sidebar — deep branded gradient with primary accents
 * ------------------------------------------------------------------ */
.fi-sidebar,
.fi-sidebar .fi-sidebar-nav {
    background: var(--ca-sidebar);
    border-right: 0;
}
.fi-sidebar {
    box-shadow: 4px 0 24px -18px rgba(0, 0, 0, .6);
}
.fi-sidebar-header {
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
    box-shadow: none;
}
/* Group labels */
.fi-sidebar-group-label {
    color: rgba(255, 255, 255, .38) !important;
    font-size: .68rem;
    letter-spacing: .09em;
    text-transform: uppercase;
}
/* Nav items */
.fi-sidebar-item-button {
    color: rgba(255, 255, 255, .72) !important;
    border-radius: var(--ca-radius-sm);
    margin: 1px .25rem;
    transition: background-color .15s ease, color .15s ease;
}
.fi-sidebar-item-button .fi-sidebar-item-icon {
    color: rgba(255, 255, 255, .55) !important;
}
.fi-sidebar-item-button:hover {
    background-color: rgba(255, 255, 255, .07) !important;
    color: #fff !important;
}
.fi-sidebar-item-button:hover .fi-sidebar-item-icon {
    color: rgb(var(--primary-400)) !important;
}
/* Active item — solid brand fill, force ALL text/icon white
   (Filament colours the label element primary-600 by default, which would be
   dark-green-on-green and invisible; these !important rules override it). */
.fi-sidebar-item.fi-active .fi-sidebar-item-button {
    background: linear-gradient(90deg, rgb(var(--primary-600)), rgb(var(--primary-500))) !important;
    box-shadow: 0 10px 20px -12px rgba(var(--primary-600), .85);
}
.fi-sidebar-item.fi-active .fi-sidebar-item-button,
.fi-sidebar-item.fi-active .fi-sidebar-item-label,
.fi-sidebar-item.fi-active .fi-sidebar-item-icon {
    color: #fff !important;
    font-weight: 600;
}
/* Labels follow the button colour in every other state too */
.fi-sidebar-item-label {
    color: inherit !important;
}
/* Collapsed-rail tweaks + badges */
.fi-sidebar-item-badge {
    background-color: rgb(var(--primary-500)) !important;
    color: #fff !important;
}
.fi-sidebar .fi-sidebar-group + .fi-sidebar-group {
    margin-top: .35rem;
}

/* ------------------------------------------------------------------ *
 * Topbar
 * ------------------------------------------------------------------ */
.fi-topbar > nav {
    background-color: rgba(255, 255, 255, .82);
    backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid rgb(var(--gray-200));
    box-shadow: var(--ca-shadow);
}
.dark .fi-topbar > nav {
    background-color: rgba(17, 24, 39, .75);
    border-bottom-color: rgb(var(--gray-800));
}

/* ------------------------------------------------------------------ *
 * Cards / sections / widgets — elevation + rounding
 * ------------------------------------------------------------------ */
.fi-section,
.fi-wi-stats-overview-stat,
.fi-ta-ctn,
.fi-fo-component-ctn > .fi-section,
.fi-wi > .fi-section {
    border-radius: var(--ca-radius) !important;
    border: 1px solid rgb(var(--gray-200));
    box-shadow: var(--ca-shadow);
}
.dark .fi-section,
.dark .fi-wi-stats-overview-stat,
.dark .fi-ta-ctn {
    border-color: rgb(var(--gray-800));
}
/* Stat cards: lift on hover + top accent */
.fi-wi-stats-overview-stat {
    position: relative;
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease;
}
.fi-wi-stats-overview-stat::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, rgb(var(--primary-500)), rgba(var(--primary-500), .25));
}
.fi-wi-stats-overview-stat:hover {
    transform: translateY(-3px);
    box-shadow: var(--ca-shadow-lg);
}
.fi-wi-stats-overview-stat-value {
    font-weight: 800;
    letter-spacing: -.02em;
}

/* Section headers a touch stronger */
.fi-section-header-heading {
    font-weight: 700;
    letter-spacing: -.01em;
}

/* ------------------------------------------------------------------ *
 * Buttons — gradient primary + hover lift
 * ------------------------------------------------------------------ */
.fi-btn {
    border-radius: var(--ca-radius-sm);
    font-weight: 600;
    transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.fi-btn.fi-btn-color-primary:not(.fi-btn-outlined) {
    background-image: linear-gradient(180deg, rgb(var(--primary-500)), rgb(var(--primary-600)));
    box-shadow: 0 10px 20px -12px rgba(var(--primary-600), .9);
}
.fi-btn.fi-btn-color-primary:not(.fi-btn-outlined):hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

/* ------------------------------------------------------------------ *
 * Inputs — softer, primary focus ring
 * ------------------------------------------------------------------ */
.fi-input-wrp {
    border-radius: var(--ca-radius-sm);
    transition: box-shadow .15s ease, border-color .15s ease;
}
.fi-input-wrp:focus-within {
    box-shadow: 0 0 0 3px rgba(var(--primary-500), .18);
    border-color: rgb(var(--primary-500));
}

/* Tables ------------------------------------------------------------ */
/* Tighten the (often empty) toolbar band so the card doesn't look hollow */
.fi-ta-header-ctn {
    border-bottom: 1px solid rgb(var(--gray-100));
}
.dark .fi-ta-header-ctn {
    border-bottom-color: rgb(var(--gray-800));
}
.fi-ta-header {
    padding-top: 1rem;
    padding-bottom: 1rem;
}
/* Column headers */
.fi-ta-header-cell {
    background-color: rgb(var(--gray-50));
    text-transform: uppercase;
    letter-spacing: .05em;
    font-size: .7rem;
    font-weight: 700;
    color: rgb(var(--gray-500));
}
.dark .fi-ta-header-cell {
    background-color: rgb(var(--gray-900));
}
/* Zebra rows + hover for readability on wide tables */
.fi-ta-row:nth-of-type(even) {
    background-color: rgba(var(--gray-500), .035);
}
.dark .fi-ta-row:nth-of-type(even) {
    background-color: rgba(255, 255, 255, .02);
}
.fi-ta-row:hover {
    background-color: rgba(var(--primary-500), .06) !important;
}
/* Give the search field the same rounded, branded treatment */
.fi-ta-search-field .fi-input-wrp {
    box-shadow: var(--ca-shadow);
}
/* Pagination footer breathing room */
.fi-ta-pagination {
    padding-top: .85rem;
    padding-bottom: .85rem;
}

/* Tabs active underline in brand */
.fi-tabs-item.fi-active {
    color: rgb(var(--primary-600));
}

/* ------------------------------------------------------------------ *
 * Login (simple) page — split screen: photo panel + elevated form card
 * ------------------------------------------------------------------ */
.fi-simple-layout {
    background:
        radial-gradient(40rem 40rem at 15% 10%, rgba(var(--primary-500), .18), transparent 55%),
        radial-gradient(46rem 46rem at 100% 100%, rgba(var(--primary-600), .16), transparent 55%),
        linear-gradient(160deg, rgb(var(--gray-50)), rgb(var(--gray-100)));
}
.dark .fi-simple-layout {
    background:
        radial-gradient(40rem 40rem at 15% 10%, rgba(var(--primary-500), .22), transparent 55%),
        linear-gradient(160deg, rgb(var(--gray-950)), #0b1220);
}
.fi-simple-main {
    border-radius: 1.25rem !important;
    border: 1px solid rgb(var(--gray-200));
    box-shadow: var(--ca-shadow-lg);
    background-color: #fff;
}
.dark .fi-simple-main {
    border-color: rgb(var(--gray-800));
    background-color: rgb(var(--gray-900));
}

/* On large screens: fixed photo panel on the left, form centered on the right */
@media (min-width: 1024px) {
    .fi-simple-layout::before {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 50vw;
        background-color: #0f172a;
        background-image:
            linear-gradient(to top, rgba(0, 0, 0, .75) 0%, rgba(0, 0, 0, .2) 45%, rgba(0, 0, 0, .15) 100%),
            radial-gradient(32rem 32rem at 22% 16%, rgba(var(--primary-500), .5), transparent 60%),
            var(--ca-login-image, none);
        background-size: cover, cover, cover;
        background-position: center;
        background-repeat: no-repeat;
        box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
    }
    .fi-simple-layout {
        padding-left: 50vw;
    }
    .fi-simple-page {
        width: 100%;
    }
}

/* Scrollbar polish */
.fi-sidebar-nav::-webkit-scrollbar { width: 8px; }
.fi-sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .14);
    border-radius: 8px;
}
