:root {
  color-scheme: light;
  --bg: #f7f9fb;
  --ink: #17202a;
  --muted: #64748b;
  --line: #d8e0e8;
  --brand: #0f766e;
  --brand-2: #2563eb;
  --panel: #ffffff;
  --danger: #b42318;
  --warn: #a15c07;
  --ok: #087443;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

a { color: inherit; text-decoration: none; }
main { max-width: 1180px; margin: 0 auto; padding: 28px 20px 64px; }

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.92);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { font-weight: 800; font-size: 20px; color: var(--brand); }
nav { display: flex; align-items: center; gap: 16px; color: var(--muted); }
nav a:hover { color: var(--ink); }
.account-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  color: var(--ink);
  background: #f8fafc;
  font-size: 13px;
  font-weight: 700;
}

.button, button {
  border: 0;
  border-radius: 7px;
  background: var(--brand);
  color: #fff;
  min-height: 40px;
  padding: 0 16px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.button.small { min-height: 34px; }
.button.ghost, button.ghost { background: #eef6f5; color: var(--brand); }
button.danger { background: var(--danger); color: #fff; }
button:disabled,
button.ghost:disabled,
button.danger:disabled {
  background: #e5e7eb;
  color: #94a3b8;
  border: 1px solid #cbd5e1;
  cursor: not-allowed;
  box-shadow: none;
  opacity: 1;
  pointer-events: none;
}

.hero {
  min-height: 280px;
  display: grid;
  grid-template-columns: 1fr minmax(220px, 320px);
  align-items: center;
  gap: 28px;
  padding: 42px 0 34px;
}
.hero.compact { min-height: auto; grid-template-columns: 1fr auto; padding: 24px 0; }
.eyebrow { color: var(--brand); font-weight: 800; margin: 0 0 10px; }
h1 { font-size: 44px; line-height: 1.08; margin: 0 0 16px; max-width: 760px; letter-spacing: 0; }
h2 { margin: 0; font-size: 20px; letter-spacing: 0; }
p { color: var(--muted); line-height: 1.7; }

.balance-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  display: grid;
  gap: 10px;
}
.balance-card span { color: var(--muted); }
.balance-card strong { font-size: 28px; color: var(--brand-2); }

.regions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.log-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.log-card {
  min-height: 92px;
  text-decoration: none;
  color: var(--ink);
}
.region-card, .plan, .panel, .auth {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.region-card {
  min-height: 96px;
  padding: 16px;
  display: grid;
  align-content: space-between;
  justify-content: space-between;
  gap: 12px;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.region-card strong {
  font-size: 17px;
}
.region-card .stock {
  width: fit-content;
  font-size: 13px;
  white-space: nowrap;
}
.region-card:hover {
  border-color: #7ac2b8;
  box-shadow: 0 8px 24px rgba(15, 118, 110, .08);
  transform: translateY(-1px);
}
.region-card.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .12);
}
.regions span { color: var(--muted); line-height: 1.55; }
.region-catalog {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}
.continent-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 4px;
}
.continent-tabs a {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  text-decoration: none;
  font-size: 16px;
  font-weight: 900;
}
.continent-tabs a:hover,
.continent-tabs a.active {
  border-color: var(--brand);
  background: #eef6f5;
  color: var(--brand);
}
.primary-region-row {
  display: grid;
  grid-template-columns: minmax(210px, 270px);
}
.primary-relay-card {
  min-height: 82px;
  background: #f7fbfb;
}
.primary-relay-card strong {
  font-size: 18px;
}
.region-group {
  display: grid;
  gap: 10px;
}
.country-section {
  display: grid;
  gap: 7px;
}
.country-section h3 {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}
.region-card.disabled {
  background: #f8fafc;
  color: #94a3b8;
  border-style: dashed;
  box-shadow: none;
  transform: none;
}
.region-card.disabled .stock {
  color: #94a3b8;
}
.permission-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.permission-users,
.permission-editor {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}
.permission-users {
  display: grid;
  gap: 6px;
}
.permission-users h2 {
  margin: 0 0 2px;
  font-size: 17px;
}
.permission-user-card {
  min-height: 40px;
  padding: 7px 9px;
  text-decoration: none;
  color: var(--ink);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: center;
  align-items: center;
  gap: 8px;
  border-radius: 6px;
  box-shadow: none;
  transform: none;
}
.permission-user-card:hover {
  box-shadow: none;
  transform: none;
}
.permission-user-main,
.permission-user-meta {
  display: flex;
  align-items: center;
  min-width: 0;
}
.permission-user-main {
  gap: 6px;
}
.permission-user-main strong {
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.permission-user-main .stock {
  flex: 0 0 auto;
  margin: 0;
  font-size: 12px;
}
.permission-user-meta {
  justify-content: flex-end;
  gap: 6px;
}
.permission-user-meta span {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 999px;
  background: #eef6f5;
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
}
.permission-user-meta .stock {
  flex: 0 0 auto;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}
.user-note-preview {
  flex: 1 1 auto;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.permission-sync-panel {
  margin-bottom: 18px;
}
.permission-title {
  align-items: start;
}
.permission-user-note {
  max-width: min(420px, 46%);
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
  overflow-wrap: anywhere;
  text-align: right;
}
.permission-form {
  display: grid;
  gap: 10px;
}
.permission-page-card {
  display: grid;
  gap: 9px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}
.permission-page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.permission-page-head h3 {
  margin: 0;
  font-size: 16px;
}
.permission-page-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}
.permission-card {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  cursor: pointer;
}
.permission-card.page-access {
  background: #eef6f5;
  border-color: #b9d9d4;
}
.permission-card input {
  width: 18px;
  min-width: 18px;
  min-height: 18px;
}
.permission-card span {
  display: grid;
  gap: 4px;
}
.permission-card small {
  color: var(--muted);
  font-weight: 800;
}
.available-regions {
  margin-bottom: 18px;
}
.compact-head {
  margin-top: 0;
}
.available-region-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.available-region-card {
  min-height: 106px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  text-decoration: none;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.available-region-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.available-region-card strong {
  font-size: 22px;
}
.available-region-card b {
  width: fit-content;
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef6f5;
  color: var(--brand);
  font-size: 12px;
}
.available-region-card:hover,
.available-region-card.active {
  border-color: var(--brand);
  box-shadow: 0 10px 26px rgba(15, 118, 110, .10);
  transform: translateY(-1px);
}
.available-region-card.active {
  background: #f4fbfa;
}
.all-region-panel {
  margin: 18px 0 22px;
}
.all-region-panel summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  cursor: pointer;
  font-weight: 900;
}
.all-region-panel summary b {
  color: var(--muted);
  font-size: 13px;
}
.all-region-panel[open] summary {
  margin-bottom: 12px;
}
.region-browser {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 16px;
  align-items: start;
  margin-bottom: 22px;
}
.continent-rail {
  position: sticky;
  top: 76px;
  display: grid;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}
.continent-rail a {
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  border-radius: 7px;
  color: var(--ink);
  text-decoration: none;
}
.continent-rail a:hover,
.continent-rail a.active {
  background: #eef6f5;
  color: var(--brand);
}
.continent-rail span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.region-tree {
  display: grid;
  gap: 14px;
}
.continent-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  display: grid;
  gap: 16px;
}
.continent-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.continent-title h2 {
  margin: 0;
  font-size: 20px;
}
.continent-title span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.country-block {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  align-items: start;
}
.country-name {
  min-height: 38px;
  display: flex;
  align-items: center;
  color: var(--ink);
  font-weight: 900;
}
.country-block.empty {
  grid-template-columns: 1fr;
  color: var(--muted);
}
.country-block.empty span {
  font-size: 13px;
}
.city-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.city-chip {
  min-height: 38px;
  min-width: 118px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-weight: 850;
}
.city-chip span {
  white-space: nowrap;
}
.city-chip b {
  color: var(--brand);
  font-size: 12px;
  white-space: nowrap;
}
.city-chip:hover {
  border-color: #7ac2b8;
  box-shadow: 0 8px 22px rgba(15, 118, 110, .09);
  transform: translateY(-1px);
}
.city-chip.active {
  border-color: var(--brand);
  background: #eef6f5;
  box-shadow: inset 3px 0 0 var(--brand);
}
.city-chip.disabled {
  color: #94a3b8;
  background: #f8fafc;
  border-style: dashed;
}
.city-chip.disabled b {
  color: #94a3b8;
}
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 4px 0 14px;
}
.section-head p { margin: 0; }

.plans {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.plan {
  padding: 20px;
  min-height: 220px;
  display: grid;
  gap: 18px;
  align-content: space-between;
}
.plan.disabled {
  background: #f8fafc;
  border-style: dashed;
  color: #94a3b8;
}
.plan.disabled strong,
.plan.disabled .stock,
.plan.disabled .tag {
  color: #94a3b8;
}
.plan form {
  display: grid;
  gap: 10px;
}
.plan form button:disabled,
.buy-form button:disabled {
  background: #e5e7eb;
  color: #94a3b8;
  border: 1px solid #cbd5e1;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}
.plan strong { font-size: 30px; color: var(--brand-2); }
.plan-price {
  display: grid;
  gap: 4px;
  justify-items: start;
}
.price-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.relay-addon-option {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  border: 1px solid #d3e7e4;
  border-radius: 7px;
  padding: 10px 12px;
  background: #f6fbfa;
  color: var(--ink);
  cursor: pointer;
}
.relay-addon-option input {
  width: 16px;
  height: 16px;
  margin: 3px 0 0;
  accent-color: var(--brand);
}
.relay-addon-option span {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.relay-addon-option b {
  font-size: 14px;
}
.relay-addon-option small {
  color: var(--muted);
  line-height: 1.45;
}
.relay-addon-option.disabled {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #94a3b8;
  cursor: not-allowed;
  pointer-events: none;
}
.relay-addon-option.disabled small,
.relay-addon-option.disabled b {
  color: #94a3b8;
}
.relay-addon-option.disabled input {
  accent-color: #94a3b8;
}
.tag {
  display: inline-block;
  font-size: 13px;
  color: var(--brand);
  font-weight: 800;
  margin-bottom: 10px;
}
.stock {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  border: 1px solid #b7d9d4;
  border-radius: 6px;
  padding: 0 10px;
  color: var(--brand);
  background: #eef8f6;
  font-size: 13px;
}

.auth-shell {
  min-height: calc(100vh - 56px);
  display: grid;
  place-items: center;
  padding: 24px 0;
}
.auth {
  width: min(440px, 100%);
  margin: 0 auto;
  padding: 30px;
  box-shadow: 0 18px 60px rgba(15, 23, 42, .08);
}
.auth-head {
  display: grid;
  gap: 8px;
  margin-bottom: 24px;
}
.auth-head strong {
  color: var(--brand);
  font-size: 18px;
}
.auth-head h1 {
  margin: 0;
  font-size: 34px;
}
.auth-head p {
  margin: 0;
}
.auth-form {
  display: grid;
  gap: 14px;
}
.auth-form label {
  margin-bottom: 0;
}
.auth-checkline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.form-hint {
  min-height: 18px;
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.form-hint.error {
  color: var(--danger);
}
.auth-form input:focus {
  border-color: var(--brand);
  outline: 3px solid rgba(15, 118, 110, .12);
}
.auth-submit {
  width: 100%;
  margin-top: 4px;
}
.auth-foot {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  color: var(--muted);
}
.auth-link {
  color: var(--brand);
  font-weight: 800;
}
form { margin: 0; }
label { display: grid; gap: 8px; color: var(--muted); margin-bottom: 14px; font-weight: 700; }
input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  font: inherit;
  color: var(--ink);
  resize: vertical;
  background: #fff;
}
.quantity-control {
  grid-template-columns: auto 96px;
  align-items: center;
  justify-content: start;
  gap: 10px;
  margin: 0;
}
.quantity-control input {
  min-width: 0;
  min-height: 38px;
}
.quantity-control.disabled {
  color: #94a3b8;
  cursor: not-allowed;
}
.quantity-control.disabled input,
.quantity-control input:disabled {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #94a3b8;
  cursor: not-allowed;
}

.inline-form { display: grid; grid-template-columns: 1fr 160px auto; gap: 10px; align-items: center; }
.row-action {
  display: grid;
  grid-template-columns: 110px auto;
  gap: 8px;
  align-items: center;
}
.row-action input {
  min-width: 0;
}
.fulfill-form {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(140px, .8fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 440px;
}
.fulfill-form input,
.fulfill-form button {
  min-height: 36px;
}
.panel { padding: 20px; margin-bottom: 18px; }
.relay-bind-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
}
.relay-bind-card h2 {
  margin: 0 0 6px;
  font-size: 18px;
}
.relay-bind-card p {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0;
  color: var(--muted);
}
.relay-bind-card strong {
  color: var(--ink);
}
.relay-bind-modal input {
  width: 100%;
}
.dashboard-tools {
  display: grid;
  grid-template-columns: minmax(260px, .8fr) minmax(420px, 1.2fr);
  gap: 14px;
  align-items: stretch;
}
.permission-top-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.permission-setting-card {
  min-height: 116px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
}
.permission-setting-card h2 {
  font-size: 17px;
  margin: 0 0 4px;
}
.permission-setting-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}
.sync-card {
  border-color: #c8d8e8;
  background: #f7fbff;
}
.approval-card.enabled {
  border-color: #8ccfc1;
  background: #f0fbf8;
}
.approval-card.disabled {
  border-color: #d6dce5;
  background: #f8fafc;
}
.setting-state {
  display: inline-flex;
  align-items: center;
  margin: 2px 0 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 13px;
  line-height: 1;
}
.approval-card.enabled .setting-state {
  color: #0f766e;
  background: #d9f6ef;
}
.approval-card.disabled .setting-state {
  color: #64748b;
  background: #e2e8f0;
}
.sync-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}
.setting-toggle-form {
  margin: 0;
}
.setting-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 210px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
.setting-toggle span {
  display: grid;
  gap: 2px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.2;
}
.setting-toggle small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.setting-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.setting-toggle i {
  position: relative;
  width: 42px;
  height: 24px;
  flex: 0 0 42px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background .18s ease;
}
.setting-toggle i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, .22);
  transition: transform .18s ease;
}
.setting-toggle input:checked + i {
  background: var(--accent);
}
.setting-toggle input:checked + i::after {
  transform: translateX(18px);
}
.danger-panel {
  border-color: #f5b5ad;
  background: #fff7f6;
}
.bulk-delete-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
}
.bulk-delete-panel h2 {
  font-size: 17px;
  margin: 0;
}
.bulk-delete-form {
  display: grid;
  grid-template-columns: 190px auto;
  gap: 10px;
  align-items: center;
}
.bulk-delete-form input {
  min-height: 38px;
}
.bulk-delete-form button {
  min-height: 38px;
}
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.checkline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--ink);
}
.checkline input {
  width: auto;
  min-height: auto;
}

.table-wrap {
  overflow-x: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 18px;
}
.record-table-wrap {
  overflow-x: hidden;
}
.table-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.table-headline span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.table-headline > div {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.table-headline .headline-title-filter {
  min-height: 32px;
  justify-content: flex-start;
  gap: 12px;
  flex: 1 1 auto;
}
.headline-title-filter h2 {
  margin: 0;
  line-height: 32px;
  white-space: nowrap;
}
.permission-title > div {
  display: block;
}
.user-order-filter {
  position: relative;
  display: inline-block;
  height: 32px;
  margin: 0;
  z-index: 8;
}
.user-filter-trigger {
  min-width: 260px;
  height: 32px;
  min-height: 32px;
  line-height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 32px 1px 12px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .06);
  cursor: pointer;
  display: grid;
  grid-template-columns: minmax(96px, 1fr) minmax(88px, 1.2fr);
  align-items: center;
  gap: 14px;
  text-align: left;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 11px,
    calc(100% - 11px) 11px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.user-filter-trigger:hover {
  color: var(--brand);
}
.user-order-filter:focus-within .user-filter-trigger {
  outline: 2px solid rgba(15, 118, 110, .18);
  outline-offset: 2px;
}
.user-filter-menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: min(520px, 80vw);
  max-height: 360px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .14);
  z-index: 1200;
}
.user-order-filter:focus-within .user-filter-menu {
  display: grid;
  gap: 2px;
}
.user-filter-option {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(170px, 1.2fr);
  gap: 16px;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 6px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
}
.user-filter-option:hover,
.user-filter-option.active {
  background: #eef6f5;
  color: var(--brand);
}
.user-filter-account,
.user-filter-note {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-filter-note {
  color: var(--muted);
}
.user-filter-option:hover .user-filter-note,
.user-filter-option.active .user-filter-note {
  color: inherit;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0 2px;
  color: var(--muted);
  font-size: 14px;
}
.pagination > div {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}
.pagination .active {
  background: var(--brand);
  color: #fff;
}
.pagination .disabled {
  opacity: .45;
  pointer-events: none;
}
.pagination-ellipsis {
  padding: 0 4px;
}
.node-copy-tools > div {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.node-filter-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}
.node-filter-tabs a {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
}
.node-filter-tabs a.active {
  background: #fff;
  color: var(--brand);
  box-shadow: 0 4px 14px rgba(15, 23, 42, .08);
}
.node-filter-tabs b {
  color: inherit;
  font-size: 12px;
}
.select-col {
  width: 56px;
  text-align: center;
}
.select-col input {
  width: 18px;
  min-height: 18px;
  cursor: pointer;
}
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { text-align: left; padding: 13px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: 13px; }
.node-disabled-row td {
  background: #f1f5f9;
  color: #94a3b8;
}
.node-disabled-row:hover td {
  background: #e9eef5;
}
.node-disabled-row code {
  background: #e2e8f0;
  color: #94a3b8;
}
.node-disabled-row .action-cell button,
.node-disabled-row .action-cell .button {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #64748b;
  box-shadow: none;
}
.node-disabled-row .action-cell button:hover,
.node-disabled-row .action-cell .button:hover {
  background: #fff;
  color: var(--ink);
}
.node-disabled-row .action-cell button:disabled {
  border-color: #d1d5db;
  background: #e5e7eb;
  color: #9ca3af;
  cursor: not-allowed;
}
.node-disabled-row .action-cell button:disabled:hover {
  background: #e5e7eb;
  color: #9ca3af;
}
.node-disabled-note {
  display: block;
  margin-top: 4px;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.record-table {
  min-width: 0;
  table-layout: fixed;
  font-size: 14px;
}
.record-table th,
.record-table td {
  padding: 11px 9px;
}
.record-table th {
  font-size: 13px;
  white-space: nowrap;
}
.record-table td {
  min-width: 0;
}
.record-table tr:hover td {
  background: #f8fafc;
}
.record-total-row td {
  background: #f1f7f6;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-weight: 850;
}
.record-total-row:hover td {
  background: #eef6f5;
}
.clip-cell,
.clip-code,
.ip-cell,
.time-cell {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.message-cell {
  max-width: 100%;
}
.ip-cell,
.time-cell {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.full-time-cell {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}
.clip-code {
  font-size: 13px;
}
.operation-log-table th:nth-child(1),
.operation-log-table td:nth-child(1) { width: 58px; }
.operation-log-table th:nth-child(2),
.operation-log-table td:nth-child(2),
.operation-log-table th:nth-child(3),
.operation-log-table td:nth-child(3) { width: 98px; }
.operation-log-table th:nth-child(4),
.operation-log-table td:nth-child(4) { width: 76px; }
.operation-log-table th:nth-child(5),
.operation-log-table td:nth-child(5) { width: 78px; }
.operation-log-table th:nth-child(6),
.operation-log-table td:nth-child(6) { width: 58px; }
.operation-log-table th:nth-child(7),
.operation-log-table td:nth-child(7) { width: 112px; }
.operation-log-table th:nth-child(8),
.operation-log-table td:nth-child(8) { width: 30%; }
.operation-log-table th:nth-child(9),
.operation-log-table td:nth-child(9) { width: 142px; }
.consumption-record-table th:nth-child(2),
.consumption-record-table td:nth-child(2) { width: 92px; }
.consumption-record-table th:nth-child(1),
.consumption-record-table td:nth-child(1) { width: 108px; }
.consumption-record-table th:nth-child(3),
.consumption-record-table td:nth-child(3) { width: 82px; }
.consumption-record-table th:nth-child(4),
.consumption-record-table td:nth-child(4) { width: 70px; }
.consumption-record-table th:nth-child(6),
.consumption-record-table td:nth-child(6) { width: 142px; }
.recharge-record-table th:nth-child(1),
.recharge-record-table td:nth-child(1) { width: 58px; }
.recharge-record-table th:nth-child(2),
.recharge-record-table td:nth-child(2),
.recharge-record-table th:nth-child(3),
.recharge-record-table td:nth-child(3) { width: 108px; }
.recharge-record-table th:nth-child(4),
.recharge-record-table td:nth-child(4) { width: 82px; }
.recharge-record-table th:nth-child(5),
.recharge-record-table td:nth-child(5) { width: 70px; }
.recharge-record-table th:nth-child(7),
.recharge-record-table td:nth-child(7) { width: 142px; }
.order-record-table th:nth-child(1),
.order-record-table td:nth-child(1) { width: 58px; }
.order-record-table th:nth-child(2),
.order-record-table td:nth-child(2) { width: 108px; }
.order-record-table th:nth-child(3),
.order-record-table td:nth-child(3) { width: 78px; }
.order-record-table th:nth-child(6),
.order-record-table td:nth-child(6) { width: 82px; }
.order-record-table th:nth-child(7),
.order-record-table td:nth-child(7) { width: 142px; }
.order-record-table th:nth-child(8),
.order-record-table td:nth-child(8) { width: 190px; }
.unified-record-table th:nth-child(1),
.unified-record-table td:nth-child(1) { width: 58px; }
.unified-record-table th:nth-child(2),
.unified-record-table td:nth-child(2) { width: 108px; }
.unified-record-table th:nth-child(3),
.unified-record-table td:nth-child(3) { width: 128px; }
.unified-record-table th:nth-child(4),
.unified-record-table td:nth-child(4) { width: 82px; }
.unified-record-table th:nth-child(5),
.unified-record-table td:nth-child(5) { width: 88px; }
.unified-record-table th:nth-child(7),
.unified-record-table td:nth-child(7) { width: 142px; }
.unified-record-table th:nth-child(8),
.unified-record-table td:nth-child(8) { width: 160px; }
.unified-record-table th:nth-child(6),
.unified-record-table td:nth-child(6) { width: auto; }
td input { min-width: 120px; }
.action-cell {
  white-space: nowrap;
  min-width: 116px;
}
.action-cell > * {
  vertical-align: middle;
}
.action-cell > * + * {
  margin-left: 6px;
}
.action-cell form,
.compact-form {
  display: inline-flex;
  vertical-align: middle;
}
.action-cell button,
.compact-button,
.button.small,
button.small {
  min-width: 48px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}
.compact-button {
  padding: 0 12px;
}
code { background: #f1f5f9; padding: 3px 6px; border-radius: 5px; }
td code {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.node-ip-cell {
  display: grid;
  gap: 6px;
}
.node-ip-cell span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.node-uri {
  width: min(260px, 34vw);
  min-height: 64px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px;
  font: 12px ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink);
  background: #f8fafc;
}
.traffic-cell {
  display: grid;
  gap: 5px;
  width: 132px;
  max-width: 132px;
}
.traffic-cell strong {
  font-size: 13px;
  color: var(--ink);
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.traffic-cell span,
.muted {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.traffic-cell small {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
}

.status {
  display: inline-block;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 13px;
  font-weight: 800;
  background: #eef2f7;
  color: var(--muted);
}
.status.active { background: #e8f7ef; color: var(--ok); }
.status.pending, .status.creating { background: #fff4dd; color: var(--warn); }
.status.disabled { background: #fdecec; color: var(--danger); }
.status.user-disabled { background: #e2e8f0; color: #64748b; }
.status.deleted { background: #eef2f7; color: #64748b; }
.status.refunded { background: #eef2ff; color: var(--brand-2); }
.status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 10px 0 14px;
}
.status-head h1 {
  font-size: 34px;
  margin-bottom: 8px;
}
.status-head p {
  margin: 0;
}
.status-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.status-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.status-alert {
  border: 1px solid #f6d391;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
  color: var(--warn);
  background: #fff8e8;
  font-weight: 800;
}
.status-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}
.compact-status {
  grid-template-columns: repeat(6, 1fr);
}
.status-card {
  display: grid;
  align-content: space-between;
  gap: 10px;
  min-height: 136px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fff;
}
.compact-status .status-card {
  min-height: 118px;
  padding: 15px;
}
.status-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.status-card strong {
  color: var(--ink);
  font-size: 28px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.compact-status .status-card strong {
  font-size: 22px;
}
.status-card small {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.4;
}
.status-card.accent {
  border-color: #9bd4cc;
  background: #f0fbf9;
}
.status-card.accent strong {
  color: var(--brand);
}
.status-card.accent-blue {
  border-color: #b8cff8;
  background: #f3f7ff;
}
.status-card.accent-blue strong {
  color: var(--brand-2);
}
.status-table table {
  min-width: 940px;
}
.toast-wrap {
  position: fixed;
  top: 78px;
  right: 18px;
  z-index: 80;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 36px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, .98);
  color: var(--ink);
  box-shadow: 0 16px 40px rgba(15, 23, 42, .16);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
  animation: toast-in .18s ease-out;
}
.toast.success { border-left-color: var(--ok); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warn); }
.toast.leaving {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .2s ease, transform .2s ease;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.42);
}
.modal-backdrop[hidden] {
  display: none;
}
.modal {
  width: min(460px, 100%);
  background: var(--panel);
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
  padding: 22px;
}
.modal h2 {
  margin-top: 0;
}
.relay-modal {
  width: min(560px, 100%);
}
.qr-modal {
  width: min(520px, 100%);
}
.renew-modal {
  width: min(480px, 100%);
}
.renew-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.renew-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 76px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  cursor: pointer;
}
.renew-option input {
  width: 18px;
  min-width: 18px;
  min-height: 18px;
}
.renew-option span {
  display: grid;
  gap: 5px;
}
.renew-option small {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-weight: 800;
}
.renew-option small strong {
  color: var(--ink);
  font-size: 15px;
}
.renew-option small em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.4;
}
.renew-option.disabled {
  color: #94a3b8;
  background: #f1f5f9;
  cursor: not-allowed;
}
.buy-confirm-card {
  cursor: default;
}
.buy-confirm-card span {
  width: 100%;
}
.renew-relay-note {
  min-height: 22px;
  margin: 2px 0 0;
}
.buy-risk-warning {
  margin-top: 12px;
  padding: 14px 16px;
  border: 2px solid #dc2626;
  border-radius: 8px;
  background: #fef2f2;
  color: #991b1b;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.55;
  box-shadow: 0 10px 28px rgba(220, 38, 38, 0.16);
}
.qr-box {
  min-height: 260px;
  display: grid;
  place-items: center;
  margin: 12px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.qr-box canvas,
.qr-box img {
  width: 240px;
  height: 240px;
}
.qr-box span {
  color: var(--muted);
  font-weight: 800;
}
.qr-uri {
  width: 100%;
  min-height: 88px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--ink);
  background: #f8fafc;
  font: inherit;
  font-size: 12px;
  line-height: 1.45;
}
.modal p {
  color: var(--muted);
}
.modal-details {
  display: grid;
  gap: 10px;
  margin: 14px 0 18px;
}
.modal-details div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}
.modal-details dt {
  color: var(--muted);
  font-weight: 700;
}
.modal-details dd {
  margin: 0;
  color: var(--ink);
  font-weight: 800;
  overflow-wrap: anywhere;
}
.modal-form {
  display: grid;
  gap: 12px;
}
.copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 14px;
}
.copy-row input {
  font: 15px ui-monospace, SFMono-Regular, Menlo, monospace;
}
.relay-info-text {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  font: 13px ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink);
  background: #f8fafc;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}
.loading-overlay {
  z-index: 40;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(3px);
}
.loading-box {
  width: min(380px, 100%);
  display: grid;
  justify-items: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 30px 26px;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
}
.loading-box strong {
  font-size: 20px;
}
.loading-box p {
  margin: 0;
  text-align: center;
  max-width: 300px;
}
.loading-estimate {
  width: 100%;
  max-width: 240px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #eef6ff;
  color: #0f4c81;
  font-weight: 700;
}
.spinner {
  width: 42px;
  height: 42px;
  border: 4px solid #d8e0e8;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.loading-bar {
  width: 100%;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
  margin-top: 6px;
}
.loading-bar span {
  display: block;
  width: 44%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  animation: loading-bar 1.2s ease-in-out infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes loading-bar {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(240%); }
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 840px) {
  .topbar { padding: 0 16px; }
  .toast-wrap { top: 72px; right: 12px; width: calc(100vw - 24px); }
  nav { gap: 10px; font-size: 14px; }
  .hero, .hero.compact { grid-template-columns: 1fr; }
  h1 { font-size: 32px; }
  .available-region-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .regions, .plans { grid-template-columns: 1fr; }
  .log-cards { grid-template-columns: 1fr; }
  .permission-layout { grid-template-columns: 1fr; }
  .permission-title { align-items: stretch; flex-direction: column; }
  .permission-user-note { max-width: 100%; text-align: left; }
  .region-browser { grid-template-columns: 1fr; }
  .continent-rail {
    position: static;
    grid-auto-flow: column;
    grid-auto-columns: minmax(128px, 1fr);
    overflow-x: auto;
  }
  .country-block { grid-template-columns: 1fr; }
  .country-name { min-height: auto; }
  .city-chip { width: 100%; }
  .inline-form { grid-template-columns: 1fr; }
  .dashboard-tools { grid-template-columns: 1fr; }
  .permission-top-grid { grid-template-columns: 1fr; }
  .permission-setting-card { align-items: stretch; flex-direction: column; }
  .sync-actions { align-items: stretch; flex-direction: column; }
  .setting-toggle { justify-content: space-between; width: 100%; }
  .bulk-delete-panel { align-items: stretch; flex-direction: column; }
  .bulk-delete-form { grid-template-columns: 1fr; }
  .fulfill-form { grid-template-columns: 1fr; min-width: 260px; }
  .node-copy-tools { align-items: stretch; flex-direction: column; }
  .node-copy-tools > div { justify-content: flex-start; }
  .record-table-wrap { overflow-x: auto; }
  .record-table { min-width: 780px; }
  .status-head { align-items: stretch; flex-direction: column; }
  .status-grid, .compact-status { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .available-region-grid { grid-template-columns: 1fr; }
  .all-region-panel summary { align-items: flex-start; flex-direction: column; }
}
