/* ========== NEON BUBBLE OVERHAUL - DASHBOARD ========== */

/* ── Server Dropdown Menu ── */
.server-dropdown {
    margin-bottom: 2px;
}

.server-toggle {
    display: flex; align-items: center; gap: 8px; padding: 12px 18px;
    border-radius: 50px; color: var(--text-secondary); text-decoration: none;
    font-size: 14px; font-weight: 700; cursor: pointer; transition: all 0.2s;
    border: 1px solid transparent; background: none; width: 100%; text-align: left;
    font-family: inherit;
}

.server-toggle:hover {
    color: white; background: rgba(0, 240, 255, 0.05);
    border: 1px solid rgba(0, 240, 255, 0.2);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.1);
}

.server-toggle .srv-icon { font-size: 16px; width: 22px; text-align: center; flex-shrink: 0; filter: drop-shadow(0 0 5px rgba(255,255,255,0.3)); }
.server-toggle .srv-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; letter-spacing: 0.5px;}
.server-toggle .srv-arrow { font-size: 12px; color: var(--text-muted); transition: transform 0.3s; flex-shrink: 0; }
.server-dropdown.open .srv-arrow { transform: rotate(180deg); color: var(--neon-cyan); text-shadow: 0 0 10px var(--neon-cyan);}

.server-submenu { display: none; padding: 8px 0 8px 24px; }
.server-dropdown.open .server-submenu { display: block; }

.server-sublink {
    display: flex; align-items: center; gap: 10px; padding: 10px 16px;
    border-radius: 50px; color: var(--text-muted); text-decoration: none;
    font-size: 13px; font-weight: 600; transition: all 0.2s; cursor: pointer;
    border: 1px solid transparent; background: none; width: 100%; text-align: left;
    font-family: inherit;
}

.server-sublink:hover {
    color: var(--text-primary); background: rgba(176, 0, 255, 0.05);
    border-color: rgba(176, 0, 255, 0.2); text-shadow: 0 0 10px rgba(255,255,255,0.5);
}

.server-sublink.active {
    color: var(--neon-cyan); background: rgba(0, 240, 255, 0.1);
    border-color: rgba(0, 240, 255, 0.3); box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
    text-shadow: 0 0 10px var(--neon-cyan);
}

.dash-layout { display: flex; min-height: 100vh; position: relative; z-index: 1; }

/* ── Sidebar ── */
.dash-sidebar {
    width: 280px; background: rgba(5, 2, 10, 0.8);
    border-right: 1px solid rgba(255,255,255,0.05); backdrop-filter: blur(40px);
    display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0;
    z-index: 100; overflow-y: auto; box-shadow: 10px 0 50px rgba(0,0,0,0.5);
}

.sidebar-header { padding: 30px 24px 20px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.sidebar-header .sub-text { font-size: 12px; color: var(--text-muted); margin-top: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: 2px;}

.sidebar-nav { flex: 1; padding: 24px 16px; display: flex; flex-direction: column; gap: 8px; }

.sidebar-link {
    display: flex; align-items: center; gap: 12px; padding: 12px 20px;
    border-radius: 50px; color: var(--text-muted); text-decoration: none;
    font-size: 14px; font-weight: 700; transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid transparent; letter-spacing: 0.5px;
}

.sidebar-link:hover {
    color: white; background: rgba(255, 255, 255, 0.05);
    transform: translateX(5px);
}

.sidebar-link.active {
    color: white; background: var(--gradient-primary);
    border-color: rgba(255, 255, 255, 0.2); box-shadow: 0 5px 20px rgba(176, 0, 255, 0.4);
    transform: scale(1.02);
}

.sidebar-link span { font-size: 18px; width: 24px; text-align: center; flex-shrink: 0; filter: drop-shadow(0 0 5px rgba(255,255,255,0.5));}

.sidebar-divider { height: 1px; background: rgba(255,255,255,0.05); margin: 20px 14px; }

.sidebar-section-label {
    font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: 2px;
    color: var(--neon-pink); padding: 10px 20px 8px; text-shadow: 0 0 10px rgba(255,0,85,0.5);
}

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

.sidebar-user { display: flex; align-items: center; gap: 16px; }
.sidebar-avatar {
    width: 44px; height: 44px; border-radius: 50%; background: var(--gradient-primary);
    display: flex; align-items: center; justify-content: center; font-weight: 900;
    font-size: 18px; color: white; box-shadow: 0 0 20px rgba(176,0,255,0.5);
}
.sidebar-username { font-weight: 800; font-size: 15px; color: white; letter-spacing: -0.5px;}
.sidebar-plan { font-size: 12px; color: var(--neon-cyan); text-transform: uppercase; font-weight: 700; letter-spacing: 1px;}

/* ── Main Content ── */
.dash-main { flex: 1; margin-left: 280px; min-height: 100vh; position: relative; background: radial-gradient(circle at top right, rgba(0,240,255,0.05), transparent 40%), radial-gradient(circle at bottom left, rgba(176,0,255,0.05), transparent 40%);}

.dash-page { display: none; padding: 40px 60px; animation: fadeIn 0.4s ease; max-width: 1400px; margin: 0 auto; }
.dash-page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* ── Topbar ── */
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px; }
.breadcrumb { font-size: 16px; color: var(--text-muted); font-weight: 600; letter-spacing: 0.5px;}
.breadcrumb span { margin: 0 10px; color: var(--border); }
.breadcrumb strong { color: white; font-weight: 800; }

.status-pill {
    padding: 8px 16px; border-radius: 50px; font-size: 12px; font-weight: 800;
    background: rgba(100, 116, 139, 0.1); color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px;
}
.status-pill.online { background: rgba(57, 255, 20, 0.1); color: var(--neon-green); border: 1px solid rgba(57,255,20,0.3); box-shadow: 0 0 15px rgba(57,255,20,0.2); }
.status-pill.offline { background: rgba(255, 0, 85, 0.1); color: var(--neon-pink); border: 1px solid rgba(255,0,85,0.3); box-shadow: 0 0 15px rgba(255,0,85,0.2); }
.version-pill { padding: 8px 16px; border-radius: 50px; font-size: 12px; font-weight: 800; background: rgba(0, 240, 255, 0.1); color: var(--neon-cyan); margin-left: 10px; border: 1px solid rgba(0,240,255,0.3); }

/* ── Dashboard Components ── */
.server-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 30px; }
.info-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 24px; backdrop-filter: blur(20px); transition: 0.3s;
}
.info-card:hover { transform: translateY(-5px); border-color: rgba(255,255,255,0.1); box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.info-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; font-weight: 800; letter-spacing: 1.5px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.info-value { font-size: 18px; font-weight: 700; color: white; word-break: break-all; }
.info-value.mono { font-family: 'JetBrains Mono', monospace; font-size: 15px; color: var(--neon-cyan); text-shadow: 0 0 10px rgba(0,240,255,0.4);}
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; box-shadow: 0 0 10px currentColor; }
.dot-emerald { background: var(--neon-green); color: var(--neon-green); }
.dot-cyan { background: var(--neon-cyan); color: var(--neon-cyan); }
.dot-purple { background: var(--neon-purple); color: var(--neon-purple); }
.dot-amber { background: var(--neon-yellow); color: var(--neon-yellow); }
.dot-rose { background: var(--neon-pink); color: var(--neon-pink); }
.dot-blue { background: #0088ff; color: #0088ff; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 40px; }
.stat-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 30px; backdrop-filter: blur(20px); transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); position: relative; overflow: hidden;
}
.stat-card::after { content: ''; position: absolute; bottom: 0; right: 0; width: 100px; height: 100px; background: radial-gradient(circle, var(--text-muted) 0%, transparent 70%); opacity: 0.1; filter: blur(20px); }
.stat-card:hover { transform: scale(1.05) translateY(-5px); border-color: rgba(255,255,255,0.1); box-shadow: 0 20px 40px rgba(0,0,0,0.6); z-index: 2;}

.stat-label { font-size: 13px; color: var(--text-muted); text-transform: uppercase; font-weight: 800; letter-spacing: 2px; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.stat-value { font-size: 48px; font-weight: 900; line-height: 1; text-shadow: 0 0 30px currentColor; }
.stat-sub { font-size: 14px; color: var(--text-muted); margin-top: 8px; font-weight: 600; }

.color-blue { color: #0088ff; }
.color-cyan { color: var(--neon-cyan); }
.color-rose { color: var(--neon-pink); }
.color-emerald { color: var(--neon-green); }
.color-purple { color: var(--neon-purple); }

.dash-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 30px; backdrop-filter: blur(30px); box-shadow: var(--shadow);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); position: relative; overflow: hidden;
}
.dash-card:hover { border-color: rgba(176,0,255,0.3); box-shadow: 0 20px 50px rgba(0,0,0,0.6), 0 0 30px rgba(176,0,255,0.1); transform: translateY(-4px); }

.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.dash-card h3 { font-size: 24px; font-weight: 800; letter-spacing: -0.5px;}
.card-subtitle { font-size: 15px; color: var(--text-secondary); margin-bottom: 24px; font-weight: 300;}

.table-wrap { overflow-x: auto; }
.dash-table { width: 100%; border-collapse: collapse; }
.dash-table th { text-align: left; padding: 16px; font-size: 12px; text-transform: uppercase; letter-spacing: 2px; color: var(--neon-cyan); border-bottom: 1px solid rgba(255,255,255,0.05); font-weight: 800;}
.dash-table td { padding: 16px; border-bottom: 1px solid rgba(255,255,255,0.02); font-size: 14px; font-weight: 500; color: var(--text-primary); transition: 0.2s;}
.dash-table tr:hover td { background: rgba(255,255,255,0.02); }
.dash-table td.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); font-size: 15px;}
.dash-table .empty-icon { font-size: 40px; margin-bottom: 16px; filter: grayscale(1); opacity: 0.5;}

.badge { padding: 6px 12px; border-radius: 50px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px;}
.badge-rose { background: rgba(255, 0, 85, 0.1); color: var(--neon-pink); border: 1px solid rgba(255,0,85,0.3); box-shadow: 0 0 10px rgba(255,0,85,0.2);}
.badge-amber { background: rgba(204, 255, 0, 0.1); color: var(--neon-yellow); border: 1px solid rgba(204,255,0,0.3); box-shadow: 0 0 10px rgba(204,255,0,0.2);}
.badge-emerald { background: rgba(57, 255, 20, 0.1); color: var(--neon-green); border: 1px solid rgba(57,255,20,0.3); box-shadow: 0 0 10px rgba(57,255,20,0.2);}
.badge-blue { background: rgba(0, 136, 255, 0.1); color: #0088ff; border: 1px solid rgba(0,136,255,0.3); box-shadow: 0 0 10px rgba(0,136,255,0.2);}

/* Admin Grid */
.admin-grid { display: grid; gap: 20px; }
.version-input-row { display: flex; gap: 10px; margin-top: 10px; }
.version-input-row input { flex: 1; min-width: 0; }

/* Config Toggles */
.toggle-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 0; border-bottom: 1px solid rgba(255,255,255,0.05);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-label { display: flex; flex-direction: column; gap: 4px; font-weight: 700; color: white; font-size: 14px;}
.toggle-label small { color: var(--text-muted); font-size: 12px; font-weight: 500;}

/* Settings Layout */
.settings-layout { display: flex; gap: 30px; }
.settings-sidebar { width: 220px; flex-shrink: 0; }
.settings-menu { display: flex; flex-direction: column; gap: 8px; }
.settings-item { padding: 12px 20px; border-radius: 50px; color: var(--text-muted); font-weight: 700; cursor: pointer; transition: 0.3s; font-size: 14px;}
.settings-item:hover { background: rgba(255,255,255,0.05); color: white; }
.settings-item.active { background: var(--gradient-primary); color: white; box-shadow: 0 5px 15px rgba(176,0,255,0.3); transform: scale(1.05); }
.settings-content { flex: 1; }
.settings-section { display: none; animation: fadeIn 0.3s ease; }
.settings-section.active { display: block; }

/* Switch Toggle */
.switch { position: relative; display: inline-block; width: 50px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(255,255,255,0.1); transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; box-shadow: 0 2px 5px rgba(0,0,0,0.3); }
input:checked + .slider { background-color: var(--neon-cyan); box-shadow: 0 0 15px var(--neon-cyan); }
input:checked + .slider:before { transform: translateX(24px); }

/* Range Slider */
input[type=range] { -webkit-appearance: none; width: 100%; background: transparent; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; height: 20px; width: 20px; border-radius: 50%; background: var(--neon-cyan); cursor: pointer; margin-top: -8px; box-shadow: 0 0 10px var(--neon-cyan); }
input[type=range]::-webkit-slider-runnable-track { width: 100%; height: 4px; cursor: pointer; background: rgba(255,255,255,0.1); border-radius: 2px; }

/* ========== RESPONSIVE DASHBOARD FIXES ========== */
@media (max-width: 900px) {
    .dash-layout { flex-direction: column; }
    .dash-sidebar {
        position: relative; width: 100%; height: auto; border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.05); box-shadow: none;
        padding-bottom: 0px;
    }
    .dash-main { margin-left: 0; min-height: auto; }
    .sidebar-header { padding: 15px; text-align: center; }
    
    /* Make the navigation horizontally scrollable on mobile */
    .sidebar-nav { 
        flex-direction: row; flex-wrap: nowrap; justify-content: flex-start; 
        padding: 10px 15px; gap: 10px; overflow-x: auto; 
        scrollbar-width: none; -ms-overflow-style: none;
    }
    .sidebar-nav::-webkit-scrollbar { display: none; }
    .sidebar-link { flex-shrink: 0; padding: 10px 16px; font-size: 13px; border-radius: 12px; }
    .sidebar-link span { font-size: 16px; margin-right: 5px; }
    .sidebar-section-label { display: none; }
    .sidebar-footer { display: none; }
    
    .dash-page { padding: 20px; }
    .topbar { flex-direction: column; align-items: flex-start; gap: 15px; }
    .topbar-right { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
    
    .stats-grid, .server-info-grid, .admin-grid { grid-template-columns: 1fr; }
    .settings-layout { flex-direction: column; gap: 20px; }
    .settings-sidebar { width: 100%; }
    .settings-menu { flex-direction: row; flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; gap: 10px;}
    .settings-menu::-webkit-scrollbar { display: none; }
    .settings-item { font-size: 13px; padding: 10px 16px; flex-shrink: 0; border-radius: 12px; }
    
    #resellerDomainGroup { flex-direction: column; }
    #resellerDomainGroup select, #resellerDomainGroup input { width: 100% !important; }
}
