﻿

:root {
    --primary-color: #4f46e5; /* Indigo */
    --primary-hover: #4338ca;
    --sidebar-bg: #111827; /* Dark Slate */
    --sidebar-text: #9ca3af;
    --sidebar-active: #ffffff;
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --border-color: #e5e7eb;
    --sidebar-width: 260px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    display: flex;
    min-height: 100vh;
}

/* --- SIDEBAR --- */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.sidebar-brand {
    height: 70px;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

    .sidebar-brand a {
        font-size: 1.25rem;
        font-weight: 700;
        color: #fff;
        text-decoration: none;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .sidebar-brand i {
        color: var(--primary-color);
    }

.sidebar-menu {
    padding: 1.5rem 1rem;
    flex-grow: 1;
    overflow-y: auto;
}

.menu-header {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #4b5563;
    margin-bottom: 1rem;
    padding-left: 1rem;
    font-weight: 600;
}

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: var(--transition);
    cursor: pointer;
}

    .nav-link:hover, .nav-link.active {
        background-color: rgba(255,255,255,0.05);
        color: var(--sidebar-active);
    }

    .nav-link i.icon-left {
        width: 20px;
        text-align: center;
        margin-right: 10px;
    }

    .nav-link i.arrow {
        font-size: 0.8rem;
        transition: transform 0.3s;
    }

/* Dropdown Logic */
.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding-left: 1rem;
}

.nav-item.open .submenu {
    max-height: 200px; /* Adjust based on content */
    margin-top: 0.25rem;
}

.nav-item.open .nav-link i.arrow {
    transform: rotate(180deg);
}

.submenu a {
    display: block;
    padding: 0.6rem 1rem 0.6rem 2.8rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: 0.375rem;
    transition: var(--transition);
}

    .submenu a:hover {
        color: #fff;
        background-color: rgba(255,255,255,0.03);
    }

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* --- MAIN CONTENT --- */
.main-content {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    padding: 2rem;
    transition: var(--transition);
}

/* Top Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.toggle-sidebar {
    display: none; /* Hidden on desktop */
    font-size: 1.25rem;
    background: none;
    border: none;
    color: var(--text-dark);
    cursor: pointer;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    text-align: right;
}

.user-name {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
}

.user-role {
    font-size: 0.8rem;
    color: var(--text-light);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

    .stat-icon.blue {
        background: #e0e7ff;
        color: #4f46e5;
    }

    .stat-icon.green {
        background: #dcfce7;
        color: #16a34a;
    }

    .stat-icon.orange {
        background: #ffedd5;
        color: #ea580c;
    }

    .stat-icon.purple {
        background: #f3e8ff;
        color: #9333ea;
    }

.stat-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

.stat-info p {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Content Section */
.content-card {
    background: var(--card-bg);
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    padding: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.3s;
    border: none;
    cursor: pointer;
}

    .btn-primary:hover {
        background-color: var(--primary-hover);
    }

/* Table */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-light);
    font-weight: 600;
    background-color: #f9fafb;
}

td {
    font-size: 0.875rem;
    color: var(--text-dark);
}

.status {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

    .status.active {
        background-color: #dcfce7;
        color: #16a34a;
    }

    .status.pending {
        background-color: #ffedd5;
        color: #ea580c;
    }

/* Responsive Styles */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

        .sidebar.active {
            transform: translateX(0);
        }

    .main-content {
        margin-left: 0;
    }

    .toggle-sidebar {
        display: block;
    }
}

