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

:root, [data-theme="dark"] {
  --bg: #050608;
  --surface: #0e0f12;
  --surface2: #13142a;
  --border: #191b2a;
  --accent: #5b6af0;
  --accent2: #818cf8;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --muted: #6b7280;
  --text: #e2e4f0;
  --text2: #9ca3af;
  --green: #22c55e;
  --red: #ef4444;
  --nav-active-bg: rgba(91,106,240,.15);
}

[data-theme="light"] {
  --bg: #f8f9fc;
  --surface: #ffffff;
  --surface2: #eef0fb;
  --border: #dde0ee;
  --accent: #4c5cd4;
  --accent2: #6470e8;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --muted: #6b7280;
  --text: #111827;
  --text2: #374151;
  --green: #16a34a;
  --red: #dc2626;
  --nav-active-bg: rgba(76,92,212,.12);
}

body { background: var(--bg); color: var(--text); font-family: 'Segoe UI', system-ui, sans-serif; height: 100vh; overflow: hidden; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #5b6af0; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #7b88f4; }
::-webkit-scrollbar-button { display: none; height: 0; width: 0; }
@-moz-document url-prefix() { * { scrollbar-color: #5b6af0 transparent; scrollbar-width: thin; } }

/* ── AUTH ── */
.auth-card { width: 360px; margin: 10vh auto; background: var(--surface); border: 1px solid transparent; border-radius: 16px; padding: 2rem; }
.brand { font-size: 1.4rem; font-weight: 700; color: var(--accent2); text-align: center; margin-bottom: 1.5rem; letter-spacing: -0.5px; }
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.tab { flex: 1; background: none; border: none; color: var(--muted); padding: .6rem; cursor: pointer; font-size: .9rem; transition: color .2s; }
.tab.active { color: var(--accent2); border-bottom: 2px solid var(--accent2); }

/* ── LAYOUT ── */
#view-app { display: flex; height: 100vh; }
.sidebar { width: 205px; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 1.5rem 0 1rem 0; flex-shrink: 0; }
.sidebar-brand { font-size: 1rem; font-weight: 700; color: var(--text); padding: 0 .875rem .9rem; margin: 0 .625rem; }
.sidebar-links { flex: 1; display: flex; flex-direction: column; gap: .25rem; padding: .75rem .625rem 0; }
.nav-link { display: block; padding: .65rem .875rem; border-radius: 6px; color: var(--text2); text-decoration: none; font-size: .9rem; transition: background .15s, color .15s; }
.nav-link:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.nav-link.active { background: var(--nav-active-bg); color: var(--accent2); }
.nav-link.logout { color: var(--text2); }
.sidebar-footer { padding: .35rem .625rem 1rem; display: flex; flex-direction: column; gap: .5rem; }
.sidebar-footer .nav-link { padding-top: 0; padding-bottom: 0; line-height: 1.4; }
.sidebar-footer .plan-badge { line-height: 1.4; }
.plan-badge { display: block; font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text2); background: transparent; border: 1px solid var(--border); padding: .33rem .875rem; border-radius: 6px; text-align: center; }
.content { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 1.5rem; min-width: 0; }

/* ── FORMS ── */
label { display: block; font-size: .82rem; color: var(--text2); margin-bottom: .3rem; margin-top: .9rem; }
input, select { width: 100%; background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: .55rem .75rem; font-size: .9rem; outline: none; transition: border-color .2s; }
select { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 2rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .75rem center; }
input:focus, select:focus { border-color: var(--accent); }
select:hover { border-color: var(--accent2); }
/* Small variant — filters, admin, world map */
.select-sm { width: auto; padding: .32rem .55rem; padding-right: 1.75rem; font-size: .8rem; border-radius: 6px; color: var(--text2); background-position: right .5rem center; }
.error-msg { color: var(--danger); font-size: .82rem; margin-top: .5rem; min-height: 1rem; }
.pass-wrap { position: relative; display: block; }
.pass-wrap input { padding-right: 2.75rem; }
.pass-eye { position: absolute; right: 0; top: 0; bottom: 0; width: 2.6rem; background: none; border: none; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; border-radius: 0 8px 8px 0; transition: color .15s; }
.pass-eye:hover { color: var(--text2); }

/* ── BUTTONS ── */
.btn-primary { width: 100%; background: var(--accent); color: #fff; border: none; border-radius: 8px; padding: .65rem; font-size: .95rem; font-weight: 600; cursor: pointer; margin-top: 1.25rem; transition: opacity .2s; }
.btn-primary:hover { opacity: .85; }
.btn-sm { background: var(--surface); border: 1px solid var(--border); color: var(--text2); border-radius: 6px; padding: .35rem .75rem; font-size: .8rem; cursor: pointer; transition: border-color .2s; }
.btn-sm:hover { border-color: var(--accent); }
.btn-accent { background: var(--accent); border: none; color: #fff; border-radius: 8px; padding: .4rem .9rem; font-size: .85rem; font-weight: 600; cursor: pointer; transition: opacity .2s; }
.btn-accent:hover { opacity: .85; }
.btn-danger { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3); color: var(--danger); border-radius: 6px; padding: .35rem .75rem; font-size: .8rem; cursor: pointer; }
.btn-run { background: var(--surface); border: 1px solid var(--border); color: var(--text2); border-radius: 6px; padding: .35rem .75rem; font-size: .8rem; cursor: pointer; transition: border-color .2s; }
.btn-run:hover { border-color: var(--accent); }
.btn-outline-accent { background: rgba(91,106,240,.12); border: 1px solid var(--accent); color: var(--accent2); border-radius: 6px; padding: .35rem .75rem; font-size: .8rem; cursor: pointer; transition: opacity .2s; }
.btn-outline-accent:hover { opacity: .8; }
.btn-back { display: inline-flex; align-items: center; gap: .35rem; background: var(--surface2); border: 1px solid var(--border); color: var(--text2); border-radius: 6px; padding: .35rem .75rem; font-size: .8rem; cursor: pointer; transition: border-color .2s, color .2s; }
.btn-back svg { display: block; flex-shrink: 0; }
.btn-back span { line-height: 1; display: flex; align-items: center; }
.btn-back:hover { border-color: var(--accent); color: var(--text); }

/* ── CARDS ── */
.card { background: var(--surface); border: 1px solid transparent; border-radius: 12px; padding: 1.25rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }

/* ── DOMAIN ROW ── */
.domain-row { background: var(--surface); border: 1px solid transparent; border-radius: 10px; padding: 1rem 1.25rem; display: flex; align-items: center; gap: 1rem; margin-bottom: .5rem; cursor: pointer; transition: border-color .2s; flex-wrap: wrap; min-width: 0; }
.domain-row:hover { border-color: var(--accent); }
.status-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot-ok { background: var(--success); box-shadow: 0 0 6px var(--success); }
.dot-down { background: var(--danger); box-shadow: 0 0 6px var(--danger); }
.dot-blocked { background: var(--danger); box-shadow: 0 0 6px var(--danger); }
.dot-proxy_error { background: #f97316; box-shadow: 0 0 6px #f97316; }
.dot-pending { background: var(--muted); }
.dot-checker_error { background: var(--muted); }
.domain-name { font-weight: 600; flex: 1; }
.domain-meta { font-size: .78rem; color: var(--muted); }
.status-tag { font-size: .72rem; font-weight: 600; padding: .2rem .5rem; border-radius: 4px; text-transform: uppercase; letter-spacing: .05em; }
.tag-ok { background: rgba(34,197,94,.15); color: var(--success); }
.tag-down { background: rgba(239,68,68,.15); color: var(--danger); }
.tag-blocked { background: rgba(239,68,68,.15); color: var(--danger); }
.tag-proxy_error, .tag-checker_error { background: rgba(249,115,22,.15); color: #f97316; }
.tag-pending { background: rgba(107,114,128,.15); color: var(--muted); }

/* ── PAGE HEADER ── */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.1rem; }
.page-title { font-size: 1.15rem; font-weight: 700; display: flex; align-items: center; gap: .5rem; }
.page-title svg { width: 22px; height: 22px; }

/* ── TABLE ── */
.table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.table th { text-align: left; padding: .5rem .75rem; color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--border); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.table td { padding: .6rem .75rem; border-bottom: 1px solid var(--border); }

/* ── PROXY CARD ── */
.proxy-card { background: var(--surface); border: 1px solid transparent; border-radius: 8px; padding: .85rem 1rem; margin-bottom: calc(.5rem - 2px); min-height: 5.5rem; box-shadow: 0 0 0 1px transparent; transition: border-color .4s ease, box-shadow .4s ease; display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 1rem; }
.proxy-card.proxy-selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.proxy-card-left { display: flex; flex-direction: column; gap: .3rem; flex: 1; min-width: 0; }
.proxy-card-r1 { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.proxy-card-r2 { display: flex; align-items: center; gap: .35rem; font-size: .8rem; }
.proxy-fallback-row { display: flex; align-items: center; gap: .35rem; font-size: .8rem; min-height: 1.3rem; }
.proxy-mini-ticks { display: flex; gap: 3px; align-items: center; flex-shrink: 0; }
.mini-tick { width: 6px; height: 20px; border-radius: 3px; }
.tick-fresh { transition: background 6s ease; }
.proxy-expanded-body { padding-top: .65rem; }
.proxy-ticks-label { font-size: .74rem; color: var(--muted); margin-bottom: .2rem; }
.stat-card-compact { background: var(--surface); border: 1px solid var(--border); border-radius: 7px; padding: .9rem .75rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.stat-card-compact .stat-label { font-size: .75rem; color: var(--muted); line-height: 1; margin: 0; padding: 0; display: flex; align-items: center; }
.stat-card-compact .stat-value { font-size: 1.12rem; font-weight: 600; line-height: 1; margin: 0; padding: 0; display: flex; align-items: center; }
.proxy-label { font-weight: 600; font-size: .88rem; }
.proxy-type { font-size: .7rem; padding: .15rem .45rem; border-radius: 4px; font-weight: 600; }
.proxy-cc-pill { font-size: .7rem; font-weight: 700; padding: .15rem .4rem; border-radius: 4px; }
.proxy-sep { color: var(--border); font-size: .8rem; }
.proxy-err-count { font-size: .78rem; color: var(--muted); }
.proxy-row-prefix { font-size: .75rem; color: var(--muted); flex-shrink: 0; }
.proxy-row-muted { font-size: .75rem; color: var(--muted); }
.proxy-row-pill { font-size: .75rem; font-weight: 600; padding: .15rem .5rem; border-radius: 5px; }
.type-managed { background: rgba(91,106,240,.2); color: var(--accent2); }
.type-own { background: rgba(34,197,94,.15); color: var(--success); }
.proxy-detail { font-size: .78rem; color: var(--muted); margin-top: .3rem; }
.proxy-stats { display: flex; gap: .75rem; margin-top: .4rem; }
.proxy-stat { font-size: .75rem; color: var(--muted); }
.proxy-stat-ok { color: var(--success); }
.fallback-badge { font-size: .72rem; border-radius: 4px; padding: .15rem .4rem; }
.fallback-badge-auto { background: rgba(91,106,240,.2); color: var(--accent2); }
.fallback-badge-custom { background: rgba(34,197,94,.15); color: var(--success); }

/* ── MODAL ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: var(--surface); border: 1px solid transparent; border-radius: 14px; padding: 1.75rem; width: 420px; max-width: 95vw; }
.modal-title { font-size: 1.05rem; font-weight: 700; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.modal-body { margin-bottom: 1rem; }
.modal-actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1rem; }
.modal-close { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1.1rem; line-height: 1; padding: .25rem .4rem; border-radius: 4px; transition: color .15s; }
.modal-close:hover { color: var(--text); }

/* ── STAT CARDS ── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.stat-card { background: var(--surface); border: 1px solid transparent; border-radius: 10px; padding: 1.1rem 1.25rem; }
.stat-tab { cursor: pointer; transition: border-color .15s, background .15s; border: 1px solid transparent; display: flex; align-items: center; justify-content: space-between; gap: .75rem; position: relative; min-height: 88px; padding-right: 5.5rem; }
.stat-tab:hover { background: var(--surface2); }
.stat-tab-active { border-color: var(--accent); background: var(--surface); }
.stat-tab-name { font-size: .95rem; font-weight: 700; color: var(--text); line-height: 1.3; }
.stat-tab-badge { position: absolute; top: 10px; right: 10px; bottom: 10px; width: 72px; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; flex-shrink: 0; }
.stat-tab-badge-value { font-size: 1.65rem; font-weight: 700; line-height: 1; }
.stat-tab-badge-label { font-size: .68rem; color: var(--muted); line-height: 1; }
.stat-tab-ring { position: absolute; top: 50%; right: 18px; transform: translateY(-50%); }
.health-score-ring { width: 64px; height: 64px; border-radius: 50%; border: 2.5px solid; display: flex; align-items: center; justify-content: center; font-size: 1.9rem; font-weight: 700; line-height: 1; flex-shrink: 0; }
.stat-value { font-size: 2rem; font-weight: 700; }
.stat-label { font-size: .75rem; color: var(--muted); margin-top: .2rem; }

/* ── CHAIN ── */
.chain { font-size: .76rem; font-family: monospace; background: var(--bg); border-radius: 6px; padding: .5rem .75rem; margin-top: .4rem; overflow-x: auto; white-space: nowrap; }

/* ── TOAST ── */
.toast { position: fixed; bottom: 1.5rem; right: 1.5rem; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: .65rem 1.1rem; font-size: .88rem; opacity: 0; transition: opacity .3s; pointer-events: none; z-index: 200; }
.toast.show { opacity: 1; }
.toast.ok { border-color: var(--success); }
.toast.err { border-color: var(--danger); }

/* ── UPTIME TICKS ── */
.uptime-ticks { display: flex; align-items: stretch; gap: 2px; height: 32px; margin: .5rem 0; }
.uptime-tick { flex: 1; border-radius: 2px; min-width: 2px; }

/* ── MISC ── */
.section-title { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: .75rem; display: flex; align-items: center; gap: .35rem; }
.section-title svg { width: 14px; height: 14px; flex-shrink: 0; }
.empty { text-align: center; padding: 3rem; color: var(--muted); }
.actions { display: flex; gap: .5rem; align-items: center; }
.actions .btn-danger { padding: 0; width: 1.75rem; height: 1.75rem; display: flex; align-items: center; justify-content: center; line-height: 1; font-size: 0; }
.pill { display: inline-block; font-size: .72rem; padding: .15rem .45rem; border-radius: 4px; font-weight: 600; }

/* ── HEALTH SCORE ── */
.score-badge { font-size: .78rem; font-weight: 700; padding: .2rem .5rem; border-radius: 6px; min-width: 2.4rem; text-align: center; flex-shrink: 0; }
.score-good { background: rgba(34,197,94,.15); color: var(--success); }
.score-warn { background: rgba(245,158,11,.15); color: var(--warning); }
.score-bad  { background: rgba(239,68,68,.15);  color: var(--danger); }
.score-none { background: rgba(107,114,128,.1);  color: var(--muted); }
.score-num-good { color: var(--success); }
.score-num-warn { color: var(--warning); }
.score-num-bad  { color: var(--danger); }
.score-num-none { color: var(--muted); }

/* ── SCORE RING (detail page) ── */
.score-ring { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.05rem; font-weight: 700; border: 3px solid; flex-shrink: 0; }
.score-ring-good { border-color: var(--success); color: var(--success); }
.score-ring-warn { border-color: var(--warning); color: var(--warning); }
.score-ring-bad  { border-color: var(--danger);  color: var(--danger); }
.score-ring-none { border-color: var(--border);  color: var(--muted); }

/* ── REPUTATION CARD ── */
.rep-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.rep-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
@media (max-width: 900px) { .rep-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .rep-grid { grid-template-columns: 1fr; } }
.rep-item { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: .85rem 1rem; }
.rep-icon { margin-bottom: .4rem; display: flex; align-items: center; }
.rep-icon svg { width: 20px; height: 20px; }
.rep-label { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .6rem; }
.rep-value { font-size: .9rem; font-weight: 600; color: var(--text); }
.rep-sub { font-size: .76rem; color: var(--muted); margin-top: .2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── PLAN CARDS ── */
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-bottom: 1.5rem; }
@media (max-width: 700px) { .plan-grid { grid-template-columns: 1fr; } }
.plan-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 1.75rem; display: flex; flex-direction: column; position: relative; transition: border-color .2s, box-shadow .2s; }
.plan-card:hover { border-color: var(--accent); }
.plan-card.plan-current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.plan-card.plan-popular { border-color: var(--accent2); box-shadow: 0 0 0 1px var(--accent2); }
.plan-card.plan-current.plan-popular { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.plan-popular-badge { position: absolute; top: -1px; left: 50%; transform: translateX(-50%); background: var(--accent2); color: #fff; font-size: .63rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: .22rem .85rem; border-radius: 0 0 8px 8px; white-space: nowrap; }
.plan-name { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: .3rem; margin-top: .5rem; }
.plan-tagline { font-size: .875rem; color: var(--text2); margin-bottom: 1rem; }
.plan-price { font-size: 2.6rem; font-weight: 800; line-height: 1; margin-bottom: 1.4rem; }
.plan-price span { font-size: .95rem; color: var(--muted); font-weight: 400; }
.plan-divider { height: 1px; background: var(--border); margin-bottom: 1.2rem; }
.plan-features { list-style: none; flex: 1; display: flex; flex-direction: column; gap: .55rem; margin-bottom: 1.5rem; }
.plan-features li { font-size: .875rem; color: var(--text2); display: flex; align-items: flex-start; gap: .5rem; line-height: 1.4; }
.plan-check { color: var(--success); font-weight: 700; flex-shrink: 0; }
.plan-badge-current { text-align: center; font-size: .75rem; font-weight: 600; color: var(--accent2); background: rgba(91,106,240,.12); border-radius: 8px; padding: .65rem; }

/* ── BILLING SUMMARY ── */
.billing-summary-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1.25rem 1.75rem; display: flex; align-items: center; gap: 2.5rem; margin-bottom: 1.5rem; }
.billing-summary-left, .billing-summary-mid { flex-shrink: 0; }
.billing-summary-right { flex: 1; }
.billing-summary-plan-label { font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: .2rem; }
.billing-summary-plan-name { font-size: 1.35rem; font-weight: 700; text-transform: capitalize; }
.billing-summary-amount { font-size: 1.35rem; font-weight: 700; }
.billing-summary-amount span { font-size: .85rem; color: var(--muted); font-weight: 400; }
.billing-summary-sep { width: 1px; height: 2.5rem; background: var(--border); flex-shrink: 0; }
.billing-usage-row { display: flex; align-items: center; gap: .75rem; }
.billing-usage-label { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.billing-usage-count { font-size: .8rem; color: var(--text2); white-space: nowrap; }

/* ── USAGE BAR / UPSELL ── */
.usage-bar-wrap { background: var(--bg); border-radius: 6px; height: 8px; overflow: hidden; margin: .5rem 0 .25rem; }
.usage-bar-fill { height: 100%; border-radius: 6px; background: var(--accent); transition: width .3s; }
.usage-bar-fill.usage-full { background: var(--danger); }
.usage-bar-label { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); margin-bottom: .25rem; }
.upsell-resource-block { padding: .75rem 0; border-bottom: 1px solid var(--border); }
.upsell-resource-block:last-child { border-bottom: none; }
.upsell-resource-title { font-size: .82rem; font-weight: 600; margin-bottom: .35rem; }
.upsell-actions { display: flex; flex-direction: column; gap: .6rem; margin-top: 1.25rem; }

/* ── DASHBOARD STICKY HEADER ── */
.content.dash-active { overflow: hidden; display: flex; flex-direction: column; }
#page-dashboard { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.dash-sticky-header { flex-shrink: 0; padding-bottom: .85rem; }
.dash-body { flex: 1; overflow-y: auto; padding-bottom: 1.5rem; padding-right: 10px; }
.dash-body::-webkit-scrollbar-track { background: transparent; }

/* ── CHECKS LOG FILTERS ── */
.log-filter-date { width: auto; background: var(--bg); border: 1px solid var(--border); color: var(--text2); border-radius: 6px; padding: .32rem .55rem; font-size: .8rem; cursor: pointer; outline: none; transition: border-color .2s; }
.log-filter-date::-webkit-calendar-picker-indicator { filter: invert(.4); cursor: pointer; }
.log-filter-date:focus, .log-filter-date:hover { border-color: var(--accent); }

/* ── MONITORING DISCLAIMER ── */
.monitoring-disclaimer { margin-top: 1.25rem; border-top: 1px solid var(--border); padding-top: 1.1rem; }
.monitoring-disclaimer-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.monitoring-disclaimer-block { padding: .75rem .9rem; background: var(--surface); border-radius: 8px; }
.monitoring-disclaimer-title { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .35rem; }
.monitoring-disclaimer-text { font-size: .76rem; color: var(--text2); line-height: 1.55; }
.monitoring-disclaimer-text strong { color: var(--text); font-weight: 600; }

/* ── LOADER ── */
.loader { text-align: center; padding: 2rem; color: var(--muted); font-size: .9rem; }

/* ── TRIAL BANNER ── */
.trial-banner { background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.28); border-radius: 8px; padding: .65rem 1rem; margin-bottom: 1.25rem; font-size: .88rem; color: var(--warning); }
.trial-banner a { color: var(--warning); font-weight: 600; }

/* ── DOMAIN TOGGLE (iOS slider) ── */
.ios-toggle { position: relative; display: inline-block; width: 36px; height: 20px; flex-shrink: 0; cursor: pointer; background: var(--border); border-radius: 10px; transition: background .2s; }
.ios-toggle.ios-on { background: var(--accent); }
.ios-knob { position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.ios-toggle.ios-on .ios-knob { transform: translateX(16px); }
.domain-inactive { opacity: .5; }
.dim-tag { font-size: .72rem; color: var(--muted); font-weight: 400; }
.dot-off { background: var(--border); }
.tag-off { background: rgba(107,114,128,.12); color: var(--muted); }

/* ── WARNING BOX ── */
.warning-box { background: rgba(245,158,11,.07); border: 1px solid rgba(245,158,11,.22); border-radius: 10px; padding: 1rem 1.25rem; text-align: center; }
.warning-box p { font-size: .9rem; line-height: 1.5; }

/* ── OTP BOXES ── */
.otp-boxes { display: flex; gap: .5rem; justify-content: center; margin: 1.25rem 0; }
.otp-box { width: 44px; height: 52px; text-align: center; font-size: 1.5rem; font-weight: 700; border-radius: 10px; border: 2px solid var(--border); background: var(--bg); color: var(--text); outline: none; transition: border-color .2s; padding: 0; }
.otp-box:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91,106,240,.25); }

/* ── ONBOARDING OVERLAY ── */
.ob-overlay { z-index: 200; }
.ob-modal { width: 520px; max-height: 90vh; overflow-y: auto; }
.ob-progress { display: flex; gap: .4rem; margin-bottom: 1.5rem; }
.ob-step { flex: 1; height: 4px; border-radius: 2px; background: var(--border); transition: background .3s; }
.ob-step.active { background: var(--accent); }
.ob-step.done { background: var(--success); }
.ob-welcome { text-align: center; margin-bottom: 1.5rem; }
.ob-welcome h2 { font-size: 1.25rem; font-weight: 700; margin-bottom: .4rem; }
.ob-welcome p { color: var(--text2); font-size: .9rem; line-height: 1.5; }
.ob-icon { font-size: 2.25rem; margin-bottom: .5rem; }

/* ── ONBOARDING RESULTS ── */
.ob-result-card { display: flex; align-items: center; gap: .85rem; background: var(--surface2); border: 1px solid transparent; border-radius: 8px; padding: .85rem 1rem; margin-bottom: .5rem; }
.ob-result-card.result-ok { border-color: rgba(34,197,94,.3); }
.ob-result-card.result-err { border-color: rgba(239,68,68,.3); }

/* ── ONBOARDING PLAN GRID ── */
.ob-plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .65rem; margin-bottom: 1rem; }
@media (max-width: 560px) { .ob-plan-grid { grid-template-columns: 1fr; } }
.ob-plan-card { background: var(--surface2); border: 2px solid var(--border); border-radius: 10px; padding: .9rem; cursor: pointer; transition: border-color .2s, transform .15s; position: relative; }
.ob-plan-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.ob-plan-card.popular { border-color: var(--accent); }
.ob-plan-card.selected { border-color: var(--success); box-shadow: 0 0 0 1px var(--success); }
.ob-plan-popular { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--accent2); margin-bottom: .35rem; }
.ob-plan-name { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--text2); margin-bottom: .25rem; }
.ob-plan-price { font-size: 1.5rem; font-weight: 700; margin-bottom: .3rem; }
.ob-plan-price span { font-size: .78rem; color: var(--muted); font-weight: 400; }
.ob-plan-desc { font-size: .74rem; color: var(--muted); margin-bottom: .5rem; }
.ob-plan-card ul { list-style: none; font-size: .78rem; color: var(--text2); }
.ob-plan-card ul li { padding: .18rem 0; }
.ob-plan-card ul li::before { content: '✓ '; color: var(--success); font-weight: 700; }
.ob-plan-badge { display: inline-block; font-size: .67rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: .18rem .45rem; border-radius: 4px; margin-top: .45rem; background: rgba(107,114,128,.15); color: var(--muted); }
.ob-plan-badge.trial { background: rgba(91,106,240,.15); color: var(--accent2); }

/* ── MODAL SCROLLABLE ── */
.modal { display: flex; flex-direction: column; max-height: 90vh; }
.modal-body { overflow-y: auto; flex: 1; padding-right: .75rem; margin-right: -.75rem; scrollbar-gutter: stable; }

/* ── AUTH EXTRAS ── */
.forgot-link { font-size: .82rem; color: var(--muted); text-decoration: none; }
.forgot-link:hover { color: var(--text); }
.auth-back { display: flex; align-items: center; margin-bottom: 1rem; }

/* ── PROXY FORM — SEARCHABLE COUNTRY ── */
.cs-wrap { position: relative; width: 100%; margin-bottom: .2rem; }
.cs-display { display: flex; align-items: center; justify-content: space-between; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: .55rem .75rem; font-size: .9rem; cursor: pointer; color: var(--text); transition: border-color .2s; }
.cs-display:hover, .cs-display:focus { border-color: var(--accent); outline: none; }
.cs-dropdown { position: absolute; top: calc(100% + 2px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; z-index: 500; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.cs-search { width: 100%; background: var(--bg); border: none; border-bottom: 1px solid var(--border); color: var(--text); padding: .55rem .75rem; font-size: .88rem; outline: none; border-radius: 8px 8px 0 0; }
.cs-list { max-height: 200px; overflow-y: auto; }
.cs-option { padding: .45rem .75rem; cursor: pointer; font-size: .88rem; color: var(--text2); }
.cs-option:hover { background: var(--surface2); color: var(--text); }
.cs-option.cs-selected { color: var(--accent2); background: rgba(91,106,240,.1); }
.cs-option-sub { font-size: .74rem; color: var(--muted); margin-top: .1rem; }
/* Simple (non-searchable) cs-dropdown: no top radius cut for search input */
.cs-dropdown-simple { border-radius: 8px; }
.cs-dropdown-simple .cs-list { border-radius: 8px; }
/* Disabled cs-wrap */
.cs-wrap.cs-disabled .cs-display { opacity: .55; pointer-events: none; cursor: default; }

/* ── PROXY FORM — SUBTYPE BUTTONS ── */
.proxy-subtype-btns { display: flex; gap: .5rem; margin: .4rem 0 .75rem; }
.subtype-btn { flex: 1; background: var(--surface2); border: 1px solid var(--border); color: var(--text2); border-radius: 7px; padding: .45rem; font-size: .82rem; cursor: pointer; transition: all .15s; }
.subtype-btn.active { background: rgba(91,106,240,.15); border-color: var(--accent); color: var(--accent2); }
.subtype-btn:hover:not(.active) { border-color: var(--accent); }

/* ── PROXY FORM — FALLBACK SECTION ── */
.proxy-fallback-section { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }

/* ── ADMIN PAGE ── */
.admin-blocked-item { display: flex; align-items: center; justify-content: space-between; padding: .35rem 0; border-bottom: 1px solid var(--border); font-size: .85rem; }

/* ── DRAG TO REORDER (dashboard geo cards) ── */
.dash-geo-header { display: flex; align-items: center; gap: .6rem; margin-bottom: .1rem; }
.drag-handle { color: var(--muted); font-size: 1.1rem; cursor: grab; user-select: none; flex-shrink: 0; opacity: .35; transition: opacity .15s; line-height: 1; }
.dash-geo-card:hover .drag-handle { opacity: .9; }
.drag-handle:active { cursor: grabbing; }
.drag-placeholder { background: rgba(91,106,240,.06); border: 2px dashed rgba(91,106,240,.35); border-radius: 10px; pointer-events: none; box-sizing: border-box; }

/* ── WORLD MAP (list, used on dashboard) ── */
.wm-grid { display: flex; flex-direction: column; gap: .25rem; }
.wm-row { display: grid; grid-template-columns: 10px 22px 105px 80px 1fr auto; align-items: center; gap: .55rem; padding: .42rem .75rem; border-radius: 7px; font-size: .84rem; }
.wm-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.wm-flag { font-size: 1rem; }
.wm-country { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-type { font-size: .72rem; color: var(--muted); }
.wm-op { font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-status { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; text-align: right; white-space: nowrap; }
.wm-section-sep { font-size: .7rem; color: var(--muted); padding: .4rem .25rem .1rem; letter-spacing: .03em; }

/* ── WORLD MAP ── */
.wm-progress-wrap { margin-bottom: 1.1rem; }
.wm-progress-bar { height: 6px; background: var(--bg); border: 1px solid var(--border); border-radius: 3px; overflow: hidden; }
.wm-progress-fill { height: 100%; width: 0%; border-radius: 3px; transition: width .6s ease; }
.wm-progress-fill.wm-waiting { background: var(--accent); }
.wm-progress-fill.wm-scanning {
  width: 100% !important;
  background: linear-gradient(90deg, #f59e0b, #22c55e, #5b6af0, #ef4444, #f59e0b);
  background-size: 300% 100%;
  animation: wm-shimmer 2.5s ease infinite;
}
@keyframes wm-shimmer {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.wm-progress-label { font-size: .73rem; color: var(--muted); margin-top: .35rem; }
.wm-map-canvas { width: 100%; margin: 0 0 1.5rem; aspect-ratio: 2.04/1; border-radius: 10px; overflow: hidden; background: #12131a; }

/* ── WM DOMAIN DROPDOWN ── */
.wm-dd { position: relative; }
.wm-dd-trigger { display: flex; align-items: center; gap: .5rem; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: .38rem .75rem; cursor: pointer; font-size: .85rem; color: var(--text); min-width: 160px; user-select: none; transition: border-color .15s; }
.wm-dd-trigger:hover { border-color: var(--accent); }
.wm-dd.open .wm-dd-trigger { border-color: var(--accent2); border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.wm-dd-chevron { margin-left: auto; color: var(--muted); transition: transform .2s; flex-shrink: 0; }
.wm-dd.open .wm-dd-chevron { transform: rotate(180deg); }
.wm-dd-menu { position: absolute; top: 100%; left: 0; right: 0; background: var(--surface); border: 1px solid var(--accent2); border-top: none; border-bottom-left-radius: 8px; border-bottom-right-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.35); z-index: 200; display: none; overflow: hidden; max-height: 220px; overflow-y: auto; }
.wm-dd.open .wm-dd-menu { display: block; }
.wm-dd-item { padding: .5rem .75rem; font-size: .85rem; cursor: pointer; color: var(--text); transition: background .1s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wm-dd-item:hover { background: var(--surface2); }
.wm-dd-item.active { color: var(--accent2); font-weight: 500; }
.jsvectormap-zoomin, .jsvectormap-zoomout { display: none !important; }
.wm-pill-grid { display: flex; flex-direction: column; }
.continent-section { margin-bottom: 1.75rem; }
.continent-name { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .13em; color: var(--muted); margin-bottom: .6rem; }
.continent-pills { display: flex; flex-wrap: wrap; gap: .4rem; }
.country-pill { display: inline-flex; align-items: center; gap: .3rem; background: var(--surface2); border: 1px solid var(--border); border-radius: 6px; padding: .3rem .55rem; cursor: pointer; transition: border-color .25s, box-shadow .25s, opacity .25s, background .15s; }
.country-pill.pill-no-data { opacity: .35; }
.country-pill.wm-hover { background: var(--surface); }
.country-pill.wm-selected { border-color: var(--accent) !important; box-shadow: 0 0 0 1px var(--accent); }
.pill-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.pill-flag { font-size: .95rem; line-height: 1; }
.pill-name { color: var(--text2); font-size: .77rem; }
/* jsvectormap overrides */
.jsvectormap-tip { background: var(--surface) !important; border: 1px solid var(--border) !important; border-radius: 8px !important; padding: 0 !important; box-shadow: 0 4px 20px rgba(0,0,0,.6) !important; font-family: inherit !important; }
.wm-map-tt { padding: .55rem .75rem; font-size: .8rem; line-height: 1.5; min-width: 120px; }
.wm-map-tt-name { font-weight: 600; margin-bottom: .2rem; color: var(--text); }
.wm-map-tt-sub { font-size: .73rem; color: var(--muted); }

/* ── TICK / MAP TOOLTIP ── */
.tick-tooltip { position: fixed; z-index: 600; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: .55rem .75rem; pointer-events: none; display: none; box-shadow: 0 4px 20px rgba(0,0,0,.5); min-width: 130px; line-height: 1.5; }

/* ── HEALTH REPORT MODAL ── */
.rep-detail-section { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: .85rem 1rem; margin-bottom: .65rem; }
.rep-detail-title { font-size: .78rem; font-weight: 700; margin-bottom: .5rem; color: var(--text2); display: flex; align-items: center; gap: .35rem; }
.rep-detail-title svg { width: 14px; height: 14px; flex-shrink: 0; }
.rep-detail-row { display: flex; justify-content: space-between; align-items: flex-start; padding: .25rem 0; border-bottom: 1px solid var(--border); font-size: .82rem; gap: .75rem; }
.rep-detail-row:last-child { border-bottom: none; }
.rep-detail-row > span:first-child { color: var(--muted); flex-shrink: 0; }
.rep-detail-row > span:last-child { text-align: right; word-break: break-word; }

/* ── DASHBOARD PROXY COLUMNS ── */
.proxy-dash-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 1100px) { .proxy-dash-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px)  { .proxy-dash-grid { grid-template-columns: 1fr; } }
.proxy-dash-col { background: var(--surface); border: 1px solid transparent; border-radius: 10px; padding: 1rem; display: flex; flex-direction: column; }
.proxy-dash-col-title { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: .5rem; display: flex; align-items: center; gap: .4rem; }
.proxy-dash-col-title svg { width: 13px; height: 13px; opacity: .7; }
.proxy-dash-col-rows { display: flex; flex-direction: column; gap: .2rem; }
.proxy-dash-row { display: grid; grid-template-columns: 10px 22px 95px 1fr auto; align-items: center; gap: .5rem; padding: .38rem .4rem; border-radius: 6px; cursor: pointer; transition: background .15s; }
.proxy-dash-row:hover { background: rgba(128,128,128,.06); }

/* ── THEME TOGGLE ── */
.theme-toggle { flex: 1; background: none; border: 1px solid var(--border); border-radius: 7px; padding: .3rem .55rem; cursor: pointer; font-size: .95rem; color: var(--text2); transition: border-color .15s, color .15s; line-height: 1; display: flex; align-items: center; justify-content: center; }
.theme-toggle:hover { border-color: var(--accent); color: var(--text); }

/* ── LANGUAGE SELECTOR ── */
.lang-btn { flex: 1; background: none; border: 1px solid var(--border); border-radius: 7px; padding: .3rem .55rem; cursor: pointer; font-size: .78rem; color: var(--text2); transition: border-color .15s; display: flex; align-items: center; justify-content: center; gap: .3rem; line-height: 1; }
.lang-btn:hover { border-color: var(--accent); color: var(--text); }
.lang-option { display: flex; align-items: center; gap: .65rem; padding: .65rem 1.25rem; cursor: pointer; transition: background .12s; }
.lang-option:hover { background: var(--surface2); }
.lang-option-active { background: rgba(91,106,240,.1); }
.lang-option-flag { font-size: .72rem; font-weight: 700; letter-spacing: .05em; color: var(--muted); min-width: 1.8rem; }
.lang-option-name { flex: 1; font-size: .88rem; color: var(--text); }
.lang-option-code { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.sidebar-footer-row { display: flex; align-items: center; gap: .5rem; margin-top: .1rem; }
.footer-sep { width: 1px; height: 1.1rem; background: var(--border); flex-shrink: 0; }

/* ── HAMBURGER (mobile) ── */
.hamburger { display: none; align-items: center; justify-content: center; position: fixed; top: .75rem; left: .75rem; z-index: 1001; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: .45rem; cursor: pointer; color: var(--text); }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 999; }
.sidebar-overlay.visible { display: block; }

/* ── MOBILE BREAKPOINTS ── */
@media (max-width: 768px) {
  .hamburger { display: flex; }
  .content { padding-top: 3.5rem; }
  .sidebar {
    position: fixed; left: -220px; top: 0; height: 100vh;
    z-index: 1000; transition: left .25s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,.4);
  }
  .sidebar.open { left: 0; }
  .modal { width: calc(100% - 2rem); max-height: 90vh; overflow-y: auto; }
  .wm-map-canvas { display: none; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .rep-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .rep-grid { grid-template-columns: 1fr; }
  .proxy-dash-grid { grid-template-columns: 1fr; }
}

/* ── TIMELINE SCROLL (M5) ── */
.timeline-scroll-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.timeline-scroll-wrap canvas { min-width: 600px; }
