/* 
 * Midnight Emerald Professional Theme
 * Optimized for GreenWave CRM
 */

:root {
    --brand-emerald: #86C100;
    --brand-azure: #00A6FF;
    --midnight-bg: #0f172a;
    --midnight-dark: #020617;
}

/* ========================================== */
/* 1. HEADER STYLING (Black & Green)         */
/* ========================================== */

#header {
    background-color: #000000 !important;
    background-image: none !important;
    border-bottom: 2px solid var(--brand-emerald) !important;
    height: 60px !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5) !important;
    display: flex !important;
    align-items: center !important;
    padding: 0 10px !important;
    width: 100% !important;
}

#header nav {
    flex: 1 !important;
}

#header .hide-menu {
    border: none !important;
    margin-top: 0 !important;
    /* Reset user's tw-mt-4 */
    display: flex !important;
    align-items: center !important;
    height: 40px !important;
}

/* Force white colors for header elements */
#header .navbar-nav>li>a,
#header .navbar-nav>li>a>i,
#header .hide-menu svg,
#header .mobile-menu-toggle i,
#header .logo-text,
#header .navbar-right li a,
#header .navbar-right li a i,
#header .navbar-right li a span {
    color: #ffffff !important;
}

#header .hide-menu:hover svg,
#header .navbar-nav>li>a:hover i,
#header .navbar-nav>li>a:hover span {
    color: var(--brand-emerald) !important;
}

/* Logo Sizing & Visibility */
#header .logo-text {
    font-size: 20px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

#logo img {
    max-height: 38px !important;
    width: auto !important;
    filter: brightness(0) invert(1) !important;
    /* Correct for Black BG */
}

/* ... (Search bar and Plus button styles remain) ... */

/* Navbar item spacing */
#header .navbar-nav>li>a {
    padding: 0 12px !important;
    height: 60px !important;
    display: flex !important;
    align-items: center !important;
    transition: all 0.2s ease !important;
}


/* ========================================== */
/* 2. SIDEBAR STYLING (Midnight Emerald)     */
/* ========================================== */

aside#menu {
    background: var(--midnight-dark) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.05) !important;
    display: flex !important;
    flex-direction: column !important;
    height: calc(100vh - 60px) !important;
    /* Adjust for fixed header */
    padding-bottom: 0 !important;
}

#side-menu {
    flex: 1 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    margin-bottom: 0 !important;
    padding-bottom: 10px !important;
    padding-top: 10px !important;
}

/* Custom Scrollbar for Sidebar */
#side-menu::-webkit-scrollbar {
    width: 5px;
}

#side-menu::-webkit-scrollbar-track {
    background: transparent;
}

#side-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

#side-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}



#side-menu li a {
    color: rgba(255, 255, 255, 0.75) !important;
    border-left: 4px solid transparent;
    padding: 8px 20px !important;
    /* Compact spacing */
    transition: all 0.2s ease;
}

#side-menu li a i.menu-icon {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* Sidebar Item Hover */
#side-menu li:hover>a {
    background: rgba(134, 193, 0, 0.08) !important;
    color: #ffffff !important;
}

#side-menu li:hover>a i.menu-icon {
    color: var(--brand-emerald) !important;
}

/* Sidebar Item Active */
#side-menu li.active>a {
    background: rgba(134, 193, 0, 0.15) !important;
    color: var(--brand-emerald) !important;
    border-left: 4px solid var(--brand-emerald) !important;
    font-weight: 600 !important;
}

#side-menu li.active>a i.menu-icon {
    color: var(--brand-emerald) !important;
}

/* Submenu Styling */
#side-menu li ul.nav-second-level {
    background: rgba(0, 0, 0, 0.3) !important;
}

#side-menu li ul.nav-second-level li a {
    padding-left: 50px !important;
}

/* ========================================== */
/* 3. SIDEBAR USER PROFILE SECTION            */
/* ========================================== */

.sidebar-user-profile {
    background: transparent !important;
    margin-top: 0 !important;
    /* Removed top margin */
    padding: 15px 10px 10px 10px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    flex-shrink: 0 !important;
    /* Prevent shrinking */
}

.sidebar-user-profile a.dropdown-toggle {
    background: #f1f5f9 !important;
    /* Light Gray Theme */
    border: 1px solid #e2e8f0 !important;
    color: #1e293b !important;
    padding: 12px !important;
    border-radius: 12px !important;
    display: flex !important;
    align-items: center !important;
    text-decoration: none !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

.sidebar-user-profile a.dropdown-toggle:hover {
    background: #e2e8f0 !important;
}

/* Dark text for profile contents on light bg */
.sidebar-user-profile a.dropdown-toggle span {
    color: #1e293b !important;
}

.sidebar-user-profile a.dropdown-toggle .tw-text-xs,
.sidebar-user-profile a.dropdown-toggle .tw-text-sm {
    color: #64748b !important;
}

/* Profile Truncation Fix */
.sidebar-user-profile .tw-max-w-\[180px\],
.sidebar-user-profile .tw-truncate {
    max-width: 140px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Avatar fix */
.sidebar-user-profile img {
    border-radius: 8px !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
}

/* ========================================== */
/* 4. SETUP MENU & MOBILE BRANDING           */
/* ========================================== */

#setup-menu-wrapper {
    background-color: var(--midnight-bg) !important;
    /* Professional Dark */
    border-right: 2px solid var(--brand-emerald) !important;
}

#setup-menu-wrapper .customizer-heading {
    background-color: var(--brand-emerald) !important;
    color: #ffffff !important;
    margin: -4px -10px 10px -15px !important;
    padding: 15px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
}

#setup-menu-wrapper li a {
    color: rgba(255, 255, 255, 0.8) !important;
}

#setup-menu-wrapper li a:hover {
    background-color: rgba(134, 193, 0, 0.1) !important;
    color: var(--brand-emerald) !important;
}

#setup-menu-wrapper li.active a {
    background-color: var(--brand-emerald) !important;
    color: #ffffff !important;
}

#setup-menu-wrapper li.active a i {
    color: #ffffff !important;
}

@media (max-width: 768px) {
    .mobile-navbar {
        background-color: var(--midnight-dark) !important;
    }

    .mobile-navbar li a {
        color: #ffffff !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    }

    #top_search {
        display: none !important;
    }
}

/* ========================================== */
/* SERVICE ORDER BADGE STYLING                */
/* ========================================== */

.service-order-badge {
    display: inline-block;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: #fff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
    transition: all 0.2s ease;
}

.service-order-badge.clickable {
    cursor: pointer;
}

.service-order-badge.clickable:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.4);
}

/* Service Order Modal Styling */
#editServiceOrderModal .modal-header {
    background-color: #007bff !important;
    color: #fff !important;
}

#editServiceOrderModal .modal-body .form-group label {
    font-weight: 600;
    color: #333;
}

#editServiceOrderModal .modal-body input[readonly] {
    background-color: #f8f9fa;
    cursor: not-allowed;
}

#serviceOrderError {
    margin-bottom: 15px;
}

/* ========================================== */
/* 5. NOTIFICATIONS DROPDOWN                 */
/* ========================================== */

/* Dropdown Container */
#header .header-notifications .dropdown-menu {
    background-color: #ffffff !important;
    color: #333333 !important;
    border: 1px solid #e5e7eb !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
    padding-bottom: 0 !important;
}

/* Notification Items Text - High Specificity Override */
#header .header-notifications .dropdown-menu a,
#header .header-notifications .dropdown-menu a span,
#header .header-notifications .dropdown-menu .notification-title {
    color: #334155 !important;
}

#header .header-notifications .dropdown-menu a:hover,
#header .header-notifications .dropdown-menu a:hover span,
#header .header-notifications .dropdown-menu a:hover .notification-title {
    color: var(--brand-emerald) !important;
}

#header .header-notifications .dropdown-menu .notification-date {
    color: #64748b !important;
}

/* Notification Box Styling */
.header-notifications .notification-box {
    border-bottom: 1px solid #f1f5f9 !important;
}

/* Hover State */
.header-notifications .notification-wrapper a.notification-handler:hover .notification-box {
    background-color: #f8fafc !important;
}

/* Unread Notification Background */
.header-notifications .unread-notification .notification-box {
    background-color: #f0fdf4 !important;
}

/* Footer Section */
.header-notifications .dropdown-menu .tw-bg-neutral-50 {
    background-color: #f8fafc !important;
    border-top: 1px solid #e2e8f0 !important;
}

#header .header-notifications .dropdown-menu .tw-bg-neutral-50 p,
#header .header-notifications .dropdown-menu .tw-bg-neutral-50 a {
    color: #64748b !important;
}

/* ========================================== */
/* 4. SIDEBAR LOGO SECTION                   */
/* ========================================== */

.sidebar-logo-container {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 15px 10px !important;
    background: var(--midnight-dark) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    /* Changed to bottom border */
    border-top: none !important;
    flex-shrink: 0 !important;
    margin-top: 0 !important;
    /* Reset margin */
    margin-bottom: 0 !important;
}

.sidebar-logo-container a {
    display: block !important;
    text-decoration: none !important;
    transition: opacity 0.2s ease !important;
}

.sidebar-logo-container a:hover {
    opacity: 0.8 !important;
}

.sidebar-logo {
    max-width: 100% !important;
    height: auto !important;
    max-height: 60px !important;
    width: auto !important;
    object-fit: contain !important;
    display: block !important;
}

/* Hide Admin Footer */
.admin-footer {
    display: none !important;
}

.sidebar-logo-container {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 80px 10px 10px 10px !important;
    background: var(--midnight-dark) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    margin-top: 0 !important;
    min-height: 60px !important;
}

.sidebar-logo {
    max-height: 50px !important;
    width: auto !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}