/* ============================================
   Nest PPPoE Manager - Premium Dark UI
   ============================================ */

:root {
    /* Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #111118;
    --bg-card: #16161e;
    --bg-card-hover: #1c1c26;
    --bg-elevated: #1e1e28;
    --bg-input: #12121a;

    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-active: rgba(99, 102, 241, 0.3);

    --text-primary: #e8e8ed;
    --text-secondary: #8b8b9e;
    --text-tertiary: #55556a;
    --text-accent: #a78bfa;

    /* Accent Colors */
    --indigo-400: #818cf8;
    --indigo-500: #6366f1;
    --indigo-600: #4f46e5;
    --purple-400: #c084fc;
    --purple-500: #a855f7;
    --green-400: #4ade80;
    --green-500: #22c55e;
    --green-600: #16a34a;
    --red-400: #f87171;
    --red-500: #ef4444;
    --amber-400: #fbbf24;
    --amber-500: #f59e0b;
    --cyan-400: #22d3ee;
    --blue-400: #60a5fa;

    /* Gradients */
    --grad-indigo: linear-gradient(135deg, #6366f1, #8b5cf6);
    --grad-green: linear-gradient(135deg, #22c55e, #10b981);
    --grad-red: linear-gradient(135deg, #ef4444, #f97316);
    --grad-amber: linear-gradient(135deg, #f59e0b, #eab308);
    --grad-purple: linear-gradient(135deg, #a855f7, #6366f1);

    /* Spacing */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
    --shadow-glow-indigo: 0 0 20px rgba(99, 102, 241, 0.15);
    --shadow-glow-green: 0 0 20px rgba(34, 197, 94, 0.15);
    --shadow-glow-red: 0 0 20px rgba(239, 68, 68, 0.15);
}

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

html {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    width: 100%;
    max-width: 100vw;
}

/* Background Effects */
.bg-grid {
    position: fixed;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    z-index: 0;
    pointer-events: none;
}

.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.12;
    z-index: 0;
    pointer-events: none;
    animation: glowFloat 20s ease-in-out infinite;
}

.bg-glow-1 {
    width: 600px; height: 600px;
    background: var(--indigo-500);
    top: -200px; right: -100px;
    animation-delay: 0s;
}

.bg-glow-2 {
    width: 500px; height: 500px;
    background: var(--purple-500);
    bottom: -150px; left: -100px;
    animation-delay: -7s;
}

.bg-glow-3 {
    width: 400px; height: 400px;
    background: var(--cyan-400);
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
    opacity: 0.06;
}

@keyframes glowFloat {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(30px, -20px); }
    50% { transform: translate(-20px, 30px); }
    75% { transform: translate(20px, 20px); }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-subtle); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.12); }

/* ============ HEADER ============ */

.header {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px) saturate(1.5);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 100;
}

.header-left { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.header-center { display: flex; align-items: center; flex: 1; justify-content: center; }
.header-right { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }

/* Header Action Buttons */
.header-actions {
    display: flex;
    gap: 6px;
}

.header-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.header-btn:active { transform: scale(0.95); }

.header-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.12), transparent);
    opacity: 0;
    transition: opacity 0.2s;
}

.header-btn:hover::after { opacity: 1; }

.header-btn-start {
    background: var(--grad-green);
    color: white;
    box-shadow: 0 2px 10px rgba(34, 197, 94, 0.3);
}

.header-btn-stop {
    background: var(--grad-red);
    color: white;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.3);
}

.header-btn-refresh {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}

.header-btn-refresh:hover {
    border-color: rgba(255,255,255,0.12);
}

.header-btn-check {
    background: rgba(34,211,238,0.1);
    color: var(--cyan-400);
    border: 1px solid rgba(34,211,238,0.2);
}

.header-btn-check:hover {
    background: rgba(34,211,238,0.2);
}

.header-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.header-btn.loading::before {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 2px;
}

/* Auto Start Toggle */
.auto-start-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    margin-left: 4px;
}

.toggle-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.3s;
}

.auto-start-toggle.active .toggle-label {
    color: var(--green-400);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    left: 2px;
    bottom: 2px;
    background: var(--text-tertiary);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.toggle-switch input:checked + .toggle-slider {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.4);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.15);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(16px);
    background: var(--green-400);
    box-shadow: 0 0 6px rgba(74, 222, 128, 0.4);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.logo h1 {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, #e8e8ed, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.3px;
}

.logo-sub {
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* System Stats */
.sys-stats {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
}

.sys-stat {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.sys-icon {
    font-size: 12px;
    flex-shrink: 0;
}

.sys-val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.sys-label {
    font-size: 10px;
    color: var(--text-tertiary);
    font-weight: 500;
}

.sys-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    animation: dotPulse 2s ease-in-out infinite;
}

.sys-divider {
    width: 1px;
    height: 18px;
    background: var(--border-subtle);
    flex-shrink: 0;
}

/* Mini progress bars */
.sys-bar-wrap {
    width: 40px;
    height: 5px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
    flex-shrink: 0;
}

.sys-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease, background 0.3s ease;
}

.sys-bar-cpu {
    background: linear-gradient(90deg, var(--green-500), var(--amber-400));
}

.sys-bar-cpu.high {
    background: linear-gradient(90deg, var(--amber-400), var(--red-400));
}

.sys-bar-cpu.critical {
    background: linear-gradient(90deg, var(--red-400), #ff3333);
    animation: barPulse 1s ease-in-out infinite;
}

.sys-bar-ram {
    background: linear-gradient(90deg, var(--indigo-400), var(--purple-400));
}

.sys-bar-ram.high {
    background: linear-gradient(90deg, var(--amber-400), var(--red-400));
}

.sys-bar-disk {
    background: linear-gradient(90deg, var(--cyan-400), var(--blue-400));
}

.sys-bar-disk.high {
    background: linear-gradient(90deg, var(--amber-400), var(--red-400));
}

@keyframes barPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.dot-green { background: var(--green-400); box-shadow: 0 0 6px rgba(74, 222, 128, 0.4); }
.dot-blue { background: var(--blue-400); box-shadow: 0 0 6px rgba(96, 165, 250, 0.4); }
.dot-purple { background: var(--purple-400); box-shadow: 0 0 6px rgba(192, 132, 252, 0.4); }

@keyframes dotPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.device-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(168,85,247,0.1));
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    color: var(--indigo-400);
}

.device-icon { font-size: 14px; }

/* ============ TABS ============ */

.main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 24px 40px;
    position: relative;
    z-index: 1;
    overflow-x: hidden;
    width: 100%;
}

.tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    width: fit-content;
}

.tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.tab.active {
    color: var(--text-primary);
    background: var(--bg-elevated);
    box-shadow: var(--shadow-sm);
}

.tab-content { display: none; overflow-x: hidden; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease; }

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

/* ============ CONTROL PANEL ============ */

.control-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 24px;
    margin-bottom: 24px;
}

.control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.control-group h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.control-group p {
    font-size: 13px;
    color: var(--text-secondary);
}

.control-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

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

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

.btn:hover::after { opacity: 1; }

.btn-install {
    background: var(--grad-indigo);
    color: white;
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.3);
}

.btn-start {
    background: var(--grad-green);
    color: white;
    box-shadow: 0 2px 12px rgba(34, 197, 94, 0.3);
}

.btn-stop {
    background: var(--grad-red);
    color: white;
    box-shadow: 0 2px 12px rgba(239, 68, 68, 0.3);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}

.btn-primary {
    background: var(--grad-purple);
    color: white;
    box-shadow: 0 2px 12px rgba(168, 85, 247, 0.3);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

.btn-add {
    background: rgba(99, 102, 241, 0.1);
    color: var(--indigo-400);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

.btn-ghost:hover {
    color: var(--text-primary);
    border-color: rgba(255,255,255,0.12);
}

.btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn.loading::before {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 4px;
}

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

/* ============ SECTIONS ============ */

.section {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    margin-bottom: 24px;
    overflow: hidden;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    cursor: pointer;
    user-select: none;
}

.section-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
}

.section-header h2 svg {
    color: var(--indigo-400);
}

.chevron {
    transition: transform 0.3s ease;
    color: var(--text-tertiary);
}

.section-body {
    padding: 0 24px 24px;
}

.section-body.collapsed {
    display: none;
}

/* ============ NIC GRID ============ */

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

.nic-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

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

.nic-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.nic-icon.up {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.nic-icon.down {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.nic-info { flex: 1; min-width: 0; }

.nic-name {
    font-size: 13px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-primary);
}

.nic-detail {
    font-size: 11px;
    color: var(--text-tertiary);
    font-family: 'JetBrains Mono', monospace;
    margin-top: 2px;
}

.nic-status {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nic-status.up {
    background: rgba(34, 197, 94, 0.1);
    color: var(--green-400);
    border: 1px solid rgba(34, 197, 94, 0.15);
}

.nic-status.down {
    background: rgba(239, 68, 68, 0.1);
    color: var(--red-400);
    border: 1px solid rgba(239, 68, 68, 0.15);
}

/* ============ FARM CARDS ============ */

.farm-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    margin-bottom: 16px;
    overflow: hidden;
    transition: all 0.3s;
}

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

.farm-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
    overflow: hidden;
}

.farm-header:hover {
    background: rgba(255, 255, 255, 0.02);
}

.farm-idx {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--grad-indigo);
    color: white;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.farm-info {
    flex: 1 1 0;
    min-width: 0;
}

.farm-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.farm-nic-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    background: rgba(99, 102, 241, 0.1);
    color: var(--indigo-400);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.farm-subtitle {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.farm-stats {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-shrink: 0;
}

.farm-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

.farm-stat .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.farm-stat .dot-online { background: var(--green-400); }
.farm-stat .dot-offline { background: var(--text-tertiary); }

.farm-controls {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    margin: 0 auto;
}

.farm-btn {
    padding: 6px 10px;
    border: none;
    border-radius: 6px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.farm-btn.start {
    background: rgba(34,197,94,0.1);
    color: var(--green-400);
    border: 1px solid rgba(34,197,94,0.15);
}
.farm-btn.start:hover { background: rgba(34,197,94,0.2); }

.farm-btn.stop {
    background: rgba(239,68,68,0.1);
    color: var(--red-400);
    border: 1px solid rgba(239,68,68,0.15);
}
.farm-btn.stop:hover { background: rgba(239,68,68,0.2); }

.farm-btn.check {
    background: rgba(34,211,238,0.1);
    color: var(--cyan-400);
    border: 1px solid rgba(34,211,238,0.15);
}
.farm-btn.check:hover { background: rgba(34,211,238,0.2); }

.farm-btn.copy {
    background: rgba(251,191,36,0.1);
    color: var(--amber-400);
    border: 1px solid rgba(251,191,36,0.15);
}
.farm-btn.copy:hover { background: rgba(251,191,36,0.2); }

.farm-chevron {
    transition: transform 0.3s;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.farm-card.collapsed .farm-chevron {
    transform: rotate(-90deg);
}

.farm-body {
    padding: 0 20px 20px;
    border-top: 1px solid var(--border-subtle);
    overflow-x: hidden;
}

.farm-card.collapsed .farm-body {
    display: none;
}

.farm-sessions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
    overflow: hidden;
}

/* Farm Toolbar (filter bar inside each farm) */
.farm-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 12px 0 4px;
}

.filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-tertiary);
    margin-left: 4px;
}

.filter-btn.active .filter-count {
    background: rgba(99, 102, 241, 0.15);
    color: var(--indigo-400);
}

/* ============ SESSIONS GRID ============ */

.session-filters {
    display: flex;
    gap: 4px;
    padding: 3px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
}

.filter-btn {
    padding: 5px 14px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover { color: var(--text-primary); }
.filter-btn.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.sessions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
    padding: 0 24px 24px;
    overflow: hidden;
}

.session-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.session-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--grad-indigo);
    opacity: 0;
    transition: opacity 0.25s;
}

.session-card:hover {
    border-color: var(--border-active);
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow-indigo);
}

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

.session-card.connected::before {
    background: var(--grad-green);
    opacity: 1;
}

.session-card.connected:hover {
    box-shadow: var(--shadow-glow-green);
}

.session-card.rotating::before {
    background: linear-gradient(135deg, #a855f7, #f59e0b);
    opacity: 1;
    animation: rotatePulse 1s ease-in-out infinite;
}

.session-card.rotating {
    border-color: rgba(168, 85, 247, 0.3);
    animation: cardPulse 2s ease-in-out infinite;
}

.session-card.connecting::before {
    background: var(--grad-green);
    opacity: 1;
    animation: rotatePulse 1s ease-in-out infinite;
}

.session-card.connecting {
    border-color: rgba(34, 197, 94, 0.3);
    animation: cardPulse 2s ease-in-out infinite;
}

.session-card.stopping::before {
    background: var(--grad-red);
    opacity: 1;
    animation: rotatePulse 1s ease-in-out infinite;
}

.session-card.stopping {
    border-color: rgba(239, 68, 68, 0.3);
    animation: cardPulse 2s ease-in-out infinite;
}

.session-card.stopped {
    opacity: 0.6;
}

.session-card.stopped:hover {
    opacity: 1;
}

@keyframes rotatePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

@keyframes cardPulse {
    0%, 100% { box-shadow: none; }
    50% { box-shadow: 0 0 20px rgba(168, 85, 247, 0.1); }
}

.session-step {
    font-size: 11px;
    font-weight: 500;
    color: var(--amber-400);
    padding: 4px 10px;
    margin-bottom: 10px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.15);
    border-radius: 6px;
    text-align: center;
    animation: stepPulse 1.5s ease-in-out infinite;
}

@keyframes stepPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Countdown badge - small pill */
.countdown-badge {
    font-size: 10px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: var(--amber-400);
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.2);
    padding: 2px 7px;
    border-radius: 8px;
    white-space: nowrap;
    animation: badgePulse 2s ease-in-out infinite;
}

.session-badge.rotating {
    background: rgba(168,85,247,0.12);
    color: var(--purple-400);
    border: 1px solid rgba(168,85,247,0.2);
    animation: badgePulse 1s ease-in-out infinite;
}

.session-badge.stopping {
    background: rgba(239,68,68,0.12);
    color: var(--red-400);
    border: 1px solid rgba(239,68,68,0.2);
    animation: badgePulse 1s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.session-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.session-id {
    display: flex;
    align-items: center;
    gap: 8px;
}

.session-num {
    font-size: 14px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-primary);
}

.session-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.session-badge.connected {
    background: rgba(34,197,94,0.12);
    color: var(--green-400);
    border: 1px solid rgba(34,197,94,0.2);
}

.session-badge.stopped {
    background: rgba(255,255,255,0.04);
    color: var(--text-tertiary);
    border: 1px solid var(--border-subtle);
}

.session-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
}

.session-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.session-label {
    font-size: 10px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.session-value {
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-primary);
    font-weight: 500;
}

.session-value.ip {
    color: var(--green-400);
}

.session-value.no-ip {
    color: var(--text-tertiary);
}

/* ---- Multi-port grid ---- */

.session-ports {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    margin-bottom: 12px;
}

.port-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 4px 2px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: 5px;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
}

.port-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

.port-item.vip {
    background: rgba(251, 191, 36, 0.06);
    border-color: rgba(251, 191, 36, 0.2);
}

.port-item.vip:hover {
    background: rgba(251, 191, 36, 0.12);
}

.port-label {
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
}

.port-item.vip .port-label {
    color: var(--amber-400);
}

.port-value {
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: var(--text-primary);
}

.port-item.vip .port-value {
    color: var(--amber-400);
}

.port-copy-icon {
    position: absolute;
    top: 2px;
    right: 3px;
    opacity: 0;
    color: var(--text-tertiary);
    transition: opacity 0.15s;
}

.port-item:hover .port-copy-icon {
    opacity: 0.6;
}

.port-item.copied {
    border-color: var(--green-400) !important;
    background: rgba(34, 197, 94, 0.15) !important;
}

.port-item.copied .port-copy-icon {
    opacity: 1;
    color: var(--green-400);
}

.session-actions {
    display: flex;
    gap: 6px;
}

.session-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 10px;
    border: none;
    border-radius: 6px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.session-btn.start {
    background: rgba(34,197,94,0.1);
    color: var(--green-400);
    border: 1px solid rgba(34,197,94,0.15);
}

.session-btn.start:hover {
    background: rgba(34,197,94,0.2);
}

.session-btn.stop {
    background: rgba(239,68,68,0.1);
    color: var(--red-400);
    border: 1px solid rgba(239,68,68,0.15);
}

.session-btn.stop:hover {
    background: rgba(239,68,68,0.2);
}

.session-btn.rotate {
    background: rgba(168,85,247,0.1);
    color: var(--purple-400);
    border: 1px solid rgba(168,85,247,0.15);
}

.session-btn.rotate:hover {
    background: rgba(168,85,247,0.2);
}

.session-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.session-btn.loading {
    pointer-events: none;
    position: relative;
}

.session-btn.loading::after {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.session-btn.check {
    background: rgba(34,211,238,0.1);
    color: var(--cyan-400);
    border: 1px solid rgba(34,211,238,0.15);
    flex: 0 0 auto;
    padding: 7px 8px;
    min-width: 32px;
}

.session-btn.check:hover {
    background: rgba(34,211,238,0.2);
}

.session-btn.check.ok {
    background: rgba(34,197,94,0.15);
    color: var(--green-400);
    border-color: rgba(34,197,94,0.25);
}

.session-btn.check.fail {
    background: rgba(239,68,68,0.15);
    color: var(--red-400);
    border-color: rgba(239,68,68,0.25);
}

.check-result {
    font-size: 10px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    padding: 2px 6px;
    border-radius: 6px;
    white-space: nowrap;
}

.check-result.ok {
    color: var(--green-400);
    background: rgba(34,197,94,0.1);
}

.check-result.fail {
    color: var(--red-400);
    background: rgba(239,68,68,0.1);
}

.btn-check-all {
    background: rgba(34,211,238,0.1);
    color: var(--cyan-400);
    border: 1px solid rgba(34,211,238,0.2);
}

.btn-check-all:hover {
    background: rgba(34,211,238,0.2);
}

/* ============ CONFIG ============ */

.config-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 32px;
}

.config-header {
    margin-bottom: 32px;
}

.config-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
}

.config-header h2 svg { color: var(--indigo-400); }

.config-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

.config-section {
    margin-bottom: 28px;
}

.config-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.config-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.config-section-header .config-label {
    margin-bottom: 0;
}

.config-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    transition: all 0.2s;
}

.config-input:focus {
    outline: none;
    border-color: var(--indigo-500);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.config-textarea {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    resize: vertical;
    transition: all 0.2s;
    line-height: 1.6;
}

.config-textarea:focus {
    outline: none;
    border-color: var(--indigo-500);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.config-textarea::placeholder {
    color: var(--text-tertiary);
}

.account-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    transition: all 0.2s;
}

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

.account-idx {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--grad-indigo);
    color: white;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.account-fields {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr auto auto;
    gap: 8px;
}

.account-input {
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    transition: all 0.2s;
}

.account-input-small {
    width: 70px;
    text-align: center;
}

.account-input-nic {
    width: 160px;
    font-size: 12px;
    cursor: pointer;
    appearance: auto;
}

.account-input:focus {
    outline: none;
    border-color: var(--indigo-500);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.account-info {
    font-size: 11px;
    color: var(--text-tertiary);
    white-space: nowrap;
}

.account-delete {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(239,68,68,0.08);
    color: var(--red-400);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.account-delete:hover {
    background: rgba(239,68,68,0.2);
}

.config-actions {
    display: flex;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--border-subtle);
}

/* ============ TERMINAL ============ */

.terminal-panel {
    background: #0d0d12;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.terminal-header {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid var(--border-subtle);
}

.terminal-dots {
    display: flex;
    gap: 6px;
    margin-right: 16px;
}

.terminal-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green2 { background: #27c93f; }

.terminal-title {
    flex: 1;
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 500;
}

.terminal-body {
    padding: 18px 20px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    line-height: 1.7;
    color: var(--text-secondary);
    min-height: 400px;
    max-height: 600px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.term-system { color: var(--indigo-400); }
.term-success { color: var(--green-400); }
.term-error { color: var(--red-400); }
.term-warn { color: var(--amber-400); }

/* ============ TOAST ============ */

.toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    backdrop-filter: blur(20px);
    max-width: 380px;
}

.toast.success { border-left: 3px solid var(--green-400); }
.toast.error { border-left: 3px solid var(--red-400); }
.toast.info { border-left: 3px solid var(--indigo-400); }
.toast.warning { border-left: 3px solid var(--amber-400); }

.toast-icon { font-size: 16px; flex-shrink: 0; }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(40px); }
}

/* ============ CONFIRM DIALOG ============ */

.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(10px);
    z-index: 300;
    display: none;
    align-items: center;
    justify-content: center;
}

.confirm-overlay.active {
    display: flex;
}

.confirm-dialog {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    animation: modalIn 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.confirm-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.confirm-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.confirm-message {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 24px;
}

.confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.confirm-btn {
    padding: 10px 28px;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

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

.confirm-btn-cancel {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

.confirm-btn-cancel:hover {
    color: var(--text-primary);
    border-color: rgba(255,255,255,0.12);
}

.confirm-btn-ok {
    background: var(--grad-indigo);
    color: white;
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.3);
}

.confirm-btn-ok:hover {
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.confirm-btn-ok.danger {
    background: var(--grad-red);
    box-shadow: 0 2px 12px rgba(239, 68, 68, 0.3);
}

.confirm-btn-ok.danger:hover {
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
}

.confirm-btn-ok.start {
    background: var(--grad-green);
    box-shadow: 0 2px 12px rgba(34, 197, 94, 0.3);
}

.confirm-btn-ok.start:hover {
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.4);
}

/* ============ MODAL ============ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 28px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: modalIn 0.3s ease;
}

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

.modal-header h3 {
    font-size: 16px;
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(255,255,255,0.05);
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
}

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

/* ============ BOTTOM NAVIGATION (Mobile) ============ */

.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: rgba(10, 10, 15, 0.92);
    backdrop-filter: blur(24px) saturate(1.8);
    -webkit-backdrop-filter: blur(24px) saturate(1.8);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)) 4px;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.5);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 8px 4px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    font-family: inherit;
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    border-radius: var(--radius-md);
    position: relative;
    min-width: 56px;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item svg {
    transition: all 0.25s ease;
}

.bottom-nav-item:active {
    transform: scale(0.92);
}

.bottom-nav-item.active {
    color: var(--indigo-400);
}

.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 2px;
    background: var(--grad-indigo);
    border-radius: 0 0 2px 2px;
}

.bottom-nav-item.active svg {
    filter: drop-shadow(0 0 6px rgba(99, 102, 241, 0.4));
}

.bottom-nav-item span {
    letter-spacing: 0.2px;
    line-height: 1;
}

/* ============ MORE MENU (Mobile) ============ */

.more-menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 199;
    background: rgba(0, 0, 0, 0.4);
    -webkit-tap-highlight-color: transparent;
}

.more-menu-overlay.active {
    display: block;
    animation: fadeInOverlay 0.2s ease;
}

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

.more-menu {
    display: none;
    position: fixed;
    bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    right: 12px;
    z-index: 201;
    background: rgba(22, 22, 30, 0.96);
    backdrop-filter: blur(24px) saturate(1.8);
    -webkit-backdrop-filter: blur(24px) saturate(1.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 6px;
    min-width: 180px;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.05);
}

.more-menu.active {
    display: block;
    animation: moreMenuIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: bottom right;
}

@keyframes moreMenuIn {
    from {
        opacity: 0;
        transform: scale(0.85) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.more-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: var(--radius-md);
    -webkit-tap-highlight-color: transparent;
    text-align: left;
}

.more-menu-item:hover,
.more-menu-item:active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.more-menu-item.active {
    color: var(--indigo-400);
    background: rgba(99, 102, 241, 0.08);
}

.more-menu-item svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.more-menu-item.active svg {
    opacity: 1;
    color: var(--indigo-400);
}

/* ============ RESPONSIVE ============ */

@media (max-width: 768px) {
    /* Show bottom nav */
    .bottom-nav {
        display: flex;
    }

    /* Hide top tab nav on mobile */
    .tabs {
        display: none;
    }

    /* Compact header */
    .header {
        flex-direction: row;
        padding: 8px 12px;
        gap: 6px;
    }

    .logo-icon {
        width: 32px;
        height: 32px;
        border-radius: 8px;
    }

    .logo-icon svg {
        width: 20px;
        height: 20px;
    }

    .logo {
        gap: 8px;
    }

    .logo h1 {
        font-size: 14px;
    }

    .logo-sub {
        display: none;
    }

    /* Header action buttons - icons only on mobile */
    .header-btn-label {
        display: none;
    }

    .header-btn {
        padding: 7px 9px;
        gap: 0;
    }

    .header-actions {
        gap: 4px;
    }

    .header-right {
        gap: 6px;
        flex-shrink: 0;
    }

    /* System stats compact on mobile */
    .sys-stats {
        gap: 6px;
        padding: 3px 8px;
        border-radius: 10px;
    }

    .sys-stat {
        gap: 3px;
    }

    .sys-icon {
        font-size: 10px;
    }

    .sys-val {
        font-size: 9px;
    }

    .sys-label {
        display: none;
    }

    .sys-bar-wrap {
        width: 24px;
        height: 4px;
    }

    .sys-divider {
        height: 14px;
    }

    .sys-dot {
        width: 5px;
        height: 5px;
    }

    .device-badge {
        padding: 4px 8px;
        font-size: 11px;
        gap: 4px;
    }

    .device-icon {
        font-size: 12px;
    }

    /* Main content - padding for bottom nav */
    .main {
        padding: 12px 10px calc(72px + env(safe-area-inset-bottom, 0px)) 10px;
        overflow-x: hidden;
        max-width: 100vw;
    }

    /* Section compact */
    .section {
        border-radius: var(--radius-md);
        margin-bottom: 14px;
    }

    .section-header {
        padding: 12px 14px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .section-header h2 {
        font-size: 13px;
        gap: 6px;
    }

    .section-header h2 svg {
        width: 16px;
        height: 16px;
    }

    .session-filters {
        width: 100%;
        justify-content: center;
    }

    .filter-btn {
        flex: 1;
        text-align: center;
        padding: 6px 10px;
        font-size: 11px;
    }

    .section-body {
        padding: 0 12px 14px;
    }

    /* Farm cards compact */
    .farm-card {
        border-radius: var(--radius-md);
        margin-bottom: 10px;
    }

    .farm-header {
        padding: 12px 14px;
        gap: 8px;
        flex-wrap: wrap;
        overflow: hidden;
    }

    .farm-idx {
        width: 30px;
        height: 30px;
        font-size: 12px;
        border-radius: 8px;
    }

    .farm-title {
        font-size: 12px;
        flex-wrap: wrap;
        gap: 4px;
    }

    .farm-nic-badge {
        font-size: 9px;
        padding: 1px 6px;
    }

    .farm-subtitle {
        font-size: 10px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .farm-stats {
        gap: 8px;
    }

    .farm-stat {
        font-size: 11px;
    }

    .farm-controls {
        gap: 4px;
    }

    .farm-btn {
        padding: 5px 8px;
        font-size: 10px;
    }

    .farm-body {
        padding: 0 12px 14px;
        overflow-x: hidden;
    }

    .farm-sessions-grid {
        grid-template-columns: 1fr;
        gap: 8px;
        padding-top: 12px;
    }

    /* Session cards compact */
    .session-card {
        padding: 12px;
        border-radius: 8px;
    }

    .session-num {
        font-size: 12px;
    }

    .session-badge {
        font-size: 9px;
        padding: 2px 6px;
    }

    .session-info {
        gap: 6px;
        margin-bottom: 10px;
    }

    .session-label {
        font-size: 9px;
    }

    .session-value {
        font-size: 11px;
    }

    .session-step {
        font-size: 10px;
        padding: 3px 8px;
        margin-bottom: 8px;
    }

    .session-ports {
        gap: 3px;
        margin-bottom: 10px;
    }

    .port-label {
        font-size: 7px;
    }

    .port-value {
        font-size: 10px;
    }

    .session-actions {
        gap: 4px;
        flex-wrap: wrap;
    }

    .session-btn {
        padding: 6px 8px;
        font-size: 10px;
        gap: 3px;
    }

    /* Sessions grid */
    .sessions-grid {
        grid-template-columns: 1fr;
        padding: 0 12px 14px;
        gap: 8px;
    }

    /* Config panel compact */
    .config-panel {
        padding: 16px;
        border-radius: var(--radius-md);
    }

    .config-header {
        margin-bottom: 20px;
    }

    .config-header h2 {
        font-size: 16px;
        gap: 8px;
    }

    .config-header h2 svg {
        width: 20px;
        height: 20px;
    }

    .config-header p {
        font-size: 12px;
    }

    .config-section {
        margin-bottom: 20px;
    }

    .config-input {
        padding: 10px 12px;
        font-size: 13px;
    }

    .account-card {
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
        gap: 8px;
    }

    .account-idx {
        width: 24px;
        height: 24px;
        font-size: 11px;
        align-self: flex-start;
    }

    .account-fields {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .account-input {
        padding: 8px 10px;
        font-size: 12px;
    }

    .account-input-small,
    .account-input-nic {
        width: 100%;
    }

    .account-info {
        font-size: 10px;
    }

    .config-actions {
        flex-direction: column;
        gap: 8px;
    }

    .config-actions .btn {
        justify-content: center;
        width: 100%;
    }

    /* Terminal compact */
    .terminal-panel {
        border-radius: var(--radius-md);
    }

    .terminal-header {
        padding: 8px 12px;
    }

    .terminal-title {
        font-size: 11px;
    }

    .terminal-body {
        padding: 12px;
        font-size: 11px;
        min-height: 300px;
    }

    .console-panel-wrap {
        height: calc(100vh - 140px - env(safe-area-inset-bottom, 0px));
        min-height: 300px;
    }

    /* Toast positioning */
    .toast-container {
        top: auto;
        bottom: calc(72px + env(safe-area-inset-bottom, 0px));
        right: 10px;
        left: 10px;
    }

    .toast {
        font-size: 12px;
        padding: 10px 14px;
        max-width: 100%;
    }

    /* Modal compact */
    .modal {
        padding: 20px;
        width: 94%;
        max-height: 70vh;
        margin-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    }

    /* Rotation queue compact */
    .queue-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .queue-grid-wrap {
        padding: 10px;
    }

    .queue-card {
        padding: 12px 14px;
    }

    .queue-card-session {
        font-size: 12px;
    }

    .queue-card-val {
        font-size: 11px;
    }

    /* Rotation tab compact */
    .rotation-tab-header {
        padding: 14px 14px 12px;
        border-radius: var(--radius-md) var(--radius-md) 0 0;
    }

    .rotation-tab-title h2 {
        font-size: 14px;
    }

    .rotation-tab-title svg {
        width: 18px;
        height: 18px;
    }

    .rotation-tab-body {
        border-radius: 0 0 var(--radius-md) var(--radius-md);
        min-height: 200px;
    }

    .queue-empty-state {
        padding: 50px 16px;
    }

    .queue-empty-icon {
        font-size: 40px;
    }

    .queue-empty-state h3 {
        font-size: 14px;
    }

    .queue-empty-state p {
        font-size: 12px;
    }

    /* Blacklist compact */
    .bl-card {
        margin-top: 12px;
    }

    .bl-header {
        padding: 10px 12px;
    }

    .bl-title {
        font-size: 12px;
    }

    .bl-body {
        padding: 10px 12px;
    }

    .bl-input {
        padding: 8px 10px;
        font-size: 11px;
    }

    .bl-add-btn {
        width: 34px;
        height: 34px;
    }

    .bl-domain {
        font-size: 10px;
    }

    /* Background effects - reduce on mobile for performance */
    .bg-glow {
        filter: blur(80px);
        opacity: 0.08;
    }

    .bg-glow-1 { width: 300px; height: 300px; }
    .bg-glow-2 { width: 250px; height: 250px; }
    .bg-glow-3 { display: none; }
}

/* Extra small devices */
@media (max-width: 380px) {
    .header {
        padding: 6px 10px;
    }

    .logo h1 {
        font-size: 13px;
    }

    .device-badge {
        padding: 3px 6px;
        font-size: 10px;
    }

    .main {
        padding: 8px 8px calc(72px + env(safe-area-inset-bottom, 0px)) 8px;
    }

    .bottom-nav-item {
        font-size: 9px;
        min-width: 48px;
        padding: 5px 4px 3px;
    }

    .bottom-nav-item svg {
        width: 18px;
        height: 18px;
    }

    .header-btn {
        padding: 6px 7px;
    }

    .header-btn svg {
        width: 12px;
        height: 12px;
    }

    .header-actions {
        gap: 3px;
    }

    /* Hide header on extra small — wrap to 2-row header */
    .header {
        flex-wrap: wrap;
    }

    .header-center {
        order: 3;
        width: 100%;
        justify-content: flex-start;
    }

    .sys-stats {
        display: none;
    }
}

/* ============ EMPTY STATE ============ */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-tertiary);
}

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

.empty-state h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 13px;
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ============ ANIMATION HELPERS ============ */

.fade-enter {
    animation: fadeIn 0.3s ease forwards;
}

.shimmer {
    background: linear-gradient(90deg, var(--bg-elevated) 25%, rgba(255,255,255,0.04) 50%, var(--bg-elevated) 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============ INTERACTIVE CONSOLE (xterm.js) ============ */

.console-panel-wrap {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 180px);
    min-height: 400px;
}

.console-container {
    flex: 1;
    padding: 8px;
    background: #0d0d12;
    overflow: hidden;
}

.console-container .xterm {
    height: 100%;
}

.console-container .xterm-viewport {
    background-color: #0d0d12 !important;
}

.console-container .xterm-screen {
    width: 100% !important;
}

/* ============ ROTATION QUEUE ============ */

/* Rotation tab layout */
.rotation-tab-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-card);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.rotation-tab-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rotation-tab-title svg {
    color: var(--purple-400);
    filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.3));
}

.rotation-tab-title h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.rotation-tab-body {
    background: var(--bg-card);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    border: 1px solid var(--border-subtle);
    border-top: none;
    min-height: 300px;
}

/* Queue empty state */
.queue-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
    color: var(--text-tertiary);
}

.queue-empty-icon {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: 0.4;
    animation: gentleSpin 4s linear infinite;
}

@keyframes gentleSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.queue-empty-state h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 0 8px;
}

.queue-empty-state p {
    font-size: 13px;
    max-width: 320px;
    line-height: 1.6;
    margin: 0;
    color: var(--text-tertiary);
}

/* Tab badge (queue count on tab buttons) */
.tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 700;
    background: rgba(168, 85, 247, 0.2);
    color: var(--purple-400);
    border: 1px solid rgba(168, 85, 247, 0.3);
    margin-left: 4px;
    animation: badgePulse 2s ease-in-out infinite;
}

/* Bottom nav badge */
.bn-badge {
    position: absolute;
    top: 2px;
    right: 50%;
    transform: translateX(calc(50% + 10px));
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    font-size: 9px;
    font-weight: 700;
    background: var(--purple-500);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.4);
    animation: badgePulse 2s ease-in-out infinite;
}

.queue-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(168, 85, 247, 0.15);
    color: var(--purple-400);
    border: 1px solid rgba(168, 85, 247, 0.25);
    margin-left: 6px;
}

.queue-grid-wrap {
    padding: 12px;
}

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

/* Queue Card */
.queue-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.queue-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    opacity: 0;
    transition: opacity 0.2s;
}

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

.queue-card.queue-status-in-progress::before {
    background: linear-gradient(90deg, var(--purple-400), var(--indigo-400));
    opacity: 1;
    animation: rotatePulse 1s ease-in-out infinite;
}

.queue-card.queue-status-in-progress {
    border-color: rgba(168, 85, 247, 0.25);
}

.queue-card.queue-status-success::before {
    background: var(--grad-green);
    opacity: 1;
}

.queue-card.queue-status-success {
    border-color: rgba(34, 197, 94, 0.2);
}

.queue-card.queue-status-failed::before {
    background: var(--grad-red);
    opacity: 1;
}

.queue-card.queue-status-failed {
    border-color: rgba(239, 68, 68, 0.2);
    opacity: 0.7;
}

.queue-card.queue-status-pending-retry::before {
    background: linear-gradient(90deg, var(--amber-400), var(--amber-500));
    opacity: 1;
    animation: rotatePulse 2s ease-in-out infinite;
}

.queue-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 8px;
}

.queue-card-session {
    font-size: 14px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-primary);
}

.queue-card-step {
    font-size: 11px;
    color: var(--purple-400);
    margin-bottom: 8px;
    padding: 4px 8px;
    background: rgba(168, 85, 247, 0.06);
    border-radius: var(--radius-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    animation: fadeIn 0.3s ease;
}

.queue-card-ips {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}

.queue-card-ip {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.queue-card-label {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
}

.queue-card-val {
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.queue-card-val.new-ip {
    color: var(--green-400);
}

.queue-card-arrow {
    flex-shrink: 0;
    color: var(--text-tertiary);
    opacity: 0.5;
}

.queue-card-bottom {
    display: flex;
    align-items: center;
    gap: 12px;
}

.queue-card-meta {
    font-size: 11px;
    color: var(--text-tertiary);
}

.queue-card-meta strong {
    color: var(--text-secondary);
    font-weight: 600;
}

.queue-card-remove {
    margin-left: auto;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-tertiary);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.queue-card-remove:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--red-400);
}

.queue-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.queue-status-queued .queue-badge,
.queue-badge.queue-status-queued {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
}

.queue-status-in-progress .queue-badge,
.queue-badge.queue-status-in-progress {
    background: rgba(168, 85, 247, 0.12);
    color: var(--purple-400);
    animation: badgePulse 1s ease-in-out infinite;
}

.queue-status-pending-retry .queue-badge,
.queue-badge.queue-status-pending-retry {
    background: rgba(251, 191, 36, 0.12);
    color: var(--amber-400);
    animation: badgePulse 2s ease-in-out infinite;
}

.queue-status-success .queue-badge,
.queue-badge.queue-status-success {
    background: rgba(34, 197, 94, 0.12);
    color: var(--green-400);
}

.queue-status-failed .queue-badge,
.queue-badge.queue-status-failed {
    background: rgba(239, 68, 68, 0.12);
    color: var(--red-400);
}

/* ============ BLACKLIST ============ */

.bl-card {
    margin-top: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.bl-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(239, 68, 68, 0.03);
}

.bl-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.bl-title svg {
    color: var(--red-400);
    opacity: 0.7;
    flex-shrink: 0;
}

.bl-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 700;
    background: rgba(239, 68, 68, 0.12);
    color: var(--red-400);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.bl-count:empty {
    display: none;
}

.bl-header-actions {
    display: flex;
    gap: 6px;
}

.bl-body {
    padding: 14px 18px;
}

.bl-input-row {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
}

.bl-input {
    flex: 1;
    padding: 9px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
}

.bl-input::placeholder {
    color: var(--text-tertiary);
    font-family: 'Inter', sans-serif;
    font-size: 12px;
}

.bl-input:focus {
    border-color: rgba(239, 68, 68, 0.4);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.08);
}

.bl-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: var(--radius-md);
    background: rgba(239, 68, 68, 0.08);
    color: var(--red-400);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.bl-add-btn:hover {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(239, 68, 68, 0.4);
    transform: scale(1.05);
}

.bl-add-btn:active {
    transform: scale(0.95);
}

.bl-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.bl-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px 4px 10px;
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.14);
    border-radius: 20px;
    transition: all 0.2s;
    animation: fadeIn 0.25s ease;
}

.bl-tag:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.28);
}

.bl-domain {
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    color: var(--red-400);
    line-height: 1;
}

.bl-remove {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 10px;
    padding: 2px 4px;
    border-radius: 50%;
    line-height: 1;
    transition: all 0.15s;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bl-remove:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--red-400);
}

.bl-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px;
    color: var(--text-tertiary);
    font-size: 12px;
    width: 100%;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--red-400);
    border: 1px solid rgba(239, 68, 68, 0.18);
    font-size: 11px;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.3);
}

/* ============ IP LIST ============ */

.iplist-card {
    margin-top: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.iplist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(34, 211, 238, 0.03);
}

.iplist-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.iplist-title svg {
    color: var(--cyan-400, #22d3ee);
    opacity: 0.7;
    flex-shrink: 0;
}

.iplist-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 700;
    background: rgba(34, 211, 238, 0.12);
    color: var(--cyan-400, #22d3ee);
    border: 1px solid rgba(34, 211, 238, 0.2);
}

.iplist-count:empty {
    display: none;
}

.iplist-header-actions {
    display: flex;
    gap: 6px;
}

.btn-copy {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(34, 211, 238, 0.08);
    color: var(--cyan-400, #22d3ee);
    border: 1px solid rgba(34, 211, 238, 0.18);
    font-size: 11px;
}

.btn-copy:hover {
    background: rgba(34, 211, 238, 0.16);
    border-color: rgba(34, 211, 238, 0.3);
}

.iplist-body {
    padding: 0;
}

.iplist-content {
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(34, 211, 238, 0.2) transparent;
}

.iplist-content::-webkit-scrollbar {
    width: 5px;
}

.iplist-content::-webkit-scrollbar-track {
    background: transparent;
}

.iplist-content::-webkit-scrollbar-thumb {
    background: rgba(34, 211, 238, 0.2);
    border-radius: 10px;
}

.iplist-content::-webkit-scrollbar-thumb:hover {
    background: rgba(34, 211, 238, 0.35);
}

.iplist-items {
    display: flex;
    flex-direction: column;
}

.iplist-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.025);
    transition: background 0.15s;
}

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

.iplist-row:hover {
    background: rgba(34, 211, 238, 0.04);
}

.iplist-ip {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 500;
    color: var(--cyan-400, #22d3ee);
    letter-spacing: 0.3px;
}

.iplist-time {
    font-size: 10px;
    color: var(--text-tertiary);
    white-space: nowrap;
    margin-left: 12px;
}

.iplist-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 32px;
    color: var(--text-tertiary);
    font-size: 12px;
    width: 100%;
}

/* Mobile responsive IP list */
@media (max-width: 768px) {
    .iplist-card {
        margin-top: 12px;
    }

    .iplist-header {
        padding: 10px 12px;
    }

    .iplist-title {
        font-size: 12px;
    }

    .iplist-row {
        padding: 6px 12px;
    }

    .iplist-ip {
        font-size: 11px;
    }

    .iplist-time {
        font-size: 9px;
    }

    .iplist-content {
        max-height: 300px;
    }
}

/* ============ OVERVIEW DASHBOARD ============ */

.overview-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ov-row {
    display: grid;
    gap: 16px;
}

.ov-row-top {
    grid-template-columns: 1fr 1fr;
}

.ov-row-metrics {
    grid-template-columns: repeat(3, 1fr);
}

.ov-row-services {
    grid-template-columns: 1fr 1fr;
}

.ov-row-farms-summary {
    grid-template-columns: 1fr;
}

/* Overview Cards */
.ov-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 20px 24px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.ov-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.3), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

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

.ov-card:hover {
    border-color: rgba(99, 102, 241, 0.15);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Uptime & Device cards */
.ov-card-uptime,
.ov-card-device {
    display: flex;
    align-items: center;
    gap: 18px;
}

.ov-card-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.uptime-icon {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: var(--green-400);
}

.device-icon-ov {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: var(--indigo-400);
}

.ov-card-body {
    flex: 1;
    min-width: 0;
}

.ov-card-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.ov-card-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-variant-numeric: tabular-nums;
}

.ov-card-sub {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

/* Metric cards (CPU, RAM, Disk) */
.ov-card-metric {
    padding: 18px 22px;
}

.ov-metric-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.ov-metric-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.ov-metric-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    flex: 1;
}

.ov-metric-value {
    font-size: 20px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    font-variant-numeric: tabular-nums;
}

.ov-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.ov-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.ov-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.ov-metric-detail {
    font-size: 11px;
    color: var(--text-tertiary);
    font-family: 'JetBrains Mono', monospace;
}

/* Service cards (PPPoE, Proxy) */
.ov-card-service {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 22px 28px;
}

.ov-service-ring {
    position: relative;
    width: 72px;
    height: 72px;
    flex-shrink: 0;
}

.ov-ring-svg {
    width: 100%;
    height: 100%;
}

.ov-ring-progress {
    transition: stroke-dasharray 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.ov-ring-center {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ov-ring-num {
    font-size: 20px;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-primary);
}

.ov-service-info {
    flex: 1;
    min-width: 0;
}

.ov-service-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.ov-service-detail {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.ov-service-sub {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

.ov-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.ov-dot.dot-green {
    background: var(--green-400);
    box-shadow: 0 0 6px rgba(74, 222, 128, 0.4);
}

.ov-dot.dot-blue {
    background: var(--blue-400);
    box-shadow: 0 0 6px rgba(96, 165, 250, 0.4);
}

.ov-dot.dot-offline {
    background: var(--text-tertiary);
}

/* Service card accents */
.ov-service-pppoe {
    border-left: 3px solid rgba(74, 222, 128, 0.4);
}

.ov-service-proxy {
    border-left: 3px solid rgba(96, 165, 250, 0.4);
}

/* Farm Overview card */
.ov-card-farms-overview {
    padding: 20px 24px;
}

.ov-farms-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.ov-farms-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ov-farms-empty {
    text-align: center;
    padding: 20px;
    color: var(--text-tertiary);
    font-size: 13px;
}

.ov-farm-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.ov-farm-row:hover {
    border-color: rgba(99, 102, 241, 0.2);
    background: var(--bg-card-hover);
}

.ov-farm-idx {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    background: rgba(99, 102, 241, 0.1);
    color: var(--indigo-400);
    border: 1px solid rgba(99, 102, 241, 0.15);
    flex-shrink: 0;
}

.ov-farm-info {
    flex: 1;
    min-width: 0;
}

.ov-farm-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ov-farm-detail {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.ov-farm-bar-wrap {
    width: 80px;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
    flex-shrink: 0;
}

.ov-farm-bar {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--green-500), var(--green-400));
    transition: width 0.6s ease;
}

.ov-farm-stats {
    font-size: 13px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    min-width: 50px;
    text-align: right;
}

.ov-farm-online {
    color: var(--green-400);
}

.ov-farm-total {
    color: var(--text-tertiary);
}

/* Responsive overview */
@media (max-width: 900px) {
    .ov-row-metrics {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .ov-row-top,
    .ov-row-services {
        grid-template-columns: 1fr;
    }

    .ov-card-value {
        font-size: 18px;
    }

    .ov-card-service {
        padding: 16px 18px;
    }

    .ov-farm-bar-wrap {
        width: 60px;
    }
}

/* ============ LOGIN OVERLAY ============ */

.login-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(30px);
    align-items: center;
    justify-content: center;
}

.login-overlay.active {
    display: flex;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    width: 100%;
    max-width: 380px;
    text-align: center;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--indigo-500), var(--purple-500), var(--indigo-500));
}

.login-logo {
    margin-bottom: 20px;
}

.login-logo svg {
    width: 56px;
    height: 56px;
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #e8e8ed, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.login-sub {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-bottom: 28px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-input {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

.login-input:focus {
    border-color: var(--indigo-500);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.login-input::placeholder {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: var(--text-tertiary);
}

.config-hint {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-tertiary);
}

/* ============ INSTALL STATUS CARD ============ */

.install-status-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 16px;
}

.install-status-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.install-status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.install-status-badge.installed {
    color: var(--green-400);
}

.install-status-badge.not-installed {
    color: var(--amber-400);
}

.install-badge-icon {
    font-size: 16px;
}

.install-status-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.install-status-details {
    margin-top: 12px;
}

.install-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
}

.install-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    font-size: 12px;
}

.install-item.ok {
    border-color: rgba(34, 197, 94, 0.2);
}

.install-item.missing {
    border-color: rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.05);
}

.install-item-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.install-item-label {
    flex: 1;
    color: var(--text-secondary);
}

.install-item-val {
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
}

.install-item.ok .install-item-val {
    color: var(--green-400);
}

.install-item.missing .install-item-val {
    color: var(--amber-400);
}

.login-error {
    font-size: 12px;
    color: var(--red-400);
    min-height: 18px;
}

.login-attempts {
    font-size: 11px;
    color: var(--text-tertiary);
    min-height: 16px;
    transition: all 0.3s;
}

.login-attempts.warning {
    color: var(--amber-400);
    font-weight: 600;
    animation: pulse-warn 1.5s ease-in-out infinite;
}

@keyframes pulse-warn {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.login-lockout {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-md);
    animation: lockout-appear 0.4s ease;
}

@keyframes lockout-appear {
    from { opacity: 0; transform: translateY(-8px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.lockout-icon {
    color: var(--red-400);
    flex-shrink: 0;
    animation: shake-lock 0.6s ease-in-out;
}

@keyframes shake-lock {
    0%, 100% { transform: rotate(0); }
    20% { transform: rotate(-12deg); }
    40% { transform: rotate(12deg); }
    60% { transform: rotate(-8deg); }
    80% { transform: rotate(8deg); }
}

.lockout-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.lockout-text > span:first-child {
    font-size: 12px;
    font-weight: 600;
    color: var(--red-400);
}

.lockout-time {
    font-size: 20px;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    color: var(--red-400);
    font-variant-numeric: tabular-nums;
}

.login-input:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.login-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--grad-indigo);
    color: white;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.4);
}

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

.login-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

/* ============ LOGOUT BUTTON ============ */

.header-btn-logout {
    background: rgba(239, 68, 68, 0.08);
    color: var(--red-400);
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.header-btn-logout:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
}

/* ============ OVERVIEW CONTROL PANEL ============ */

.ov-row-controls {
    grid-template-columns: 1fr;
}

.ov-card-controls {
    padding: 14px 20px;
    background: rgba(22, 22, 30, 0.8);
    border: 1px solid var(--border-subtle);
}

.ov-controls-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ov-ctrl-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.ov-ctrl-btn:active { transform: scale(0.95); }

.ov-ctrl-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.12), transparent);
    opacity: 0;
    transition: opacity 0.2s;
}

.ov-ctrl-btn:hover::after { opacity: 1; }

.ov-ctrl-start {
    background: var(--grad-green);
    color: white;
    box-shadow: 0 2px 10px rgba(34, 197, 94, 0.3);
}

.ov-ctrl-stop {
    background: var(--grad-red);
    color: white;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.3);
}

.ov-ctrl-refresh {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}

.ov-ctrl-refresh:hover {
    border-color: rgba(255,255,255,0.12);
}

.ov-ctrl-check {
    background: rgba(34,211,238,0.1);
    color: var(--cyan-400);
    border: 1px solid rgba(34,211,238,0.2);
}

.ov-ctrl-check:hover {
    background: rgba(34,211,238,0.2);
}

.ov-ctrl-copy {
    background: rgba(251,191,36,0.1);
    color: var(--amber-400);
    border: 1px solid rgba(251,191,36,0.2);
}

.ov-ctrl-copy:hover {
    background: rgba(251,191,36,0.2);
}

.ov-ctrl-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.ov-ctrl-btn.loading::before {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 2px;
}

.ov-ctrl-divider {
    width: 1px;
    height: 24px;
    background: var(--border-subtle);
    margin: 0 4px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .ov-controls-bar {
        gap: 6px;
        justify-content: center;
    }

    .ov-ctrl-btn {
        padding: 7px 12px;
        font-size: 11px;
    }

    .ov-ctrl-divider {
        display: none;
    }

    .ov-card-controls {
        padding: 10px 14px;
    }

    /* Prevent overview card overflow */
    .ov-card {
        overflow: hidden;
    }

    .ov-metric-detail {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

@media (max-width: 420px) {
    .ov-ctrl-btn {
        padding: 7px 10px;
        font-size: 10px;
        gap: 4px;
    }

    .ov-ctrl-btn svg {
        width: 12px;
        height: 12px;
    }
}

/* ============ SERVER SYNC CARD ============ */

.server-sync-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    margin-top: 16px;
    overflow: hidden;
}

.server-sync-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.03), rgba(168, 85, 247, 0.03));
}

.server-sync-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.server-sync-title svg {
    color: var(--indigo-400);
    flex-shrink: 0;
}

.server-sync-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.server-sync-badge.badge-on {
    background: rgba(34, 197, 94, 0.1);
    color: var(--green-400);
    border-color: rgba(34, 197, 94, 0.2);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.1);
}

.server-sync-body {
    padding: 16px 20px;
}

.server-sync-status {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.server-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.server-status-label {
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 500;
}

.server-status-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
}

.server-status-value.status-connected {
    color: var(--green-400);
}

.server-status-value.status-disconnected {
    color: var(--red-400);
}

.server-sync-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.server-sync-fields .config-section {
    margin-bottom: 0;
}

.server-sync-fields .config-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
    padding: 0;
}

/* Header Server Status Dot */
.server-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-tertiary);
    margin-left: 4px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.server-status-dot.dot-online {
    background: var(--green-400);
    box-shadow: 0 0 6px rgba(74, 222, 128, 0.5);
    animation: dotPulse 2s ease-in-out infinite;
}

.server-status-dot.dot-offline {
    background: var(--red-400);
    box-shadow: 0 0 6px rgba(248, 113, 113, 0.5);
    animation: dotPulse 1s ease-in-out infinite;
}

@media (max-width: 768px) {
    .server-sync-header {
        padding: 12px 16px;
    }
    .server-sync-body {
        padding: 12px 16px;
    }
    .server-sync-fields .config-actions {
        flex-direction: column;
    }
}

/* ============ SYNC SESSION LIST ============ */

.sync-sessions-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sync-empty {
    text-align: center;
    padding: 20px;
    color: var(--text-tertiary);
    font-size: 13px;
}

.sync-session-row {
    display: grid;
    grid-template-columns: 80px 1fr 90px 100px;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: 12px;
}

.sync-session-row:hover {
    border-color: var(--border-active);
}

.sync-session-id {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: var(--indigo-400);
}

.sync-session-ip {
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-primary);
}

.sync-session-proxies {
    color: var(--text-secondary);
    text-align: right;
}

.sync-session-status {
    font-weight: 600;
    text-align: right;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
}

.sync-session-status.status-connected {
    color: var(--green-400);
}

.sync-session-status.status-rotating {
    color: var(--amber-400);
}

.sync-session-status.status-done {
    color: var(--purple-400);
}

@media (max-width: 600px) {
    .sync-session-row {
        grid-template-columns: 60px 1fr 100px;
    }
    .sync-session-proxies {
        display: none;
    }
}

/* ============ HUB DASHBOARD ============ */
.view-section { display: none; width: 100%; }
.view-section.active { display: block; }

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding: 0 4px;
}

.dashboard-title {
    display: flex;
    align-items: center;
    gap: 16px;
}

.dashboard-title h1 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 4px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.dashboard-title p {
    color: var(--text-tertiary);
    font-size: 14px;
}

.hub-stat-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 20px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.hub-stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
}

.hub-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--green-400);
}

.machine-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.machine-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.machine-card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.5), 0 0 20px rgba(99, 102, 241, 0.05);
}

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

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

.m-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.m-card-id {
    display: flex;
    align-items: center;
    gap: 12px;
}

.m-card-icon {
    width: 40px;
    height: 40px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--indigo-400);
    font-size: 18px;
}

.m-card-title h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 2px;
}

.m-card-lock {
    font-size: 13px;
    opacity: 0.6;
    margin-left: 2px;
}

.m-card-title p {
    font-size: 12px;
    color: var(--text-tertiary);
}

.m-card-status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.m-card-status.online { background: rgba(34, 197, 94, 0.1); color: var(--green-400); }
.m-card-status.offline { background: rgba(239, 68, 68, 0.1); color: var(--red-400); }

.m-card-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.m-stat-box {
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
}

.m-stat-v { font-size: 14px; font-weight: 600; }
.m-stat-l { font-size: 10px; color: var(--text-tertiary); text-transform: uppercase; }

.m-card-footer {
    margin-top: 8px;
    display: flex;
    justify-content: flex-end;
}

.m-btn-enter {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.machine-card:hover .m-btn-enter {
    background: var(--primary-gradient);
    border-color: transparent;
}

.loader-wrap {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 0;
    color: var(--text-tertiary);
}

.loader {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.05);
    border-top-color: var(--indigo-500);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

@media (max-width: 768px) {
    .dashboard-header { flex-direction: column; align-items: flex-start; gap: 20px; }
    .hub-stat-item { width: 100%; align-items: flex-start; }
}
