:root {
    --bg-color: #f7f9fc;
    --text-main: #1a1a2e;
    --text-muted: #6b7280;
    --accent: #10b981;
    --accent-glow: rgba(16, 185, 129, 0.4);
    --secondary-accent: #14b8a6;
    --card-bg: #ffffff;
    --nav-bg: #ffffff;
    --border-color: #e5e7eb;
    --sidebar-width: 250px;
    --collapsed-width: 80px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
}

/* Layout */
.admin-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--card-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    height: 100vh;
    position: fixed;
    z-index: 1000;
}

.sidebar.collapsed {
    width: var(--collapsed-width);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.sidebar-header h2 {
    font-size: 1.8rem;
    font-weight: 800;
}

.sidebar-header h2 span {
    color: var(--accent);
}

.sidebar.collapsed .sidebar-header h2 {
    font-size: 1.2rem;
}

.sidebar-menu {
    list-style: none;
    padding: 1rem 0;
    flex-grow: 1;
}

.sidebar-menu li {
    padding: 0 1rem;
    margin-bottom: 0.5rem;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    text-decoration: none;
    padding: 12px 15px;
    border-radius: 8px;
    transition: all 0.3s;
    font-weight: 600;
}

.sidebar-menu a i {
    font-size: 1.2rem;
    margin-right: 15px;
    width: 20px;
    text-align: center;
}

.sidebar.collapsed .sidebar-menu a {
    justify-content: center;
    padding: 12px 0;
}

.sidebar.collapsed .sidebar-menu a i {
    margin-right: 0;
}

.sidebar.collapsed .sidebar-menu a span.menu-text {
    display: none;
}

.sidebar-menu li.active a,
.sidebar-menu a:hover {
    background: var(--accent);
    color: white;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

.logout-btn {
    display: flex;
    align-items: center;
    color: var(--text-main);
    text-decoration: none;
    padding: 12px 15px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s;
    font-weight: 600;
}

.logout-btn i {
    margin-right: 15px;
}

.logout-btn:hover {
    background: #ff1a1a;
    color: white;
}

.sidebar.collapsed .logout-btn {
    justify-content: center;
    padding: 12px 0;
}

.sidebar.collapsed .logout-btn i {
    margin-right: 0;
}

/* Main Content Wrapper */
.main-content {
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    transition: all 0.3s ease;
    width: calc(100% - var(--sidebar-width));
}

.main-content.expanded {
    margin-left: var(--collapsed-width);
    width: calc(100% - var(--collapsed-width));
}

/* Topbar */
.topbar {
    background: var(--nav-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 999;
}

.toggle-btn {
    font-size: 1.5rem;
    color: var(--text-main);
    cursor: pointer;
    transition: color 0.3s;
}

.toggle-btn:hover {
    color: var(--accent);
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 8px 20px;
    width: 300px;
}

.search-bar i {
    color: var(--text-muted);
    margin-right: 10px;
}

.search-bar input {
    background: transparent;
    border: none;
    color: var(--text-main);
    outline: none;
    width: 100%;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    position: relative;
    transition: color 0.3s;
}

.icon-btn:hover {
    color: var(--text-main);
}

.notification-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
}

.profile {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 600;
}

.profile img {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
}

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

.page-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
}

.stat-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.stat-info h3 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 5px;
}

.trend {
    font-size: 0.85rem;
    font-weight: 600;
}

.trend.up {
    color: #00e676;
}

.trend.down {
    color: #ff1a1a;
}

/* Data Table */
.recent-orders-section {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.4rem;
    font-weight: 600;
}

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 15px 10px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.data-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    font-weight: 500;
}

.status-badge {
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-badge.pending {
    background: rgba(250, 204, 21, 0.1);
    color: #facc15;
}

.status-badge.completed {
    background: rgba(0, 229, 255, 0.1);
    color: #00e5ff;
}

.status-badge.delivered {
    background: rgba(0, 230, 118, 0.1);
    color: #00e676;
}

.status-badge.cancelled {
    background: rgba(255, 26, 26, 0.1);
    color: #ff1a1a;
}

.action-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    transition: color 0.3s;
}

.action-btn:hover {
    color: var(--text-main);
}

.btn.secondary-btn {
    background: var(--bg-color);
    border: 1px solid var(--text-main);
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 8px;
    font-weight: 600;
}

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

/* Admin Sections */
.admin-section {
    display: none;
    padding: 2rem;
    animation: fadeIn 0.4s ease;
}

.admin-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--card-bg);
    margin: 5% auto;
    padding: 2rem;
    border: 1px solid var(--border-color);
    width: 500px;
    border-radius: 16px;
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.2);
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.close-modal {
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: var(--accent);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.admin-input,
form input,
form select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.3s;
}

.admin-input:focus,
form input:focus {
    border-color: var(--accent);
}

.primary-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.primary-btn:hover {
    background: #059669;
    box-shadow: 0 0 15px var(--accent-glow);
}

.card-view {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1rem;
}

.product-img-mini {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
    background: #222;
}

.flex-center {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Responsive Options */
@media (max-width: 991px) {
    .sidebar {
        width: var(--collapsed-width);
    }

    .sidebar-header h2 {
        font-size: 1.2rem;
    }

    .sidebar-menu a {
        justify-content: center;
        padding: 12px 0;
    }

    .sidebar-menu a i {
        margin-right: 0;
    }

    .sidebar-menu a span.menu-text {
        display: none;
    }

    .main-content {
        margin-left: var(--collapsed-width);
        width: calc(100% - var(--collapsed-width));
    }
}

@media (max-width: 600px) {
    .modal-content {
        width: 90%;
        margin: 20% auto;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}