/* ==========================================
   TS3 PANEL - FUTURISTIC DARK THEME
   Modern, clean, animated
   ========================================== */

/* ==========================================
   CSS VARIABLES
   ========================================== */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --primary-glow: rgba(99, 102, 241, 0.35);
    --accent: #06d6a0;
    --accent-dark: #05b384;
    --accent-glow: rgba(6, 214, 160, 0.25);
    --secondary: #64748b;
    --success: #10b981;
    --danger: #f43f5e;
    --warning: #f59e0b;
    --info: #06b6d4;

    --bg-body: #0c0e14;
    --bg-card: #13151e;
    --bg-card-hover: #191c28;
    --bg-sidebar: #0f1119;
    --bg-topbar: rgba(15, 17, 25, 0.85);
    --bg-input: #1a1d2a;
    --bg-hover: rgba(99, 102, 241, 0.08);

    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(99, 102, 241, 0.3);
    --border-active: var(--primary);

    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.4);
    --shadow-lg: 0 16px 48px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 20px var(--primary-glow);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --sidebar-width: 260px;
    --gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06d6a0 100%);
    --gradient-subtle: linear-gradient(135deg, rgba(99,102,241,0.15) 0%, rgba(139,92,246,0.1) 100%);

    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================
   RESET & BASE
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image:
        radial-gradient(circle at 25% 25%, rgba(99, 102, 241, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(6, 214, 160, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

::-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); }

::selection { background: var(--primary); color: white; }

/* ==========================================
   AUTH PAGE
   ========================================== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-body);
    padding: 20px;
    position: relative;
}

.auth-page::before {
    content: '';
    position: absolute;
    width: 500px; height: 500px;
    background: radial-gradient(circle, var(--primary-glow), transparent 70%);
    top: 20%; left: 30%;
    pointer-events: none;
    animation: authGlow 8s ease-in-out infinite alternate;
}

@keyframes authGlow {
    0% { transform: translate(0, 0) scale(1); opacity: 0.4; }
    100% { transform: translate(50px, -30px) scale(1.2); opacity: 0.6; }
}

.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 40px;
    width: 100%; max-width: 420px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    position: relative; z-index: 1;
    backdrop-filter: blur(20px);
}

.auth-card h1 {
    text-align: center;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 24px; font-weight: 700;
}

.auth-card .subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 14px;
}

.auth-card .logo {
    text-align: center;
    margin-bottom: 20px;
    font-size: 48px;
}

/* ==========================================
   LAYOUT
   ========================================== */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ==========================================
   SIDEBAR
   ========================================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
    z-index: 100;
    transition: transform 0.3s ease;
}

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

.sidebar-header .logo-icon {
    width: 40px; height: 40px;
    background: var(--gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    box-shadow: 0 4px 15px var(--primary-glow);
    animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { box-shadow: 0 4px 15px var(--primary-glow); }
    50% { box-shadow: 0 4px 25px var(--primary-glow), 0 0 40px rgba(99,102,241,0.15); }
}

.sidebar-header h2 {
    font-size: 16px; font-weight: 600;
    color: var(--text-primary);
}

.sidebar-header small {
    color: var(--text-muted);
    font-size: 11px;
}

.sidebar-menu { padding: 12px 0; }

.menu-label {
    color: var(--text-muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 16px 20px 6px;
    font-weight: 700;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--text-secondary);
    font-size: 14px;
    transition: all var(--transition-base);
    border-left: 3px solid transparent;
    cursor: pointer;
    position: relative;
    margin: 2px 8px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

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

.menu-item.active {
    background: var(--bg-hover);
    color: var(--primary-light);
    border-left-color: var(--primary);
}

.menu-item.active::after {
    content: '';
    position: absolute;
    right: 0; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 20px;
    background: var(--primary);
    border-radius: 3px;
}

.menu-item .icon {
    width: 20px;
    text-align: center;
    font-size: 15px;
}

.menu-item .badge {
    margin-left: auto;
    background: var(--primary);
    color: white;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

/* Sidebar Dropdown Menu */
.menu-dropdown {
    position: relative;
}

.menu-dropdown > .menu-item {
    justify-content: space-between;
}

.menu-dropdown > .menu-item .chevron {
    font-size: 10px;
    margin-left: auto;
    transition: transform var(--transition-base);
    color: var(--text-muted);
}

.menu-dropdown.open > .menu-item .chevron {
    transform: rotate(90deg);
    color: var(--primary-light);
}

.menu-dropdown-items {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.menu-dropdown.open .menu-dropdown-items {
    max-height: 300px;
}

.menu-dropdown-items .menu-item {
    padding-left: 48px;
    font-size: 13px;
    margin-left: 12px;
    border-left: 1px solid var(--border);
    border-radius: 0;
    position: relative;
}

.menu-dropdown-items .menu-item::before {
    content: '';
    position: absolute;
    left: -1px;
    top: 50%;
    width: 12px;
    height: 1px;
    background: var(--border);
}

.menu-dropdown-items .menu-item:hover::before,
.menu-dropdown-items .menu-item.active::before {
    background: var(--primary);
}

.menu-dropdown-items .menu-item .icon {
    font-size: 12px;
    width: 16px;
}

/* ==========================================
   MAIN CONTENT
   ========================================== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
}

/* ==========================================
   TOPBAR
   ========================================== */
.topbar {
    background: var(--bg-topbar);
    backdrop-filter: blur(20px);
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0; z-index: 50;
}

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

.topbar-left h1 {
    font-size: 18px; font-weight: 600;
    color: var(--text-primary);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary-light); }

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

.user-dropdown {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition-fast);
    position: relative;
}

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

.user-dropdown span { color: var(--text-primary); }

.user-avatar {
    width: 32px; height: 32px;
    border-radius: var(--radius-sm);
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 13px;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    display: none;
    z-index: 200;
    overflow: hidden;
    animation: dropdownIn 0.2s ease;
}

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

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

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-secondary);
    font-size: 14px;
    transition: all var(--transition-fast);
}

.dropdown-menu a:hover {
    background: var(--bg-hover);
    color: var(--primary-light);
}

/* Page Content */
.page-content {
    padding: 24px;
    flex: 1;
    animation: pageFadeIn 0.4s ease;
}

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

/* ==========================================
   CARDS
   ========================================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    margin-bottom: 20px;
    transition: all var(--transition-base);
}

.card:hover {
    border-color: var(--border-hover);
}

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

.card-header h3 {
    font-size: 15px; font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header h3 i {
    color: var(--primary-light);
    font-size: 14px;
}

.card-body { padding: 20px; }

.card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    background: rgba(255,255,255,0.02);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

/* ==========================================
   STAT CARDS
   ========================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--gradient);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.stat-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

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

.stat-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-icon.blue { background: rgba(99,102,241,0.15); color: #818cf8; }
.stat-icon.green { background: rgba(16,185,129,0.15); color: #34d399; }
.stat-icon.orange { background: rgba(245,158,11,0.15); color: #fbbf24; }
.stat-icon.purple { background: rgba(139,92,246,0.15); color: #a78bfa; }
.stat-icon.red { background: rgba(244,63,94,0.15); color: #fb7185; }

.stat-info h4 {
    font-size: 24px; font-weight: 700;
    color: var(--text-primary);
}

.stat-info p {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 2px;
}

/* ==========================================
   FORMS
   ========================================== */
.form-group { margin-bottom: 18px; }

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

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-input);
    transition: all var(--transition-base);
    outline: none;
    font-family: inherit;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: rgba(99,102,241,0.05);
}

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

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

select.form-control option {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 8px 12px;
}

select.form-control option:checked {
    background: var(--primary);
    color: white;
}

textarea.form-control { resize: vertical; min-height: 80px; }

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ==========================================
   BUTTONS
   ========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    white-space: nowrap;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(255,255,255,0.1), transparent);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.btn:hover::after { opacity: 1; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 10px var(--primary-glow);
}
.btn-primary:hover {
    background: var(--primary-dark);
    color: white;
    box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-success {
    background: var(--success);
    color: white;
    box-shadow: 0 2px 10px rgba(16,185,129,0.3);
}
.btn-success:hover { background: #059669; color: white; }

.btn-danger {
    background: var(--danger);
    color: white;
    box-shadow: 0 2px 10px rgba(244,63,94,0.3);
}
.btn-danger:hover { background: #e11d48; color: white; }

.btn-warning {
    background: var(--warning);
    color: #1a1a1a;
    box-shadow: 0 2px 10px rgba(245,158,11,0.3);
}
.btn-warning:hover { background: #d97706; color: #1a1a1a; }

.btn-info { background: var(--info); color: white; }
.btn-info:hover { background: #0891b2; color: white; }

.btn-secondary {
    background: rgba(255,255,255,0.06);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

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

.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 6px; }
.btn-xs { padding: 4px 8px; font-size: 11px; border-radius: 6px; }
.btn-lg { padding: 14px 24px; font-size: 15px; }
.btn-block { display: flex; width: 100%; justify-content: center; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ==========================================
   TABLES
   ========================================== */
.table-responsive { overflow-x: auto; }

.table { width: 100%; border-collapse: collapse; }

.table th, .table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.table th {
    background: rgba(255,255,255,0.02);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.table td { color: var(--text-secondary); }
.table tbody tr { transition: background var(--transition-fast); }
.table tbody tr:hover { background: var(--bg-hover); }
.table tbody tr:last-child td { border-bottom: none; }

/* ==========================================
   BADGES / STATUS
   ========================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px; font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-success { background: rgba(16,185,129,0.15); color: #34d399; }
.badge-danger { background: rgba(244,63,94,0.15); color: #fb7185; }
.badge-warning { background: rgba(245,158,11,0.15); color: #fbbf24; }
.badge-info { background: rgba(6,182,212,0.15); color: #22d3ee; }
.badge-secondary { background: rgba(255,255,255,0.06); color: var(--text-secondary); }

.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.status-dot.online { background: var(--success); box-shadow: 0 0 8px rgba(16,185,129,0.5); }
.status-dot.offline { background: var(--danger); }
.status-dot.suspended { background: var(--warning); }

/* ==========================================
   ALERTS
   ========================================== */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid;
    animation: alertIn 0.3s ease;
}

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

.alert-success { background: rgba(16,185,129,0.1); color: #34d399; border-color: rgba(16,185,129,0.2); }
.alert-danger { background: rgba(244,63,94,0.1); color: #fb7185; border-color: rgba(244,63,94,0.2); }
.alert-warning { background: rgba(245,158,11,0.1); color: #fbbf24; border-color: rgba(245,158,11,0.2); }
.alert-info { background: rgba(6,182,212,0.1); color: #22d3ee; border-color: rgba(6,182,212,0.2); }

/* ==========================================
   MODAL SYSTEM
   ========================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.show {
    display: flex;
    animation: modalOverlayIn 0.25s ease;
}

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

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 100%; max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg), 0 0 60px rgba(99,102,241,0.1);
    animation: modalIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

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

.modal-header h3 {
    font-size: 16px; font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h3 i { color: var(--primary-light); }

.modal-close {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    width: 32px; height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: rgba(244,63,94,0.1);
    color: var(--danger);
    border-color: rgba(244,63,94,0.3);
}

.modal-body { padding: 24px; }

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

/* ==========================================
   CUSTOM DIALOG (replaces confirm/prompt/alert)
   ========================================== */
.dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    opacity: 0;
    animation: dialogOverlayIn 0.25s ease forwards;
}

@keyframes dialogOverlayIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes dialogOverlayOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.dialog-box {
    background: linear-gradient(145deg, rgba(19, 21, 30, 0.97), rgba(15, 17, 25, 0.99));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    width: 100%;
    max-width: 420px;
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.6),
        0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    animation: dialogBoxIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    overflow: hidden;
    position: relative;
}

.dialog-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 20px 20px 0 0;
    background: var(--gradient);
    opacity: 0.7;
}

@keyframes dialogBoxIn {
    from { opacity: 0; transform: scale(0.85) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes dialogBoxOut {
    from { opacity: 1; transform: scale(1) translateY(0); }
    to { opacity: 0; transform: scale(0.9) translateY(10px); }
}

.dialog-icon-wrap {
    text-align: center;
    padding: 32px 24px 4px;
}

.dialog-icon-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    position: relative;
    animation: dialogIconPulse 0.5s ease 0.15s both;
}

@keyframes dialogIconPulse {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

.dialog-icon-circle i { font-size: 28px; position: relative; z-index: 1; }

.dialog-icon-circle.confirm {
    background: rgba(245, 158, 11, 0.12);
    border: 2px solid rgba(245, 158, 11, 0.25);
    box-shadow: 0 0 24px rgba(245, 158, 11, 0.15);
}
.dialog-icon-circle.confirm i { color: #fbbf24; }

.dialog-icon-circle.danger {
    background: rgba(244, 63, 94, 0.12);
    border: 2px solid rgba(244, 63, 94, 0.25);
    box-shadow: 0 0 24px rgba(244, 63, 94, 0.15);
}
.dialog-icon-circle.danger i { color: #fb7185; }

.dialog-icon-circle.info {
    background: rgba(6, 182, 212, 0.12);
    border: 2px solid rgba(6, 182, 212, 0.25);
    box-shadow: 0 0 24px rgba(6, 182, 212, 0.15);
}
.dialog-icon-circle.info i { color: #22d3ee; }

.dialog-icon-circle.prompt {
    background: rgba(99, 102, 241, 0.12);
    border: 2px solid rgba(99, 102, 241, 0.25);
    box-shadow: 0 0 24px rgba(99, 102, 241, 0.15);
}
.dialog-icon-circle.prompt i { color: #a5b4fc; }

.dialog-icon-circle.success {
    background: rgba(16, 185, 129, 0.12);
    border: 2px solid rgba(16, 185, 129, 0.25);
    box-shadow: 0 0 24px rgba(16, 185, 129, 0.15);
}
.dialog-icon-circle.success i { color: #34d399; }

.dialog-icon-circle.warning {
    background: rgba(245, 158, 11, 0.12);
    border: 2px solid rgba(245, 158, 11, 0.25);
    box-shadow: 0 0 24px rgba(245, 158, 11, 0.15);
}
.dialog-icon-circle.warning i { color: #fbbf24; }

.dialog-content {
    padding: 16px 32px 8px;
    text-align: center;
}

.dialog-content h4 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.dialog-content p {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.dialog-input {
    padding: 8px 32px 4px;
}

.dialog-input input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-input);
    outline: none;
    font-family: inherit;
    transition: all var(--transition-base);
    margin-top: 8px;
}

.dialog-input input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: rgba(26, 29, 42, 0.8);
}

.dialog-actions {
    padding: 20px 32px 28px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.dialog-actions .btn {
    min-width: 110px;
    padding: 10px 20px;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.dialog-actions .dialog-cancel {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}
.dialog-actions .dialog-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.dialog-actions .dialog-ok {
    border: none;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.dialog-actions .dialog-ok:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.dialog-actions .dialog-ok.btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}
.dialog-actions .dialog-ok.btn-danger {
    background: linear-gradient(135deg, #f43f5e, #e11d48);
}
.dialog-actions .dialog-ok.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
}
.dialog-actions .dialog-ok.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

/* Alert-only: single centered OK button */
.dialog-actions.single-action {
    justify-content: center;
}
.dialog-actions.single-action .dialog-ok {
    min-width: 140px;
    justify-content: center;
}

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

.empty-state .icon { font-size: 48px; margin-bottom: 16px; opacity: 0.3; }
.empty-state h4 { color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 14px; margin-bottom: 20px; }

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

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

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(12, 14, 20, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: var(--radius-md);
    backdrop-filter: blur(4px);
}

/* ==========================================
   SERVER MANAGE HEADER
   ========================================== */
.server-manage-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 20px 24px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.server-manage-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--gradient);
}

.server-manage-info {
    display: flex;
    align-items: center;
}

.server-manage-info h2 {
    font-size: 18px; font-weight: 600;
    margin: 0 0 4px 0;
    color: var(--text-primary);
}

.server-manage-actions { display: flex; gap: 8px; }

.server-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.server-dot.online {
    background: var(--success);
    box-shadow: 0 0 8px rgba(16,185,129,0.5);
    animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% { box-shadow: 0 0 8px rgba(16,185,129,0.5); }
    50% { box-shadow: 0 0 16px rgba(16,185,129,0.8); }
}

.server-dot.offline { background: var(--danger); }

/* ==========================================
   TABS
   ========================================== */
.tabs-container {
    margin-bottom: 20px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    padding: 0 8px;
    overflow-x: auto;
}

.tabs { display: flex; gap: 0; }

.tab {
    padding: 14px 16px;
    font-size: 13px; font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-base);
    white-space: nowrap;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 7px;
}

.tab:hover { color: var(--text-primary); }

.tab.active {
    color: var(--primary-light);
    border-bottom-color: var(--primary);
}

.tab i { font-size: 13px; }

.tab-content {
    display: none;
    animation: tabFadeIn 0.4s ease;
}

.tab-content.active { display: block; }

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

/* ==========================================
   SERVER CARD (list)
   ========================================== */
.server-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    padding: 20px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.server-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--primary);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.server-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

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

.server-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius-md);
    background: var(--gradient-subtle);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--primary-light);
    flex-shrink: 0;
}

.server-info { flex: 1; }

.server-info h4 {
    font-size: 15px; font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.server-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.server-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.server-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ==========================================
   CHANNEL TREE
   ========================================== */
.channel-tree {
    padding: 4px 0;
    list-style: none;
}

.channel-tree ul {
    padding-left: 20px;
    list-style: none;
    border-left: 1px solid var(--border);
    margin-left: 10px;
}

.channel-item {
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    border: 1px solid transparent;
    transition: all var(--transition-fast);
    margin-bottom: 2px;
}

.channel-item:hover {
    background: var(--bg-hover);
    border-color: var(--border);
}

.channel-item-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.channel-icon {
    color: var(--primary-light);
    font-size: 12px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.channel-item .actions,
.channel-item > div:last-child:not(.channel-item-left) {
    opacity: 0;
    transition: opacity var(--transition-fast);
    display: flex;
    gap: 4px;
}

.channel-item:hover .actions,
.channel-item:hover > div:last-child:not(.channel-item-left) {
    opacity: 1;
}

/* ==========================================
   INFO ROWS
   ========================================== */
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.info-row:last-child { border-bottom: none; }

.info-label { color: var(--text-muted); font-weight: 500; }

.info-value {
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.info-loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

.info-loading i { margin-right: 8px; color: var(--primary-light); }

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ==========================================
   CLIENT LIST
   ========================================== */
.client-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    border-bottom: 1px solid var(--border);
}

.client-row:last-child { border-bottom: none; }
.client-row:hover { background: var(--bg-hover); }

.client-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.client-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px; font-weight: 600;
    color: white;
    flex-shrink: 0;
}

/* ==========================================
   BACKUP LIST
   ========================================== */
.backup-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin-bottom: 8px;
    transition: all var(--transition-base);
}

.backup-item:hover {
    border-color: var(--border-hover);
    background: var(--bg-hover);
}

/* ==========================================
   PAGINATION
   ========================================== */
.pagination {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: 20px;
}

.pagination a, .pagination span {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: all var(--transition-fast);
}

.pagination a:hover {
    border-color: var(--primary);
    color: var(--primary-light);
}

.pagination .active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ==========================================
   RESPONSIVE
   ========================================== */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    padding: 4px;
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .mobile-toggle { display: block; }
    .stats-grid { grid-template-columns: 1fr; }
    .form-row, .grid-2 { grid-template-columns: 1fr; }
    .server-card { flex-direction: column; align-items: flex-start; }
    .server-actions { width: 100%; }
    .server-actions .btn { flex: 1; justify-content: center; }
    .server-manage-header { flex-direction: column; gap: 16px; align-items: flex-start; }
    .tab { padding: 12px 10px; font-size: 12px; }
}

/* ==========================================
   UTILITY
   ========================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.p-3 { padding: 16px; }
.p-4 { padding: 24px; }
.d-flex { display: flex; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.w-100 { width: 100%; }
.hidden { display: none !important; }
