:root {
    --bg: #07070b;
    --bg-soft: #0d0d14;
    --bg-card: #12121c;
    --bg-card-hover: #171724;
    --bg-input: #0a0a12;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);
    --text: #f5f5f7;
    --muted: #9ca0ad;
    --muted-2: #6f7584;
    --red: #e50914;
    --red-2: #ff3b4e;
    --red-soft: rgba(229, 9, 20, 0.14);
    --green: #22c55e;
    --green-soft: rgba(34, 197, 94, 0.14);
    --yellow: #f59e0b;
    --yellow-soft: rgba(245, 158, 11, 0.14);
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
    --radius: 16px;
    --radius-sm: 12px;
    --sidebar-width: 280px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: Inter, system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.admin-body { min-height: 100vh; }

.admin-shell {
    min-height: 100vh;
    display: flex;
    background:
        radial-gradient(circle at top left, rgba(229, 9, 20, 0.12), transparent 28%),
        radial-gradient(circle at top right, rgba(99, 102, 241, 0.08), transparent 24%),
        var(--bg);
}

.sidebar {
    width: var(--sidebar-width);
    background: rgba(10, 10, 16, 0.92);
    border-right: 1px solid var(--border);
    backdrop-filter: blur(18px);
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    transition: transform 0.25s ease;
}

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

.brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: linear-gradient(180deg, var(--red-2), var(--red));
    display: grid;
    place-items: center;
    box-shadow: 0 10px 30px rgba(229, 9, 20, 0.28);
}

.brand-mark svg {
    width: 22px;
    height: 22px;
    color: white;
}

.sidebar-brand strong {
    display: block;
    font-size: 1.02rem;
    font-weight: 700;
}

.sidebar-brand span {
    color: var(--muted);
    font-size: 0.82rem;
}

.sidebar-nav {
    padding: 18px 14px;
    flex: 1;
    overflow-y: auto;
}

.sidebar-section + .sidebar-section {
    margin-top: 18px;
}

.sidebar-section-title {
    display: block;
    padding: 0 12px 8px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted-2);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-weight: 500;
    transition: 0.2s ease;
    margin-bottom: 4px;
}

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

.sidebar-link.is-active {
    background: var(--red-soft);
    color: white;
    border: 1px solid rgba(229, 9, 20, 0.22);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.sidebar-icon {
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.sidebar-icon svg {
    width: 18px;
    height: 18px;
}

.sidebar-footer {
    padding: 16px 14px 20px;
    border-top: 1px solid var(--border);
}

.sidebar-link.subtle {
    font-size: 0.92rem;
}

.danger-text { color: #ff8f96 !important; }

.admin-main {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 28px;
    border-bottom: 1px solid var(--border);
    background: rgba(7, 7, 11, 0.82);
    backdrop-filter: blur(16px);
}

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

.topbar-title h1 {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 700;
}

.topbar-title p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.badge-online {
    background: var(--green-soft);
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.22);
}

.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
}

.topbar-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px 8px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.02);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, var(--red-2), var(--red));
    font-weight: 700;
}

.topbar-user-card strong {
    display: block;
    font-size: 0.9rem;
}

.topbar-user-card span {
    color: var(--muted);
    font-size: 0.78rem;
}

.admin-content {
    padding: 28px;
    flex: 1;
}

.admin-footer {
    padding: 18px 28px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.86rem;
}

.stats-grid,
.content-grid {
    display: grid;
    gap: 20px;
}

.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 24px;
}

.content-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card,
.stat-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: "";
    position: absolute;
    inset: auto -20px -20px auto;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: var(--red-soft);
}

.stat-label {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 800;
    margin-top: 8px;
}

.card-wide { grid-column: 1 / -1; }

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

.card-header h2,
.card-header h3,
.form-section h3 {
    margin: 0 0 6px;
    font-size: 1.15rem;
    font-weight: 700;
}

.card-header p {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.form-grid,
.form-sections,
.form-section {
    display: grid;
    gap: 14px;
}

.form-grid.two-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid .full,
.form-section .full {
    grid-column: 1 / -1;
}

label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 600;
}

input,
select,
textarea,
button {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    padding: 13px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--bg-input);
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(229, 9, 20, 0.55);
    box-shadow: 0 0 0 4px rgba(229, 9, 20, 0.12);
}

textarea {
    min-height: 140px;
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9rem;
}

.btn,
button.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border: none;
    border-radius: var(--radius-sm);
    background: linear-gradient(180deg, var(--red-2), var(--red));
    color: white;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(229, 9, 20, 0.22);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(229, 9, 20, 0.28);
}

.btn-secondary {
    background: #242433;
    box-shadow: none;
}

.btn-danger,
.btn-small.btn-danger {
    background: #8b1530;
    box-shadow: none;
}

.btn-small {
    padding: 8px 12px;
    font-size: 0.84rem;
}

.table-wrap {
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

th,
td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

th {
    background: rgba(255, 255, 255, 0.02);
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.015);
}

code,
pre {
    background: #0b0b12;
    border: 1px solid var(--border);
    border-radius: 10px;
}

code {
    padding: 3px 8px;
    font-size: 0.86rem;
}

pre {
    padding: 16px;
    overflow: auto;
    font-size: 0.88rem;
}

.table-actions,
.card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.status-pill {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.status-pill.ok {
    background: var(--green-soft);
    color: #86efac;
}

.status-pill.off {
    background: rgba(120, 120, 120, 0.14);
    color: #d1d5db;
}

.status-pill.warn {
    background: var(--yellow-soft);
    color: #fcd34d;
}

.alert {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    border: 1px solid rgba(229, 9, 20, 0.28);
    background: var(--red-soft);
    color: #ffb4ba;
    font-weight: 500;
}

.alert.success,
.alert.ok {
    border-color: rgba(34, 197, 94, 0.28);
    background: var(--green-soft);
    color: #bbf7d0;
}

.alert.error {
    border-color: rgba(229, 9, 20, 0.28);
}

.method-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.method-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 18px;
    display: grid;
    gap: 6px;
    background: rgba(255,255,255,0.02);
}

.method-item.enabled {
    border-color: rgba(229, 9, 20, 0.28);
    background: var(--red-soft);
}

.method-item.disabled { opacity: 0.55; }

.preview-login {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    min-height: 220px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.preview-left {
    padding: 24px;
    background: linear-gradient(90deg, #2a0810, #12080d 55%, #050505);
}

.preview-right { background: #050505; }

.preview-tabs {
    display: flex;
    gap: 8px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.preview-tabs span {
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.82rem;
}

.api-block {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.checkbox-line {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    color: var(--text);
}

.inline-activate-form {
    display: grid;
    gap: 8px;
    min-width: 260px;
}

.icon-button,
.mobile-only { display: none; }

.sidebar-overlay { display: none; }

.auth-body {
    min-height: 100vh;
    background: var(--bg);
}

.auth-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
}

.auth-hero {
    position: relative;
    padding: 56px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background:
        radial-gradient(circle at 20% 20%, rgba(229, 9, 20, 0.22), transparent 30%),
        linear-gradient(135deg, #1a0508, #09090d 65%);
    overflow: hidden;
}

.auth-hero h1 {
    font-size: 3.2rem;
    margin: 0 0 14px;
    font-weight: 800;
}

.auth-hero p,
.auth-hero li {
    color: var(--muted);
    line-height: 1.7;
    max-width: 520px;
}

.auth-hero ul {
    padding-left: 18px;
    margin-top: 24px;
}

.auth-panel {
    display: grid;
    place-items: center;
    padding: 32px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 32px;
    box-shadow: var(--shadow);
}

.auth-card h2 {
    margin: 0 0 8px;
    font-size: 1.6rem;
}

.auth-card p {
    color: var(--muted);
    margin-top: 0;
}

@media (max-width: 1200px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .content-grid,
    .form-grid.two-cols,
    .method-grid,
    .auth-layout,
    .preview-login { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.is-open { transform: translateX(0); }
    .sidebar-overlay.is-visible {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.55);
        z-index: 35;
    }
    .admin-main { margin-left: 0; width: 100%; }
    .mobile-only { display: inline-flex; }
    .icon-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        border-radius: 12px;
        border: 1px solid var(--border);
        background: rgba(255,255,255,0.03);
        color: var(--text);
    }
    .icon-button svg { width: 20px; height: 20px; }
    .admin-content,
    .admin-footer,
    .topbar { padding-left: 18px; padding-right: 18px; }
}

body.modal-open { overflow: hidden; }

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(6px);
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 24px;
}

.modal-overlay[hidden] { display: none !important; }

.modal-card {
    width: min(560px, 100%);
    max-height: 90vh;
    overflow: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 24px;
}

.modal-card.modal-wide { width: min(760px, 100%); }

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

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.modal-close {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    font-size: 1.4rem;
    cursor: pointer;
}

.modal-body { display: grid; gap: 12px; }

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

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 8px;
}

.detail-grid span {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    margin-bottom: 4px;
}

.detail-grid strong {
    display: block;
    word-break: break-all;
}

@media (max-width: 700px) {
    .detail-grid { grid-template-columns: 1fr; }
}

.support-preview {
    display: inline-flex;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.03);
}

.support-preview-image {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
}

.hint-list {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
    line-height: 1.7;
}

/* ===== Premium responsive refresh ===== */
:root {
    --bg: #050812;
    --bg-soft: #0a1020;
    --bg-card: #101727;
    --bg-card-hover: #151f34;
    --bg-input: #09101f;
    --border: rgba(151, 167, 205, 0.12);
    --border-strong: rgba(151, 167, 205, 0.22);
    --text: #f7f9ff;
    --muted: #9aa8c3;
    --muted-2: #65738d;
    --red: #e72b3f;
    --red-2: #ff5264;
    --red-soft: rgba(231, 43, 63, 0.14);
    --blue-soft: rgba(65, 105, 225, 0.14);
    --shadow: 0 22px 60px rgba(0, 0, 0, 0.32);
    --sidebar-width: 268px;
}

.admin-shell {
    background:
        radial-gradient(circle at 5% 0%, rgba(231, 43, 63, 0.11), transparent 26%),
        radial-gradient(circle at 90% 0%, rgba(59, 91, 198, 0.13), transparent 28%),
        linear-gradient(160deg, #050812, #070b16 60%, #050710);
}

.sidebar {
    background:
        linear-gradient(180deg, rgba(14, 21, 38, 0.98), rgba(7, 11, 21, 0.98));
    border-right-color: rgba(164, 180, 221, 0.12);
    box-shadow: 18px 0 50px rgba(0, 0, 0, 0.2);
}

.sidebar-brand {
    min-height: 86px;
    padding: 20px 18px;
    background: linear-gradient(135deg, rgba(255,255,255,0.035), transparent);
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    background: linear-gradient(145deg, #ff5366, #bb1428);
    box-shadow: 0 13px 28px rgba(231, 43, 63, 0.3), inset 0 1px 0 rgba(255,255,255,.35);
}

.sidebar-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 14px 0;
    padding: 11px 12px;
    border: 1px solid rgba(65, 204, 129, 0.17);
    border-radius: 13px;
    background: rgba(34, 197, 94, 0.07);
}

.sidebar-status > span {
    width: 9px;
    height: 9px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #29d47b;
    box-shadow: 0 0 0 5px rgba(41, 212, 123, 0.11), 0 0 16px rgba(41, 212, 123, 0.5);
}

.sidebar-status strong,
.sidebar-status small { display: block; }
.sidebar-status strong { font-size: .78rem; }
.sidebar-status small { color: var(--muted); font-size: .68rem; margin-top: 1px; }

.sidebar-nav { padding: 14px 12px 18px; }
.sidebar-section + .sidebar-section { margin-top: 14px; }
.sidebar-section-title { padding: 0 11px 7px; font-size: .66rem; }

.sidebar-link {
    position: relative;
    min-height: 44px;
    gap: 11px;
    margin-bottom: 5px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: .89rem;
    overflow: hidden;
}

.sidebar-link::before {
    content: "";
    position: absolute;
    inset: 6px auto 6px 0;
    width: 3px;
    border-radius: 0 5px 5px 0;
    background: transparent;
}

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

.sidebar-link.is-active {
    background: linear-gradient(90deg, rgba(231, 43, 63, 0.18), rgba(231, 43, 63, 0.07));
    border-color: rgba(244, 73, 93, 0.2);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.035), 0 8px 20px rgba(0,0,0,.15);
}

.sidebar-link.is-active::before { background: linear-gradient(180deg, #ff6677, #d91b33); }
.sidebar-link.is-active .sidebar-icon { color: #ff8491; }
.sidebar-icon { width: 22px; height: 22px; border-radius: 7px; }
.sidebar-icon svg { width: 19px; height: 19px; }
.sidebar-footer { background: rgba(0,0,0,.12); }

.topbar {
    min-height: 78px;
    padding: 16px 26px;
    background: rgba(5, 8, 18, 0.83);
    border-bottom-color: rgba(151, 167, 205, 0.12);
}

.topbar-title h1 { font-size: 1.32rem; letter-spacing: -.025em; }
.topbar-title p { font-size: .84rem; }

.admin-content {
    width: 100%;
    max-width: 1660px;
    margin: 0 auto;
    padding: 24px 26px 30px;
}

.card,
.stat-card {
    background:
        linear-gradient(145deg, rgba(255,255,255,.035), rgba(255,255,255,.012)),
        var(--bg-card);
    border-color: rgba(151, 167, 205, 0.12);
    box-shadow: 0 16px 45px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255,255,255,.025);
}

.card { padding: 20px; }
.card:hover { border-color: rgba(151, 167, 205, 0.19); }
.card-header { margin-bottom: 16px; }
.card-header-split { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }

.btn,
button.btn {
    min-height: 42px;
    padding: 10px 16px;
    border-radius: 11px;
    border: 1px solid rgba(255,255,255,.08);
    background: linear-gradient(145deg, #f3485c, #c9162c);
    box-shadow: 0 10px 22px rgba(218, 28, 51, .18), inset 0 1px 0 rgba(255,255,255,.25);
    transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.08); box-shadow: 0 13px 28px rgba(218, 28, 51, .24); }
.btn:active { transform: translateY(0); }
.btn-secondary { background: linear-gradient(145deg, rgba(255,255,255,.08), rgba(255,255,255,.035)); box-shadow: none; }
.btn-danger { background: linear-gradient(145deg, #d93045, #941126); }
.btn-small { min-height: 34px; padding: 7px 10px; border-radius: 9px; font-size: .78rem; }
.btn-premium { min-width: 220px; }

.dashboard-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    padding: 2px 2px 0;
}
.dashboard-hero h2 { margin: 3px 0 3px; font-size: 1.35rem; }
.dashboard-hero p { margin: 0; color: var(--muted); }
.eyebrow { color: #ff7c8b; text-transform: uppercase; letter-spacing: .12em; font-size: .68rem; font-weight: 800; }
.live-indicator { display: flex; align-items: center; gap: 11px; padding: 10px 14px; border: 1px solid rgba(41,212,123,.16); border-radius: 13px; background: rgba(41,212,123,.055); }
.live-indicator strong, .live-indicator small { display: block; }
.live-indicator strong { font-size: .8rem; }
.live-indicator small { color: var(--muted); font-size: .7rem; margin-top: 1px; }
.live-pulse { width: 10px; height: 10px; border-radius: 50%; background: #2bd47e; box-shadow: 0 0 0 0 rgba(43,212,126,.35); animation: livePulse 2s infinite; }
@keyframes livePulse { 70% { box-shadow: 0 0 0 9px rgba(43,212,126,0); } 100% { box-shadow: 0 0 0 0 rgba(43,212,126,0); } }

.stats-grid-compact {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 13px;
    margin-bottom: 18px;
}

.stat-card-compact {
    min-height: 94px;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 15px;
    border-radius: 14px;
}
.stat-card-compact::after { width: 58px; height: 58px; opacity: .55; }
.stat-card-compact.featured { border-color: rgba(255, 73, 94, .28); background: linear-gradient(145deg, rgba(231,43,63,.13), rgba(255,255,255,.015)), var(--bg-card); }
.stat-card-compact.online-card { border-color: rgba(41,212,126,.19); }
.stat-icon { position: relative; z-index: 1; width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; border-radius: 11px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.07); color: #cbd5ee; font-size: .65rem; font-weight: 800; letter-spacing: .04em; }
.stat-card-compact .stat-label { display: block; font-size: .75rem; }
.stat-card-compact .stat-value { position: relative; z-index: 1; display: block; margin-top: 2px; font-size: 1.75rem; line-height: 1; }

.dashboard-content-grid { grid-template-columns: 1.25fr .75fr; gap: 16px; }
.compact-table table { min-width: 620px; }
.compact-table th, .compact-table td { padding: 11px 12px; }
.monitor-note { margin: 13px 0 0; color: var(--muted); font-size: .78rem; line-height: 1.55; }

.quick-actions-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quick-action { min-height: 86px; display: flex; flex-direction: column; justify-content: center; padding: 14px; border: 1px solid var(--border); border-radius: 13px; background: rgba(255,255,255,.025); transition: .18s ease; }
.quick-action:hover { transform: translateY(-2px); border-color: rgba(244,73,93,.28); background: rgba(231,43,63,.07); }
.quick-action strong { font-size: .87rem; }
.quick-action span { margin-top: 4px; color: var(--muted); font-size: .72rem; }

.server-mini-list { display: grid; gap: 8px; margin-bottom: 15px; }
.server-mini-list > div { display: grid; grid-template-columns: 9px minmax(100px,.45fr) 1fr; align-items: center; gap: 9px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 11px; background: rgba(255,255,255,.02); }
.server-mini-list strong { font-size: .8rem; }
.server-mini-list code { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-status-dot { width: 8px; height: 8px; border-radius: 50%; background: #6b7280; }
.server-status-dot.active { background: #2bd47e; box-shadow: 0 0 10px rgba(43,212,126,.45); }

/* Bulk DNS */
.bulk-dns-card { overflow: hidden; }
.dns-swap-grid { display: grid; grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr); align-items: stretch; gap: 14px; }
.dns-swap-panel { position: relative; padding: 19px; border: 1px solid var(--border); border-radius: 15px; background: rgba(255,255,255,.023); }
.dns-swap-panel.source { border-color: rgba(245,158,11,.18); }
.dns-swap-panel.target { border-color: rgba(41,212,126,.19); }
.dns-swap-panel h3 { margin: 0 0 14px 36px; font-size: 1rem; }
.dns-step { position: absolute; top: 16px; left: 16px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; background: rgba(255,255,255,.07); font-size: .76rem; font-weight: 800; }
.dns-swap-arrow { display: grid; place-items: center; font-size: 1.8rem; color: #ff7181; }
.scope-section { padding-top: 6px; }
.scope-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; }
.scope-option { display: flex; align-items: flex-start; gap: 9px; margin: 0; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: rgba(255,255,255,.022); color: var(--text); cursor: pointer; }
.scope-option:hover { border-color: rgba(244,73,93,.25); }
.scope-option input { width: auto; margin-top: 3px; accent-color: var(--red); }
.scope-option strong, .scope-option small { display: block; }
.scope-option strong { font-size: .79rem; }
.scope-option small { margin-top: 3px; color: var(--muted); font-size: .67rem; line-height: 1.35; }
.confirm-box { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 13px 14px; border: 1px solid rgba(245,158,11,.18); border-radius: 12px; background: rgba(245,158,11,.055); color: #e8decb; }
.confirm-box input { width: auto; margin-top: 3px; accent-color: var(--red); }
.confirm-box span { font-size: .8rem; }

.table-wrap { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
th { background: rgba(255,255,255,.025); }
input, select, textarea { background: rgba(5,9,19,.8); }
input:focus, select:focus, textarea:focus { border-color: rgba(244,73,93,.5); box-shadow: 0 0 0 4px rgba(231,43,63,.09); }

@media (max-width: 1360px) {
    .stats-grid-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .scope-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
    .dashboard-content-grid { grid-template-columns: 1fr; }
    .stats-grid-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dns-swap-grid { grid-template-columns: 1fr; }
    .dns-swap-arrow { transform: rotate(90deg); min-height: 28px; }
}

@media (max-width: 900px) {
    .sidebar { width: min(88vw, 304px); }
    .topbar { min-height: 70px; padding-top: 13px; padding-bottom: 13px; }
    .topbar-title p { display: none; }
    .topbar-user-card { padding-right: 8px; }
    .topbar-user-card > div:last-child { display: none; }
    .admin-content { padding-top: 18px; }
    .dashboard-hero { align-items: flex-start; }
    .dashboard-hero p { font-size: .8rem; }
}

@media (max-width: 700px) {
    .admin-content { padding: 15px 13px 24px; }
    .topbar, .admin-footer { padding-left: 13px; padding-right: 13px; }
    .topbar-actions { gap: 7px; }
    .badge { padding: 7px 9px; font-size: .72rem; }
    .dashboard-hero { display: grid; }
    .live-indicator { justify-self: stretch; }
    .stats-grid-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
    .stat-card-compact { min-height: 82px; padding: 12px; gap: 9px; }
    .stat-icon { width: 34px; height: 34px; flex-basis: 34px; font-size: .57rem; }
    .stat-card-compact .stat-value { font-size: 1.42rem; }
    .stat-card-compact .stat-label { font-size: .66rem; }
    .card { padding: 16px; border-radius: 14px; }
    .card-header-split { display: grid; }
    .quick-actions-grid { grid-template-columns: 1fr; }
    .scope-grid { grid-template-columns: 1fr; }
    .server-mini-list > div { grid-template-columns: 9px 1fr; }
    .server-mini-list code { grid-column: 2; }
    .modal-overlay { padding: 10px; }
    .modal-card { padding: 17px; border-radius: 15px; }
    .modal-actions { flex-wrap: wrap; }
    .modal-actions .btn { flex: 1; }
}

@media (max-width: 430px) {
    .stats-grid-compact { grid-template-columns: 1fr 1fr; }
    .stat-card-compact:nth-child(5) { grid-column: 1 / -1; }
    .badge-online { display: none; }
    .topbar-title h1 { font-size: 1.12rem; }
    .auth-card { padding: 23px 19px; }
}

/* ===== Dashboard + sidebar precision alignment V2.1 ===== */
.sidebar-brand > div:last-child,
.sidebar-status > div,
.sidebar-link-text,
.stat-card-copy,
.quick-action-copy {
    min-width: 0;
}

.sidebar-brand > div:last-child {
    flex: 1;
}

.sidebar-brand strong,
.sidebar-brand span,
.sidebar-status strong,
.sidebar-status small,
.sidebar-link-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.sidebar-section {
    width: 100%;
}

.sidebar-link {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 18px;
    align-items: center;
    column-gap: 11px;
    width: 100%;
    min-height: 52px;
    padding: 7px 10px;
    border-radius: 14px;
    color: #aeb9cf;
}

.sidebar-link::before {
    inset: 9px auto 9px 0;
}

.sidebar-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: #8998b7;
    background: linear-gradient(145deg, rgba(255,255,255,.055), rgba(255,255,255,.018));
    border: 1px solid rgba(255,255,255,.055);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
    transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease;
}

.sidebar-icon svg {
    width: 19px;
    height: 19px;
}

.sidebar-link-text {
    display: block;
    font-size: .86rem;
    font-weight: 650;
    letter-spacing: -.01em;
}

.sidebar-chevron {
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    color: #56637d;
    opacity: .7;
    transition: transform .18s ease, color .18s ease, opacity .18s ease;
}

.sidebar-chevron svg {
    width: 15px;
    height: 15px;
}

.sidebar-link:hover {
    transform: none;
    background: linear-gradient(90deg, rgba(255,255,255,.055), rgba(255,255,255,.025));
    border-color: rgba(151,167,205,.12);
    color: #f7f9ff;
}

.sidebar-link:hover .sidebar-icon {
    color: #ffffff;
    transform: translateY(-1px);
    background: linear-gradient(145deg, rgba(255,255,255,.09), rgba(255,255,255,.035));
    border-color: rgba(255,255,255,.1);
}

.sidebar-link:hover .sidebar-chevron {
    color: #ffffff;
    opacity: 1;
    transform: translateX(2px);
}

.sidebar-link.is-active {
    color: #ffffff;
    background:
        linear-gradient(90deg, rgba(231,43,63,.22), rgba(231,43,63,.07)),
        linear-gradient(145deg, rgba(255,255,255,.035), rgba(255,255,255,.01));
    border-color: rgba(255,82,100,.24);
    box-shadow: 0 10px 24px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.05);
}

.sidebar-link.is-active .sidebar-icon {
    color: #ffffff;
    background: linear-gradient(145deg, #ff5b6d, #c3172d);
    border-color: rgba(255,255,255,.15);
    box-shadow: 0 9px 20px rgba(213,25,48,.24), inset 0 1px 0 rgba(255,255,255,.28);
}

.sidebar-link.is-active .sidebar-chevron {
    color: #ff9ba6;
    opacity: 1;
}

.sidebar-footer .sidebar-link {
    min-height: 48px;
}

.sidebar-domain {
    font-size: .76rem;
}

.danger-text .sidebar-icon {
    color: #ff8f9b;
    background: rgba(231,43,63,.06);
}

.stats-grid-compact {
    align-items: stretch;
}

.stat-card-compact {
    height: 100%;
    min-width: 0;
    isolation: isolate;
}

.stat-card-compact > * {
    position: relative;
    z-index: 2;
}

.stat-card-compact .stat-icon {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
    color: #b8c6e3;
    background: linear-gradient(145deg, rgba(255,255,255,.075), rgba(255,255,255,.025));
}

.stat-card-compact .stat-icon svg {
    width: 21px;
    height: 21px;
}

.stat-card-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-card-compact .stat-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-card-compact.featured .stat-icon {
    color: #ffffff;
    background: linear-gradient(145deg, #ff596b, #c8182e);
    border-color: rgba(255,255,255,.15);
    box-shadow: 0 10px 24px rgba(213,25,48,.2);
}

.stat-card-compact.online-card .stat-icon {
    color: #a7f3d0;
    background: linear-gradient(145deg, rgba(43,212,126,.2), rgba(43,212,126,.07));
    border-color: rgba(43,212,126,.2);
}

.dashboard-content-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-flow: row dense;
    align-items: stretch;
}

.dashboard-card {
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.activity-card {
    grid-column: span 8;
}

.quick-actions-card {
    grid-column: span 4;
}

.login-methods-card,
.servers-card {
    grid-column: span 6;
}

.dashboard-card .card-actions {
    margin-top: auto;
    padding-top: 16px;
}

.activity-card .table-wrap {
    flex: 1;
}

.quick-actions-grid {
    grid-template-columns: 1fr;
    align-content: start;
}

.quick-action {
    min-height: 74px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 22px;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    overflow: hidden;
    background: linear-gradient(145deg, rgba(255,255,255,.045), rgba(255,255,255,.015));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}

.quick-action-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #d8e0f2;
    background: linear-gradient(145deg, rgba(255,255,255,.08), rgba(255,255,255,.025));
    border: 1px solid rgba(255,255,255,.07);
    transition: transform .18s ease, color .18s ease, background .18s ease;
}

.quick-action-icon svg,
.quick-action-arrow svg {
    width: 20px;
    height: 20px;
}

.quick-action-copy strong,
.quick-action-copy small {
    display: block;
}

.quick-action-copy strong {
    color: #f7f9ff;
    font-size: .84rem;
    line-height: 1.25;
}

.quick-action-copy small {
    margin-top: 4px;
    color: var(--muted);
    font-size: .69rem;
    line-height: 1.35;
}

.quick-action-arrow {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    color: #697792;
    transition: transform .18s ease, color .18s ease;
}

.quick-action:hover {
    transform: translateY(-1px);
    border-color: rgba(244,73,93,.25);
    background: linear-gradient(145deg, rgba(231,43,63,.11), rgba(255,255,255,.018));
    box-shadow: 0 10px 24px rgba(0,0,0,.13), inset 0 1px 0 rgba(255,255,255,.035);
}

.quick-action:hover .quick-action-icon {
    color: #ffffff;
    transform: scale(1.03);
    background: linear-gradient(145deg, #f34a5e, #bd152a);
}

.quick-action:hover .quick-action-arrow {
    color: #ff7d8b;
    transform: translateX(3px);
}

.method-grid {
    align-items: stretch;
}

.method-item {
    min-height: 112px;
    align-content: start;
}

.server-mini-list {
    flex: 1;
}

.btn,
button.btn {
    position: relative;
    overflow: hidden;
    letter-spacing: -.01em;
}

.btn::after,
button.btn::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(120deg, transparent 15%, rgba(255,255,255,.14) 45%, transparent 72%);
    transform: translateX(-135%);
    transition: transform .5s ease;
}

.btn:hover::after,
button.btn:hover::after {
    transform: translateX(135%);
}

@media (max-width: 1280px) {
    .activity-card,
    .quick-actions-card {
        grid-column: span 12;
    }

    .quick-actions-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .sidebar-link {
        min-height: 54px;
    }

    .dashboard-content-grid {
        grid-template-columns: 1fr;
    }

    .activity-card,
    .quick-actions-card,
    .login-methods-card,
    .servers-card {
        grid-column: 1;
    }
}

@media (max-width: 700px) {
    .quick-actions-grid {
        grid-template-columns: 1fr;
    }

    .quick-action {
        min-height: 70px;
    }
}


/* ===== Automatic device detection + pending activation V2.2 ===== */
.stats-grid-compact { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.stat-card-pending { border-color: rgba(245,158,11,.22); }
.stat-card-pending .stat-icon { color: #ffd38a; background: linear-gradient(145deg, rgba(245,158,11,.17), rgba(245,158,11,.04)); border-color: rgba(245,158,11,.2); }
.sidebar-badge { min-width: 22px; height: 22px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 999px; color: #fff4da; background: linear-gradient(145deg, #f59e0b, #b96806); border: 1px solid rgba(255,255,255,.12); box-shadow: 0 7px 16px rgba(245,158,11,.18); font-size: .67rem; font-weight: 900; }
.sidebar-link.is-active .sidebar-badge { background: rgba(255,255,255,.16); box-shadow: none; }
.pending-hero { align-items: center; }
.pending-total { min-width: 112px; padding: 13px 17px; display: grid; place-items: center; border: 1px solid rgba(245,158,11,.2); border-radius: 15px; background: linear-gradient(145deg, rgba(245,158,11,.12), rgba(255,255,255,.02)); }
.pending-total strong { font-size: 1.7rem; line-height: 1; }
.pending-total span { margin-top: 4px; color: var(--muted); font-size: .72rem; }
.pending-device-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.pending-device-card { position: relative; overflow: hidden; }
.pending-device-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: linear-gradient(#f7b84b, #d5780b); }
.pending-device-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 16px; }
.pending-device-top h3 { margin: 10px 0 3px; font-size: 1rem; }
.pending-device-top p { margin: 0; color: var(--muted); font-size: .76rem; }
.copy-code-button { min-width: 154px; padding: 10px 12px; border: 1px solid rgba(245,158,11,.22); border-radius: 12px; color: #fff; background: linear-gradient(145deg, rgba(245,158,11,.13), rgba(255,255,255,.025)); cursor: pointer; text-align: left; transition: .18s ease; }
.copy-code-button:hover { transform: translateY(-1px); border-color: rgba(245,158,11,.42); }
.copy-code-button span, .copy-code-button strong { display: block; }
.copy-code-button span { color: #f7c66c; font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.copy-code-button strong { margin-top: 4px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .84rem; letter-spacing: .04em; }
.copy-code-button.is-copied { border-color: rgba(43,212,126,.35); background: rgba(43,212,126,.09); }
.device-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 0 0 17px; }
.device-details > div { min-width: 0; padding: 10px 11px; border: 1px solid var(--border); border-radius: 11px; background: rgba(255,255,255,.02); }
.device-details dt { color: var(--muted); font-size: .65rem; }
.device-details dd { min-width: 0; margin: 4px 0 0; color: #eef3ff; font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pending-activation-form { display: grid; gap: 9px; padding-top: 15px; border-top: 1px solid var(--border); }
.pending-activation-form textarea { min-height: 116px; resize: vertical; }
.pending-card-actions { display: flex; justify-content: flex-end; margin-top: 3px; }
.pending-delete-form { display: flex; justify-content: flex-end; margin-top: 9px; }
.empty-pending-card { max-width: 680px; margin: 30px auto; text-align: center; }
.empty-pending-icon { width: 54px; height: 54px; margin: 0 auto 13px; display: grid; place-items: center; border-radius: 50%; color: #bdf6d6; background: rgba(43,212,126,.1); border: 1px solid rgba(43,212,126,.2); font-size: 1.3rem; }
.empty-pending-card h2 { margin: 0 0 7px; }
.empty-pending-card p { max-width: 520px; margin: 0 auto 17px; color: var(--muted); line-height: 1.55; }
@media (max-width: 1500px) { .stats-grid-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .pending-device-grid { grid-template-columns: 1fr; } }
@media (max-width: 700px) {
    .stats-grid-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pending-device-top { display: grid; }
    .copy-code-button { width: 100%; min-width: 0; }
    .device-details { grid-template-columns: 1fr; }
    .pending-total { width: 100%; }
}
@media (max-width: 430px) {
    .stat-card-compact:nth-child(5) { grid-column: auto; }
    .stat-card-compact:nth-child(6) { grid-column: 1 / -1; }
}
