:root {
  --topbar-height: 52px;
  --sidebar-width: 220px;
  --topbar-bg: #001529;
  --topbar-text: #bfcbd9;
  --topbar-active: #fff;
  --sidebar-bg: #001529;
  --sidebar-sub-bg: #000c17;
  --sidebar-text: #bfcbd9;
  --sidebar-active-bg: #409eff;
  --primary: #409eff;
  --primary-hover: #66b1ff;
  --page-bg: #f0f2f5;
  --panel-bg: #fff;
  --border: #dcdfe6;
  --border-light: #ebeef5;
  --text: #303133;
  --text-regular: #606266;
  --text-muted: #909399;
  --success: #67c23a;
  --danger: #f56c6c;
  --warning: #e6a23c;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  background: var(--page-bg);
  overflow-x: hidden;
}

.admin-icon {
  flex-shrink: 0;
  display: block;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

/* ─── Top bar ─── */
.admin-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  height: var(--topbar-height);
  padding: 0 16px;
  background: var(--topbar-bg);
  color: var(--topbar-text);
  border-bottom: 1px solid #002140;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  overflow: visible;
}

.admin-topbar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  width: var(--sidebar-width);
  flex-shrink: 0;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.admin-topbar__brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), #337ecc);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(64, 158, 255, 0.35);
}

.admin-topbar__modules {
  display: flex;
  align-items: stretch;
  flex: 1;
  height: 100%;
  overflow-x: auto;
}

.admin-topbar__module {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  color: var(--topbar-text);
  font-size: 13px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}

.admin-topbar__module .admin-icon {
  opacity: 0.75;
}

.admin-topbar__module.is-active .admin-icon,
.admin-topbar__module:hover .admin-icon {
  opacity: 1;
}

.admin-topbar__module:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.admin-topbar__module.is-active {
  color: var(--topbar-active);
  border-bottom-color: var(--primary);
  background: rgba(64, 158, 255, 0.08);
}

.admin-topbar__right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  position: relative;
  z-index: 10;
}

/* Language switcher dropdown */
.admin-locale-switch {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  vertical-align: middle;
}

.admin-locale-switch__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  line-height: 0;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.admin-locale-switch__trigger:active {
  transform: scale(0.96);
}

.admin-locale-switch__glyph {
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  gap: 1px;
  line-height: 1;
  font-weight: 700;
  user-select: none;
}

.admin-locale-switch__glyph-a {
  font-size: 14px;
  letter-spacing: -0.03em;
}

.admin-locale-switch__glyph-zh {
  font-size: 10px;
  font-weight: 600;
  margin-bottom: 1px;
}

.admin-locale-switch--dark .admin-locale-switch__trigger {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.admin-locale-switch--dark .admin-locale-switch__trigger:hover,
.admin-locale-switch--dark.is-open .admin-locale-switch__trigger {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}

.admin-locale-switch--light .admin-locale-switch__trigger {
  color: #fff;
  background: #5f6b7c;
  border: 1px solid #4f5a68;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18);
}

.admin-locale-switch--light .admin-locale-switch__trigger:hover,
.admin-locale-switch--light.is-open .admin-locale-switch__trigger {
  background: #4a5568;
  border-color: #3d4654;
  color: #fff;
}

.admin-locale-switch__menu {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 2000;
  min-width: 232px;
  padding: 6px 0;
  margin: 0;
  list-style: none;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow:
    0 12px 32px rgba(15, 23, 42, 0.12),
    0 4px 12px rgba(15, 23, 42, 0.08);
  animation: admin-locale-fade-in 0.16s ease;
}

.admin-locale-switch.is-open .admin-locale-switch__menu {
  display: block;
}

.admin-locale-switch__menu[hidden] {
  display: none !important;
}

@keyframes admin-locale-fade-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.admin-locale-switch__menu::before {
  content: '';
  position: absolute;
  top: -5px;
  right: 11px;
  width: 10px;
  height: 10px;
  background: #fff;
  border-left: 1px solid #e2e8f0;
  border-top: 1px solid #e2e8f0;
  transform: rotate(45deg);
}

.admin-locale-switch__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  color: #4a5568;
  font-size: 13px;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease;
}

.admin-locale-switch__item:hover {
  background: #f0f7ff;
  color: #2563eb;
}

.admin-locale-switch__item.is-active {
  background: #eff6ff;
  color: var(--primary);
  font-weight: 600;
}

.admin-locale-switch__label {
  flex: 1;
  min-width: 0;
  color: #718096;
  font-size: 12px;
}

.admin-locale-switch__item:hover .admin-locale-switch__label {
  color: #4a5568;
}

.admin-locale-switch__item.is-active .admin-locale-switch__label {
  color: var(--primary);
}

.admin-locale-switch__native {
  color: #2d3748;
  font-size: 13px;
  font-weight: 500;
}

.admin-locale-switch__item.is-active .admin-locale-switch__native {
  color: var(--primary);
}

.admin-topbar__user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  color: var(--topbar-text);
  font-size: 12px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
}

.admin-topbar__user-avatar {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  background: rgba(64, 158, 255, 0.25);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 50%;
  text-transform: uppercase;
}

.admin-topbar__logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  color: var(--topbar-text);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  font-size: 12px;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.admin-topbar__logout:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.05);
}

/* ─── Shell ─── */
.admin-shell {
  display: flex;
  min-height: 100vh;
  padding-top: var(--topbar-height);
}

.admin-aside {
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  z-index: 200;
  width: var(--sidebar-width);
  height: calc(100vh - var(--topbar-height));
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--sidebar-bg);
  border-right: 1px solid #002140;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.admin-aside::-webkit-scrollbar {
  width: 5px;
}

.admin-aside::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 4px;
}

.admin-aside__title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 16px 10px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(191, 203, 217, 0.65);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-aside__title .admin-icon {
  opacity: 0.7;
}

.admin-menu {
  list-style: none;
  padding: 8px 0 16px;
}

.admin-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 8px;
  padding: 10px 12px;
  color: var(--sidebar-text);
  font-size: 13px;
  border-radius: 4px;
  border-left: 3px solid transparent;
  transition: color 0.15s, background 0.15s;
}

.admin-menu a .admin-icon {
  opacity: 0.65;
}

.admin-menu a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.admin-menu a:hover .admin-icon {
  opacity: 1;
}

.admin-menu a.is-active {
  color: #fff;
  background: var(--sidebar-active-bg);
  border-left-color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.admin-menu a.is-active .admin-icon {
  opacity: 1;
}

/* ─── Main ─── */
.admin-main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-width);
  padding: 12px 16px 24px;
}

.admin-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  margin-bottom: 12px;
  padding: 0 4px;
}

.admin-page-head h1 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.admin-breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* ─── Alerts ─── */
.admin-alert {
  padding: 10px 14px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  background: var(--panel-bg);
  font-size: 13px;
}

.admin-alert--success {
  border-color: #c2e7b0;
  background: #f0f9eb;
  color: #529b2e;
}

.admin-alert--error {
  border-color: #fbc4c4;
  background: #fef0f0;
  color: #c45656;
}

/* ─── Panel / box ─── */
.panel {
  background: var(--panel-bg);
  border: 1px solid var(--border-light);
  margin-bottom: 12px;
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  background: #fafafa;
}

.panel__head h2 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.panel__body {
  padding: 16px;
}

.box {
  background: var(--panel-bg);
  border: 1px solid var(--border-light);
  margin-bottom: 12px;
}

.box h2 {
  font-size: 14px;
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  background: #fafafa;
  margin: 0;
}

.box > :not(h2) {
  padding: 16px;
}

.box > .table-wrap,
.box > .actions,
.box > form {
  padding: 16px;
}

.box h2 + form,
.box h2 + .actions,
.box h2 + .table-wrap,
.box h2 + .field,
.box h2 + p,
.box h2 + ol,
.box h2 + pre {
  padding-top: 16px;
}

.box h2 ~ .field,
.box h2 ~ p,
.box h2 ~ ol,
.box h2 ~ pre {
  padding-left: 16px;
  padding-right: 16px;
}

.box h2 ~ .field:last-child,
.box h2 ~ p:last-child,
.box h2 ~ pre:last-child {
  padding-bottom: 16px;
}

/* Tabs inside panel */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border-light);
  background: #fafafa;
  padding: 0 8px;
}

.tabs__item {
  padding: 10px 16px;
  color: var(--text-regular);
  font-size: 13px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tabs__item.is-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: var(--panel-bg);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 24px;
}

/* Form rows — label left, field right (enterprise style) */
.form-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
}

.form-row:last-child {
  border-bottom: none;
}

.form-row label {
  color: var(--text-regular);
  font-size: 13px;
  text-align: right;
  padding-right: 4px;
}

.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  max-width: 420px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font: inherit;
  outline: none;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  border-color: var(--primary);
}

.form-row small {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.field {
  margin-bottom: 12px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-regular);
  font-size: 13px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  max-width: 420px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font: inherit;
  outline: none;
}

.field textarea {
  height: auto;
  min-height: 80px;
  padding: 8px 10px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
}

.field small {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.field--inline label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 72px;
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-regular);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  color: var(--primary);
  border-color: #c6e2ff;
  background: #ecf5ff;
}

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

.btn--primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #fff;
}

.btn--danger {
  color: var(--danger);
  border-color: #fbc4c4;
}

.btn--danger:hover {
  background: #fef0f0;
}

.btn--sm {
  min-width: 56px;
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

.btn--dark {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn--dark:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #fff;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.form-actions {
  padding: 16px;
  border-top: 1px solid var(--border-light);
  background: #fafafa;
  display: flex;
  gap: 8px;
}

/* Tables */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.data-table {
  border: 1px solid var(--border-light);
}

table.data-table th,
table.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  text-align: left;
  vertical-align: middle;
}

table.data-table th {
  background: #fafafa;
  color: var(--text-regular);
  font-weight: 600;
}

table.data-table tr:hover td {
  background: #fafcff;
}

table.data-table tr:last-child td {
  border-bottom: none;
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px;
  border: 1px solid var(--border);
}

.tag--on {
  color: var(--success);
  border-color: #c2e7b0;
  background: #f0f9eb;
}

.tag--off {
  color: var(--danger);
  border-color: #fbc4c4;
  background: #fef0f0;
}

.tag--warn {
  color: #b88230;
  border-color: #f5dab1;
  background: #fdf6ec;
}

button.tag {
  cursor: pointer;
  font: inherit;
}

.mono {
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  word-break: break-all;
  color: var(--text-regular);
}

pre.mono {
  padding: 12px;
  background: #fafafa;
  border: 1px solid var(--border-light);
  overflow: auto;
  max-height: 280px;
}

.stat-row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  padding: 4px 0;
}

.stat-row p {
  color: var(--text-regular);
}

.stat-row strong {
  color: var(--text);
}

/* ─── Agente / Carteiras ─── */
.agent-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.agent-kpi {
  background: var(--panel-bg);
  border: 1px solid var(--border-light);
  padding: 14px 16px;
  min-height: 96px;
}

.agent-kpi--primary {
  border-color: rgba(64, 158, 255, 0.35);
  background: linear-gradient(180deg, #f5faff 0%, #fff 100%);
}

.agent-kpi__label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.agent-kpi__value {
  display: block;
  font-size: 22px;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 4px;
}

.agent-kpi__hint {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

.agent-kpi__hint a {
  color: var(--primary);
}

.agent-progress {
  height: 4px;
  margin-top: 8px;
  background: var(--border-light);
  overflow: hidden;
}

.agent-progress span {
  display: block;
  height: 100%;
  background: var(--primary);
}

.agent-detail-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px 16px;
  margin: 0;
}

.agent-detail-grid dt {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.agent-detail-grid dd {
  margin: 0;
  font-size: 13px;
  color: var(--text-regular);
}

.agent-detail-inline {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.agent-category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
}

.agent-empty {
  color: var(--text-muted);
  font-size: 13px;
}

.agent-empty--padded {
  padding: 16px;
}

.agent-form-intro {
  margin-bottom: 16px;
  padding: 10px 12px;
  background: #f5f7fa;
  border: 1px solid var(--border-light);
  color: var(--text-regular);
  font-size: 12px;
}

.panel__head-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.panel__body--flush {
  padding: 0;
}

.agent-wallet-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  background: #fafafa;
}

.agent-wallet-search,
.agent-wallet-filter {
  min-width: 180px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 13px;
}

.agent-wallet-search {
  flex: 1;
  min-width: 220px;
}

.agent-wallet-table__name {
  font-weight: 600;
  color: var(--text);
  max-width: 320px;
}

.agent-wallet-table__balance {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

.agent-table-footnote {
  padding: 10px 16px 14px;
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-light);
}

.agent-wallet-table tfoot td {
  background: #fafafa;
  border-top: 1px solid var(--border);
}

@media (max-width: 1100px) {
  .agent-kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .agent-kpi-row {
    grid-template-columns: 1fr;
  }

  .agent-detail-grid {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .agent-detail-grid dt {
    margin-top: 8px;
  }
}

.hint-red {
  color: var(--danger);
  font-size: 12px;
}

/* ─── Dashboard ─── */
.dash-welcome__inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.dash-welcome__title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.dash-welcome__text {
  margin: 0;
  font-size: 13px;
  color: var(--text-regular);
  max-width: 42rem;
  line-height: 1.55;
}

.dash-welcome__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.dash-welcome__date {
  font-size: 12px;
  color: var(--text-muted);
}

.dash-kpi {
  margin-bottom: 12px;
}

.dash-kpi--secondary .agent-kpi__value {
  font-size: 18px;
}

.dash-kpi__date {
  font-size: 15px !important;
  font-weight: 600;
}

.dash-setup-list {
  list-style: none;
  display: grid;
  gap: 8px;
}

.dash-setup-list__item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-regular);
}

.dash-setup-list__item.is-done {
  color: var(--text-muted);
}

.dash-setup-list__item a {
  color: var(--primary);
  font-weight: 600;
}

.dash-setup-list__mark {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 11px;
  flex-shrink: 0;
}

.dash-setup-list__item.is-done .dash-setup-list__mark {
  background: #f0f9eb;
  border-color: #c2e7b0;
  color: var(--success);
}

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

.dash-action {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--border-light);
  background: #fafafa;
  color: inherit;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.dash-action:hover {
  border-color: rgba(64, 158, 255, 0.45);
  background: #f5faff;
  color: inherit;
}

.dash-action--external {
  border-style: dashed;
}

.dash-action__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.dash-action__desc {
  font-size: 11px;
  color: var(--text-muted);
}

.panel__head-link {
  font-size: 12px;
  color: var(--primary);
  font-weight: 500;
}

.dash-detail-grid dd a {
  color: var(--primary);
  word-break: break-all;
}

.dash-hint {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
  font-size: 11px;
  color: var(--text-muted);
}

.dash-rank-table td:first-child {
  font-weight: 600;
}

@media (max-width: 1100px) {
  .dash-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .dash-actions {
    grid-template-columns: 1fr;
  }

  .dash-welcome__meta {
    align-items: flex-start;
  }
}

/* Login */
body.login-body {
  background: var(--page-bg);
}

.login-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.login-main {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: 100%;
  max-width: 400px;
  background: var(--panel-bg);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  overflow: visible;
}

.login-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  background: #fafafa;
  font-size: 15px;
  font-weight: 600;
  border-radius: 8px 8px 0 0;
  overflow: visible;
  position: relative;
  z-index: 2;
}

.login-panel__head-title {
  flex: 1;
  min-width: 0;
}

.login-panel__body {
  padding: 20px;
}

.login-panel .field input {
  max-width: none;
}

.login-panel .btn--primary {
  width: 100%;
  height: 36px;
  margin-top: 8px;
}

/* ─── Provider folders (home games) ─── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.home-games-toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px 16px;
  align-items: center;
  padding: 14px 16px;
  margin-bottom: 8px;
}

.home-games-intro .panel__body {
  padding: 12px 16px;
}

.home-games-intro p {
  margin: 0;
  font-size: 12px;
  color: var(--text-regular);
  line-height: 1.55;
}

.home-games-kpi {
  margin-bottom: 12px;
}

.home-games-chips {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.home-games-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-regular);
  font-size: 12px;
  border-radius: 999px;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.home-games-chip:hover {
  color: var(--primary);
  border-color: rgba(64, 158, 255, 0.45);
}

.home-games-chip.is-active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.home-games-empty-state {
  text-align: center;
  padding: 32px 16px;
}

.home-games-empty-state h3 {
  font-size: 16px;
  margin-bottom: 8px;
  color: var(--text);
}

.home-games-empty-state p {
  color: var(--text-muted);
  margin-bottom: 16px;
}

.home-games-toolbar__stats {
  display: flex;
  gap: 16px;
}

.home-games-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 4rem;
}

.home-games-stat__label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.home-games-stat strong {
  font-size: 18px;
  color: var(--text);
}

.home-games-toolbar__search {
  min-width: 0;
}

.home-games-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.home-games-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.home-games-filter select {
  height: 32px;
  max-width: 200px;
  padding: 0 10px;
  border: 1px solid var(--border);
  background: #fff;
  font: inherit;
}

.search-input {
  width: 100%;
  height: 36px;
  padding: 0 12px 0 34px;
  border: 1px solid var(--border);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23909399' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242 1.156a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E") no-repeat 10px center;
  font: inherit;
  outline: none;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.15);
}

.search-input--compact {
  height: 32px;
  padding-left: 30px;
  background-position: 8px center;
}

.provider-status-legend--bar {
  padding: 0 4px 12px;
}

.home-games-no-results {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.provider-folders {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

.provider-folder {
  border: 1px solid var(--border-light);
  background: var(--panel-bg);
  scroll-margin-top: calc(var(--topbar-height) + 12px);
  min-width: 0;
  transition: box-shadow 0.2s ease;
}

.provider-folder[open] {
  grid-column: 1 / -1;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  z-index: 1;
}

.provider-status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.provider-folder:target {
  outline: 2px solid rgba(64, 158, 255, 0.35);
  outline-offset: 1px;
}

.provider-folder--all_off,
.provider-folder--empty {
  border-left: 3px solid var(--danger);
}

.provider-folder--all_on {
  border-left: 3px solid var(--success);
}

.provider-folder--partial {
  border-left: 3px solid var(--warning);
}

.provider-folder__summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
  background: #fafafa;
  user-select: none;
}

.provider-folder[open] .provider-folder__summary {
  border-bottom: 1px solid var(--border-light);
}

/* Card compacto (fechado) — 2 colunas */
.provider-folder:not([open]) .provider-folder__summary {
  flex-wrap: wrap;
  align-items: flex-start;
  padding: 10px 12px;
  gap: 8px;
}

.provider-folder:not([open]) .provider-folder__logo,
.provider-folder:not([open]) .provider-folder__logo--empty {
  width: 36px;
  height: 36px;
}

.provider-folder:not([open]) .provider-folder__meta {
  flex: 1 1 calc(100% - 52px);
  min-width: 0;
}

.provider-folder:not([open]) .provider-folder__name-row {
  flex-wrap: nowrap;
  gap: 6px;
}

.provider-folder:not([open]) .provider-folder__name {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.provider-folder:not([open]) .provider-folder__name-row .tag {
  font-size: 10px;
  padding: 2px 5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.provider-folder:not([open]) .provider-folder__stats {
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.provider-folder:not([open]) .provider-folder__wallet {
  display: none;
}

.provider-folder:not([open]) .provider-folder__actions {
  display: none;
}

/* Expandido — linha completa */
.provider-folder[open] .provider-folder__summary {
  flex-wrap: nowrap;
  padding: 12px 16px;
  gap: 12px;
}

.provider-folder__summary::-webkit-details-marker {
  display: none;
}

.provider-folder__summary::before {
  content: '▶';
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.provider-folder[open] .provider-folder__summary::before {
  transform: rotate(90deg);
}

.provider-folder__logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--border-light);
  flex-shrink: 0;
}

.provider-folder__logo--empty {
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: #f5f7fa;
}

.provider-folder__meta {
  flex: 1;
  min-width: 0;
}

.provider-folder__name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.provider-folder__name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn:disabled:hover {
  color: var(--text-regular);
  border-color: var(--border);
  background: #fff;
}

.btn--primary:disabled:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.provider-folder__stats {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.provider-folder__progress {
  height: 4px;
  margin-top: 8px;
  background: var(--border-light);
  overflow: hidden;
}

.provider-folder__progress span {
  display: block;
  height: 100%;
  background: var(--primary);
  min-width: 0;
  max-width: 100%;
}

.provider-folder--all_on .provider-folder__progress span {
  background: var(--success);
}

.provider-folder--all_off .provider-folder__progress span,
.provider-folder--empty .provider-folder__progress span {
  background: var(--danger);
}

.provider-folder--partial .provider-folder__progress span {
  background: var(--warning);
}

.provider-folder__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

.provider-folder__body {
  padding: 0;
}

.provider-folder__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: #fcfcfc;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 2;
}

.provider-folder__search {
  position: relative;
  flex: 1;
  max-width: 360px;
}

.provider-folder__search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

.provider-folder__search .search-input--compact {
  width: 100%;
  padding-left: 28px;
  background-image: none;
}

.provider-folder__count {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.provider-folder__empty {
  padding: 20px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* ─── Home games grid ─── */
.home-games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
  padding: 12px 16px 16px;
}

.home-game-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-light);
  background: #fff;
  min-width: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.home-game-card.is-enabled {
  border-color: rgba(103, 194, 58, 0.5);
}

.home-game-card.is-top {
  box-shadow: inset 0 3px 0 var(--warning);
}

.home-game-card__thumb {
  position: relative;
  aspect-ratio: 1;
  background: #f5f7fa;
  border-bottom: 1px solid var(--border-light);
  overflow: hidden;
}

.home-game-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.home-game-card__placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-muted);
}

.home-game-card__badge {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #fff;
  background: var(--warning);
  border-radius: 3px;
}

.home-game-card__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  flex: 1;
}

.home-game-card__name {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}

.home-game-card__code {
  font-size: 10px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-game-card__toggles {
  display: flex;
  gap: 4px;
  margin-top: auto;
}

.home-game-card__toggle-form {
  flex: 1;
  min-width: 0;
}

.home-game-chip {
  width: 100%;
  padding: 4px 0;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.home-game-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.home-game-chip.is-on {
  color: #fff;
  background: var(--success);
  border-color: var(--success);
}

.home-game-chip--top.is-on {
  background: var(--warning);
  border-color: var(--warning);
}

.home-game-card__order {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 4px;
  align-items: end;
  padding-top: 4px;
  border-top: 1px solid var(--border-light);
}

.home-game-card__order-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 10px;
  color: var(--text-muted);
}

.home-game-card__order-field .input-inline,
.home-game-card__order-field .input-inline--wide {
  width: 100%;
  height: 26px;
  font-size: 11px;
}

.home-game-card__save {
  height: 26px;
  padding: 0 8px;
  align-self: end;
}

.data-table--games td {
  vertical-align: middle;
}

.game-row__name {
  display: block;
  margin-bottom: 2px;
}

.game-row__code {
  font-size: 11px;
  color: var(--text-muted);
}

.game-thumb {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: cover;
  border: 1px solid var(--border-light);
  background: #fafafa;
}

.game-thumb--empty {
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--text-muted);
}

.input-inline {
  width: 64px;
  height: 28px;
  padding: 0 6px;
  border: 1px solid var(--border);
  font: inherit;
}

.input-inline--wide {
  width: 72px;
}

/* ─── Provider cards grid ─── */
.provider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.provider-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-light);
  background: var(--panel-bg);
}

.provider-card--all_off,
.provider-card--empty {
  border-top: 3px solid var(--danger);
}

.provider-card--all_on {
  border-top: 3px solid var(--success);
}

.provider-card--partial {
  border-top: 3px solid var(--warning);
}

.provider-card__logo-wrap {
  display: grid;
  place-items: center;
  height: 96px;
  padding: 12px;
  background: #fafafa;
  border-bottom: 1px solid var(--border-light);
}

.provider-card__logo {
  max-width: 100%;
  max-height: 72px;
  object-fit: contain;
}

.provider-card__logo--empty {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  background: #ecf5ff;
  border: 1px solid #c6e2ff;
}

.provider-card__body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.provider-card__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.provider-card__meta {
  font-size: 12px;
  color: var(--text-muted);
}

.provider-card__stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-regular);
  margin-top: 4px;
}

.provider-card .btn {
  margin-top: auto;
  align-self: flex-start;
}

/* ─── Game catalog cards ─── */
.game-catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.game-catalog-toolbar__filters select {
  height: 36px;
  min-width: 180px;
  padding: 0 10px;
  border: 1px solid var(--border);
  background: #fff;
  font: inherit;
}

.game-catalog-toolbar__search {
  flex: 1;
  min-width: 200px;
  max-width: 420px;
}

.game-catalog-toolbar__count {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.game-catalog-grid-wrap {
  padding-top: 0;
}

.game-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 8px;
}

.game-catalog-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-light);
  background: #fff;
  min-width: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.game-catalog-card:hover {
  border-color: #c6e2ff;
  box-shadow: 0 2px 8px rgba(64, 158, 255, 0.08);
}

.game-catalog-card--no-image {
  opacity: 0.82;
  border-style: dashed;
}

.game-catalog-card__thumb {
  aspect-ratio: 1;
  background: #f5f7fa;
  border-bottom: 1px solid var(--border-light);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.game-catalog-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-catalog-card__placeholder {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-muted);
}

.game-catalog-card__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 8px 8px;
  min-width: 0;
}

.game-catalog-card__name {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.5em;
}

.game-catalog-card__code {
  font-size: 10px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-catalog-card__provider {
  font-size: 10px;
  color: var(--text-regular);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 4px;
}

.game-catalog-card__actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: auto;
}

.game-catalog-card__actions form {
  flex: 1;
  min-width: 0;
}

.game-catalog-card__actions button {
  width: 100%;
}

.tag--xs {
  padding: 2px 4px;
  font-size: 10px;
  min-width: 0;
}

.game-catalog-empty {
  padding: 24px 0 8px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

@media (min-width: 1200px) {
  .home-games-grid {
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  }

  .game-catalog-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
}

@media (max-width: 960px) {
  .admin-topbar__brand {
    width: auto;
    min-width: 0;
  }

  .admin-shell { flex-direction: column; }

  .admin-aside {
    position: sticky;
    top: var(--topbar-height);
    width: 100%;
    height: auto;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid #002140;
  }

  .admin-main {
    margin-left: 0;
  }

  .admin-menu { display: flex; flex-wrap: wrap; padding: 8px; }
  .admin-menu a {
    margin: 2px;
    padding: 8px 12px;
    border-left: none;
    border-bottom: 2px solid transparent;
  }
  .admin-menu a.is-active { border-bottom-color: #fff; border-left: none; }
  .grid-2 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .form-row label { text-align: left; }
  .provider-folder__summary { flex-wrap: wrap; }
  .provider-folder__actions { width: 100%; margin-left: 0; margin-top: 8px; }
  .home-games-toolbar { grid-template-columns: 1fr; }
  .home-games-toolbar__actions { width: 100%; }
  .home-games-toolbar__stats { justify-content: space-between; }
  .provider-folders {
    grid-template-columns: 1fr;
  }

  .provider-folder[open] {
    grid-column: auto;
  }

  .game-catalog-toolbar__count { margin-left: 0; width: 100%; }
}

/* Home layout admin */
.hl-page {
  margin-bottom: 16px;
  overflow: hidden;
}

.hl-page.panel {
  padding: 0;
}

.hl-tabs {
  display: flex;
  gap: 0;
  padding: 0 20px;
  background: #fafafa;
  border-bottom: 1px solid var(--border-light);
}

.hl-tabs__btn {
  display: inline-flex;
  align-items: center;
  padding: 14px 20px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: var(--text-regular);
  font-size: 13px;
  font-weight: 500;
  transition: color 0.15s, border-color 0.15s;
}

.hl-tabs__btn:hover {
  color: var(--primary);
}

.hl-tabs__btn.is-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.hl-page__body {
  padding: 20px 24px 24px;
}

.hl-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.hl-header__title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.hl-header__desc {
  margin: 0;
  max-width: 640px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
}

.hl-block {
  margin-bottom: 20px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}

.hl-block > .table-wrap {
  padding: 0 20px 12px;
}

.hl-block > .table-wrap .hl-table thead th:first-child {
  padding-left: 0;
}

.hl-block > .table-wrap .hl-table tbody td:first-child {
  padding-left: 0;
}

.hl-block > .hl-empty {
  padding: 32px 20px;
}

.hl-block--editor {
  border-color: #c6ddf8;
  box-shadow: 0 0 0 1px rgba(64, 158, 255, 0.08);
}

.hl-block--nested {
  margin: 0 20px 20px;
  background: #fafbfc;
}

.hl-block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  background: #fafafa;
  border-bottom: 1px solid var(--border-light);
}

.hl-block__head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.hl-block__close {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.hl-block__close:hover {
  color: var(--primary);
}

.hl-table-wrap-inset {
  padding: 0 20px 8px;
}

.hl-table {
  width: 100%;
  border-collapse: collapse;
}

.hl-table th,
.hl-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.hl-table thead th {
  padding-top: 14px;
  padding-bottom: 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #fafafa;
}

.hl-table tbody tr:last-child td {
  border-bottom: none;
}

.hl-table tbody tr:hover {
  background: #fafbfc;
}

.hl-table tbody tr.is-active {
  background: #ecf5ff;
}

.hl-col-order {
  width: 72px;
}

.hl-col-status {
  width: 100px;
}

.hl-col-action {
  width: 120px;
  text-align: right;
}

.hl-order-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 8px;
  border-radius: 4px;
  background: #f0f2f5;
  color: var(--text-regular);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.hl-row-title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.hl-row-meta {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-muted);
}

.hl-empty {
  margin: 0;
  padding: 32px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.hl-hint {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
}

.hl-hint--pad {
  padding: 0 20px;
}

.hl-form {
  padding: 20px;
}

.hl-form--compact {
  padding: 0;
}

.hl-form-section {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
}

.hl-form-section:last-of-type {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.hl-form-section__title {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hl-form-section__desc {
  margin: -8px 0 14px;
  font-size: 13px;
  color: var(--text-regular);
  line-height: 1.55;
}

.hl-form-section__desc--pad {
  margin: 0 20px 16px;
}

.hl-callout {
  margin-bottom: 20px;
  padding: 12px 14px;
  background: #ecf5ff;
  border: 1px solid #c6ddf8;
  border-radius: 6px;
}

.hl-callout p {
  margin: 0;
  font-size: 13px;
  color: #1d4f8f;
  line-height: 1.55;
}

.hl-field--check small {
  margin-top: 2px;
}

.hl-icon-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  gap: 10px;
}

.hl-icon-picker__item {
  display: block;
  cursor: pointer;
}

.hl-icon-picker__item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.hl-icon-picker__box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 78px;
  padding: 10px 8px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.hl-icon-picker__item:hover .hl-icon-picker__box {
  border-color: #c6ddf8;
  background: #fafcff;
}

.hl-icon-picker__item input:checked + .hl-icon-picker__box {
  border-color: var(--primary);
  background: #ecf5ff;
  box-shadow: 0 0 0 1px rgba(64, 158, 255, 0.25);
}

.hl-icon-picker__glyph {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  color: #303133;
}

.hl-icon-picker__name {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.25;
}

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

.hl-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.hl-field--wide {
  grid-column: 1 / -1;
}

.hl-field--narrow {
  max-width: 160px;
}

.hl-field--check {
  justify-content: flex-end;
  padding-bottom: 4px;
}

.hl-field--inline {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.hl-field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-regular);
}

.hl-field input[type="text"],
.hl-field input[type="number"],
.hl-field input[type="file"],
.hl-field select,
.hl-field textarea {
  width: 100%;
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.hl-field input:focus,
.hl-field select:focus,
.hl-field textarea:focus {
  border-color: var(--primary);
}

.hl-field small {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.45;
}

.hl-pair {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hl-pair input {
  width: 72px !important;
  flex: 0 0 72px;
}

.hl-pair span {
  color: var(--text-muted);
  font-size: 14px;
}

.hl-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-regular);
  cursor: pointer;
  user-select: none;
}

.hl-multiselect {
  width: 100%;
  min-height: 180px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font: inherit;
}

.hl-color-input {
  width: 100%;
  max-width: 120px;
  height: 36px !important;
  padding: 2px 4px !important;
  cursor: pointer;
}

.hl-form-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.hl-settings {
  margin-bottom: 20px;
  padding: 14px 18px;
  background: #f5f7fa;
  border: 1px solid var(--border-light);
  border-radius: 6px;
}

.hl-settings__form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
}

.hl-settings__form .hl-field--inline input {
  width: 110px;
}

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

.hl-media-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: #fff;
}

.hl-media-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.hl-media-card__title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.hl-media-card__desc {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.hl-media-card__preview {
  display: grid;
  place-items: center;
  min-height: 88px;
  padding: 12px;
  background: #f5f7fa;
  border: 1px dashed var(--border);
  border-radius: 6px;
}

.hl-media-card__preview--empty {
  color: var(--text-muted);
  font-size: 12px;
}

.hl-media-card__preview img {
  max-width: 100%;
  max-height: 72px;
  object-fit: contain;
}

.hl-media-card__size {
  margin: -6px 0 0;
  font-size: 11px;
  color: var(--text-muted);
}

.hl-code {
  display: inline-block;
  font-size: 11px;
  color: var(--text-muted);
  background: #f0f2f5;
  padding: 2px 7px;
  border-radius: 4px;
}

.btn--block {
  width: 100%;
  justify-content: center;
}

.hl-hidden {
  display: none !important;
}

.hl-optional {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
}

.hl-col-preview {
  width: 148px;
}

.hl-banner-thumb {
  display: block;
  width: 132px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border-light);
  background: #f5f7fa;
}

.hl-banner-thumb--empty {
  display: grid;
  place-items: center;
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  padding: 4px;
}

.hl-banner-editor__fields {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.hl-banner-preview {
  margin-bottom: 4px;
}

.hl-banner-preview__frame {
  padding: 12px;
  background: #0d1117;
  border: 1px solid var(--border-light);
  border-radius: 8px;
}

.hl-banner-preview__card {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 1;
  min-height: 120px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--banner-bg, #1a2e24);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-decoration: none;
  color: #fff;
}

.hl-banner-preview .banner-card--no-border {
  border-color: transparent;
}

.hl-banner-preview .banner-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hl-banner-preview .banner-card__img.is-hidden {
  display: none;
}

.hl-banner-preview .banner-card__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  padding: 16px 20px;
  background: rgba(5, 5, 8, 0.55);
}

.hl-banner-preview .banner-card--no-overlay .banner-card__content {
  background: transparent;
}

.hl-banner-preview .banner-card__content.is-hidden {
  display: none;
}

.hl-banner-preview .banner-card__title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.15;
}

.hl-banner-preview .banner-card__subtitle {
  margin: 0 0 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
  max-width: 24ch;
}

.hl-banner-preview .banner-card__subtitle.is-hidden,
.hl-banner-preview .banner-card__cta.is-hidden {
  display: none;
}

.hl-banner-preview .banner-card__cta {
  display: inline-flex;
  align-self: flex-start;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #050508;
  background: var(--banner-accent, #00e68a);
}

.hl-banner-preview__hint {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--text-muted);
}

.admin-code-block {
  margin-top: 10px;
  padding: 10px 12px;
  background: #f5f7fa;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  font-size: 12px;
}

@media (max-width: 1200px) {
  .hl-media-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .hl-field--narrow {
    max-width: none;
  }

  .hl-media-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .hl-page__body {
    padding: 16px;
  }

  .hl-header {
    flex-direction: column;
    align-items: stretch;
  }

  .hl-tabs {
    padding: 0 12px;
    overflow-x: auto;
  }

  .hl-form {
    padding: 16px;
  }

  .hl-block--nested {
    margin-left: 12px;
    margin-right: 12px;
  }
}

.vip-config__layout {
  align-items: start;
}

.vip-config__level-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vip-config__icon-key {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: #f0f2f5;
  font-size: 10px;
  color: #606266;
  text-transform: lowercase;
}

.vip-config__level-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vip-config__preview {
  margin-bottom: 8px;
}

.vip-config__reset {
  margin-top: 12px;
}

.admin-hint {
  color: var(--text-secondary);
  line-height: 1.6;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.theme-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 14px;
  border: 1px solid #e4e7ed;
  border-radius: 8px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.theme-card:hover {
  border-color: #c0c4cc;
}

.theme-card.is-active {
  border-color: #409eff;
  box-shadow: 0 0 0 1px #409eff inset;
  background: #f0f7ff;
}

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

.theme-card__title {
  font-weight: 600;
  color: #303133;
}

.theme-card__id {
  font-size: 12px;
  color: #909399;
}

.theme-card__mode {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.theme-card__mode--dark {
  background: #303133;
  color: #fff;
}

.theme-card__mode--light {
  background: #fdf6ec;
  color: #e6a23c;
}

.theme-swatches {
  display: flex;
  gap: 6px;
}

.theme-swatch {
  flex: 1;
  height: 28px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.theme-card__actions {
  margin-top: auto;
}

.theme-card__actions .btn {
  width: 100%;
}

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