/* Dashboard Layout */
.layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    height: 100vh;
    position: fixed;
    border-radius: 0;
    border-left: none;
    border-top: none;
    border-bottom: none;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

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

.text-primary {
    color: var(--primary);
}

.text-danger {
    color: var(--danger);
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-item i {
    font-size: 1.25rem;
}

.nav-item:hover, .nav-item.active {
    background: rgba(255, 69, 0, 0.15);
    color: var(--primary);
    border-left: 3px solid var(--primary);
}

.nav-item.text-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

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

.sidebar-collapse {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 2rem 3rem;
}

.topbar {
    margin-bottom: 2rem;
}

.topbar h1 {
    font-size: 2rem;
}

.topbar p {
    color: var(--text-muted);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px -10px rgba(0, 240, 255, 0.25);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: rgba(0, 240, 255, 0.15);
    color: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.mvp-card .stat-icon {
    background: rgba(255, 69, 0, 0.15);
}

.stat-info h3 {
    font-size: 1rem;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-weight: 500;
}

.stat-info p {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    font-family: var(--font-heading);
}

/* Common Utilities */
.mt-4 {
    margin-top: 2rem;
}

.content-section {
    padding: 2rem;
}

.content-section h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

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

.table th, .table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.text-center {
    text-align: center;
}

/* Mobile Responsiveness */
.mobile-only { display: none; }

@media (max-width: 992px) {
    .mobile-only { display: flex !important; align-items: center; justify-content: center; }

    .layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 0.5rem;
    }

    .sidebar-header {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: space-between !important;
        align-items: center !important;
        border-bottom: none;
        padding: 0.5rem 1rem;
    }
    
    .sidebar-header-subtitle {
        display: none;
    }

    .sidebar-collapse {
        display: none; /* hidden by default on mobile */
        flex-direction: column;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: 12px;
        position: absolute;
        top: 100%;
        left: 1rem;
        right: 1rem;
        z-index: 1000;
        box-shadow: 0 10px 25px rgba(0,0,0,0.8);
    }

    .sidebar-collapse.active {
        display: flex;
    }
    
    .sidebar-nav {
        display: flex;
        flex-direction: column;
        padding: 0.5rem;
    }

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

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

    .topbar > div {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1rem;
        text-align: center;
    }

    .filter-bar {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
    }
    
    .modal-content {
        margin: 1rem !important;
        padding: 1.5rem !important;
        width: auto !important;
    }
}
