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

/* ===================================================================
   THEME SYSTEM — CSS Custom Properties
   =================================================================== */
:root {
    /* Dark Theme (Default) */
    --bg-base: #050505;
    --bg-panel: #0a0a0a;
    --bg-surface: #111111;
    --bg-surface-hover: #1a1a1a;
    
    --accent-primary: #3b82f6;
    --accent-secondary: #8b5cf6;
    --accent-tertiary: #06b6d4;
    --accent-glow: rgba(59, 130, 246, 0.4);
    --accent-glow-secondary: rgba(139, 92, 246, 0.3);
    
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(59, 130, 246, 0.2);
    
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #38bdf8;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 20px -5px var(--accent-glow);
    --shadow-glow-lg: 0 0 40px -10px var(--accent-glow);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Theme */
[data-theme="light"] {
    --bg-base: #f8fafc;
    --bg-panel: #ffffff;
    --bg-surface: #f1f5f9;
    --bg-surface-hover: #e2e8f0;
    
    --accent-glow: rgba(59, 130, 246, 0.2);
    --accent-glow-secondary: rgba(139, 92, 246, 0.15);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --border-subtle: rgba(0, 0, 0, 0.08);
    --border-glow: rgba(59, 130, 246, 0.15);
    
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .text-gradient {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="light"] .orb { opacity: 0.15 !important; }
[data-theme="light"] body::before, [data-theme="light"] body::after { opacity: 0.04; }

/* ===================================================================
   RESET & BASE
   =================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-base);
    background-image: radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.08) 0%, transparent 50%), 
                      radial-gradient(circle at 100% 100%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--transition-base), color var(--transition-base);
}

/* Ambient Background Lights */
body::before, body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(150px);
    z-index: -1;
    pointer-events: none;
    transition: opacity var(--transition-base);
}

body::before {
    top: -150px;
    left: -150px;
    width: 600px;
    height: 600px;
    background: var(--accent-secondary);
    opacity: 0.07;
}

body::after {
    bottom: -150px;
    right: -150px;
    width: 600px;
    height: 600px;
    background: var(--accent-primary);
    opacity: 0.07;
}

/* ===================================================================
   TYPOGRAPHY
   =================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.text-gradient {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-success { color: var(--success) !important; }

/* ===================================================================
   STRUCTURAL
   =================================================================== */
.container {
    width: 100%;
    max-width: 96%;
    margin: 0 auto;
    padding: 0;
}

/* ===================================================================
   GLASS PANELS & CARDS
   =================================================================== */
.glass-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    transition: background var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
}

/* Noise texture overlay for depth */
.glass-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

.glass-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.02'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
    border-radius: inherit;
}

.glass-panel > * {
    position: relative;
    z-index: 1;
}

/* Hover glow effect */
.hover-glow {
    transition: all var(--transition-smooth);
}
.hover-glow:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

/* Hover lift utility */
.hover-lift {
    transition: all var(--transition-smooth);
}
.hover-lift:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: var(--shadow-lg);
}

.card {
    display: flex;
    flex-direction: column;
}
.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.01);
}
.card-title {
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0;
    color: var(--text-primary);
}
.card-body {
    padding: 1.5rem;
}

/* ===================================================================
   ANIMATED GRADIENT BORDER UTILITY
   =================================================================== */
.gradient-border {
    position: relative;
    background: var(--bg-panel);
    border: none;
}
.gradient-border::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary), var(--accent-tertiary));
    background-size: 300% 300%;
    animation: gradientRotate 4s ease infinite;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

@keyframes gradientRotate {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ===================================================================
   NAVIGATION
   =================================================================== */
nav {
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 50;
    transition: background var(--transition-base);
}

[data-theme="light"] nav {
    background: rgba(255, 255, 255, 0.85);
}

.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
}

nav .brand {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.5px;
}
nav .brand span {
    color: var(--accent-primary);
}

nav .links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

nav .links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color var(--transition-fast);
}

nav .links a:hover {
    color: var(--text-primary);
}

/* Theme Toggle Button */
.theme-toggle {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 50px;
    width: 44px;
    height: 24px;
    cursor: pointer;
    position: relative;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    padding: 0 3px;
}
.theme-toggle::after {
    content: '';
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-primary);
    transition: transform var(--transition-base);
    box-shadow: 0 0 8px var(--accent-glow);
}
[data-theme="light"] .theme-toggle::after {
    transform: translateX(20px);
    background: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}
.theme-toggle .toggle-icon {
    position: absolute;
    font-size: 0.6rem;
    transition: opacity var(--transition-fast);
}
.theme-toggle .icon-moon { left: 6px; opacity: 1; }
.theme-toggle .icon-sun { right: 5px; opacity: 0.4; }
[data-theme="light"] .theme-toggle .icon-moon { opacity: 0.4; }
[data-theme="light"] .theme-toggle .icon-sun { opacity: 1; }

/* ===================================================================
   BUTTONS
   =================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    border: 1px solid transparent;
    font-family: 'Inter', sans-serif;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(255,255,255,0.1), transparent);
    opacity: 0;
    transition: opacity var(--transition-fast);
}
.btn:hover::after { opacity: 1; }

.btn-primary {
    background: var(--text-primary);
    color: var(--bg-base);
    box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
    background: #e4e4e7;
    transform: translateY(-1px);
}

.btn-gradient {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    box-shadow: var(--shadow-glow);
}
.btn-gradient:hover {
    box-shadow: var(--shadow-glow-lg);
    filter: brightness(1.1);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}
.btn-outline:hover {
    background: var(--bg-surface);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

.btn-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}
.btn-warning:hover {
    background: rgba(245, 158, 11, 0.2);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.05rem;
    border-radius: var(--radius-lg);
}

/* ===================================================================
   FORMS
   =================================================================== */
.form-group {
    margin-bottom: 1.25rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all var(--transition-base);
    font-family: 'Inter', sans-serif;
}
.form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
    background: var(--bg-panel);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}
select.form-control option {
    background-color: var(--bg-surface);
    color: var(--text-primary);
}

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

/* ===================================================================
   DASHBOARD LAYOUT
   =================================================================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 0;
    width: 96%;
    max-width: none;
    min-height: calc(100vh - 220px);
    margin: 2rem auto;
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 40px rgba(59, 130, 246, 0.05);
    overflow: hidden;
}

.sidebar {
    padding: 2rem 1.5rem;
    border-right: 1px solid var(--border-subtle);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

[data-theme="light"] .sidebar {
    background: rgba(0, 0, 0, 0.02);
}

.sidebar-nav {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sidebar-nav a i {
    width: 24px;
    text-align: center;
    margin-right: 10px;
    font-size: 1.1rem;
}

.sidebar-user {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 1rem;
}
.sidebar-user img {
    width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent-primary);
}
.sidebar-user-info {
    display: flex;
    flex-direction: column;
}
.sidebar-user-info .name { font-weight: 600; font-size: 0.95rem; color: var(--text-primary); }
.sidebar-user-info .plan { font-size: 0.8rem; color: var(--accent-secondary); font-weight: 500;}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 0.65rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    font-weight: 500;
    font-size: 0.9rem;
}

.sidebar-nav a:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}
.sidebar-nav a.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-primary);
    font-weight: 600;
}

.main-content {
    padding: 2.5rem 3rem;
    overflow-y: auto;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 2rem;
}

/* ===================================================================
   STATS
   =================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.stat-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.stat-card h3 {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin: 0;
}
.stat-card p {
    font-size: 2rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* ===================================================================
   TABLES
   =================================================================== */
.table-container {
    width: 100%;
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
th {
    padding: 1rem 1.5rem;
    text-align: left;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.01);
}
td {
    padding: 1.25rem 1.5rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}
tbody tr {
    transition: background var(--transition-fast);
}
tbody tr:hover {
    background: var(--bg-surface);
}
tbody tr:last-child td {
    border-bottom: none;
}

/* Table Search */
.table-search {
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.85rem;
    width: 260px;
    transition: all var(--transition-base);
    font-family: 'Inter', sans-serif;
}
.table-search:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
    width: 320px;
}
.table-search-wrapper {
    position: relative;
    display: inline-block;
}
.table-search-wrapper i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
}

/* ===================================================================
   BADGES
   =================================================================== */
.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    letter-spacing: 0.02em;
}
.badge-success { background: rgba(16, 185, 129, 0.1); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.2); }
.badge-primary { background: rgba(59, 130, 246, 0.1); color: var(--accent-primary); border: 1px solid rgba(59, 130, 246, 0.2); }
.badge-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.2); }
.badge-info { background: rgba(56, 189, 248, 0.1); color: var(--info); border: 1px solid rgba(56, 189, 248, 0.2); }

/* ===================================================================
   ALERTS
   =================================================================== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-left: 4px solid transparent;
    animation: alertSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-left-color: var(--danger);
}
.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border-left-color: var(--success);
}
.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border-left-color: var(--warning);
}
.alert-info {
    background: rgba(56, 189, 248, 0.1);
    color: var(--info);
    border-left-color: var(--info);
}

@keyframes alertSlideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ===================================================================
   TOAST NOTIFICATIONS
   =================================================================== */
.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1rem 1.5rem;
    min-width: 320px;
    max-width: 420px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255,255,255,0.05);
    backdrop-filter: blur(12px);
    animation: toastSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.toast.toast-exit {
    animation: toastSlideOut 0.4s cubic-bezier(0.7, 0, 1, 1) forwards;
}

.toast-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.toast-success .toast-icon { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.toast-danger .toast-icon { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.toast-warning .toast-icon { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.toast-info .toast-icon { background: rgba(56, 189, 248, 0.15); color: var(--info); }

.toast-body {
    flex: 1;
}
.toast-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.toast-message {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.25rem;
    transition: color var(--transition-fast);
    flex-shrink: 0;
}
.toast-close:hover { color: var(--text-primary); }

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    animation: toastProgress linear forwards;
}
.toast-success .toast-progress { background: var(--success); }
.toast-danger .toast-progress { background: var(--danger); }
.toast-warning .toast-progress { background: var(--warning); }
.toast-info .toast-progress { background: var(--accent-primary); }

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(100px) scale(0.95); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastSlideOut {
    from { opacity: 1; transform: translateX(0) scale(1); }
    to { opacity: 0; transform: translateX(100px) scale(0.95); }
}
@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

/* ===================================================================
   MODALS
   =================================================================== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.modal-overlay.active {
    display: flex;
    opacity: 1;
    animation: modalFadeIn 0.3s ease forwards;
}
.modal-content {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 450px;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    transform: translateY(20px);
    animation: modalSlideUp 0.3s ease forwards;
}

@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalSlideUp { from { transform: translateY(20px); } to { transform: translateY(0); } }

.modal-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color var(--transition-fast);
    line-height: 1;
}
.modal-close:hover {
    color: var(--text-primary);
}

.action-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* ===================================================================
   AUTH PAGES (Login/Register)
   =================================================================== */
.auth-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    width: 100%;
    margin: 0;
    background: var(--bg-base);
}

.auth-visual {
    background: linear-gradient(135deg, rgba(10, 10, 10, 0.9), rgba(17, 17, 17, 0.9)), url('data:image/svg+xml;utf8,<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><filter id="noiseFilter"><feTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23noiseFilter)" opacity="0.1"/></svg>');
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 4rem;
    position: relative;
    overflow: hidden;
    border-right: 1px solid var(--border-subtle);
}

.auth-visual::before {
    content: '';
    position: absolute;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 60%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
    opacity: 0.5;
}

.auth-visual-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.auth-visual-content .brand {
    font-family: 'Outfit', sans-serif;
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: block;
}

.auth-visual-content p {
    color: var(--text-secondary);
    font-size: 1.2rem;
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.6;
}

.auth-form-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.auth-form-container {
    width: 100%;
    max-width: 420px;
}

@media (max-width: 900px) {
    .auth-split {
        grid-template-columns: 1fr;
    }
    .auth-visual {
        display: none;
    }
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}
.auth-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}
.auth-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===================================================================
   CODE BLOCKS
   =================================================================== */
.code-block {
    background: var(--bg-surface);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    color: var(--text-primary);
}

/* Syntax Highlighting */
.code-preview {
    background: #0d1117;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-lg);
    overflow: hidden;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.7;
}
.code-preview-header {
    padding: 0.75rem 1.25rem;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}
.code-preview-header .dots {
    display: flex;
    gap: 6px;
    margin-right: 0.75rem;
}
.code-preview-header .dots span {
    width: 10px; height: 10px; border-radius: 50%;
}
.code-preview-header .dots span:nth-child(1) { background: #ff5f57; }
.code-preview-header .dots span:nth-child(2) { background: #febc2e; }
.code-preview-header .dots span:nth-child(3) { background: #28c840; }

.code-preview pre {
    padding: 1.25rem 1.5rem;
    margin: 0;
    overflow-x: auto;
    color: #e6edf3;
}
.code-preview .kw { color: #ff7b72; }
.code-preview .fn { color: #d2a8ff; }
.code-preview .str { color: #a5d6ff; }
.code-preview .cm { color: #8b949e; }
.code-preview .num { color: #79c0ff; }
.code-preview .var { color: #ffa657; }

/* ===================================================================
   LAYOUT HELPERS
   =================================================================== */
.main-wrapper {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

.row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
}

.col-md-4 { }
.col-md-6 { }
.col-md-8 { }

/* ===================================================================
   SCROLL REVEAL ANIMATIONS
   =================================================================== */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

/* Stagger children */
.reveal-stagger > * {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-stagger.revealed > *:nth-child(1) { transition-delay: 0s; }
.reveal-stagger.revealed > *:nth-child(2) { transition-delay: 0.1s; }
.reveal-stagger.revealed > *:nth-child(3) { transition-delay: 0.2s; }
.reveal-stagger.revealed > *:nth-child(4) { transition-delay: 0.3s; }
.reveal-stagger.revealed > *:nth-child(5) { transition-delay: 0.4s; }
.reveal-stagger.revealed > *:nth-child(6) { transition-delay: 0.5s; }
.reveal-stagger.revealed > * {
    opacity: 1;
    transform: translateY(0);
}

/* ===================================================================
   RESPONSIVE
   =================================================================== */
@media (max-width: 1200px) {
    .row {
        grid-template-columns: 1fr 1.5fr;
    }
}

@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
    }
    .main-content {
        padding: 1.5rem;
    }
    .row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-inner {
        padding: 1rem 0;
    }
    .main-content {
        padding: 1.25rem;
    }
    .toast {
        min-width: unset;
        max-width: calc(100vw - 2rem);
    }
    .toast-container {
        right: 1rem;
        left: 1rem;
    }
}

/* ===================================================================
   FOOTER
   =================================================================== */
.site-footer {
    background: rgba(10, 10, 10, 0.9);
    border-top: 1px solid var(--border-subtle);
    padding: 3rem 0;
    margin-top: 4rem;
}

.footer-inner {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2rem;
    align-items: center;
}

.footer-brand .brand {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    display: block;
    margin-bottom: 0.5rem;
}

.footer-brand p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    gap: 2rem;
    justify-content: center;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-copyright {
    text-align: right;
    color: var(--text-muted);
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .footer-inner {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .footer-links {
        justify-content: center;
    }
    .footer-copyright {
        text-align: center;
    }
}

/* ===================================================================
   BACKGROUND ORBS
   =================================================================== */
.bg-orbs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s infinite ease-in-out alternate;
}
.orb-1 {
    width: 400px;
    height: 400px;
    background: #38bdf8;
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}
.orb-2 {
    width: 500px;
    height: 500px;
    background: #818cf8;
    bottom: -150px;
    right: -100px;
    animation-delay: -5s;
}
.orb-3 {
    width: 300px;
    height: 300px;
    background: #c084fc;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -10s;
    opacity: 0.3;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
    100% { transform: translate(0, 0) scale(1); }
}

/* ===================================================================
   GENERIC KEYFRAMES
   =================================================================== */
@keyframes fadeUp {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}
@keyframes fadeDown {
    0% { opacity: 0; transform: translateY(-20px); }
    100% { opacity: 1; transform: translateY(0); }
}
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===================================================================
   TIMELINE (Changelog)
   =================================================================== */
.timeline {
    position: relative;
    padding-left: 40px;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 18px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--accent-primary), var(--accent-secondary), transparent);
}
.timeline-item {
    position: relative;
    margin-bottom: 2.5rem;
    padding-left: 1.5rem;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -26px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-primary);
    border: 3px solid var(--bg-panel);
    box-shadow: 0 0 12px var(--accent-glow);
}
.timeline-item .timeline-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 500;
}
.timeline-item .timeline-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all var(--transition-smooth);
}
.timeline-item .timeline-card:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
    transform: translateX(4px);
}

/* ===================================================================
   STATUS PAGE
   =================================================================== */
.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
    position: relative;
}
.status-indicator.operational {
    background: var(--success);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}
.status-indicator.operational::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.3);
    animation: pulse 2s infinite;
}
.status-indicator.degraded {
    background: var(--warning);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}
.status-indicator.down {
    background: var(--danger);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

/* ===================================================================
   404 PAGE
   =================================================================== */
.page-404 {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 2rem;
}
.page-404 .error-code {
    font-size: clamp(8rem, 15vw, 14rem);
    font-weight: 900;
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    margin-bottom: 1rem;
    animation: float404 6s ease-in-out infinite;
}
@keyframes float404 {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}
.page-404 h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}
.page-404 p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 500px;
    margin: 0 auto 2rem;
    line-height: 1.7;
}

/* Floating particles for 404 */
.floating-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}
.floating-particles span {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent-primary);
    border-radius: 50%;
    opacity: 0.3;
    animation: floatParticle linear infinite;
}

@keyframes floatParticle {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 0.3; }
    90% { opacity: 0.3; }
    100% { transform: translateY(-10vh) rotate(720deg); opacity: 0; }
}

/* ===================================================================
   WELCOME BANNER (Dashboard)
   =================================================================== */
.welcome-banner {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.08));
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 2rem 2.5rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}
.welcome-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    opacity: 0.3;
    pointer-events: none;
}
.welcome-banner h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    position: relative;
}
.welcome-banner p {
    color: var(--text-secondary);
    font-size: 1rem;
    position: relative;
}

/* Quick Stats Row */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}
.quick-stat {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all var(--transition-smooth);
}
.quick-stat:hover {
    border-color: var(--border-glow);
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
}
.quick-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}
.quick-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
    line-height: 1.2;
}
.quick-stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

@media (max-width: 1100px) {
    .quick-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 600px) {
    .quick-stats {
        grid-template-columns: 1fr;
    }
}
