/* ==========================================================================
   Zain Marketing Admin — custom theme
   Layered on top of Filament's default theme: brand gradient accents,
   glassy sidebar, richer stat/table cards, and a branded login screen.
   ========================================================================== */

:root {
    --zain-marketing-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    --zain-marketing-gradient-soft: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(236, 72, 153, 0.12) 100%);
}

/* ---- Sidebar ------------------------------------------------------------ */

.fi-sidebar {
    border-inline-end-width: 0;
    background-color: #fff !important;
    box-shadow: 1px 0 0 0 rgba(0, 0, 0, 0.06), 4px 0 24px -8px rgba(99, 102, 241, 0.15);
}

:root.dark .fi-sidebar {
    background-color: #18181b !important;
}

.fi-sidebar-header {
    background: var(--zain-marketing-gradient) !important;
    box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.08), 0 4px 14px -6px rgba(99, 102, 241, 0.55) !important;
    border: none !important;
}

.fi-sidebar-header .fi-logo {
    color: #fff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.fi-sidebar-header .fi-icon-btn {
    color: rgba(255, 255, 255, 0.85) !important;
}

.fi-sidebar-header .fi-icon-btn:hover {
    color: #fff !important;
}

.fi-sidebar-nav-groups {
    gap: 1.25rem;
}

.fi-sidebar-group-label {
    font-weight: 700 !important;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.65rem;
    background: var(--zain-marketing-gradient) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    color: transparent !important;
    opacity: 0.9;
}

.fi-sidebar-item-button {
    border-radius: 0.65rem;
    transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.fi-sidebar-item-button:hover {
    transform: translateX(2px);
}

.fi-sidebar-item-active .fi-sidebar-item-button {
    background: var(--zain-marketing-gradient);
    box-shadow: 0 4px 14px -4px rgba(99, 102, 241, 0.55);
}

.fi-sidebar-item-active .fi-sidebar-item-button,
.fi-sidebar-item-active .fi-sidebar-item-button .fi-sidebar-item-icon,
.fi-sidebar-item-active .fi-sidebar-item-button .fi-sidebar-item-label {
    color: #fff !important;
}

/* ---- Topbar -------------------------------------------------------------- */

.fi-topbar {
    backdrop-filter: blur(8px);
    background-color: rgba(255, 255, 255, 0.75) !important;
}

:root.dark .fi-topbar {
    background-color: rgba(24, 24, 27, 0.7) !important;
}

/* ---- Dashboard: white content background ---------------------------------- */

.fi-dashboard-page {
    background-color: #fff !important;
    border-radius: 1rem;
    padding: 1.5rem;
}

:root.dark .fi-dashboard-page {
    background-color: #18181b !important;
}

/* ---- White page background everywhere (not just the dashboard) ----------- */

.fi-body {
    background-color: #fff !important;
}

:root.dark .fi-body {
    background-color: #18181b !important;
}

/* ---- Cards / panels ------------------------------------------------------ */

.fi-section,
.fi-in-card,
.fi-ta-ctn,
.fi-wi-stats-overview-stat {
    border-radius: 1rem !important;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.fi-section:hover,
.fi-wi-stats-overview-stat:hover {
    box-shadow: 0 12px 28px -12px rgba(99, 102, 241, 0.25);
}

/* ---- Charts: force the canvas to actually fill its card, not just cap it -- */

.fi-wi-chart .fi-section-content-ctn {
    display: flex;
    flex-direction: column;
}

.fi-wi-chart .fi-section-content-ctn > div,
.fi-wi-chart .fi-section-content-ctn > div > div {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 340px;
    position: relative;
}

.fi-wi-chart canvas {
    flex: 1;
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
}

/* ---- Stat widgets: gradient top border + icon halo ----------------------- */

.fi-wi-stats-overview-stat {
    position: relative;
    overflow: hidden;
}

.fi-wi-stats-overview-stat::before {
    content: '';
    position: absolute;
    inset-inline: 0;
    top: 0;
    height: 4px;
    background: var(--zain-marketing-gradient);
}

.fi-wi-stats-overview-stat-icon {
    border-radius: 0.75rem !important;
    box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.15);
}

/* ---- "Status" stat tiles (e.g. Cancellations & Returns): the whole card
   reads as green/amber/red — not just the description text — while keeping
   the same left-aligned layout every other stat tile uses. */

.zm-stat-status:has(.fi-color-success)::before {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important;
}

.zm-stat-status:has(.fi-color-success) .fi-wi-stats-overview-stat-value {
    color: #16a34a !important;
}

:root.dark .zm-stat-status:has(.fi-color-success) .fi-wi-stats-overview-stat-value {
    color: #4ade80 !important;
}

.zm-stat-status:has(.fi-color-warning)::before {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
}

.zm-stat-status:has(.fi-color-danger)::before {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
}

/* ---- Sidebar nav badges: hint that they're hoverable for a tooltip -------- */

.fi-sidebar-item .fi-badge {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    cursor: default;
}

.fi-sidebar-item .fi-badge:hover {
    transform: scale(1.12);
    box-shadow: 0 4px 10px -3px rgba(99, 102, 241, 0.5);
}

/* ---- Tables --------------------------------------------------------------- */

.fi-ta-row {
    transition: background-color 0.12s ease;
}

.fi-ta-row:hover {
    background: var(--zain-marketing-gradient-soft) !important;
}

.fi-ta-header-cell {
    font-weight: 700 !important;
}

.fi-badge {
    font-weight: 600 !important;
}

/* ---- Buttons ---------------------------------------------------------------- */

.fi-btn[data-color="primary"],
.fi-btn.fi-color-primary {
    background: var(--zain-marketing-gradient) !important;
    border: none !important;
}

.fi-btn[data-color="primary"]:hover,
.fi-btn.fi-color-primary:hover {
    filter: brightness(1.08);
}

/* ---- Login / auth pages ---------------------------------------------------- */

.fi-simple-layout {
    position: relative;
    min-height: 100dvh;
    background: radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.25), transparent 45%),
        radial-gradient(circle at 85% 85%, rgba(236, 72, 153, 0.22), transparent 45%),
        linear-gradient(160deg, #0f0b2e 0%, #1e1b4b 45%, #3b0764 100%);
}

.fi-simple-layout .fi-simple-main {
    backdrop-filter: blur(14px);
    background-color: rgba(255, 255, 255, 0.92);
    border-radius: 1.25rem !important;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

:root.dark .fi-simple-layout .fi-simple-main {
    background-color: rgba(24, 24, 27, 0.85);
    border-color: rgba(255, 255, 255, 0.08);
}

.fi-simple-layout .fi-logo {
    background: var(--zain-marketing-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* ---- Brand name next to the logo: white on the sidebar's purple header,
   gradient text on the login page's white/light card (was hardcoded white
   in both places, making it invisible on login). ------------------------- */

.zm-brand-name {
    color: #fff;
}

.fi-simple-layout .zm-brand-name {
    background: var(--zain-marketing-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.fi-simple-layout .fi-simple-header-heading {
    background: var(--zain-marketing-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ---- Typography: slightly larger, easier to read -------------------------- */

.fi-sidebar-item-label {
    font-size: 0.9rem !important;
}

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

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

.fi-ta-header-cell-label {
    font-size: 0.8rem !important;
}

.fi-ta-text,
.fi-ta-cell .fi-ta-text-item,
.fi-in-entry-wrp,
.fi-fo-field-wrp-label,
.fi-input,
.fi-select-input,
textarea.fi-input {
    font-size: 0.925rem !important;
}

.fi-wi-stats-overview-stat-label {
    font-size: 0.8rem !important;
}

.fi-wi-stats-overview-stat-value {
    font-size: 1.75rem !important;
}

/* ---- Extra color accents on cards and sections ----------------------------- */

.fi-section-header {
    border-start-start-radius: 1rem;
    border-start-end-radius: 1rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(236, 72, 153, 0.06)) !important;
    border-bottom: 1px solid rgba(99, 102, 241, 0.18) !important;
}

.fi-section-header-heading {
    color: #4338ca !important;
    font-weight: 700 !important;
}

:root.dark .fi-section-header {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.16), rgba(236, 72, 153, 0.12)) !important;
    border-bottom-color: rgba(129, 140, 248, 0.3) !important;
}

:root.dark .fi-section-header-heading {
    color: #a5b4fc !important;
}

.fi-section-content-ctn {
    border-start-start-radius: inherit;
    border-start-end-radius: inherit;
}

.fi-section {
    border-inline-start: 3px solid transparent !important;
    border-image: var(--zain-marketing-gradient) 1 !important;
}

.fi-modal-window,
.fi-modal-content {
    border-radius: 1rem !important;
}

/* ---- Scrollbar -------------------------------------------------------------- */

* {
    scrollbar-width: thin;
    scrollbar-color: #8b5cf6 transparent;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-thumb {
    background: var(--zain-marketing-gradient);
    border-radius: 999px;
}
