:root {
  --bg: #0a0d12;
  --bg-elev: #0f141c;
  --surface: #141b24;
  --surface-2: #1b2330;
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f4f7fb;
  --muted: #8e99ab;
  --accent: #22c55e;
  --accent-2: #16a34a;
  --accent-soft: rgba(34, 197, 94, 0.14);
  --accent-text: #d8ffe8;
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.14);
  --warn: #eab308;
  --warn-soft: rgba(234, 179, 8, 0.14);
  --ok: #22c55e;
  --info: #38bdf8;
  --info-soft: rgba(56, 189, 248, 0.14);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
  --radius: 16px;
  --radius-sm: 11px;
  --sidebar: 260px;
  --control-h: 42px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  background:
    radial-gradient(1200px 520px at 0% -10%, rgba(34, 197, 94, 0.08), transparent 42%),
    radial-gradient(900px 480px at 100% 0%, rgba(56, 189, 248, 0.05), transparent 38%),
    var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
button, input, select, textarea { font-family: inherit; }
button { appearance: none; }

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar);
  background: linear-gradient(180deg, #111821 0%, #0d1219 100%);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
  z-index: 30;
}
.backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 12, 0.62);
  backdrop-filter: blur(6px);
  z-index: 25;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 22px 20px 18px;
}
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(180deg, #2ae072, #16a34a);
  color: #052e16;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: 0.02em;
  font-size: 13px;
  box-shadow: 0 8px 20px rgba(34, 197, 94, 0.28);
}
.brand strong { display: block; font-size: 15px; letter-spacing: -0.02em; }
.brand span { color: var(--muted); font-size: 12px; }

.nav {
  padding: 8px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
}
.nav a {
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 11px;
  color: var(--muted);
  font-weight: 600;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.nav-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  flex-shrink: 0;
}
.nav-icon svg { width: 16px; height: 16px; display: block; }
.nav a:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.nav a.is-active {
  background: var(--accent-soft);
  color: var(--accent-text);
}
.nav a.is-active .nav-icon {
  background: rgba(34, 197, 94, 0.2);
  color: var(--accent);
}

.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group-toggle {
  appearance: none;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  font-size: 13.5px;
  padding: 9px 12px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  text-align: left;
}
.nav-group-label { display: flex; align-items: center; gap: 10px; min-width: 0; }
.nav-chevron {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  opacity: 0.7;
  transition: transform 0.16s ease;
}
.nav-chevron svg { width: 14px; height: 14px; }
.nav-group-toggle:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.nav-group.has-active > .nav-group-toggle { color: var(--accent-text); }
.nav-group.is-open > .nav-group-toggle .nav-chevron { transform: rotate(180deg); }
.nav-sub {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 2px 0 6px 14px;
}
.nav-group.is-open > .nav-sub,
.nav-group.has-active > .nav-sub { display: flex; }
.nav-sub a { font-size: 13px; padding: 8px 10px; }

.sidebar-foot {
  padding: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.who {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 2px;
}
.who-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #243042;
  color: #d5e4f5;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.who span { display: block; font-size: 13px; font-weight: 700; line-height: 1.2; }
.who small { color: var(--muted); font-size: 12px; }
.logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.02);
}
.logout svg { width: 15px; height: 15px; }
.menu-btn svg { width: 18px; height: 18px; }

.shell { flex: 1; min-width: 0; }
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 13, 18, 0.78);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 5;
}
.topbar h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.menu-btn {
  display: none;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  width: 40px;
  height: 40px;
  cursor: pointer;
}

.content { padding: 24px 28px 56px; }
.content > .card,
.content > form.card,
.content > .tabs { margin-bottom: 16px; }
.content > .grid-stats,
.content > .meta-grid { margin-bottom: 18px; }

.tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
}
.tabs a {
  text-decoration: none;
  color: var(--muted);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 650;
  border-radius: 10px;
  white-space: nowrap;
}
.tabs a:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.tabs a.is-active {
  color: var(--text);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.flash {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 14px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.flash-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.flash-icon svg { width: 16px; height: 16px; }
.flash-body { flex: 1; min-width: 0; font-size: 14px; font-weight: 550; padding-top: 3px; }
.flash-close {
  background: transparent;
  border: 0;
  color: inherit;
  opacity: 0.7;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 18px;
  line-height: 1;
}
.flash-close:hover { opacity: 1; background: rgba(255, 255, 255, 0.06); }
.flash-success { background: linear-gradient(180deg, rgba(34, 197, 94, 0.16), rgba(34, 197, 94, 0.08)); border-color: rgba(34, 197, 94, 0.28); color: #d8ffe8; }
.flash-success .flash-icon { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.flash-error { background: linear-gradient(180deg, rgba(248, 113, 113, 0.16), rgba(248, 113, 113, 0.08)); border-color: rgba(248, 113, 113, 0.28); color: #ffe4e4; }
.flash-error .flash-icon { background: rgba(248, 113, 113, 0.2); color: #fca5a5; }
.flash-info { background: linear-gradient(180deg, rgba(56, 189, 248, 0.16), rgba(56, 189, 248, 0.08)); border-color: rgba(56, 189, 248, 0.28); color: #e0f4ff; }
.flash-info .flash-icon { background: rgba(56, 189, 248, 0.2); color: #7dd3fc; }
.flash-warn { background: linear-gradient(180deg, rgba(234, 179, 8, 0.16), rgba(234, 179, 8, 0.08)); border-color: rgba(234, 179, 8, 0.28); color: #fff3c4; }
.flash-warn .flash-icon { background: rgba(234, 179, 8, 0.2); color: #facc15; }

.grid-stats,
.meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.stat {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 15px;
  overflow: hidden;
}
.stat::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent 70%);
  opacity: 0.85;
}
.stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.stat strong a { text-decoration: none; }

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
  flex-wrap: wrap;
}
.card-head h2 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -0.02em; }
.card-body { padding: 18px; }
.card-body > .muted:first-child { margin-top: 0; }

.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.data th,
table.data td {
  text-align: left;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.data th {
  color: var(--muted);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.025);
}
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background 0.12s ease; }
table.data tbody tr:hover td { background: rgba(255, 255, 255, 0.025); }
table.data a { color: #86efac; text-decoration: none; font-weight: 650; }
table.data a:hover { text-decoration: underline; }
table.data td .toolbar { margin-top: 2px; }
.mono {
  font-family: "JetBrains Mono", "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  color: #c9d4e3;
}
pre.mono {
  background: #0c1118;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  overflow-x: auto;
  font-size: 12px;
}
pre.node-source {
  max-height: 420px;
  overflow: auto;
  white-space: pre;
  font-size: 11px;
  line-height: 1.45;
}
.badge-muted { background: rgba(148, 163, 184, 0.12); color: #94a3b8; border-color: rgba(148, 163, 184, 0.16); }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
}
.badge-ok { background: var(--accent-soft); color: #86efac; border-color: rgba(34, 197, 94, 0.18); }
.badge-warn { background: var(--warn-soft); color: #fde68a; border-color: rgba(234, 179, 8, 0.18); }
.badge-danger { background: var(--danger-soft); color: #fca5a5; border-color: rgba(248, 113, 113, 0.18); }
.badge-info { background: var(--info-soft); color: #7dd3fc; border-color: rgba(56, 189, 248, 0.18); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 11px;
  padding: 0 13px;
  min-height: 38px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
  white-space: nowrap;
}
.btn:hover { border-color: rgba(255, 255, 255, 0.22); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(180deg, #2dd36a, var(--accent-2));
  border-color: transparent;
  color: #052e16;
  box-shadow: 0 8px 18px rgba(34, 197, 94, 0.22);
}
.btn-primary:hover { background: linear-gradient(180deg, #4ade80, #15803d); }
.btn-danger {
  background: linear-gradient(180deg, #fb8383, #dc2626);
  border-color: transparent;
  color: #fff5f5;
}
.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}
.btn-ghost:hover { color: var(--text); }
table.data .btn,
.toolbar .btn {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 9px;
}

.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  flex-shrink: 0;
}
.muted { color: var(--muted); }
.empty {
  padding: 36px 18px;
  text-align: center;
  color: var(--muted);
  font-weight: 550;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}
.filters .filter-q,
.filters input[type="search"],
.filters input[name="q"] {
  flex: 1 1 260px;
  min-width: 220px;
  max-width: 440px;
}
.filters select {
  flex: 0 1 168px;
  min-width: 148px;
  max-width: 200px;
}
.filters .btn {
  flex: 0 0 auto;
  min-height: var(--control-h);
  padding: 0 16px;
  font-size: 13px;
  border-radius: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.form-row { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.form-row.full,
.form-actions { grid-column: 1 / -1; }
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  align-items: end;
  padding-top: 2px;
}
label { font-size: 13px; color: #b7c0ce; font-weight: 650; }

input:not([type]),
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="url"],
input[type="tel"],
input[type="date"],
select,
textarea {
  background: #0c1118;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 0 13px;
  min-height: var(--control-h);
  height: var(--control-h);
  font-size: 14px;
  line-height: 1.3;
  width: auto;
  max-width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.form-row input:not([type]),
.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="password"],
.form-row input[type="number"],
.form-row input[type="search"],
.form-row input[type="url"],
.form-row input[type="tel"],
.form-row input[type="date"],
.form-row select,
.form-row textarea,
.login-card input,
.login-card select,
.login-card textarea {
  width: 100%;
}
textarea {
  min-height: 104px;
  height: auto;
  resize: vertical;
  padding-top: 11px;
  padding-bottom: 11px;
  line-height: 1.45;
}
select {
  appearance: none;
  background-color: #0c1118;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238e99ab' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.push-device-picker[hidden] { display: none !important; }
.push-device-picker input[type="search"] { margin-bottom: 8px; }
select[multiple],
select.is-multi {
  appearance: none;
  background-image: none;
  height: auto;
  min-height: 240px;
  padding: 8px;
  overflow: auto;
}
select[multiple] option,
select.is-multi option {
  padding: 8px 10px;
  border-radius: 8px;
  margin-bottom: 2px;
}
::placeholder { color: #6d7889; opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: rgba(255, 255, 255, 0.22); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(34, 197, 94, 0.7);
  box-shadow: 0 0 0 4px var(--accent-soft);
  background: #10161f;
}
input[readonly] {
  opacity: 0.88;
  cursor: default;
  background: #0a0e14;
}
input[type="file"] {
  width: 100%;
  min-height: var(--control-h);
  padding: 8px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: #0c1118;
  color: var(--muted);
}
.check-row { display: flex; gap: 16px; flex-wrap: wrap; padding-top: 4px; }
.check-row label { color: var(--text); display: flex; gap: 8px; align-items: center; font-weight: 600; }
input[type="checkbox"] {
  appearance: none;
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #0c1118;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: none;
}
input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
input[type="checkbox"]:checked::after {
  content: "";
  width: 10px;
  height: 6px;
  border: 2px solid #052e16;
  border-top: 0;
  border-right: 0;
  transform: rotate(-46deg) translate(1px, -1px);
}
input[type="checkbox"]:focus {
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.reason-input {
  width: 180px;
  min-width: 140px;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 420px at 50% -10%, rgba(34, 197, 94, 0.16), transparent 50%),
    radial-gradient(700px 380px at 100% 100%, rgba(56, 189, 248, 0.08), transparent 46%),
    var(--bg);
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 32px 28px 28px;
  box-shadow: var(--shadow);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.login-card h1 { margin: 0 0 6px; font-size: 24px; letter-spacing: -0.03em; }
.login-card p { margin: 0 0 22px; color: var(--muted); }
.login-card .form-row { margin-bottom: 12px; }
.login-card .btn { width: 100%; margin-top: 10px; min-height: 44px; }

.feature-list { display: flex; flex-direction: column; gap: 8px; }
.feature-row { display: flex; gap: 8px; }
.feature-row input { flex: 1; }

.lang-editor { width: 100%; }
.lang-editor .key { width: 34%; color: var(--muted); font-family: "JetBrains Mono", monospace; font-size: 12px; }

.kv {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 10px 16px;
  margin: 0;
}
.kv dt { color: var(--muted); font-size: 13px; margin: 0; font-weight: 650; }
.kv dd { margin: 0; word-break: break-all; }

.app-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}
.app-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: cover;
  background: #1c2532;
  flex-shrink: 0;
  border: 1px solid var(--line);
}
.app-logo-fallback {
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #86efac;
  background: var(--accent-soft);
}
.logo-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.logo-preview img {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--line);
}
.range-custom {
  display: flex;
  align-items: center;
  gap: 8px;
}
.range-custom[hidden] { display: none !important; }
.range-custom input[type="date"] { min-width: 150px; }
.stats-six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.stats-five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stats-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stats-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
table.data tbody tr.log-ad td { background: rgba(234, 179, 8, 0.07); }
table.data tbody tr.log-down td { background: rgba(34, 197, 94, 0.08); }
table.data tbody tr.log-ad:hover td,
table.data tbody tr.log-down:hover td { filter: brightness(1.08); }
.timeline { display: flex; flex-direction: column; gap: 10px; }
.timeline-item {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}
.timeline-item.is-down { border-color: rgba(34, 197, 94, 0.32); }
.timeline-item strong { margin-left: 8px; }
.log-params {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 13px;
}
pre.log-json {
  margin-top: 14px;
  max-height: 280px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.modal-wide {
  width: min(760px, 100%);
  max-height: 86vh;
  overflow: auto;
}
[data-ad-type-fields][hidden] { display: none !important; }
[data-platform-fields][hidden] { display: none !important; }
.switch-inline {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  min-height: 42px;
}
.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 650;
  color: var(--text);
  user-select: none;
}
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-ui {
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: #243042;
  border: 1px solid var(--line);
  position: relative;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.switch-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #d5e4f5;
  transition: transform 0.15s ease;
}
.switch input:checked + .switch-ui {
  background: var(--accent-soft);
  border-color: rgba(34, 197, 94, 0.35);
}
.switch input:checked + .switch-ui::after {
  transform: translateX(18px);
  background: #86efac;
}
.switch-delay {
  display: flex;
  align-items: center;
  gap: 8px;
}
.switch-delay[hidden] { display: none !important; }
.switch-delay input { width: 88px; }

.modal-root {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(5, 8, 12, 0.62);
  backdrop-filter: blur(8px);
  z-index: 80;
  padding: 20px;
}
.modal-root.is-open { display: grid; }
.modal {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.modal h3 { margin: 0 0 8px; font-size: 18px; letter-spacing: -0.03em; }
.modal p { margin: 0 0 18px; color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--line);
}
.pager-info { color: var(--muted); font-size: 13px; font-weight: 600; }
.pager .btn[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
}

@media (max-width: 1100px) {
  .grid-stats, .meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 4px 0; }
}
@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    left: 0;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }
  .sidebar.is-open { transform: none; }
  .backdrop.is-open { display: block; }
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  .content, .topbar { padding-left: 16px; padding-right: 16px; }
  .grid-stats, .meta-grid { grid-template-columns: 1fr; }
  .filters .filter-q,
  .filters input[type="search"],
  .filters input[name="q"],
  .filters select {
    flex: 1 1 100%;
    min-width: 0;
    max-width: 100%;
    width: 100%;
  }
  .filters .btn { width: 100%; }
}

.price-input-wrap {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.price-input-wrap input {
  flex: 1 1 auto;
  min-width: 0;
}
.btn-fx {
  flex: 0 0 auto;
  min-width: 88px;
  background: #13233a;
  border: 1px solid #2a4a73;
  color: #d7e8ff;
  font-weight: 700;
}
.btn-fx:hover { border-color: #3d6aa3; }
.fx-hidden { display: none; }
.modal-fx {
  width: min(760px, 100%);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  padding: 18px 18px 16px;
}
.fx-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.fx-modal-head p { margin: 6px 0 0; }
.fx-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
}
.fx-status { color: var(--muted); font-size: 13px; }
.fx-table-wrap {
  overflow: auto;
  max-height: min(58vh, 620px);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #0c1118;
}
.fx-table {
  width: 100%;
  border-collapse: collapse;
}
.fx-table th,
.fx-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.fx-table th {
  position: sticky;
  top: 0;
  background: #121924;
  text-align: left;
  font-size: 12px;
  color: #9aa6b8;
  z-index: 1;
}
.fx-try-cell,
.fx-fx-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.fx-try-amount,
.fx-code {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.fx-try-label,
.fx-name {
  color: var(--muted);
  font-size: 12px;
}
.fx-amount-input {
  width: 140px;
  min-height: 38px;
  height: 38px;
}
.fx-table tr.is-missing .fx-amount-input {
  border-color: #7a4a16;
}
