/* ═══════════════════════════════════════════════════════
   AG-SaaS TGBot — Premium Design System
   ═══════════════════════════════════════════════════════ */

:root {
    /* Core Colors */
    --primary:        #7c3aed; /* Vibrant Violet */
    --primary-light:  #a78bfa;
    --primary-glow:   rgba(124, 58, 237, 0.3);
    --secondary:      #06b6d4; /* Cyan */
    --accent:         #f43f5e; /* Rose */
    
    /* Backgrounds */
    --bg-main:        #020617; /* Deep Slate */
    --bg-sidebar:     rgba(15, 23, 42, 0.7);
    --card-bg:        rgba(30, 41, 59, 0.45);
    --card-hover:     rgba(30, 41, 59, 0.65);
    
    /* Typography */
    --text-main:      #f8fafc;
    --text-muted:     #94a3b8;
    --text-dim:       #64748b;
    
    /* Borders & Glass */
    --border:         rgba(255, 255, 255, 0.08);
    --border-hover:   rgba(255, 255, 255, 0.15);
    --glass-blur:     16px;
    
    /* Status */
    --success:        #10b981;
    --danger:         #ef4444;
    --warning:        #f59e0b;
    --info:           #3b82f6;

    /* Spacing & Sizing */
    --sidebar-w:      280px;
    --radius-sm:      12px;
    --radius-md:      20px;
    --radius-lg:      32px;
    --transition:     0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; font-size: 15px; }

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3, h4, .logo, .stat-value {
    font-family: 'Outfit', sans-serif;
}

/* Ambient Ambient Glow */
body::before {
    content: '';
    position: fixed; inset: 0; z-index: -1;
    background: 
        radial-gradient(circle at 0% 0%, rgba(124, 58, 237, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 100% 100%, rgba(6, 182, 212, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(15, 23, 42, 1) 0%, var(--bg-main) 100%);
}

/* ── Layout ──────────────────────────────────────────── */
.container { display: flex; min-height: 100vh; }

/* ── Sidebar (Premium Glass) ─────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-sidebar);
    backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    border-right: 1px solid var(--border);
    padding: 2.5rem 1.5rem;
    position: fixed; top: 0; left: 0; bottom: 0;
    display: flex; flex-direction: column;
    z-index: 200;
    transition: transform var(--transition);
}

.logo {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 3.5rem;
    letter-spacing: -0.5px;
}

.logo-icon {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    box-shadow: 0 8px 16px var(--primary-glow);
}

.logo span {
    background: linear-gradient(to right, #fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Navigation Links */
nav { flex: 1; }

.sidebar-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 1.5rem 1rem 0.75rem;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0.9rem 1.2rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-sm);
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all var(--transition);
}

.menu-item i { width: 18px; height: 18px; opacity: 0.7; }

.menu-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    transform: translateX(4px);
}

.menu-item.active {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(124, 58, 237, 0.05));
    color: #fff;
    border: 1px solid rgba(124, 58, 237, 0.25);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.menu-item.active i { color: var(--primary-light); opacity: 1; }

.menu-item--danger:hover { color: var(--accent); background: rgba(244, 63, 94, 0.1); }

.sidebar-divider { height: 1px; background: var(--border); margin: 1.5rem 0.5rem; opacity: 0.5; }

/* User Profile Section */
.user-profile {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-top: auto;
}

.avatar {
    width: 44px; height: 44px;
    background: linear-gradient(135deg, var(--primary), #9333ea);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: #fff; font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.user-name { font-weight: 600; font-size: 0.9rem; color: #fff; }
.user-role { font-size: 0.75rem; color: var(--text-dim); }

/* ── Main Content Area ───────────────────────────────── */
.main {
    flex: 1;
    margin-left: var(--sidebar-w);
    padding: 3rem 4.5rem;
    min-width: 0;
}

.content-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    animation: slideUp 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* ── Typography & Headers ────────────────────────────── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 3rem;
}

.page-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ── Stats Grid (High Premium) ───────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: all var(--transition);
}

.stat-card:hover {
    transform: translateY(-6px);
    background: var(--card-hover);
    border-color: rgba(124, 58, 237, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.stat-card i {
    position: absolute;
    right: -10px; bottom: -10px;
    font-size: 5rem;
    opacity: 0.04;
    transform: rotate(-15deg);
}

.stat-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    display: block;
}

.stat-value {
    font-size: 2.4rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
}

.stat-trend {
    margin-top: 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.trend-up { color: var(--success); }
.trend-down { color: var(--danger); }

/* ── Dashboard Cards & Charts ────────────────────────── */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ── Bot Grid ────────────────────────────────────────── */
.bot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.bot-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    transition: all var(--transition);
}

.bot-card:hover {
    border-color: var(--primary);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
    transform: translateY(-4px);
}

.bot-card__header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.bot-info h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 2px; }
.bot-username { font-size: 0.85rem; color: var(--text-dim); }

.bot-stats {
    display: flex;
    gap: 1.5rem;
    margin: 1.5rem 0;
    padding: 1rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.mini-stat { display: flex; flex-direction: column; gap: 2px; }
.mini-stat__label { font-size: 0.7rem; color: var(--text-dim); text-transform: uppercase; }
.mini-stat__value { font-size: 1.1rem; font-weight: 700; }

/* ── Buttons (Modern) ────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid transparent;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--primary-glow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-color: var(--border);
}

.btn-secondary:hover { background: rgba(255, 255, 255, 0.1); }

.btn-icon {
    width: 38px; height: 38px;
    padding: 0; border-radius: 10px;
}

/* ── Alerts ──────────────────────────────────────────── */
.alert {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    margin-bottom: 2rem;
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    animation: slideInDown 0.4s ease forwards;
}

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

.alert-success { border-left: 4px solid var(--success); }
.alert-error { border-left: 4px solid var(--danger); }

.alert__close { margin-left: auto; background: none; border: none; color: var(--text-dim); cursor: pointer; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 1200px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; padding: 2rem 1.5rem; }
    .mobile-header { display: flex; }
    .stats-grid { grid-template-columns: 1fr; }
}

/* Mobile Header */
.mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.hamburger {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: #fff;
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
}
