:root {
    --primary: #0f1535;
    --primary-dark: #0a0e27;
    --secondary: #ff6b35;
    --secondary-dark: #e55a2b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --text-dark: #1e293b;
    --text-gray: #64748b;
    --text-light: #94a3b8;
    --bg-light: #f8fafc;
    --white: #ffffff;
    --sidebar-width: 280px;
    --mobile-sidebar-width: 260px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-light);
    overflow-x: hidden;
    position: relative;
}

/* Admin Container */
.admin-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* ============================================ */
/* SIDEBAR - Desktop & Mobile Responsive */
/* ============================================ */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: transform 0.3s ease-in-out;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

/* Custom scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--secondary);
    border-radius: 5px;
}

/* Sidebar Header */
.sidebar-header {
    padding: 25px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header .logo-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--secondary), #ff8c42);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
}

.sidebar-header .logo-icon i {
    font-size: 1.5rem;
}

.sidebar-header h3 {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.sidebar-header p {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Sidebar Menu */
.sidebar-menu {
    padding: 20px 0;
}

.menu-item {
    padding: 12px 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s;
    position: relative;
}

.menu-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.menu-item.active {
    background: rgba(255,107,53,0.2);
    color: var(--secondary);
    border-left: 3px solid var(--secondary);
}

.menu-item i {
    width: 20px;
    font-size: 1.1rem;
}

.menu-item span {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    background: var(--secondary);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: all 0.3s;
    align-items: center;
    justify-content: center;
}

.mobile-menu-toggle:hover {
    background: var(--secondary-dark);
    transform: scale(1.05);
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    transition: all 0.3s;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 20px;
    transition: all 0.3s;
    width: 100%;
}

/* Top Bar */
.top-bar {
    background: white;
    border-radius: 15px;
    padding: 15px 25px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    flex-wrap: wrap;
    gap: 15px;
}

.page-title h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.page-title p {
    color: var(--text-gray);
    font-size: 0.85rem;
}

.admin-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.admin-avatar {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--secondary), #ff8c42);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.logout-btn {
    background: var(--danger);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.logout-btn:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.stat-icon i {
    font-size: 1.5rem;
}

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

.stat-info p {
    color: var(--text-gray);
    font-size: 0.85rem;
}

/* Tables - Fully Responsive */
.table-container {
    background: white;
    border-radius: 20px;
    padding: 20px;
    overflow-x: auto;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

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

.data-table th {
    text-align: left;
    padding: 12px;
    background: var(--bg-light);
    font-weight: 600;
    color: var(--text-dark);
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.data-table tr:hover {
    background: var(--bg-light);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--secondary), #ff8c42);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255,107,53,0.3);
}

.btn-danger {
    background: var(--danger);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-warning {
    background: var(--warning);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-success {
    background: var(--success);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Form Styles - Mobile Responsive */
.form-container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    max-width: 800px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.9rem;
    transition: all 0.3s;
    font-family: 'Inter', sans-serif;
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(255,107,53,0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.image-preview {
    margin-top: 10px;
    max-width: 200px;
}

.image-preview img {
    width: 100%;
    border-radius: 10px;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}

.status-paid {
    background: #d1fae5;
    color: #065f46;
}

.status-pending {
    background: #fed7aa;
    color: #92400e;
}

.status-failed {
    background: #fee2e2;
    color: #991b1b;
}

/* Dashboard Row Layout */
.row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Alert Box */
.alert {
    padding: 12px 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--success);
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--danger);
}

/* ============================================ */
/* MOBILE RESPONSIVE BREAKPOINTS */
/* ============================================ */

/* Tablet and Mobile */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    /* Show mobile menu toggle */
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* Sidebar hidden by default on mobile */
    .sidebar {
        transform: translateX(-100%);
        width: var(--mobile-sidebar-width);
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1002;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    /* Show overlay when sidebar is active */
    .sidebar-overlay.active {
        display: block;
    }
    
    /* Main content full width on mobile */
    .main-content {
        margin-left: 0;
        padding: 70px 15px 20px 15px;
        width: 100%;
    }
    
    /* Top Bar Mobile */
    .top-bar {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }
    
    .page-title h2 {
        font-size: 1.2rem;
    }
    
    .page-title p {
        font-size: 0.75rem;
    }
    
    .admin-info {
        justify-content: center;
    }
    
    /* Stats Grid Mobile */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-info h3 {
        font-size: 1.5rem;
    }
    
    /* Table Container Mobile */
    .table-container {
        padding: 15px;
        overflow-x: auto;
    }
    
    .data-table {
        min-width: 500px;
        font-size: 0.85rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px;
    }
    
    /* Form Container Mobile */
    .form-container {
        padding: 20px;
        margin: 0 10px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-group label {
        font-size: 0.9rem;
    }
    
    .form-control {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    /* Buttons Mobile */
    .btn-primary {
        padding: 8px 16px;
        font-size: 0.85rem;
        width: 100%;
        justify-content: center;
    }
    
    .btn-danger,
    .btn-warning,
    .btn-success {
        padding: 5px 10px;
        font-size: 0.7rem;
    }
    
    /* Action buttons in tables */
    .data-table td .btn-danger,
    .data-table td .btn-warning,
    .data-table td .btn-success {
        margin: 2px;
        display: inline-block;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .main-content {
        padding: 65px 10px 15px 10px;
    }
    
    .mobile-menu-toggle {
        width: 40px;
        height: 40px;
        top: 12px;
        left: 12px;
        font-size: 1rem;
    }
    
    .top-bar {
        padding: 12px;
    }
    
    .page-title h2 {
        font-size: 1rem;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
    }
    
    .stat-icon i {
        font-size: 1.2rem;
    }
    
    .stat-info h3 {
        font-size: 1.2rem;
    }
    
    .table-container {
        padding: 10px;
    }
    
    .data-table {
        min-width: 450px;
        font-size: 0.75rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 6px;
    }
    
    .form-container {
        padding: 15px;
    }
    
    .form-group label {
        font-size: 0.85rem;
    }
    
    .form-control {
        padding: 8px 10px;
        font-size: 0.8rem;
    }
    
    /* Stack buttons on mobile */
    .data-table td {
        white-space: nowrap;
    }
    
    .btn-danger,
    .btn-warning,
    .btn-success {
        padding: 4px 8px;
        font-size: 0.65rem;
    }
}

/* Extra Small Devices */
@media (max-width: 380px) {
    .data-table {
        min-width: 400px;
        font-size: 0.7rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 5px;
    }
    
    .btn-danger,
    .btn-warning,
    .btn-success {
        padding: 3px 6px;
        font-size: 0.6rem;
    }
}

/* Fix for dashboard charts on mobile */
@media (max-width: 768px) {
    canvas {
        max-height: 250px !important;
        width: 100% !important;
    }
}

/* Fix for category management grid on mobile */
@media (max-width: 768px) {
    .form-container + .table-container {
        margin-top: 20px;
    }
}