:root {
    --bg-dark: #07090e;
    --glass-bg: rgba(16, 22, 34, 0.65);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-border-hover: rgba(255, 255, 255, 0.25);
    --glass-specular: rgba(255, 255, 255, 0.05);

    --primary-emerald: #10b981;
    --emerald-glow: rgba(16, 185, 129, 0.35);
    --danger-ruby: #ef4444;
    --ruby-glow: rgba(239, 68, 68, 0.35);
    --warning-amber: #f59e0b;
    --accent-cyan: #06b6d4;

    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dim: #6b7280;

    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(140px);
    z-index: -1;
    pointer-events: none;
}
.bg-glow-1 {
    width: 500px;
    height: 500px;
    background: rgba(16, 185, 129, 0.12);
    top: -100px;
    left: -100px;
}
.bg-glow-2 {
    width: 600px;
    height: 600px;
    background: rgba(6, 182, 212, 0.10);
    bottom: -150px;
    right: -150px;
}
.bg-glow-3 {
    width: 400px;
    height: 400px;
    background: rgba(139, 92, 246, 0.08);
    top: 40%;
    left: 45%;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    border-radius: 16px;
    transition: border-color 0.3s ease, transform 0.3s ease;
}

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

.login-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 6, 11, 0.85);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 20px;
    overflow-y: auto;
}
.login-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 36px 32px;
    text-align: center;
}
.settings-card {
    max-width: 620px;
    text-align: left;
}

.shield-badge {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(6, 182, 212, 0.2));
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-emerald);
    box-shadow: 0 0 20px var(--emerald-glow);
}
.shield-badge svg {
    width: 32px;
    height: 32px;
}

.login-card h2 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 6px;
}
.login-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.btn-passkey {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.25), rgba(59, 130, 246, 0.25));
    border: 1px solid rgba(6, 182, 212, 0.5);
    border-radius: 12px;
    color: #fff;
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.3);
    transition: all 0.25s ease;
    margin-bottom: 20px;
}
.btn-passkey:hover {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.35), rgba(59, 130, 246, 0.35));
    box-shadow: 0 6px 25px rgba(6, 182, 212, 0.45);
    transform: translateY(-1px);
}
.btn-passkey svg {
    width: 22px;
    height: 22px;
    color: var(--accent-cyan);
}

.divider {
    display: flex;
    align-items: center;
    margin: 18px 0;
    color: var(--text-dim);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1px;
}
.divider::before, .divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}
.divider span {
    padding: 0 12px;
}

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

.input-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
}
.input-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}
.input-group input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: #fff;
    font-family: var(--font-mono);
    font-size: 1rem;
    outline: none;
    transition: all 0.2s ease;
}
.input-group input:focus {
    border-color: var(--primary-emerald);
    box-shadow: 0 0 12px var(--emerald-glow);
    background: rgba(255, 255, 255, 0.08);
}

.btn-primary {
    padding: 14px;
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px var(--emerald-glow);
    transition: all 0.2s ease;
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--emerald-glow);
}

.btn-secondary {
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: var(--glass-border-hover);
}

.error-banner {
    padding: 10px 14px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #fca5a5;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.hidden {
    display: none !important;
}

.login-footer {
    margin-top: 24px;
    font-size: 0.75rem;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.settings-sections {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 24px;
}

.settings-box {
    padding: 18px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.settings-box h3 {
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-emerald);
}
.settings-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.passkeys-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}
.passkey-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    font-size: 0.82rem;
}
.passkey-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}
.passkey-date {
    font-size: 0.7rem;
    color: var(--text-dim);
}

/* QR Code Box Styling */
.qr-image-box {
    margin: 12px auto;
    padding: 12px;
    background: #ffffff;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 224px;
    height: 224px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    border: 2px solid var(--primary-emerald);
}
.qr-image-box img {
    width: 200px;
    height: 200px;
    display: block;
    border-radius: 8px;
}

.totp-secret-box {
    padding: 10px 14px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px dashed rgba(16, 185, 129, 0.4);
    border-radius: 8px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.totp-secret-box code {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--primary-emerald);
    font-size: 1.05rem;
    letter-spacing: 2px;
}

.totp-qr-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 10px;
}

/* Dashboard Layout */
.dashboard-layout {
    max-width: 1320px;
    margin: 0 auto;
    padding: 24px 20px 60px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.navbar {
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}
.logo-box {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(6, 182, 212, 0.2));
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-emerald);
}
.brand h1 {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}
.vps-tag {
    font-size: 0.72rem;
    color: var(--primary-emerald);
    font-family: var(--font-mono);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.pulse-dot {
    width: 7px;
    height: 7px;
    background-color: var(--primary-emerald);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--primary-emerald);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-icon:hover {
    background: rgba(255, 255, 255, 0.12);
}
.btn-danger-icon:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: var(--danger-ruby);
}

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

.metric-card {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.metric-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.metric-title {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.metric-val {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.05rem;
    color: #fff;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.5s ease;
}
.fill-cpu { background: linear-gradient(90deg, #06b6d4, #3b82f6); }
.fill-ram { background: linear-gradient(90deg, #10b981, #059669); }
.fill-disk { background: linear-gradient(90deg, #f59e0b, #ec4899); }

.metric-sub {
    font-size: 0.75rem;
    color: var(--text-dim);
}

.filters-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.tab-btn {
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    transition: all 0.2s ease;
}
.tab-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}
.tab-btn.active {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
    color: var(--primary-emerald);
}
.badge {
    padding: 2px 7px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    font-size: 0.72rem;
    font-family: var(--font-mono);
}

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

.service-card {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    overflow: hidden;
}
.service-card.semi-disabled {
    opacity: 0.65;
    border-style: dashed;
}

.service-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.service-icon-box {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-cyan);
    flex-shrink: 0;
}

.service-meta {
    flex: 1;
}
.service-title {
    font-size: 0.98rem;
    font-weight: 700;
    margin-bottom: 2px;
    line-height: 1.3;
}
.service-name {
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--text-dim);
}

.status-badge {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: var(--font-mono);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.status-running {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--primary-emerald);
}
.status-stopped {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger-ruby);
}
.status-disabled {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--warning-amber);
}

.service-metrics {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 10px;
    font-size: 0.8rem;
    font-family: var(--font-mono);
}
.metric-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
}
.metric-item span {
    color: #fff;
    font-weight: 600;
}

.service-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.type-pill {
    font-size: 0.7rem;
    font-family: var(--font-mono);
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}
.toggle-label {
    font-size: 0.8rem;
    font-weight: 700;
}
.toggle-label.on { color: var(--primary-emerald); }
.toggle-label.off { color: var(--danger-ruby); }

.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: rgba(239, 68, 68, 0.3);
    border: 1px solid rgba(239, 68, 68, 0.5);
    border-radius: 999px;
    transition: .3s;
}
.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    border-radius: 50%;
    transition: .3s;
}
input:checked + .slider {
    background-color: rgba(16, 185, 129, 0.3);
    border-color: rgba(16, 185, 129, 0.6);
    box-shadow: 0 0 10px var(--emerald-glow);
}
input:checked + .slider:before {
    transform: translateX(22px);
    background-color: var(--primary-emerald);
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}
