/* ===== CSS Variables ===== */
:root {
    --primary: #2563eb;
    --secondary: #0ea5e9;
    --accent: #f97316;
    --light: #f8fafc;
    --dark: #1e293b;
    --gray: #64748b;
    --light-gray: #e2e8f0;
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --sidebar-text: #f1f5f9;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    --radius: 12px;
    --transition: all 0.3s ease;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

/* ===== Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--dark);
    line-height: 1.6;
    background-color: var(--light);
    overflow-x: hidden;
}

/* ===== Mobile First Layout ===== */
.dashboard-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: var(--primary);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.mobile-menu-btn:hover {
    transform: scale(1.05);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    transition: var(--transition);
    z-index: 999;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar.active {
    left: 0;
}

.sidebar-header {
    padding: 30px 20px;
    border-bottom: 1px solid #334155;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
}

.logo img {
    height: 40px;
    width: auto;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 25px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: var(--transition);
    border-left: 4px solid transparent;
}

.nav-item:hover,
.nav-item.active {
    background-color: var(--sidebar-hover);
    border-left-color: var(--accent);
    color: white;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #334155;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: var(--transition);
    border-radius: var(--radius);
}

.logout-btn:hover {
    background-color: var(--danger);
    color: white;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 20px;
    margin-left: 0;
    transition: var(--transition);
}

.sidebar.active ~ .main-content {
    margin-left: 280px;
}

/* Top Header */
.top-header {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark);
}

.welcome-text {
    color: var(--gray);
    font-size: 1rem;
}

.header-right {
    display: flex;
    justify-content: flex-end;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: var(--transition);
}

.user-profile:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.user-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    color: var(--dark);
    font-size: 0.9rem;
}

.user-email {
    font-size: 0.8rem;
    color: var(--gray);
}

/* Stats Section */
.stats-section {
    margin-bottom: 30px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.stat-icon.pending {
    background: linear-gradient(135deg, var(--warning) 0%, #fbbf24 100%);
}

.stat-icon.processing {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

.stat-icon.completed {
    background: linear-gradient(135deg, var(--success) 0%, #34d399 100%);
}

.stat-icon.total {
    background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--dark);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--gray);
}

/* Section Styles */
.section-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--dark);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.view-all {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.view-all:hover {
    color: var(--secondary);
}

/* Actions Section */
.actions-section {
    margin-bottom: 30px;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.action-card {
    background: white;
    border-radius: var(--radius);
    padding: 25px 20px;
    text-decoration: none;
    color: var(--dark);
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--shadow);
    border: 1px solid transparent;
}

.action-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
    color: var(--dark);
}

.action-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    margin: 0 auto 15px;
}

.action-card h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.action-card p {
    color: var(--gray);
    font-size: 0.9rem;
}

/* Orders Section */
.orders-section {
    margin-bottom: 30px;
}

.orders-table {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table-header {
    display: none; /* Hidden on mobile */
    background-color: #f8fafc;
    padding: 15px 20px;
    font-weight: 600;
    color: var(--gray);
    border-bottom: 1px solid var(--light-gray);
}

.table-row {
    display: flex;
    flex-direction: column;
    padding: 20px;
    border-bottom: 1px solid var(--light-gray);
    transition: var(--transition);
}

.table-row:hover {
    background-color: #f8fafc;
}

.table-row:last-child {
    border-bottom: none;
}

.col {
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.col:last-child {
    margin-bottom: 0;
}

.col::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--gray);
    font-size: 0.9rem;
}

.order-id {
    font-weight: 600;
    color: var(--primary);
}

.specs {
    color: var(--dark);
    font-size: 0.9rem;
}

.date, .amount {
    color: var(--gray);
    font-size: 0.9rem;
}

.amount {
    font-weight: 600;
    color: var(--dark);
}

/* Status Badges */
.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-badge.pending {
    background-color: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.status-badge.confirmed {
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

.status-badge.completed {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

/* Buttons */
.btn-view {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-view:hover {
    background: #1e40af;
    transform: translateY(-1px);
}

/* Payment Section */
.payment-section {
    margin-bottom: 30px;
}

.payment-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.payment-card {
    background: white;
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.payment-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.payment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.payment-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark);
}

.payment-header i {
    color: var(--primary);
    font-size: 1.2rem;
}

.payment-amount {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
}

.payment-desc {
    color: var(--gray);
    font-size: 0.9rem;
}

/* ===== Tablet Styles ===== */
@media (min-width: 768px) {
    .mobile-menu-btn {
        display: none;
    }

    .dashboard-container {
        flex-direction: row;
    }

    .sidebar {
        position: static;
        width: 280px;
        height: 100vh;
        left: 0;
    }

    .main-content {
        margin-left: 0;
        padding: 30px;
    }

    .top-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .page-title {
        font-size: 2rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .actions-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .table-header {
        display: grid;
        grid-template-columns: 1fr 2fr 1fr 1fr 1fr 1fr;
        gap: 15px;
    }

    .table-row {
        display: grid;
        grid-template-columns: 1fr 2fr 1fr 1fr 1fr 1fr;
        gap: 15px;
        padding: 15px 20px;
        align-items: center;
    }

    .col {
        margin-bottom: 0;
        display: block;
    }

    .col::before {
        display: none;
    }

    .payment-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===== Desktop Styles ===== */
@media (min-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .actions-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .main-content {
        padding: 40px;
    }

    .section-title {
        font-size: 1.5rem;
    }
}

/* ===== Large Desktop Styles ===== */
@media (min-width: 1200px) {
    .container {
        max-width: 1200px;
        margin: 0 auto;
    }
}

/* ===== Utility Classes ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-0 { margin-bottom: 0; }
.mt-20 { margin-top: 20px; }
.p-20 { padding: 20px; }

/* ===== Loading States ===== */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* ===== Animation Keyframes ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}