:root {
  --bg: #080c24;
  --bg-2: #0c1230;
  --card: rgba(18, 24, 58, .72);
  --card-solid: #121838;
  --border: rgba(110, 125, 255, .16);
  --border-strong: rgba(120, 135, 255, .32);
  --text: #eef0ff;
  --muted: #8d94bf;
  --dim: #5d6491;

  --blue: #3b82f6;
  --cyan: #22d3ee;
  --purple: #a855f7;
  --violet: #7c3aed;
  --green: #22c55e;
  --red: #ef4444;
  --amber: #f59e0b;

  --radius: 16px;
  --sidebar-w: 264px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Inter Variable", Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  background:
    radial-gradient(900px 500px at 80% -10%, rgba(124, 58, 237, .18), transparent 60%),
    radial-gradient(800px 500px at 10% 110%, rgba(59, 130, 246, .12), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: #7aa2ff; text-decoration: none; }
a:hover { color: #a5c0ff; }
h1, h2, h3 { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.icon { width: 20px; height: 20px; flex: none; }

/* ---------- Buttons & forms ---------- */
.btn {
  font: inherit; font-weight: 600; border: 0; border-radius: 10px; padding: 11px 18px;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: filter .15s, background .15s, opacity .15s; color: #fff;
}
.btn .icon { width: 18px; height: 18px; }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-primary { background: linear-gradient(90deg, #3b5bfd, #7c3aed); box-shadow: 0 6px 24px rgba(91, 76, 255, .35); }
.btn-primary:hover { filter: brightness(1.12); }
.btn-outline { background: rgba(124, 58, 237, .14); border: 1px solid rgba(139, 92, 246, .55); color: #c4b5fd; }
.btn-outline:hover { background: rgba(124, 58, 237, .26); }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
  background: rgba(255, 255, 255, .03); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); cursor: pointer;
}
.icon-btn:hover { border-color: var(--border-strong); }
.icon-btn.round { border-radius: 50%; }

.form { display: grid; gap: 16px; }
.form label { display: grid; gap: 7px; font-size: 13px; color: var(--muted); font-weight: 500; }
.form input {
  font: inherit; font-size: 14.5px; color: var(--text); width: 100%;
  background: rgba(8, 12, 36, .7); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px;
}
.form input:focus { outline: none; border-color: #6d7bff; box-shadow: 0 0 0 3px rgba(109, 123, 255, .2); }
.code-input { letter-spacing: .5em; text-align: center; font-size: 20px; font-variant-numeric: tabular-nums; }

.alert { border-radius: 10px; padding: 11px 14px; margin-bottom: 16px; font-size: 13.5px; }
.alert-error { background: rgba(239, 68, 68, .1); color: #fca5a5; border: 1px solid rgba(239, 68, 68, .3); }
.alert-ok { background: rgba(34, 197, 94, .1); color: #86efac; border: 1px solid rgba(34, 197, 94, .3); }
.alert-info { background: rgba(124, 58, 237, .1); color: #c4b5fd; border: 1px solid rgba(139, 92, 246, .3); margin: 0; display: flex; gap: 10px; align-items: center; }
.alert-info .icon { width: 18px; height: 18px; }

/* ---------- Brand ---------- */
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #7c3aed); color: #fff;
  box-shadow: 0 6px 20px rgba(91, 76, 255, .45);
}
.brand-mark .icon { width: 22px; height: 22px; }
.brand-name { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }

/* ---------- Auth pages ---------- */
.auth-page { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.auth-card {
  width: 100%; max-width: 400px; background: var(--card); backdrop-filter: blur(14px);
  border: 1px solid var(--border); border-radius: 20px; padding: 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .04);
}
.auth-card-wide { max-width: 480px; }
.auth-head { text-align: center; margin-bottom: 26px; }
.auth-head .brand { justify-content: center; margin-bottom: 18px; }
.auth-head h1 { font-size: 22px; font-weight: 700; }
.auth-head p { margin: 4px 0 0; color: var(--muted); }
.setup-2fa {
  background: rgba(8, 12, 36, .6); border: 1px dashed var(--border-strong); border-radius: 12px;
  padding: 16px; font-size: 13.5px;
}
.setup-2fa p { margin: 6px 0 12px; }
.secret {
  display: block; background: rgba(124, 58, 237, .12); color: #ddd6fe; border-radius: 8px; padding: 12px;
  font: 600 15px ui-monospace, Consolas, monospace; text-align: center; letter-spacing: .06em;
  word-break: break-all; margin-bottom: 12px; user-select: all;
}

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: none; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  background: linear-gradient(180deg, rgba(14, 19, 52, .95), rgba(10, 14, 39, .95));
  border-right: 1px solid var(--border);
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 20px 18px; }
.nav-close { display: none; }

.nav { flex: 1; overflow-y: auto; padding: 6px 12px; display: grid; gap: 3px; align-content: start; }
.nav-item {
  display: flex; align-items: center; gap: 14px; padding: 11px 14px; border-radius: 11px;
  color: #c9cdf0; font-size: 14.5px; font-weight: 500; border: 1px solid transparent;
}
.nav-item:hover { background: rgba(255, 255, 255, .04); color: #fff; }
.nav-item.active {
  color: #fff; font-weight: 600;
  background: linear-gradient(90deg, rgba(59, 91, 253, .55), rgba(124, 58, 237, .35));
  border-color: rgba(120, 135, 255, .35);
  box-shadow: 0 6px 20px rgba(59, 91, 253, .25);
}
.nav-item.disabled { color: var(--dim); cursor: default; }
.nav-item.disabled:hover { background: none; color: var(--dim); }
.nav-item em {
  margin-left: auto; font-style: normal; font-size: 10.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; padding: 2px 7px; border-radius: 99px; background: rgba(255, 255, 255, .05);
}

.session-card {
  margin: 14px; padding: 16px; border-radius: 14px; display: grid; gap: 12px;
  background: linear-gradient(160deg, rgba(59, 91, 253, .16), rgba(124, 58, 237, .12));
  border: 1px solid var(--border);
}
.session-top { display: flex; gap: 12px; align-items: center; }
.session-top b { display: block; font-size: 14.5px; }
.session-top small { color: var(--muted); font-size: 12px; }
.session-icon { color: #c084fc; }
.session-icon .icon { width: 24px; height: 24px; }
.session-bar { width: 100%; height: 6px; display: block; }
.session-bar .bar-fill { fill: #8b5cf6; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 22px 28px 8px;
}
.topbar .spacer { flex: 1; }
.nav-open { display: none; }

/* Country clocks */
.clocks { display: flex; gap: 12px; min-width: 0; }
.clock {
  display: flex; align-items: center; gap: 12px; padding: 8px 16px 8px 8px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03);
}
.clock-code {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; flex: none;
  font-weight: 700; font-size: 13px; letter-spacing: .04em; color: #fff;
  background: linear-gradient(135deg, #3b5bfd, #7c3aed); box-shadow: 0 4px 14px rgba(91, 76, 255, .35);
}
.clock-body { display: grid; line-height: 1.2; }
.clock-body small { color: var(--muted); font-size: 12px; font-weight: 500; }
.clock-time { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

/* Load balancer cards */
.lbs { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.lb { display: grid; gap: 18px; padding: 22px 24px; align-content: start; }
.lb-top { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.lb-head { display: flex; align-items: center; gap: 16px; flex: 1; min-width: 220px; }
.lb-name { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 700; }
.lb-id small { color: var(--muted); font-size: 13.5px; }
.lb-metrics { display: flex; gap: 32px; }
.lb-metric { display: grid; gap: 2px; min-width: 110px; }
.lb-metric span { color: var(--muted); font-size: 13px; font-weight: 500; }
.lb-metric b { font-size: 26px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; }
.lb-bar { width: 110px; height: 6px; display: block; margin-top: 4px; }

/* Server group rows */
.group-row td {
  padding: 16px 12px 8px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: #a5b4fc; border-bottom: 1px solid var(--border); background: none !important;
}
.group-row span { margin-left: 10px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); }
tbody:first-of-type .group-row td { padding-top: 6px; }
td.users { font-weight: 600; font-variant-numeric: tabular-nums; }
.bell { position: relative; width: 44px; height: 44px; cursor: default; }
.avatar {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, #3b4a8f, #2a2f66); border: 1px solid var(--border-strong); color: #dfe3ff;
}

.content { padding: 18px 28px 28px; display: grid; gap: 20px; }

/* ---------- Cards ---------- */
.card {
  background: var(--card); backdrop-filter: blur(12px);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .03);
  min-width: 0;
}
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.card-head h2 { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-head h2 small { font-size: 14px; font-weight: 400; color: #b6bce0; }
.card-head h2 .icon { width: 16px; height: 16px; color: var(--muted); }
.card-head .spacer { flex: 1; }
.chip {
  font-size: 12px; padding: 3px 10px; border-radius: 99px; color: #b6bce0;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--border);
}
.link-more { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; font-size: 13.5px; }
.link-more .icon { width: 16px; height: 16px; }

.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13.5px; color: #c9cdf0; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.legend b { color: #fff; font-weight: 700; margin-left: 4px; }
.dot-blue { background: var(--blue); box-shadow: 0 0 8px var(--blue); }
.dot-purple { background: var(--purple); box-shadow: 0 0 8px var(--purple); }
.dot-cyan { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }

/* ---------- Stat cards ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.stat { display: flex; align-items: center; gap: 18px; padding: 20px; }
.stat-icon {
  display: grid; place-items: center; width: 62px; height: 62px; border-radius: 50%; flex: none;
}
.stat-icon .icon { width: 28px; height: 28px; }
.tone-blue   .stat-icon { background: radial-gradient(circle at 30% 30%, #4f7dff, #2340b8); color: #e0e8ff; box-shadow: 0 0 24px rgba(59, 130, 246, .45); }
.tone-green  .stat-icon { background: radial-gradient(circle at 30% 30%, #26c26a, #0d6b3a); color: #dcfce7; box-shadow: 0 0 24px rgba(34, 197, 94, .4); }
.tone-purple .stat-icon { background: radial-gradient(circle at 30% 30%, #7b5cff, #3b2a9e); color: #ede9fe; box-shadow: 0 0 24px rgba(124, 58, 237, .45); }
.tone-violet .stat-icon { background: radial-gradient(circle at 30% 30%, #8b5cf6, #4c1d95); color: #f3e8ff; box-shadow: 0 0 24px rgba(168, 85, 247, .45); }
.tone-green { background: linear-gradient(135deg, rgba(20, 83, 45, .35), var(--card)); }
.stat-body { flex: 1; min-width: 0; }
.stat-label { color: #d6d9f5; font-size: 15px; font-weight: 500; }
.stat-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.stat-value { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; white-space: nowrap; }
.delta { display: inline-flex; align-items: center; gap: 3px; color: var(--green); font-weight: 600; font-size: 14px; white-space: nowrap; }
.delta .icon { width: 15px; height: 15px; }
.pill-green { color: #4ade80; font-weight: 700; font-size: 14px; padding: 2px 10px; border-radius: 99px; background: rgba(34, 197, 94, .15); }


/* ---------- Charts ---------- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: rgba(255, 255, 255, .07); stroke-width: 1; }
.chart .axis { fill: #a3a9d4; font-size: 12px; font-family: inherit; }
.chart .line { fill: none; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 0 4px currentColor); }
.chart .last-dot { fill: var(--bg); stroke-width: 2.5; }
.chart .cross { stroke: rgba(255, 255, 255, .35); stroke-dasharray: 4 4; }
.chart .empty { fill: var(--muted); font-size: 14px; }

/* Traffic card */
.traffic-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: -4px 0 14px; }
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: rgba(8, 12, 36, .6); border: 1px solid var(--border); }
.seg button {
  font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); background: none; border: 0;
  padding: 6px 14px; border-radius: 8px; cursor: pointer;
}
.seg button:hover { color: var(--text); }
.seg button.active { color: #fff; background: linear-gradient(90deg, #3b5bfd, #7c3aed); box-shadow: 0 4px 14px rgba(91, 76, 255, .35); }
.date-pick {
  display: inline-flex; align-items: center; gap: 8px; padding: 0 10px; height: 38px; border-radius: 11px;
  background: rgba(8, 12, 36, .6); border: 1px solid var(--border); color: var(--muted);
}
.date-pick .icon { width: 16px; height: 16px; }
.date-pick input { font: inherit; font-size: 13px; color: var(--text); background: none; border: 0; outline: none; color-scheme: dark; }
.traffic-status { font-size: 12.5px; color: var(--muted); }
.traffic-status.is-live::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px;
  background: var(--green); box-shadow: 0 0 8px var(--green); vertical-align: 1px;
}
.traffic-chart { position: relative; min-height: 220px; }
.traffic-chart svg { width: 100%; height: auto; }
.chart-tip {
  position: absolute; top: 8px; pointer-events: none; z-index: 2; min-width: 170px;
  padding: 8px 12px; border-radius: 10px; font-size: 12.5px; line-height: 1.7;
  background: rgba(10, 14, 39, .95); border: 1px solid var(--border-strong); box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
}
.chart-tip b { display: block; font-size: 13px; }
.chart-tip i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; }
.legend .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; margin: 0 -6px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-weight: 500; color: #d6d9f5; padding: 8px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid rgba(110, 125, 255, .08); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255, 255, 255, .02); }
.srv { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.srv-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, .06); color: #c9cdf0; }
.srv-icon .icon { width: 17px; height: 17px; }
.srv b { display: block; font-weight: 600; font-size: 14px; }
.srv small { color: var(--muted); font-size: 12.5px; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-ok { color: #4ade80; background: rgba(34, 197, 94, .12); }
.status-bad { color: #f87171; background: rgba(239, 68, 68, .12); }
.uptime { color: #4ade80; font-weight: 600; white-space: nowrap; }
.mini { display: grid; gap: 4px; min-width: 70px; }
.mini span { font-size: 12.5px; color: #d6d9f5; }
.bar { width: 70px; height: 6px; display: block; }
.bar-track { fill: rgba(255, 255, 255, .08); }
.bar-cpu .bar-fill { fill: var(--blue); }
.bar-ram .bar-fill { fill: var(--purple); }
.bar-disk .bar-fill { fill: var(--cyan); }
tr.is-hidden { display: none; }

/* ---------- Activity feed ---------- */
.feed { list-style: none; margin: 0; padding: 0; }
.feed-item { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid rgba(110, 125, 255, .08); }
.feed-item:last-child { border-bottom: 0; }
.feed-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); margin-top: 6px; flex: none; box-shadow: 0 0 8px var(--green); }
.feed-item.is-bad .feed-dot { background: var(--red); box-shadow: 0 0 8px var(--red); }
.feed-body { flex: 1; min-width: 0; }
.feed-title { font-weight: 500; }
.feed-meta { text-align: right; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.feed-meta b { display: block; color: #d6d9f5; font-weight: 500; }
.prev-login { display: flex; gap: 10px; align-items: center; padding: 10px 12px; margin-bottom: 8px; border-radius: 10px; background: rgba(59, 130, 246, .08); border: 1px solid rgba(59, 130, 246, .2); font-size: 13px; color: #c9cdf0; }
.prev-login .icon { width: 18px; height: 18px; color: #7aa2ff; }

/* ---------- Grid rows ---------- */
.row { display: grid; gap: 20px; }
.row-a { grid-template-columns: 1fr 1.3fr; }

.overlay { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1400px) {
  .lb { gap: 16px; }
  .lb-metrics { gap: 22px; }
  .lb-metric b { font-size: 22px; }
}
@media (max-width: 1200px) {
  .row-a, .lbs { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  html, body { overflow-x: hidden; }
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 30; height: 100%;
    width: min(var(--sidebar-w), 84vw);
    transform: translateX(-100%); visibility: hidden;
    transition: transform .22s ease, visibility .22s;
  }
  body.nav-open .sidebar { transform: none; visibility: visible; box-shadow: 10px 0 40px rgba(0, 0, 0, .5); }
  body.nav-open .overlay { display: block; position: fixed; inset: 0; background: rgba(3, 5, 20, .6); z-index: 20; }
  .nav-open, .nav-close { display: inline-grid; }
  .topbar { padding: 14px 16px 4px; gap: 10px; }
  .bell, .avatar { width: 40px; height: 40px; }
  .content { padding: 12px 16px 20px; gap: 14px; }
  .card, .clock { backdrop-filter: none; background: var(--card-solid); }
}
@media (max-width: 700px) {
  /* clocks get their own full-width row under the menu button */
  .topbar { flex-wrap: wrap; }
  .clocks { order: 5; width: 100%; gap: 8px; }
  .clock { flex: 1; min-width: 0; padding: 7px 8px; gap: 8px; }
  .clock-code { width: 30px; height: 30px; font-size: 11px; border-radius: 8px; }
  .clock-body small { font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .clock-time { font-size: 16px; }
}
@media (max-width: 600px) {
  .card { padding: 16px; }
  .card-head h2 { font-size: 16px; }
  .lb { padding: 16px; }
  .lb-head { min-width: 0; }
  .lb-name { font-size: 19px; }
  .lb-metrics { width: 100%; justify-content: space-between; }
  .chart .axis { font-size: 17px; }
  .bell { display: none; }
  /* Servers table fits a phone: no icon */
  .srv-icon { display: none; }
  th, td { padding-left: 6px; padding-right: 6px; }
  .srv b { font-size: 13.5px; }
  .srv small { font-size: 11.5px; }
  .status { padding: 2px 8px; font-size: 11.5px; }
  .mini, .bar { min-width: 0; width: 56px; }
  .group-row td { padding-left: 6px; }
}

/* ---------- Load balancer link + actions ---------- */
.lb-metric small { color: var(--muted); font-size: 12px; }
.lb-metric b em { font-style: normal; font-size: 15px; font-weight: 600; color: #c9cdf0; }
.link { display: grid; gap: 7px; padding: 14px 16px; border-radius: 12px; background: rgba(8, 12, 36, .45); border: 1px solid var(--border); }
.link-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; color: var(--muted); font-size: 13px; font-weight: 500; }
.link-row > b { font-size: 18px; color: var(--text); }
.link-row.small { font-size: 12.5px; }
.link-row.small b { color: var(--text); font-weight: 700; }
.link-bar { width: 100%; height: 8px; display: block; }
.link-ok .bar-fill { fill: var(--green); }
.link-warn .bar-fill { fill: var(--amber); }
.link-bad .bar-fill { fill: var(--red); }
.link-ok .link-row > b { color: #4ade80; }
.link-warn .link-row > b { color: #fbbf24; }
.link-bad .link-row > b { color: #f87171; }

.btn-sm { padding: 9px 14px; font-size: 13.5px; border-radius: 10px; }
.btn-sm .icon { width: 16px; height: 16px; }
.btn-ghost { background: rgba(59, 130, 246, .12); border: 1px solid rgba(59, 130, 246, .45); color: #bfdbfe; }
.btn-ghost:hover { background: rgba(59, 130, 246, .22); }
.btn[data-unset] { opacity: .55; }
.btn.is-busy { opacity: .7; cursor: progress; }
.lb-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lb-actions .btn span, .actions-row .btn span { white-space: nowrap; }
.actions-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.actions-card .card-head { margin-bottom: 14px; }

/* ---------- Confirm dialog ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(3, 5, 20, .65); backdrop-filter: blur(3px); }
.modal[hidden] { display: none; }
.modal-card { width: 100%; max-width: 420px; background: var(--card-solid); border: 1px solid var(--border-strong); border-radius: 18px; padding: 24px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.modal-card h3 { font-size: 18px; margin-bottom: 8px; }
.modal-card p { margin: 0 0 20px; color: #c9cdf0; line-height: 1.6; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: grid; gap: 10px; width: min(380px, calc(100vw - 40px)); }
.toast {
  position: relative; padding: 12px 36px 12px 14px; border-radius: 12px; font-size: 13.5px; line-height: 1.5;
  background: var(--card-solid); border: 1px solid var(--border-strong); box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
  border-left: 4px solid var(--blue); transition: opacity .3s, transform .3s; word-break: break-word;
}
.toast b { display: block; margin-bottom: 2px; }
.toast div { color: #c9cdf0; }
.toast-ok { border-left-color: var(--green); }
.toast-bad { border-left-color: var(--red); }
.toast-info { border-left-color: var(--amber); }
.toast.out { opacity: 0; transform: translateY(8px); }
.toast-x { position: absolute; top: 6px; right: 8px; background: none; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; line-height: 1; }

@media (max-width: 600px) {
  .lb-actions { grid-template-columns: 1fr 1fr; gap: 8px; }
  .actions-row { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .lb-actions .btn, .actions-row .btn { flex-direction: column; gap: 4px; padding: 9px 6px; font-size: 12px; text-align: center; }
  .link-row.small { flex-direction: column; gap: 2px; }
  .toasts { right: 12px; left: 12px; bottom: 12px; width: auto; }
}
@media (max-width: 1200px) and (min-width: 601px) {
  /* cards are full width here: all four buttons fit in one row */
  .lb-actions { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Domains page ---------- */
.add-domain { display: grid; grid-template-columns: 1.5fr 1fr 1fr .8fr auto; gap: 14px; align-items: end; }
.add-domain label { display: grid; gap: 7px; font-size: 13px; color: var(--muted); font-weight: 500; }
.add-domain input, .add-domain select {
  font: inherit; font-size: 14.5px; color: var(--text); width: 100%;
  background: rgba(8, 12, 36, .7); border: 1px solid var(--border); border-radius: 10px; padding: 11px 14px;
}
.add-domain input:focus, .add-domain select:focus { outline: none; border-color: #6d7bff; box-shadow: 0 0 0 3px rgba(109, 123, 255, .2); }
.add-domain .btn { height: 46px; white-space: nowrap; }
.form-alert { margin-bottom: 14px; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; color: #d6d9f5; }
.col-action { text-align: right; width: 1%; white-space: nowrap; }
table.domains td { padding-top: 9px; padding-bottom: 9px; }
@media (max-width: 700px) {
  .add-domain { grid-template-columns: 1fr; }
  .add-domain .btn { width: 100%; }
}
select { color-scheme: dark; }
.add-domain select { cursor: pointer; }
.nowrap { white-space: nowrap; }
.empty-row { text-align: center; padding: 28px 12px !important; }

/* App tags (colour picked per app name) */
.tag { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.tag-0 { color: #93c5fd; background: rgba(59, 130, 246, .14); border-color: rgba(59, 130, 246, .3); }
.tag-1 { color: #d8b4fe; background: rgba(168, 85, 247, .14); border-color: rgba(168, 85, 247, .3); }
.tag-2 { color: #67e8f9; background: rgba(34, 211, 238, .12); border-color: rgba(34, 211, 238, .3); }
.tag-3 { color: #f9a8d4; background: rgba(236, 72, 153, .13); border-color: rgba(236, 72, 153, .3); }
.tag-4 { color: #fcd34d; background: rgba(245, 158, 11, .12); border-color: rgba(245, 158, 11, .3); }
.tag-5 { color: #a5b4fc; background: rgba(99, 102, 241, .15); border-color: rgba(99, 102, 241, .32); }

/* Status dropdown styled as a pill */
.status-form { margin: 0; }
.status-select {
  font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; border-radius: 99px;
  padding: 4px 26px 4px 12px; border: 1px solid transparent; appearance: none; -webkit-appearance: none;
  background-repeat: no-repeat; background-position: right 9px center; background-size: 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23a3a9d4' stroke-width='1.5'/%3E%3C/svg%3E");
}
.status-select option { background: #121838; color: #eef0ff; }
.st-active   { color: #4ade80; background-color: rgba(34, 197, 94, .12);  border-color: rgba(34, 197, 94, .3); }
.st-blocked  { color: #f87171; background-color: rgba(239, 68, 68, .12);  border-color: rgba(239, 68, 68, .3); }
.st-reserved { color: #fbbf24; background-color: rgba(245, 158, 11, .12); border-color: rgba(245, 158, 11, .3); }

.row-actions { display: inline-flex; gap: 8px; align-items: center; }
.row-actions form { margin: 0; }
.icon-btn.danger { width: 36px; height: 36px; color: #fca5a5; border-color: rgba(239, 68, 68, .35); background: rgba(239, 68, 68, .08); }
.icon-btn.danger:hover { background: rgba(239, 68, 68, .2); }
.icon-btn.danger .icon { width: 17px; height: 17px; }

.seg button em { font-style: normal; opacity: .65; margin-left: 4px; font-weight: 500; }
.app-filter {
  font: inherit; font-size: 13px; color: var(--text); height: 38px; padding: 0 12px; border-radius: 11px; cursor: pointer;
  background: rgba(8, 12, 36, .6); border: 1px solid var(--border);
}

@media (max-width: 1200px) {
  .add-domain { grid-template-columns: 1fr 1fr; }
  .add-domain .btn { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .add-domain { grid-template-columns: 1fr; }
}
.feed-detail { font-size: 13px; color: #d6d9f5; margin: 1px 0 2px; word-break: break-word; }
@media (max-width: 1100px) {
  /* keep the domain table inside the card without sideways scrolling */
  table.domains .srv-icon { display: none; }
  table.domains th, table.domains td { padding-left: 8px; padding-right: 8px; }
  table.domains .row-actions .btn span { display: none; }
  table.domains .row-actions .btn { width: 36px; height: 36px; padding: 0; }
}

/* ---------- V2Ray Ping page ---------- */
.proto { display: inline-block; padding: 3px 10px; border-radius: 8px; font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: #c4b5fd; background: rgba(124, 58, 237, .15); border: 1px solid rgba(139, 92, 246, .32); }
.proto-vless, .proto-vmess { color: #93c5fd; background: rgba(59, 130, 246, .14); border-color: rgba(59, 130, 246, .3); }
.proto-trojan { color: #67e8f9; background: rgba(34, 211, 238, .12); border-color: rgba(34, 211, 238, .3); }
.col-result { text-align: right; width: 1%; white-space: nowrap; }
.result { display: inline-block; min-width: 86px; text-align: center; padding: 4px 12px; border-radius: 99px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); background: rgba(255, 255, 255, .04); border: 1px solid var(--border); }
.result.r-ok   { color: #4ade80; background: rgba(34, 197, 94, .12);  border-color: rgba(34, 197, 94, .3); }
.result.r-warn { color: #fbbf24; background: rgba(245, 158, 11, .12); border-color: rgba(245, 158, 11, .3); }
.result.r-bad  { color: #f87171; background: rgba(239, 68, 68, .12);  border-color: rgba(239, 68, 68, .3); }
.result.is-testing { color: #c4b5fd; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }
@media (max-width: 700px) {
  table.v2ray .srv-icon { display: none; }
  table.v2ray th, table.v2ray td { padding-left: 6px; padding-right: 6px; }
  .result { min-width: 0; padding: 3px 8px; font-size: 12px; }
}

/* ---------- Revenue (dashboard) ---------- */
.rev-top { display: grid; grid-template-columns: 1.1fr 2fr; gap: 16px; }
.rev-main {
  padding: 18px 20px; border-radius: 14px; display: grid; gap: 4px; align-content: center;
  background: linear-gradient(135deg, rgba(20, 83, 45, .38), rgba(18, 24, 58, .6)); border: 1px solid rgba(34, 197, 94, .25);
}
.rev-label { color: #bbf7d0; font-size: 13px; font-weight: 500; }
.rev-total { font-size: 40px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.rev-change { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; margin-top: 4px; }
.rev-pill { padding: 3px 10px; border-radius: 99px; background: rgba(34, 197, 94, .14); font-weight: 700; font-size: 14px; }
.rev-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.rev-kpi { padding: 16px 18px; border-radius: 14px; background: rgba(8, 12, 36, .45); border: 1px solid var(--border); display: grid; gap: 2px; align-content: center; }
.rev-kpi span:first-child { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.rev-kpi b { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.rev-kpi > span:last-child { font-size: 12.5px; font-weight: 600; }
.delta-up { color: #4ade80; font-weight: 700; }
.delta-down { color: #f87171; font-weight: 700; }
.delta-flat { color: var(--muted); font-weight: 600; }
@media (max-width: 1200px) {
  .rev-top { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .rev-total { font-size: 32px; }
  .rev-kpis { grid-template-columns: 1fr 1fr; }
  .rev-kpis .rev-kpi:last-child { grid-column: 1 / -1; }
  .rev-kpi b { font-size: 19px; }
}

/* ---------- Income page ---------- */
.earn-summary {
  background: radial-gradient(700px 260px at 15% 0%, rgba(124, 58, 237, .28), transparent 70%),
              linear-gradient(135deg, rgba(23, 28, 70, .95), rgba(14, 18, 48, .95));
  border-color: rgba(139, 92, 246, .3);
}
.uptodate { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 600; color: #4ade80; background: rgba(34, 197, 94, .1); border: 1px solid rgba(34, 197, 94, .35); }
.uptodate .icon { width: 15px; height: 15px; }
.earn-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.earn-box { padding: 16px 18px; border-radius: 14px; background: rgba(8, 12, 36, .5); border: 1px solid var(--border); display: grid; gap: 4px; }
.earn-box > span { color: #c9cdf0; font-size: 13px; font-weight: 500; }
.earn-box b { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.earn-box small { font-size: 12.5px; }
.earn-box small em { font-style: normal; font-weight: 500; opacity: .85; }
.rep-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.rep-nav .btn:disabled { opacity: .4; cursor: default; }
.rev-table td.num, .rev-table th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rev-table tr.total-row td { font-weight: 700; border-top: 1px solid var(--border-strong); background: rgba(255, 255, 255, .02); }
[data-income-report] .rev-top { margin-bottom: 16px; }
@media (max-width: 1200px) {
  .earn-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .earn-box b { font-size: 24px; }
  .rep-nav { width: 100%; }
  .rep-nav .btn { flex: 1; }
}

/* Dashboard revenue: per-app Show Rate / Fill Rate (one compact line each) */
.app-rates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
@media (min-width: 1800px) { .app-rates { grid-template-columns: repeat(4, 1fr); } }
.app-rate {
  display: flex; align-items: baseline; gap: 12px; padding: 8px 12px; border-radius: 10px; white-space: nowrap;
  background: rgba(8, 12, 36, .45); border: 1px solid var(--border); font-size: 12.5px; color: var(--muted);
}
.app-rate > b { color: var(--text); font-size: 13px; margin-right: auto; }
.app-rate { min-width: 0; overflow: hidden; }
.app-rate strong { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) { .app-rates { grid-template-columns: 1fr; } }

/* ---------- Shared bits ---------- */
.modal-card p { white-space: pre-line; }
.spin { display: inline-block; width: 13px; height: 13px; border: 2px solid rgba(255, 255, 255, .25); border-top-color: #a5b4fc; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-teal { background: rgba(20, 184, 166, .16); border: 1px solid rgba(45, 212, 191, .45); color: #99f6e4; }
.btn-teal:hover { background: rgba(20, 184, 166, .28); }
.btn-danger-soft { background: rgba(239, 68, 68, .14); border: 1px solid rgba(239, 68, 68, .45); color: #fecaca; }
.btn-danger-soft:hover { background: rgba(239, 68, 68, .24); }
.btn-dark { background: rgba(255, 255, 255, .06); border: 1px solid var(--border-strong); color: #e2e8f0; }
.btn-violet { background: rgba(124, 58, 237, .22); border: 1px solid rgba(167, 139, 250, .5); color: #ddd6fe; }
.btn b { font-weight: 800; }

/* ---------- IPXO ---------- */
.ix-tabs { display: flex; gap: 8px; }
.ix-tabs a {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 11px; font-weight: 600; font-size: 14px;
  color: var(--muted); background: rgba(8, 12, 36, .5); border: 1px solid var(--border); text-decoration: none;
}
.ix-tabs a .icon { width: 17px; height: 17px; }
.ix-tabs a:hover { color: var(--text); }
.ix-tabs a.active { color: #fff; background: linear-gradient(90deg, rgba(59, 91, 253, .55), rgba(124, 58, 237, .35)); border-color: rgba(120, 135, 255, .35); }

.ix-filters { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.ix-filters label { display: grid; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.ix-filters input, .ix-filters select, .ix-bar select, .ix-tools select, .ix-tools textarea, .ms-search {
  font: inherit; font-size: 13.5px; color: var(--text); background: rgba(8, 12, 36, .7);
  border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; width: 100%; color-scheme: dark;
}
.ix-filters input:focus, .ix-filters select:focus, .ix-tools textarea:focus { outline: none; border-color: #6d7bff; }
.ix-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.ix-bar select { width: auto; }
.ix-bar .spacer { flex: 1; }
.ix-tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.ix-tools .card-head { margin-bottom: 6px; }
.ix-tools .card-head h2 { font-size: 16px; }
.ix-help { margin: 0 0 10px; line-height: 1.5; }
.ix-tools textarea { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; resize: vertical; min-height: 84px; }
.ix-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.ix-row select { width: auto; flex: 1; min-width: 120px; }
.ix-result { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; background: rgba(8, 12, 36, .6); border: 1px solid var(--border); font-size: 12.5px; white-space: pre-wrap; color: #c9cdf0; }

.ix-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.ms-stats { grid-template-columns: repeat(4, 1fr); }
.ix-stat { padding: 14px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--border); display: grid; gap: 2px; }
.ix-stat > span { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.ix-stat b { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.ix-stat b i { font-style: normal; }
.ix-stat b small { font-size: 13px; font-weight: 500; color: var(--muted); }
.c-ok { color: #4ade80; } .c-loss { color: #fbbf24; } .c-gts { color: #c4b5fd; } .c-block { color: #f87171; } .c-no { color: #cbd5e1; }

.ix-table { font-size: 13px; }
.ix-table td { padding-top: 8px; padding-bottom: 8px; }
.ix-table .w-num { width: 38px; } .ix-table .w-sel { width: 30px; }
.ix-table tr.is-sel td { background: rgba(124, 58, 237, .1) !important; }
.sel { width: 15px; height: 15px; accent-color: #7c3aed; cursor: pointer; }
.sort-h { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.sort-h span { color: #a5b4fc; margin-left: 2px; }
.ix-subnet { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ix-subnet .mono { font-weight: 600; color: var(--text); font-size: 13px; }
.ix-copy { width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--border); background: rgba(255, 255, 255, .04); color: var(--muted); cursor: pointer; font-size: 13px; line-height: 1; }
.ix-copy:hover { color: #fff; border-color: #6d7bff; }
.ix-copy.ok { color: #4ade80; border-color: rgba(34, 197, 94, .5); }
.ix-price { font-weight: 700; white-space: nowrap; }
.ix-time { margin-left: 8px; color: var(--dim); font-size: 11.5px; white-space: nowrap; }
.ix-badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 700; white-space: nowrap; border: 1px solid transparent; }
.ix-badge.sm { padding: 1px 8px; font-size: 11px; }
.ix-ok { color: #4ade80; background: rgba(34, 197, 94, .12); border-color: rgba(34, 197, 94, .3); }
.ix-loss { color: #fbbf24; background: rgba(245, 158, 11, .12); border-color: rgba(245, 158, 11, .3); }
.ix-gts { color: #c4b5fd; background: rgba(139, 92, 246, .14); border-color: rgba(139, 92, 246, .35); }
.ix-block { color: #f87171; background: rgba(239, 68, 68, .12); border-color: rgba(239, 68, 68, .3); }
.ix-no { color: #cbd5e1; background: rgba(148, 163, 184, .1); border-color: rgba(148, 163, 184, .25); }
.ix-prot { color: #93c5fd; background: rgba(59, 130, 246, .14); border-color: rgba(59, 130, 246, .35); }
.ix-res { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ix-ips { font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; color: #c9cdf0; }
.ix-tm, .ix-scan { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }

.ix-acts { display: flex; gap: 5px; align-items: center; flex-wrap: nowrap; }
.xb {
  font: inherit; font-size: 11.5px; font-weight: 700; height: 28px; padding: 0 10px; border-radius: 8px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--border); background: rgba(255, 255, 255, .04); color: #c9cdf0;
}
.xb:hover { filter: brightness(1.25); }
.xb:disabled { opacity: .5; cursor: default; filter: none; }
.xb.sm { height: 24px; padding: 0 8px; font-size: 11px; }
.xb-blue { color: #bfdbfe; background: rgba(59, 130, 246, .16); border-color: rgba(59, 130, 246, .4); }
.xb-violet { color: #ddd6fe; background: rgba(124, 58, 237, .2); border-color: rgba(167, 139, 250, .45); }
.xb-teal { color: #99f6e4; background: rgba(20, 184, 166, .14); border-color: rgba(45, 212, 191, .4); }
.xb-teal.is-added { color: #fff; background: #15803d; border-color: #16a34a; }
.xb-teal.is-failed { color: #fff; background: #b91c1c; border-color: #dc2626; }
.xb-dark { color: #e2e8f0; background: rgba(255, 255, 255, .07); border-color: var(--border-strong); }
.xb-ghost { color: #e2e8f0; }
.xb-locked { color: var(--dim); background: rgba(255, 255, 255, .03); }
.xg-ok { color: #4ade80; } .xg-loss { color: #fbbf24; } .xg-gts { color: #c4b5fd; } .xg-block { color: #f87171; }
.xb-group { display: inline-flex; }
.xb-group .xb { border-radius: 0; margin-left: -1px; }
.xb-group .xb:first-child { border-radius: 8px 0 0 8px; margin-left: 0; }
.xb-group .xb:last-child { border-radius: 0 8px 8px 0; }

.ix-select { font: inherit; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 99px; cursor: pointer; color-scheme: dark; }
.ix-select option { background: #121838; color: #eef0ff; }
.ms-mixed { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.ms-days { font-size: 11.5px; font-weight: 600; margin-top: 2px; }
.ms-days.soon { color: #f87171; } .ms-days.mid { color: #fbbf24; } .ms-days.far { color: #4ade80; }
.ms-bar { margin: 0 0 14px; }
.ms-search { display: flex; align-items: center; gap: 8px; width: 220px; padding: 0 10px; }
.ms-search input { flex: 1; min-width: 0; background: none; border: 0; color: var(--text); font: inherit; outline: none; padding: 8px 0; }
.ms-search .icon { width: 16px; height: 16px; color: var(--muted); }

@media (max-width: 1400px) {
  .ix-tools { grid-template-columns: 1fr 1fr; }
  .ix-filters { grid-template-columns: repeat(3, 1fr); }
  .ix-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .ix-tools { grid-template-columns: 1fr; }
  .ix-filters, .ix-stats, .ms-stats { grid-template-columns: 1fr 1fr; }
  .ms-search { width: 100%; }
}

/* ---------- Notebook ---------- */
.nb-lock { max-width: 420px; margin: 40px auto 0; text-align: center; display: grid; justify-items: center; gap: 6px; padding: 32px; }
.nb-lock h2 { font-size: 20px; }
.nb-lock p { margin: 0 0 10px; }
.nb-lock-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: linear-gradient(135deg, #3b82f6, #7c3aed); color: #fff; margin-bottom: 6px; box-shadow: 0 6px 20px rgba(91, 76, 255, .45); }
.nb-lock-icon .icon { width: 26px; height: 26px; }
.nb-lock-form { width: 100%; }
.nb-lock-form input { font: inherit; color: var(--text); background: rgba(8, 12, 36, .7); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; width: 100%; }
.nb-lock-form input:focus { outline: none; border-color: #6d7bff; }
.nb-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nb-top .spacer { flex: 1; }
.nb-top form { margin: 0; }
.btn.is-on { border-color: #6d7bff; color: #fff; }

.nb-add { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.nb-add input, .nb-add select, .nb-amount input {
  font: inherit; font-size: 13.5px; color: var(--text); background: rgba(8, 12, 36, .7);
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; color-scheme: dark;
}
.nb-add input:focus, .nb-add select:focus, .nb-amount input:focus { outline: none; border-color: #6d7bff; }
.nb-add input[name="text"], .nb-add input[name="name"] { flex: 2; min-width: 200px; }
.nb-add input[name="note"] { flex: 1.5; min-width: 150px; }
.nb-add input[name="amount"] { width: 120px; }
.nb-add .nb-cur { width: 80px; text-transform: uppercase; }
.nb-due { display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; border-radius: 10px; background: rgba(8, 12, 36, .7); border: 1px solid var(--border); color: var(--muted); }
.nb-due .icon { width: 16px; height: 16px; }
.nb-due input { border: 0; background: none; padding: 9px 0; }

.nb-tasks { list-style: none; margin: 0; padding: 0; }
.nb-tasks li { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid rgba(110, 125, 255, .08); }
.nb-tasks li:last-child { border-bottom: 0; }
.nb-tasks form { margin: 0; }
.nb-text { flex: 1; min-width: 0; font-size: 14.5px; word-break: break-word; }
.nb-tasks li.is-done .nb-text { color: var(--dim); text-decoration: line-through; }
.nb-box {
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; cursor: pointer; padding: 0;
  border: 2px solid rgba(165, 180, 252, .55); background: transparent; color: #fff;
}
.nb-box:hover { border-color: #a5b4fc; background: rgba(124, 58, 237, .2); }
.nb-tasks li.is-done .nb-box { background: #7c3aed; border-color: #7c3aed; }
.nb-box .icon { width: 14px; height: 14px; stroke-width: 3; }
.nb-del .icon-btn, .nb-table .icon-btn.danger { width: 32px; height: 32px; }

.nb-sums { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 12px; }
.nb-sum { padding: 14px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--border); display: grid; gap: 2px; align-content: start; }
.nb-sum > span { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.nb-sum b { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.nb-sum-main { background: linear-gradient(135deg, rgba(59, 91, 253, .22), rgba(124, 58, 237, .14)); border-color: rgba(139, 92, 246, .35); }
.nb-sum-main b { font-size: 26px; }
.nb-table td.num, .nb-table th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.nb-amount { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.nb-amount input { width: 120px; text-align: right; padding: 6px 10px; font-weight: 700; }
@media (max-width: 1100px) { .nb-sums { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) {
  .nb-sums { grid-template-columns: 1fr; }
  .nb-add input, .nb-add select, .nb-add .btn { flex: 1 1 100%; width: 100%; }
}
tr.is-stale td { opacity: .55; }

/* ---------- Output dialog (GTS loss log) ---------- */
.modal-card.modal-wide { max-width: 760px; }
.output-box { margin: 0 0 18px; padding: 14px; max-height: 60vh; overflow: auto; background: rgba(3, 5, 20, .55); border: 1px solid var(--border); border-radius: 12px; color: #d6daf7; font: 12.5px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }

/* Buttons turned off in config (disabled_actions) */
.btn:disabled:not(.is-busy) { opacity: .4; cursor: not-allowed; }

/* Group header with buttons (Russia: Change All IPs / Check All) */
.group-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.group-head .row-actions { text-transform: none; letter-spacing: 0; }

/* Load balancer VM IP + copy button */
.vm-ip { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 13.5px; color: var(--muted); }
.vm-ip span { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; padding: 1px 6px; border-radius: 6px; background: rgba(139, 92, 246, .18); color: #c4b5fd; }
.vm-ip code { font: inherit; color: #d6daf7; }
.copy-btn { display: inline-grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 1px solid var(--border); border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; transition: color .15s, border-color .15s; }
.copy-btn:hover { color: #fff; border-color: var(--border-strong); }
.copy-btn .icon { width: 13px; height: 13px; }
.copy-btn.is-copied { color: var(--green); border-color: var(--green); }
.sr-copy { position: fixed; top: 0; left: 0; opacity: 0; pointer-events: none; }
.vm-ip.ads-ip { margin-top: 0; }

/* ---------- Change Region ---------- */
.region-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.region-card { display: grid; gap: 14px; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: rgba(255, 255, 255, .02); margin: 0; }
.region-top { display: flex; align-items: center; gap: 12px; }
.region-top b { display: block; font-size: 17px; }
.region-top small { color: var(--muted); font-size: 13px; }
.region-now { color: #c4b5fd; font-weight: 600; }
.region-row { display: flex; gap: 8px; }
.region-row select { flex: 1; min-width: 0; font: inherit; font-size: 14px; color: var(--text); background: rgba(8, 12, 36, .7); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; color-scheme: dark; cursor: pointer; }
.region-row select:focus { outline: none; border-color: #6d7bff; }
.region-row select option { background: #121838; color: #eef0ff; }

/* ---------- Activity Log → Bot Messages ---------- */
.bot-sources { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.bot-sources a { padding: 5px 12px; border-radius: 99px; font-size: 13px; color: var(--muted); border: 1px solid var(--border); text-decoration: none; }
.bot-sources a span { margin-left: 4px; opacity: .7; font-variant-numeric: tabular-nums; }
.bot-sources a:hover { color: #fff; }
.bot-sources a.active { color: #fff; background: rgba(124, 58, 237, .25); border-color: rgba(139, 92, 246, .45); }
.bot-tag { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 700; color: #c4b5fd; background: rgba(139, 92, 246, .16); }
.bot-msg { margin-top: 4px; white-space: pre-line; word-break: break-word; color: #d6daf7; font-size: 14px; line-height: 1.55; }

/* ---------- Notifications (Bot Messages tab) ---------- */
.push-device { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: rgba(255, 255, 255, .02); }
.push-ios { margin: 8px 0 0; }
.push-rules { display: grid; gap: 8px; margin-top: 16px; justify-items: start; }
.push-rules-title { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.push-sources { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: #7c3aed; }
.push-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.push-list li { display: flex; align-items: center; gap: 12px; padding: 8px 4px; border-top: 1px solid rgba(110, 125, 255, .08); }
.push-list li > div { flex: 1; min-width: 0; }
.push-list b { display: block; }
.push-list small { color: var(--muted); font-size: 12.5px; }
.push-this { font-size: 11px; font-weight: 700; color: #4ade80; padding: 2px 8px; border-radius: 99px; background: rgba(34, 197, 94, .12); }

[hidden] { display: none !important; }

/* Live load balancer card body (replaced every 30 s) */
.lb-live { display: contents; }

/* Faint colour per app (dashboard Show / Fill / eCPM cards) */
.app-rate.app-mia    { background: linear-gradient(90deg, rgba(236, 72, 153, .13), rgba(236, 72, 153, .03)); border-color: rgba(236, 72, 153, .22); }
.app-rate.app-zero   { background: linear-gradient(90deg, rgba(59, 130, 246, .14), rgba(59, 130, 246, .03)); border-color: rgba(59, 130, 246, .24); }
.app-rate.app-nexa   { background: linear-gradient(90deg, rgba(34, 197, 94, .12), rgba(34, 197, 94, .03));  border-color: rgba(34, 197, 94, .22); }
.app-rate.app-veenox { background: linear-gradient(90deg, rgba(245, 158, 11, .13), rgba(245, 158, 11, .03)); border-color: rgba(245, 158, 11, .22); }
.app-rate.app-mia > b    { color: #f9a8d4; }
.app-rate.app-zero > b   { color: #93c5fd; }
.app-rate.app-nexa > b   { color: #86efac; }
.app-rate.app-veenox > b { color: #fcd34d; }

/* ---------- Login: trusted device ---------- */
.trusted-note { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; color: #86efac; background: rgba(34, 197, 94, .1); border: 1px solid rgba(34, 197, 94, .25); }
.trusted-note .icon { width: 16px; height: 16px; flex: none; }
.check.remember { font-size: 13.5px; color: var(--muted); }
.trust-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.trust-list li { display: flex; align-items: center; gap: 12px; padding: 8px 2px; border-top: 1px solid rgba(110, 125, 255, .08); }
.trust-list li:first-child { border-top: 0; }
.trust-list li > div { flex: 1; min-width: 0; }
.trust-list b { display: block; }
.trust-list small { color: var(--muted); font-size: 12.5px; }
.trust-list form { margin: 0; }

/* Domains: inline IP edit (looks like text until clicked) */
.ip-form { display: flex; align-items: center; gap: 4px; margin: 0; }
.ip-input { width: 132px; font-size: 13.5px; color: var(--text); background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 5px 8px; }
.ip-input::placeholder { color: var(--muted); }
.ip-input:hover { border-color: var(--border); }
.ip-input:focus { outline: none; border-color: #6d7bff; background: rgba(8, 12, 36, .7); }
.ip-save { visibility: hidden; }
.ip-form:focus-within .ip-save { visibility: visible; }

/* Domains: name opens https://domain in a new tab */
.domain-link { color: var(--text); text-decoration: none; }
.domain-link:hover b { color: #a5b4fc; text-decoration: underline; text-underline-offset: 3px; }
.srv .copy-btn { flex: none; }

/* Revenue card: short highlight when a new report is loaded live */
@keyframes rev-flash { from { box-shadow: 0 0 0 2px rgba(34,197,94,.55); } to { box-shadow: 0 0 0 2px rgba(34,197,94,0); } }
.card.revenue.rev-flash { animation: rev-flash 2.5s ease-out; }

/* My Subnets: server-status tiles act as filters; filter / sort dropdowns; sortable Blocked at */
button.ix-stat { font: inherit; color: inherit; text-align: left; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
button.ix-stat:hover { border-color: var(--primary, #3b82f6); }
.ix-stat.is-on { border-color: var(--primary, #3b82f6); box-shadow: 0 0 0 1px var(--primary, #3b82f6) inset; }
.ms-select { height: 36px; padding: 0 10px; border-radius: 10px; background: var(--card); color: var(--text); border: 1px solid var(--border); font: inherit; font-size: 13px; }
th.ms-sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.ms-sortable:hover { color: var(--text); }
.ms-sort-arrow { font-size: 10px; color: var(--primary, #3b82f6); }
@media (max-width: 760px) { .ms-select { flex: 1 1 45%; } }
