﻿:root {
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --primary-color: #4e73df;
    --secondary-color: #858796;
    --success-color: #1cc88a;
    --info-color: #36b9cc;
    --warning-color: #f6c23e;
    --danger-color: #e74a3b;
    --light-bg: #f8f9fc;
    --dark-bg: #1a1c23;
    --dark-sidebar: #242634;
    --dark-card: #2d303e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-bg);
    overflow-x: hidden;
    transition: background-color 0.3s ease;
}

    body.dark-mode {
        background-color: var(--dark-bg);
        color: #e4e6eb;
    }

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: linear-gradient(180deg, #4e73df 0%, #224abe 100%);
    color: white;
    transition: all 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
}

body.dark-mode .sidebar {
    background: linear-gradient(180deg, #242634 0%, #1a1c23 100%);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

    .sidebar-header h4 {
        font-weight: 700;
        margin: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
    }

.sidebar.collapsed .sidebar-header h4 span {
    display: none;
}

.sidebar-menu {
    padding: 15px 0;
}

.menu-item {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: rgba(255,255,255,0.8);
    border-left: 4px solid transparent;
}

    .menu-item:hover, .menu-item.active {
        background-color: rgba(255,255,255,0.1);
        color: white;
        border-left-color: #fff;
    }

    .menu-item i {
        font-size: 1.2rem;
        min-width: 24px;
        text-align: center;
    }

    .menu-item .menu-arrow {
        margin-left: auto;
        transition: transform 0.3s ease;
        font-size: 0.9rem;
    }

    .menu-item[aria-expanded="true"] .menu-arrow {
        transform: rotate(180deg);
    }

.sidebar.collapsed .menu-item span,
.sidebar.collapsed .menu-item .menu-arrow {
    display: none;
}

/* Submenu Styles */
.submenu {
    background-color: rgba(0,0,0,0.15);
    overflow: hidden;
}

body.dark-mode .submenu {
    background-color: rgba(0,0,0,0.2);
}

.submenu-item {
    padding: 10px 20px 10px 60px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

    .submenu-item:hover {
        background-color: rgba(255,255,255,0.08);
        color: white;
        border-left-color: rgba(255,255,255,0.5);
    }

    .submenu-item.active {
        background-color: rgba(255,255,255,0.1);
        color: white;
        border-left-color: #fff;
    }

    .submenu-item i {
        font-size: 0.8rem;
    }

.sidebar.collapsed .submenu {
    display: none !important;
}

.menu-divider {
    height: 1px;
    background-color: rgba(255,255,255,0.1);
    margin: 15px 20px;
}

.sidebar.collapsed .menu-divider {
    margin: 15px 10px;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    transition: all 0.3s ease;
    min-height: 100vh;
}

.sidebar.collapsed ~ .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

/* Top Navbar */
.top-navbar {
    background-color: white;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

body.dark-mode .top-navbar {
    background-color: var(--dark-card);
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.toggle-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--secondary-color);
    transition: color 0.3s;
}

    .toggle-btn:hover {
        color: var(--primary-color);
    }

.navbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-box {
    position: relative;
}

    .search-box input {
        border-radius: 25px;
        padding: 8px 40px 8px 20px;
        border: 1px solid #e3e6f0;
        width: 250px;
        transition: all 0.3s;
    }

body.dark-mode .search-box input {
    background-color: var(--dark-bg);
    border-color: #444;
    color: #e4e6eb;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(78, 115, 223, 0.1);
}

.search-box i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-color);
}

.nav-icon {
    position: relative;
    cursor: pointer;
    font-size: 1.3rem;
    color: var(--secondary-color);
    transition: color 0.3s;
    background: none;
    border: none;
    padding: 0;
}

    .nav-icon:hover {
        color: var(--primary-color);
    }

.badge-counter {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--danger-color);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 5px 10px;
    border-radius: 8px;
    transition: background-color 0.3s;
}

    .user-profile:hover {
        background-color: rgba(78, 115, 223, 0.1);
    }

    .user-profile img {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        object-fit: cover;
    }

    .user-profile span {
        font-weight: 600;
        color: #333;
    }

body.dark-mode .user-profile span {
    color: #e4e6eb;
}

/* Dropdown Menu Styles */
.dropdown-menu {
    border: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border-radius: 12px;
    padding: 10px;
    min-width: 280px;
}

body.dark-mode .dropdown-menu {
    background-color: var(--dark-card);
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.dropdown-header {
    font-weight: 700;
    color: #333;
    padding: 10px 15px;
    border-bottom: 1px solid #e3e6f0;
    margin-bottom: 5px;
}

body.dark-mode .dropdown-header {
    color: #e4e6eb;
    border-bottom-color: #444;
}

.dropdown-item {
    padding: 12px 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s;
}

    .dropdown-item:hover {
        background-color: rgba(78, 115, 223, 0.1);
    }

body.dark-mode .dropdown-item {
    color: #e4e6eb;
}

    body.dark-mode .dropdown-item:hover {
        background-color: rgba(255,255,255,0.1);
        color: #fff;
    }

.dropdown-item i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.dropdown-divider {
    margin: 8px 0;
    border-color: #e3e6f0;
}

body.dark-mode .dropdown-divider {
    border-color: #444;
}

/* Notification Dropdown */
.notification-dropdown {
    min-width: 320px;
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    padding: 12px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

    .notification-item:hover {
        background-color: rgba(78, 115, 223, 0.05);
    }

body.dark-mode .notification-item:hover {
    background-color: rgba(255,255,255,0.05);
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .notification-icon.order {
        background-color: rgba(28, 200, 138, 0.1);
        color: var(--success-color);
    }

    .notification-icon.user {
        background-color: rgba(78, 115, 223, 0.1);
        color: var(--primary-color);
    }

    .notification-icon.system {
        background-color: rgba(246, 194, 62, 0.1);
        color: var(--warning-color);
    }

.notification-content {
    flex: 1;
}

    .notification-content p {
        margin: 0;
        font-size: 0.9rem;
        color: #333;
    }

body.dark-mode .notification-content p {
    color: #e4e6eb;
}

.notification-content small {
    color: #888;
    font-size: 0.75rem;
}

.notification-footer {
    padding: 10px 15px;
    text-align: center;
    border-top: 1px solid #e3e6f0;
    margin-top: 5px;
}

body.dark-mode .notification-footer {
    border-top-color: #444;
}

.notification-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}

    .notification-footer a:hover {
        text-decoration: underline;
    }

.unread-dot {
    width: 8px;
    height: 8px;
    background-color: var(--primary-color);
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
}

/* Dashboard Content */
.dashboard-content {
    padding: 25px;
}

/* Stats Cards */
.stats-card {
    background-color: white;
    border-radius: 15px;
    padding: 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: none;
}

body.dark-mode .stats-card {
    background-color: var(--dark-card);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.stats-info h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: #333;
}

body.dark-mode .stats-info h3 {
    color: #e4e6eb;
}

.stats-info p {
    color: var(--secondary-color);
    margin: 0;
    font-size: 0.9rem;
}

.stats-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
}

    .stats-icon.primary {
        background: linear-gradient(135deg, #4e73df, #224abe);
    }

    .stats-icon.success {
        background: linear-gradient(135deg, #1cc88a, #13855c);
    }

    .stats-icon.info {
        background: linear-gradient(135deg, #36b9cc, #258391);
    }

    .stats-icon.warning {
        background: linear-gradient(135deg, #f6c23e, #dda20a);
    }

/* Charts Section */
.chart-card {
    background-color: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    margin-bottom: 25px;
}

body.dark-mode .chart-card {
    background-color: var(--dark-card);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.chart-card h5 {
    font-weight: 700;
    margin-bottom: 20px;
    color: #333;
}

body.dark-mode .chart-card h5 {
    color: #e4e6eb;
}

/* Table Styles */
.table-card {
    background-color: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

body.dark-mode .table-card {
    background-color: var(--dark-card);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.table-card h5 {
    font-weight: 700;
    margin-bottom: 20px;
    color: #333;
}

body.dark-mode .table-card h5 {
    color: #e4e6eb;
}

.custom-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

    .custom-table th {
        background-color: var(--light-bg);
        padding: 15px;
        font-weight: 600;
        color: #333;
        border: none;
    }

body.dark-mode .custom-table th {
    background-color: var(--dark-sidebar);
    color: #e4e6eb;
}

.custom-table td {
    padding: 15px;
    border-bottom: 1px solid #e3e6f0;
    vertical-align: middle;
}

body.dark-mode .custom-table td {
    border-bottom-color: #444;
    color: #e4e6eb;
}

.custom-table tr:hover td {
    background-color: rgba(78, 115, 223, 0.05);
}

body.dark-mode .custom-table tr:hover td {
    background-color: rgba(255,255,255,0.05);
}

.status-badge {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

    .status-badge.active {
        background-color: rgba(28, 200, 138, 0.1);
        color: var(--success-color);
    }

    .status-badge.pending {
        background-color: rgba(246, 194, 62, 0.1);
        color: var(--warning-color);
    }

    .status-badge.inactive {
        background-color: rgba(231, 74, 59, 0.1);
        color: var(--danger-color);
    }

.action-btn {
    width: 35px;
    height: 35px;
    border-radius: 8px;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-right: 5px;
}

    .action-btn.edit {
        background-color: rgba(78, 115, 223, 0.1);
        color: var(--primary-color);
    }

    .action-btn.delete {
        background-color: rgba(231, 74, 59, 0.1);
        color: var(--danger-color);
    }

    .action-btn:hover {
        transform: scale(1.1);
    }

/* Progress Bars */
.progress {
    height: 8px;
    border-radius: 10px;
    background-color: #e3e6f0;
}

.progress-bar {
    border-radius: 10px;
}

/* Activity Timeline */
.timeline {
    position: relative;
    padding-left: 30px;
}

    .timeline::before {
        content: '';
        position: absolute;
        left: 8px;
        top: 0;
        bottom: 0;
        width: 2px;
        background-color: #e3e6f0;
    }

body.dark-mode .timeline::before {
    background-color: #444;
}

.timeline-item {
    position: relative;
    padding-bottom: 25px;
}

    .timeline-item::before {
        content: '';
        position: absolute;
        left: -26px;
        top: 5px;
        width: 12px;
        height: 12px;
        border-radius: 50%;
        background-color: var(--primary-color);
        border: 2px solid white;
        box-shadow: 0 0 0 3px rgba(78, 115, 223, 0.2);
    }

body.dark-mode .timeline-item::before {
    border-color: var(--dark-card);
}

.timeline-item h6 {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

body.dark-mode .timeline-item h6 {
    color: #e4e6eb;
}

.timeline-item p {
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.timeline-item small {
    color: #aaa;
}

/* Mobile Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

    .sidebar-overlay.show {
        display: block;
        opacity: 1;
    }

/* Responsive */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width) !important;
    }

        .sidebar.show {
            transform: translateX(0);
        }

        .sidebar.collapsed {
            transform: translateX(-100%) !important;
        }

            .sidebar.collapsed .sidebar-header h4 span,
            .sidebar.collapsed .menu-item span,
            .sidebar.collapsed .menu-item .menu-arrow {
                display: inline !important;
            }

            .sidebar.collapsed .submenu {
                display: block !important;
            }

            .sidebar.collapsed .menu-divider {
                margin: 15px 20px !important;
            }

    .main-content {
        margin-left: 0 !important;
    }

    .sidebar.collapsed ~ .main-content {
        margin-left: 0 !important;
    }

    .search-box input {
        width: 150px;
    }
}

@media (max-width: 768px) {
    .search-box {
        display: none;
    }

    .stats-card {
        margin-bottom: 20px;
    }

    .top-navbar {
        padding: 15px;
    }

    .navbar-right {
        gap: 15px;
    }

    .user-profile span {
        display: none !important;
    }
}

/* Dark Mode Toggle */
.theme-toggle {
    cursor: pointer;
    font-size: 1.3rem;
    color: var(--secondary-color);
    transition: color 0.3s;
}

    .theme-toggle:hover {
        color: var(--primary-color);
    }

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: #555;
    }
