/* ===== DATAFLOW ANALYTICS DASHBOARD ===== */
/* Premium Dark Mode Dashboard with Neon Effects */

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

/* ===== VARIABLES ===== */
:root {
    /* Neon Color Palette */
    --primary: #8b5cf6;
    --primary-dark: #7c3aed;
    --primary-light: #a78bfa;
    --primary-glow: rgba(139, 92, 246, 0.4);
    --blue: #3b82f6;
    --blue-glow: rgba(59, 130, 246, 0.4);
    --green: #10b981;
    --green-glow: rgba(16, 185, 129, 0.4);
    --purple: #8b5cf6;
    --purple-glow: rgba(139, 92, 246, 0.4);
    --orange: #f59e0b;
    --orange-glow: rgba(245, 158, 11, 0.4);
    --red: #ef4444;
    --red-glow: rgba(239, 68, 68, 0.4);
    --cyan: #06b6d4;
    --cyan-glow: rgba(6, 182, 212, 0.4);
    --pink: #ec4899;
    --pink-glow: rgba(236, 72, 153, 0.4);

    /* Dark Theme Colors */
    --dark: #0a0a0f;
    --dark-light: #12121a;
    --dark-card: #16161f;
    --dark-elevated: #1a1a25;
    --sidebar-bg: linear-gradient(180deg, #0f0f18 0%, #0a0a0f 100%);
    --sidebar-hover: rgba(139, 92, 246, 0.1);
    --sidebar-active: rgba(139, 92, 246, 0.15);
    --main-bg: linear-gradient(135deg, #0a0a0f 0%, #0f0f18 50%, #0a0a0f 100%);

    /* Gray Scale (Dark Mode) */
    --gray-900: #18181b;
    --gray-800: #27272a;
    --gray-700: #3f3f46;
    --gray-600: #52525b;
    --gray-500: #71717a;
    --gray-400: #a1a1aa;
    --gray-300: #d4d4d8;
    --gray-200: #e4e4e7;
    --gray-100: #f4f4f5;
    --white: #ffffff;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #8b5cf6 0%, #6366f1 50%, #3b82f6 100%);
    --gradient-blue: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
    --gradient-green: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    --gradient-purple: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    --gradient-orange: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    --gradient-mesh: radial-gradient(at 40% 20%, rgba(139, 92, 246, 0.15) 0px, transparent 50%),
                     radial-gradient(at 80% 0%, rgba(6, 182, 212, 0.1) 0px, transparent 50%),
                     radial-gradient(at 0% 50%, rgba(236, 72, 153, 0.1) 0px, transparent 50%);

    /* Shadows & Glows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px var(--primary-glow);
    --shadow-neon: 0 0 20px var(--primary-glow), 0 0 40px var(--primary-glow);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    --shadow-card-hover: 0 8px 40px rgba(0, 0, 0, 0.4), 0 0 30px var(--primary-glow);

    /* Border & Glass */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-glow: rgba(139, 92, 246, 0.3);
    --glass-bg: rgba(22, 22, 31, 0.8);
    --glass-border: rgba(255, 255, 255, 0.08);

    /* Sizes */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --sidebar-width: 280px;
    --header-height: 72px;

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);

    /* Fonts */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

/* ===== KEYFRAME ANIMATIONS ===== */
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px var(--primary-glow); }
    50% { box-shadow: 0 0 40px var(--primary-glow), 0 0 60px var(--primary-glow); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

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

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

@keyframes countUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes borderGlow {
    0%, 100% { border-color: rgba(139, 92, 246, 0.3); }
    50% { border-color: rgba(139, 92, 246, 0.6); }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes neonPulse {
    0%, 100% {
        text-shadow: 0 0 5px var(--primary-glow), 0 0 10px var(--primary-glow);
    }
    50% {
        text-shadow: 0 0 10px var(--primary-glow), 0 0 20px var(--primary-glow), 0 0 30px var(--primary-glow);
    }
}

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

@keyframes barGrow {
    from { height: 0; }
    to { height: var(--height); }
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--dark);
    background-image: var(--gradient-mesh);
    background-attachment: fixed;
    color: var(--gray-300);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Ambient background orbs */
body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
}

body::before {
    width: 500px;
    height: 500px;
    background: var(--primary);
    top: -200px;
    right: -100px;
    animation: float 20s ease-in-out infinite;
}

body::after {
    width: 400px;
    height: 400px;
    background: var(--cyan);
    bottom: -150px;
    left: 20%;
    animation: float 25s ease-in-out infinite reverse;
}

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

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

input, select {
    font-family: inherit;
}

/* Selection styling */
::selection {
    background: var(--primary);
    color: var(--white);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--dark-light);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-700);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ===== BACK BUTTON ===== */
.back-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--gradient-primary);
    color: var(--white);
    padding: 14px 24px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    transition: var(--transition);
    z-index: 1000;
    overflow: hidden;
}

.back-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.2) 50%, transparent 70%);
    transition: left 0.5s ease;
}

.back-btn:hover::before {
    left: 100%;
}

.back-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--shadow-xl), 0 0 60px var(--primary-glow);
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 100;
    border-right: 1px solid var(--border-subtle);
    backdrop-filter: blur(20px);
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(to bottom, var(--primary), var(--cyan), transparent);
    opacity: 0.5;
}

.sidebar::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, var(--primary-glow) 0%, transparent 70%);
    opacity: 0.1;
    pointer-events: none;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: var(--gradient-primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    box-shadow: 0 4px 20px var(--primary-glow);
}

.logo span {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--white);
    letter-spacing: -0.5px;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 16px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 28px;
}

.nav-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 0 12px;
    margin-bottom: 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: var(--radius);
    color: var(--gray-400);
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 4px;
    position: relative;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--gradient-primary);
    border-radius: 0 3px 3px 0;
    transition: var(--transition);
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: var(--white);
}

.nav-item.active {
    background: var(--sidebar-active);
    color: var(--white);
}

.nav-item.active::before {
    height: 60%;
}

.nav-item svg {
    opacity: 0.7;
    transition: var(--transition);
}

.nav-item:hover svg,
.nav-item.active svg {
    opacity: 1;
    color: var(--primary-light);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius);
    transition: var(--transition);
}

.user-info:hover {
    background: rgba(255, 255, 255, 0.06);
}

.user-avatar {
    width: 42px;
    height: 42px;
    background: var(--gradient-primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 700;
    font-size: 0.9rem;
}

.user-avatar.small {
    width: 34px;
    height: 34px;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
}

.user-details strong {
    display: block;
    color: var(--white);
    font-size: 0.9rem;
}

.user-details span {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

/* ===== HEADER ===== */
.main-header {
    height: var(--header-height);
    background: rgba(10, 10, 15, 0.8);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(20px) saturate(180%);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    color: var(--gray-600);
    transition: var(--transition);
}

.menu-toggle:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--dark-card);
    padding: 10px 20px;
    border-radius: 50px;
    width: 320px;
    transition: var(--transition);
    border: 1px solid var(--border-subtle);
}

.search-box:focus-within {
    background: var(--dark-elevated);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow), var(--shadow-neon);
}

.search-box svg {
    color: var(--gray-500);
}

.search-box input {
    border: none;
    background: none;
    outline: none;
    flex: 1;
    font-size: 0.9rem;
    color: var(--gray-200);
}

.search-box input::placeholder {
    color: var(--gray-600);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-btn {
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    transition: var(--transition);
    position: relative;
    background: var(--dark-card);
    border: 1px solid var(--border-subtle);
}

.icon-btn:hover {
    background: var(--dark-elevated);
    color: var(--primary-light);
    border-color: var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
}

.notification-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 18px;
    height: 18px;
    background: var(--red);
    color: var(--white);
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--white);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.header-user {
    margin-left: 8px;
    padding-left: 20px;
    border-left: 1px solid var(--border-subtle);
}

/* ===== DASHBOARD CONTENT ===== */
.dashboard-content {
    flex: 1;
    padding: 32px;
    animation: slideUp 0.6s ease-out;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--white);
    margin-bottom: 6px;
    background: linear-gradient(135deg, var(--white) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-header p {
    color: var(--gray-500);
    font-size: 0.95rem;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.date-select {
    padding: 10px 16px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    background: var(--dark-card);
    color: var(--gray-300);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.date-select option {
    background: var(--dark-card);
    color: var(--gray-300);
}

.date-select:hover {
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

.date-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--white);
    box-shadow: var(--shadow), 0 0 20px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), 0 0 30px var(--primary-glow);
}

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--dark-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    gap: 20px;
    box-shadow: var(--shadow-card);
    transition: var(--transition);
    border: 1px solid var(--border-subtle);
    position: relative;
    overflow: hidden;
    animation: slideUp 0.6s ease-out backwards;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    transition: var(--transition);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top right, rgba(255,255,255,0.03) 0%, transparent 60%);
    pointer-events: none;
}

.stat-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--border-glow);
}

.stat-card:nth-child(1)::before { background: var(--gradient-blue); }
.stat-card:nth-child(2)::before { background: var(--gradient-green); }
.stat-card:nth-child(3)::before { background: var(--gradient-purple); }
.stat-card:nth-child(4)::before { background: var(--gradient-orange); }

.stat-card:nth-child(1):hover { box-shadow: var(--shadow-lg), 0 0 40px var(--blue-glow); }
.stat-card:nth-child(2):hover { box-shadow: var(--shadow-lg), 0 0 40px var(--green-glow); }
.stat-card:nth-child(3):hover { box-shadow: var(--shadow-lg), 0 0 40px var(--purple-glow); }
.stat-card:nth-child(4):hover { box-shadow: var(--shadow-lg), 0 0 40px var(--orange-glow); }

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
}

.stat-icon.blue {
    background: rgba(59, 130, 246, 0.1);
    color: var(--blue);
}

.stat-icon.green {
    background: rgba(16, 185, 129, 0.1);
    color: var(--green);
}

.stat-icon.purple {
    background: rgba(139, 92, 246, 0.1);
    color: var(--purple);
}

.stat-icon.orange {
    background: rgba(245, 158, 11, 0.1);
    color: var(--orange);
}

.stat-card:hover .stat-icon.blue { background: var(--gradient-blue); color: var(--white); }
.stat-card:hover .stat-icon.green { background: var(--gradient-green); color: var(--white); }
.stat-card:hover .stat-icon.purple { background: var(--gradient-purple); color: var(--white); }
.stat-card:hover .stat-icon.orange { background: var(--gradient-orange); color: var(--white); }

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--white);
    line-height: 1;
    margin-bottom: 10px;
    font-family: var(--font-mono);
    animation: countUp 0.8s ease-out backwards;
    animation-delay: 0.3s;
}

.stat-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 50px;
}

.stat-change.positive {
    color: var(--green);
    background: rgba(16, 185, 129, 0.1);
}

.stat-change.negative {
    color: var(--red);
    background: rgba(239, 68, 68, 0.1);
}

.stat-change svg {
    width: 14px;
    height: 14px;
}

/* ===== CHARTS ROW ===== */
.charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.chart-card {
    background: var(--dark-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-subtle);
    position: relative;
    overflow: hidden;
}

.chart-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top left, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--white);
}

.card-actions {
    display: flex;
    gap: 4px;
    background: var(--dark-elevated);
    padding: 4px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

.tab-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--gray-500);
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--primary-light);
}

.tab-btn.active {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 0 20px var(--primary-glow);
}

.more-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    transition: var(--transition);
    border: 1px solid var(--border-subtle);
}

.more-btn:hover {
    background: var(--dark-elevated);
    color: var(--primary-light);
    border-color: var(--primary);
}

/* ===== BAR CHART ===== */
.chart-container {
    height: 280px;
    display: flex;
    align-items: flex-end;
    position: relative;
    z-index: 1;
}

.bar-chart {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    width: 100%;
    height: 100%;
    padding: 20px 0;
}

.bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.bar {
    width: 40px;
    height: var(--height);
    background: var(--gradient-primary);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    position: relative;
    transition: var(--transition);
    cursor: pointer;
    animation: barGrow 1s ease-out backwards;
    box-shadow: 0 0 20px var(--primary-glow);
}

.bar-group:nth-child(1) .bar { animation-delay: 0.1s; }
.bar-group:nth-child(2) .bar { animation-delay: 0.2s; }
.bar-group:nth-child(3) .bar { animation-delay: 0.3s; }
.bar-group:nth-child(4) .bar { animation-delay: 0.4s; }
.bar-group:nth-child(5) .bar { animation-delay: 0.5s; }
.bar-group:nth-child(6) .bar { animation-delay: 0.6s; }
.bar-group:nth-child(7) .bar { animation-delay: 0.7s; }

.bar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, transparent, rgba(255,255,255,0.3));
    border-radius: inherit;
}

.bar:hover {
    filter: brightness(1.2);
    transform: scaleY(1.05);
    box-shadow: 0 0 40px var(--primary-glow);
}

.bar.secondary {
    background: var(--gray-700);
    box-shadow: none;
}

.bar.secondary::before {
    background: none;
}

.bar.secondary:hover {
    background: var(--gray-600);
    box-shadow: 0 0 20px rgba(113, 113, 122, 0.3);
}

.bar-value {
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--white);
    opacity: 0;
    transition: var(--transition);
    white-space: nowrap;
    background: var(--dark-elevated);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-subtle);
}

.bar:hover .bar-value {
    opacity: 1;
    top: -36px;
}

.bar-label {
    font-size: 0.8rem;
    color: var(--gray-500);
    font-weight: 500;
}

/* ===== DONUT CHART ===== */
.donut-chart {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.donut {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: conic-gradient(
        var(--blue) 0% 45%,
        var(--green) 45% 73%,
        var(--purple) 73% 91%,
        var(--orange) 91% 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: rotate 30s linear infinite;
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.3);
}

.donut::before {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    background: conic-gradient(
        var(--blue-glow) 0% 45%,
        var(--green-glow) 45% 73%,
        var(--purple-glow) 73% 91%,
        var(--orange-glow) 91% 100%
    );
    filter: blur(20px);
    opacity: 0.5;
    z-index: -1;
}

.donut-center {
    width: 120px;
    height: 120px;
    background: var(--dark-card);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: rotate 30s linear infinite reverse;
    border: 1px solid var(--border-subtle);
}

.donut-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--white);
    font-family: var(--font-mono);
}

.donut-label {
    font-size: 0.8rem;
    color: var(--gray-500);
}

.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    border: 1px solid transparent;
}

.legend-item:hover {
    background: var(--dark-elevated);
    border-color: var(--border-subtle);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 4px;
    box-shadow: 0 0 10px currentColor;
}

.legend-color.blue { background: var(--blue); color: var(--blue); }
.legend-color.green { background: var(--green); color: var(--green); }
.legend-color.purple { background: var(--purple); color: var(--purple); }
.legend-color.orange { background: var(--orange); color: var(--orange); }

.legend-label {
    flex: 1;
    font-size: 0.9rem;
    color: var(--gray-400);
}

.legend-value {
    font-weight: 700;
    color: var(--white);
    font-family: var(--font-mono);
}

/* ===== TABLE CARD ===== */
.table-card {
    background: var(--dark-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-subtle);
}

.view-all {
    color: var(--primary-light);
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.view-all:hover {
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary-glow);
}

.table-container {
    overflow-x: auto;
}

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

.data-table th {
    text-align: left;
    padding: 14px 16px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
    padding: 16px;
    font-size: 0.9rem;
    color: var(--gray-400);
    border-bottom: 1px solid var(--border-subtle);
}

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

.data-table tbody tr:hover {
    background: var(--dark-elevated);
}

.data-table code {
    background: var(--dark-elevated);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--primary-light);
    font-weight: 500;
    font-family: var(--font-mono);
    border: 1px solid var(--border-subtle);
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-cell span {
    font-weight: 500;
    color: var(--gray-200);
}

.data-table strong {
    color: var(--white);
    font-family: var(--font-mono);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--green);
    box-shadow: 0 0 10px var(--green-glow);
}

.badge.pending {
    background: rgba(245, 158, 11, 0.15);
    color: var(--orange);
    box-shadow: 0 0 10px var(--orange-glow);
}

.badge.failed {
    background: rgba(239, 68, 68, 0.15);
    color: var(--red);
    box-shadow: 0 0 10px var(--red-glow);
}

/* ===== FOOTER ===== */
.main-footer {
    padding: 24px 32px;
    border-top: 1px solid var(--border-subtle);
    text-align: center;
    color: var(--gray-500);
    font-size: 0.85rem;
    background: rgba(10, 10, 15, 0.5);
}

.main-footer a {
    color: var(--primary-light);
    font-weight: 600;
    transition: var(--transition);
}

.main-footer a:hover {
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary-glow);
}

/* ===== WIDGETS ROW ===== */
.widgets-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 32px;
}

.widget-card {
    background: var(--dark-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-subtle);
    animation: slideUp 0.6s ease-out backwards;
    animation-delay: 0.5s;
}

/* Live Badge */
.live-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--green);
    background: rgba(16, 185, 129, 0.1);
    padding: 6px 12px;
    border-radius: 50px;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: var(--green);
    border-radius: 50%;
    animation: pulse 2s infinite;
    box-shadow: 0 0 10px var(--green-glow);
}

/* Activity Feed */
.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.activity-item {
    display: flex;
    gap: 16px;
    padding: 12px;
    border-radius: var(--radius);
    transition: var(--transition);
    border: 1px solid transparent;
}

.activity-item:hover {
    background: var(--dark-elevated);
    border-color: var(--border-subtle);
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon.green { background: rgba(16, 185, 129, 0.15); color: var(--green); }
.activity-icon.blue { background: rgba(59, 130, 246, 0.15); color: var(--blue); }
.activity-icon.purple { background: rgba(139, 92, 246, 0.15); color: var(--purple); }
.activity-icon.orange { background: rgba(245, 158, 11, 0.15); color: var(--orange); }

.activity-content p {
    color: var(--gray-200);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.activity-content span {
    color: var(--gray-500);
    font-size: 0.8rem;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px 16px;
    background: var(--dark-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    transition: var(--transition);
    cursor: pointer;
}

.quick-action-btn:hover {
    border-color: var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
    transform: translateY(-4px);
}

.action-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-icon.blue { background: rgba(59, 130, 246, 0.15); color: var(--blue); box-shadow: 0 0 15px var(--blue-glow); }
.action-icon.green { background: rgba(16, 185, 129, 0.15); color: var(--green); box-shadow: 0 0 15px var(--green-glow); }
.action-icon.purple { background: rgba(139, 92, 246, 0.15); color: var(--purple); box-shadow: 0 0 15px var(--purple-glow); }
.action-icon.orange { background: rgba(245, 158, 11, 0.15); color: var(--orange); box-shadow: 0 0 15px var(--orange-glow); }

.quick-action-btn span {
    color: var(--gray-300);
    font-size: 0.85rem;
    font-weight: 500;
}

.quick-action-btn:hover span {
    color: var(--white);
}

/* Performance Metrics */
.performance-metrics {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.metric-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.metric-header span {
    color: var(--gray-400);
    font-size: 0.85rem;
}

.metric-value {
    color: var(--white) !important;
    font-weight: 700;
    font-family: var(--font-mono);
}

.metric-bar {
    height: 8px;
    background: var(--dark-elevated);
    border-radius: 4px;
    overflow: hidden;
}

.metric-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s ease-out;
    position: relative;
}

.metric-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

.metric-fill.blue { background: var(--gradient-blue); box-shadow: 0 0 10px var(--blue-glow); }
.metric-fill.green { background: var(--gradient-green); box-shadow: 0 0 10px var(--green-glow); }
.metric-fill.purple { background: var(--gradient-purple); box-shadow: 0 0 10px var(--purple-glow); }
.metric-fill.orange { background: var(--gradient-orange); box-shadow: 0 0 10px var(--orange-glow); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1400px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .widgets-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .widgets-row .widget-card:last-child {
        grid-column: span 2;
    }
}

@media (max-width: 1200px) {
    .charts-row {
        grid-template-columns: 1fr;
    }

    .widgets-row {
        grid-template-columns: 1fr;
    }

    .widgets-row .widget-card:last-child {
        grid-column: span 1;
    }

    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        transition: var(--transition);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .search-box {
        width: 200px;
    }
}

@media (max-width: 768px) {
    .dashboard-content {
        padding: 20px;
    }

    .page-header {
        flex-direction: column;
        gap: 20px;
    }

    .page-actions {
        width: 100%;
    }

    .date-select {
        flex: 1;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .main-header {
        padding: 0 20px;
    }

    .search-box {
        display: none;
    }

    .back-btn {
        bottom: 20px;
        right: 20px;
        padding: 12px 20px;
        font-size: 0.85rem;
    }

    .bar {
        width: 28px;
    }

    .widget-card {
        padding: 20px;
    }

    .activity-item {
        padding: 12px;
    }

    .activity-icon {
        width: 36px;
        height: 36px;
    }

    .action-btn {
        padding: 14px 10px;
    }

    .action-btn svg {
        width: 20px;
        height: 20px;
    }

    .action-btn span {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .header-user {
        display: none;
    }

    .page-header h1 {
        font-size: 1.4rem;
    }

    .stat-icon {
        width: 48px;
        height: 48px;
    }

    .stat-icon svg {
        width: 20px;
        height: 20px;
    }

    .chart-card {
        padding: 16px;
    }

    .data-table th,
    .data-table td {
        padding: 12px 10px;
    }

    .widget-card {
        padding: 16px;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .live-badge {
        font-size: 0.7rem;
        padding: 3px 8px;
    }

    .activity-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .activity-time {
        margin-left: 0;
    }

    .quick-actions-grid {
        gap: 10px;
    }

    .action-btn {
        padding: 12px 8px;
    }

    .performance-metrics {
        gap: 12px;
    }

    .metric-header {
        font-size: 0.8rem;
    }

    .metric-value {
        font-size: 0.85rem;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .ambient-orb,
    .live-dot,
    .metric-fill::after {
        animation: none;
    }
}
