/* =====================================================================
   CYL ENVIROCONSULT — MODERN ADMIN THEME
   Brand: Deep Green (#1B5E20) + Amber Gold (#F9A825)
   Design: Floating sidebar, sticky topbar, pill nav, glassmorphism
   ===================================================================== */

/* ── GOOGLE FONTS ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── GLOBAL BODY ── */
body.fi-body {
    font-family: 'Inter', sans-serif !important;
    background-color: #eef2f7 !important;
}
body.dark.fi-body {
    background-color: #0a0f1a !important;
}

/* =====================================================================
   1. LOGIN PAGE – MESH GRADIENT BACKGROUND
   ===================================================================== */
.fi-simple-layout {
    min-height: 100vh;
    background-color: #eef2f7 !important;
    background-image:
        radial-gradient(ellipse at 0% 0%,   rgba(27, 94, 32, 0.35)  0%, transparent 55%),
        radial-gradient(ellipse at 100% 0%,  rgba(249, 168, 37, 0.25) 0%, transparent 55%),
        radial-gradient(ellipse at 100% 100%, rgba(27, 94, 32, 0.25)  0%, transparent 55%),
        radial-gradient(ellipse at 0% 100%,  rgba(249, 168, 37, 0.15) 0%, transparent 55%) !important;
}
.dark .fi-simple-layout {
    background-color: #071008 !important;
    background-image:
        radial-gradient(ellipse at 0% 0%,   rgba(27, 94, 32, 0.45)  0%, transparent 55%),
        radial-gradient(ellipse at 100% 0%,  rgba(249, 168, 37, 0.20) 0%, transparent 55%),
        radial-gradient(ellipse at 100% 100%, rgba(27, 94, 32, 0.30)  0%, transparent 55%),
        radial-gradient(ellipse at 0% 100%,  rgba(7, 16, 8, 1) 0%, transparent 55%) !important;
}

/* Login card */
.fi-simple-main {
    background: rgba(255, 255, 255, 0.88) !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    box-shadow: 0 24px 60px -12px rgba(27, 94, 32, 0.18), 0 8px 20px -8px rgba(0,0,0,0.08) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-radius: 1.5rem !important;
}
.dark .fi-simple-main {
    background: rgba(10, 20, 12, 0.80) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.6) !important;
}

/* Logo */
.fi-sidebar-header .fi-logo {
    display: block !important;
    margin: 0 auto 1.25rem auto !important;
}
.fi-logo {
    background: #fff !important;
    padding: 6px !important;
    border-radius: 10px !important;
    box-shadow: 0 8px 24px -4px rgba(27, 94, 32, 0.2) !important;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.fi-logo:hover { transform: scale(1.05) translateY(-2px) !important; }

/* Login button */
.fi-simple-page button[type="submit"] {
    background: linear-gradient(135deg, #1B5E20 0%, #2E7D32 100%) !important;
    border: none !important;
    border-radius: 0.75rem !important;
    color: #fff !important;
    font-weight: 700 !important;
    box-shadow: 0 8px 20px -4px rgba(27, 94, 32, 0.40) !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.fi-simple-page button[type="submit"]:hover {
    background: linear-gradient(135deg, #2E7D32 0%, #388E3C 100%) !important;
    box-shadow: 0 12px 28px -4px rgba(27, 94, 32, 0.50) !important;
    transform: translateY(-2px) !important;
}

/* =====================================================================
   2. MAIN LAYOUT WRAPPER
   ===================================================================== */
.fi-body-has-navigation .fi-layout {
    background-color: #eef2f7 !important;
    min-height: 100vh;
}
.dark .fi-body-has-navigation .fi-layout {
    background-color: #0a0f1a !important;
}

/* =====================================================================
   3. FIXED FLOATING SIDEBAR
   The sidebar uses position: sticky/fixed with margin so it "floats".
   Sidebar + topbar will NOT scroll with page content.
   ===================================================================== */

/* Sidebar container itself */
.fi-sidebar.fi-main-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    height: 100vh !important;
    z-index: 50 !important;
    width: 17rem !important;

    /* Floating look */
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    border-right: none !important;
    border-radius: 0 1.5rem 1.5rem 0 !important;
    box-shadow: 6px 0 40px -8px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(226,232,240,0.5) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    display: flex !important;
    flex-direction: column !important;
}
.dark .fi-sidebar.fi-main-sidebar {
    background: rgba(12, 22, 14, 0.92) !important;
    box-shadow: 6px 0 40px -8px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.05) !important;
    border-radius: 0 1.5rem 1.5rem 0 !important;
}

/* When sidebar collapses on desktop keep same border radius */
.fi-sidebar.fi-main-sidebar:not(.fi-sidebar-open) {
    width: 5rem !important;
}

/* Mobile – full width no radius */
@media (max-width: 1023px) {
    .fi-sidebar.fi-main-sidebar {
        border-radius: 0 !important;
        width: 17rem !important;
    }
}

/* Sidebar header */
.fi-sidebar-header {
    background: transparent !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6) !important;
    padding: 1.1rem 1rem !important;
    flex-shrink: 0 !important;
}
.dark .fi-sidebar-header {
    border-bottom: 1px solid rgba(255,255,255,0.05) !important;
}
.fi-sidebar-header img {
    background: #fff !important;
    padding: 3px !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 12px rgba(27, 94, 32, 0.15) !important;
}

/* Sidebar nav grows to fill space */
.fi-sidebar-nav {
    flex: 1 !important;
    padding: 0.5rem 0 !important;
    overflow-y: auto !important;
}

/* ── GROUP LABELS ── */
.fi-sidebar-group-label {
    font-size: 0.625rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.12em !important;
    text-transform: uppercase !important;
    color: #94a3b8 !important;
    padding: 0.6rem 1.25rem 0.3rem !important;
}
.dark .fi-sidebar-group-label {
    color: #475569 !important;
}

/* ── NAV ITEM LINKS – PILL STYLE ── */
.fi-sidebar-item-btn {
    display: flex !important;
    align-items: center !important;
    gap: 0.65rem !important;
    border-radius: 0.75rem !important;
    margin: 0.15rem 0.65rem !important;
    padding: 0.6rem 0.85rem !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    color: #475569 !important;
    text-decoration: none !important;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
    position: relative !important;
}
.dark .fi-sidebar-item-btn {
    color: #94a3b8 !important;
}
.fi-sidebar-item-btn:hover {
    background: rgba(241, 245, 249, 0.9) !important;
    color: #1B5E20 !important;
    transform: translateX(3px) !important;
}
.fi-sidebar-item-btn:hover .fi-sidebar-item-label,
.fi-sidebar-item-btn:hover span {
    color: #1B5E20 !important;
}
.dark .fi-sidebar-item-btn:hover {
    background: rgba(255,255,255,0.06) !important;
    color: #4ade80 !important;
}
.dark .fi-sidebar-item-btn:hover .fi-sidebar-item-label,
.dark .fi-sidebar-item-btn:hover span {
    color: #4ade80 !important;
}

/* ── ACTIVE NAV ITEM ── */
.fi-sidebar-item.fi-active > .fi-sidebar-item-btn,
.fi-sidebar-item-btn.fi-active {
    background: linear-gradient(135deg, #1B5E20 0%, #2E7D32 100%) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 14px -3px rgba(27, 94, 32, 0.45) !important;
    border-left: none !important;
}
.fi-sidebar-item.fi-active .fi-sidebar-item-label,
.fi-sidebar-item.fi-active span,
.fi-sidebar-item-btn.fi-active .fi-sidebar-item-label,
.fi-sidebar-item-btn.fi-active span {
    color: #ffffff !important;
}
.dark .fi-sidebar-item.fi-active > .fi-sidebar-item-btn,
.dark .fi-sidebar-item-btn.fi-active {
    background: rgba(27, 94, 32, 0.35) !important;
    color: #4ade80 !important;
    border: 1px solid rgba(74, 222, 128, 0.2) !important;
}
.dark .fi-sidebar-item.fi-active .fi-sidebar-item-label,
.dark .fi-sidebar-item.fi-active span,
.dark .fi-sidebar-item-btn.fi-active .fi-sidebar-item-label,
.dark .fi-sidebar-item-btn.fi-active span {
    color: #4ade80 !important;
}

/* Active icon */
.fi-sidebar-item.fi-active .fi-sidebar-item-icon,
.fi-sidebar-item-btn.fi-active .fi-sidebar-item-icon {
    color: #ffffff !important;
}
.dark .fi-sidebar-item.fi-active .fi-sidebar-item-icon,
.dark .fi-sidebar-item-btn.fi-active .fi-sidebar-item-icon {
    color: #4ade80 !important;
}

/* Regular icon */
.fi-sidebar-item-btn .fi-sidebar-item-icon {
    width: 1.25rem !important;
    height: 1.25rem !important;
    flex-shrink: 0 !important;
    color: #94a3b8 !important;
    transition: color 0.2s !important;
}
.fi-sidebar-item-btn:hover .fi-sidebar-item-icon {
    color: #1B5E20 !important;
}
.dark .fi-sidebar-item-btn:hover .fi-sidebar-item-icon {
    color: #4ade80 !important;
}

/* ── SIDEBAR FOOTER ── */
.fi-sidebar-footer {
    border-top: 1px solid rgba(226, 232, 240, 0.6) !important;
    padding: 0.75rem !important;
    flex-shrink: 0 !important;
}
.dark .fi-sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.05) !important;
}

/* =====================================================================
   4. TOPBAR — FIXED STICKY FROSTED GLASS
   ===================================================================== */
.fi-topbar-ctn {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    left: 17rem !important;          /* matches sidebar width */
    z-index: 40 !important;
    padding: 0.65rem 1.25rem 0.65rem 1.25rem !important;
    pointer-events: none !important;
}
.fi-topbar-ctn .fi-topbar {
    pointer-events: auto !important;
}

/* Collapsed sidebar adjustment */
@media (min-width: 1024px) {
    body.fi-body-has-sidebar-collapsible-on-desktop .fi-topbar-ctn {
        transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    }
}

/* Mobile topbar spans full width */
@media (max-width: 1023px) {
    .fi-topbar-ctn {
        left: 0 !important;
        padding: 0.5rem 0.75rem !important;
    }
}

/* The actual nav bar */
.fi-topbar {
    background: rgba(255, 255, 255, 0.82) !important;
    backdrop-filter: blur(18px) !important;
    -webkit-backdrop-filter: blur(18px) !important;
    border: 1px solid rgba(226, 232, 240, 0.5) !important;
    border-radius: 1rem !important;
    box-shadow: 0 4px 24px -8px rgba(0, 0, 0, 0.06) !important;
    height: 3.5rem !important;
    display: flex !important;
    align-items: center !important;
    padding: 0 1rem !important;
}
.dark .fi-topbar {
    background: rgba(10, 20, 12, 0.80) !important;
    border: 1px solid rgba(255,255,255,0.06) !important;
    box-shadow: 0 4px 24px -8px rgba(0,0,0,0.4) !important;
}

/* =====================================================================
   5. MAIN CONTENT AREA — offset for fixed sidebar + topbar
   ===================================================================== */
.fi-main-ctn {
    margin-left: 17rem !important;
    padding-top: 5.25rem !important;  /* topbar height + gap */
    min-height: 100vh !important;
    transition: margin-left 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

@media (max-width: 1023px) {
    .fi-main-ctn {
        margin-left: 0 !important;
        padding-top: 5rem !important;
    }
}

/* Main area */
.fi-main {
    background-color: transparent !important;
    padding: 1.5rem !important;
}

/* =====================================================================
   6. DASHBOARD CARDS & WIDGETS
   ===================================================================== */
.fi-wi-stats-overview-stat {
    background: #ffffff !important;
    border: 1px solid rgba(226, 232, 240, 0.7) !important;
    border-radius: 1.25rem !important;
    box-shadow: 0 4px 24px -8px rgba(0, 0, 0, 0.05) !important;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
    overflow: hidden !important;
}
.fi-wi-stats-overview-stat:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 16px 40px -10px rgba(27, 94, 32, 0.14) !important;
    border-color: rgba(27, 94, 32, 0.2) !important;
}
.dark .fi-wi-stats-overview-stat {
    background: rgba(15, 30, 17, 0.6) !important;
    border: 1px solid rgba(255,255,255,0.06) !important;
    box-shadow: 0 4px 24px -8px rgba(0, 0, 0, 0.4) !important;
}
.dark .fi-wi-stats-overview-stat:hover {
    box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.6) !important;
    border-color: rgba(74, 222, 128, 0.2) !important;
}

/* Color-coded bottom border accents on stat cards */
.fi-wi-stats-overview .fi-grid > *:nth-child(1) .fi-wi-stats-overview-stat { border-bottom: 3px solid #1B5E20 !important; }
.fi-wi-stats-overview .fi-grid > *:nth-child(2) .fi-wi-stats-overview-stat { border-bottom: 3px solid #F9A825 !important; }
.fi-wi-stats-overview .fi-grid > *:nth-child(3) .fi-wi-stats-overview-stat { border-bottom: 3px solid #3b82f6 !important; }
.fi-wi-stats-overview .fi-grid > *:nth-child(4) .fi-wi-stats-overview-stat { border-bottom: 3px solid #8b5cf6 !important; }

/* Stat values */
.fi-wi-stats-overview .fi-grid > *:nth-child(1) [class*="fi-wi-stats-overview-stat-value"] { color: #1B5E20 !important; font-weight: 800 !important; }
.fi-wi-stats-overview .fi-grid > *:nth-child(2) [class*="fi-wi-stats-overview-stat-value"] { color: #d97706 !important; font-weight: 800 !important; }
.fi-wi-stats-overview .fi-grid > *:nth-child(3) [class*="fi-wi-stats-overview-stat-value"] { color: #2563eb !important; font-weight: 800 !important; }
.fi-wi-stats-overview .fi-grid > *:nth-child(4) [class*="fi-wi-stats-overview-stat-value"] { color: #7c3aed !important; font-weight: 800 !important; }

/* =====================================================================
   7. TABLES
   ===================================================================== */
.fi-ta-ctn {
    background: #ffffff !important;
    border: 1px solid rgba(226, 232, 240, 0.7) !important;
    border-radius: 1.25rem !important;
    box-shadow: 0 4px 24px -8px rgba(0, 0, 0, 0.04) !important;
    overflow: hidden !important;
}
.dark .fi-ta-ctn {
    background: rgba(12, 22, 14, 0.55) !important;
    border: 1px solid rgba(255,255,255,0.05) !important;
}

/* Table header row */
.fi-ta-header-cell {
    background: #f8fafc !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.06em !important;
    text-transform: uppercase !important;
    color: #64748b !important;
}
.dark .fi-ta-header-cell {
    background: rgba(15, 30, 17, 0.6) !important;
    color: #475569 !important;
}

/* Table rows */
.fi-ta-row {
    transition: background 0.18s ease !important;
}
.fi-ta-row:hover {
    background: rgba(241, 245, 249, 0.8) !important;
}
.dark .fi-ta-row:hover {
    background: rgba(255,255,255,0.03) !important;
}

/* =====================================================================
   8. BUTTONS (ACTION / PRIMARY)
   ===================================================================== */
.fi-btn.fi-btn-color-primary,
.fi-btn[class*="fi-btn-color-primary"] {
    background: linear-gradient(135deg, #1B5E20 0%, #2E7D32 100%) !important;
    border: none !important;
    border-radius: 0.65rem !important;
    box-shadow: 0 4px 14px -3px rgba(27, 94, 32, 0.40) !important;
    font-weight: 700 !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.fi-btn.fi-btn-color-primary:hover,
.fi-btn[class*="fi-btn-color-primary"]:hover {
    background: linear-gradient(135deg, #2E7D32 0%, #388E3C 100%) !important;
    box-shadow: 0 8px 20px -4px rgba(27, 94, 32, 0.50) !important;
    transform: translateY(-1px) !important;
}

/* =====================================================================
   9. FORM INPUTS
   ===================================================================== */
.fi-input {
    border-radius: 0.65rem !important;
    border-color: #e2e8f0 !important;
    transition: border-color 0.2s, box-shadow 0.2s !important;
}
.fi-input:focus,
.fi-input-wrp:focus-within {
    border-color: #1B5E20 !important;
    box-shadow: 0 0 0 3px rgba(27, 94, 32, 0.12) !important;
    outline: none !important;
}

/* =====================================================================
   10. SECTION / PAGE HEADINGS
   ===================================================================== */
.fi-header-heading {
    font-size: 1.5rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.025em !important;
    color: #0f172a !important;
}
.dark .fi-header-heading {
    color: #f1f5f9 !important;
}

/* =====================================================================
   11. SIDEBAR NAVIGATION BADGES
   ===================================================================== */
.fi-sidebar-item-badge,
.fi-sidebar-item-badge span,
.fi-sidebar-item .fi-badge,
.fi-sidebar-item .fi-badge span {
    background-color: #ef4444 !important; /* Rich red/danger badge background */
    color: #ffffff !important;           /* High contrast white text */
    font-weight: 800 !important;
    font-size: 0.75rem !important;
    border-radius: 6px !important;       /* Square shape */
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3) !important;
}

/* Badge inside active sidebar item */
.fi-sidebar-item.fi-active .fi-sidebar-item-badge,
.fi-sidebar-item.fi-active .fi-sidebar-item-badge span,
.fi-sidebar-item.fi-active .fi-badge,
.fi-sidebar-item.fi-active .fi-badge span {
    background-color: #fca5a5 !important; /* Solid faded red/pink to prevent green blending */
    color: #7f1d1d !important;             /* Dark red text for high contrast */
    box-shadow: none !important;
}

/* Badge inside dark mode */
.dark .fi-sidebar-item-badge,
.dark .fi-sidebar-item-badge span,
.dark .fi-sidebar-item .fi-badge,
.dark .fi-sidebar-item .fi-badge span {
    background-color: rgba(239, 68, 68, 0.2) !important;
    color: #ef4444 !important;
    border: 1px solid rgba(239, 68, 68, 0.4) !important;
    box-shadow: none !important;
    border-radius: 6px !important;
}
.dark .fi-sidebar-item.fi-active .fi-sidebar-item-badge,
.dark .fi-sidebar-item.fi-active .fi-sidebar-item-badge span,
.dark .fi-sidebar-item.fi-active .fi-badge,
.dark .fi-sidebar-item.fi-active .fi-badge span {
    background-color: rgba(239, 68, 68, 0.4) !important;
    color: #ff8a8a !important;
    border: 1px solid rgba(239, 68, 68, 0.5) !important;
    border-radius: 6px !important;
}

