/* ======================================
   Admin Layout & Sidebar
   ====================================== */

.admin-layout {
    display: flex;
    min-height: 100vh;
    background: #f5f6fa;
}

/* Sidebar */
.admin-sidebar {
    width: 260px;
    background: #2c3e50;
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 25px 20px;
    background: #34495e;
    border-bottom: 1px solid #465669;
}

.sidebar-header h4 {
    color: white;
    font-size: 18px;
    font-weight: 600;
}

.sidebar-nav {
    padding: 20px 0;
}

.sidebar-nav .nav-link {
    color: #ecf0f1;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link i {
    width: 24px;
    margin-right: 12px;
    font-size: 18px;
}

.sidebar-nav .nav-link:hover {
    background: #34495e;
    color: white;
    text-decoration: none;
}

.sidebar-nav .nav-link.active {
    background: #34495e;
    border-left-color: #3498db;
    color: white;
}

.sidebar-nav .nav-link-secondary {
    color: #95a5a6;
    border-top: 1px solid #465669;
    margin-top: 10px;
    padding-top: 20px;
}

.sidebar-nav .nav-link-secondary:hover {
    background: #34495e;
    color: #3498db;
}

/* Main Content */
.admin-main {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
}

/* Top Bar */
.admin-topbar {
    background: white;
    padding: 15px 25px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 999;
}

.sidebar-toggle {
    display: none;
    color: #2c3e50;
    font-size: 20px;
    padding: 8px;
}

/* Content Area */
.admin-content {
    padding: 30px 25px;
    flex: 1;
}

/* Override body wrapper for admin pages */
.admin-layout .body_wrapper {
    padding-top: 0 !important;
}

/* Admin Page Headers */
.admin-page-header {
    margin-bottom: 30px;
}

.admin-page-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.admin-page-header p {
    color: #7f8c8d;
    margin: 0;
}

/* Stats Cards */
.stat-card {
    background: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 5px;
    color: #2c3e50;
}

.stat-card p {
    color: #7f8c8d;
    margin: 0;
    font-size: 14px;
}

.stat-card i {
    font-size: 36px;
    opacity: 0.2;
}

/* Responsive */
@media (max-width: 991px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-sidebar.show {
        transform: translateX(0);
    }

    .admin-main {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: block;
    }
}

@media (max-width: 767px) {
    .admin-content {
        padding: 20px 15px;
    }

    .admin-page-header h1 {
        font-size: 22px;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-card h3 {
        font-size: 24px;
    }
}

/* ======================================
   Mobile Admin Improvements
   ====================================== */

/* Mobile Admin Improvements */

/* Sidebar Backdrop for Mobile (Hidden on Desktop) */
.sidebar-backdrop {
    display: none;
}

@media (max-width: 991px) {
    .sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .sidebar-backdrop.show {
        display: block;
        opacity: 1;
    }
}

/* Mobile Responsive Adjustments for Admin */
@media (max-width: 991px) {
    .admin-sidebar {
        transform: translateX(-100%);
        z-index: 1000;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
    }

    .admin-sidebar.show {
        transform: translateX(0);
    }

    .admin-main {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: block;
        padding: 0.75rem;
        color: #2c3e50;
        font-size: 1.5rem;
        background: transparent;
        border: none;
        cursor: pointer;
        min-width: 44px;
        min-height: 44px;
    }

    .sidebar-toggle:hover {
        background-color: rgba(0, 0, 0, 0.05);
        border-radius: 0.25rem;
    }
}

@media (max-width: 767px) {
    .admin-content {
        padding: 20px 15px;
    }

    .admin-page-header h1 {
        font-size: 22px;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-card h3 {
        font-size: 24px;
    }

    /* Admin Tables - Better mobile view */
    .admin-table {
        font-size: 0.875rem;
    }

    .admin-table .btn-sm {
        min-width: 36px;
        min-height: 36px;
        padding: 0.375rem 0.5rem;
        font-size: 0.8rem;
    }
}

/* Mobile Improvements for Admin Cards and Forms */
@media (max-width: 576px) {

    /* Admin Cards Stack */
    .row>[class*="col-"] {
        margin-bottom: 1rem;
    }

    /* Admin Filters */
    .card .row .col-md-4,
    .card .row .col-md-3 {
        margin-bottom: 0.75rem;
    }

    /* Admin Modal Improvements */
    .modal-xl {
        max-width: 100%;
        margin: 0.5rem;
    }

    /* Admin Buttons in Modals */
    .modal-footer .btn {
        flex: 1;
        margin: 0.25rem;
    }
}