:root {
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --dark: #111827;
    --gray-900: #111827;
    --gray-800: #1F2937;
    --gray-700: #374151;
    --gray-600: #4B5563;
    --gray-500: #6B7280;
    --gray-400: #9CA3AF;
    --gray-300: #D1D5DB;
    --gray-200: #E5E7EB;
    --gray-100: #F3F4F6;
    --gray-50: #F9FAFB;
    --white: #ffffff;
    --danger: #EF4444;
    --success: #10B981;
    --warning: #F59E0B;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; background-color: var(--gray-50); color: var(--gray-800); }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

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

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--dark);
    color: var(--gray-300);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.sidebar-header {
    height: 4.5rem;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    background-color: rgba(0,0,0,0.2);
}

.logo {
    color: var(--white);
    font-size: 1.25rem;
    font-weight: 700;
}

.sidebar-nav {
    flex-grow: 1;
    padding: 1.5rem 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    color: var(--gray-400);
    transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
    color: var(--white);
    background-color: rgba(255,255,255,0.05);
    border-left: 3px solid var(--primary);
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--gray-800);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-user { font-size: 0.875rem; color: var(--gray-300); display: flex; align-items: center; gap: 0.5rem; }
.logout-btn { color: var(--gray-400); }
.logout-btn:hover { color: var(--danger); }

/* Main Content */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    height: 4.5rem;
    background-color: var(--white);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    padding: 0 2rem;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-600);
    margin-right: 1rem;
    cursor: pointer;
}

.content-wrapper {
    padding: 2rem;
    flex-grow: 1;
}

/* UI Components */
.card {
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: 0 1px 3px 0 rgba(0,0,0,0.1);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

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

.stat-card {
    display: flex;
    align-items: center;
    padding: 1.5rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background-color: var(--primary);
    color: var(--white);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    margin-right: 1rem;
}

.stat-icon.success { background-color: var(--success); }
.stat-icon.warning { background-color: var(--warning); }

.stat-content h3 { font-size: 0.875rem; color: var(--gray-500); font-weight: 500; }
.stat-content .value { font-size: 1.5rem; font-weight: 700; color: var(--gray-900); }

/* Tables */
.table-responsive { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 1rem; text-align: left; border-bottom: 1px solid var(--gray-200); }
.table th { background-color: var(--gray-50); font-weight: 600; color: var(--gray-700); font-size: 0.875rem; }
.table tr:hover { background-color: var(--gray-50); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
}
.btn-primary { background-color: var(--primary); color: white; }
.btn-primary:hover { background-color: var(--primary-hover); }
.btn-danger { background-color: var(--danger); color: white; }
.btn-danger:hover { background-color: #DC2626; }
.btn-outline { border-color: var(--gray-300); color: var(--gray-700); background: white; }
.btn-outline:hover { background-color: var(--gray-50); }
.btn-sm { padding: 0.25rem 0.5rem; font-size: 0.75rem; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-weight: 500; margin-bottom: 0.5rem; font-size: 0.875rem; }
.form-control { width: 100%; padding: 0.625rem; border: 1px solid var(--gray-300); border-radius: 6px; font-family: inherit; }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,0.1); }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-row { display: flex; gap: 1rem; }
.form-row .form-group { flex: 1; }

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

/* Badges */
.badge { padding: 0.25rem 0.5rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 600; }
.badge-success { background-color: #D1FAE5; color: #065F46; }
.badge-secondary { background-color: #E0E7FF; color: #3730A3; }

/* Responsive */
@media (max-width: 768px) {
    .sidebar { position: fixed; height: 100vh; z-index: 100; transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .mobile-toggle { display: block; }
    .form-row { flex-direction: column; gap: 0; }
}
