/* ═══════════════════════════════════════════════════════
   ECOMANAGER AI — Core Design System
   Ultra-futuristic dark theme with neon accents
   ═══════════════════════════════════════════════════════ */

:root {
    /* Color Palette - Cosmic Dark */
    --bg-primary: #06060f;
    --bg-secondary: #0a0a1a;
    --bg-tertiary: #0f0f24;
    --bg-card: rgba(12, 12, 30, 0.7);
    --bg-card-hover: rgba(18, 18, 45, 0.85);
    --bg-glass: rgba(255, 255, 255, 0.03);
    --bg-glass-hover: rgba(255, 255, 255, 0.06);

    /* Borders */
    --border-color: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.04);
    --border-glow: rgba(99, 102, 241, 0.3);

    /* Text */
    --text-primary: #f0f0ff;
    --text-secondary: #8888aa;
    --text-tertiary: #555577;
    --text-muted: #44445e;

    /* Accent Colors - Neon */
    --accent-primary: #6366f1;
    --accent-primary-rgb: 99, 102, 241;
    --accent-secondary: #8b5cf6;
    --accent-secondary-rgb: 139, 92, 246;
    --accent-cyan: #06b6d4;
    --accent-cyan-rgb: 6, 182, 212;
    --accent-emerald: #10b981;
    --accent-emerald-rgb: 16, 185, 129;
    --accent-amber: #f59e0b;
    --accent-amber-rgb: 245, 158, 11;
    --accent-rose: #f43f5e;
    --accent-rose-rgb: 244, 63, 94;
    --accent-blue: #3b82f6;
    --accent-blue-rgb: 59, 130, 246;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
    --gradient-cosmic: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    --gradient-neon: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
    --gradient-fire: linear-gradient(135deg, #f43f5e 0%, #f59e0b 100%);
    --gradient-emerald: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    --gradient-glass: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.01) 100%);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
    --shadow-glow-lg: 0 0 40px rgba(99, 102, 241, 0.2);
    --shadow-neon: 0 0 15px rgba(99, 102, 241, 0.4), 0 0 30px rgba(99, 102, 241, 0.1);

    /* Spacing */
    --sidebar-width: 280px;
    --sidebar-collapsed: 80px;
    --topbar-height: 64px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 9999px;

    /* Typography */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ══════ LIGHT THEME ══════ */
[data-theme="light"] {
    /* Backgrounds — warm whites */
    --bg-primary: #f4f6fa;
    --bg-secondary: #eaecf2;
    --bg-tertiary: #e0e3ec;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    --bg-glass: rgba(255, 255, 255, 0.55);
    --bg-glass-hover: rgba(255, 255, 255, 0.75);

    /* Borders */
    --border-color: rgba(0, 0, 0, 0.08);
    --border-glow: rgba(99, 102, 241, 0.25);
    --border-light: rgba(0, 0, 0, 0.06);

    /* Text */
    --text-primary: #1a1a2e;
    --text-secondary: #555570;
    --text-tertiary: #8888a0;
    --text-muted: #aaaac0;

    /* Shadows — realistic soft shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.10);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.08);
    --shadow-glow-lg: 0 0 40px rgba(99, 102, 241, 0.12);
    --shadow-neon: 0 0 15px rgba(99, 102, 241, 0.15), 0 0 30px rgba(99, 102, 241, 0.05);

    /* Gradients */
    --gradient-glass: linear-gradient(135deg, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0.4) 100%);
    --gradient-cosmic: linear-gradient(135deg, #e8e8f0 0%, #d8d8e8 50%, #e0e0f0 100%);
}

[data-theme="light"] body {
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* Sidebar light */
[data-theme="light"] .sidebar {
    background: rgba(255, 255, 255, 0.92);
    border-right-color: rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .sidebar::after {
    background: linear-gradient(180deg, rgba(99,102,241,0.12), transparent 30%, transparent 70%, rgba(6,182,212,0.12));
}
[data-theme="light"] .logo-name {
    background: linear-gradient(135deg, #1a1a2e 0%, #555570 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Topbar light */
[data-theme="light"] .topbar {
    background: rgba(255, 255, 255, 0.85);
    border-bottom-color: rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .notif-dot {
    border-color: var(--bg-primary);
}

/* Glass card light */
[data-theme="light"] .glass-card {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .glass-card::before {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
}
[data-theme="light"] .glass-card:hover {
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.15);
}

/* Tables light */
[data-theme="light"] .data-table th {
    border-bottom-color: rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .data-table td {
    border-bottom-color: rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .data-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.04);
}

/* Inputs light */
[data-theme="light"] .input-field {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}
[data-theme="light"] .input-field:focus {
    background: #fff;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.08);
}

/* Buttons light */
[data-theme="light"] .btn-secondary {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .btn-secondary:hover {
    background: #fff;
    border-color: rgba(99, 102, 241, 0.2);
}

/* Filter buttons light */
[data-theme="light"] .filter-btn {
    background: rgba(255, 255, 255, 0.6);
    color: var(--text-secondary);
    border-color: rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .filter-btn:hover,
[data-theme="light"] .filter-btn.active {
    background: var(--accent-primary);
    color: #fff;
}

/* ══════ LANGUAGE SWITCHER ══════ */
.lang-switcher {
    position: relative;
}
.lang-trigger {
    font-size: 1.1rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
    position: relative;
}
.lang-trigger:hover {
    background: var(--bg-glass-hover);
    transform: translateY(-1px);
}
.lang-trigger.open {
    transform: translateY(-1px) scale(1.05);
}
.lang-trigger.open #langFlag {
    animation: flagBounce 0.4s ease;
}
@keyframes flagBounce {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.2) rotate(-5deg); }
    75% { transform: scale(0.9) rotate(3deg); }
}
.lang-trigger::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--accent-primary);
    border-radius: 1px;
    transition: width var(--transition-base);
}
.lang-trigger:hover::after {
    width: 100%;
}
.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    backdrop-filter: blur(20px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(var(--accent-primary-rgb), 0.1);
    padding: 8px;
    display: none;
    z-index: 200;
    opacity: 0;
    transform: translateY(-8px) scale(0.95);
    transition: all var(--transition-base);
}
.lang-dropdown.open {
    display: block;
    opacity: 1;
    transform: translateY(0) scale(1);
}
.lang-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: none;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-base);
    text-align: left;
    position: relative;
    overflow: hidden;
}
.lang-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(var(--accent-primary-rgb), 0.1), transparent);
    transition: left var(--transition-slow);
}
.lang-option:hover::before {
    left: 100%;
}
.lang-option:hover {
    background: var(--bg-glass-hover);
    transform: translateX(4px);
}
.lang-option.active {
    background: rgba(var(--accent-primary-rgb), 0.15);
    color: var(--accent-primary);
    font-weight: 600;
}
.lang-option.active::after {
    content: '✓';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: var(--accent-primary);
    font-weight: 700;
}
.lang-flag {
    font-size: 1.3rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(var(--accent-primary-rgb), 0.05);
    transition: all var(--transition-base);
    position: relative;
}
.lang-option:hover .lang-flag {
    transform: scale(1.15) rotate(5deg);
    background: rgba(var(--accent-primary-rgb), 0.1);
    box-shadow: 0 4px 12px rgba(var(--accent-primary-rgb), 0.2);
}
.lang-option.active .lang-flag {
    background: rgba(var(--accent-primary-rgb), 0.15);
    transform: scale(1.1);
    box-shadow: 0 0 0 2px rgba(var(--accent-primary-rgb), 0.2);
}
/* Flag pulse animation for active language */
@keyframes flagPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
.lang-option.active .lang-flag {
    animation: flagPulse 2s ease-in-out infinite;
}

/* Light theme lang dropdown */
[data-theme="light"] .lang-dropdown {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(99, 102, 241, 0.08);
}
[data-theme="light"] .lang-trigger:hover {
    background: rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .lang-option:hover {
    background: rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .lang-option.active {
    background: rgba(99, 102, 241, 0.1);
}
[data-theme="light"] .lang-flag {
    background: rgba(99, 102, 241, 0.05);
}
[data-theme="light"] .lang-option:hover .lang-flag {
    background: rgba(99, 102, 241, 0.1);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}
[data-theme="light"] .lang-option.active .lang-flag {
    background: rgba(99, 102, 241, 0.15);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

/* ══════ RTL SUPPORT ══════ */
[dir="rtl"] .sidebar {
    left: auto;
    right: 0;
    border-right: none;
    border-left: 1px solid var(--border-color);
}
[dir="rtl"] .sidebar::after {
    right: auto;
    left: 0;
}
[dir="rtl"] .main-content {
    margin-left: 0;
    margin-right: var(--sidebar-width);
}
[dir="rtl"] .breadcrumb {
    direction: ltr;
}
[dir="rtl"] .topbar {
    direction: ltr;
}
[dir="rtl"] .topbar-right {
    direction: ltr;
}
[dir="rtl"] .topbar-left {
    direction: rtl;
}
[dir="rtl"] .search-box {
    direction: rtl;
    text-align: right;
}
[dir="rtl"] .search-box input {
    text-align: right;
}
[dir="rtl"] .topbar-clock {
    direction: ltr;
}
[dir="rtl"] header {
    display: block !important;
    position: relative;
    z-index: 100;
    visibility: visible !important;
    opacity: 1 !important;
}
[dir="rtl"] .topbar {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}
[dir="rtl"] .topbar-content {
    display: flex !important;
    visibility: visible !important;
}
[dir="rtl"] .topbar-actions {
    direction: ltr;
}
[dir="rtl"] .topbar-btn {
    direction: ltr;
}
[dir="rtl"] .page-header {
    direction: rtl;
}
[dir="rtl"] .page-title {
    direction: rtl;
}
[dir="rtl"] .page-subtitle {
    direction: rtl;
}
[dir="rtl"] .nav-item {
    text-align: right;
}
[dir="rtl"] .nav-indicator {
    left: auto;
    right: 0;
}
[dir="rtl"] .lang-dropdown {
    right: auto;
    left: 0;
}
[dir="rtl"] .lang-option {
    text-align: right;
}
[dir="rtl"] .notif-panel {
    right: auto;
    left: 0;
    border-left: none;
    border-right: 1px solid var(--border-color);
    transform: translateX(-100%);
    border-radius: 0 0 var(--radius-lg) 0;
}
[dir="rtl"] .notif-panel.active {
    transform: translateX(0);
}
[dir="rtl"] .toast-container {
    right: auto;
    left: 28px;
}

/* RTL responsive */
@media (max-width: 768px) {
    [dir="rtl"] .main-content {
        margin-right: 0;
    }
}

/* Page header gradient text light */
[data-theme="light"] .page-title {
    background: linear-gradient(135deg, #1a1a2e, #444466) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

/* Scrollbar light */
[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.18);
}
[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.3);
}

/* Selection light */
[data-theme="light"] ::selection {
    background: rgba(99, 102, 241, 0.2);
    color: #1a1a2e;
}

/* Ambient background light */
[data-theme="light"] .ambient-orb {
    opacity: 0.06;
}

/* Search box light */
[data-theme="light"] .search-box {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .search-box kbd {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
    color: var(--text-tertiary);
}

/* User card light */
[data-theme="light"] .user-status-dot {
    border-color: var(--bg-primary);
}

/* AI panel light */
[data-theme="light"] .ai-panel {
    background: rgba(255, 255, 255, 0.98);
    border-left-color: rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .ai-panel::before {
    background: linear-gradient(180deg, rgba(99,102,241,0.15), transparent 30%, transparent 70%, rgba(6,182,212,0.15));
}

/* Mobile overlay light */
[data-theme="light"] .sidebar-overlay {
    background: rgba(0, 0, 0, 0.25);
}

/* Tooltip light */
[data-theme="light"] [data-tooltip]::after {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.08);
    color: var(--text-primary);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* Pipeline buttons light */
[data-theme="light"] .pipeline-btn {
    background: rgba(255, 255, 255, 0.6);
    color: var(--text-secondary);
}
[data-theme="light"] .pipeline-btn.active {
    background: var(--accent-primary);
    color: #fff;
}

/* Stat card light */
[data-theme="light"] .stat-card {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

/* Modal light */
[data-theme="light"] .modal-content {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.12);
}

/* ══════ RTL SUPPORT (Arabic) ══════ */
[dir="rtl"] .sidebar {
    left: auto;
    right: 0;
    border-right: none;
    border-left: 1px solid var(--border-color);
}
[dir="rtl"] .main-content {
    margin-left: 0;
    margin-right: var(--sidebar-width);
}
[dir="rtl"] .topbar {
    left: 0;
    right: var(--sidebar-width);
}
[dir="rtl"] body.sidebar-collapsed .main-content {
    margin-right: var(--sidebar-collapsed);
    margin-left: 0;
}
[dir="rtl"] body.sidebar-collapsed .topbar {
    right: var(--sidebar-collapsed);
    left: 0;
}
[dir="rtl"] .nav-item i {
    margin-right: 0;
    margin-left: 12px;
}
[dir="rtl"] .settings-layout {
    direction: rtl;
}
[dir="rtl"] .stat-footer i {
    margin-right: 0;
    margin-left: 6px;
}

/* ══════ RESET & BASE ══════ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    transition: background 0.4s ease, color 0.4s ease;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.5);
}

::selection {
    background: rgba(99, 102, 241, 0.4);
    color: #fff;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    color: inherit;
}

input, textarea, select {
    font-family: inherit;
    border: none;
    outline: none;
    background: none;
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

/* ══════ APP SHELL ══════ */
.app-shell {
    display: flex;
    height: 100vh;
    width: 100vw;
    position: relative;
    overflow: hidden;
}

.app-shell.hidden {
    opacity: 0;
    visibility: hidden;
}

.app-shell.visible {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

/* ══════ AMBIENT BACKGROUND ══════ */
.ambient-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.ambient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    animation: orbFloat 20s ease-in-out infinite;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: var(--accent-primary);
    top: -200px;
    right: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: var(--accent-cyan);
    bottom: -200px;
    left: -100px;
    animation-delay: -7s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: var(--accent-secondary);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
    opacity: 0.08;
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
}

/* ══════ MAIN CONTENT ══════ */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    z-index: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left var(--transition-base);
}

.sidebar.collapsed ~ .main-content {
    margin-left: var(--sidebar-collapsed);
}

/* ══════ TOP BAR ══════ */
.topbar {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(6, 6, 15, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: relative;
    z-index: 10;
    transition: background 0.4s ease, border-color 0.4s ease;
    flex-shrink: 0;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.92rem;
}

.breadcrumb-item {
    color: var(--text-tertiary);
}

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 600;
}

.breadcrumb i {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.topbar-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 1rem;
    transition: all var(--transition-fast);
    position: relative;
}

.topbar-btn:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
}

.topbar-btn .ai-glow {
    position: absolute;
    inset: -2px;
    border-radius: var(--radius-md);
    background: var(--gradient-primary);
    opacity: 0;
    z-index: -1;
    transition: opacity var(--transition-fast);
}

#aiAssistBtn:hover .ai-glow {
    opacity: 0.3;
}

#aiAssistBtn {
    color: var(--accent-primary);
}

.notif-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--accent-rose);
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
}

.topbar-clock {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-tertiary);
    letter-spacing: 0.5px;
    min-width: 65px;
}

/* ══════ PAGE CONTAINER ══════ */
.page-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 28px;
    position: relative;
}

/* ══════ GLASS CARD ══════ */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all var(--transition-base), background 0.4s ease;
    position: relative;
    overflow: hidden;
}

.glass-card::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-card:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
}

/* ══════ COMMON UTILITIES ══════ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-xs { gap: 6px; }
.gap-sm { gap: 10px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }
.gap-xl { gap: 32px; }

.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.85rem; }
.text-md { font-size: 1rem; }
.text-lg { font-size: 1.15rem; }
.text-xl { font-size: 1.35rem; }
.text-2xl { font-size: 1.7rem; }
.text-3xl { font-size: 2.2rem; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }

.text-muted { color: var(--text-secondary); }
.text-accent { color: var(--accent-primary); }

.w-full { width: 100%; }
.h-full { height: 100%; }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.grid-auto {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* ══════ BUTTONS ══════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    transition: all var(--transition-fast);
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(var(--accent-primary-rgb), 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 25px rgba(var(--accent-primary-rgb), 0.5);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    border-color: var(--border-glow);
    background: var(--bg-glass-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.82rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-md);
}

.btn-icon.sm {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
}

/* ══════ STATUS BADGES ══════ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-success {
    background: rgba(var(--accent-emerald-rgb), 0.15);
    color: var(--accent-emerald);
    border: 1px solid rgba(var(--accent-emerald-rgb), 0.2);
}

.badge-warning {
    background: rgba(var(--accent-amber-rgb), 0.15);
    color: var(--accent-amber);
    border: 1px solid rgba(var(--accent-amber-rgb), 0.2);
}

.badge-danger {
    background: rgba(var(--accent-rose-rgb), 0.15);
    color: var(--accent-rose);
    border: 1px solid rgba(var(--accent-rose-rgb), 0.2);
}

.badge-info {
    background: rgba(var(--accent-cyan-rgb), 0.15);
    color: var(--accent-cyan);
    border: 1px solid rgba(var(--accent-cyan-rgb), 0.2);
}

.badge-ai {
    background: rgba(var(--accent-primary-rgb), 0.15);
    color: var(--accent-primary);
    border: 1px solid rgba(var(--accent-primary-rgb), 0.2);
}

/* ══════ INPUT FIELDS ══════ */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.input-field {
    padding: 10px 14px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.92rem;
    transition: all var(--transition-fast);
}

.input-field:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(var(--accent-primary-rgb), 0.1);
}

.input-field::placeholder {
    color: var(--text-muted);
}

textarea.input-field {
    min-height: 100px;
    resize: vertical;
}

/* ══════ TABLES ══════ */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 14px 16px;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

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

/* ══════ TABS ══════ */
.tabs {
    display: flex;
    gap: 2px;
    background: var(--bg-glass);
    padding: 4px;
    border-radius: var(--radius-md);
    width: fit-content;
}

.tab-btn {
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.tab-btn.active {
    background: var(--accent-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(var(--accent-primary-rgb), 0.3);
}

.tab-btn:hover:not(.active) {
    color: var(--text-primary);
    background: rgba(255,255,255,0.05);
}

/* ══════ PROGRESS BAR ══════ */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-glass);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-fill.primary { background: var(--gradient-primary); }
.progress-fill.emerald { background: var(--gradient-emerald); }
.progress-fill.fire { background: var(--gradient-fire); }

/* ══════ TOGGLE ══════ */
.toggle {
    width: 44px;
    height: 24px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    position: relative;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.toggle::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: var(--text-secondary);
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all var(--transition-fast);
}

.toggle.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.toggle.active::after {
    transform: translateX(20px);
    background: white;
}

/* ══════ TOOLTIP ══════ */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    color: var(--text-primary);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition-fast);
    z-index: 999;
}

[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ══════ RESPONSIVE ══════ */
@media (max-width: 1024px) {
    .main-content {
        margin-left: 0;
    }
    .mobile-menu-btn {
        display: flex;
    }
}
