:root {
  --bg: #f3f1ec;
  --panel: #fffdf8;
  --ink: #1c1914;
  --muted: #6d675c;
  --line: #e4ddd0;
  --accent: #0f6b5c;
  --accent-2: #c45c26;
  --danger: #b42318;
  --ok: #067647;
  --shadow: 0 18px 50px rgba(40, 30, 10, 0.08);
  --radius: 16px;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(15, 107, 92, 0.12), transparent 40%),
    radial-gradient(circle at bottom right, rgba(196, 92, 38, 0.12), transparent 35%),
    var(--bg);
  min-height: 100vh;
}

button, input, select, textarea {
  font: inherit;
}

.auth-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.auth-card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 32px;
  box-shadow: var(--shadow);
}

.auth-card h1 { margin: 0 0 8px; font-size: 28px; }
.auth-card label { display: grid; gap: 8px; margin: 16px 0; }
.auth-card input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.auth-card select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.auth-link { margin: 14px 0 0; }
.auth-link a { color: var(--accent); }

.auth-card button[type="submit"] {
  width: 100%;
  margin-top: 8px;
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

.layout {
  display: grid;
  grid-template-columns: 216px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #15231f;
  color: #f5f1ea;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-hide {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  flex: none;
  border: 1px solid rgba(246, 241, 230, 0.18);
  background: transparent;
  color: #f6f1e6;
}

.sidebar-hide svg { width: 15px; height: 15px; }

.sidebar-hide:hover { background: rgba(255, 255, 255, 0.08); }

.home-mark {
  width: 26px;
  height: 26px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  flex: none;
  color: #f3d78a;
  background:
    radial-gradient(circle at 38% 30%, #2c261c, #12100c 72%);
  box-shadow: 0 0 0 1px #e8c878;
}

.home-mark svg { width: 13px; height: 13px; }

.home-mark[hidden] { display: none !important; }

.home-mark:hover {
  color: #fff6d8;
  box-shadow: 0 0 0 1px #f6e7b4;
}

.with-home {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
}

body.sidebar-hidden .layout { grid-template-columns: 1fr; }
body.sidebar-hidden .sidebar { display: none; }

.brand {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 4px 4px 0 12px;
}

.role-slot { margin: 0 12px 8px; }

.id-plate,
.member-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.id-plate {
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  line-height: 1;
}

.id-name {
  font-size: 12px;
  letter-spacing: 0.16em;
  font-weight: 600;
}

.id-mark {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  position: relative;
  flex: none;
}

.id-mark.moon {
  background: #0c1624;
  box-shadow: 0 0 0 1px rgba(214, 226, 242, 0.7);
}

.id-mark.moon::before,
.id-mark.moon::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.id-mark.moon::before {
  width: 68%;
  height: 68%;
  left: 10%;
  top: 16%;
  background: linear-gradient(155deg, #ffffff, #c9d6e8 70%);
}

.id-mark.moon::after {
  width: 56%;
  height: 56%;
  left: 34%;
  top: 22%;
  background: #0c1624;
}

.id-mark.sun {
  background-color: #120e0a;
  background-image:
    radial-gradient(circle at 50% 50%, #fff8e4 0 16%, #f0d48a 17% 28%, transparent 29%),
    repeating-conic-gradient(from -7deg, #f3d78a 0 14deg, transparent 14deg 45deg);
  box-shadow: 0 0 0 1px rgba(244, 226, 168, 0.8);
}

.id-mark.seal {
  display: grid;
  place-items: center;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 13px;
  color: #3a2710;
  background: radial-gradient(circle at 35% 28%, #fff8e4, #e8c98a 46%, #b1843a 78%);
  box-shadow:
    0 0 0 1px #f8e7c2,
    0 0 0 3px #2c2114,
    0 0 0 4px #e4c27a;
}

.id-month {
  color: #e8eef6;
  background: linear-gradient(180deg, #1b314c 0%, #0c1828 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 0 0 1px rgba(198, 214, 232, 0.45);
}

.id-forever {
  color: #f6e6c4;
  background: linear-gradient(180deg, #2a2116 0%, #120e0a 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 232, 186, 0.2),
    inset 0 0 0 1px rgba(228, 194, 122, 0.75);
}

.id-mark.dot {
  background: #10211f;
  box-shadow: 0 0 0 1px rgba(244, 226, 168, 0.75);
}

.id-mark.dot::before {
  content: "";
  position: absolute;
  width: 42%;
  height: 42%;
  left: 29%;
  top: 29%;
  background: linear-gradient(145deg, #fffaf0, #e4c27a);
  transform: rotate(45deg);
  border-radius: 1px;
}

.id-mark.free {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px #a78455;
}

.id-mark.free::before {
  content: "";
  position: absolute;
  width: 28%;
  height: 28%;
  left: 36%;
  top: 36%;
  border-radius: 50%;
  background: #a78455;
}

.id-mark.exec {
  background: radial-gradient(circle at 40% 30%, #2a2418, #0c0a08 72%);
  box-shadow:
    0 0 0 1px #e8c878,
    0 0 0 3px #0a0908,
    0 0 0 4px #c6a15a;
}

.id-mark.exec::before {
  content: "";
  position: absolute;
  left: 18%;
  top: 30%;
  width: 64%;
  height: 40%;
  background: linear-gradient(180deg, #fff6d8, #e2b657 70%);
  clip-path: polygon(0 100%, 0 58%, 16% 30%, 33% 64%, 50% 6%, 67% 64%, 84% 30%, 100% 58%, 100% 100%);
}

.id-trial {
  color: #3d3428;
  background: linear-gradient(180deg, #f8f3ea 0%, #efe4d2 100%);
  box-shadow: inset 0 0 0 1px rgba(138, 108, 62, 0.4);
}

.id-click {
  color: #e8f6f2;
  background: linear-gradient(180deg, #173f38 0%, #0c2421 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 0 0 1px rgba(186, 224, 214, 0.4);
}

.id-admin {
  color: #f8e7c0;
  background: linear-gradient(180deg, #1c160f 0%, #070605 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 232, 186, 0.16),
    inset 0 0 0 1px rgba(232, 200, 120, 0.85);
}

.member-card {
  display: flex;
  width: min(460px, 100%);
  margin: 0 0 18px;
  padding: 18px 20px;
  border-radius: 18px;
  gap: 16px;
}

.member-card .id-mark {
  width: 52px;
  height: 52px;
}

.member-card .id-mark.seal,
.member-card .id-mark.exec { font-size: 22px; }

.tariff-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.tariff {
  min-height: 230px;
  padding: 22px 20px 18px;
  border-radius: 20px;
  display: grid;
  align-content: space-between;
  gap: 16px;
}

.tariff-click {
  color: #e8f6f2;
  background: linear-gradient(180deg, #173f38 0%, #0c2421 100%);
  box-shadow: inset 0 0 0 1px rgba(186, 224, 214, 0.45);
}

.tariff-month {
  color: #e8eef6;
  background: linear-gradient(180deg, #1b314c 0%, #0c1828 100%);
  box-shadow: inset 0 0 0 1px rgba(198, 214, 232, 0.5);
}

.tariff-forever {
  color: #f6e6c4;
  background: linear-gradient(180deg, #2a2116 0%, #120e0a 100%);
  box-shadow: inset 0 0 0 1px rgba(228, 194, 122, 0.75);
}

.tariff h2 {
  margin: 12px 0 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.2em;
}

.tariff-price {
  margin: 8px 0 0;
  font-size: 28px;
  letter-spacing: 0.03em;
}

.tariff-note,
.tariff label {
  margin: 6px 0 0;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: inherit;
  opacity: 0.9;
}

.tariff label { display: grid; gap: 8px; }

.tariff input,
.pay-desk input {
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: #f7f3ea;
  color: #1c1914;
}

.tariff .id-mark { width: 36px; height: 36px; }
.tariff .id-mark.seal,
.tariff .id-mark.exec { font-size: 16px; }

.tariff .btn-row { margin-top: 8px; }

.tariff .primary {
  background: #f6f1e6;
  color: #1a1612;
}

.tariff .secondary,
.tariff .ghost,
.pay-desk .ghost {
  background: transparent;
  color: inherit;
  border-color: rgba(255, 255, 255, 0.28);
}

.tariff-form { display: grid; gap: 16px; }

.pay-desk {
  background: #14110e;
  color: #f4eadc;
  border-radius: 20px;
  padding: 22px;
  display: grid;
  gap: 12px;
  box-shadow: inset 0 0 0 1px rgba(228, 194, 122, 0.4);
}

.pay-desk h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0.18em;
  font-weight: 600;
}

.pay-desk .muted { color: rgba(244, 234, 220, 0.72); }

.pay-desk code,
.pay-desk .pay-address {
  display: block;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f7f3ea;
  color: #1c1914;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-all;
}

.pay-desk .primary {
  justify-self: start;
  background: #f6f1e6;
  color: #1a1612;
}

@media (max-width: 900px) {
  .tariff-grid { grid-template-columns: 1fr; }
}

.member-card .id-name {
  display: block;
  font-size: 20px;
  letter-spacing: 0.22em;
}

.member-card .id-sub {
  margin-top: 6px;
  font-size: 13px;
  letter-spacing: 0.06em;
  opacity: 0.72;
}

.nav-btn {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 12px 14px;
  border-radius: 12px;
  cursor: pointer;
}

.nav-btn.active,
.nav-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-foot {
  margin-top: auto;
  display: grid;
  gap: 8px;
  padding: 8px 12px;
}

.content {
  padding: 36px 40px 48px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  margin-bottom: 22px;
}

.mast {
  display: flex;
  align-items: center;
  gap: 22px;
  min-width: 0;
}

.page-head h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1;
  color: #1a1612;
}

.page-head .btn-row { margin-top: 0; gap: 10px; }

.joke {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(21, 35, 31, 0.28);
}
.joke[hidden] { display: none; }
.joke-card {
  min-width: 220px;
  padding: 28px 40px;
  border-radius: 18px;
  background: #fffdf8;
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(21, 35, 31, 0.16);
  text-align: center;
}
.joke-card p {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0.08em;
  color: #15231f;
}

.page-head .primary,
.page-head .secondary {
  border-radius: 999px;
  padding: 9px 18px;
  letter-spacing: 0.14em;
  font-size: 13px;
}

.page-head .secondary {
  background: transparent;
  border-color: rgba(28, 25, 20, 0.22);
  color: #1c1914;
}

.page-head .primary {
  background: #15231f;
  color: #f6f1e6;
  border-color: #15231f;
  box-shadow: inset 0 0 0 1px rgba(232, 200, 120, 0.45);
}

.page-head .secondary:hover { background: rgba(28, 25, 20, 0.04); }
.page-head .primary:hover { background: #1c312b; }

.work {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.group-col {
  position: sticky;
  top: 20px;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 8px;
}

.group-rail {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
}

.group-item { position: relative; display: flex; width: 100%; }

.group-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  color: #6d675c;
  border-radius: 12px;
  padding: 10px 28px 10px 12px;
  cursor: pointer;
  text-align: left;
}

.group-x {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #8a8378;
  cursor: pointer;
  line-height: 14px;
  padding: 0;
  font-size: 14px;
}

.group-item:has(.group-chip.active) .group-x { color: #f6f1e6; }

.group-chip em {
  margin-left: 8px;
  font-style: normal;
  font-size: 12px;
  opacity: 0.55;
  font-variant-numeric: tabular-nums;
}

.group-chip.active {
  background: #15231f;
  color: #f6f1e6;
}

.group-chip.active em { opacity: 0.7; }

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  margin-top: 8px;
  padding: 2px 4px 4px;
}

.order-pager { justify-content: flex-end; margin-top: 14px; padding: 0; }

.page-btn {
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #6d675c;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}

.page-btn.active {
  background: #15231f;
  color: #f6f1e6;
}

.page-btn:hover:not(:disabled):not(.active) { background: #f3f1ec; }

.page-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.page-gap {
  color: #8a8378;
  padding: 0 2px;
}


.work-main .search-field {
  width: min(360px, 100%);
  margin-bottom: 14px;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f3f1ec;
  border-radius: 14px;
  padding: 0 14px;
}

.search-field.account-search {
  width: min(320px, 100%);
  margin-top: 12px;
}

.search-field input {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 11px 0;
  outline: none;
}

.search-mark {
  width: 13px;
  height: 13px;
  border: 1.5px solid #6d675c;
  border-radius: 50%;
  position: relative;
  flex: none;
}

.search-mark::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 1.5px;
  background: #6d675c;
  right: -5px;
  bottom: -1px;
  transform: rotate(40deg);
}

.code-num {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  color: #3d3428;
}
.today-clicks {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0;
  padding-left: 22px;
  border-left: 1px solid rgba(28, 25, 20, 0.14);
}
.today-clicks[hidden] { display: none !important; }
.joke-switch { cursor: pointer; }
.joke-switch .switch { margin-top: 2px; }
.today-clicks .stat {
  display: grid;
  gap: 3px;
}
.today-clicks em {
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: #8a8378;
}
.today-clicks strong {
  font-size: 18px;
  font-weight: 500;
  color: #1a1612;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.muted { color: var(--muted); margin: 0; }
.subhead { margin: 28px 0 12px; font-size: 18px; }

.primary, .secondary, .ghost, .danger {
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  border: 1px solid transparent;
}

.primary {
  background: var(--accent);
  color: #fff;
}

.secondary {
  background: #fff;
  border-color: var(--line);
}

.ghost {
  background: transparent;
  border-color: var(--line);
  color: inherit;
}

.danger {
  background: #fff;
  color: var(--danger);
  border-color: #f3c6c2;
}

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

.table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

th, td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}

th {
  background: #faf7f1;
  color: var(--muted);
  font-weight: 600;
}

tr:last-child td { border-bottom: 0; }

code {
  background: #f1eee6;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
}

.badge.on { background: #e8f8ef; color: var(--ok); }
.badge.off { background: #f5f1ea; color: var(--muted); }

.jump-line {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.error {
  color: var(--danger);
  margin: 8px 0 0;
}

dialog {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0;
  width: min(520px, calc(100vw - 32px));
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(20, 16, 10, 0.45);
}

.modal-form {
  padding: 22px;
  display: grid;
  gap: 12px;
}

.modal-form h3 { margin: 0; }
.modal-form label {
  display: grid;
  gap: 6px;
  font-size: 14px;
}
.modal-form label[hidden] { display: none; }
.modal-form label.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.switch {
  position: relative;
  display: inline-flex;
  width: 42px;
  height: 24px;
  flex: none;
}
.switch input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}
.switch-ui {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #e6e8ec;
  box-shadow: none;
  transition: background 0.18s ease;
}
.switch-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  transition: transform 0.18s ease;
}
.switch input:checked + .switch-ui {
  background: #2fce73;
  box-shadow: none;
}
.switch input:checked + .switch-ui::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-ui { outline: 2px solid rgba(47, 206, 115, 0.45); outline-offset: 2px; }
.link-table { min-width: 980px; background: #fff; }
.link-table th,
.link-table td {
  padding: 14px 12px;
  border-bottom: 1px solid #eef0f3;
  font-size: 14px;
  color: #2c3138;
  white-space: nowrap;
}
.link-table th {
  background: #f7f8fa;
  color: #8b919a;
  font-weight: 500;
  font-size: 13px;
}
.link-table .num { font-variant-numeric: tabular-nums; color: #4b5563; }
.link-table .link-name { font-weight: 600; color: #1f2430; }
.link-table .plat { color: #2457d6; font-weight: 600; }
.link-table .jump-url { color: #1f2430; word-break: break-all; }
.link-table .switch-col,
.link-table .pb-col { text-align: center; }
.pb-cell { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.pb-mark,
.pb-ok,
.pb-bad { font-style: normal; font-size: 12px; }
.pb-mark { color: #6b7280; }
.pb-ok { color: #1a9b4a; }
.pb-bad { color: #c24141; }
.link-table .switch.sm { width: 40px; height: 22px; }
.link-table .switch.sm .switch-ui { width: 40px; height: 22px; background: #e6e8ec; box-shadow: none; }
.link-table .switch.sm .switch-ui::after { width: 16px; height: 16px; top: 3px; left: 3px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18); }
.link-table .switch.sm input:checked + .switch-ui {
  background: #2fce73;
  box-shadow: none;
}
.link-table .switch.sm input:checked + .switch-ui::after { transform: translateX(18px); }
tr.link-off td { color: #9a9388; }
tr.link-off .link-name,
tr.link-off .plat { color: #9a9388; }
.guard-panel { display: grid; gap: 12px; }
.guard-panel[hidden],
[data-guard-rules][hidden] { display: none; }
.guard-field { display: grid; gap: 6px; font-size: 14px; }
.modal-form .country-list {
  max-height: 148px;
  overflow: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.modal-form .country-list label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 13px;
}
.modal-form .country-list input { width: auto; padding: 0; }
.modal-form input,
.modal-form select,
.modal-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.modal-form textarea { min-height: 140px; resize: vertical; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.stat-card strong { display: block; font-size: 22px; margin-top: 6px; }
.panel-form {
  max-width: 420px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: grid;
  gap: 12px;
}
.panel-form label { display: grid; gap: 6px; }
.panel-form input {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.check-grid { display: grid; gap: 8px; }
.check-grid label { display: flex; gap: 8px; align-items: center; }
.pay-amount { font-size: 28px; font-weight: 700; margin: 8px 0; }
.pay-address { word-break: break-all; }
.sidebar .muted { color: #c9c2b6; }

.stat-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.seg {
  display: flex;
  padding: 4px;
  border-radius: 999px;
  background: #fffdf8;
  border: 1px solid var(--line);
}

.seg-btn {
  border: 0;
  background: transparent;
  color: #6d675c;
  border-radius: 999px;
  padding: 8px 16px;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.seg-btn.active {
  background: #15231f;
  color: #f6f1e6;
}

.date-field {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #6d675c;
  letter-spacing: 0.08em;
  font-size: 13px;
}

.date-field input {
  border: 1px solid var(--line);
  background: #fffdf8;
  color: #1a1612;
  border-radius: 10px;
  padding: 8px 10px;
}

.stat-screen {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.stat-screen[hidden] { display: none !important; }

.dedupe-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #6d675c;
  letter-spacing: 0.08em;
  font-size: 13px;
}

.stat-figures {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.stat-figure {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 22px 20px;
}

.stat-figure em {
  display: block;
  font-style: normal;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: #8a8378;
}

.stat-figure strong {
  display: block;
  margin-top: 10px;
  font-size: 40px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.stat-stage {
  flex: 1;
  min-height: 0;
  display: grid;
}

.stat-board {
  display: grid;
  gap: 14px;
}

.visit-card {
  display: grid;
  gap: 14px;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  cursor: pointer;
}

.visit-card.static,
.visit-card.static:hover {
  cursor: default;
  border-color: var(--line);
}

.visit-card.hero {
  height: 100%;
  align-content: center;
  padding: 28px 40px;
}

.visit-card.hero .visit-card-body {
  justify-content: center;
  gap: min(8vw, 72px);
}

.visit-card.hero .donut {
  width: min(36vh, 320px);
  height: min(36vh, 320px);
}

.visit-card.hero .donut-hole {
  width: 62%;
  height: 62%;
}

.visit-card.hero .donut-hole b { font-size: 42px; }

.visit-card.hero .donut-legend {
  min-width: 280px;
  gap: 12px;
  font-size: 15px;
}

.visit-card.hero .donut-legend li {
  grid-template-columns: 10px minmax(72px, 1fr) 48px 56px;
  gap: 16px;
}

@media (min-width: 901px) {
  .stat-screen { height: calc(100vh - 84px); }
}

.visit-card-head strong {
  display: block;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.visit-card-head span {
  display: block;
  margin-top: 4px;
  color: #8a8378;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.visit-card-body {
  display: flex;
  align-items: center;
  gap: 16px;
}

.donut {
  width: 118px;
  height: 118px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
}

.donut-hole {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: #fffdf8;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
}

.donut-hole b {
  font-size: 20px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.donut-hole em {
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: #8a8378;
}

.donut-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  min-width: 0;
}

.donut-legend li {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}

.donut-legend .legend-head {
  color: #8a8378;
  font-size: 11px;
  letter-spacing: 0.12em;
}

.donut-legend b {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  min-width: 42px;
  text-align: right;
}

.donut-swatch {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}

.donut-legend em {
  font-style: normal;
  font-variant-numeric: tabular-nums;
  color: #6d675c;
  text-align: right;
  min-width: 28px;
}

.legend-empty {
  color: #8a8378;
  letter-spacing: 0.06em;
}

.visit-counts {
  display: flex;
  gap: 16px;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: #3d3428;
}

.visit-counts b {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.stat-empty {
  margin: 8px 0 0;
  color: #8a8378;
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .sidebar-foot { margin-top: 0; width: 100%; }
  .content { padding: 16px; }
  .stat-screen { height: auto; }
  .stat-figures { grid-template-columns: 1fr; }
  .visit-card.hero .donut { width: 220px; height: 220px; }
  .visit-card.hero .visit-card-body { flex-direction: column; gap: 20px; }
  .work { grid-template-columns: 1fr; }
  .group-col { position: static; }
}
