:root {
  --primary: #006d33;
  --primary-strong: #07c160;
  --primary-soft: rgba(7, 193, 96, 0.1);
  --text: #1b1c1c;
  --muted: #647064;
  --line: #e4e2e1;
  --surface: #fcf9f8;
  --card: #ffffff;
  --blue: #006495;
  --orange: #8d4f00;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--surface);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 64px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(252, 249, 248, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand,
.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 900;
}

.brand-name {
  color: var(--primary);
  font-size: 22px;
  font-weight: 800;
}

.icon-button {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
}

.icon-button:hover {
  background: #f0eded;
}

.admin-avatar {
  width: 34px;
  height: 34px;
  border: 1px solid var(--primary);
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--primary-strong);
  color: #ffffff;
  font-weight: 800;
}

.shell {
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 24px 16px 88px;
}

.welcome {
  margin-bottom: 24px;
}

.welcome h1,
.panel h2,
.quick-card h2,
.server-card h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.35;
}

.welcome p,
.panel-head p,
.quick-card p {
  margin: 4px 0 0;
  color: var(--muted);
}

.admin-tabs {
  margin: -6px 0 24px;
  padding: 6px;
  border: 1px solid #ededed;
  border-radius: 999px;
  display: inline-flex;
  gap: 4px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.admin-tabs button {
  height: 38px;
  padding: 0 18px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.admin-tabs button.active {
  background: var(--primary-strong);
  color: #ffffff;
}

.hidden {
  display: none !important;
}

.stats-grid {
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stat-card,
.panel {
  border: 1px solid #ededed;
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.stat-card {
  min-height: 132px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.stat-card strong {
  display: block;
  margin-top: 6px;
  font-size: 25px;
  line-height: 1.25;
}

.trend {
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 800;
}

.panel {
  padding: 24px;
}

.revenue-panel {
  margin-bottom: 24px;
}

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

.panel-head.inline {
  margin-bottom: 18px;
}

.panel-head.inline button {
  background: transparent;
  color: var(--primary);
  font-weight: 800;
}

.live-badge {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  background: #f6f3f2;
  font-size: 12px;
  font-weight: 800;
}

.live-badge i,
.server-state i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
  background: var(--primary-strong);
}

.chart {
  position: relative;
  height: 220px;
  padding-top: 22px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: end;
  gap: 10px;
}

.chart::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 30px;
  border-bottom: 1px solid rgba(108, 123, 108, 0.18);
}

.bar-item {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: end;
  gap: 10px;
  color: #6c7b6c;
}

.bar {
  width: 100%;
  max-width: 96px;
  min-height: 20px;
  border-radius: 10px 10px 0 0;
  background: rgba(0, 109, 51, 0.12);
  transition: transform 0.2s ease, background 0.2s ease;
}

.bar-item:hover .bar {
  transform: translateY(-3px);
  background: rgba(0, 109, 51, 0.26);
}

.bar-item.active {
  color: var(--primary);
  font-weight: 800;
}

.bar-item.active .bar {
  background: var(--primary-strong);
}

.bar-item em {
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
}

.money-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.money-grid div {
  padding: 16px;
  border: 1px solid rgba(187, 203, 186, 0.4);
  border-radius: 8px;
  background: #f0eded;
}

.money-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.money-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  gap: 24px;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.activity-item {
  padding: 14px 12px;
  border-radius: 10px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
}

.activity-item:hover {
  background: #f6f3f2;
}

.activity-item.border-top {
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.activity-icon {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.activity-icon.green {
  background: rgba(0, 109, 51, 0.1);
  color: var(--primary);
}

.activity-icon.blue {
  background: rgba(0, 100, 149, 0.1);
  color: var(--blue);
}

.activity-icon.orange {
  background: rgba(141, 79, 0, 0.1);
  color: var(--orange);
}

.activity-item strong {
  display: block;
  font-size: 16px;
}

.activity-item p {
  margin: 4px 0 0;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-item time {
  color: #8c958f;
  font-size: 12px;
  white-space: nowrap;
}

.side-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.quick-card {
  padding: 24px;
  border-radius: 12px;
  background: var(--primary);
  color: #ffffff;
  box-shadow: var(--shadow);
}

.quick-card p {
  color: rgba(255, 255, 255, 0.82);
}

.quick-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.quick-grid button {
  min-height: 76px;
  padding: 12px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-weight: 800;
}

.quick-grid button:hover {
  background: rgba(255, 255, 255, 0.18);
}

.server-state {
  margin: 12px 0 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.admin-form {
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: 1fr 160px 1.4fr auto;
  gap: 12px;
}

.ad-slot-form {
  grid-template-columns: 1fr 130px 170px 1.2fr 110px 110px 1.2fr auto;
}

.admin-form input,
.admin-form select,
.settings-grid input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #dcd9d9;
  border-radius: 10px;
  background: #ffffff;
  color: var(--text);
  outline: none;
}

.admin-form input:focus,
.admin-form select:focus,
.settings-grid input:focus {
  border-color: var(--primary-strong);
  box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.12);
}

.admin-form button,
.settings-grid button {
  height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--primary-strong);
  color: #ffffff;
  font-weight: 800;
  white-space: nowrap;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid #ededed;
  border-radius: 12px;
}

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

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid #ededed;
  text-align: left;
}

th {
  background: #f6f3f2;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

td {
  color: var(--text);
}

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

.status-pill {
  padding: 4px 10px;
  border-radius: 999px;
  display: inline-flex;
  background: rgba(7, 193, 96, 0.1);
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.status-pill.off {
  background: #f0eded;
  color: var(--muted);
}

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

.row-actions button {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: #f0eded;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.row-actions button.danger {
  background: #ffdad6;
  color: #93000a;
}

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

.ad-card,
.notice-item {
  padding: 18px;
  border: 1px solid #ededed;
  border-radius: 12px;
  background: #ffffff;
}

.ad-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ad-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.ad-unit {
  padding: 6px 8px;
  border-radius: 8px;
  background: #f6f3f2;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-all;
}

.ad-card strong,
.notice-item strong {
  display: block;
  font-size: 18px;
}

.ad-card p,
.notice-item p {
  margin: 4px 0 0;
  color: var(--muted);
}

.ad-card button,
.notice-item button {
  height: 36px;
  border-radius: 999px;
  background: #f0eded;
  color: var(--text);
  font-weight: 800;
}

.ad-card.active button {
  background: var(--primary-strong);
  color: #ffffff;
}

.notice-form {
  grid-template-columns: 1fr 2fr auto;
}

.notice-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notice-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.settings-grid label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.settings-grid .switch-row {
  min-height: 78px;
  padding: 0 16px;
  border: 1px solid #ededed;
  border-radius: 12px;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
}

.settings-grid input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--primary-strong);
}

.settings-grid button {
  width: fit-content;
}

.save-state {
  margin: 16px 0 0;
  color: var(--primary);
  font-weight: 800;
}

.meter-row + .meter-row {
  margin-top: 16px;
}

.meter-row div {
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

progress {
  width: 100%;
  height: 7px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #f0eded;
}

progress::-webkit-progress-bar {
  background: #f0eded;
}

progress::-webkit-progress-value {
  border-radius: 999px;
  background: var(--primary-strong);
}

progress::-moz-progress-bar {
  border-radius: 999px;
  background: var(--primary-strong);
}

.tool-stats-panel {
  margin-bottom: 24px;
}

.tool-stats-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tool-stat-row {
  display: grid;
  grid-template-columns: 120px 1fr 48px;
  align-items: center;
  gap: 12px;
}

.tool-stat-name {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tool-stat-bar-wrap {
  height: 10px;
  border-radius: 999px;
  background: #f0eded;
  overflow: hidden;
}

.tool-stat-bar {
  height: 100%;
  border-radius: 999px;
  background: var(--primary-strong);
  transition: width 0.4s ease;
}

.tool-stat-count {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  text-align: right;
}

.tool-form-grid {
  grid-template-columns: 1fr 130px 160px 1.4fr auto !important;
}

/* ── Tool management enhancements ── */

.add-tool-details {
  margin-bottom: 20px;
  border: 1px solid #ededed;
  border-radius: 12px;
  overflow: hidden;
}

.add-tool-details summary {
  padding: 12px 18px;
  background: #f6f3f2;
  cursor: pointer;
  font-weight: 800;
  color: var(--primary);
  list-style: none;
  user-select: none;
}

.add-tool-details summary::-webkit-details-marker { display: none; }

.add-tool-details[open] summary {
  border-bottom: 1px solid #ededed;
}

.tool-add-form {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #fff;
}

.tool-edit-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.form-row label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 120px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.form-row label input,
.form-row label select {
  height: 40px;
  padding: 0 10px;
  border: 1px solid #dcd9d9;
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: none;
  width: 100%;
}

.form-row label input:focus,
.form-row label select:focus {
  border-color: var(--primary-strong);
  box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.12);
}

.switch-inline {
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px !important;
  min-width: unset !important;
  white-space: nowrap;
}

.switch-inline input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-strong);
}

.btn-primary {
  height: 40px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: var(--primary-strong);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  align-self: flex-end;
}

.btn-ghost {
  height: 40px;
  padding: 0 16px;
  border: 1px solid #dcd9d9;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  align-self: flex-end;
}

.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost:hover { background: #f0eded; }

/* Filter bar */
.tool-filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.tool-filter-bar input,
.tool-filter-bar select {
  height: 38px;
  padding: 0 12px;
  border: 1px solid #dcd9d9;
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: none;
}

.tool-filter-bar input { flex: 1; min-width: 160px; }
.tool-filter-bar select { min-width: 120px; }

.tool-filter-bar input:focus,
.tool-filter-bar select:focus {
  border-color: var(--primary-strong);
  box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.12);
}

/* Tool table extras */
.icon-cell { font-size: 20px; text-align: center; }
.slug-code { font-size: 11px; color: #888; font-family: ui-monospace, Menlo, monospace; }
.desc-cell { color: var(--muted); max-width: 240px; }
.row-disabled td { opacity: 0.55; }

.cat-pill {
  padding: 3px 9px;
  border-radius: 999px;
  background: #f0eded;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

/* Tool badge (NEW / HOT) */
.tool-badge {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
}

.badge-new {
  background: rgba(0, 100, 149, 0.1);
  color: var(--blue);
}

.badge-hot {
  background: rgba(141, 79, 0, 0.1);
  color: var(--orange);
}

/* Featured star button */
.star-btn {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: transparent;
  color: #ccc;
  font-size: 18px;
  display: grid;
  place-items: center;
  transition: color 0.15s, background 0.15s;
}

.star-btn:hover { color: #f5a623; background: rgba(245, 166, 35, 0.1); }
.star-btn.starred { color: #f5a623; }

/* Empty row */
.empty-row {
  text-align: center;
  color: var(--muted);
  padding: 32px 16px !important;
}

/* Feedback unread */
.feedback-unread td { background: rgba(0, 100, 149, 0.03); }
.feedback-unread td:first-child { border-left: 3px solid var(--blue); }

/* ── Edit Modal ── */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(4px);
  padding: 16px;
}

.modal {
  width: min(680px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-head h3 {
  margin: 0;
  font-size: 20px;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: #f0eded;
  color: var(--muted);
  font-size: 20px;
  display: grid;
  place-items: center;
}

.modal-close:hover { background: #e0dddc; }

.mobile-tabs {
  display: none;
}

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

  .workspace-grid {
    display: flex;
    flex-direction: column;
  }

  .money-grid {
    grid-template-columns: 1fr;
  }

  .admin-form,
  .ad-slot-form,
  .notice-form,
  .settings-grid,
  .ad-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .brand-name {
    font-size: 20px;
  }

  .shell {
    padding-bottom: 96px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .admin-tabs {
    width: 100%;
    overflow-x: auto;
    border-radius: 14px;
  }

  .admin-tabs button {
    flex: 0 0 auto;
  }

  .panel,
  .quick-card {
    padding: 18px;
  }

  .chart {
    height: 190px;
    gap: 6px;
  }

  .activity-item {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .activity-item time {
    grid-column: 2;
  }

  .mobile-tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    height: 64px;
    padding-bottom: env(safe-area-inset-bottom);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    align-items: center;
    border-top: 1px solid var(--line);
    border-radius: 16px 16px 0 0;
    background: #ffffff;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.08);
  }

  .mobile-tabs a {
    color: var(--muted);
    text-align: center;
    text-decoration: none;
    font-size: 12px;
    font-weight: 800;
  }

  .mobile-tabs a.active {
    color: var(--primary-strong);
  }
}

/* ── Featured sort ──────────────────────────────────────────────────────── */
.featured-sort-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.fs-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: default;
  transition: background 120ms, box-shadow 120ms;
  user-select: none;
}

.fs-item.fs-dragging {
  opacity: 0.45;
}

.fs-item.fs-over {
  background: var(--primary-soft);
  border-color: var(--primary-strong);
  box-shadow: 0 0 0 2px var(--primary-soft);
}

.fs-handle {
  font-size: 18px;
  color: var(--muted);
  cursor: grab;
  padding: 0 4px;
  line-height: 1;
}

.fs-handle:active { cursor: grabbing; }

.fs-icon {
  font-size: 22px;
  width: 36px;
  text-align: center;
  flex-shrink: 0;
}

.fs-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fs-info strong {
  font-size: 14px;
  color: var(--text);
}

.fs-info span {
  font-size: 12px;
  color: var(--muted);
}

.fs-order {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  min-width: 24px;
  text-align: right;
}

.featured-tip {
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
}

/* ── Sub-tabs ──────────────────────────────────────────────────────────────── */
.sub-tabs {
  margin: 0 0 20px;
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--line);
  padding-bottom: 0;
}

.sub-tabs button {
  height: 36px;
  padding: 0 16px;
  border-radius: 6px 6px 0 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.sub-tabs button.active {
  background: var(--primary-soft);
  color: var(--primary);
  border-bottom-color: var(--primary-strong);
}

.pts-tab-content {
  margin-top: 4px;
}

/* ── Points stats grid ─────────────────────────────────────────────────────── */
.pts-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}

.pts-stat-card {
  padding: 20px;
  border: 1px solid #ededed;
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pts-stat-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.pts-stat-card strong {
  font-size: 24px;
}

/* ── Section hint ──────────────────────────────────────────────────────────── */
.section-hint {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 16px;
  padding: 10px 14px;
  background: #f6f3f2;
  border-radius: 8px;
  border-left: 3px solid var(--primary-strong);
}

/* ── Packages admin grid ───────────────────────────────────────────────────── */
.pkg-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}

.pkg-admin-card {
  padding: 16px;
  border: 1px solid #ededed;
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.pkg-admin-card.disabled {
  opacity: 0.6;
}

.pkg-admin-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.pkg-admin-body {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
  font-size: 13px;
  color: var(--muted);
}

/* ── Points log filters ────────────────────────────────────────────────────── */
.pts-log-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.pts-log-pagination {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
}

/* ── Payment notice ────────────────────────────────────────────────────────── */
.payment-notice {
  margin: 0 0 24px;
  padding: 14px 18px;
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 10px;
  font-size: 13px;
  color: #7a5800;
  line-height: 1.6;
}

.payment-notice strong {
  display: block;
  margin-bottom: 4px;
}

/* ── Settings full-width row ───────────────────────────────────────────────── */
.settings-full {
  grid-column: 1 / -1;
}

/* ── 登录遮罩 ───────────────────────────────────────────────────────────────── */
.login-mask {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0a1628 0%, #0d2416 100%);
}
.login-mask.hidden { display: none; }
.login-box {
  width: 100%; max-width: 400px;
  padding: 48px 40px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0,0,0,.3);
  text-align: center;
}
.login-logo {
  font-size: 40px; margin-bottom: 16px;
  width: 72px; height: 72px; line-height: 72px;
  background: var(--primary-soft); border-radius: 16px;
  display: inline-block; color: var(--primary-strong);
}
.login-title { font-size: 22px; font-weight: 800; color: #111; margin: 0 0 6px; }
.login-sub { font-size: 14px; color: #888; margin: 0 0 24px; }
.login-error {
  background: #fff0f0; color: #c00; border: 1px solid #fcc;
  border-radius: 8px; padding: 10px 14px; font-size: 14px;
  margin-bottom: 16px; text-align: left;
}
.login-error.hidden { display: none; }
.login-input {
  width: 100%; box-sizing: border-box;
  padding: 14px 16px; border-radius: 10px;
  border: 1.5px solid #e0e0e0; font-size: 16px;
  outline: none; margin-bottom: 14px;
  transition: border-color .2s;
}
.login-input:focus { border-color: var(--primary-strong); }
.login-btn {
  width: 100%; padding: 14px;
  background: var(--primary-strong); color: #fff;
  border: none; border-radius: 10px;
  font-size: 16px; font-weight: 700; cursor: pointer;
  transition: background .2s;
}
.login-btn:hover { background: var(--primary); }

/* ── 退出按钮 ───────────────────────────────────────────────────────────────── */
.logout-btn {
  padding: 6px 14px; border-radius: 8px;
  background: rgba(255,255,255,.08); color: rgba(255,255,255,.65);
  border: 1px solid rgba(255,255,255,.12);
  font-size: 13px; cursor: pointer;
  transition: background .15s;
}
.logout-btn:hover { background: rgba(255,255,255,.15); color: #fff; }
