/* ============================================
   Baileys CRM — Premium Dark Dashboard
   Design System & Complete Styles
   ============================================ */

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

/* === CSS Custom Properties (Design Tokens) === */
:root {
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;

    /* Background Colors */
    --bg-primary: #0b0e14;
    --bg-secondary: #0f1219;
    --bg-tertiary: #151a24;
    --bg-elevated: #1a2030;
    --bg-hover: rgba(255, 255, 255, 0.04);
    --bg-active: rgba(255, 255, 255, 0.06);

    /* Surface (Glass Cards) */
    --surface-glass: rgba(255, 255, 255, 0.02);
    --surface-glass-hover: rgba(255, 255, 255, 0.04);
    --surface-glass-border: rgba(255, 255, 255, 0.06);
    --surface-glass-border-hover: rgba(255, 255, 255, 0.1);

    /* Text Colors */
    --text-primary: #e8eaed;
    --text-secondary: #9aa0ab;
    --text-tertiary: #5f6673;
    --text-muted: #3d4350;

    /* Border Colors */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-default: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.15);

    /* Accent Colors */
    --accent-green: #22c55e;
    --accent-green-soft: rgba(34, 197, 94, 0.12);
    --accent-green-glow: rgba(34, 197, 94, 0.25);

    --accent-yellow: #eab308;
    --accent-yellow-soft: rgba(234, 179, 8, 0.12);

    --accent-red: #ef4444;
    --accent-red-soft: rgba(239, 68, 68, 0.12);

    --accent-blue: #3b82f6;
    --accent-blue-soft: rgba(59, 130, 246, 0.12);
    --accent-blue-glow: rgba(59, 130, 246, 0.3);

    --accent-purple: #8b5cf6;
    --accent-purple-soft: rgba(139, 92, 246, 0.12);

    --accent-cyan: #06b6d4;
    --accent-cyan-soft: rgba(6, 182, 212, 0.12);

    --accent-orange: #f97316;
    --accent-orange-soft: rgba(249, 115, 22, 0.12);

    --accent-rose: #f43f5e;
    --accent-rose-soft: rgba(244, 63, 94, 0.12);

    /* Gradients */
    --gradient-green: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    --gradient-blue: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --gradient-purple: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    --gradient-rose: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
    --gradient-cyan: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    --gradient-orange: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    --gradient-dark: linear-gradient(180deg, #0f1219 0%, #0b0e14 100%);

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

    /* Spacing */
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --topbar-height: 64px;

    /* Radius */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 12px 48px rgba(0, 0, 0, 0.5);
    --shadow-glow-green: 0 0 20px rgba(34, 197, 94, 0.15);
    --shadow-glow-blue: 0 0 20px rgba(59, 130, 246, 0.15);
    --shadow-glow-purple: 0 0 20px rgba(139, 92, 246, 0.15);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.16, 1, 0.3, 1);
    --transition-normal: 250ms cubic-bezier(0.16, 1, 0.3, 1);
    --transition-slow: 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

body {
    font-family: var(--font-primary);
    background: radial-gradient(circle at 15% 15%, rgba(34, 197, 94, 0.08) 0%, transparent 45%),
                radial-gradient(circle at 85% 30%, rgba(59, 130, 246, 0.07) 0%, transparent 45%),
                radial-gradient(circle at 50% 85%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
                #090c10;
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
}

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

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

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

img {
    max-width: 100%;
    height: auto;
}

/* === Custom Scrollbar === */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* === Animations === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

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

@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 5px rgba(34, 197, 94, 0.2); }
    50% { box-shadow: 0 0 20px rgba(34, 197, 94, 0.4); }
}

@keyframes dotPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.7; }
}

/* === Login Page === */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-bg {
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(34, 197, 94, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(59, 130, 246, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 50%),
        var(--bg-primary);
    z-index: 0;
}

.login-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.01) 1px, transparent 1px),
        radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.01) 1px, transparent 1px);
    background-size: 50px 50px;
}

.login-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 40px;
    background: rgba(15, 18, 25, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid var(--surface-glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    animation: fadeInUp 0.6s ease-out;
}

.login-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    justify-content: center;
}

.login-logo svg {
    width: 40px;
    height: 40px;
}

.login-logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #22c55e, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-title {
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    text-align: center;
    margin-bottom: 32px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.form-input:focus {
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px var(--accent-green-soft);
}

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

.form-input.error {
    border-color: var(--accent-red);
    box-shadow: 0 0 0 3px var(--accent-red-soft);
    animation: shake 0.5s ease;
}

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-green);
    cursor: pointer;
}

.form-link {
    font-size: 0.8125rem;
    color: var(--accent-green);
    transition: color var(--transition-fast);
}

.form-link:hover {
    color: #16a34a;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    cursor: pointer;
    border: none;
    white-space: nowrap;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: var(--gradient-green);
    color: white;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.25);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

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

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

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8125rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    color: var(--text-primary);
    background: var(--bg-elevated);
    border-color: var(--border-default);
}

.btn-add {
    background: var(--accent-green-soft);
    color: var(--accent-green);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.btn-add:hover {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.3);
}

.login-error {
    display: none;
    padding: 10px 14px;
    background: var(--accent-red-soft);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-md);
    color: var(--accent-red);
    font-size: 0.8125rem;
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease;
}

.login-error.show {
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.btn-primary.loading .login-spinner {
    display: inline-block;
}

.btn-primary.loading .btn-text {
    display: none;
}

/* === Dashboard Layout === */
.dashboard {
    display: flex;
    min-height: 100vh;
}

/* === Sidebar === */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
    min-height: 64px;
}

.sidebar-logo {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo svg {
    width: 36px;
    height: 36px;
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar-brand-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.sidebar-brand-sub {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    line-height: 1.2;
}

/* === Sidebar Navigation === */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

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

.nav-section-title {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding: 12px 12px 6px;
    display: block;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    margin-bottom: 1px;
    cursor: pointer;
    position: relative;
}

.nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.nav-item.active {
    color: var(--text-primary);
    background: var(--accent-green-soft);
}

.nav-item.active .nav-icon {
    color: var(--accent-green);
}

.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.6;
    transition: all var(--transition-fast);
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
    opacity: 1;
}

.nav-item-expand {
    margin-left: auto;
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

.nav-item.expanded .nav-item-expand {
    transform: rotate(180deg);
}

.nav-subitems {
    display: none;
    padding-left: 40px;
}

.nav-subitems.show {
    display: block;
}

.nav-subitem {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.nav-subitem:hover {
    color: var(--text-secondary);
    background: var(--bg-hover);
}

/* === Sidebar Footer === */
.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border-subtle);
}

.sidebar-plan {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    margin-bottom: 8px;
}

.plan-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.plan-badge {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: var(--accent-purple-soft);
    color: var(--accent-purple);
}

.plan-expiry {
    font-size: 0.6875rem;
    color: var(--text-muted);
    padding: 0 12px;
    margin-bottom: 8px;
    display: block;
}

.btn-upgrade {
    width: 100%;
    padding: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    background: var(--gradient-green);
    color: white;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-upgrade:hover {
    box-shadow: var(--shadow-glow-green);
    transform: translateY(-1px);
}

/* === Main Content === */
.dashboard-main {
    flex: 1;
    margin-left: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-height: 100vh;
}

/* === Top Bar === */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    height: var(--topbar-height);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(11, 14, 20, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 50;
}

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

.topbar-hamburger {
    display: none;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

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

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

.topbar-btn {
    position: relative;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

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

.notification-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--accent-red);
    border-radius: 50%;
    border: 2px solid var(--bg-secondary);
    animation: dotPulse 2s ease-in-out infinite;
}

.notification-count {
    position: absolute;
    top: 2px;
    right: 0px;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.5625rem;
    font-weight: 700;
    background: var(--accent-red);
    color: white;
    border-radius: var(--radius-full);
    border: 2px solid var(--bg-secondary);
    padding: 0 3px;
}

.topbar-divider {
    width: 1px;
    height: 24px;
    background: var(--border-subtle);
    margin: 0 4px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px 4px 4px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.topbar-user:hover {
    background: var(--bg-hover);
}

.topbar-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--gradient-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
}

.topbar-user-info {
    display: flex;
    flex-direction: column;
}

.topbar-user-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.topbar-user-role {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    line-height: 1.2;
}

.topbar-user-expand {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
}

/* Date Range Picker */
.date-range-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.date-range-btn:hover {
    border-color: var(--border-default);
    color: var(--text-primary);
}

.date-range-btn svg {
    width: 14px;
    height: 14px;
}

/* === Dashboard Content Area === */
.dashboard-content {
    padding: 24px 28px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.page-header {
    margin-bottom: 24px;
    animation: fadeInUp 0.4s ease-out;
}

.page-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.page-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-primary);
}

.page-subtitle {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin-top: 2px;
}

/* === Stat Cards === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.stat-card {
    position: relative;
    padding: 14px 18px;
    background: rgba(18, 22, 32, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
    box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.5), inset 0 1px 0 0 rgba(255, 255, 255, 0.08);
    animation: fadeInUp 0.4s ease-out both;
}

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

.stat-card:hover {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(24, 30, 44, 0.75);
    transform: translateY(-3px);
    box-shadow: 0 14px 30px -10px rgba(0, 0, 0, 0.6), 0 0 16px rgba(34, 197, 94, 0.1);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    opacity: 0.85;
    transition: opacity var(--transition-fast);
}

.stat-card.green::before { background: linear-gradient(90deg, #22c55e, #10b981); }
.stat-card.blue::before { background: linear-gradient(90deg, #3b82f6, #06b6d4); }
.stat-card.purple::before { background: linear-gradient(90deg, #8b5cf6, #ec4899); }
.stat-card.cyan::before { background: linear-gradient(90deg, #06b6d4, #3b82f6); }

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.stat-card-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    letter-spacing: 0.01em;
}

.stat-card-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

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

.stat-card-icon.green { background: rgba(34, 197, 94, 0.15); color: #4ade80; box-shadow: 0 0 12px rgba(34, 197, 94, 0.2); }
.stat-card-icon.blue { background: rgba(59, 130, 246, 0.15); color: #60a5fa; box-shadow: 0 0 12px rgba(59, 130, 246, 0.2); }
.stat-card-icon.purple { background: rgba(139, 92, 246, 0.15); color: #c084fc; box-shadow: 0 0 12px rgba(139, 92, 246, 0.2); }
.stat-card-icon.cyan { background: rgba(6, 182, 212, 0.15); color: #22d3ee; box-shadow: 0 0 12px rgba(6, 182, 212, 0.2); }

.stat-card-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.02em;
    line-height: 1;
    margin: 2px 0 4px 0;
    animation: countUp 0.6s ease-out both;
}

.stat-card-change {
    font-size: 0.72rem;
    font-weight: 600;
}

.stat-card-change.positive { color: #4ade80; }
.stat-card-change.neutral { color: #64748b; }
.stat-card-change.negative { color: #f87171; }

/* === Content Grid (Tables + Chart) === */
.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.content-grid-equal {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

/* === Card / Container === */
.card {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    background: rgba(16, 20, 29, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5), inset 0 1px 0 0 rgba(255, 255, 255, 0.06);
    animation: fadeInUp 0.4s ease-out both;
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.14);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.015);
}

.card-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.01em;
}

.card-title svg {
    width: 18px;
    height: 18px;
    color: var(--accent-green);
    opacity: 0.9;
}

.card-body {
    padding: 16px;
}

.card-footer {
    padding: 10px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.01);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* === Data Tables === */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 12px 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #8892b0;
    background: rgba(255, 255, 255, 0.025);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    white-space: nowrap;
}

.data-table td {
    padding: 12px 20px;
    font-size: 0.82rem;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    white-space: nowrap;
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background 0.2s ease;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.035);
}

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

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

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.td-name {
    color: var(--text-primary);
    font-weight: 500;
}

.td-mono {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.td-copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.copy-btn {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-xs);
    transition: all var(--transition-fast);
    opacity: 0;
}

.data-table tbody tr:hover .copy-btn {
    opacity: 1;
}

.copy-btn:hover {
    color: var(--text-secondary);
    background: var(--bg-hover);
}

/* === Status Badges === */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-connected {
    background: var(--accent-green-soft);
    color: var(--accent-green);
}
.status-connected::before {
    background: var(--accent-green);
    box-shadow: 0 0 6px var(--accent-green);
}

.status-connecting {
    background: var(--accent-yellow-soft);
    color: var(--accent-yellow);
}
.status-connecting::before {
    background: var(--accent-yellow);
    animation: pulse 1.5s ease-in-out infinite;
}

.status-disconnected {
    background: var(--accent-red-soft);
    color: var(--accent-red);
}
.status-disconnected::before {
    background: var(--accent-red);
}

/* Network Badges */
.network-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 0.625rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.network-ethereum { background: rgba(98, 126, 234, 0.15); color: #627eea; }
.network-bsc { background: rgba(243, 186, 47, 0.15); color: #f3ba2f; }
.network-polygon { background: rgba(130, 71, 229, 0.15); color: #8247e5; }
.network-arbitrum { background: rgba(40, 160, 240, 0.15); color: #28a0f0; }
.network-base { background: rgba(0, 82, 255, 0.15); color: #0052ff; }
.network-solana { background: rgba(153, 69, 255, 0.15); color: #9945ff; }

/* Platform Icons */
.platform-icon {
    width: 20px;
    height: 20px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.platform-whatsapp {
    background: rgba(37, 211, 102, 0.15);
    color: #25d366;
}

/* === Pagination === */
.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
}

.page-info {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.page-btn {
    min-width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.page-btn:hover:not(:disabled):not(.active) {
    background: var(--bg-hover);
    border-color: var(--border-subtle);
}

.page-btn.active {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* === Session Status (Donut Chart) === */
.chart-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    min-height: 280px;
}

.donut-wrapper {
    position: relative;
    width: 180px;
    height: 180px;
    margin-bottom: 20px;
}

.donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.donut-center-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.donut-center-label {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    flex-shrink: 0;
}

.legend-dot.green { background: var(--accent-green); }
.legend-dot.yellow { background: var(--accent-yellow); }
.legend-dot.red { background: var(--accent-red); }

.legend-value {
    margin-left: auto;
    font-weight: 600;
    color: var(--text-primary);
}

/* === Recent Activity === */
.activity-section {
    animation: fadeInUp 0.5s ease-out 0.4s both;
}

.activity-list {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.activity-item {
    flex: 1;
    min-width: 280px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--surface-glass);
    border: 1px solid var(--surface-glass-border);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

.activity-item:hover {
    border-color: var(--surface-glass-border-hover);
    background: var(--surface-glass-hover);
}

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

.activity-icon.green { background: var(--accent-green-soft); color: var(--accent-green); }
.activity-icon.blue { background: var(--accent-blue-soft); color: var(--accent-blue); }
.activity-icon.purple { background: var(--accent-purple-soft); color: var(--accent-purple); }
.activity-icon.orange { background: var(--accent-orange-soft); color: var(--accent-orange); }

.activity-icon svg {
    width: 18px;
    height: 18px;
}

.activity-info {
    flex: 1;
    min-width: 0;
}

.activity-title {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-detail {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-time {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.view-all-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-tertiary);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    transition: all var(--transition-fast);
}

.view-all-link:hover {
    color: var(--text-primary);
    border-color: var(--border-default);
    background: var(--bg-hover);
}

/* === Action Buttons in Tables === */
.table-actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}

.action-btn {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    opacity: 0;
}

.data-table tbody tr:hover .action-btn {
    opacity: 1;
}

.action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.action-btn.danger:hover {
    background: var(--accent-red-soft);
    color: var(--accent-red);
}

/* === Modal === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    width: 100%;
    max-width: 480px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    animation: fadeInUp 0.3s ease-out;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
    font-size: 1rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-tertiary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-subtle);
}

/* === Toast Notifications === */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    max-width: calc(100vw - 40px);
    overflow: hidden;
}

@keyframes toastFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(22, 27, 38, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
    animation: toastFadeIn 0.25s ease-out;
    width: 340px;
    max-width: 100%;
    pointer-events: auto;
    box-sizing: border-box;
}

.toast.success { border-left: 3px solid var(--accent-green); }
.toast.error { border-left: 3px solid var(--accent-red); }
.toast.warning { border-left: 3px solid var(--accent-yellow); }
.toast.info { border-left: 3px solid var(--accent-blue); }

.toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast.success .toast-icon { color: var(--accent-green); }
.toast.error .toast-icon { color: var(--accent-red); }
.toast.warning .toast-icon { color: var(--accent-yellow); }
.toast.info .toast-icon { color: var(--accent-blue); }

.toast-content {
    flex: 1;
}

.toast-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.toast-message {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.toast-close {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.toast-close:hover {
    color: var(--text-secondary);
    background: var(--bg-hover);
}

/* === Loading Skeleton === */
.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-elevated) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 20px;
    width: 60%;
    margin-bottom: 12px;
}

.skeleton-circle {
    border-radius: var(--radius-full);
}

/* === Dropdown Menu === */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 180px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 4px;
    z-index: 150;
    display: none;
    animation: fadeInUp 0.2s ease-out;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.dropdown-item.danger {
    color: var(--accent-red);
}

.dropdown-item.danger:hover {
    background: var(--accent-red-soft);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 4px 0;
}

/* === Responsive === */
@media (max-width: 1200px) {
    .content-grid,
    .content-grid-equal {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

    .stat-card {
        padding: 14px;
    }

    .stat-card-value {
        font-size: 1.25rem;
    }

    .topbar-user-info {
        display: none;
    }

    .activity-list {
        flex-direction: column;
    }

    .activity-item {
        min-width: unset;
    }
}

@media (max-width: 580px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .page-header-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* === Utility Classes === */
.text-green { color: var(--accent-green); }
.text-blue { color: var(--accent-blue); }
.text-red { color: var(--accent-red); }
.text-yellow { color: var(--accent-yellow); }
.text-purple { color: var(--accent-purple); }
.text-muted { color: var(--text-tertiary); }
.text-primary { color: var(--text-primary); }

.font-mono { font-family: var(--font-mono); }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

.hidden { display: none !important; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* === Select Input === */
.form-select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235f6673' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.form-select:focus {
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px var(--accent-green-soft);
}

.form-select option {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* === Textarea === */
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    resize: vertical;
    min-height: 80px;
    transition: all var(--transition-fast);
}

.form-textarea:focus {
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px var(--accent-green-soft);
}

/* === Toggle Switch === */
.toggle {
    position: relative;
    width: 40px;
    height: 22px;
    cursor: pointer;
}

.toggle input {
    display: none;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

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

.toggle input:checked + .toggle-slider {
    background: var(--accent-green-soft);
    border-color: rgba(34, 197, 94, 0.3);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(18px);
    background: var(--accent-green);
}
