:root {
  --bg: #0a0d10;
  --bg-2: #0e1317;
  --panel: #111820;
  --panel-2: #0f151b;
  --card: #121a22;
  --border: #1e2a35;
  --border-soft: #182028;
  --text: #e6edf3;
  --text-dim: #8b9aa7;
  --text-faint: #5c6b78;
  --accent: #35c4e8;
  --accent-2: #2aa7c7;
  --green: #3fb950;
  --amber: #e3b341;
  --red: #f05d5d;
  --pink: #e06c9f;
  --radius: 12px;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  /* Derived tokens (themes override these) */
  --on-accent: #042028;
  --solid-bg: #f4f6f8;
  --solid-text: #0a0d10;
  --overlay: rgba(2,5,8,0.7);
  --shadow: 0 16px 40px rgba(0,0,0,0.4);
  --shadow-lg: 0 30px 80px rgba(0,0,0,0.5);
  --topbar-bg: rgba(10,13,16,0.85);
  --tip-bg: #0b1016;
  --switch-off: #2b3844;
  --hover-border: #26323d;
  --amber-text: #e9c87a;
  --green-text: #9fe0a8;
  --glow-1: rgba(53,196,232,0.10);
  --glow-2: rgba(224,108,159,0.06);
  --chart-grid: #182028;
  --chart-label: #5c6b78;
  --c1: var(--accent);
  --c2: var(--pink);
  --c3: var(--green);
  --dot-off: #3a4752;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
a { cursor: pointer; text-decoration: none; color: inherit; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(900px 500px at 20% -10%, var(--glow-1), transparent 60%),
    radial-gradient(700px 500px at 110% 10%, var(--glow-2), transparent 55%),
    var(--bg);
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-lg);
}
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.login-card label { font-size: 12px; color: var(--text-dim); margin-top: 8px; }
.login-card input, .modal input, .modal select {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: var(--sans);
  outline: none;
}
.login-card input:focus, .modal input:focus, .modal select:focus { border-color: var(--accent-2); }

.logo-mark {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: grid; place-items: center;
  font-family: var(--mono); font-weight: 700; font-size: 15px;
  color: var(--on-accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  flex: none;
}
.brand-title { font-family: var(--mono); font-weight: 700; letter-spacing: 1px; font-size: 13px; }
.brand-sub { color: var(--text-faint); font-size: 11px; letter-spacing: .5px; }

.btn-primary {
  margin-top: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--on-accent);
  border: none;
  border-radius: 8px;
  padding: 11px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.btn-primary:hover { filter: brightness(1.06); }
.form-error { color: var(--red); font-size: 12px; min-height: 16px; margin-top: 8px; }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--bg-2);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  position: sticky; top: 0; height: 100vh;
}
.side-head { display: flex; align-items: center; gap: 11px; padding: 6px 8px 18px; }
.nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.nav-section {
  font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text-faint); margin: 16px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: 9px;
  color: var(--text-dim); font-weight: 500; font-size: 13.5px;
}
.nav-item .ic { font-size: 14px; width: 16px; text-align: center; opacity: .85; }
.nav-item:hover { background: var(--panel); color: var(--text); }
.nav-item.active { background: var(--panel); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }

.side-foot {
  display: flex; align-items: center; gap: 8px;
  border-top: 1px solid var(--border-soft);
  padding-top: 14px; margin-top: 10px;
}
.user-chip { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 600; font-size: 13px;
  background: var(--panel); border: 1px solid var(--border); color: var(--accent);
}
.user-meta { min-width: 0; }
.user-meta > div:first-child { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--green); }
.icon-btn {
  background: var(--panel); border: 1px solid var(--border); color: var(--text-dim);
  width: 34px; height: 34px; border-radius: 9px; cursor: pointer; font-size: 15px;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent-2); }

/* ---------- Main ---------- */
.main { min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 28px; border-bottom: 1px solid var(--border-soft);
  position: sticky; top: 0; background: var(--topbar-bg); backdrop-filter: blur(8px); z-index: 5;
}
.topbar h1 { font-size: 19px; margin: 0; font-weight: 600; }
.status-pill {
  font-family: var(--mono); font-size: 11px; padding: 5px 11px; border-radius: 20px;
  border: 1px solid var(--border); color: var(--text-dim); background: var(--panel);
}
.status-pill.ok { color: var(--green); border-color: color-mix(in srgb, var(--green) 40%, transparent); }
.status-pill.bad { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, transparent); }

.view { padding: 24px 28px 60px; }

.panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; margin-bottom: 20px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.panel-head h2 { font-size: 15px; margin: 0; font-weight: 600; }
.panel-head .desc { font-size: 12px; color: var(--text-dim); margin-top: 3px; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 10px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--text-faint); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--border-soft);
}
td { padding: 12px; border-bottom: 1px solid var(--border-soft); font-size: 13.5px; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr.clickable:hover td { background: var(--panel-2); cursor: pointer; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.truncate { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; padding: 3px 9px; border-radius: 20px; font-weight: 500;
  border: 1px solid var(--border);
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.active { color: var(--green); border-color: color-mix(in srgb, var(--green) 35%, transparent); }
.badge.pending { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 35%, transparent); }
.badge.paused, .badge.moved, .badge.deactivated { color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, transparent); }
.tag { font-family: var(--mono); font-size: 11px; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); padding: 2px 7px; border-radius: 5px; }

/* ---------- Buttons ---------- */
.btn {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
  padding: 8px 14px; border-radius: 8px; font-size: 13px; cursor: pointer; font-family: var(--sans);
}
.btn:hover { border-color: var(--accent-2); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.accent { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--on-accent); border: none; font-weight: 600; }
.btn.danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 30%, transparent); }
.btn.danger:hover { background: color-mix(in srgb, var(--red) 8%, transparent); }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ---------- Chart ---------- */
.chart-wrap { position: relative; width: 100%; height: 240px; }
.chart-wrap svg { width: 100%; height: 100%; display: block; }
.chart-empty { display: grid; place-items: center; height: 240px; color: var(--text-faint); font-size: 13px; }
.legend { display: flex; gap: 18px; margin-top: 12px; font-size: 12px; color: var(--text-dim); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.toolbar select, .toolbar input {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 8px 11px; font-size: 13px; font-family: var(--sans);
}
.spacer { flex: 1; }
.muted { color: var(--text-dim); }
.empty-state { text-align: center; padding: 50px 20px; color: var(--text-faint); }
.empty-state .big { font-size: 15px; color: var(--text-dim); margin-bottom: 6px; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: var(--overlay); backdrop-filter: blur(3px);
  display: grid; place-items: center; z-index: 50; padding: 20px;
}
.modal {
  width: 100%; max-width: 440px; background: var(--panel);
  border: 1px solid var(--border); border-radius: 14px; padding: 24px;
  max-height: 88vh; overflow: auto;
}
.modal h3 { margin: 0 0 4px; font-size: 17px; }
.modal .sub { color: var(--text-dim); font-size: 12.5px; margin-bottom: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; color: var(--text-dim); }
.field input, .field select, .field textarea {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 10px 12px; font-size: 14px; font-family: var(--sans); width: 100%;
}
.field.inline { flex-direction: row; align-items: center; gap: 10px; }
.field.inline input[type=checkbox] { width: auto; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.ns-list { background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px; font-family: var(--mono); font-size: 12.5px; color: var(--accent); }
.ns-list div { padding: 3px 0; }
.checklist { max-height: 220px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.checklist label { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--border-soft); font-size: 13px; cursor: pointer; }
.checklist label:last-child { border-bottom: none; }
.checklist label:hover { background: var(--panel-2); }

/* ---------- Toast ---------- */
#toast {
  position: fixed; bottom: 22px; right: 22px; z-index: 100;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  padding: 12px 16px; border-radius: 10px; font-size: 13px; max-width: 340px;
  box-shadow: var(--shadow); animation: slideIn .2s ease;
}
.toast.error { border-left-color: var(--red); }
.toast.success { border-left-color: var(--green); }
@keyframes slideIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.spinner {
  width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: grid; place-items: center; padding: 50px; }

/* ---------- Dashboard: analytics ---------- */
.vt-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.vt-left { display: flex; align-items: center; gap: 12px; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-faint); }
.live-dot.on { background: var(--green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 15%, transparent); }
.vt-title { font-weight: 600; font-size: 15px; }
.vt-status { font-size: 12.5px; color: var(--green); letter-spacing: .5px; }
.vt-right { display: flex; align-items: center; gap: 10px; }

.dash-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 16px; align-items: start; }
.na-panel, .geo-panel { margin-bottom: 0; }

.range-tabs { display: inline-flex; gap: 2px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 20px; padding: 3px; }
.range-tab { background: transparent; border: none; color: var(--text-dim); font-family: var(--sans); padding: 5px 13px; border-radius: 16px; font-size: 12.5px; cursor: pointer; }
.range-tab:hover { color: var(--text); }
.range-tab.active { background: var(--solid-bg); color: var(--solid-text); font-weight: 600; }

.na-stats { display: grid; grid-template-columns: repeat(4, 1fr); margin: 18px 0; border: 1px solid var(--border-soft); border-radius: 10px; overflow: hidden; }
.na-stat { padding: 16px 18px; min-width: 0; }
.na-stat + .na-stat { border-left: 1px solid var(--border-soft); }
.na-stat-line { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.na-stat-label { font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-faint); margin-bottom: 6px; }
.na-stat-value { font-family: var(--mono); font-size: 26px; font-weight: 700; line-height: 1.1; }
.na-stat-value.green { color: var(--green); }
.na-stat-sub { font-size: 11px; color: var(--text-dim); font-family: var(--mono); }

.na-chart { position: relative; }
.tc-svg { width: 100%; height: 240px; display: block; cursor: crosshair; }

.chart-tip {
  position: absolute; top: 10px; pointer-events: none;
  background: var(--tip-bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; font-size: 12px; min-width: 170px; box-shadow: var(--shadow); z-index: 3;
}
.tip-time { font-family: var(--mono); font-size: 11px; color: var(--text-dim); margin-bottom: 7px; }
.tip-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 2px 0; }
.tip-row span { display: inline-flex; align-items: center; gap: 7px; color: var(--text-dim); }
.tip-row i { width: 8px; height: 8px; border-radius: 50%; }
.tip-row b { font-family: var(--mono); color: var(--text); }

/* geography */
.geo-list { display: flex; flex-direction: column; gap: 12px; padding-top: 4px; }
.geo-row { display: grid; grid-template-columns: 110px 1fr 54px; align-items: center; gap: 12px; }
.geo-name { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.geo-bar { height: 8px; background: var(--panel-2); border-radius: 6px; overflow: hidden; }
.geo-bar-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.geo-val { font-size: 12px; color: var(--text-dim); text-align: right; }

/* visitor configuration */
.cfg-select { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 8px 11px; font-size: 13px; font-family: var(--sans); min-width: 180px; cursor: pointer; outline: none; }
.cfg-select:focus { border-color: var(--accent-2); }
.cfg-grid { display: flex; flex-direction: column; gap: 4px; padding-top: 4px; }
.cfg-grid .field input, .cfg-grid .field select { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 10px 12px; font-size: 14px; font-family: var(--sans); width: 100%; outline: none; }
.cfg-grid .field input:focus, .cfg-grid .field select:focus { border-color: var(--accent-2); }
.cfg-grid .field label { font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-faint); }
.cfg-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cfg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; border-top: 1px solid var(--border-soft); padding-top: 16px; }
.cfg-hint-slot:empty { display: none; }
.cfg-hint { display: flex; align-items: flex-start; gap: 10px; padding: 11px 13px; border-radius: 9px; font-size: 12.5px; line-height: 1.5; margin-bottom: 14px; border: 1px solid var(--border); }
.cfg-hint-ic { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; margin-top: 1px; }
.cfg-hint.warn { background: color-mix(in srgb, var(--amber) 7%, transparent); border-color: color-mix(in srgb, var(--amber) 30%, transparent); color: var(--amber-text); }
.cfg-hint.warn .cfg-hint-ic { background: color-mix(in srgb, var(--amber) 18%, transparent); color: var(--amber); }
.cfg-hint.ok { background: color-mix(in srgb, var(--green) 6%, transparent); border-color: color-mix(in srgb, var(--green) 25%, transparent); color: var(--green-text); }
.cfg-hint.ok .cfg-hint-ic { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--green); }

@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } .na-stats { grid-template-columns: repeat(2, 1fr); } .na-stat:nth-child(3) { border-left: none; } .na-stat:nth-child(n+3) { border-top: 1px solid var(--border-soft); } .cfg-row { grid-template-columns: 1fr; } }

/* ---------- Domains: banner ---------- */
.banner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 16px; flex-wrap: wrap;
}
.banner-left { display: flex; align-items: center; gap: 14px; }
.banner-icon {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: var(--panel-2); border: 1px solid var(--border); font-size: 16px; flex: none;
}
.banner-title { font-weight: 600; font-size: 14.5px; }
.banner-desc { color: var(--text-dim); font-size: 12.5px; margin-top: 2px; }

.segmented { display: inline-flex; gap: 6px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 22px; padding: 4px; }
.seg {
  background: transparent; border: none; color: var(--text-dim); font-family: var(--sans);
  padding: 6px 15px; border-radius: 18px; font-size: 13px; cursor: pointer;
}
.seg:hover:not(.disabled) { color: var(--text); }
.seg.active { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent); }
.seg.disabled { cursor: default; opacity: .6; }

/* ---------- Domains: stat bar ---------- */
.statbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 20px; margin-bottom: 16px; flex-wrap: wrap;
}
.statbar-stats { display: flex; gap: 34px; }
.stat2-label { font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-faint); }
.stat2-value { font-family: var(--mono); font-size: 24px; font-weight: 600; margin-top: 3px; }
.stat2-value.green { color: var(--green); }
.stat2-value.red { color: var(--red); }
.statbar-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.pill-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  padding: 9px 16px; border-radius: 22px; font-size: 13px; cursor: pointer; font-family: var(--sans); font-weight: 500;
}
.pill-btn:hover { border-color: var(--accent-2); }
.pill-btn .ic-svg { width: 15px; height: 15px; }
.pill-btn.danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, transparent); }
.pill-btn.danger:hover { background: color-mix(in srgb, var(--red) 8%, transparent); }
.pill-btn.solid { background: var(--solid-bg); color: var(--solid-text); border: none; font-weight: 600; }
.pill-btn.solid:hover { filter: brightness(1.05); }

/* ---------- Domains: controls / sections ---------- */
.dom-controls { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.dom-search {
  flex: 1; background: var(--panel); border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: 11px 14px; font-size: 13.5px; font-family: var(--sans); outline: none;
}
.dom-search:focus { border-color: var(--accent-2); }
.newsection-btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  background: transparent; border: 1px dashed var(--border); color: var(--text-dim);
  padding: 11px 18px; border-radius: 10px; font-size: 13px; cursor: pointer; font-family: var(--sans);
}
.newsection-btn:hover { color: var(--text); border-color: var(--accent-2); }
.newsection-btn .ic-svg { width: 14px; height: 14px; }

.section { margin-top: 10px; }
.section-head {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  padding: 12px 8px; border-bottom: 1px solid var(--border-soft);
}
.section-caret { color: var(--text-dim); width: 14px; font-size: 12px; }
.section-name { font-weight: 600; font-size: 14px; }
.section-count { font-size: 12px; color: var(--text-faint); margin-top: 1px; }
.section-del { margin-left: auto; background: none; border: none; color: var(--text-faint); cursor: pointer; font-size: 13px; }
.section-del:hover { color: var(--red); }
.section-rows { display: flex; flex-direction: column; gap: 10px; padding: 12px 0; }

/* ---------- Domains: row ---------- */
.domain-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 13px 16px;
}
.domain-row:hover { border-color: var(--hover-border); }
.row-check input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.favicon { width: 20px; height: 20px; border-radius: 4px; flex: none; }
.favicon.globe { display: grid; place-items: center; font-size: 15px; }
.domain-name { font-size: 14px; }
.health {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 500;
  padding: 4px 11px; border-radius: 20px; border: 1px solid var(--border);
}
.health::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.health.ok { color: var(--green); border-color: color-mix(in srgb, var(--green) 30%, transparent); }
.health.warn { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 30%, transparent); }
.health.bad { color: var(--red); border-color: color-mix(in srgb, var(--red) 30%, transparent); }

/* toggle switch */
.switch {
  width: 46px; height: 26px; border-radius: 20px; border: none; cursor: pointer;
  background: var(--switch-off); position: relative; transition: background .15s; flex: none; padding: 0;
}
.switch.on { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.switch-knob {
  position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.switch.on .switch-knob { transform: translateX(20px); }

.cat-select {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text-dim);
  border-radius: 8px; padding: 7px 10px; font-size: 12.5px; font-family: var(--sans);
  min-width: 140px; cursor: pointer; outline: none;
}
.cat-select:focus { border-color: var(--accent-2); }

.row-icons { display: flex; align-items: center; gap: 2px; }
.act {
  width: 32px; height: 32px; border-radius: 8px; background: transparent; border: none;
  color: var(--text-faint); cursor: pointer; display: grid; place-items: center;
}
.act:hover { background: var(--panel-2); color: var(--text); }
.act.danger { color: var(--red); opacity: .75; }
.act.danger:hover { background: color-mix(in srgb, var(--red) 10%, transparent); opacity: 1; }
.ic-svg { width: 17px; height: 17px; }

/* dashboard mini list */
.mini-list { display: flex; flex-direction: column; }
.mini-row { display: flex; align-items: center; gap: 14px; padding: 12px; border-bottom: 1px solid var(--border-soft); border-radius: 8px; }
.mini-row:last-child { border-bottom: none; }
.mini-row.clickable:hover { background: var(--panel-2); cursor: pointer; }

@media (max-width: 820px) {
  .domain-row { flex-wrap: wrap; }
  .cat-select { min-width: 110px; }
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav-section { display: none; }
  .side-foot { border-top: none; margin: 0; padding: 0; }
}

/* ---------- Visitors ---------- */
.nav-badge { margin-left: auto; background: color-mix(in srgb, var(--amber) 15%, transparent); color: var(--amber); font-family: var(--mono); font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 10px; }
.stat2-value.amber { color: var(--amber); }
.vis-controls { flex-wrap: wrap; margin-bottom: 14px; }
.vis-controls .dom-search { min-width: 200px; }
.seg-count { margin-left: 6px; font-family: var(--mono); font-size: 11px; opacity: .8; }
.vis-panel { padding: 6px 8px; }
.vis-scroll { overflow-x: auto; }
.vis-table td { vertical-align: top; }
.vis-sid { color: var(--accent); font-weight: 600; letter-spacing: .5px; white-space: nowrap; }
.vis-sub { font-size: 11.5px; margin-top: 3px; }
.vis-flag { font-size: 11px; margin-top: 3px; color: var(--amber); }
.btn.approve { color: var(--green); border-color: color-mix(in srgb, var(--green) 35%, transparent); }
.btn.approve:hover { background: color-mix(in srgb, var(--green) 8%, transparent); }
.vis-modal { max-width: 560px; }
.vis-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.vis-sid-big { color: var(--accent); letter-spacing: 1.5px; font-size: 20px; margin-top: 4px; }
.vis-section { font-size: 10px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--text-faint); margin: 18px 0 6px; padding-bottom: 6px; border-bottom: 1px solid var(--border-soft); }
.vis-kv { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 5px 0; font-size: 13px; }
.vis-k { color: var(--text-dim); font-size: 12px; }
.vis-v { overflow-wrap: anywhere; }
.vis-modal .modal-actions { flex-wrap: wrap; }
@media (max-width: 600px) { .vis-kv { grid-template-columns: 1fr; gap: 2px; } }

/* ---------- Dashboard: domain on/off dropdown ---------- */
.vt-toggle { display: inline-flex; align-items: center; gap: 8px; background: none; border: 1px solid transparent; border-radius: 8px; padding: 4px 8px; margin-left: -4px; cursor: pointer; font-family: var(--sans); }
.vt-toggle:hover { border-color: var(--border); background: var(--panel-2); }
.vt-status.idle { color: var(--text-dim); }
.vt-caret { color: var(--text-dim); width: 16px; height: 16px; transition: transform .15s; display: inline-flex; }
.vt-caret svg { width: 100%; height: 100%; }
.vt-caret.open { transform: rotate(180deg); }
.vt-domains { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border-soft); display: flex; flex-direction: column; gap: 4px; }
.vt-domains .cfg-hint { margin-bottom: 8px; }
.vt-domain { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 8px; border-radius: 8px; }
.vt-domain:hover { background: var(--panel-2); }
.vt-domain-main { min-width: 0; }
.vt-domain-name { font-size: 13.5px; overflow-wrap: anywhere; }
.vt-domain.off .vt-domain-name { color: var(--text-dim); }
.vt-domain-sub { font-size: 12px; color: var(--text-dim); margin-top: 3px; }
.vt-domain.off .vt-domain-sub { color: var(--amber); }
.linkish { background: none; border: none; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.switch:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- Templates ---------- */
.tpl-intro { font-size: 12.5px; margin: 6px 0 8px; max-width: 680px; line-height: 1.5; }
.tpl-on { color: var(--accent); }
.modal.tpl-modal { max-width: 900px; }
.tpl-preview .tpl-frame { width: 100%; height: min(70vh, 640px); border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.field input[type=file] { padding: 9px; }
.vis-on-tpl { font-size: 11px; color: var(--accent); margin-top: 5px; white-space: nowrap; }
.move-list { display: flex; flex-direction: column; gap: 8px; max-height: 55vh; overflow-y: auto; }
.move-group { font-size: 10px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--text-faint); margin: 10px 2px 0; }
.move-opt { text-align: left; background: var(--panel-2); border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 11px 14px; cursor: pointer; font-family: var(--sans); }
.move-opt:hover { border-color: var(--accent-2); }
.move-opt.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.move-title { font-weight: 600; font-size: 13.5px; }
.move-sub { font-size: 12px; margin-top: 2px; }

/* Templates: folders -> list -> preview */
.tpl-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-top: 10px; }
.folder-card { text-align: left; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; cursor: pointer; color: var(--text); font-family: var(--sans); display: flex; flex-direction: column; gap: 4px; }
.folder-card:hover { border-color: var(--accent-2); background: var(--card); }
.folder-ic { width: 34px; height: 34px; color: var(--accent); margin-bottom: 8px; display: block; }
.folder-ic svg { width: 100%; height: 100%; }
.folder-name { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.folder-sub { font-size: 12px; }
.tpl-crumbs { font-size: 15px; display: flex; align-items: center; gap: 4px; }
.tpl-crumbs .linkish { font-size: 15px; }
.tpl-browser { display: grid; grid-template-columns: minmax(200px, 280px) 1fr; gap: 16px; margin-top: 14px; align-items: start; }
.tpl-list-panel { padding: 12px; margin: 0; }
.tpl-list { display: flex; flex-direction: column; gap: 4px; max-height: 70vh; overflow-y: auto; }
.tpl-item { text-align: left; background: none; border: 1px solid transparent; border-radius: 9px; padding: 10px 12px; cursor: pointer; color: var(--text); font-family: var(--sans); }
.tpl-item:hover { background: var(--panel-2); }
.tpl-item.active { background: var(--panel-2); border-color: var(--border); box-shadow: inset 2px 0 0 var(--accent); }
.tpl-item-name { font-weight: 500; font-size: 13.5px; overflow-wrap: anywhere; }
.tpl-item-sub { font-size: 11.5px; margin-top: 2px; }
.tpl-preview-panel { margin: 0; min-width: 0; }
.site-holder { display: flex; justify-content: center; }
.site-frame { width: 100%; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; }
.site-holder.phone .site-frame { width: 280px; border-radius: 22px; border-width: 6px; border-color: var(--hover-border); }
.site-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--panel-2); border-bottom: 1px solid var(--border); }
.site-holder.phone .site-dots { display: none; }
.site-dots { display: inline-flex; gap: 5px; }
.site-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--dot-off); display: block; }
.site-url { font-size: 11.5px; color: var(--text-dim); background: var(--panel); border-radius: 6px; padding: 3px 10px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-screen { position: relative; overflow: hidden; }
.site-iframe { border: 0; transform-origin: 0 0; position: absolute; top: 0; left: 0; background: #fff; }
@media (max-width: 760px) { .tpl-browser { grid-template-columns: 1fr; } }

/* ---------- Visitors: master–detail ---------- */
.vis-layout { display: grid; grid-template-columns: 350px 1fr; gap: 18px; align-items: start; }
.vis-left { padding: 16px; position: sticky; top: 84px; max-height: calc(100vh - 110px); display: flex; flex-direction: column; gap: 12px; margin: 0; }
.vis-search { position: relative; }
.vis-search-ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-faint); display: inline-flex; }
.vis-search-ic .ic-svg { width: 15px; height: 15px; }
.vis-search input { width: 100%; background: var(--panel-2); border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 10px 12px 10px 34px; font-size: 13px; font-family: var(--sans); outline: none; }
.vis-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.vis-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--panel-2); border: 1px solid var(--border); color: var(--text-dim); font-family: var(--sans); font-size: 12px; padding: 5px 10px; border-radius: 999px; cursor: pointer; }
.vis-chip.active { color: var(--on-accent); background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; }
.vis-chip-n { font-family: var(--mono); font-size: 10.5px; opacity: .85; }
.vis-chip.active .vis-chip-n { opacity: 1; }
.vis-count-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; }

/* Anti-bot blocks box */
.vis-botbox { border: 1px solid color-mix(in srgb, var(--red) 30%, var(--border)); border-radius: 10px; background: color-mix(in srgb, var(--red) 5%, transparent); overflow: hidden; }
.vis-botbox-head { width: 100%; display: flex; align-items: center; gap: 9px; padding: 10px 12px; background: none; border: none; color: var(--text); font-family: var(--sans); font-size: 13px; font-weight: 600; cursor: pointer; }
.vis-botbox-ic { color: var(--red); font-size: 14px; }
.vis-botbox-title { flex: 1; text-align: left; }
.vis-botbox-n { font-family: var(--mono); font-size: 11px; background: color-mix(in srgb, var(--red) 18%, transparent); color: var(--red); padding: 1px 8px; border-radius: 999px; }
.vis-botbox-caret { color: var(--text-faint); font-size: 11px; }
.vis-botbox-body { padding: 4px 8px 8px; display: flex; flex-direction: column; gap: 6px; border-top: 1px solid color-mix(in srgb, var(--red) 20%, transparent); }

/* Visitor list + cards */
.vis-list { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; flex: 1; margin: 0 -4px; padding: 0 4px; }
.vis-empty { color: var(--text-faint); font-size: 13px; text-align: center; padding: 30px 10px; }
.vis-card { text-align: left; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 5px; font-family: var(--sans); color: var(--text); }
.vis-card:hover { border-color: var(--hover-border); }
.vis-card.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--panel-2)); }
.vis-card.bot { opacity: .9; }
.vis-card-top { display: flex; align-items: center; gap: 8px; }
.vis-card-ip { font-size: 13.5px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vis-card-time { font-size: 11px; white-space: nowrap; }
.vis-card-bot { display: flex; align-items: center; gap: 8px; }
.vis-card-stage { font-size: 12px; color: var(--text-dim); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vis-card-pages { font-size: 11px; white-space: nowrap; }
.vis-card-pin { background: none; border: none; cursor: pointer; font-size: 12px; filter: grayscale(1); opacity: .5; padding: 0 2px; }
.vis-card-pin.on { filter: none; opacity: 1; }
.vis-card-pin:hover { opacity: 1; }
.vis-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--text-faint); }
.vis-dot.pending { background: var(--amber); }
.vis-dot.active { background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 20%, transparent); }
.vis-dot.idle { background: var(--text-dim); }
.vis-dot.declined { background: var(--red); }

/* Status badges added for visitors */
.badge.idle { color: var(--text-dim); }
.badge.declined { color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, transparent); }

/* Detail panel */
.vis-right { min-width: 0; }
.vis-detail-empty { display: grid; place-items: center; min-height: 300px; border: 1px dashed var(--border); border-radius: var(--radius); }
.vis-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.vis-detail-id h2 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.3px; }
.vis-detail-sid { font-size: 12px; margin-top: 3px; }
.vis-detail-tagrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.vis-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.vis-tag { display: inline-flex; align-items: center; gap: 5px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); font-size: 12px; padding: 3px 4px 3px 10px; border-radius: 999px; }
.vis-tag-x { background: none; border: none; color: inherit; cursor: pointer; font-size: 14px; line-height: 1; opacity: .7; }
.vis-tag-x:hover { opacity: 1; }
.vis-tag-add { background: none; border: 1px dashed var(--border); color: var(--text-dim); font-family: var(--sans); font-size: 12px; padding: 4px 11px; border-radius: 999px; cursor: pointer; }
.vis-tag-add:hover { border-color: var(--accent); color: var(--accent); }

.vis-decide { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.vis-decide-btn { padding: 10px 22px; font-size: 14px; font-weight: 600; }

.vis-panel-box { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; }
.vis-box-label { font-size: 10px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--text-faint); margin-bottom: 14px; }
.vis-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; }
.vis-info-label { font-size: 11px; color: var(--text-faint); margin-bottom: 4px; }
.vis-info-val { font-size: 13.5px; display: flex; align-items: center; gap: 6px; overflow-wrap: anywhere; }
.vis-info-val .ic-svg { width: 15px; height: 15px; color: var(--text-dim); flex: none; }

.vis-notes { width: 100%; min-height: 96px; resize: vertical; background: var(--panel-2); border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 11px 13px; font-size: 13.5px; font-family: var(--sans); outline: none; }
.vis-notes:focus { border-color: var(--accent); }
.vis-notes-hint { font-size: 11.5px; margin-top: 8px; }

.vis-detail-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.vis-act { position: relative; }
.vis-soon { font-size: 9px; letter-spacing: .5px; text-transform: uppercase; background: var(--panel-2); border: 1px solid var(--border); color: var(--text-faint); padding: 1px 5px; border-radius: 6px; margin-left: 7px; }

.vis-activity { display: flex; flex-direction: column; }
.vis-act-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border-soft); }
.vis-act-row:last-child { border-bottom: none; }
.vis-act-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.vis-act-path { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vis-act-time { font-size: 11.5px; white-space: nowrap; }
.vis-activity-empty { font-size: 13px; padding: 4px 0; }

@media (max-width: 900px) {
  .vis-layout { grid-template-columns: 1fr; }
  .vis-left { position: static; max-height: none; }
  .vis-list { max-height: 420px; }
  .vis-info-grid { grid-template-columns: 1fr; gap: 14px; }
}

/* ---------- Manage session panel ---------- */
.ms-modal { width: min(1600px, 96vw); height: 92vh; max-width: none; max-height: none; padding: 0; overflow: hidden; display: flex; flex-direction: column; background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
.ms-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border-soft); }
.ms-head-title { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; }
.ms-head-sub { font-size: 12.5px; margin-top: 4px; }
.ms-close { background: none; border: none; color: var(--text-dim); cursor: pointer; padding: 4px; border-radius: 8px; display: inline-flex; }
.ms-close .ic-svg { width: 20px; height: 20px; }
.ms-close:hover { color: var(--text); background: var(--panel-2); }

.ms-main { flex: 1; display: flex; min-height: 0; }
.ms-rail { width: 184px; flex: none; border-right: 1px solid var(--border-soft); padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.ms-tab { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; background: none; border: none; color: var(--text-dim); font-family: var(--sans); font-size: 13.5px; font-weight: 500; cursor: pointer; text-align: left; }
.ms-tab .ic-svg { width: 17px; height: 17px; opacity: .9; }
.ms-tab:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); color: var(--text); }
.ms-tab.active { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent); }
.ms-tab.active .ic-svg { color: var(--accent); }
.ms-max .ms-rail { display: none; }

.ms-body { flex: 1; min-width: 0; display: flex; }
.ms-pane { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ms-scroll { overflow-y: auto; }
.ms-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--border-soft); flex-wrap: wrap; }
.ms-tool-title { font-size: 14px; font-weight: 600; }
.ms-tool-sub { font-size: 12px; margin-top: 2px; max-width: 640px; }
.ms-tool-right { display: flex; align-items: center; gap: 8px; }
.ms-tool-btn { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--border); color: var(--text-dim); cursor: pointer; }
.ms-tool-btn .ic-svg { width: 16px; height: 16px; }
.ms-tool-btn:hover { color: var(--accent); border-color: var(--accent-2); }
.ms-zoom-pct { font-family: var(--mono); font-size: 12px; color: var(--text-dim); min-width: 40px; text-align: center; }

/* Preview */
.ms-frame-area { flex: 1; position: relative; overflow: hidden; background: #0b0b0d; }
.ms-frame-hold { position: absolute; inset: 0; }
.ms-frame { border: 0; transform-origin: 0 0; background: #fff; }
.ms-frame-loading { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 12px; background: var(--panel); }
.ms-fail { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 14px; text-align: center; padding: 20px; }
.ms-fail-title { font-size: 17px; font-weight: 600; }
.ms-fail-msg { font-size: 13px; color: var(--text-dim); max-width: 430px; line-height: 1.55; }

/* Pages */
.ms-pages { padding: 18px 20px; max-width: 640px; }

/* Data */
.ms-data { padding: 18px 22px; }
.ms-data-sec { margin-bottom: 22px; }
.ms-data-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 24px; }
.ms-data-row .vis-info-val { font-size: 12.5px; overflow-wrap: anywhere; }

/* Coming soon */
.ms-soon { display: grid; place-items: center; }
.ms-soon-card { text-align: center; max-width: 420px; padding: 30px; }
.ms-soon-title { font-size: 17px; font-weight: 600; margin-bottom: 8px; }

@media (max-width: 760px) {
  .ms-modal { width: 100vw; height: 100vh; border-radius: 0; }
  .ms-main { flex-direction: column; }
  .ms-rail { width: auto; flex-direction: row; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--border-soft); }
  .ms-data-grid { grid-template-columns: 1fr; }
}

/* ---------- Domain row actions: scan / health / events ---------- */
.act.on { color: var(--accent); }
.probe-body { min-height: 90px; }
.probe-grid { display: flex; flex-direction: column; }
.probe-grid .vis-kv { grid-template-columns: 130px 1fr; padding: 6px 0; }
.ok-text { color: var(--green); }
.warn-text { color: var(--amber); }
.bad-text { color: var(--red); }
.scan-list { display: flex; flex-direction: column; margin-top: 6px; }
.scan-row { display: flex; align-items: center; gap: 11px; padding: 9px 0; border-bottom: 1px solid var(--border-soft); font-size: 13px; }
.scan-row:last-child { border-bottom: none; }
.scan-ico { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; }
.scan-ico.ok { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--green); }
.scan-ico.bad { background: color-mix(in srgb, var(--red) 18%, transparent); color: var(--red); }
.scan-ico.na { background: var(--panel-2); color: var(--text-faint); }
.scan-label { flex: 1; }
.scan-detail { font-size: 12px; overflow-wrap: anywhere; text-align: right; }
.ev-modal { max-width: 560px; }
.ev-list { max-height: 60vh; overflow-y: auto; }
.ev-row { display: flex; align-items: center; gap: 11px; padding: 9px 0; border-bottom: 1px solid var(--border-soft); font-size: 13px; }
.ev-row:last-child { border-bottom: none; }
.ev-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--text-faint); }
.ev-dot.visit { background: var(--accent); }
.ev-dot.page { background: var(--text-dim); }
.ev-dot.approved { background: var(--green); }
.ev-dot.denied { background: var(--red); }
.ev-dot.move { background: var(--pink); }
.ev-dot.pending { background: var(--amber); }
.ev-text { flex: 1; overflow-wrap: anywhere; }
.ev-time { font-size: 11.5px; white-space: nowrap; }

/* ---------- Flows ---------- */
.flow-layout { display: grid; grid-template-columns: 320px 1fr; gap: 18px; align-items: start; }
.flow-left { padding: 14px; position: sticky; top: 84px; max-height: calc(100vh - 110px); display: flex; flex-direction: column; gap: 12px; margin: 0; }
.flow-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.flow-head-title { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 15px; }
.flow-head-title .ic-svg { width: 18px; height: 18px; color: var(--accent); }
.flow-count { font-family: var(--mono); font-size: 12px; color: var(--text-faint); }
.flow-add { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; background: var(--solid-bg); color: var(--solid-text); border: none; }
.flow-add .ic-svg { width: 17px; height: 17px; }
.flow-add:hover { filter: brightness(1.08); }
.flow-list { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; flex: 1; }
.flow-empty { color: var(--text-faint); font-size: 13px; text-align: center; padding: 30px 14px; line-height: 1.5; }
.flow-card { display: flex; align-items: center; gap: 11px; text-align: left; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px; cursor: pointer; color: var(--text); font-family: var(--sans); }
.flow-card:hover { border-color: var(--hover-border); }
.flow-card.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--panel-2)); }
.flow-card-ic { color: var(--accent); display: inline-flex; }
.flow-card-ic .ic-svg { width: 18px; height: 18px; }
.flow-card-main { min-width: 0; }
.flow-card-name { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flow-card-sub { font-size: 11.5px; margin-top: 2px; }

.flow-right { min-width: 0; }
.flow-editor-empty { display: grid; place-items: center; min-height: 300px; border: 1px dashed var(--border); border-radius: var(--radius); }
.flow-editor-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.flow-name { flex: 1; background: var(--panel-2); border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 11px 14px; font-size: 17px; font-weight: 600; font-family: var(--sans); outline: none; }
.flow-name:focus { border-color: var(--accent); }
.flow-ed-row { display: flex; align-items: center; gap: 14px; }
.flow-ed-label { font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase; }
.flow-hint { font-size: 12.5px; color: var(--text-dim); margin-top: 10px; line-height: 1.5; max-width: 620px; }

.flow-steps { display: flex; flex-direction: column; gap: 8px; }
.flow-step { display: flex; align-items: flex-start; gap: 12px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.flow-step-n { width: 24px; height: 24px; flex: none; border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); font-size: 12px; font-weight: 600; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); margin-top: 3px; }
.flow-step-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 9px; }
.flow-step-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.flow-step-top .cfg-select { min-width: 170px; }
.flow-url { flex: 1; min-width: 0; background: var(--panel-2); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 9px 12px; font-size: 13px; font-family: var(--sans); outline: none; }
.flow-url:focus { border-color: var(--accent); }
.flow-step-note { font-size: 12.5px; }
.flow-secs { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.flow-secs input { width: 64px; background: var(--panel-2); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 7px 9px; font-family: var(--mono); font-size: 12.5px; outline: none; }
.flow-step-ctl { display: flex; align-items: center; gap: 2px; margin-top: 3px; }
.flow-step-ctl .act { font-size: 14px; }
.flow-run-note { font-size: 12px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border-soft); }

/* "On flow" banner in Manage session → Pages */
.ms-pages { padding: 18px 20px; max-width: 660px; }
.flow-onbanner { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-radius: 12px; padding: 13px 16px; margin-bottom: 16px; }
.flow-onbanner-title { font-weight: 600; font-size: 14px; }
.flow-onbanner-actions { display: flex; gap: 8px; }

@media (max-width: 900px) {
  .flow-layout { grid-template-columns: 1fr; }
  .flow-left { position: static; max-height: none; }
  .flow-list { max-height: 360px; }
}

/* ---------- User settings ---------- */
.us-page { max-width: 920px; }
.avatar.has-img { background-size: cover; background-position: center; color: transparent; }
.us-profile { display: flex; gap: 24px; align-items: flex-start; }
.us-avatar-col { display: flex; flex-direction: column; align-items: center; gap: 10px; flex: none; }
.us-avatar { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); font-size: 30px; font-weight: 600; color: var(--text-dim); background: var(--panel-2); border: 1px solid var(--border); overflow: hidden; }
.us-avatar.has-img { color: transparent; background-size: cover; background-position: center; }
.us-fields { flex: 1; min-width: 0; }
.us-userid { font-size: 13.5px; color: var(--text-dim); padding: 4px 0; }
.us-actions { display: flex; justify-content: flex-end; margin-top: 16px; }

.us-notify-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.us-notify-sub { font-size: 12.5px; margin-top: 6px; max-width: 620px; line-height: 1.5; }
.us-enable { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; flex: none; }
.us-events { margin-top: 16px; }
.field-label { font-size: 12px; color: var(--text-dim); margin-bottom: 8px; }
.us-check { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 13.5px; cursor: pointer; }
.us-check input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.us-notify-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; flex-wrap: wrap; }
.us-help { font-size: 12px; max-width: 460px; line-height: 1.5; }
.us-help b { color: var(--accent); font-weight: 600; }
.us-notify-actions { display: flex; gap: 10px; }

@media (max-width: 640px) {
  .us-profile { flex-direction: column; align-items: center; text-align: center; }
  .us-fields { width: 100%; }
}

/* ---------- Traffic & Security ---------- */
.sec-page { max-width: 920px; }
.sec-master { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.sec-master-title { font-weight: 600; font-size: 14px; margin-bottom: 3px; }
.sec-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.sec-badge { font-size: 11px; font-weight: 600; padding: 5px 11px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--border-soft); color: var(--text-dim); }
.sec-badge.ok { color: var(--green-text); border-color: color-mix(in srgb, var(--green) 40%, transparent); background: color-mix(in srgb, var(--green) 12%, transparent); }
.sec-badge.off { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, transparent); background: color-mix(in srgb, var(--red) 10%, transparent); }
.sec-badge.soon { color: var(--text-faint); }
.sec-soon-body { display: flex; align-items: center; gap: 14px; }
.sec-soon { opacity: .9; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.sec-threshold { max-width: 260px; margin-bottom: 16px; }
.sec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sec-sig { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 13px; background: var(--panel-2); border: 1px solid var(--border-soft); border-radius: 10px; }
.sec-sig-main { display: flex; align-items: center; gap: 11px; min-width: 0; }
.sec-sig-name { font-size: 13px; font-weight: 600; }
.sec-sig-hint { font-size: 11px; color: var(--text-faint); margin-top: 1px; line-height: 1.3; }
.sec-sig-weight { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 9px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-faint); }
.sec-weight { width: 56px; text-align: center; }
.sec-inline-sw { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 13px; color: var(--text-dim); }
.sec-rp-rows { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.sec-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 1px solid var(--border-soft); }
.sec-rp-result { font-size: 13px; padding: 11px 13px; background: var(--panel-2); border: 1px solid var(--border-soft); border-radius: 10px; margin-bottom: 8px; }
.sec-rp-ok { color: var(--green-text); }
.sec-rp-bad { color: var(--red); display: inline-flex; align-items: center; gap: 6px; }
.sec-rp-bad .ic-svg, .sec-rp-ok .ic-svg { width: 15px; height: 15px; vertical-align: -2px; }
.sec-savebar { position: sticky; bottom: 0; display: flex; justify-content: flex-end; padding: 14px 0 4px; background: linear-gradient(to top, var(--bg) 60%, transparent); }
@media (max-width: 760px) { .sec-grid { grid-template-columns: 1fr; } }

/* ---------- Account security (Telegram 2FA) ---------- */
.acct-sec-head { display: flex; align-items: center; gap: 16px; }
.acct-sec-ic { flex: none; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.acct-sec-ic .ic-svg { width: 22px; height: 22px; color: var(--accent); }
.acct-sec-txt { flex: 1; min-width: 0; }
.acct-sec-title { font-size: 16px; font-weight: 600; margin-bottom: 2px; }
.acct-sec-badges { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.input-eye { position: relative; display: flex; align-items: center; }
.input-eye input { flex: 1; padding-right: 40px; }
.eye-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--text-faint); padding: 6px; display: grid; place-items: center; border-radius: 7px; }
.eye-btn:hover { color: var(--text-dim); background: var(--panel-2); }
.eye-btn .ic-svg { width: 17px; height: 17px; }
.twofa-form-code, #twofa-code { letter-spacing: 6px; text-align: center; font-family: ui-monospace, Menlo, monospace; font-size: 18px; }
@media (max-width: 640px) { .acct-sec-head { flex-wrap: wrap; } .acct-sec-badges { justify-content: flex-start; } }

/* ---------- Visitor Traffic master switch (dashboard) ---------- */
.vt-master { display: inline-flex; align-items: center; gap: 9px; margin-left: 8px; padding-left: 14px; border-left: 1px solid var(--border-soft); cursor: pointer; }
.vt-master-label { font-size: 11px; letter-spacing: 1px; color: var(--text-faint); font-weight: 600; }
@media (max-width: 560px) { .vt-master { margin-left: 0; padding-left: 0; border-left: none; } }

/* ---------- Visitors: multi-select + bulk actions ---------- */
.vis-selectall { background: none; border: none; color: var(--accent); font: inherit; font-size: 12px; cursor: pointer; padding: 2px 4px; }
.vis-selectall:hover { text-decoration: underline; }
.vis-card.picked { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--panel-2)); }
.vis-card-check { flex: none; width: 17px; height: 17px; border-radius: 5px; border: 1.5px solid var(--border); background: var(--panel); color: #fff; font-size: 11px; line-height: 1; display: grid; place-items: center; cursor: pointer; padding: 0; }
.vis-card-check:hover { border-color: var(--accent); }
.vis-card-check.on { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; }
.vis-bulk-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; padding: 8px 10px; background: color-mix(in srgb, var(--accent) 10%, var(--panel-2)); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-radius: 10px; }
.vis-bulk-n { font-size: 12.5px; font-weight: 600; color: var(--accent); }

/* ---------- Telegram approve/decline status note ---------- */
.tg-actions-note { display: flex; align-items: flex-start; gap: 9px; margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--border-soft); font-size: 12.5px; color: var(--text-dim); line-height: 1.45; }
.tg-actions-note b { color: var(--text); font-weight: 600; }
.tg-actions-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; background: var(--text-faint); }
.tg-actions-note.on { background: color-mix(in srgb, var(--green) 10%, transparent); border-color: color-mix(in srgb, var(--green) 35%, transparent); }
.tg-actions-note.on .tg-actions-dot { background: var(--green); box-shadow: 0 0 8px -1px var(--green); }

/* ---------- Manage session: journey timeline ---------- */
.ms-journey { max-height: none; }
.ms-journey .ev-row { padding: 8px 0; }
