/* ═══════════════ AmneziaVPN Dark Theme ═══════════════ */

body {
    background: #0d1117;
    color: #e6edf3;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
}

/* ─── Logo ─── */
.logo-text {
    font-weight: 700;
    letter-spacing: -0.3px;
    color: #e6edf3;
}
.logo-text span { color: #4f8ef7; }
.shield-icon { color: #4f8ef7; font-size: 2.5rem; }

/* ─── Navbar ─── */
.navbar-custom {
    background: #161b22;
    border-bottom: 1px solid #30363d;
    padding: 8px 0;
}

/* ─── Sidebar ─── */
.sidebar {
    background: #161b22;
    border-right: 1px solid #30363d;
    min-height: calc(100vh - 50px);
    width: 220px;
    flex-shrink: 0;
}
.sidebar .offcanvas-body {
    flex-direction: column;
}
.section-title {
    color: #8b949e;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 0 20px;
    margin-bottom: 6px;
}
.nav-link-custom {
    color: #8b949e;
    padding: 8px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
}
.nav-link-custom:hover {
    background: #21262d;
    color: #e6edf3;
}
.nav-link-custom.active {
    background: #21262d;
    color: #4f8ef7;
    border-left-color: #4f8ef7;
}
.nav-link-custom i { width: 18px; text-align: center; }

/* ─── Auth card ─── */
.auth-card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
}
.tab-switcher {
    background: #0d1117;
    border-radius: 10px;
}
.tab-btn {
    border: none;
    background: none;
    color: #8b949e;
    padding: 8px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
}
.tab-btn.active {
    background: #21262d;
    color: #e6edf3;
    font-weight: 600;
}
.divider { color: #8b949e; font-size: 0.85rem; }
.text-muted-custom { color: #8b949e !important; }

/* ─── Forms ─── */
.form-control, .form-select {
    background: #0d1117;
    border-color: #30363d;
    color: #e6edf3;
}
.form-control:focus, .form-select:focus {
    background: #0d1117;
    border-color: #4f8ef7;
    color: #e6edf3;
    box-shadow: 0 0 0 3px rgba(79,142,247,0.15);
}
.form-control::placeholder { color: #484f58; }

/* ─── Buttons ─── */
.btn-primary { background: #4f8ef7; border-color: #4f8ef7; }
.btn-primary:hover { background: #3a7de8; border-color: #3a7de8; }
.btn-outline-secondary { border-color: #30363d; color: #8b949e; }
.btn-outline-secondary:hover { background: #21262d; border-color: #8b949e; color: #e6edf3; }

/* ─── Cards ─── */
.stat-card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 10px;
}
.stat-val { font-size: 1.8rem; font-weight: 700; color: #e6edf3; }
.stat-lbl { color: #8b949e; font-size: 0.8rem; }

.device-card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 10px;
    transition: border-color 0.2s;
}
.device-card:hover { border-color: #4f8ef7; }

.add-device-card {
    background: #161b22;
    border: 1px dashed #30363d;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.add-device-card:hover {
    border-color: #4f8ef7;
    background: rgba(79,142,247,0.05);
}

.settings-card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
}

/* ─── Badges ─── */
.badge-role-admin {
    background: rgba(248,81,73,0.15);
    color: #f85149;
    border: 1px solid rgba(248,81,73,0.3);
    font-size: 0.65rem;
    vertical-align: middle;
}
.badge-role-superuser {
    background: rgba(163,113,247,0.15);
    color: #a371f7;
    border: 1px solid rgba(163,113,247,0.3);
    font-size: 0.65rem;
    vertical-align: middle;
}
.badge-awg2 {
    background: rgba(79,142,247,0.15);
    color: #4f8ef7;
    border: 1px solid rgba(79,142,247,0.3);
}
.badge-awg1 {
    background: rgba(139,145,158,0.1);
    color: #8b949e;
    border: 1px solid #30363d;
}
.badge-approved {
    background: rgba(63,185,80,0.15);
    color: #3fb950;
    border: 1px solid rgba(63,185,80,0.3);
}
.badge-pending {
    background: rgba(210,153,34,0.15);
    color: #d2991f;
    border: 1px solid rgba(210,153,34,0.3);
}
.badge-blocked {
    background: rgba(248,81,73,0.1);
    color: #f85149;
    border: 1px solid rgba(248,81,73,0.2);
}
.badge-rejected { background: rgba(248,81,73,0.1); color: #f85149; }
.badge-pending-count {
    background: rgba(210,153,34,0.2);
    color: #d2991f;
    font-size: 0.7rem;
}

/* ─── Status dots ─── */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.status-online { background: #3fb950; }
.status-offline { background: #8b949e; }

/* ─── Traffic bar ─── */
.traffic-bar {
    height: 4px;
    background: #21262d;
    border-radius: 2px;
    overflow: hidden;
}
.traffic-fill {
    height: 100%;
    background: linear-gradient(90deg, #4f8ef7, #a371f7);
    border-radius: 2px;
}

/* ─── User avatar ─── */
.user-avatar-sm {
    width: 28px;
    height: 28px;
    background: #21262d;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #4f8ef7;
    flex-shrink: 0;
}

/* ─── Tables ─── */
.table-dark {
    --bs-table-bg: #161b22;
    --bs-table-border-color: #30363d;
}
.table-dark th {
    color: #8b949e;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-color: #30363d;
}
.table-dark td {
    color: #e6edf3;
    border-color: #21262d;
    font-size: 0.9rem;
    vertical-align: middle;
}

/* ─── Modals ─── */
.modal-content {
    background: #161b22;
    border: 1px solid #30363d;
}
.modal-header { border-bottom: 1px solid #30363d; }
.modal-footer { border-top: 1px solid #30363d; }

/* ─── QR ─── */
.qr-container {
    background: white;
    border-radius: 8px;
    padding: 12px;
    display: inline-block;
}

/* ─── Code display ─── */
.code-display {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    font-family: monospace;
    font-size: 2rem;
    letter-spacing: 8px;
    color: #4f8ef7;
    text-align: center;
    padding: 16px;
}

/* ─── Alerts ─── */
.pending-alert {
    background: rgba(210,153,34,0.1);
    border: 1px solid rgba(210,153,34,0.3);
    border-radius: 8px;
}
.linked-badge {
    background: rgba(63,185,80,0.15);
    border: 1px solid rgba(63,185,80,0.3);
    border-radius: 8px;
}
.not-linked-badge {
    background: rgba(139,145,158,0.08);
    border: 1px solid #30363d;
    border-radius: 8px;
}

/* ─── Dropdowns ─── */
.dropdown-menu {
    background: #21262d;
    border-color: #30363d;
}
.dropdown-item { color: #e6edf3; font-size: 0.9rem; }
.dropdown-item:hover { background: #30363d; color: #e6edf3; }
.dropdown-divider { border-color: #30363d; }

/* ─── HTMX indicator ─── */
.htmx-indicator {
    display: none;
}
.htmx-request .htmx-indicator {
    display: inline-block;
}

/* ─── Responsive ─── */
@media (max-width: 767.98px) {
    .sidebar { width: 260px; min-height: auto; }
    main { padding: 12px !important; }
}
