/* =============================================
   StockSplitBot Dashboard — Design System CSS
   Premium Dark Mode Trading Dashboard
   ============================================= */

/* ===== CSS VARIABLES ===== */
:root {
    /* Backgrounds */
    --bg-main: #0a0e17;
    --bg-card: #111827;
    --bg-sidebar: #1a1f2e;
    --bg-input: #0f1520;
    --bg-hover: rgba(99, 102, 241, 0.08);
    --bg-table-stripe: rgba(255, 255, 255, 0.02);

    /* Glass */
    --glass-bg: rgba(17, 24, 39, 0.8);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: 20px;

    /* Colors */
    --profit: #10b981;
    --profit-bg: rgba(16, 185, 129, 0.12);
    --loss: #ef4444;
    --loss-bg: rgba(239, 68, 68, 0.12);
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-end: #8b5cf6;
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.12);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.12);

    /* Text */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-inverse: #0a0e17;

    /* Borders */
    --border: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.1);
    --border-accent: rgba(99, 102, 241, 0.3);

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

    /* Sizes */
    --sidebar-width: 260px;
    --header-height: 60px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.15);

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

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

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

body {
    font-family: var(--font-body);
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 22px; font-weight: 600; }
h3 { font-size: 18px; font-weight: 600; }
h4 { font-size: 16px; font-weight: 600; }

img { max-width: 100%; }

ul, ol { list-style: none; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ===== UTILITY CLASSES ===== */
.hidden { display: none !important; }
.mono { font-family: var(--font-mono); }
.text-profit { color: var(--profit) !important; }
.text-loss { color: var(--loss) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }

/* ===== LOGIN OVERLAY ===== */
.login-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(139, 92, 246, 0.06) 0%, transparent 50%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 40px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.6s var(--transition-slow);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.3));
}

.login-logo h1 {
    background: linear-gradient(135deg, var(--accent), var(--accent-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 26px;
}

.login-subtitle {
    color: var(--text-secondary);
    margin-top: 6px;
    font-size: 13px;
}

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

.login-error {
    color: var(--loss);
    text-align: center;
    font-size: 13px;
    margin-top: 12px;
    padding: 8px;
    background: var(--loss-bg);
    border-radius: var(--radius-sm);
}

/* ===== APP LAYOUT ===== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform var(--transition-base);
}

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

.sidebar-logo {
    font-size: 26px;
    filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.3));
}

.sidebar-title {
    font-size: 17px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), var(--accent-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-close-btn {
    display: none;
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}
.sidebar-close-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

.sidebar-nav {
    flex: 1;
    padding: 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: linear-gradient(180deg, var(--accent), var(--accent-end));
    border-radius: 0 2px 2px 0;
    transition: height var(--transition-base);
}

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

.nav-item.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.08));
    color: var(--text-primary);
}

.nav-item.active::before {
    height: 24px;
}

.nav-icon { font-size: 18px; width: 24px; text-align: center; }
.nav-label { white-space: nowrap; }

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

.sidebar-version {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
}

/* ===== MAIN WRAPPER ===== */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left var(--transition-base);
}

/* ===== TOP HEADER ===== */
.top-header {
    height: var(--header-height);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(17, 24, 39, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.hamburger-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
}
.hamburger-btn:hover { background: var(--bg-hover); }
.hamburger-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 1px;
    transition: all var(--transition-fast);
}

.page-title {
    font-size: 18px;
    font-weight: 600;
}

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

/* Bot Status Indicator */
.bot-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    position: relative;
}

.status-dot.running {
    background: var(--profit);
    box-shadow: 0 0 8px var(--profit);
    animation: pulse-green 2s infinite;
}

.status-dot.stopped {
    background: var(--loss);
    box-shadow: 0 0 8px var(--loss);
}

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

/* ===== CONTENT AREA ===== */
.content-area {
    flex: 1;
    padding: 24px;
    background-image:
        radial-gradient(ellipse at 10% 20%, rgba(99, 102, 241, 0.04) 0%, transparent 40%),
        radial-gradient(ellipse at 90% 80%, rgba(139, 92, 246, 0.03) 0%, transparent 40%);
}

/* ===== CARDS ===== */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    padding: 1px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), transparent 50%, rgba(139, 92, 246, 0.05));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.card-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-value {
    font-family: var(--font-mono);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    margin-top: 4px;
}

.card-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.card-icon {
    font-size: 28px;
    opacity: 0.7;
}

/* Grid layouts */
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

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

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    line-height: 1.4;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-end));
    color: #fff;
    border: none;
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.25);
}
.btn-primary:hover {
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
    filter: brightness(1.1);
}

.btn-danger {
    background: var(--loss);
    color: #fff;
    border: none;
}
.btn-danger:hover { filter: brightness(1.15); box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3); }

.btn-success {
    background: var(--profit);
    color: #fff;
    border: none;
}
.btn-success:hover { filter: brightness(1.15); box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3); }

.btn-warning {
    background: var(--warning);
    color: var(--text-inverse);
    border: none;
}
.btn-warning:hover { filter: brightness(1.15); }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-accent); }

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-full { width: 100%; }

.btn:disabled, .btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ===== FORM ELEMENTS ===== */
.form-group {
    margin-bottom: 16px;
}

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

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    transition: all var(--transition-fast);
    outline: none;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

input[type="number"] { font-family: var(--font-mono); }

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

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.form-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ===== TABLES ===== */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

thead th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

tbody tr:nth-child(even) { background: var(--bg-table-stripe); }

tbody tr:hover { background: rgba(99, 102, 241, 0.04); }

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

td.mono, th.mono { font-family: var(--font-mono); }

.table-summary {
    background: rgba(99, 102, 241, 0.06) !important;
    font-weight: 600;
}

.table-summary td { border-top: 2px solid var(--border-accent); }

/* ===== STATUS BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-profit {
    background: var(--profit-bg);
    color: var(--profit);
}

.badge-loss {
    background: var(--loss-bg);
    color: var(--loss);
}

.badge-neutral {
    background: rgba(100, 116, 139, 0.15);
    color: var(--text-muted);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-running {
    background: var(--profit-bg);
    color: var(--profit);
}

.badge-stopped {
    background: var(--loss-bg);
    color: var(--loss);
}

/* ===== LOADING SPINNER ===== */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-sm {
    width: 18px;
    height: 18px;
    border-width: 2px;
}

.btn-spinner {
    animation: spin 1s linear infinite;
    display: inline-block;
}

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

.loading-fullpage {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    gap: 16px;
    color: var(--text-muted);
}

.loading-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 13px;
    padding: 20px 0;
    justify-content: center;
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.35s ease;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    max-width: 420px;
    backdrop-filter: blur(12px);
    cursor: pointer;
}

.toast-success {
    background: rgba(16, 185, 129, 0.9);
    color: #fff;
    border: 1px solid rgba(16, 185, 129, 0.5);
}

.toast-error {
    background: rgba(239, 68, 68, 0.9);
    color: #fff;
    border: 1px solid rgba(239, 68, 68, 0.5);
}

.toast-info {
    background: rgba(59, 130, 246, 0.9);
    color: #fff;
    border: 1px solid rgba(59, 130, 246, 0.5);
}

.toast-warning {
    background: rgba(245, 158, 11, 0.9);
    color: var(--text-inverse);
    border: 1px solid rgba(245, 158, 11, 0.5);
}

.toast.fade-out {
    animation: slideOutRight 0.35s ease forwards;
}

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

@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* ===== CHART CONTAINERS ===== */
.chart-container {
    position: relative;
    width: 100%;
    padding: 16px 0;
}

.chart-container canvas {
    max-height: 350px;
}

.chart-container-mini canvas {
    max-height: 200px;
}

/* ===== SECTION HEADERS ===== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 15px;
    margin-top: 8px;
}

/* ===== FILTER BAR ===== */
.filter-bar {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    padding: 20px 24px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-bar .form-group {
    margin-bottom: 0;
    min-width: 150px;
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    padding: 12px 0;
}

.pagination-btn {
    padding: 8px 14px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pagination-btn:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--border-accent);
    color: var(--text-primary);
}

.pagination-btn.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-end));
    color: #fff;
    border-color: transparent;
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 13px;
    color: var(--text-muted);
    padding: 0 12px;
}

/* ===== BOT CONTROL BAR ===== */
.bot-control-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.bot-control-status {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.bot-control-status .status-label {
    font-size: 14px;
    font-weight: 500;
}

.bot-control-status .uptime {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 8px;
}

/* ===== STATS BAR ===== */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 20px;
}

.stats-bar .stat-item {
    padding: 16px 20px;
    background: var(--glass-bg);
    text-align: center;
}

.stats-bar .stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.stats-bar .stat-value {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 700;
}

/* ===== CONFIG / SETTINGS SECTIONS ===== */
.config-section {
    margin-bottom: 32px;
}

.config-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.config-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    transition: border-color var(--transition-fast);
}

.config-item:hover { border-color: var(--border-light); }

.config-item label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}

.config-item .config-key {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent);
    opacity: 0.7;
    margin-bottom: 2px;
}

.config-item input {
    margin-top: 4px;
}

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

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

.animate-in {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.animate-in:nth-child(1) { animation-delay: 0.05s; }
.animate-in:nth-child(2) { animation-delay: 0.1s; }
.animate-in:nth-child(3) { animation-delay: 0.15s; }
.animate-in:nth-child(4) { animation-delay: 0.2s; }
.animate-in:nth-child(5) { animation-delay: 0.25s; }
.animate-in:nth-child(6) { animation-delay: 0.3s; }
.animate-in:nth-child(7) { animation-delay: 0.35s; }
.animate-in:nth-child(8) { animation-delay: 0.4s; }

/* ===== DIVIDER ===== */
.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 24px 0;
}

/* ===== TAB-LIKE BUTTONS ===== */
.tab-group {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.03);
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.tab-btn {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.tab-btn.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-end));
    color: #fff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

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

@media (max-width: 768px) {
    :root { --sidebar-width: 280px; }

    .sidebar {
        transform: translateX(-100%);
    }

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

    .sidebar-close-btn { display: block; }

    .sidebar-overlay.active { display: block; }

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

    .hamburger-btn { display: flex; }

    .top-header { padding: 0 16px; }

    .content-area { padding: 16px; }

    .grid-4, .grid-3, .grid-2 {
        grid-template-columns: 1fr;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-bar .form-group { min-width: auto; }

    .bot-control-bar {
        flex-direction: column;
        align-items: stretch;
    }

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

    .card-value { font-size: 22px; }

    .page-title { font-size: 16px; }

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

    .toast-container { top: 10px; right: 10px; left: 10px; }
    .toast { min-width: auto; }

    .header-right .btn span.btn-label-desktop { display: none; }
}

@media (max-width: 480px) {
    .stats-bar { grid-template-columns: 1fr; }
    .pagination { flex-wrap: wrap; }
    .btn-group { flex-direction: column; }
    .btn-group .btn { width: 100%; }
}
