@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500&display=swap');

:root {
    /* Brand Colors - Premium SaaS Purple */
    --primary: #7C3AED;
    --primary-dark: #6D28D9;
    --primary-light: #8B5CF6;
    --primary-soft: rgba(124, 58, 237, 0.1);
    --secondary: #8B5CF6;
    --accent: #A78BFA;
    --highlight: #F59E0B;
    
    /* Status Colors */
    --success: #22C55E;
    --success-light: rgba(34, 197, 94, 0.1);
    --warning: #F59E0B;
    --warning-light: rgba(245, 158, 11, 0.1);
    --danger: #EF4444;
    --danger-light: rgba(239, 68, 68, 0.1);
    --info: #3B82F6;
    --info-light: rgba(59, 130, 246, 0.1);
    
    /* Gradients */
    --grad-brand: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 50%, #6D28D9 100%);
    --grad-brand-hover: linear-gradient(135deg, #7C3AED 0%, #6D28D9 50%, #5B21B6 100%);
    --grad-dark: linear-gradient(180deg, #1E1B2E 0%, #0F0A1E 100%);
    
    /* Backgrounds */
    --bg-main: #F8F9FC;
    --bg-card: #FFFFFF;
    --bg-dark: #1E1B2E;
    --bg-glass: rgba(255, 255, 255, 0.7);
    --bg-glass-dark: rgba(30, 27, 46, 0.8);
    --bg-hover: #F3F4F8;
    
    /* Text Colors */
    --text-main: #1E1B2E;
    --text-secondary: #4B5563;
    --text-muted: #9CA3AF;
    --text-light: #F9FAFB;
    
    /* Borders */
    --border-light: rgba(255, 255, 255, 0.8);
    --border-dark: rgba(255, 255, 255, 0.08);
    --border-gray: #E5E7EB;
    --border-soft: #F3F4F6;
    
    /* UI Variables */
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 9999px;
    
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06), 0 2px 6px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 24px 60px rgba(0, 0, 0, 0.10), 0 8px 24px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 32px rgba(124, 58, 237, 0.25);
    --shadow-purple: 0 4px 20px rgba(124, 58, 237, 0.15);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode */
html[data-bs-theme="dark"] {
    --primary: #A78BFA;
    --primary-dark: #8B5CF6;
    --primary-light: #C4B5FD;
    --primary-soft: rgba(167, 139, 250, 0.15);
    --secondary: #A78BFA;
    --accent: #C4B5FD;
    
    --grad-brand: linear-gradient(135deg, #A78BFA 0%, #8B5CF6 50%, #7C3AED 100%);
    --grad-brand-hover: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 50%, #6D28D9 100%);
    --grad-dark: linear-gradient(180deg, #0F0A1E 0%, #000000 100%);
    
    --bg-main: #0F0A1E;
    --bg-card: #1E1B2E;
    --bg-dark: #000000;
    --bg-glass: rgba(30, 27, 46, 0.8);
    --bg-glass-dark: rgba(15, 10, 30, 0.9);
    --bg-hover: #2A2540;
    
    --text-main: #F9FAFB;
    --text-secondary: #D1D5DB;
    --text-muted: #9CA3AF;
    --text-light: #1E1B2E;
    
    --border-light: rgba(255, 255, 255, 0.08);
    --border-dark: rgba(255, 255, 255, 0.04);
    --border-gray: #374151;
    --border-soft: #2A2540;
    
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 24px 60px rgba(0, 0, 0, 0.6), 0 8px 24px rgba(0, 0, 0, 0.4);
}

html[data-bs-theme="dark"] body {
    background-color: var(--bg-main);
    color: var(--text-main);
}

html[data-bs-theme="dark"] .navbar {
    background: var(--bg-card) !important;
    border-bottom-color: var(--border-gray) !important;
}

html[data-bs-theme="dark"] .form-control,
html[data-bs-theme="dark"] .form-select {
    background-color: var(--bg-hover);
    border-color: var(--border-gray);
    color: var(--text-main);
}

html[data-bs-theme="dark"] .form-control:focus,
html[data-bs-theme="dark"] .form-select:focus {
    background-color: var(--bg-hover);
    color: var(--text-main);
}

html[data-bs-theme="dark"] .modal-content {
    background-color: var(--bg-card);
    border-color: var(--border-gray);
}

html[data-bs-theme="dark"] .dropdown-menu {
    background-color: var(--bg-card);
    border-color: var(--border-gray);
}

html[data-bs-theme="dark"] .dropdown-item:hover {
    background-color: var(--bg-hover);
}

html[data-bs-theme="dark"] .table {
    --bs-table-bg: var(--bg-card);
    --bs-table-color: var(--text-main);
    --bs-table-border-color: var(--border-gray);
}

html[data-bs-theme="dark"] .card {
    background-color: var(--bg-card);
    border-color: var(--border-gray);
    color: var(--text-main);
}

html[data-bs-theme="dark"] .text-dark {
    color: var(--text-main) !important;
}

html[data-bs-theme="dark"] .bg-light {
    background-color: var(--bg-hover) !important;
}

html[data-bs-theme="dark"] .bg-white {
    background-color: var(--bg-card) !important;
}

html[data-bs-theme="dark"] .text-muted {
    color: var(--text-muted) !important;
}

/* Skip to content link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: #fff;
    padding: 8px 16px;
    z-index: 9999;
    border-radius: 0 0 var(--radius-sm) 0;
    text-decoration: none;
    font-weight: 600;
    transition: top 0.2s;
}
.skip-link:focus {
    top: 0;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    margin: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}
a:hover {
    color: var(--secondary);
}

/* Typography Enhancements */
h1, h2, h3, h4, h5, h6 {
    letter-spacing: -0.03em;
    font-weight: 800;
    line-height: 1.2;
    margin-top: 0;
}

.gradient-text {
    background: var(--grad-brand);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* Glassmorphism & Cards */
.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.glass-panel-dark {
    background: var(--bg-glass-dark);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    color: var(--text-light);
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-gray);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    border-color: rgba(124, 58, 237, 0.2);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 15px;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    text-align: center;
    letter-spacing: -0.01em;
}
.btn-primary {
    background: var(--grad-brand);
    color: #FFFFFF;
    box-shadow: 0 4px 14px 0 rgba(124, 58, 237, 0.25);
}
.btn-primary:hover {
    background: var(--grad-brand-hover);
    color: #FFFFFF;
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.35);
    transform: translateY(-2px);
}
.btn-secondary {
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-gray);
    box-shadow: var(--shadow-xs);
}
.btn-secondary:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary);
    transform: translateY(-1px);
}
.btn-glow {
    background: var(--grad-brand);
    color: #FFFFFF;
    box-shadow: var(--shadow-glow);
    position: relative;
    overflow: hidden;
}
.btn-glow::after {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shine 3s infinite;
}
.btn-glow:hover {
    color: #FFFFFF;
    transform: scale(1.02);
    box-shadow: 0 0 40px rgba(124, 58, 237, 0.4);
}
@keyframes shine {
    0% { left: -100%; }
    20% { left: 200%; }
    100% { left: 200%; }
}

/* Animations */
@keyframes float {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(1deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}
.floating {
    animation: float 8s ease-in-out infinite;
}
.floating-delayed {
    animation: float 9s ease-in-out infinite;
    animation-delay: -4s;
}

/* Aurora Background */
.aurora-bg {
    position: relative;
    overflow-x: hidden;
    background: var(--bg-main);
}
.aurora-bg::before, .aurora-bg::after {
    content: '';
    position: absolute;
    width: 800px;
    height: 800px;
    border-radius: 50%;
    filter: blur(120px);
    z-index: 0;
    animation: float 25s infinite alternate ease-in-out;
    opacity: 0.6;
    pointer-events: none;
}
.aurora-bg::before {
    background: rgba(124, 58, 237, 0.12);
    top: -300px;
    left: -200px;
}
.aurora-bg::after {
    background: rgba(167, 139, 250, 0.10);
    top: 20%;
    right: -200px;
    animation-delay: -12s;
}
.mesh-gradient {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: 
        radial-gradient(at 0% 0%, rgba(124, 58, 237, 0.10) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(139, 92, 246, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(167, 139, 250, 0.06) 0px, transparent 50%);
    z-index: 0;
    pointer-events: none;
}

/* Forms */
.form-control {
    border: 1px solid var(--border-gray);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    background: var(--bg-card);
    transition: var(--transition);
    font-size: 15px;
    color: var(--text-main);
    box-shadow: var(--shadow-xs);
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft), var(--shadow-xs);
}
.form-control::placeholder {
    color: var(--text-muted);
}

/* Utilities */
.relative { position: relative; }
.z-10 { z-index: 10; }
.z-50 { z-index: 50; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.flex { display: flex; }
.grid { display: grid; }
.gap-4 { gap: 16px; }
.gap-8 { gap: 32px; }
.text-center { text-align: center; }

/* Dashboard Layout */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
    background: var(--bg-main);
}
.sidebar {
    width: 280px;
    background: var(--bg-dark);
    border-right: 1px solid var(--border-dark);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 40;
}
.main-content {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
}
.topbar {
    height: 72px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-gray);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 30;
}
.content-area {
    padding: 40px;
    flex: 1;
}

/* Legacy Compatibility Classes */
.glass-card { background: var(--bg-card); border: 1px solid var(--border-gray); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 24px; transition: var(--transition); }
.glass-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: rgba(124, 58, 237, 0.2); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.form-mb { margin-bottom: 24px; }
.form-label { display: block; font-weight: 600; margin-bottom: 8px; color: var(--text-main); font-size: 14px; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.fw-900 { font-weight: 900; }
.text-violet { color: var(--primary); }
.bg-violet-50 { background: var(--primary-light); }
.border-violet-100 { border-color: var(--primary-light); }
.badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: var(--radius-full); font-weight: 600; font-size: 12px; }
.admin-table-card { background: var(--bg-card); border-radius: var(--radius-lg); border: 1px solid var(--border-gray); overflow: hidden; box-shadow: var(--shadow-sm); }
.table-glass { width: 100%; border-collapse: collapse; }
.table-glass th, .table-glass td { padding: 16px; text-align: left; border-bottom: 1px solid var(--border-gray); }
.table-glass th { font-weight: 600; color: var(--text-muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; }
.page-title { font-size: 24px; font-weight: 800; margin: 0; }
.content-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 32px; }
.stat-card { padding: 24px; }
.stat-icon { width: 48px; height: 48px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 16px; }
.stat-title { font-size: 14px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }
.stat-value { font-size: 32px; font-weight: 800; }

/* ===== Animations ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-fade-in { animation: fadeIn 0.4s ease-out; }
.animate-fade-in-up { animation: fadeInUp 0.5s ease-out; }
.animate-fade-in-down { animation: fadeInDown 0.5s ease-out; }
.animate-scale-in { animation: scaleIn 0.3s ease-out; }
.animate-slide-in-left { animation: slideInLeft 0.4s ease-out; }
.animate-slide-in-right { animation: slideInRight 0.4s ease-out; }

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #F3F4F6 25%, #E5E7EB 50%, #F3F4F6 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
    border-radius: var(--radius-sm);
}

/* Staggered animation delays */
.delay-0 { animation-delay: 0s; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* ===== Additional Utilities ===== */
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.flex-1 { flex: 1; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-6 { gap: 24px; }
.w-auto { width: auto; }
.h-auto { height: auto; }
.cursor-pointer { cursor: pointer; }
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-sm { font-size: 14px; }
.text-xs { font-size: 12px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 20px; }
.text-2xl { font-size: 24px; }
.text-3xl { font-size: 30px; }
.text-4xl { font-size: 36px; }
.text-5xl { font-size: 48px; }
.text-muted { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-primary { color: var(--primary) !important; }
.text-white { color: #FFFFFF !important; }
.bg-primary { background: var(--primary) !important; }
.bg-success { background: var(--success) !important; }
.bg-warning { background: var(--warning) !important; }
.bg-danger { background: var(--danger) !important; }
.bg-card { background: var(--bg-card) !important; }
.bg-main { background: var(--bg-main) !important; }
.bg-hover { background: var(--bg-hover) !important; }
.rounded-sm { border-radius: var(--radius-sm) !important; }
.rounded-md { border-radius: var(--radius-md) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }
.rounded-xl { border-radius: var(--radius-xl) !important; }
.rounded-full { border-radius: var(--radius-full) !important; }
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }
.shadow-xl { box-shadow: var(--shadow-xl) !important; }
.shadow-glow { box-shadow: var(--shadow-glow) !important; }
.border { border: 1px solid var(--border-gray); }
.border-0 { border: none !important; }
.transition { transition: var(--transition); }
.transition-fast { transition: var(--transition-fast); }
.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }
.opacity-100 { opacity: 1; }
.hover-lift { transition: var(--transition); }
.hover-lift:hover { transform: translateY(-2px); }
.hover-scale { transition: var(--transition); }
.hover-scale:hover { transform: scale(1.02); }
.position-relative { position: relative; }
.position-absolute { position: absolute; }
.position-fixed { position: fixed; }
.position-sticky { position: sticky; }

/* ===== Badge System ===== */
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-info { background: var(--info-light); color: var(--info); }
.badge-secondary { background: #F3F4F6; color: #4B5563; }

/* ===== Alert System ===== */
.alert { padding: 16px 20px; border-radius: var(--radius-md); font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 12px; }
.alert-success { background: var(--success-light); color: #15803D; border: 1px solid rgba(34, 197, 94, 0.2); }
.alert-warning { background: var(--warning-light); color: #B45309; border: 1px solid rgba(245, 158, 11, 0.2); }
.alert-danger { background: var(--danger-light); color: #B91C1C; border: 1px solid rgba(239, 68, 68, 0.2); }
.alert-info { background: var(--info-light); color: #1D4ED8; border: 1px solid rgba(59, 130, 246, 0.2); }

/* ===== Scrollbar Styling ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: #9CA3AF; }

/* ===== Focus Visible ===== */
*:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ===== Table Scroll Wrapper ===== */
.table-responsive-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-responsive-wrap table { min-width: 600px; }

/* ===== Responsive Sidebar ===== */
@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); transition: transform 0.3s ease; }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 39; }
    .sidebar-overlay.show { display: block; }
}

@media (max-width: 991px) {
    .content-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .text-5xl { font-size: 36px !important; }
    .text-4xl { font-size: 28px !important; }
}

@media (max-width: 768px) {
    .content-area { padding: 20px; }
    .topbar { padding: 0 16px; height: 60px; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .content-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .text-5xl { font-size: 28px !important; }
    .text-4xl { font-size: 24px !important; }
    .text-3xl { font-size: 22px !important; }
    .stat-value { font-size: 24px; }
    .page-title { font-size: 20px; }
    .glass-card, .card { padding: 16px; }
    .btn { padding: 10px 20px; font-size: 14px; }
    .content-area { padding: 16px; }
    .container { max-width: 100%; padding: 0 16px; }
    section { overflow-x: hidden; }
}

@media (max-width: 576px) {
    .content-area { padding: 12px; }
    .topbar { padding: 0 12px; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .text-5xl { font-size: 24px !important; }
    .text-4xl { font-size: 22px !important; }
    .text-3xl { font-size: 20px !important; }
    .glass-card, .card { padding: 14px; }
    .stat-card { padding: 16px; }
    .stat-value { font-size: 22px; }
    .btn { width: 100%; }
    .btn-auto { width: auto; }
    .content-header { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ===== Mobile Table Scroll ===== */
@media (max-width: 768px) {
    .admin-table-card, .table-responsive-wrap { overflow-x: auto; }
    .table-glass, .admin-table { min-width: 600px; }
}

/* ===== Global Overflow Prevention ===== */
html, body { max-width: 100%; overflow-x: hidden; }
img { max-width: 100%; height: auto; }
pre, code { max-width: 100%; overflow-x: auto; }
table { max-width: 100%; }
iframe { max-width: 100%; }
.video-container, .embed-responsive { max-width: 100%; overflow: hidden; }

/* ===== Ultra Small Screens ===== */
@media (max-width: 380px) {
    .content-area { padding: 8px; }
    .glass-card, .card { padding: 12px; }
    .btn { font-size: 13px; padding: 8px 16px; }
    .page-title { font-size: 18px; }
    .text-5xl { font-size: 20px !important; }
    .text-4xl { font-size: 18px !important; }
    .text-3xl { font-size: 16px !important; }
}

