: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; }
[hidden] { display: none !important; }

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,
.brand-mark img {
    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;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.16) transparent;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 999px; }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(229,9,20,.55); }
.sidebar-close { margin-left: auto; width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 11px; background: rgba(255,255,255,.04); color: var(--text); font-size: 1.45rem; cursor: pointer; }

.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 {
    position: relative;
    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);
}
.brand-mark img { object-fit: contain; border-radius: 9px; }

.topbar-user-card { border: 1px solid var(--border); color: var(--text); cursor: pointer; text-align: left; }
.account-chevron { color: var(--muted); margin-left: 6px; }
.account-menu { position: absolute; right: 0; top: calc(100% + 10px); width: 240px; padding: 8px; border: 1px solid var(--border-strong); border-radius: 14px; background: #14141e; box-shadow: var(--shadow); z-index: 60; }
.account-menu-head { display: grid; padding: 10px 12px 13px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.account-menu-head span { color: var(--muted); font-size: .8rem; }
.account-menu a { display: block; padding: 10px 12px; border-radius: 9px; font-size: .9rem; }
.account-menu a:hover { background: rgba(255,255,255,.05); }

.page-stack { display: grid; gap: 18px; }
.page-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 4px 2px; }
.page-toolbar h2 { margin: 0 0 5px; font-size: 1.25rem; }
.page-toolbar p, .modal-header p { margin: 0; color: var(--muted); font-size: .9rem; }
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.search-field { position: relative; width: min(400px, 100%); margin: 0; }
.search-field input { padding-left: 42px; }
.search-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 1.3rem; z-index: 1; }
.result-count { color: var(--muted); font-size: .86rem; white-space: nowrap; }
.empty-state { padding: 42px 18px !important; color: var(--muted); text-align: center; }

.switch-line { display: flex; align-items: center; gap: 14px; padding: 15px; margin-bottom: 10px; border: 1px solid var(--border); border-radius: 13px; background: rgba(255,255,255,.018); cursor: pointer; }
.switch-line input { position: absolute; opacity: 0; pointer-events: none; }
.switch-control { width: 42px; height: 24px; border-radius: 999px; background: #373744; position: relative; flex: 0 0 auto; transition: .2s; }
.switch-control::after { content: ''; position: absolute; width: 18px; height: 18px; top: 3px; left: 3px; border-radius: 50%; background: white; transition: .2s; box-shadow: 0 2px 5px rgba(0,0,0,.35); }
.switch-line input:checked + .switch-control { background: var(--red); }
.switch-line input:checked + .switch-control::after { transform: translateX(18px); }
.switch-line > span:last-child { display: grid; }
.switch-line small { color: var(--muted); font-weight: 400; margin-top: 2px; }
.switch-line.compact { width: fit-content; padding: 10px 12px; }
.stats-grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.status-pill.expired { color: #ffb4b9; background: rgba(229,9,20,.16); }
.settings-layout { display: grid; grid-template-columns: minmax(0, 680px) minmax(240px, 340px); gap: 20px; align-items: start; }
.security-note { padding: 20px; border: 1px solid rgba(34,197,94,.22); border-radius: var(--radius); background: var(--green-soft); }
.security-note p { color: var(--muted); margin-bottom: 0; }
.horizontal-chart { display: grid; gap: 11px; }
.chart-row { display: grid; grid-template-columns: 42px 1fr 28px; align-items: center; gap: 10px; }
.chart-track { height: 10px; border-radius: 999px; background: rgba(255,255,255,.06); overflow: hidden; }
.chart-bar { height: 100%; min-width: 3px; border-radius: 999px; background: linear-gradient(90deg, var(--red), var(--red-2)); }
.chart-value { color: var(--text); font-size: .78rem; }
.chart-row small { color: var(--muted); font-size: .72rem; }
.server-grid, .plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.server-grid-scroll { max-height: 430px; overflow-y: auto; padding-right: 6px; scrollbar-color: var(--red) transparent; }
.server-card, .plan-card { border: 1px solid var(--border); border-radius: 15px; padding: 17px; background: rgba(255,255,255,.018); display: grid; gap: 15px; }
.server-card-head { display: flex; align-items: center; gap: 11px; }
.server-card-head > .status-pill { margin-left: auto; }
.server-card h3, .plan-card h3 { margin: 0; font-size: 1rem; }
.server-card-head span:not(.status-pill), .plan-card p { color: var(--muted); font-size: .8rem; margin: 2px 0 0; }
.server-icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--red-soft); color: #ff7a84; font-size: .68rem; font-weight: 800; }
.server-card code { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toolbar-actions, .compact-switches { display: flex; gap: 10px; flex-wrap: wrap; }
.workflow-strip { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.workflow-strip div { display: flex; align-items: center; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 13px; color: var(--muted); }
.workflow-strip strong { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--red-soft); color: #ff8f96; }
.plan-duration { font-size: 1.25rem; }
.settings-preview-grid { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(320px,.65fr); gap: 20px; align-items: start; }
.preview-sticky { position: sticky; top: 110px; }
.phone-preview { width: min(330px,100%); margin: auto; padding: 9px; border: 1px solid var(--border-strong); border-radius: 32px; background: #050505; }
.phone-screen { min-height: 560px; padding: 54px 24px 28px; border-radius: 25px; background: radial-gradient(circle at 50% 0,rgba(229,9,20,.18),transparent 30%),#080808; }
.phone-app-name { color: #ff4a57; font-weight: 800; }
.phone-screen h4 { font-size: 1.75rem; margin: 55px 0 5px; }.phone-screen p { color: var(--muted); min-height: 22px; }
.app-tabs { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; margin: 25px 0 18px; }.app-tabs button { padding: 11px; border: 1px solid #333; background:transparent;color:#aaa;border-radius: 9px; text-align: center; font-size: .8rem;cursor:pointer }.app-tabs button.active { border-color: var(--red); color: white; }
.app-field { padding: 14px 2px; margin-top: 8px; color: #aaa; border-bottom: 1px solid #444; }.app-primary-button { margin-top: 25px; padding: 14px; border-radius: 10px; background: #343434; text-align: center; font-weight: 700; }
.app-support-preview { padding: 25px 18px; border: 1px solid #3b3b3b; border-radius: 18px; background: #121212; text-align: center; display: grid; justify-items: center; gap: 12px; }.app-support-preview img,.support-avatar { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; }.support-avatar { display:grid;place-items:center;background:#333;font-weight:800}.fake-qr { width: 140px; height: 140px; display:grid;place-items:center;background:white;color:black;border-radius:10px}.fake-qr span{font-size:6rem;line-height:1}.app-support-preview p{color:#aaa;font-size:.82rem;margin:0;max-width:280px}
.chart-heading { display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-bottom:15px }.chart-heading h2{margin:0 0 5px}.chart-heading p{margin:0;color:var(--muted)}.chart-comparison{display:grid;text-align:right}.chart-comparison strong{font-size:1.8rem}.chart-comparison span{font-size:.78rem}.positive{color:#4ade80}.negative{color:#fb7185}.area-chart{height:230px}.area-chart svg{width:100%;height:190px;overflow:visible}.chart-labels{display:grid;grid-template-columns:repeat(7,1fr);color:var(--muted);font-size:.7rem;text-align:center}
.dns-id { display:inline-flex;padding:4px 7px;border-radius:7px;background:rgba(99,102,241,.14);color:#a5b4fc;font-weight:700;font-size:.74rem }
.action-cell{position:relative;width:50px}.action-menu{position:relative}.action-trigger{width:32px;height:32px;border:1px solid var(--border);border-radius:9px;background:rgba(255,255,255,.03);color:var(--text);cursor:pointer}.action-dropdown{display:none;position:absolute;right:0;top:30px;min-width:145px;padding:6px;border:1px solid var(--border-strong);border-radius:11px;background:#171721;box-shadow:var(--shadow);z-index:30}.action-menu:hover .action-dropdown,.action-menu:focus-within .action-dropdown{display:block}.action-dropdown button{display:block;width:100%;padding:9px 10px;border:0;border-radius:7px;background:transparent;color:var(--text);text-align:left;cursor:pointer}.action-dropdown button:hover{background:rgba(255,255,255,.06)}
.pagination{display:flex;justify-content:center;gap:6px;margin-top:18px}.pagination a{min-width:34px;height:34px;display:grid;place-items:center;border:1px solid var(--border);border-radius:9px;color:var(--muted)}.pagination a.active{background:var(--red);color:white;border-color:var(--red)}
.brand-upload-preview{display:flex;align-items:center;gap:16px;padding:14px;border:1px solid var(--border);border-radius:14px}.brand-upload-preview img{width:64px;height:64px;object-fit:contain;border-radius:15px}.brand-upload-preview small{display:block;color:var(--muted);margin-top:5px}.auth-logo{width:76px;height:76px;object-fit:contain;border-radius:20px;margin-bottom:20px}

@media (max-width: 760px) {
    .page-toolbar, .list-toolbar { align-items: stretch; flex-direction: column; }
    .page-toolbar .btn { width: 100%; }
    .settings-layout { grid-template-columns: 1fr; }
    .stats-grid-three { grid-template-columns: 1fr; }
    .topbar-title p, .badge-online, .topbar-user-card > div:not(.user-avatar), .account-chevron { display: none; }
    .topbar-user-card { padding: 5px; }
    .modal-overlay { padding: 12px; }
    .modal-card { padding: 18px; border-radius: 16px; }
    .server-grid, .plan-grid, .settings-preview-grid { grid-template-columns: 1fr; }
    .workflow-strip { grid-template-columns: 1fr; }
    .preview-sticky { position: static; }
    .form-grid.two-cols { grid-template-columns: 1fr; }
    .responsive-table table,.responsive-table tbody,.responsive-table tr,.responsive-table td{display:block;min-width:0;width:100%}.responsive-table thead{display:none}.responsive-table{overflow:visible;border:0}.responsive-table tr{margin-bottom:12px;padding:14px;border:1px solid var(--border);border-radius:14px;background:var(--bg-card)}.responsive-table td{display:grid;grid-template-columns:110px 1fr;gap:10px;padding:9px 0;border:0}.responsive-table td::before{content:attr(data-label);color:var(--muted);font-size:.78rem}.responsive-table .action-cell{display:block;text-align:right}.responsive-table .action-cell::before{display:none}.action-dropdown{right:0;top:auto;bottom:30px}.chart-heading{align-items:flex-start}.area-chart{height:200px}
}

.password-field {
    position: relative;
    width: 100%;
}

.password-field input {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    width: 36px;
    height: 36px;
    padding: 8px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transform: translateY(-50%);
}

.password-toggle:hover,
.password-toggle:focus-visible {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text);
    outline: none;
}

.password-toggle svg {
    display: block;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

body.security-warning-open { overflow: hidden; }
.security-warning-overlay { position: fixed; inset: 0; z-index: 99999; display: grid; place-items: center; padding: 20px; background: rgba(2, 3, 8, .88); backdrop-filter: blur(9px); }
.security-warning-modal { width: min(620px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; padding: 30px; border: 1px solid rgba(239,68,68,.55); border-radius: 22px; background: #17171f; box-shadow: 0 30px 90px rgba(0,0,0,.65), 0 0 0 1px rgba(239,68,68,.12); text-align: center; }
.security-warning-modal h2 { margin: 12px 0 16px; color: #fff; }
.security-warning-modal p { color: #c9cbd3; line-height: 1.65; text-align: left; }
.security-warning-modal strong { color: #fff; }
.security-warning-modal .warning-critical { color: #ef4444; font-weight: 900; }
.security-warning-icon { display: inline-grid; place-items: center; width: 58px; height: 58px; border-radius: 18px; background: rgba(239,68,68,.14); border: 1px solid rgba(239,68,68,.42); color: #fb7185; font-size: 32px; font-weight: 900; }
.security-warning-countdown { margin: 20px 0 14px; padding: 12px; border-radius: 12px; background: rgba(239,68,68,.09); color: #fca5a5; font-weight: 700; }
.security-warning-confirm { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 16px 0; color: #e5e7eb; }
.security-warning-confirm input { width: 18px; height: 18px; }
.security-warning-modal .btn { width: 100%; }
.security-warning-modal .btn:disabled { opacity: .38; cursor: not-allowed; }
.blocked-access-body { display: grid; place-items: center; padding: 20px; }
.blocked-access-card { width: min(500px, 100%); padding: 34px; border: 1px solid rgba(239,68,68,.4); border-radius: 24px; background: #17171f; box-shadow: 0 26px 80px rgba(0,0,0,.55); text-align: center; }
.blocked-access-card h1 { color: #fff; font-size: clamp(25px, 5vw, 36px); }
.blocked-access-card p { color: #aeb1bb; line-height: 1.6; }
.blocked-access-card #blockedCountdown { display: block; margin: 22px 0 8px; color: #fb7185; font-size: 30px; }
.blocked-access-note { font-size: 13px; }
.topbar-password-alert { display: inline-block; padding: 8px 11px; border: 1px solid #ef4444; border-radius: 9px; background: transparent; color: #ef4444; text-decoration: none; font-size: 12px; font-weight: 900; white-space: nowrap; }
.topbar-password-alert:hover { border-color: #f87171; color: #f87171; }
@media (max-width: 820px) { .topbar-password-alert { max-width: 145px; white-space: normal; text-align: right; font-size: 10px; line-height: 1.2; } }

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; }

/* O atributo hidden precisa vencer qualquer regra responsiva durante o
   primeiro frame, antes do JavaScript inicializar os modais. */
html body .modal-overlay[hidden] { display: none !important; visibility: hidden !important; }

.dashboard-system-row { margin-top: 18px; }
.dashboard-stats-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.system-status-list { display: grid; gap: 2px; }
.system-status-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 2px; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; }
.system-status-row:last-child { border-bottom: 0; }
.system-status-row > span { color: var(--muted); }
.dashboard-brand-preview { min-height: 112px; display: grid; place-items: center; padding: 14px; border: 1px solid var(--border); border-radius: 16px; background: rgba(0,0,0,.18); }
.dashboard-brand-preview img { display: block; max-width: 100%; width: min(280px, 88%); max-height: 110px; object-fit: contain; }
.brand-placeholder { color: var(--muted); }
.dashboard-support-summary { display: flex; align-items: center; gap: 13px; margin: 16px 0; }
.dashboard-support-summary img { width: 52px; height: 52px; object-fit: cover; border-radius: 14px; }
.dashboard-support-summary div { display: grid; gap: 3px; }
.dashboard-support-summary small, .dashboard-support-summary span { color: var(--muted); }

.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;
}

.status-text {
    display: block;
    margin-top: -6px;
    font-size: .82rem;
    font-weight: 600;
}

.status-text.success { color: #39d98a; }
.status-text.error { color: #ff6b72; }

.action-menu:not(.is-open) .action-dropdown { display: none !important; }
.action-menu.is-open .action-dropdown { display: block !important; }
.responsive-table table { min-width: 0; table-layout: fixed; }
.responsive-table th,
.responsive-table td { padding: 11px 10px; font-size: .83rem; }
.responsive-table th:nth-child(2),
.responsive-table td:nth-child(2) { width: 14%; }
.responsive-table th:last-child,
.responsive-table td:last-child { width: 48px; }
.fake-qr img { width: 132px !important; height: 132px !important; border-radius: 4px !important; }
.remove-logo { display:flex;align-items:center;gap:8px;margin-top:10px;color:var(--muted);font-weight:500 }.remove-logo input{width:auto}
.settings-layout { grid-template-columns: minmax(0, 760px); }
.support-switch { max-width: 520px; margin-bottom: 18px; }
.dashboard-chart-canvas { position: relative; width: 100%; height: 310px; }
.auth-logo { display:block; width:min(540px,88%); height:auto; max-height:310px; object-fit:contain; object-position:left center; border-radius:18px; margin:0 0 30px; filter:drop-shadow(0 18px 38px rgba(0,0,0,.38)); }
.chart-summary { display: flex; align-items: center; gap: 22px; }
.chart-periods { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 11px; background: rgba(0,0,0,.22); }
.chart-periods button { padding: 7px 11px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: .72rem; font-weight: 800; cursor: pointer; }
.chart-periods button.active { color: white; background: var(--red); box-shadow: 0 6px 14px rgba(229,9,20,.2); }
@media (max-width: 700px) {
    .chart-heading,.chart-summary { flex-direction: column; align-items: stretch; }
    .chart-comparison { text-align: left; }
    .chart-periods button { flex: 1; }
    .dashboard-chart-canvas { height: 260px; }
    .auth-logo { width:min(420px,100%); margin-bottom:22px; }
}

@media (max-width: 900px) {
    .sidebar { width: min(86vw, 320px); box-shadow: 22px 0 60px rgba(0,0,0,.5); }
    .sidebar-brand { justify-content: space-between; }
    .sidebar-brand .brand-mark { width: 128px; height: 64px; }
    .sidebar-nav { padding-bottom: 90px; }
}
.sidebar-brand { justify-content: center; padding: 22px 18px; }
.brand-mark { width: 150px; height: 76px; background: transparent; box-shadow: none; border-radius: 0; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; border-radius: 0; }
.brand-upload-preview { align-items: flex-start; padding: 20px; }
.brand-upload-preview img { width: 140px; height: 110px; border-radius: 12px; background: rgba(255,255,255,.025); padding: 8px; }
.user-actions-card { width: min(440px,100%); }
.user-action-list { display: grid; gap: 10px; }
.user-action-list form { margin: 0; }
.user-action-button { width: 100%; display: flex; align-items: center; gap: 13px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: rgba(255,255,255,.025); color: var(--text); text-align: left; cursor: pointer; }
.user-action-button:hover { border-color: rgba(229,9,20,.35); background: var(--red-soft); }
.user-action-button > span { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 9px; background: rgba(255,255,255,.06); font-size: 1.05rem; }
.user-action-button div { display: grid; }.user-action-button small { color: var(--muted); margin-top: 2px; }.danger-action { color: #ff8f96; }
.empty-guidance { text-align: center; }.empty-guidance > p { color: var(--muted); }.guidance-icon { width: 62px; height: 62px; display: grid; place-items: center; margin: 0 auto 15px; border-radius: 18px; background: var(--red-soft); color: #ff6b76; font-size: 2rem; }
