/* Elegant Header Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* Theme Variables */
:root {
    --navbar-bg: #ffffff;
    --hover-bg: #f1f5f9;
    --border-color: #e2e8f0;
    --text-color: #334155;
}

body.dark {
    --navbar-bg: #1e293b;
    --hover-bg: #334155;
    --border-color: #475569;
    --text-color: #f1f5f9;
}

/* Navbar Background Utility */
.navbar-bg {
    background-color: var(--navbar-bg);
    transition: background-color 0.3s ease;
}

/* Main Navbar */
.elegant-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: var(--navbar-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    margin: 0 auto;
    padding: 0 24px;
}

/* Left Section */
.navbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    background: none;
    border-radius: 12px;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-toggle:hover {
    background: var(--hover-bg);
    color: var(--text-color);
    transform: translateY(-1px);
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
}

.brand-text {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
    letter-spacing: -0.025em;
}

/* Center Section */
.navbar-center {
    flex: 1;
    max-width: 480px;
    margin: 0 40px;
}

.search-container {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    height: 44px;
    padding: 0 16px 0 44px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--navbar-bg);
    font-size: 14px;
    color: var(--text-color);
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-color);
    font-size: 14px;
}

.search-shortcut {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--hover-bg);
    color: var(--text-color);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-family: inherit;
}

/* Right Section */
.navbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    background-color: var(--hover-bg);
    border-radius: 8px;
    padding: 0.25rem;
    border: 1px solid var(--border-color);
}

.theme-toggle .selectgroup {
    display: flex;
    gap: 0;
    margin: 0;
    padding: 0;
}

.theme-toggle .selectgroup-item {
    margin: 0;
    display: flex;
}

.theme-toggle .selectgroup-input-radio {
    display: none;
}

.theme-toggle .selectgroup-button.theme-btn {
    background: none;
    border: none;
    color: var(--text-color);
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.6;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle .selectgroup-input-radio:checked + .selectgroup-button.theme-btn {
    background-color: var(--navbar-bg);
    opacity: 1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.theme-toggle .selectgroup-button.theme-btn:hover {
    opacity: 1;
}

/* Notifications */
.notification-container {
    position: relative;
}

.notification-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    background: none;
    border-radius: 12px;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.notification-btn:hover {
    background: var(--hover-bg);
    color: var(--text-color);
}

.notification-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    min-width: 18px;
    height: 18px;
    background: #ef4444;
    color: white;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

.notification-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    background: var(--navbar-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.notification-container:hover .notification-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notification-header,
.notification-footer {
    padding: 20px;
    border-bottom: 1px solid var(--hover-bg);
}

.notification-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
}

.notification-count {
    font-size: 12px;
    color: #4f46e5;
    background: #eef2ff;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 500;
}

.notification-list {
    max-height: 300px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--hover-bg);
    transition: background 0.2s ease;
}

.notification-item:hover {
    background: var(--hover-bg);
}

.notification-item.unread {
    background: #fefce8;
    border-left: 3px solid #eab308;
}

.notification-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--hover-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
}

.notification-text {
    font-size: 14px;
    color: var(--text-color);
    margin-bottom: 4px;
    line-height: 1.4;
}

.notification-time {
    font-size: 12px;
    color: #94a3b8;
}

.view-all-btn {
    display: block;
    text-align: center;
    color: #4f46e5;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.view-all-btn:hover {
    color: #3730a3;
}

/* Balance Display */
.balance-display {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding: 8px 16px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border-radius: 12px;
    color: white;
}

.balance-label {
    font-size: 11px;
    opacity: 0.8;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.balance-amount {
    font-size: 14px;
    font-weight: 600;
    margin-top: 2px;
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px 6px 6px;
    border: none;
    background: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-btn:hover {
    background: var(--hover-bg);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
}

.user-caret {
    font-size: 12px;
    color: #94a3b8;
    transition: transform 0.2s ease;
}

.user-menu:hover .user-caret {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    background: var(--navbar-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.user-menu:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
}

.user-info-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
}

.user-details h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 4px;
}

.user-details p {
    font-size: 13px;
    color: #64748b;
}

.dropdown-divider {
    height: 1px;
    background: var(--hover-bg);
    margin: 8px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: var(--hover-bg);
    color: var(--text-color);
}

.dropdown-item i {
    width: 16px;
    font-size: 14px;
    color: var(--text-color);
}

.dropdown-item.text-red {
    color: #dc2626;
}

.dropdown-item.text-red:hover {
    background: #fef2f2;
    color: #b91c1c;
}

/* Utility Classes */
.text-blue { color: #3b82f6; }
.text-green { color: #10b981; }
.text-red { color: #ef4444; }

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Responsive */
@media (max-width: 768px) {
    .navbar-center {
        display: none;
    }

    .navbar-right {
        gap: 8px;
    }

    .user-name {
        display: none;
    }

    .balance-display {
        display: none;
    }

    .navbar-container {
        padding: 0 16px;
    }
}

.theme-orange a {
    color: #000;
}

.light-sidebar .main-sidebar .sidebar-menu li.active a {
    background-color: #e31b29 !important;
    transition: background-color 0.3s ease;
}

.light-sidebar .main-sidebar .sidebar-menu li.active a:hover {
    background-color: #b38f00 !important;
}

.badge.badge-success {
    background-color: #e31b29 !important;
    margin-left: 10px;
}

.main-sidebar .sidebar-menu li a:hover {
    background-color: #FFF9DB !important;
}


/* Enhanced navbar adaptation for sidebar states */
.elegant-navbar {
    position: fixed;
    top: 0;
    left: 250px; /* Default sidebar width */
    right: 0;
    height: 70px;
    background: var(--navbar-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    width: calc(100% - 250px); /* Default width minus sidebar */
    margin-left: 0 !important; /* Remove any inherited margin */
}

/* When sidebar is in mini mode */
body.sidebar-mini .elegant-navbar {
    left: 65px !important;
    width: calc(100% - 65px) !important;
}

/* When sidebar is completely hidden (mobile) */
body.sidebar-hide .elegant-navbar {
    left: 0 !important;
    width: 100% !important;
}

/* Main content adaptation */
.main-content {
    margin-left: 0 !important; /* Remove default margin */
    padding-top: 70px; /* Add top padding for fixed navbar */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Main wrapper should handle the sidebar spacing */
.main-wrapper {
    margin-left: 250px; /* Default sidebar width */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.sidebar-mini .main-wrapper {
    margin-left: 65px !important;
}

body.sidebar-hide .main-wrapper {
    margin-left: 0 !important;
}

/* Responsive behavior */
@media (max-width: 991px) {
    .elegant-navbar {
        left: 0 !important;
        width: 100% !important;
    }
    
    .main-wrapper {
        margin-left: 0 !important;
    }
}

/* Smooth transitions for all elements */
.elegant-navbar,
.main-content,
.main-sidebar {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Ensure navbar container adapts properly */
.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
    max-width: none; /* Remove any max-width constraints */
}

/* Optional: Add a subtle shadow when sidebar is collapsed for better visual separation */
body.sidebar-mini .elegant-navbar {
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.05);
}

.main-content, .sidebar-mini .main-content, .sidebar-mini .main-footer {
    padding-left: 30px !important;
}

.main-sidebar, .light-sidebar.sidebar-mini .main-sidebar .sidebar-menu, .sidebar-user {
    background: #ffcc0f !important;
}

.light-sidebar .main-sidebar .sidebar-menu li.active a {
    border-radius: 25px !important;
}

.main-sidebar .sidebar-menu li a {
    color: #212121 !important;
}


.container-row {
      display: flex;
      align-items: center;
      padding: 5px;
      margin-bottom: 5px;
      border-radius: 0.25rem;
      color: #fff;
      font-family: Arial, sans-serif;
    }
    .status-content {
      display: flex;
      align-items: center;
      flex-grow: 1;
    }
    .status-content i {
      margin-right: 0.5rem;
    }
    .item-count {
      margin-left: auto; /* Pushes the count to the extreme end */
      display: flex;
      align-items: center;
      font-size: 1.2em; /* Slightly bigger for readability */
    }
    .status-item-success { background-color: #28a745; }
    .status-item-distribution { background-color: #17a2b8; }
    .status-item-progress { background-color: #ffc107; }
    .status-item-new { background-color: #007bff; }
    .status-item-picked { background-color: #6c757d; }
    .status-item-received { background-color: #20c997; }
    .status-item-agency { background-color: #6610f2; }
    .status-item-refunded { background-color: #dc3545; }
    .status-item-returned { background-color: #e83e8c; }
    .status-item-sent { background-color: #fd7e14; }
    .status-item-waiting { background-color: #343a40; }

.special-btn {
    background-color: #e31b29 !important;
    color: #fff !important;
}

#map {
        width: 100% !important;
        height: auto !important;
        max-height: 400px !important;
        border-radius: 8px !important;
        margin-top: 15px !important;
    }

    #map {
        min-height: 333px !important;
    }
    
    .light-sidebar .main-sidebar .sidebar-menu li.active a{
        color: #fff !important;
    }
    
    .main-sidebar .sidebar-menu li.active > ul.dropdown-menu {
        background: #ffcc0f !important;
    }
    
    .light-sidebar:not(.sidebar-mini) .sidebar-style-2 .sidebar-menu > li.active ul.dropdown-menu li a{
        background: #ffcc0f !important;
        color: #000 !important;
    }