@import url("admin-panel.css");
@import url("old-site-list.css");
@import url("admin-filter-toolbar.css");

/* SHBSC Platform Admin — new theme */
:root {
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --sidebar-w: 252px;
  --header-h: 60px;
  --radius: 10px;
  --radius-sm: 6px;
  --bg: #f0f2f8;
  --surface: #ffffff;
  --sidebar: #0f172a;
  --sidebar-hover: #1e293b;
  --sidebar-active: #4f46e5;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 16px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 8px 30px rgba(15, 23, 42, 0.12);
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 15px; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* —— Login —— */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 900px) {
  .login-page { grid-template-columns: 1fr; }
  .login-hero { display: none; }
}
.login-hero {
  background: linear-gradient(135deg, #312e81 0%, #4f46e5 50%, #7c3aed 100%);
  color: #fff;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-hero h1 { font-size: 2rem; font-weight: 700; margin: 0 0 12px; }
.login-hero p { opacity: 0.9; max-width: 360px; margin: 0; }
.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: var(--bg);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 40px 36px;
  box-shadow: var(--shadow-lg);
}
.login-card h2 { margin: 0 0 8px; font-size: 1.5rem; }
.login-card .sub { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 28px; }
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.98); }
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-hover); }
.btn--ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn--ghost:hover { background: #f8fafc; }
.btn--danger { background: var(--danger); color: #fff; }
.btn--sm { padding: 6px 12px; font-size: 0.8125rem; }
.btn--block { width: 100%; }
.form-error { color: var(--danger); font-size: 0.8125rem; min-height: 1.25em; margin-top: 8px; }

/* —— Shell —— */
.shell { display: flex; min-height: 100vh; }
.shell__sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar);
  color: #e2e8f0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
}
.shell__brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.shell__brand strong {
  display: block;
  font-size: 1.125rem;
  color: #fff;
  letter-spacing: -0.02em;
}
.shell__brand span { font-size: 0.75rem; color: #94a3b8; }
.shell__nav { flex: 1; padding: 12px 0 24px; }
.nav-section {
  padding: 16px 16px 6px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  margin: 2px 10px;
  color: #cbd5e1;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  transition: background 0.12s, color 0.12s;
}
.nav-link:hover { background: var(--sidebar-hover); color: #fff; }
.nav-link.is-active {
  background: var(--sidebar-active);
  color: #fff;
  font-weight: 600;
}
.nav-link .dot,
.nav-group__toggle .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
  flex-shrink: 0;
}

.nav-group { margin: 2px 10px; }
.nav-group__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: #cbd5e1;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
}
.nav-group__toggle:hover { background: var(--sidebar-hover); color: #fff; }
.nav-group__arrow {
  margin-left: auto;
  transition: transform 0.2s;
  opacity: 0.7;
}
.nav-group.is-open .nav-group__arrow { transform: rotate(90deg); }
.nav-group__children {
  display: none;
  padding: 4px 0 8px 8px;
}
.nav-group.is-open .nav-group__children { display: block; }
.nav-sublink {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 12px 7px 28px;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
  margin: 1px 0;
}
.nav-item__label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-group__toggle .nav-item__label {
  flex: 1;
}
.nav-pending-badge,
.nav-ticket-badge,
.nav-conv-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(239, 68, 68, 0.45);
}
.nav-group__toggle .nav-pending-badge,
.nav-group__toggle .nav-ticket-badge,
.nav-group__toggle .nav-conv-badge {
  margin-left: auto;
  margin-right: 6px;
}
.nav-sublink .nav-pending-badge,
.nav-sublink .nav-ticket-badge,
.nav-sublink .nav-conv-badge {
  margin-left: 8px;
}
.nav-link .nav-pending-badge,
.nav-link .nav-ticket-badge,
.nav-link .nav-conv-badge {
  margin-left: auto;
}
.nav-sublink:hover { background: var(--sidebar-hover); color: #fff; }
.nav-sublink.is-active {
  background: var(--sidebar-active);
  color: #fff;
  font-weight: 600;
}
.shell__main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.shell__header {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.shell__title { font-size: 1.125rem; font-weight: 600; margin: 0; flex-shrink: 0; }

.shell__header-right {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
  flex-shrink: 0;
}

/* —— 通知角标（充值/店铺审核/提现/工单） —— */
.notify-hub {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.notify-hub-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  background: var(--bg, #f1f5f9);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.notify-hub-badge:hover {
  color: var(--primary);
  border-color: rgba(230, 46, 4, 0.25);
  background: rgba(230, 46, 4, 0.06);
}
.notify-hub-badge__num {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #cbd5e1;
  color: #64748b;
  font-size: 0.6875rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.notify-hub-badge.has-count .notify-hub-badge__num {
  background: var(--danger, #dc2626);
  color: #fff;
}
.notify-hub-badge.has-count {
  color: var(--text);
  border-color: rgba(220, 38, 38, 0.25);
}

/* —— 通知小弹窗 —— */
.notify-hub-popups {
  position: fixed;
  top: calc(var(--header-h, 56px) + 10px);
  right: 16px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}
.notify-hub-popup {
  pointer-events: auto;
  position: relative;
  padding: 14px 40px 14px 16px;
  background: var(--surface, #fff);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius, 10px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  animation: notifyPopupIn 0.28s ease;
}
.notify-hub-popup--recharge { border-left-color: #2563eb; }
.notify-hub-popup--kyc { border-left-color: #d97706; }
.notify-hub-popup--product_audit { border-left-color: #059669; }
.notify-hub-popup--withdraw { border-left-color: #7c3aed; }
.notify-hub-popup--recycle { border-left-color: #dc2626; }
.notify-hub-popup.is-leaving {
  animation: notifyPopupOut 0.22s ease forwards;
}
.notify-hub-popup__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
}
.notify-hub-popup__close:hover { background: var(--bg, #f1f5f9); }
.notify-hub-popup__label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}
.notify-hub-popup__msg {
  margin: 0 0 10px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text);
}
.notify-hub-popup__go {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}
.notify-hub-popup__go:hover { text-decoration: underline; }
@keyframes notifyPopupIn {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes notifyPopupOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(12px); }
}
.shell__user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.875rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.shell__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
}
.shell__content { padding: 24px 28px 40px; flex: 1; }

.shell__loading {
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 0.9375rem;
}

.shell__loading--error {
  color: #dc2626;
}

.shell-boot-loading {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  background: #f8fafc;
}

/* —— Cards & stats —— */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.card__body { padding: 20px; }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.stat-card__label { font-size: 0.8125rem; color: var(--text-muted); font-weight: 500; }
.stat-card__value {
  font-size: 1.75rem;
  font-weight: 700;
  margin-top: 8px;
  color: var(--text);
  letter-spacing: -0.02em;
}
.stat-card--accent .stat-card__value { color: var(--primary); }
.stat-card--warn .stat-card__value { color: var(--warning); }

/* —— Toolbar & table —— */
.page-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}
.page-toolbar input,
.page-toolbar select {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  min-width: 160px;
}
.page-toolbar input:focus,
.page-toolbar select:focus {
  outline: none;
  border-color: var(--primary);
}
.table-wrap {
  overflow: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th {
  text-align: left;
  padding: 12px 16px;
  background: #f8fafc;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tbody tr:hover { background: #fafbff; }
.data-table tbody tr:last-child td { border-bottom: none; }
.table-empty {
  padding: 48px;
  text-align: center;
  color: var(--text-muted);
}
.table-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.pager button {
  padding: 6px 12px;
  margin-left: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.8125rem;
}
.pager button:disabled { opacity: 0.4; cursor: not-allowed; }
.pager button:not(:disabled):hover { border-color: var(--primary); color: var(--primary); }

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge--ok { background: #d1fae5; color: #065f46; }
.badge--warn { background: #fef3c7; color: #92400e; }
.badge--danger { background: #fee2e2; color: #991b1b; }
.badge--muted { background: #f1f5f9; color: #475569; }

.toast-host {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  background: var(--sidebar);
  color: #fff;
  font-size: 0.875rem;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.25s ease;
}
.toast--error { background: var(--danger); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}

.card .field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 768px) { .grid-2 { grid-template-columns: 1fr; } }
.quick-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.quick-links a {
  padding: 8px 14px;
  background: #f1f5f9;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 500;
}
.quick-links a:hover { background: #e0e7ff; color: var(--primary); }

/* Drawer */
.drawer-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.2s;
}
.drawer-mask.is-open { opacity: 1; }
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(520px, 100vw);
  height: 100vh;
  background: var(--surface);
  z-index: 201;
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
}
.drawer.is-open { transform: translateX(0); }
.drawer__head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.drawer__head h2 { margin: 0; font-size: 1.05rem; }
.drawer__body { padding: 20px; overflow: auto; flex: 1; }
.drawer__foot {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* Modal */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
}
.modal__head { padding: 16px 20px; border-bottom: 1px solid var(--border); font-weight: 600; }
.modal__body { padding: 20px; }
.modal__foot {
  padding: 12px 20px 16px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.detail-grid {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px 16px;
  font-size: 0.875rem;
}
.detail-grid dt { color: var(--text-muted); margin: 0; }
.detail-grid dd { margin: 0; word-break: break-all; }

.tabs { display: flex; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  padding: 8px 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.8125rem;
}
.tab.is-active { background: var(--primary); color: #fff; border-color: var(--primary); }

.settings-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
@media (max-width: 900px) {
  .settings-layout { grid-template-columns: 1fr; }
}
.settings-nav {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  position: sticky;
  top: 16px;
}
.settings-nav button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text);
}
.settings-nav button:hover { background: var(--bg); }
.settings-nav button.is-active {
  background: rgba(79, 70, 229, 0.1);
  color: var(--primary);
  font-weight: 600;
}
.settings-panel .card { max-width: 640px; }
.settings-panel textarea,
.settings-panel input,
.settings-panel select {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
}
.settings-panel textarea { min-height: 100px; resize: vertical; }
.settings-hint {
  color: var(--text-muted);
  font-size: 0.8125rem;
  margin: 0;
}

.settings-stack {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 960px) {
  .settings-stack { grid-template-columns: 1fr; }
}
.settings-section h3 {
  margin: 0 0 4px;
  font-size: 1.0625rem;
}
.settings-section__head {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.settings-section__fields .field input,
.settings-section__fields .field textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
}
.settings-section__fields .field textarea {
  min-height: 100px;
  resize: vertical;
}
.settings-section__foot {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.settings-stack__foot {
  grid-column: 1 / -1;
  padding: 8px 0 24px;
}

.img-upload {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.img-upload__preview {
  width: 120px;
  height: 120px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  overflow: hidden;
  flex-shrink: 0;
}
.img-upload__preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.img-upload__placeholder {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.img-upload__path {
  margin: 0 0 4px;
  font-size: 0.8125rem;
  word-break: break-all;
  font-family: ui-monospace, monospace;
}
.img-upload__hint {
  margin: 0 0 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.img-upload__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.settings-section {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.settings-section__fields {
  flex: 1;
}
