
/* TraceSeek Admin — 运营管理中心 */

:root {
  --adm-bg: #ffffff;
  --adm-bg-accent: none;
  --adm-sidebar: #ffffff;
  --adm-border: rgba(15, 23, 42, 0.08);
  --adm-text: #0f172a;
  --adm-muted: #64748b;
  --adm-accent: #0d9488;
  --adm-accent-hover: #0f766e;
  --adm-success: #16a34a;
  --adm-warning: #d97706;
  --adm-danger: #ef4444;
  --adm-card: #ffffff;
  --adm-input-bg: #ffffff;
  --adm-font: 'Inter', system-ui, sans-serif;
  --adm-radius: 8px;
  --adm-shadow: none;
  --adm-shadow-md: none;
}

*, *::before, *::after { box-sizing: border-box; }

.adm {
  margin: 0;
  font-family: var(--adm-font);
  background: var(--adm-bg);
  background-image: var(--adm-bg-accent);
  color: var(--adm-text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.adm-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.adm-sidebar {
  width: 224px;
  flex-shrink: 0;
  background: #ffffff;
  border-right: 1px solid var(--adm-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  box-shadow: none;
}

.adm-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 20px;
  border-bottom: 1px solid var(--adm-border);
  flex-shrink: 0;
}

.adm-brand-text {
  flex: 1;
  min-width: 0;
}

.adm-sidebar-close {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-left: auto;
  border: 1px solid var(--adm-border);
  border-radius: 10px;
  background: #fff;
  color: var(--adm-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.adm-sidebar-close:hover {
  background: #f8fafc;
  color: var(--adm-text);
}

.adm-brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(145deg, #0f766e 0%, #0d9488 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.28);
}

.adm-brand strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.adm-brand span {
  font-size: 11px;
  color: var(--adm-muted);
}

.adm-nav {
  flex: 1;
  padding: 16px 12px 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.adm-nav-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.adm-nav-group + .adm-nav-group {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.adm-nav-group-label {
  padding: 0 14px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--adm-muted);
  opacity: 0.85;
}

.adm-nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--adm-muted);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
  position: relative;
}

.adm-nav-item:hover {
  background: rgba(15, 23, 42, 0.04);
  color: var(--adm-text);
}

.adm-nav-item.active {
  background: rgba(13, 148, 136, 0.08);
  color: #0f766e;
  font-weight: 600;
  box-shadow: none;
  border: 1px solid rgba(13, 148, 136, 0.12);
}

.adm-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  border-radius: 0 4px 4px 0;
  background: #0d9488;
}

.adm-nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
}

.adm-badge {
  margin-left: auto;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  min-width: 20px;
  text-align: center;
}

.adm-badge.hidden { display: none; }

/* ── Main ── */
.adm-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.adm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--adm-border);
  background: #ffffff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: none;
}

.adm-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.adm-header-titles {
  min-width: 0;
}

.adm-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--adm-border);
  border-radius: 12px;
  background: #fff;
  color: var(--adm-text);
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: var(--adm-shadow);
  transition: background 0.15s, border-color 0.15s;
}

.adm-menu-btn:hover {
  background: #f8fafc;
  border-color: rgba(13, 148, 136, 0.22);
}

.adm-header-left h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.adm-header-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--adm-muted);
}

.adm-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.adm-header-divider {
  width: 1px;
  height: 28px;
  background: var(--adm-border);
  margin: 0 4px;
}

.adm-header-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}

.adm-header-btn svg {
  flex-shrink: 0;
  opacity: 0.85;
}

.adm-header-btn-ghost {
  background: #fff;
  border: 1px solid var(--adm-border);
  color: var(--adm-muted);
  box-shadow: var(--adm-shadow);
}

.adm-header-btn-ghost:hover {
  background: #f8fafc;
  color: var(--adm-text);
  border-color: rgba(15, 23, 42, 0.12);
}

.adm-header-btn-danger {
  background: linear-gradient(135deg, #fef2f2 0%, #fff1f2 100%);
  border: 1px solid rgba(239, 68, 68, 0.22);
  color: #dc2626;
}

.adm-header-btn-danger:hover {
  background: #fee2e2;
  border-color: rgba(239, 68, 68, 0.35);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.12);
}

.adm-header-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px 5px 5px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--adm-border);
}

.adm-header-user .adm-user-avatar,
#adm-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(145deg, #0f766e 0%, #0d9488 100%);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.adm-header-user-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.adm-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--adm-text);
  line-height: 1.2;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.adm-role-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #0d9488;
  line-height: 1.2;
}

.adm-content {
  padding: 16px 24px 40px;
  flex: 1;
  min-width: 0;
  max-width: none;
  width: 100%;
  margin: 0;
}

.adm-section { display: none !important; }
.adm-section.active { display: block !important; }

.adm-pending-alerts {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: var(--adm-radius);
  border: 1px solid rgba(239, 68, 68, 0.22);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(245, 158, 11, 0.06));
}

.adm-pending-alerts.hidden { display: none !important; }

.adm-pending-alerts-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
}

.adm-pending-alerts-label {
  font-size: 12px;
  font-weight: 700;
  color: #b45309;
}

.adm-pending-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.adm-pending-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: #fff;
}

.adm-pending-chip strong {
  font-weight: 800;
}

.adm-pending-chip-ticket {
  background: #ef4444;
}

.adm-pending-chip-withdraw {
  background: #d97706;
}

.adm-pending-chip-order {
  background: #0d9488;
}

.adm-pending-chip:hover {
  filter: brightness(1.05);
}

/* ── Dashboard ── */
.adm-dash-section { margin-bottom: 28px; }

.adm-dash-section-title {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--adm-muted);
}

.adm-kpi-row {
  display: grid;
  gap: 16px;
}

.adm-kpi-row-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.adm-kpi-row-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.adm-kpi-row-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.adm-kpi-row-pending {
  margin-top: 16px;
}

/* 累计数据：移动端合并为统一 2 列网格 */
.adm-kpi-grid-total {
  display: block;
}

.adm-kpi {
  background: var(--adm-card);
  border: 1px solid var(--adm-border);
  border-radius: 8px;
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s;
  box-shadow: none;
}

.adm-kpi:hover {
  transform: translateY(-1px);
  box-shadow: var(--adm-shadow-md);
}

.adm-kpi::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--adm-radius) var(--adm-radius) 0 0;
  opacity: 0.9;
}

.adm-kpi-cyan::before { background: linear-gradient(90deg, #22d3ee, #06b6d4); }
.adm-kpi-violet::before { background: linear-gradient(90deg, #0f766e, #0d9488); }
.adm-kpi-emerald::before { background: linear-gradient(90deg, #34d399, #10b981); }
.adm-kpi-amber::before { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.adm-kpi-blue::before { background: linear-gradient(90deg, #60a5fa, #3b82f6); }
.adm-kpi-green::before { background: linear-gradient(90deg, #4ade80, #22c55e); }
.adm-kpi-teal::before { background: linear-gradient(90deg, #2dd4bf, #14b8a6); }
.adm-kpi-rose::before { background: linear-gradient(90deg, #fb7185, #f43f5e); }

.adm-kpi:hover {
  transform: translateY(-2px);
  box-shadow: var(--adm-shadow);
}

.adm-kpi-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--adm-muted);
}

.adm-kpi-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
  margin-top: 4px;
  letter-spacing: -0.03em;
  font-feature-settings: "tnum";
}

.adm-kpi-cyan .adm-kpi-value { color: #0891b2; }
.adm-kpi-violet .adm-kpi-value { color: #0f766e; }
.adm-kpi-emerald .adm-kpi-value { color: #059669; }
.adm-kpi-amber .adm-kpi-value { color: #d97706; }
.adm-kpi-blue .adm-kpi-value { color: #0f766e; }
.adm-kpi-green .adm-kpi-value { color: #16a34a; }
.adm-kpi-teal .adm-kpi-value { color: #0d9488; }
.adm-kpi-rose .adm-kpi-value { color: #e11d48; }

.adm-kpi-sub {
  margin-top: 6px;
  font-size: 11px;
  color: var(--adm-muted);
}

.adm-card-spaced { margin-top: 8px; }

/* ── Cards & tables ── */
.adm-card {
  background: var(--adm-card);
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius);
  overflow: hidden;
  box-shadow: var(--adm-shadow);
}

.adm-card-flush { border-radius: var(--adm-radius); }

.adm-card-title {
  padding: 16px 20px;
  font-size: 13px;
  font-weight: 600;
  border-bottom: 1px solid var(--adm-border);
  background: #fafafa;
}

.adm-table-box {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 0 0 var(--adm-radius) var(--adm-radius);
}

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

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

.adm-table th {
  font-size: 11px;
  font-weight: 600;
  color: var(--adm-muted);
  background: #fafafa;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.adm-table tr:last-child td { border-bottom: none; }
.adm-table tbody tr:hover td { background: rgba(13, 148, 136, 0.05); }

.adm-table-compact th,
.adm-table-compact td { padding: 10px 14px; }

.adm-cell-clip {
  display: inline-block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.adm-cell-muted { color: var(--adm-muted); font-size: 12px; }

.adm-user-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: #0f766e;
  cursor: pointer;
  text-decoration: none;
  text-underline-offset: 3px;
}

.adm-user-link:hover { color: #1d4ed8; }

.adm-code {
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: 12px;
  background: rgba(13, 148, 136, 0.1);
  padding: 2px 8px;
  border-radius: 6px;
  color: #0f766e;
}

.adm-amount-plus { color: #16a34a; font-weight: 600; }
.adm-amount-minus { color: #dc2626; font-weight: 600; }

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

/* ── Shared list cards (mobile) ── */
.adm-list-mobile { display: none; }

.adm-list-card {
  background: var(--adm-card);
  border: 1px solid var(--adm-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--adm-shadow);
}

.adm-list-card-btn {
  display: block;
  width: 100%;
  padding: 14px 16px;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.adm-list-card-btn:active {
  background: rgba(13, 148, 136, 0.05);
}

.adm-list-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.adm-list-card-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  word-break: break-word;
}

.adm-list-card-head .adm-tag {
  flex-shrink: 0;
  font-size: 10px;
}

.adm-list-card-amount {
  font-size: 20px;
  font-weight: 800;
  color: #0f766e;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.adm-list-card-meta {
  font-size: 12px;
  color: var(--adm-muted);
}

.adm-list-card-desc {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--adm-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Users list (desktop table + mobile cards) ── */
.adm-users-mobile { display: none; }

.adm-user-card {
  background: var(--adm-card);
  border: 1px solid var(--adm-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.adm-user-card-main {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.adm-user-card-main:active {
  background: rgba(13, 148, 136, 0.05);
}

.adm-user-card-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(145deg, #0f766e 0%, #0d9488 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.adm-user-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.adm-user-card-top {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.adm-user-card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--adm-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.adm-user-card-top .adm-tag {
  flex-shrink: 0;
  font-size: 10px;
  padding: 1px 6px;
}

.adm-user-card-email {
  font-size: 11px;
  color: var(--adm-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.adm-user-card-meta {
  font-size: 11px;
  color: var(--adm-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.adm-user-card-actions {
  display: flex;
  gap: 0;
  border-top: 1px solid var(--adm-border);
}

.adm-user-card-act {
  flex: 1;
  min-width: 0;
  height: 30px;
  padding: 0 4px;
  border: none;
  border-right: 1px solid var(--adm-border);
  background: #fafbfc;
  color: var(--adm-muted);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.adm-user-card-act:last-child { border-right: none; }

.adm-user-card-act:active {
  background: rgba(13, 148, 136, 0.1);
}

.adm-user-card-act-primary {
  color: #0f766e;
  background: rgba(13, 148, 136, 0.08);
}

.adm-user-card-act-danger {
  color: #dc2626;
}

.adm-users-toolbar .adm-input {
  flex: 1;
  min-width: 0;
}

/* ── Buttons & inputs ── */
.adm-btn {
  height: 36px;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.adm-btn:active { transform: scale(0.98); }

.adm-btn-primary {
  background: linear-gradient(135deg, #0f766e, #0d9488);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 12px rgba(13, 148, 136, 0.28);
}

.adm-btn-primary:hover { filter: brightness(1.06); }

.adm-btn-ghost {
  background: #ffffff;
  color: var(--adm-muted);
  border-color: var(--adm-border);
}

.adm-btn-ghost:hover {
  color: var(--adm-text);
  border-color: rgba(0, 0, 0, 0.15);
  background: #fafafa;
}

.adm-btn-danger {
  background: rgba(239, 68, 68, 0.08);
  color: #dc2626;
  border-color: rgba(239, 68, 68, 0.2);
}

.adm-btn-xs {
  height: 30px;
  padding: 0 12px;
  font-size: 11px;
}

.adm-btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
}

.adm-input-sm {
  height: 32px;
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.adm-settings-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

@media (max-width: 520px) {
  .adm-settings-form-row { grid-template-columns: 1fr; }
}

.adm-field .adm-select,
.adm-field select,
.adm-dialog .adm-select,
.adm-drawer .adm-select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.adm-input,
.adm-select,
.adm-textarea {
  width: 100%;
  background: var(--adm-input-bg);
  border: 1px solid var(--adm-border);
  border-radius: 10px;
  color: var(--adm-text);
  font-size: 13px;
  font-family: inherit;
  padding: 0 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.adm-input:focus,
.adm-select:focus,
.adm-textarea:focus {
  outline: none;
  border-color: rgba(13, 148, 136, 0.5);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.14);
}

.adm-input, .adm-select { height: 38px; }
.adm-textarea { padding: 12px 14px; resize: vertical; min-height: 80px; }
.adm-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
}

/* 工具栏筛选用自动宽度；表单/抽屉内强制铺满 */
.adm-section-toolbar .adm-select,
.adm-orders-history-toolbar .adm-select,
.adm-pager .adm-select {
  width: auto;
  min-width: 150px;
}
.adm-field .adm-select,
.adm-field select,
.adm-dialog .adm-select,
.adm-drawer .adm-select,
.adm-select-full {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.adm-categories-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  margin-bottom: 16px;
}

.adm-category-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--adm-border);
  border-radius: 10px;
  background: #fafafa;
}

.adm-category-row-info strong {
  display: block;
  font-size: 13px;
}

.adm-category-row-info span {
  font-size: 11px;
  color: var(--adm-muted);
}

.adm-category-row-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.adm-category-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr 80px;
  gap: 10px;
  margin-bottom: 12px;
}

.adm-category-form .adm-field-sort .adm-input {
  width: 100%;
}

@media (max-width: 520px) {
  .adm-category-form-row { grid-template-columns: 1fr; }
}

.adm-section-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.adm-section-toolbar-sub {
  justify-content: space-between;
  margin-bottom: 12px;
}

.adm-section-toolbar-sub .adm-input {
  flex: 1;
  max-width: 320px;
}

.adm-segment {
  display: inline-flex;
  width: 100%;
  padding: 3px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid var(--adm-border);
  box-sizing: border-box;
}

.adm-segment-btn {
  border: none;
  background: transparent;
  color: var(--adm-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.adm-segment-btn:hover { color: var(--adm-text); }

.adm-segment-btn.active {
  background: #fff;
  color: var(--adm-text);
  box-shadow: var(--adm-shadow);
}

.adm-textarea-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
}

.adm-select-wrap {
  position: relative;
}

.adm-select-wrap::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--adm-muted);
  border-bottom: 2px solid var(--adm-muted);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.adm-select-styled {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  padding: 11px 40px 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--adm-border);
  background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
  color: var(--adm-text);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.adm-select-styled:hover {
  border-color: rgba(13, 148, 136, 0.35);
}

.adm-select-styled:focus {
  outline: none;
  border-color: var(--adm-accent);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.14);
}

.adm-settings-form { max-width: none; width: 100%; }

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

.adm-settings-card-wide { grid-column: 1 / -1; }

.adm-settings-title {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 700;
}

.adm-settings-card {
  padding: 20px 22px;
  border-radius: 12px;
}

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

.adm-field-check input { width: auto; }

.adm-balance-mode {
  border: 1px solid var(--adm-border, #e2e8f0);
  border-radius: 10px;
  padding: 12px 14px 10px;
  margin: 0 0 8px;
}

.adm-balance-mode legend {
  font-size: 13px;
  font-weight: 600;
  padding: 0 4px;
}

.adm-balance-mode .adm-field-check {
  margin: 6px 0;
}

.adm-balance-mode-hint {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.45;
}

.adm-settings-mail-test {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  align-items: stretch;
}

.adm-settings-mail-test .adm-input { flex: 1; min-width: 0; }

@media (max-width: 760px) {
  .adm-settings-grid { grid-template-columns: 1fr; }
  .adm-settings-mail-test {
    flex-direction: column;
  }
  .adm-settings-mail-test .adm-btn {
    width: 100%;
    justify-content: center;
    min-height: 42px;
  }
}

.adm-detail-block {
  margin-bottom: 18px;
}

.adm-detail-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--adm-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.adm-pre {
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--adm-border);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.adm-section-toolbar .adm-input { max-width: 300px; }

.adm-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 18px;
  font-size: 13px;
  color: var(--adm-muted);
}

.adm-muted { color: var(--adm-muted); font-size: 13px; }

.adm-empty-state {
  padding: 56px 24px;
  text-align: center;
  color: var(--adm-muted);
  font-size: 13px;
}

.adm-empty-compact { padding: 32px 16px; }

/* ── Tags ── */
.adm-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.1);
  color: #475569;
}

.adm-tag-pending { background: rgba(245, 158, 11, 0.12); color: #b45309; }
.adm-tag-processing { background: rgba(13, 148, 136, 0.12); color: #0f766e; }
.adm-tag-warning { background: rgba(234, 88, 12, 0.12); color: #c2410c; }
.adm-tag-resolved { background: rgba(22, 163, 74, 0.1); color: #16a34a; }
.adm-tag-vip { background: rgba(13, 148, 136, 0.12); color: #0f766e; }
.adm-tag-balance { background: rgba(59, 130, 246, 0.1); color: #2563eb; }
.adm-tag-closed { background: rgba(0, 0, 0, 0.06); color: var(--adm-muted); }
.adm-tag-admin { background: rgba(124, 58, 237, 0.1); color: #7c3aed; }

/* ── User drawer ── */
.adm-drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
}

.adm-drawer.hidden { display: none; }

.adm-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
}

.adm-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(640px, 100vw);
  height: 100%;
  background: #ffffff;
  border-left: 1px solid var(--adm-border);
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
  animation: adm-slide-in 0.25s ease;
}

.adm-drawer-panel-wide { width: min(720px, 100vw); }

.adm-drawer-body-padded { padding: 20px 24px; }

.adm-drawer-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 24px;
  border-top: 1px solid var(--adm-border);
  background: #fafafa;
}

.adm-table-clickable tbody tr { cursor: pointer; }

.adm-ticket-detail-block {
  margin-bottom: 20px;
  padding: 16px;
  border: 1px solid var(--adm-border);
  border-radius: 12px;
  background: #fafafa;
}

.adm-ticket-detail-reply {
  background: rgba(13, 148, 136, 0.05);
  border-color: rgba(13, 148, 136, 0.18);
}

.adm-ticket-detail-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--adm-muted);
  margin-bottom: 8px;
}

.adm-ticket-detail-content {
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.adm-ticket-reply-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--adm-border);
}

.adm-ticket-thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.adm-ticket-msg {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--adm-border);
}

.adm-ticket-msg-user {
  background: rgba(13, 148, 136, 0.05);
}

.adm-ticket-msg-admin {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.18);
}

.adm-ticket-msg-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--adm-muted);
  margin-bottom: 8px;
}

.adm-ticket-msg-body {
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.adm-field-hint {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--adm-muted);
}

.adm-tag-suggestions { margin-bottom: 8px; }

.adm-tag-suggestions-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--adm-muted);
  margin-bottom: 8px;
}

.adm-tag-suggestions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.adm-tag-chip {
  border: 1px solid var(--adm-border);
  background: #f4f4f5;
  color: var(--adm-text);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}

.adm-tag-chip:hover {
  border-color: rgba(13, 148, 136, 0.32);
  background: rgba(13, 148, 136, 0.08);
  color: #0f766e;
}

.adm-tags-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  margin-bottom: 16px;
}

@keyframes adm-slide-in {
  from { transform: translateX(100%); opacity: 0.8; }
  to { transform: translateX(0); opacity: 1; }
}

.adm-drawer-open { overflow: hidden; }

.adm-drawer-panel-user { width: min(680px, 100vw); }

.adm-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 14px;
  border-bottom: 1px solid var(--adm-border);
  background: linear-gradient(180deg, #fafafa 0%, #ffffff 100%);
}

.adm-drawer-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.adm-drawer-close {
  width: 36px;
  height: 36px;
  border: 1px solid var(--adm-border);
  border-radius: 10px;
  background: #fafafa;
  color: var(--adm-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.adm-drawer-close:hover {
  background: #f4f4f5;
  color: var(--adm-text);
}

.adm-drawer-summary {
  padding: 0;
  border-bottom: 1px solid var(--adm-border);
  background: #ffffff;
}

.adm-user-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 24px 12px;
}

.adm-user-hero .adm-user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(145deg, #0f766e 0%, #0d9488 100%);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.28);
}

.adm-user-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.adm-user-meta-extra {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 0 24px 14px;
  font-size: 12px;
  color: var(--adm-muted);
}

.adm-user-meta-extra strong {
  color: var(--adm-text);
  font-weight: 600;
}

.adm-user-meta-dot { opacity: 0.5; }

.adm-user-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 0 24px 18px;
}

.adm-user-stat-card {
  padding: 12px 14px;
  border: 1px solid var(--adm-border);
  border-radius: 12px;
  background: #fafafa;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.adm-user-stat-card:hover {
  border-color: rgba(13, 148, 136, 0.22);
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.08);
}

.adm-user-stat-label {
  display: block;
  font-size: 11px;
  color: var(--adm-muted);
  margin-bottom: 4px;
}

.adm-user-stat-value {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.adm-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.adm-summary-item {
  background: #ffffff;
  border: 1px solid var(--adm-border);
  border-radius: 10px;
  padding: 12px 14px;
}

.adm-summary-item span {
  display: block;
  font-size: 11px;
  color: var(--adm-muted);
  margin-bottom: 4px;
}

.adm-summary-item strong {
  font-size: 15px;
  font-weight: 700;
}

.adm-drawer-tabs {
  display: flex;
  gap: 6px;
  padding: 12px 24px 0;
  border-bottom: 1px solid var(--adm-border);
  overflow-x: auto;
  scrollbar-width: none;
}

.adm-drawer-tabs::-webkit-scrollbar { display: none; }

.adm-drawer-tab {
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--adm-muted);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  margin-bottom: 12px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.adm-drawer-tab:hover {
  color: var(--adm-text);
  background: rgba(0, 0, 0, 0.04);
}

.adm-drawer-tab.active {
  color: #0f766e;
  background: rgba(13, 148, 136, 0.1);
  border-color: rgba(13, 148, 136, 0.22);
}

.adm-affiliate-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 0;
}

.adm-affiliate-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.adm-affiliate-stat {
  padding: 12px 14px;
  border: 1px solid var(--adm-border);
  border-radius: 12px;
  background: #fafafa;
}

.adm-affiliate-stat span {
  display: block;
  font-size: 11px;
  color: var(--adm-muted);
  margin-bottom: 4px;
}

.adm-affiliate-stat strong {
  font-size: 15px;
  font-weight: 700;
}

.adm-affiliate-section-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
}

.adm-withdraw-qr-link img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--adm-border);
}

.adm-drawer-body {
  flex: 1;
  overflow: auto;
  padding: 16px 24px;
}

.adm-drawer-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 24px;
  border-top: 1px solid var(--adm-border);
  font-size: 12px;
  color: var(--adm-muted);
}

/* ── Tickets ── */
.adm-ticket-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.adm-ticket-card {
  background: var(--adm-card);
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius);
  padding: 18px 20px;
  transition: border-color 0.15s;
}

.adm-ticket-card:hover { border-color: rgba(13, 148, 136, 0.28); }

.adm-ticket-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.adm-ticket-card-head h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.adm-ticket-meta {
  font-size: 12px;
  color: var(--adm-muted);
  margin-bottom: 8px;
}

.adm-ticket-body {
  font-size: 13px;
  line-height: 1.6;
  color: var(--adm-text);
  white-space: pre-wrap;
  margin-bottom: 10px;
}

.adm-ticket-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.adm-ticket-attachments a {
  display: block;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--adm-border);
}

.adm-ticket-attachments img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.adm-ticket-reply {
  background: rgba(13, 148, 136, 0.08);
  border: 1px solid rgba(13, 148, 136, 0.18);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  margin-top: 10px;
}

.adm-ticket-reply strong {
  display: block;
  font-size: 11px;
  color: #0f766e;
  margin-bottom: 6px;
}

.adm-ticket-preview {
  background: var(--adm-input-bg);
  border: 1px solid var(--adm-border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 14px;
  font-size: 13px;
}

/* ── News editor ── */
.adm-news-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
  min-height: 520px;
}

.adm-news-list {
  max-height: 640px;
  overflow-y: auto;
}

.adm-news-list-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 14px 18px;
  border: none;
  border-bottom: 1px solid var(--adm-border);
  background: transparent;
  color: var(--adm-text);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s;
}

.adm-news-list-item:hover { background: rgba(0, 0, 0, 0.03); }
.adm-news-list-item.active {
  background: rgba(13, 148, 136, 0.1);
  border-left: 3px solid #0d9488;
}

.adm-news-list-item strong {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}

.adm-news-list-item span {
  font-size: 11px;
  color: var(--adm-muted);
}

.adm-news-form {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── Orders management ── */
.adm-orders-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.adm-orders-toolbar .adm-segment {
  flex: 0 1 280px;
}

.adm-orders-toolbar #adm-order-refresh {
  margin-left: auto;
  flex-shrink: 0;
}

.adm-orders-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.adm-orders-layout {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 14px;
  min-height: 480px;
  align-items: stretch;
}

.adm-orders-list-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.adm-orders-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--adm-border);
  background: #fafbfc;
  flex-shrink: 0;
}

.adm-orders-list-toolbar .adm-muted {
  font-size: 12px;
  font-weight: 600;
}

.adm-orders-list {
  flex: 1;
  overflow-y: auto;
  max-height: min(62vh, 640px);
  -webkit-overflow-scrolling: touch;
}

.adm-orders-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  border: none;
  border-bottom: 1px solid var(--adm-border);
  background: transparent;
  color: var(--adm-text);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 0.12s;
}

.adm-orders-list-item:hover {
  background: rgba(15, 23, 42, 0.03);
}

.adm-orders-list-item.active {
  background: rgba(13, 148, 136, 0.1);
  box-shadow: inset 3px 0 0 #0d9488;
}

.adm-orders-list-item-body {
  flex: 1;
  min-width: 0;
}

.adm-orders-list-item-body strong {
  display: block;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.3;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.adm-orders-list-item-meta {
  font-size: 11px;
  color: var(--adm-muted);
}

.adm-orders-list-item-price {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 13px;
  font-weight: 700;
  color: #0f766e;
  letter-spacing: -0.02em;
}

.adm-orders-list-item-cost {
  font-size: 11px;
  font-weight: 500;
  color: var(--adm-muted);
}

.adm-orders-editor-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.adm-orders-empty {
  flex: 1;
  min-height: 280px;
}

.adm-orders-form {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.adm-orders-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 14px;
}

.adm-orders-form-grid .adm-orders-form-span {
  grid-column: 1 / -1;
}

.adm-orders-form-actions {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--adm-border);
}

.adm-orders-history-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: var(--adm-card);
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius);
  box-shadow: var(--adm-shadow);
}

.adm-orders-history-toolbar .adm-input {
  flex: 1 1 220px;
  min-width: 0;
  max-width: 480px;
}

.adm-orders-history-toolbar .adm-select {
  flex: 0 0 140px;
  width: 140px;
  min-width: 0;
}

.adm-table-orders .adm-th-id,
.adm-table-orders .adm-td-id {
  width: 56px;
  white-space: nowrap;
}

.adm-table-orders .adm-th-content,
.adm-table-orders .adm-td-content {
  min-width: 160px;
}

.adm-table-orders .adm-td-content .adm-cell-clip {
  display: inline-block;
  max-width: min(420px, 36vw);
}

.adm-table-orders .adm-td-amount {
  font-weight: 650;
  white-space: nowrap;
  color: #1d4ed8;
}

.adm-table-orders .adm-td-time {
  white-space: nowrap;
}

.adm-order-card-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.adm-order-card .adm-list-card-amount {
  font-size: 18px;
}

@media (max-width: 1100px) {
  .adm-orders-form-grid {
    grid-template-columns: 1fr 1fr;
  }

  .adm-table-orders .adm-td-content .adm-cell-clip {
    max-width: min(260px, 28vw);
  }
}

.adm-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.adm-field span {
  font-size: 12px;
  font-weight: 600;
  color: var(--adm-muted);
}

.adm-field-check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.adm-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.adm-form-actions-right {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

/* ── Dialogs ── */
.adm-dialog {
  border: 1px solid var(--adm-border);
  border-radius: 16px;
  padding: 0;
  background: #ffffff;
  color: var(--adm-text);
  max-width: 440px;
  width: calc(100% - 32px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.15);
}

.adm-dialog-wide { max-width: 580px; }

.adm-dialog-card-result {
  max-width: 400px;
  width: calc(100% - 24px);
}

.adm-card-result-body {
  padding: 14px 16px 12px;
  gap: 10px;
}

.adm-card-result-body h3 {
  font-size: 16px;
}

.adm-card-result-sub {
  margin: 2px 0 0;
  font-size: 12px;
  line-height: 1.4;
}

.adm-card-result-list {
  max-height: min(45vh, 240px);
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid var(--adm-border);
  border-radius: 8px;
  background: #f8fafc;
  -webkit-overflow-scrolling: touch;
}

.adm-card-result-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  min-height: 32px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.adm-card-result-row:last-child {
  border-bottom: none;
}

.adm-card-result-row .adm-card-code-sm {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  padding: 2px 6px;
  background: #fff;
}

.adm-card-result-amt {
  flex: 0 1 auto;
  max-width: 46%;
  min-width: 0;
  font-size: 11px;
  color: var(--adm-muted);
  text-align: right;
  white-space: normal;
  line-height: 1.35;
  word-break: break-word;
}

.adm-card-result-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--adm-border);
}

.adm-card-result-toolbar .adm-btn {
  flex: 1;
  min-width: 0;
  padding: 7px 8px;
  font-size: 12px;
  white-space: nowrap;
}

.adm-card-result-toolbar .adm-btn-primary {
  flex: 1.2;
}

.adm-dialog::backdrop { background: rgba(0, 0, 0, 0.4); backdrop-filter: blur(2px); }

.adm-dialog-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.adm-dialog-body h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

/* ── Toast ── */
.adm-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: #ffffff;
  border: 1px solid var(--adm-border);
  color: var(--adm-text);
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  z-index: 999;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.adm-toast.success { border-color: rgba(22, 163, 74, 0.35); color: #16a34a; }
.adm-toast.error { border-color: rgba(239, 68, 68, 0.35); color: #dc2626; }
.adm-toast.hidden { display: none; }
.hidden { display: none !important; }

/* ── Mobile sidebar & bottom nav ── */
.adm-sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 190;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s, visibility 0.25s;
}

.adm-sidebar-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.adm-mobile-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  padding: 4px 6px calc(4px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--adm-border);
  box-shadow: 0 -1px 0 rgba(15, 23, 42, 0.04);
  justify-content: space-around;
  gap: 0;
  overflow: hidden;
}

.adm-mobile-nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 1;
  min-width: 0;
  max-width: none;
  min-height: 48px;
  padding: 8px 2px 6px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--adm-muted);
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

html[data-adm-tab="dashboard"] .adm-mobile-nav-item[data-tab="dashboard"]::before,
html[data-adm-tab="users"] .adm-mobile-nav-item[data-tab="users"]::before,
html[data-adm-tab="tickets"] .adm-mobile-nav-item[data-tab="tickets"]::before,
html[data-adm-tab="withdrawals"] .adm-mobile-nav-item[data-tab="withdrawals"]::before,
html[data-adm-tab="news"] #adm-mobile-more::before,
html[data-adm-tab="orders"] #adm-mobile-more::before,
html[data-adm-tab="popups"] #adm-mobile-more::before,
html[data-adm-tab="cards"] #adm-mobile-more::before,
html[data-adm-tab="settings"] #adm-mobile-more::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--adm-accent, #0d9488);
}

.adm-mobile-nav-item svg {
  flex-shrink: 0;
  opacity: 0.88;
}

.adm-mobile-nav-item:active {
  color: var(--adm-accent, #0d9488);
}

.adm-mobile-nav-item span:not(.adm-mobile-badge) {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.adm-mobile-badge {
  position: absolute;
  top: 4px;
  right: calc(50% - 22px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.adm-mobile-badge.hidden { display: none; }

body.adm-sidebar-open { overflow: hidden; }

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

@media (max-width: 900px) {
  .adm-menu-btn { display: inline-flex; }
  .adm-sidebar-close { display: inline-flex; }

  .adm-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(300px, 88vw) !important;
    height: 100vh;
    height: 100dvh;
    z-index: 200;
    transform: translateX(calc(-100% - 4px));
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s linear 0.28s;
    box-shadow: none !important;
    overflow-x: hidden;
    overflow-y: auto;
    visibility: hidden;
    pointer-events: none;
    clip-path: inset(0 100% 0 0);
  }

  .adm-sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 48px rgba(15, 23, 42, 0.16) !important;
    visibility: visible;
    pointer-events: auto;
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s;
    clip-path: none;
  }

  .adm-main {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .adm-header {
    padding: 12px 16px;
    gap: 10px;
  }

  .adm-header-left h1 {
    font-size: 18px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .adm-header-sub {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .adm-header-right {
    gap: 6px;
  }

  .adm-header-user {
    padding: 4px;
    border: none;
    background: transparent;
  }

  .adm-header-user-text { display: none; }
  .adm-header-divider { display: none; }

  .adm-header-btn span { display: none; }
  .adm-header-btn {
    padding: 8px 10px;
    border-radius: 10px;
  }

  .adm-content {
    padding: 16px 16px calc(96px + env(safe-area-inset-bottom, 0px));
  }

  .adm-mobile-nav { display: flex; }

  .adm-settings-card {
    padding: 16px;
  }

  .adm-settings-mail-test {
    flex-direction: column;
    gap: 8px;
  }

  .adm-settings-mail-test .adm-btn {
    width: 100%;
    justify-content: center;
    min-height: 42px;
  }

  .adm-form-actions {
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    padding-bottom: 4px;
  }

  .adm-form-actions .adm-btn {
    min-height: 44px;
    width: 100%;
    justify-content: center;
  }

  .adm-form-actions-right {
    width: 100%;
    margin-left: 0;
  }

  .adm-form-actions-right .adm-btn {
    flex: 1;
    width: auto;
  }

  #tab-settings .adm-settings-card-wide {
    margin-bottom: 4px;
  }

  #tab-settings .adm-settings-mail-test {
    margin-bottom: 4px;
  }

  .adm-category-form-row {
    grid-template-columns: 1fr;
  }

  .adm-field-hint {
    line-height: 1.55;
  }

  .adm-input,
  .adm-select {
    min-height: 42px;
    font-size: 16px;
  }

  .adm-news-layout { grid-template-columns: 1fr; }
  .adm-drawer-panel {
    width: 100vw;
    max-width: 100vw;
  }

  .adm-section-toolbar {
    flex-wrap: wrap;
  }

  .adm-section-toolbar .adm-input {
    flex: 1 1 100%;
    max-width: none;
  }

  .adm-section-toolbar-sub {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .adm-section-toolbar-sub .adm-input {
    max-width: none;
    width: 100%;
  }

  #tab-orders .adm-orders-toolbar {
    gap: 8px;
  }

  #tab-orders .adm-orders-toolbar .adm-segment {
    flex: 1;
    min-width: 0;
  }

  #tab-orders .adm-orders-history-toolbar {
    display: grid;
    grid-template-columns: 1fr minmax(100px, 34%);
    gap: 8px;
  }

  #tab-orders .adm-orders-history-toolbar .adm-input,
  #tab-orders .adm-orders-history-toolbar .adm-select {
    width: 100%;
    max-width: none;
    flex: none;
    min-width: 0;
    height: 42px;
  }

  #tab-orders .adm-orders-layout {
    grid-template-columns: 1fr;
    min-height: 0;
    gap: 0;
  }

  #tab-orders .adm-orders-layout:not(.is-editing) .adm-orders-editor-panel {
    display: none;
  }

  #tab-orders .adm-orders-layout.is-editing .adm-orders-list-panel {
    display: none;
  }

  #tab-orders .adm-orders-list {
    max-height: none;
  }

  #tab-orders .adm-orders-form-grid {
    grid-template-columns: 1fr 1fr;
  }

  #tab-orders .adm-orders-form-actions {
    flex-wrap: wrap;
  }

  .adm-pager {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }

  .adm-kpi {
    padding: 16px 18px;
  }

  .adm-kpi-value {
    font-size: 22px;
  }

  .adm-card {
    border-radius: 14px;
  }

  .adm-table th,
  .adm-table td {
    padding: 10px 12px;
    font-size: 12px;
  }

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

  .adm-toast {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    max-width: calc(100vw - 32px);
    text-align: center;
  }

  .adm-users-desktop { display: none; }

  .adm-users-mobile,
  .adm-list-mobile {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 2px 0 4px;
  }

  .adm-list-desktop { display: none; }

  .adm-users-card,
  #tab-tickets .adm-card-flush,
  #tab-withdrawals .adm-card-flush,
  #tab-orders .adm-card-flush {
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: visible;
  }

  .adm-users-table-box,
  #tab-tickets .adm-table-box,
  #tab-withdrawals .adm-table-box,
  #tab-orders .adm-table-box {
    overflow: visible;
  }

  #tab-orders .adm-list-card-title {
    white-space: normal;
    word-break: break-word;
    line-height: 1.35;
  }

  #tab-orders .adm-list-card-desc {
    white-space: normal;
    word-break: break-word;
  }

  #tab-orders .adm-order-card .adm-list-card-amount {
    font-size: 18px;
    margin-bottom: 0;
  }

  .adm-users-mobile {
    gap: 8px;
  }

  .adm-users-toolbar {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
  }

  .adm-users-toolbar .adm-input {
    max-width: none;
  }

  .adm-users-toolbar #adm-user-create {
    grid-column: 1 / -1;
  }

  #tab-cards .adm-card-gen-form {
    grid-template-columns: 1fr;
  }

  #tab-cards .adm-card-gen-actions .adm-btn {
    width: 100%;
  }

  #tab-cards .adm-toolbar-cards {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
  }

  #tab-cards .adm-segment-cards-filter {
    max-width: none;
  }

  #tab-cards .adm-segment-cards-filter .adm-segment-btn {
    padding: 9px 6px;
    font-size: 13px;
  }

  #tab-cards .adm-toolbar-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
  }

  #tab-cards .adm-toolbar-actions .adm-btn {
    width: 100%;
    justify-content: center;
    padding-left: 4px;
    padding-right: 4px;
    font-size: 12px;
  }

  #tab-cards .adm-cards-mobile-bar {
    display: flex;
    padding: 8px 10px;
  }

  #tab-cards .adm-cards-desktop-only {
    display: none;
  }

  #tab-cards .adm-cards-desktop {
    display: none;
  }

  #tab-cards .adm-cards-mobile {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 10px;
  }

  #tab-cards .adm-card-table-box {
    overflow: visible;
  }

  #tab-users .adm-pager {
    margin-top: 12px;
    padding: 0 2px;
  }

  #tab-tickets .adm-section-toolbar,
  #tab-withdrawals .adm-section-toolbar {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
  }

  #tab-tickets .adm-select,
  #tab-withdrawals .adm-select,
  #tab-withdrawals .adm-input {
    min-width: 0;
    width: 100%;
  }

  .adm-news-layout {
    gap: 12px;
    min-height: auto;
  }

  .adm-news-list {
    max-height: min(42vh, 360px);
  }

  .adm-news-form {
    padding: 16px;
  }

  .adm-news-list-panel,
  .adm-news-editor-panel {
    min-width: 0;
  }

  .adm-settings-form {
    max-width: none;
  }

  .adm-drawer-head {
    padding: 14px 16px;
  }

  .adm-drawer-body,
  .adm-drawer-body-padded {
    padding: 16px;
  }

  .adm-drawer-foot {
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    gap: 10px;
  }

  .adm-drawer-foot .adm-btn {
    flex: 1;
  }
}

@media (max-width: 520px) {
  .adm-user-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .adm-affiliate-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .adm-summary-grid { grid-template-columns: 1fr; }
  .adm-withdraw-detail-grid { grid-template-columns: 1fr; }
  .adm-segment {
    width: 100%;
    justify-content: stretch;
  }
  .adm-segment-btn {
    flex: 1;
    text-align: center;
    padding: 8px 10px;
    font-size: 12px;
  }
}

@media (max-width: 380px) {
  .adm-header-btn {
    padding: 7px 8px;
  }
}

.adm-withdraw-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  margin-bottom: 20px;
}

.adm-withdraw-detail-grid > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.adm-withdraw-qr-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.adm-withdraw-qr-img {
  width: min(240px, 100%);
  border-radius: 12px;
  border: 1px solid var(--adm-border, #e5e7eb);
}

.adm-withdraw-reject-box {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.08);
  color: #b91c1c;
}

.adm-withdraw-reject-box p {
  margin: 6px 0 0;
  line-height: 1.5;
}

.adm-settings-desc {
  margin: -4px 0 12px;
  font-size: 13px;
}

.adm-settings-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.adm-home-popups-list {
  margin-top: 4px;
}

.adm-user-query-fee-bar {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--adm-border, #e5e7eb);
  border-radius: 12px;
  background: rgba(13, 148, 136, 0.04);
}

.adm-user-query-fee-bar .adm-field {
  margin-bottom: 10px;
}

.adm-user-query-fee-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.adm-user-query-fee-hint {
  margin: 0;
  font-size: 12px;
  color: var(--adm-muted, #6b7280);
}

.adm-user-edit-form {
  margin-top: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.adm-user-edit-section {
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid var(--adm-border);
  border-radius: 12px;
  background: #fff;
}

.adm-user-edit-section-title {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0f766e;
}

.adm-user-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.adm-user-edit-form .adm-field-hint {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 500;
  color: #94a3b8;
  line-height: 1.4;
}

.adm-user-edit-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.adm-user-edit-hint {
  margin: 0 0 10px;
  font-size: 12px;
  color: #b45309;
  line-height: 1.5;
}

.adm-list-card-actions {
  display: flex;
  gap: 8px;
  padding: 0 12px 12px;
}

.adm-td-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
}

.adm-settings-toolbar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.adm-settings-title-inline {
  margin: 0 0 6px;
}

.adm-card-cards {
  margin-bottom: 16px;
  padding: 18px 20px;
}

.adm-card-cards-head {
  margin-bottom: 16px;
}

.adm-segment-cards-type {
  display: inline-flex;
  margin-bottom: 14px;
  max-width: 320px;
  width: 100%;
}

.adm-segment-cards-type .adm-segment-btn {
  flex: 1;
  min-width: 0;
  text-align: center;
}

.adm-card-gen-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 16px;
  margin-bottom: 16px;
}

.adm-toolbar-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.adm-toolbar-filters .adm-segment-cards-filter {
  max-width: none;
  width: auto;
  min-width: 0;
}

.adm-card-gen-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
  border-top: 1px solid var(--adm-border);
}

.adm-card-cards-list {
  margin-top: 0;
  overflow: hidden;
}

.adm-card-table-box {
  border-radius: 0;
  border: none;
  box-shadow: none;
}

.adm-cards-desktop {
  display: block;
}

.adm-cards-mobile {
  display: none;
}

.ticket-new-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  vertical-align: middle;
}

.adm-order-reply-images {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}

.adm-order-reply-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.adm-order-reply-thumb {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--adm-border);
  background: #f8fafc;
}

.adm-order-reply-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.adm-order-reply-thumb button {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.adm-table-cards {
  min-width: 860px;
}

.adm-card-code-td {
  min-width: 220px;
}

.adm-card-code-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.adm-card-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  padding: 5px 10px;
  border-radius: 8px;
  line-height: 1.3;
}

.adm-copy-btn {
  flex-shrink: 0;
  border: 1px solid var(--adm-border);
  background: #fff;
  color: var(--adm-text);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.adm-copy-btn:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.adm-copy-btn:active {
  transform: scale(0.98);
}

.adm-card-amount-td {
  font-weight: 600;
  white-space: nowrap;
}

.adm-card-note-td {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.adm-card-time-td {
  white-space: nowrap;
  font-size: 12px;
}

.adm-card-actions-td {
  white-space: nowrap;
}

.adm-btn-danger-text {
  color: #dc2626;
}

.adm-btn-danger-text:hover {
  background: #fef2f2;
  color: #b91c1c;
}

.adm-card-item {
  background: #fafafa;
  border: 1px solid var(--adm-border);
  border-radius: 10px;
  padding: 14px;
}

.adm-card-item-compact {
  padding: 8px 10px;
  border-radius: 8px;
}

.adm-card-item-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.adm-card-item-row + .adm-card-item-row {
  margin-top: 6px;
}

.adm-card-item-row-sub {
  justify-content: space-between;
  gap: 8px;
}

.adm-card-code-sm {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 6px;
  letter-spacing: 0.02em;
  overflow-x: auto;
}

.adm-copy-btn-sm {
  padding: 3px 8px;
  font-size: 11px;
  border-radius: 6px;
}

.adm-tag-xs {
  font-size: 10px;
  padding: 2px 6px;
  flex-shrink: 0;
}

.adm-card-item-meta-line {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  line-height: 1.35;
  color: var(--adm-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.adm-card-item-ops {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.adm-card-item-compact .adm-card-item-check {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin: 0;
  cursor: pointer;
}

.adm-card-item-check input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 20px;
  height: 20px;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}

.adm-card-check-box {
  display: block;
  width: 20px;
  height: 20px;
  border: 2px solid #94a3b8;
  border-radius: 5px;
  background: #fff;
  box-sizing: border-box;
  transition: background 0.15s, border-color 0.15s;
}

.adm-card-item-check input:checked + .adm-card-check-box {
  background: #0d9488;
  border-color: #0f766e;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.5 8.5L6.5 11.5L12.5 4.5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px;
}

.adm-card-item-check input:focus-visible + .adm-card-check-box {
  outline: 2px solid rgba(13, 148, 136, 0.35);
  outline-offset: 2px;
}

.adm-card-check-placeholder {
  display: block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.adm-card-item-compact.is-selected {
  border-color: #93c5fd;
  background: #f0f7ff;
}

.adm-card-item-check-table {
  margin: 0 auto;
}

.adm-th-check,
.adm-td-check {
  width: 44px;
  text-align: center;
  vertical-align: middle;
}

.adm-card-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.adm-card-item-head .adm-card-code {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
}

.adm-card-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 12px;
  color: var(--adm-muted);
  margin-bottom: 12px;
}

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

.adm-card-item-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--adm-muted);
  margin-right: auto;
}

.adm-pager-inset {
  border: none;
  border-top: 1px solid var(--adm-border);
  border-radius: 0;
  box-shadow: none;
  background: #fafafa;
}

.adm-dialog-actions-wrap {
  flex-wrap: wrap;
  gap: 8px;
}

.adm-cards-mobile-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: #f8fafc;
  border-bottom: 1px solid var(--adm-border);
}

.adm-cards-mobile-bar.is-empty {
  display: none !important;
}

.adm-card-select-all-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  font-weight: 500;
}

.adm-card-select-all-text {
  color: var(--adm-text);
}

.adm-card-selected-hint {
  font-size: 12px;
  color: var(--adm-muted);
}

.adm-cards-desktop-only {
  display: inline-flex;
}

.adm-toolbar-cards {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--adm-border);
  background: #fff;
}

.adm-toolbar-cards .adm-toolbar-filters {
  flex: 1 1 auto;
}

.adm-toolbar-cards .adm-toolbar-actions {
  margin-left: auto;
}

.adm-segment-cards-filter {
  width: auto;
  max-width: none;
}

.adm-segment-cards-filter .adm-segment-btn {
  flex: 1;
  min-width: 0;
  padding: 7px 8px;
  font-size: 12px;
  text-align: center;
}

.adm-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.adm-select-sm {
  min-width: 120px;
  padding: 6px 10px;
  font-size: 13px;
}

.adm-card-table-box .adm-empty-state {
  padding: 28px 16px;
}

@media (max-width: 640px) {
  .adm-dialog-card-result {
    max-width: none;
    width: calc(100% - 20px);
  }

  .adm-card-result-toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .adm-card-result-toolbar #adm-card-result-copy {
    grid-column: 1 / -1;
  }

  .adm-card-result-toolbar .adm-btn {
    width: auto;
  }
}

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

  .adm-user-edit-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .adm-user-edit-actions .adm-btn {
    width: 100%;
  }
}

.adm-field-hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--adm-muted, #6b7280);
}

/* ── Admin layout v2 ── */
.adm-content {
  max-width: none;
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}

.adm-section-toolbar {
  padding: 10px 14px;
  background: var(--adm-card);
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius);
  box-shadow: var(--adm-shadow);
  flex-wrap: wrap;
}

.adm-section-toolbar .adm-input {
  flex: 1;
  min-width: 140px;
}

.adm-section-toolbar .adm-select {
  flex: 0 0 auto;
  width: auto;
  min-width: 140px;
  max-width: 220px;
}

#adm-ticket-status,
#adm-withdraw-status {
  min-width: 132px;
  max-width: 180px;
}

.adm-section-toolbar .adm-btn {
  flex-shrink: 0;
}

.adm-pager {
  padding: 10px 14px;
  background: var(--adm-card);
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius);
  box-shadow: var(--adm-shadow);
}

.adm-section > .adm-card {
  box-shadow: var(--adm-shadow);
}

.adm-mobile-nav-item svg {
  width: 22px;
  height: 22px;
  opacity: 1;
}

.adm-nav-icon svg {
  display: block;
}

/* ── Dashboard mobile ── */
.adm-dash-queries-mobile { display: none; }

.adm-dash-query-card {
  padding: 14px 16px;
  border: 1px solid var(--adm-border);
  border-radius: 12px;
  background: #fff;
}

.adm-dash-query-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.adm-dash-query-user {
  font-size: 14px;
  font-weight: 600;
}

.adm-dash-query-content {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--adm-text);
  word-break: break-word;
}

.adm-dash-query-time {
  font-size: 12px;
  color: var(--adm-muted);
}

@media (max-width: 900px) {
  .adm-section-toolbar {
    padding: 10px 12px;
    gap: 8px;
  }

  .adm-section-toolbar .adm-input,
  .adm-section-toolbar .adm-select {
    flex: 1 1 100%;
    min-width: 0;
  }

  .adm-pager {
    padding: 10px 12px;
  }

  .adm-dash-section { margin-bottom: 18px; }

  .adm-dash-section-title {
    margin-bottom: 10px;
    font-size: 11px;
  }

  /* 今日数据：2×2 */
  .adm-kpi-row-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  /* 累计数据：2+1全宽 + 待办2列 */
  .adm-kpi-grid-total {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .adm-kpi-grid-total .adm-kpi-row-3 {
    display: contents;
  }

  .adm-kpi-grid-total .adm-kpi-row-3 .adm-kpi:nth-child(3) {
    grid-column: 1 / -1;
  }

  .adm-kpi-grid-total .adm-kpi-row-pending {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 0;
  }

  .adm-kpi-grid-total .adm-kpi-row-pending .adm-kpi:last-child {
    grid-column: auto;
  }

  .adm-kpi {
    padding: 14px 14px;
    min-height: 72px;
  }

  .adm-kpi-value {
    font-size: 22px;
    margin-top: 6px;
  }

  .adm-kpi-label {
    font-size: 11px;
    line-height: 1.3;
  }

  .adm-kpi-sub {
    font-size: 10px;
    margin-top: 4px;
  }

  .adm-card-spaced {
    margin-top: 4px;
    margin-bottom: 8px;
  }

  .adm-dash-queries-desktop { display: none; }

  .adm-dash-queries-mobile {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px 14px;
  }

  .adm-dash-query-card {
    border-radius: 10px;
  }

  .adm-card-title {
    padding: 14px 16px;
  }

  .adm-header-sub { display: none; }

  .adm-header {
    padding: 10px 14px;
  }

  .adm-header-left {
    gap: 10px;
  }

  .adm-header-left h1 {
    font-size: 17px;
  }

  .adm-header-right {
    gap: 4px;
  }

  .adm-header-btn {
    padding: 7px 9px;
  }

  .adm-header-user .adm-user-avatar,
  #adm-user-avatar {
    width: 32px;
    height: 32px;
    font-size: 11px;
  }
}

@media (max-width: 640px) {
  .adm-header-left h1 {
    font-size: 16px;
  }

  .adm-content {
    padding: 14px 14px calc(92px + env(safe-area-inset-bottom, 0px));
  }

  .adm-section-toolbar {
    padding: 10px;
  }

  .adm-pager {
    padding: 10px;
    font-size: 12px;
  }

  .adm-pager .adm-btn {
    padding: 8px 12px;
    font-size: 12px;
  }

  #tab-news .adm-section-toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  #tab-news .adm-section-toolbar .adm-muted,
  #tab-news .adm-section-toolbar .adm-btn-primary {
    grid-column: 1 / -1;
  }

  #tab-popups .adm-settings-toolbar-head {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  #tab-popups .adm-settings-toolbar-head .adm-btn {
    width: 100%;
  }

  .adm-dialog-actions-wrap {
    flex-direction: column;
    align-items: stretch;
  }

  .adm-dialog-actions-wrap .adm-btn {
    width: 100%;
  }
}

@media (max-width: 400px) {
  .adm-mobile-nav-item span:not(.adm-mobile-badge) {
    font-size: 9px;
  }
}
/* ══════════════════════════════════════════════════════════
   Admin UI v2 · 精致运营后台
   ══════════════════════════════════════════════════════════ */

:root {
  --adm-bg: #f6f7f9;
  --adm-bg-accent: none;
  --adm-sidebar: #ffffff;
  --adm-border: rgba(15, 23, 42, 0.08);
  --adm-text: #0f172a;
  --adm-muted: #64748b;
  --adm-accent: #0d9488;
  --adm-accent-hover: #0f766e;
  --adm-card: #ffffff;
  --adm-radius: 10px;
  --adm-radius-sm: 8px;
  --adm-radius-lg: 12px;
  --adm-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  --adm-shadow-md: 0 4px 16px rgba(15, 23, 42, 0.05);
  --adm-pad: 20px;
  --adm-pad-lg: 24px;
}

.adm {
  background: var(--adm-bg);
  background-image: none;
  color: var(--adm-text);
  -webkit-font-smoothing: antialiased;
}

.adm-sidebar {
  width: 224px;
  background: #ffffff;
  border-right: 1px solid var(--adm-border);
  box-shadow: none;
}

.adm-brand {
  padding: 16px 14px;
  gap: 12px;
  min-height: 56px;
}

.adm-brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(145deg, #0f766e 0%, #0d9488 100%);
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.28);
}

.adm-brand strong {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.adm-brand span {
  font-size: 11px;
  color: #94a3b8;
}

.adm-nav {
  padding: 8px 10px 20px;
}

.adm-nav-group-label {
  padding: 12px 12px 6px;
  font-size: 10px;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: #94a3b8;
}

.adm-nav-item {
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  gap: 10px;
}

.adm-nav-item:hover {
  background: #f8fafc;
  color: #0f172a;
}

.adm-nav-item.active {
  background: rgba(13, 148, 136, 0.08);
  color: #0f766e;
  font-weight: 600;
  box-shadow: none;
}

.adm-nav-item.active::before {
  background: #0d9488;
  width: 3px;
  height: 16px;
  border-radius: 0 3px 3px 0;
}

.adm-header {
  padding: 14px var(--adm-pad-lg);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: none;
  border-bottom: 1px solid var(--adm-border);
}

.adm-header-left h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.adm-header-sub {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}

.adm-header-btn {
  border-radius: 8px;
  border: 1px solid var(--adm-border);
  background: #fff;
  color: #334155;
}

.adm-header-btn:hover {
  border-color: rgba(13, 148, 136, 0.3);
  color: #0f766e;
}

.adm-content {
  padding: var(--adm-pad) var(--adm-pad-lg) 40px;
}

.adm-kpi-row {
  gap: 12px;
}

.adm-kpi {
  border-radius: 10px !important;
  border: 1px solid var(--adm-border);
  box-shadow: none !important;
  padding: 14px 16px;
  background: #fff;
  overflow: hidden;
}

.adm-kpi::before {
  height: 2px !important;
  opacity: 0.85;
}

.adm-kpi:hover {
  transform: none;
  box-shadow: none !important;
  border-color: rgba(15, 23, 42, 0.12);
}

.adm-kpi-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.02em;
}

.adm-kpi-value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-feature-settings: "tnum";
  margin-top: 4px;
}

.adm-kpi-sub {
  font-size: 11px;
  color: #94a3b8;
}

.adm-card,
.adm-settings-card,
.adm-table-box,
.adm-modal-panel,
.adm-filter-bar {
  border-radius: 10px !important;
  border: 1px solid var(--adm-border) !important;
  box-shadow: none !important;
  background: #fff;
}

.adm-card-title,
.adm-settings-title,
.adm-dash-section-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.adm-dash-section {
  margin-bottom: 22px;
}

.adm-table {
  font-size: 13px;
}

.adm-table th {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
  background: #fafbfc;
  border-bottom: 1px solid var(--adm-border);
  padding: 10px 12px;
}

.adm-table td {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
  color: #1e293b;
}

.adm-table tr:hover td {
  background: #f8fafc;
}

.adm-btn {
  border-radius: 8px !important;
  font-weight: 600;
  font-size: 13px;
}

.adm-btn-primary {
  background: linear-gradient(135deg, #0f766e 0%, #0d9488 100%) !important;
  border-color: transparent !important;
  box-shadow: 0 4px 16px rgba(13, 148, 136, 0.22) !important;
  color: #fff !important;
}

.adm-btn-primary:hover {
  background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%) !important;
  border-color: transparent !important;
}

.adm-btn-ghost,
.adm-btn-outline {
  border-radius: 8px !important;
}

.adm-input,
.adm-textarea,
.adm-select,
.adm-select-styled {
  border-radius: 8px !important;
  border-color: var(--adm-border) !important;
  background: #fff;
  font-size: 13px;
}

.adm-input:focus,
.adm-textarea:focus,
.adm-select:focus {
  border-color: rgba(13, 148, 136, 0.5) !important;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12) !important;
}

.adm-field > span {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

.adm-field-hint {
  color: #94a3b8;
  font-size: 11.5px;
}

.adm-tag,
.adm-badge:not(.adm-nav-badge) {
  border-radius: 6px !important;
  font-weight: 600;
}

.adm-badge {
  border-radius: 6px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.adm-pending-alerts {
  border-radius: 0 !important;
  border-left: 3px solid #d97706;
  background: #fffbeb;
}

.adm-pending-chip {
  border-radius: 6px !important;
}

.adm-settings-grid {
  gap: 14px;
}

.adm-settings-card {
  padding: 16px 18px;
}

.adm-modal-panel {
  border-radius: 12px !important;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.16) !important;
}

.adm-pager {
  gap: 8px;
}

.adm-pager .adm-btn {
  border-radius: 6px !important;
}

.adm-user-drawer,
.adm-drawer,
.adm-side-panel {
  border-left: 1px solid var(--adm-border);
  box-shadow: -8px 0 24px rgba(15, 23, 42, 0.06);
}

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


/* ══════════════════════════════════════════════════════════
   Admin UI v3 · 全宽贴侧栏 · 去气球圆角 · 运营密度
   ══════════════════════════════════════════════════════════ */
:root {
  --adm-bg: #ffffff !important;
  --adm-bg-accent: none !important;
  --adm-accent: #0d9488 !important;
  --adm-accent-hover: #0f766e !important;
  --adm-radius: 8px !important;
  --adm-radius-sm: 6px !important;
  --adm-radius-lg: 8px !important;
  --adm-shadow: none !important;
  --adm-shadow-md: none !important;
  --adm-pad: 16px !important;
  --adm-pad-lg: 24px !important;
}

.adm {
  background: #ffffff !important;
  background-image: none !important;
}

.adm-sidebar {
  width: 224px !important;
  background: #ffffff !important;
  box-shadow: none !important;
}

.adm-main,
.adm-content {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
}

.adm-content {
  padding: 16px 24px 40px !important;
}

.adm-header {
  padding: 12px 24px !important;
  background: #ffffff !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

.adm-header-user,
.adm-menu-btn,
.adm-header-btn,
.adm-sidebar-close {
  border-radius: 8px !important;
}

.adm-user-avatar {
  border-radius: 6px !important;
  background: linear-gradient(145deg, #0f766e 0%, #0d9488 100%) !important;
}

.adm-nav-item {
  border-radius: 8px !important;
}

.adm-nav-item.active,
html[data-adm-tab] .adm-nav-item[data-tab].active {
  background: rgba(13, 148, 136, 0.08) !important;
  color: #0f766e !important;
  box-shadow: none !important;
}

.adm-kpi,
.adm-card,
.adm-settings-card,
.adm-table-box,
.adm-filter-bar,
.adm-section-toolbar,
.adm-pager,
.adm-dash-query-card {
  border-radius: 8px !important;
  box-shadow: none !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
}

.adm-kpi {
  padding: 14px 16px !important;
}

.adm-kpi:hover {
  transform: none !important;
  box-shadow: none !important;
}

.adm-kpi-value {
  font-size: 22px !important;
  font-weight: 700 !important;
}

.adm-kpi-row {
  gap: 12px !important;
}

.adm-dash-section {
  margin-bottom: 20px !important;
}

.adm-table th {
  padding: 9px 12px !important;
  background: #fafafa !important;
}

.adm-table td {
  padding: 10px 12px !important;
}

.adm-btn,
.adm-btn-primary,
.adm-btn-ghost,
.adm-btn-outline,
.adm-input,
.adm-textarea,
.adm-select,
.adm-select-styled {
  border-radius: 8px !important;
}

.adm-btn-primary {
  background: linear-gradient(135deg, #0f766e 0%, #0d9488 100%) !important;
  border-color: transparent !important;
  box-shadow: 0 4px 16px rgba(13, 148, 136, 0.22) !important;
  color: #fff !important;
}

.adm-btn-primary:hover {
  background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%) !important;
  border-color: transparent !important;
}

.adm-badge:not(.adm-nav-badge),
.adm-tag,
.adm-pending-chip {
  border-radius: 6px !important;
}

.adm-badge:not(.adm-nav-badge) {
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  color: #fff !important;
}

.adm-settings-form,
.adm-settings-grid {
  max-width: none !important;
  width: 100% !important;
}

.adm-settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.adm-modal-panel {
  border-radius: 10px !important;
}

.adm-segment {
  border-radius: 8px !important;
}

.adm-segment-btn {
  border-radius: 6px !important;
}

.adm-role-tag {
  color: #0d9488 !important;
}

.adm-user-link,
.adm-link,
a.adm-user-link {
  color: #0d9488 !important;
}

.adm-user-link:hover {
  color: #0f766e !important;
}

.adm-nav-item.active::before {
  background: #0d9488 !important;
}

@media (max-width: 960px) {
  .adm-content {
    padding: 14px 16px calc(96px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .adm-header {
    padding: 10px 14px !important;
  }
  .adm-settings-grid {
    grid-template-columns: 1fr !important;
  }
  .adm-settings-mail-test {
    flex-direction: column !important;
  }
  .adm-settings-mail-test .adm-btn {
    width: 100% !important;
    justify-content: center;
    min-height: 42px;
  }
}

@media (min-width: 901px) and (max-width: 960px) {
  .adm-content {
    padding: 14px 16px 32px !important;
  }
}

/* ── Layout polish (tabs / mobile / cards) ── */
.adm-card > .adm-table-box,
.adm-card-flush > .adm-table-box {
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.adm-card-item-row {
  flex-wrap: wrap;
}

.adm-card-item-tags {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.adm-popup-list-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.adm-popup-mobile {
  display: none;
  gap: 8px;
}

.adm-dialog-popup {
  max-width: min(980px, calc(100vw - 24px));
  width: 100%;
}
.adm-popup-form { gap: 14px; }
.adm-popup-form-head h3 { margin: 0 0 4px; }
.adm-popup-form-desc { margin: 0; font-size: 12px; line-height: 1.45; }
.adm-popup-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
  gap: 16px;
  align-items: start;
}
.adm-popup-form-editor {
  display: grid;
  gap: 12px;
  min-width: 0;
}
.adm-popup-form-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 10px;
}
.adm-popup-form-row-meta {
  grid-template-columns: 140px 1fr;
  align-items: end;
}
.adm-popup-body-input {
  min-height: 260px;
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.55;
}
.adm-popup-enabled-field {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 4px;
}
.adm-popup-preview {
  position: sticky;
  top: 0;
  min-width: 0;
}
.adm-popup-preview-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--adm-muted, #64748b);
  margin-bottom: 8px;
}
.adm-popup-preview-card {
  border: 1px solid var(--adm-border, rgba(15, 23, 42, 0.08));
  border-radius: 14px;
  background: var(--adm-surface, #fff);
  padding: 16px;
  max-height: min(62vh, 520px);
  overflow: auto;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}
.adm-popup-preview-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--adm-text, #0f172a);
}
.adm-popup-preview-tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  margin-bottom: 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #0f766e;
  background: rgba(13, 148, 136, 0.1);
}
.adm-popup-preview-body {
  font-size: 13px;
  line-height: 1.6;
  color: var(--adm-muted, #475569);
}
.adm-popup-preview-body p { margin: 0 0 10px; }
.adm-popup-preview-body ul { margin: 0 0 10px; padding-left: 18px; }
.adm-popup-preview-body li { margin-bottom: 6px; }
.adm-popup-preview-body strong { color: var(--adm-text, #0f172a); }

@media (max-width: 900px) {
  .adm-popup-desktop { display: none; }
  .adm-popup-mobile { display: grid; }
  .adm-popup-form-grid { grid-template-columns: 1fr; }
  .adm-popup-preview { position: static; }
  .adm-popup-preview-card { max-height: 240px; }
  .adm-popup-form-row,
  .adm-popup-form-row-meta { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  #tab-news .adm-news-layout:not(.is-editing) .adm-news-editor-panel {
    display: none;
  }
  #tab-news .adm-news-layout.is-editing .adm-news-list-panel {
    display: none;
  }
}

@media (max-width: 520px) {
  #tab-orders .adm-orders-form-grid {
    grid-template-columns: 1fr !important;
  }

  #tab-cards .adm-card-gen-form {
    grid-template-columns: 1fr !important;
  }

  .adm-toolbar-cards .adm-toolbar-actions {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
  }
}

.adm-audit-detail {
  display: inline-block;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  vertical-align: bottom;
}

.adm-audit-row-fail td {
  background: rgba(185, 28, 28, 0.06);
}

.adm-audit-status-fail {
  color: #b91c1c;
  font-weight: 700;
}

.adm-audit-status-ok {
  color: #0f766e;
  font-weight: 600;
}

/* ══════════════════════════════════════════════════════════
   Mobile scroll fix · 文档原生滚动，避免嵌套 overflow 拖不动
   ══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  html:has(body.adm),
  body.adm {
    height: auto !important;
    min-height: 100%;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  body.adm.adm-drawer-open,
  body.adm.adm-sidebar-open {
    overflow: hidden !important;
    overscroll-behavior: none;
  }

  .adm-layout {
    display: block;
    min-height: 100dvh;
    overflow: visible;
  }

  .adm-main {
    min-height: 100dvh;
    overflow: visible !important;
  }

  .adm-content {
    overflow: visible !important;
  }

  /* 表格只横向滑动，纵向交给页面 */
  .adm-table-box {
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
  }

  /* 用户抽屉：整板滚动，取消 body 内嵌套滚动 */
  .adm-drawer-panel,
  .adm-drawer-panel-user,
  .adm-drawer-panel-wide {
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    display: flex !important;
    flex-direction: column !important;
  }

  .adm-drawer-body,
  .adm-drawer-body-padded {
    overflow: visible !important;
    flex: 0 0 auto !important;
    min-height: 0;
    padding-bottom: 8px !important;
  }

  .adm-drawer-head,
  .adm-drawer-summary,
  .adm-drawer-tabs {
    flex-shrink: 0;
  }

  .adm-drawer-tabs {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #fff;
  }

  .adm-drawer-foot {
    position: sticky;
    bottom: 0;
    z-index: 3;
    margin-top: auto;
  }

  .adm-user-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    padding: 0 16px 14px !important;
  }

  .adm-user-stat-card {
    padding: 10px 12px !important;
  }

  .adm-user-stat-value {
    font-size: 14px !important;
  }

  .adm-user-edit-grid {
    grid-template-columns: 1fr !important;
  }

  .adm-user-hero,
  .adm-user-meta-extra {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  /* 设置 / 弹窗 / 审计 */
  #tab-settings .adm-settings-form-row,
  #tab-audit .adm-settings-form-row {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  #tab-settings .adm-form-actions {
    position: sticky;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    z-index: 4;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    padding: 10px 0 4px;
    margin-top: 8px;
  }

  #tab-settings .adm-form-actions .adm-btn {
    width: 100%;
    min-height: 44px;
  }

  #tab-popups .adm-settings-toolbar-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  #tab-popups .adm-settings-toolbar-head .adm-btn {
    width: 100%;
    min-height: 42px;
  }

  #tab-audit .adm-audit-desktop {
    display: none !important;
  }

  #tab-audit .adm-audit-mobile {
    display: flex !important;
    flex-direction: column;
    gap: 8px;
    padding: 4px 0 8px;
  }

  .adm-audit-card {
    border: 1px solid var(--adm-border);
    border-radius: 12px;
    background: #fff;
    padding: 12px 14px;
  }

  .adm-audit-card.is-fail {
    background: rgba(185, 28, 28, 0.04);
    border-color: rgba(185, 28, 28, 0.18);
  }

  .adm-audit-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
  }

  .adm-audit-card-action {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    word-break: break-word;
  }

  .adm-audit-card-meta {
    display: grid;
    gap: 4px;
    font-size: 12px;
    color: var(--adm-muted);
    line-height: 1.45;
  }

  .adm-audit-card-detail {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--adm-border);
    font-size: 11px;
    line-height: 1.45;
    word-break: break-word;
    white-space: pre-wrap;
    color: #475569;
  }

  .adm-dialog-popup {
    max-width: calc(100vw - 16px) !important;
    max-height: calc(100dvh - 24px);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .adm-popup-preview-card {
    max-height: none !important;
    overflow: visible !important;
  }

  .adm-popup-body-input {
    min-height: 180px !important;
  }
}

@media (min-width: 901px) {
  .adm-audit-mobile { display: none !important; }
}
