/* CSS Variables are now dynamically loaded from database via includes/meta.php */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.3s ease;
    overflow-x: hidden;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    z-index: 1000;
    transform: translateX(0);
    transition: transform 0.3s ease;
    backdrop-filter: blur(10px);
}

.sidebar-header {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-primary);
}

.sidebar-header h4 {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 2rem;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.sidebar-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sidebar-nav {
    list-style: none;
    padding: 1rem 0;
}

.nav-item {
    margin: 0.25rem 1rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 0.75rem;
    transition: all 0.2s ease;
    font-weight: 500;
}

.nav-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transform: translateX(4px);
}

.nav-item.active .nav-link {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    box-shadow: var(--shadow-md);
}

.nav-link i {
    width: 20px;
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

/* Top Navbar */
.top-navbar {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 0.62rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-title {
    color: var(--text-primary);
    font-weight: 600;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-toggle {
    background: var(--bg-tertiary);
    border: none;
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

/* User Dropdown */
.user-dropdown {
    position: relative;
}

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

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

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
}

.user-name {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

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

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
}

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

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

/* Dashboard Content */
.dashboard-content {
    padding: 2rem 1rem;
}

/* Stats Cards */
.stats-card {
    background: var(--bg-primary);
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.stats-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stats-card .card-body {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.card-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.card-icon.orders {
    background: linear-gradient(135deg, var(--success-color), #059669);
}

.card-icon.revenue {
    background: linear-gradient(135deg, var(--warning-color), #d97706);
}

.card-icon.products {
    background: linear-gradient(135deg, var(--info-color), #2563eb);
}

.card-info h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.card-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.trend {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
}

.trend.positive {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.trend.negative {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

/* Chart Card */
.chart-card,
.activity-card {
    background: var(--bg-primary);
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.card-header {
    padding: 1.5rem 1.5rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h5 {
    color: var(--text-primary);
    font-weight: 600;
    margin: 0;
}

.btn-action {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-action:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.chart-placeholder {
    height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-align: center;
}

.chart-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.chart-placeholder h6 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

/* Activity Card */
.activity-card .card-body {
    padding: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-light);
}

.activity-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.activity-item:first-child {
    padding-top: 0;
}

.activity-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    flex-shrink: 0;
}

.activity-icon.orders {
    background: linear-gradient(135deg, var(--success-color), #059669);
}

.activity-icon.revenue {
    background: linear-gradient(135deg, var(--warning-color), #d97706);
}

.activity-icon.products {
    background: linear-gradient(135deg, var(--info-color), #2563eb);
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-content p {
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 0.25rem;
    word-wrap: break-word;
    line-height: 1.4;
}

.activity-content small {
    color: var(--text-muted);
    font-size: 0.8rem;
    white-space: nowrap;
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .navbar-left .sidebar-toggle {
        display: block;
    }
}

@media (max-width: 767.98px) {
    .top-navbar {
        padding: 1rem;
    }

    .dashboard-content {
        padding: 1rem 0;
    }

    .user-name {
        display: none;
    }

    .stats-card .card-body {
        padding: 1rem;
    }

    .card-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

    .card-info h3 {
        font-size: 1.5rem;
    }
}

@media (max-width: 575.98px) {
    .chart-placeholder {
        height: 200px;
    }

    .chart-placeholder i {
        font-size: 2rem;
    }

    .activity-card .card-body {
        padding: 1rem;
    }

    .activity-item {
        padding: 0.75rem 0;
        gap: 0.75rem;
    }

    .activity-item:first-child {
        padding-top: 0;
    }

    .activity-icon {
        width: 35px;
        height: 35px;
        min-width: 35px;
        font-size: 0.9rem;
    }

    .activity-content p {
        font-size: 0.9rem;
    }
}

/* Smooth Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stats-card,
.chart-card,
.activity-card {
    animation: fadeIn 0.6s ease forwards;
}

.stats-card:nth-child(1) {
    animation-delay: 0.1s;
}

.stats-card:nth-child(2) {
    animation-delay: 0.2s;
}

.stats-card:nth-child(3) {
    animation-delay: 0.3s;
}

.stats-card:nth-child(4) {
    animation-delay: 0.4s;
}

/* Custom Scrollbar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
/* Sid
ebar Stats Styles */
.sidebar-stats {
    padding: 1.5rem;
    margin-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.stats-header {
    margin-bottom: 1rem;
}

.stats-header h6 {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    margin: 0;
    display: flex;
    align-items: center;
}

.stats-grid {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 0.5rem;
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
}

.stat-item:hover {
    background: var(--bg-secondary);
    transform: translateY(-1px);
}

.stat-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.stat-link:hover {
    text-decoration: none;
    color: inherit;
}

.stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: white;
}

.stat-icon.today {
    background: linear-gradient(135deg, var(--info-color), #2563eb);
}

.stat-icon.week {
    background: linear-gradient(135deg, var(--success-color), #059669);
}

.stat-icon.total {
    background: linear-gradient(135deg, var(--warning-color), #d97706);
}

.stat-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.stat-number {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

.last-activity {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 0.75rem;
    padding: 1rem;
}

.activity-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
}

.activity-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.activity-action {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
    line-height: 1.3;
}

.activity-time {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 400;
}

/* Responsive adjustments for sidebar stats */
@media (max-width: 991.98px) {
    .sidebar-stats {
        padding: 1rem;
    }
    
    .stat-item {
        padding: 0.5rem;
    }
    
    .stat-icon {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    .stat-number {
        font-size: 1rem;
    }
    
    .last-activity {
        padding: 0.75rem;
    }
}

/* Dark theme adjustments */
[data-theme="dark"] .sidebar-stats {
    border-top-color: var(--border-color);
}

[data-theme="dark"] .stat-item {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .stat-item:hover {
    background: var(--bg-primary);
}

[data-theme="dark"] .last-activity {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}