/* ==========================================================================
   LiveAgent Pro - Vibrant Modern SaaS Design System
   Colorful Sidebar Icons, Glassmorphic Accents, Vector Graphics
   ========================================================================== */

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

:root {
    /* Color Palette */
    --bg-dark: #f8fafc;
    --bg-surface: #ffffff;
    --border-color: #e2e8f0;

    /* Vibrant Accents */
    --accent-indigo: #6366f1;
    --accent-purple: #8b5cf6;
    --accent-cyan: #0ea5e9;
    --accent-green: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;
    --accent-pink: #ec4899;

    /* Gradients */
    --grad-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --grad-hero: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #8b5cf6 100%);
    --grad-cyan: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
    --grad-green: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --grad-amber: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --grad-rose: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);

    /* Text */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    /* Geometry & Effects */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 14px -2px rgba(15, 23, 42, 0.06);
    --shadow-glass: 0 12px 32px -4px rgba(15, 23, 42, 0.08);
    --shadow-glow: 0 8px 24px rgba(99, 102, 241, 0.22);

    --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseGlow {
    0%, 100% { opacity: 1; filter: drop-shadow(0 0 6px var(--accent-green)); }
    50% { opacity: 0.5; filter: drop-shadow(0 0 12px var(--accent-green)); }
}

.animate-fade-in {
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Layout Container */
.app-container {
    display: flex;
    min-height: 100vh;
    background: radial-gradient(circle at 5% 5%, rgba(99, 102, 241, 0.04) 0%, transparent 35%),
                radial-gradient(circle at 95% 95%, rgba(14, 165, 233, 0.04) 0%, transparent 35%),
                var(--bg-dark);
}

/* Modern Sidebar */
.sidebar {
    width: 275px;
    background: #ffffff;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.75rem 1.25rem;
    z-index: 100;
    box-shadow: 2px 0 16px rgba(0, 0, 0, 0.02);
}

/* Clean Logo (No Underline) */
.brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding-bottom: 1.25rem;
    border-bottom: none !important;
    margin-bottom: 1.25rem;
    text-decoration: none !important;
}

.brand-logo {
    width: 44px;
    height: 44px;
    background: var(--grad-hero);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: var(--shadow-glow);
    transition: var(--transition);
}

.brand:hover .brand-logo {
    transform: scale(1.06) rotate(-3deg);
}

.brand-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    text-decoration: none !important;
}

.brand-subtitle {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent-indigo);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Sidebar Menu with Colorful Icons */
.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none !important;
    font-size: 0.93rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    color: var(--accent-indigo);
    background: #f1f5f9;
    transform: translateX(4px);
}

.nav-link.active {
    color: var(--accent-indigo);
    background: rgba(99, 102, 241, 0.09);
    font-weight: 700;
}

/* Colorful Icon Badges */
.nav-icon-badge {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.nav-icon-badge svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.2;
    fill: none;
}

/* Theme Icon Colors */
.icon-indigo { background: rgba(99, 102, 241, 0.12); color: #6366f1; }
.icon-cyan   { background: rgba(14, 165, 233, 0.12); color: #0ea5e9; }
.icon-green  { background: rgba(16, 185, 129, 0.12); color: #10b981; }
.icon-purple { background: rgba(139, 92, 246, 0.12); color: #8b5cf6; }
.icon-amber  { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }
.icon-pink   { background: rgba(236, 72, 153, 0.12); color: #ec4899; }
.icon-rose   { background: rgba(244, 63, 94, 0.12);  color: #f43f5e; }
.icon-slate  { background: rgba(71, 85, 105, 0.12);  color: #475569; }

.nav-link:hover .nav-icon-badge {
    transform: scale(1.1);
}

/* Sidebar Footer */
.sidebar-footer {
    margin-top: auto;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.agent-pill {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.status-dot-live {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-green);
    animation: pulseGlow 2s infinite;
}

/* Topbar Header */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    height: 72px;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 0 2.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 90;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.02);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.badge-status {
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.badge-connected {
    background: rgba(16, 185, 129, 0.08);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-purple {
    background: rgba(139, 92, 246, 0.08);
    color: var(--accent-purple);
    border: 1px solid rgba(139, 92, 246, 0.25);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.65rem 1.25rem;
    font-size: 0.88rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    text-decoration: none !important;
    outline: none;
    font-family: var(--font-main);
}

.btn-primary {
    background: var(--grad-primary);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.28);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: #ffffff;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.btn-danger {
    background: rgba(244, 63, 94, 0.08);
    color: var(--accent-rose);
    border: 1px solid rgba(244, 63, 94, 0.2);
}

.btn-danger:hover {
    background: var(--accent-rose);
    color: #ffffff;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.45rem 0.85rem;
    font-size: 0.8rem;
}

/* Content Area */
.content-body {
    padding: 2.25rem;
    flex: 1;
    overflow-y: auto;
}

/* KPI Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.35rem;
    margin-bottom: 2rem;
}

.glass-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: var(--transition);
    box-shadow: var(--shadow-glass);
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--grad-primary);
    opacity: 0;
    transition: var(--transition);
}

.glass-card:hover {
    border-color: #cbd5e1;
    transform: translateY(-4px);
    box-shadow: 0 18px 40px -6px rgba(15, 23, 42, 0.12);
}

.glass-card:hover::before {
    opacity: 1;
}

/* Color Accent Top Borders for Cards */
.card-accent-indigo::before { background: var(--grad-primary) !important; opacity: 1 !important; }
.card-accent-cyan::before   { background: var(--grad-cyan) !important; opacity: 1 !important; }
.card-accent-green::before  { background: var(--grad-green) !important; opacity: 1 !important; }
.card-accent-purple::before { background: var(--grad-primary) !important; opacity: 1 !important; }
.card-accent-rose::before   { background: var(--grad-rose) !important; opacity: 1 !important; }

.card-header-sm {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.85rem;
}

.card-value {
    font-size: 2.15rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    line-height: 1;
}

.card-subtext {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.45rem;
    font-weight: 500;
}

/* 2-Column Grid Layout */
.grid-2 {
    display: grid;
    grid-template-columns: 2.2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

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

.chart-container {
    height: 260px;
    width: 100%;
    position: relative;
    margin-top: 1rem;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 9999;
}

.toast {
    min-width: 290px;
    padding: 0.9rem 1.25rem;
    border-radius: var(--radius-md);
    background: #ffffff;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-glass);
    font-size: 0.88rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}