/* ==========================================================================
   E3LANJEA Agency ERP - Premium Theme Design System
   ========================================================================== */

/* 1. Brand Logo Sizing */
.fi-logo img {
    height: 2.75rem !important;
    max-height: 2.75rem !important;
    width: auto !important;
    object-fit: contain !important;
}

/* 2. Top Header & Glassmorphism */
header.fi-topbar {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(12px) !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

.dark header.fi-topbar {
    background: rgba(15, 23, 42, 0.9) !important;
    border-bottom-color: #1e293b !important;
}

/* 3. Enhanced Sidebar */
aside.fi-sidebar {
    background: #ffffff !important;
    border-inline-end: 1px solid #e2e8f0 !important;
}

.dark aside.fi-sidebar {
    background: #0f172a !important;
    border-inline-end-color: #1e293b !important;
}

/* ============================================================
   3. Sidebar Navigation System (Full & Mini Rail Mode)
   ============================================================ */

/* ------------------------------------------------------------
   A. FULL EXPANDED SIDEBAR (Ultra-Compact Spacing)
   ------------------------------------------------------------ */

/* Navigation container padding */
.fi-sidebar-open .fi-sidebar-nav,
.fi-sidebar-nav {
    padding: 0.5rem 0.75rem 1.5rem 0.75rem !important;
}

/* Groups list - eliminates the huge default gap */
.fi-sidebar-open .fi-sidebar-nav-groups,
.fi-sidebar-nav-groups {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.15rem !important;
}

/* Individual group container */
.fi-sidebar-group {
    margin: 0 !important;
    padding: 0 !important;
}

/* Group header button */
.fi-sidebar-group-button {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    padding: 0.2rem 0.5rem !important;
    margin: 0.15rem 0 !important;
    min-height: 1.85rem !important;
    border-radius: 0.4rem !important;
    cursor: pointer !important;
    user-select: none !important;
    transition: background-color 0.15s ease !important;
}

.fi-sidebar-group-button:hover {
    background-color: rgba(99, 102, 241, 0.05) !important;
}

.dark .fi-sidebar-group-button:hover {
    background-color: rgba(129, 140, 248, 0.08) !important;
}

/* Group label text */
.fi-sidebar-group-label {
    font-size: 0.715rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em !important;
    color: #64748b !important;
    text-transform: uppercase !important;
}

.dark .fi-sidebar-group-label {
    color: #94a3b8 !important;
}

/* Collapse button in group header */
.fi-sidebar-group-collapse-button {
    color: #94a3b8 !important;
    transition: transform 0.2s ease-in-out !important;
}

/* Group items list inside expanded group */
.fi-sidebar-group-items {
    display: flex !important;
    flex-direction: column !important;
    gap: 1px !important;
    margin: 1px 0 !important;
    padding-inline-start: 0.25rem !important;
}

/* Nav Item Container */
.fi-sidebar-item {
    margin: 0 !important;
}

/* Nav Item Link (Expanded Full Mode) */
.fi-sidebar-item > a,
.fi-sidebar-item > button {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    padding: 0.35rem 0.55rem !important;
    min-height: 2.1rem !important;
    border-radius: 0.5rem !important;
    font-size: 0.835rem !important;
    font-weight: 500 !important;
    color: #334155 !important;
    transition: all 0.15s ease !important;
    width: 100% !important;
    text-decoration: none !important;
    border-inline-start: 3.5px solid transparent !important;
}

.dark .fi-sidebar-item > a,
.dark .fi-sidebar-item > button {
    color: #cbd5e1 !important;
}

/* Item hover */
.fi-sidebar-item > a:hover,
.fi-sidebar-item > button:hover {
    background-color: rgba(99, 102, 241, 0.07) !important;
    color: #4338ca !important;
}

.dark .fi-sidebar-item > a:hover,
.dark .fi-sidebar-item > button:hover {
    background-color: rgba(129, 140, 248, 0.12) !important;
    color: #a5b4fc !important;
}

/* Active Item — High Contrast & Elegant Indicator */
.fi-sidebar-item-active > a,
.fi-sidebar-item-active > button,
.fi-active > a,
.fi-active > button {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.12) 0%, rgba(6, 182, 212, 0.06) 100%) !important;
    border-inline-start: 3.5px solid #4f46e5 !important;
    font-weight: 700 !important;
    color: #3730a3 !important;
}

.dark .fi-sidebar-item-active > a,
.dark .fi-sidebar-item-active > button,
.dark .fi-active > a,
.dark .fi-active > button {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.22) 0%, rgba(6, 182, 212, 0.1) 100%) !important;
    border-inline-start-color: #818cf8 !important;
    color: #e0e7ff !important;
}

/* Item Icon (Full Mode) */
.fi-sidebar-item-icon {
    width: 1.15rem !important;
    height: 1.15rem !important;
    color: #6366f1 !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
}

.fi-sidebar-item-active .fi-sidebar-item-icon,
.fi-active .fi-sidebar-item-icon {
    color: #4338ca !important;
}

.dark .fi-sidebar-item-active .fi-sidebar-item-icon,
.dark .fi-active .fi-sidebar-item-icon {
    color: #a5b4fc !important;
}

/* Item label */
.fi-sidebar-item-label {
    flex: 1 1 auto !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* ------------------------------------------------------------
   B. MINI / COLLAPSED SIDEBAR (Rail Mode - Perfectly Organized)
   ------------------------------------------------------------ */

/* Sidebar width in collapsed mode */
aside.fi-sidebar:not(.fi-sidebar-open) {
    width: 4.5rem !important;
    min-width: 4.5rem !important;
}

/* Nav container in mini mode */
aside.fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-nav {
    padding: 0.75rem 0.35rem !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

/* Groups list in mini mode */
aside.fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-nav-groups {
    gap: 0.35rem !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

/* In mini mode: hide text group headers completely to prevent text bleed */
aside.fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-group-button {
    display: none !important;
}

/* Group separator in mini mode — subtle divider between groups */
aside.fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-group {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    padding-bottom: 0.35rem !important;
    margin-bottom: 0.35rem !important;
    border-bottom: 1px solid #f1f5f9 !important;
}

.dark aside.fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-group {
    border-bottom-color: #1e293b !important;
}

aside.fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-group:last-child {
    border-bottom: none !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Group items in mini mode */
aside.fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-group-items {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 0.25rem !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Items in mini mode */
aside.fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-item {
    display: flex !important;
    justify-content: center !important;
    width: 100% !important;
    margin: 0 !important;
}

/* Item button/link in mini mode — centered square badge */
aside.fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-item > a,
aside.fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-item > button {
    width: 2.75rem !important;
    height: 2.75rem !important;
    min-height: 2.75rem !important;
    max-width: 2.75rem !important;
    padding: 0 !important;
    margin: 0 auto !important;
    border-radius: 0.625rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-inline-start: none !important;
    border: 1.5px solid transparent !important;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Hide text label in mini mode */
aside.fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-item span {
    display: none !important;
}

/* Icon in mini mode — perfectly centered */
aside.fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-item-icon {
    width: 1.3rem !important;
    height: 1.3rem !important;
    margin: 0 !important;
}

/* Hover in mini mode */
aside.fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-item > a:hover,
aside.fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-item > button:hover {
    background-color: rgba(99, 102, 241, 0.08) !important;
    color: #4338ca !important;
    border-color: rgba(99, 102, 241, 0.2) !important;
    transform: scale(1.06) !important;
}

.dark aside.fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-item > a:hover,
.dark aside.fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-item > button:hover {
    background-color: rgba(129, 140, 248, 0.15) !important;
    color: #a5b4fc !important;
    border-color: rgba(129, 140, 248, 0.3) !important;
}

/* ACTIVE item in mini mode — bold primary badge with glow */
aside.fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-item-active > a,
aside.fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-item-active > button,
aside.fi-sidebar:not(.fi-sidebar-open) .fi-active > a,
aside.fi-sidebar:not(.fi-sidebar-open) .fi-active > button {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px -1px rgba(79, 70, 229, 0.45) !important;
    border-color: #4338ca !important;
}

aside.fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-item-active .fi-sidebar-item-icon,
aside.fi-sidebar:not(.fi-sidebar-open) .fi-active .fi-sidebar-item-icon {
    color: #ffffff !important;
}

/* 4. Rich Stat Cards Custom Gradients & Accents */
.fi-wi-stats-overview-stat {
    border-radius: 1.25rem !important;
    padding: 1.25rem !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative !important;
    box-shadow: 0 4px 15px -2px rgba(0, 0, 0, 0.04), 0 2px 6px -2px rgba(0, 0, 0, 0.02) !important;
}

.fi-wi-stats-overview-stat:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 16px 25px -4px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04) !important;
}

/* Card 1: Revenue (Emerald Gradient) */
.stat-card-revenue {
    background: linear-gradient(145deg, #f0fdf4 0%, #ecfdf5 50%, #ffffff 100%) !important;
    border: 1.5px solid #a7f3d0 !important;
}
.stat-card-revenue .fi-wi-stats-overview-stat-value {
    color: #065f46 !important;
}

/* Card 2: Receivables (Amber Gradient) */
.stat-card-receivables {
    background: linear-gradient(145deg, #fffbeb 0%, #fefce8 50%, #ffffff 100%) !important;
    border: 1.5px solid #fde68a !important;
}
.stat-card-receivables .fi-wi-stats-overview-stat-value {
    color: #92400e !important;
}

/* Card 3: Expenses (Rose Gradient) */
.stat-card-expenses {
    background: linear-gradient(145deg, #fff1f2 0%, #ffe4e6 50%, #ffffff 100%) !important;
    border: 1.5px solid #fecdd3 !important;
}
.stat-card-expenses .fi-wi-stats-overview-stat-value {
    color: #9f1239 !important;
}

/* Card 4: Profit (Indigo Gradient) */
.stat-card-profit {
    background: linear-gradient(145deg, #eef2ff 0%, #f0f9ff 50%, #ffffff 100%) !important;
    border: 1.5px solid #c7d2fe !important;
}
.stat-card-profit .fi-wi-stats-overview-stat-value {
    color: #3730a3 !important;
}

/* Card 5: Projects (Sky Gradient) */
.stat-card-projects {
    background: linear-gradient(145deg, #f0f9ff 0%, #e0f2fe 50%, #ffffff 100%) !important;
    border: 1.5px solid #bae6fd !important;
}
.stat-card-projects .fi-wi-stats-overview-stat-value {
    color: #0369a1 !important;
}

/* Card 6: Completed Tasks (Green Gradient) */
.stat-card-tasks {
    background: linear-gradient(145deg, #f0fdf4 0%, #dcfce7 50%, #ffffff 100%) !important;
    border: 1.5px solid #bbf7d0 !important;
}
.stat-card-tasks .fi-wi-stats-overview-stat-value {
    color: #166534 !important;
}

/* Card 7: Overdue Tasks (Rose Gradient) */
.stat-card-overdue {
    background: linear-gradient(145deg, #fff1f2 0%, #fef2f2 50%, #ffffff 100%) !important;
    border: 1.5px solid #fecaca !important;
}
.stat-card-overdue .fi-wi-stats-overview-stat-value {
    color: #991b1b !important;
}

/* Card 8: Satisfaction Rating (Gold/Amber Gradient) */
.stat-card-rating {
    background: linear-gradient(145deg, #fffbeb 0%, #fef3c7 50%, #ffffff 100%) !important;
    border: 1.5px solid #fde68a !important;
}
.stat-card-rating .fi-wi-stats-overview-stat-value {
    color: #b45309 !important;
}

/* Dark Mode Overrides for Stat Cards */
.dark .stat-card-revenue { background: linear-gradient(145deg, rgba(6,78,59,0.3) 0%, rgba(15,23,42,0.9) 100%) !important; border-color: rgba(5,150,105,0.4) !important; }
.dark .stat-card-receivables { background: linear-gradient(145deg, rgba(120,53,15,0.3) 0%, rgba(15,23,42,0.9) 100%) !important; border-color: rgba(217,119,6,0.4) !important; }
.dark .stat-card-expenses { background: linear-gradient(145deg, rgba(136,19,55,0.3) 0%, rgba(15,23,42,0.9) 100%) !important; border-color: rgba(225,29,72,0.4) !important; }
.dark .stat-card-profit { background: linear-gradient(145deg, rgba(49,46,129,0.3) 0%, rgba(15,23,42,0.9) 100%) !important; border-color: rgba(99,102,241,0.4) !important; }
.dark .stat-card-projects { background: linear-gradient(145deg, rgba(12,74,110,0.3) 0%, rgba(15,23,42,0.9) 100%) !important; border-color: rgba(2,132,199,0.4) !important; }
.dark .stat-card-tasks { background: linear-gradient(145deg, rgba(20,83,45,0.3) 0%, rgba(15,23,42,0.9) 100%) !important; border-color: rgba(22,163,74,0.4) !important; }
.dark .stat-card-overdue { background: linear-gradient(145deg, rgba(153,27,27,0.3) 0%, rgba(15,23,42,0.9) 100%) !important; border-color: rgba(239,68,68,0.4) !important; }
.dark .stat-card-rating { background: linear-gradient(145deg, rgba(120,53,15,0.3) 0%, rgba(15,23,42,0.9) 100%) !important; border-color: rgba(245,158,11,0.4) !important; }

/* 5. Tables & Badges */
.fi-ta-ctn {
    border-radius: 1.25rem !important;
    border: 1px solid #e2e8f0 !important;
    overflow: hidden !important;
}

.dark .fi-ta-ctn {
    border-color: #1e293b !important;
}

.fi-badge {
    border-radius: 9999px !important;
    font-weight: 700 !important;
    padding: 0.25rem 0.75rem !important;
}

/* ============================================================
   6. Guided Sales POS Styles (iPad & Touch Friendly)
   ============================================================ */
.pos-wrapper {
    padding-bottom: 7rem;
}
.pos-card-client {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1rem 1.25rem;
    transition: all 0.2s ease;
    cursor: pointer;
}
.pos-card-client:hover {
    border-color: #6366f1;
    background: #f8faff;
}
.pos-card-client.is-active {
    border-color: #4f46e5 !important;
    background: #eef2ff !important;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.15) !important;
}
.dark .pos-card-client {
    background: #1e293b;
    border-color: #334155;
}
.dark .pos-card-client:hover {
    background: #1e1b4b;
    border-color: #6366f1;
}
.dark .pos-card-client.is-active {
    background: #1e1b4b !important;
    border-color: #818cf8 !important;
}

.pos-service-card {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 1.25rem;
    padding: 1.25rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.pos-service-card:hover {
    border-color: #818cf8;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
}
.pos-service-card.is-selected {
    border-color: #4f46e5 !important;
    background: #f5f3ff !important;
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.2) !important;
}
.dark .pos-service-card {
    background: #0f172a;
    border-color: #334155;
}
.dark .pos-service-card.is-selected {
    background: #1e1b4b !important;
    border-color: #818cf8 !important;
}

.pos-option-btn {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1rem;
    transition: all 0.15s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.pos-option-btn:hover {
    border-color: #6366f1;
    background: #fafafa;
}
.pos-step-pill {
    padding: 0.5rem 1rem;
    border-radius: 0.625rem;
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    color: #c7d2fe !important;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}
.pos-step-pill span {
    color: inherit !important;
}
.pos-step-pill.is-active-step {
    background: #ffffff !important;
    color: #1e1b4b !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25) !important;
}
.pos-step-pill.is-active-step span {
    color: #1e1b4b !important;
    font-weight: 900 !important;
}
.pos-step-pill.is-launch-active {
    background: #10b981 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(16,185,129,0.35) !important;
}
.pos-step-pill.is-launch-active span {
    color: #ffffff !important;
    font-weight: 900 !important;
}
.pos-option-btn.is-active {
    border-color: #4f46e5 !important;
    background: #eef2ff !important;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15) !important;
}
.dark .pos-option-btn {
    background: #1e293b;
    border-color: #334155;
}
.dark .pos-option-btn.is-active {
    background: #1e1b4b !important;
    border-color: #818cf8 !important;
}



