:root {
  --cash-green: #00c853;
  --cash-green-dark: #00a844;
  --cash-green-soft: #e8f8ee;
  --cash-bg: #0a0e17;
  --cash-sidebar: #0d121c;
  --cash-ink: #111827;
  --cash-muted: #6b7280;
  --cash-border: #e6e8ec;
  --cash-page: #f4f5f7;
  --cash-card-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body.admin-app {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
  overflow-x: hidden;
}

body.admin-app .content-wrapper .content {
  font-size: 14px;
  font-weight: 400;
}

body.admin-app .content-wrapper .content .card-title,
body.admin-app .content-wrapper .content h3,
body.admin-app .content-wrapper .content h5 {
  font-size: 14px;
  font-weight: 700;
}

body.admin-app .content-wrapper .content .form-group label {
  font-size: 14px;
  font-weight: 600;
}

body.admin-app .content-wrapper .content .form-control,
body.admin-app .content-wrapper .content .btn,
body.admin-app .content-wrapper .content .alert,
body.admin-app .content-wrapper .content p,
body.admin-app .content-wrapper .content code,
body.admin-app .content-wrapper .content pre.sweep-log {
  font-size: 14px;
  font-weight: 400;
}

body.admin-app .table th,
body.admin-app .table td,
body.admin-app .table code,
body.admin-app .table a {
  font-size: 12px;
  font-weight: 400;
}

/* 三类 ID 分色，避免全是 Bootstrap code 粉字 */
body.admin-app code.id-bolt11 {
  color: #0f766e;
  background: #ecfdf5;
  padding: 0.1em 0.35em;
  border-radius: 3px;
}
body.admin-app code.id-btcpay {
  color: #1d4ed8;
  background: #eff6ff;
  padding: 0.1em 0.35em;
  border-radius: 3px;
}
body.admin-app code.id-hash {
  color: #9a3412;
  background: #fff7ed;
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

body.admin-app .table {
  width: max-content;
  min-width: 100%;
  margin-bottom: 0;
}

body.admin-app .table th,
body.admin-app .table td {
  white-space: nowrap;
  vertical-align: middle;
}

body.admin-app .main-sidebar .nav-sidebar > .nav-item > .nav-link,
body.admin-app .main-sidebar .nav-sidebar > .nav-item > .nav-link p {
  font-size: 16px;
  font-weight: 700;
}

body.admin-app .main-sidebar .brand-text {
  color: #fff !important;
}

.login-page {
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background: #f5f5f7;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight: 600;
  position: relative;
  overflow: hidden;
}

.login-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.login-bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
}

.login-bg-blob--1 {
  width: 420px;
  height: 420px;
  background: #00d54b;
  top: -120px;
  right: -80px;
}

.login-bg-blob--2 {
  width: 320px;
  height: 320px;
  background: #86efac;
  bottom: -100px;
  left: -60px;
}

.login-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  min-width: 0;
}

.login-card {
  background: #fff;
  border-radius: 24px;
  padding: 32px 28px 28px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  position: relative;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.login-card-notch {
  width: 48px;
  height: 5px;
  background: #e5e7eb;
  border-radius: 999px;
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
}

.login-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #f0fdf4;
  color: #00b341;
  font-size: 13px;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 999px;
  margin: 0 auto 20px;
  width: fit-content;
}

.login-brand-box {
  text-align: center;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
}

.login-brand-box img {
  border-radius: 12px;
}

.login-brand-title {
  margin-top: 10px;
  font-size: 22px;
  font-weight: 900;
  color: #030712;
  letter-spacing: -0.02em;
}

.login-brand-sub {
  font-size: 14px;
  color: #9ca3af;
  font-weight: 700;
  margin-top: 2px;
}

.login-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 14px;
  border-radius: 14px;
  margin-bottom: 20px;
}

.login-alert svg {
  flex-shrink: 0;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  min-width: 0;
}

.login-field {
  width: 100%;
  min-width: 0;
}

.login-field label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9ca3af;
  margin-bottom: 8px;
}

.login-input-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
}

.login-input-wrap input {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 2px solid #e5e7eb;
  border-radius: 999px;
  padding: 14px 48px 14px 46px;
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.login-input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #00b341;
  pointer-events: none;
  z-index: 1;
}

.login-input-wrap input::placeholder {
  color: #d1d5db;
  font-weight: 600;
}

.login-input-wrap input:focus {
  border-color: #00d54b;
  box-shadow: 0 0 0 4px rgba(0, 213, 75, 0.12);
}

.login-toggle-pw {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.login-toggle-pw:hover {
  color: #00b341;
}

.login-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
  border: none;
  border-radius: 999px;
  padding: 16px;
  background: #00d54b;
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.02em;
  cursor: pointer;
  box-shadow: 0 0 24px rgba(0, 213, 75, 0.35);
  transition: background 0.15s, transform 0.1s, opacity 0.15s;
}

.login-submit:hover {
  background: #00c044;
}

.login-submit:active {
  transform: scale(0.98);
}

.login-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.login-footer {
  text-align: center;
  margin: 24px 0 0;
  font-size: 13px;
  color: #9ca3af;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.login-footer-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid #d1d5db;
  display: inline-block;
}

/* legacy aliases removed — login uses classes above */

.btn-cash {
  background: var(--cash-green);
  border: none;
  color: #fff;
  font-weight: 800;
  border-radius: 999px;
  padding: 12px 16px;
  width: 100%;
  box-shadow: 0 8px 18px rgba(0, 200, 83, 0.22);
}

.btn-cash:hover {
  background: #00c044;
  color: #fff;
}

.login-error {
  color: #dc2626;
  font-size: 0.875rem;
  margin-bottom: 12px;
  text-align: center;
  font-weight: 700;
}

.main-sidebar.sidebar-dark-primary {
  background: var(--cash-sidebar) !important;
}

.main-sidebar .brand-link {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.main-sidebar .brand-link .brand-image {
  border-radius: 12px !important;
  opacity: 1 !important;
}

.main-sidebar .brand-text {
  font-size: 16px;
  font-weight: 700 !important;
  color: #fff !important;
}

.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link {
  border-radius: 10px;
  margin: 2px 8px;
  color: rgba(255, 255, 255, 0.72) !important;
}

.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #fff !important;
}

.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link.active,
.sidebar-dark-primary .nav-sidebar .nav-link.active {
  background: var(--cash-green) !important;
  color: #fff !important;
  box-shadow: 0 6px 16px rgba(0, 200, 83, 0.28);
}

.navbar-white {
  border-bottom: 1px solid var(--cash-border);
  background: #fff !important;
}

.admin-account-dropdown {
  position: relative;
}

.admin-account-toggle {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
  max-width: none;
}

.admin-account-toggle .admin-user-full {
  display: inline;
  white-space: nowrap;
}

.admin-account-caret {
  font-size: 12px;
  opacity: 0.65;
  flex-shrink: 0;
}

.admin-account-menu {
  min-width: 180px;
  margin-top: 0;
  border: 1px solid var(--cash-border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.1);
  padding: 0.35rem 0;
}

.admin-account-menu .dropdown-item {
  font-weight: 600;
  font-size: 13px;
  padding: 0.55rem 1rem;
  color: var(--cash-ink);
}

.admin-account-menu .dropdown-item:hover,
.admin-account-menu .dropdown-item:focus {
  background: #f3f4f6;
  color: var(--cash-ink);
}

.admin-account-menu .dropdown-divider {
  margin: 0.3rem 0;
}

/* 桌面悬停展开；点击/触摸用 .show */
@media (hover: hover) and (pointer: fine) {
  .admin-account-dropdown:hover > .admin-account-menu,
  .admin-account-dropdown.show > .admin-account-menu {
    display: block;
  }
}

@media (hover: none), (pointer: coarse) {
  .admin-account-dropdown.show > .admin-account-menu {
    display: block;
  }
}

.main-header .nav-link {
  font-size: 14px;
  font-weight: 600;
  color: #374151 !important;
}

body.admin-app .content-wrapper {
  background: var(--cash-page);
}

body.admin-app .content-wrapper .card {
  border: 1px solid var(--cash-border);
  border-radius: 14px;
  box-shadow: var(--cash-card-shadow);
  background: #fff;
}

body.admin-app .content-wrapper .card .card-header {
  background: transparent;
  border-bottom: 1px solid var(--cash-border);
  padding: 0.9rem 1.1rem;
}

body.admin-app .content-wrapper .card > .card-body {
  padding: 1.1rem;
}

.stat-card {
  border: 1px solid var(--cash-border);
  border-radius: 14px;
  box-shadow: var(--cash-card-shadow);
  overflow: hidden;
  position: relative;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.stat-card:hover {
  box-shadow: 0 4px 14px rgba(16, 24, 40, 0.08);
}

.stat-card .card-body {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1.1rem 1.15rem !important;
}

.stat-card .stat-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  background: #f3f4f6;
  color: #4b5563;
}

.stat-card .stat-body {
  min-width: 0;
  flex: 1;
}

.stat-card .stat-value {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--cash-ink);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.stat-card .stat-label {
  color: var(--cash-muted);
  font-weight: 600;
  font-size: 12px;
  margin-top: 0.28rem;
  letter-spacing: 0.01em;
}

.stat-card.stat-paid {
  background: linear-gradient(180deg, #f3fcf6 0%, #fff 55%);
  border-color: #c8ecd4;
}

.stat-card.stat-paid .stat-icon {
  background: var(--cash-green-soft);
  color: var(--cash-green-dark);
}

.stat-card.stat-paid .stat-value {
  color: var(--cash-green-dark);
}

.stat-card.stat-today {
  background: linear-gradient(180deg, #f5f8ff 0%, #fff 55%);
  border-color: #dbe4ff;
}

.stat-card.stat-today .stat-icon {
  background: #eef2ff;
  color: #3b82f6;
}

.stat-card.stat-today .stat-value {
  color: #1d4ed8;
}

.stat-card.stat-sweep {
  background: linear-gradient(180deg, #f2fbf8 0%, #fff 55%);
  border-color: #cfece4;
}

.stat-card.stat-sweep .stat-icon {
  background: #e6f7f1;
  color: #0f766e;
}

.stat-card.stat-sweep .stat-value {
  color: #0f766e;
  font-size: 1.25rem;
}

.stat-card.stat-count .stat-icon {
  background: #f3f4f6;
  color: #374151;
}

.dashboard-meta {
  margin: 0;
}

.dashboard-meta li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.72rem 0.85rem;
  margin: 0 0 0.4rem;
  border-radius: 10px;
  background: #f8f9fb;
  border: 1px solid transparent;
  font-size: 13px;
}

.dashboard-meta li:last-child {
  margin-bottom: 0;
}

.dashboard-meta li span {
  color: var(--cash-muted);
  font-weight: 600;
}

.dashboard-meta li strong {
  font-weight: 800;
  color: var(--cash-ink);
  font-variant-numeric: tabular-nums;
}

.dashboard-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.dashboard-range .btn {
  font-weight: 600;
  border-color: var(--cash-border);
  color: var(--cash-muted);
  background: #fff;
}

.dashboard-range .btn:hover {
  color: var(--cash-ink);
  background: #f8f9fb;
  border-color: var(--cash-border);
}

.dashboard-range .btn.active {
  color: #fff;
  background: var(--cash-green);
  border-color: var(--cash-green);
  box-shadow: none;
}

.dashboard-range.is-loading {
  pointer-events: none;
  opacity: 0.72;
}

#dashboard-content.is-updating {
  transition: opacity 0.15s ease;
  opacity: 0.82;
}

.dashboard-chart-card .card-body {
  padding-bottom: 1rem;
}

.dashboard-chart-wrap {
  position: relative;
  height: 260px;
}

@media (max-width: 767.98px) {
  .dashboard-toolbar {
    justify-content: stretch;
  }

  .dashboard-range {
    width: 100%;
  }

  .dashboard-range .btn {
    flex: 1;
  }

  .dashboard-chart-wrap {
    height: 220px;
  }
}

.dash-status {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--cash-border);
  background: #f8faf9;
}

.dash-status.is-ok {
  background: var(--cash-green-soft);
  border-color: #b8e9c8;
}

.dash-status.is-warn {
  background: #fffbeb;
  border-color: #fde68a;
}

.dash-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 0.35rem;
  flex: 0 0 auto;
  background: #9ca3af;
  box-shadow: 0 0 0 4px rgba(156, 163, 175, 0.18);
}

.dash-status.is-ok .dash-status-dot {
  background: var(--cash-green);
  box-shadow: 0 0 0 4px rgba(0, 200, 83, 0.18);
}

.dash-status.is-warn .dash-status-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.18);
}

.dash-status-body {
  min-width: 0;
  flex: 1;
  color: #374151;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 600;
}

.dash-status-body a {
  color: var(--cash-green-dark);
  font-weight: 700;
}

.dash-hint {
  color: var(--cash-muted);
  font-size: 12px !important;
  margin: 0.85rem 0 0;
}

.dash-hint code {
  background: #f3f4f6;
  border: 1px solid var(--cash-border);
  border-radius: 6px;
  padding: 0.1rem 0.35rem;
  color: #374151;
  font-size: 12px;
}

.btn-dash {
  border-radius: 999px !important;
  font-weight: 700 !important;
  padding: 0.28rem 0.85rem !important;
  border-color: var(--cash-border) !important;
  color: #374151 !important;
  background: #fff !important;
}

.btn-dash:hover {
  background: #f9fafb !important;
  border-color: #d1d5db !important;
  color: var(--cash-ink) !important;
}

.table-invoices th,
.table-invoices td,
.table-invoices code,
.table-invoices a {
  text-align: center;
  vertical-align: middle;
}

.table-invoices th {
  color: #6b7280;
  border-top: none;
  background: #f9fafb;
  font-weight: 700;
  font-size: 11px !important;
  letter-spacing: 0.02em;
  text-transform: none;
}

.table-invoices tbody tr:hover {
  background: #f8faf9;
}

.badge-status {
  border-radius: 999px;
  font-weight: 700;
  font-size: 11px;
  padding: 0.35em 0.7em;
  border: 1px solid transparent;
  letter-spacing: 0.01em;
}

.badge-status-paid {
  background: var(--cash-green-soft);
  color: var(--cash-green-dark);
  border-color: #b8e9c8;
}

.badge-status-awaiting {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fed7aa;
}

.badge-status-expired {
  background: #f3f4f6;
  color: #6b7280;
  border-color: #e5e7eb;
}

.badge-status-error {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.table-actions {
  white-space: nowrap;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.table-actions .btn-icon {
  width: 20px;
  height: 20px;
  min-height: 0;
  padding: 0;
  margin: 0 0.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  line-height: 1;
  vertical-align: middle;
}

.table-actions .btn-icon i {
  font-size: 10px;
  line-height: 1;
}

.table-actions .btn-icon:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.store-test-steps {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.store-test-step {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  background: #fff;
}

.store-test-step.is-ok {
  border-color: #c3e6cb;
  background: #f4fff6;
}

.store-test-step.is-fail {
  border-color: #f5c6cb;
  background: #fff6f7;
}

.store-test-step.is-skip {
  border-color: #e2e3e5;
  background: #f8f9fa;
}

.store-test-step.is-running {
  border-color: #bee5eb;
  background: #f4fcfe;
}

.store-test-step__icon {
  width: 1.25rem;
  text-align: center;
  line-height: 1.4;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.store-test-step__title {
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.35;
}

.store-test-step__msg {
  margin-top: 0.15rem;
  font-size: 0.82rem;
  color: #6c757d;
  line-height: 1.4;
  word-break: break-word;
}

.store-test-step.is-fail .store-test-step__msg {
  color: #a71d2a;
}

.user-status-ban {
  white-space: nowrap;
  display: inline-block;
  max-width: none;
  font-weight: 400;
  line-height: 1.4;
  padding: 0.35em 0.6em;
}

.table-invoices th.user-aliases-cell,
.table-invoices td.user-aliases-cell {
  width: 9.5rem;
  max-width: 9.5rem;
  text-align: center;
  vertical-align: middle;
}

.user-aliases-ellipsis {
  display: inline-block;
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.admin-detail-table th,
.admin-detail-table td {
  vertical-align: middle;
}

.admin-detail-table th {
  width: 130px;
  color: #6b7280;
  background: #f9fafb;
  white-space: nowrap;
}

.admin-detail-table td {
  word-break: break-all;
}

.admin-detail-table code {
  white-space: normal;
  word-break: break-all;
}

.invoice-detail {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.invoice-bolt11 {
  border-top: 1px solid #e6e8ec;
  padding-top: 1rem;
}

.invoice-bolt11__head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
  position: relative;
}

.invoice-bolt11__title {
  font-size: 13px;
  font-weight: 800;
  color: #374151;
  letter-spacing: 0.04em;
}

.invoice-bolt11__head #copy-bolt11 {
  position: absolute;
  right: 0;
}

.invoice-bolt11 textarea {
  resize: vertical;
  min-height: 7rem;
}

.admin-table-scroll,
body.admin-app .table-responsive,
body.admin-app .card-body.p-0:has(> .table) {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.form-control:focus {
  border-color: var(--cash-green);
  box-shadow: 0 0 0 0.2rem rgba(0, 213, 75, 0.15);
}

.btn-cash.btn-sm {
  width: auto;
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
}

.modal-footer .btn-cash {
  width: auto;
  padding: 0.375rem 1rem;
  font-size: 0.875rem;
  font-weight: 700;
  box-shadow: none;
}

.btn-settings-save {
  width: auto;
  padding: 0.5rem 1.25rem;
  box-shadow: none;
}

pre.sweep-log {
  background: #0f1420;
  border: 1px solid #1f2937;
  border-radius: 10px;
  padding: 12px 14px;
  max-height: 360px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  color: #d1d5db;
  font-size: 12px !important;
  line-height: 1.55;
}


.content-header h1 {
  font-weight: 900;
}

.admin-app .content {
  padding-top: 0.75rem;
}

/* Fixed layout: sidebar/navbar stay put, main column scrolls */
body.admin-app.layout-fixed.layout-navbar-fixed {
  height: 100vh;
  overflow: hidden;
}

body.admin-app.layout-fixed.layout-navbar-fixed .content-wrapper {
  height: calc(100vh - (3.5rem + 1px));
  max-height: calc(100vh - (3.5rem + 1px));
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* List pages: toolbar fixed, only table body scrolls inside */
body.admin-app.admin-list-layout .content-wrapper > .content.admin-content-list {
  height: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

body.admin-app.admin-list-layout .content-wrapper > .content.admin-content-list > .container-fluid.admin-container-list {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 0.75rem;
}

body.admin-app.admin-list-layout .admin-list-page {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.admin-app.admin-list-layout .admin-list-page--with-stats > .row {
  flex: 0 0 auto;
}

body.admin-app.admin-list-layout .admin-list-page--with-stats > .admin-list-card {
  margin-top: 1rem;
}

body.admin-app.admin-list-layout .admin-list-card {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-bottom: 0;
}

.admin-list-toolbar {
  flex: 0 0 auto;
}

.admin-list-toolbar .card-title {
  float: none;
  margin-bottom: 0;
}

.admin-list-toolbar .form-inline.w-100 {
  width: 100%;
}

.admin-filter-form {
  width: 100%;
}

.admin-filter-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem 0.75rem;
}

.admin-filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-width: 0;
  flex: 1 1 8rem;
}

.admin-filter-field--grow {
  flex: 1.6 1 12rem;
  min-width: 11rem;
}

.admin-filter-field--range {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}

.admin-filter-field--amount {
  flex: 0 1 11rem;
  min-width: 9.5rem;
}

.admin-filter-field--actions {
  flex: 0 0 auto;
}

.admin-filter-field > label {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: #4b5563;
  line-height: 1.2;
  white-space: nowrap;
}

.admin-filter-field__spacer {
  visibility: hidden;
  user-select: none;
}

.admin-filter-field .form-control {
  width: 100%;
  min-width: 0;
}

.admin-filter-range {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.admin-filter-range .form-control {
  flex: 1 1 0;
  min-width: 0;
}

.admin-filter-range__sep {
  flex: 0 0 auto;
  color: #9ca3af;
  line-height: 1;
}

.admin-filter-datetime-row {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  max-width: 100%;
  vertical-align: top;
}

.admin-filter-datetime-row .admin-filter-range {
  flex: 0 0 auto;
  width: auto;
}

.admin-filter-datetime-row .admin-filter-range .form-control {
  width: auto;
  flex: 0 0 auto;
  min-width: 10.5rem;
  max-width: 13.5rem;
}

.admin-filter-date-presets {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  flex: 0 1 auto;
  min-width: 0;
}

.admin-filter-date-presets .btn {
  padding: 0.08rem 0.4rem;
  font-size: 12px;
  line-height: 1.35;
  border-radius: 0.25rem;
  white-space: nowrap;
}

.admin-filter-date-presets .btn.is-active {
  color: #fff;
  background-color: #00a844;
  border-color: #00a844;
}

.admin-filter-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: calc(1.8125rem + 2px);
}

.admin-filter-total {
  white-space: nowrap;
}

.admin-list-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-left: auto;
  flex-shrink: 0;
}

@media (max-width: 767.98px) {
  .admin-filter-field,
  .admin-filter-field--grow,
  .admin-filter-field--range,
  .admin-filter-field--amount {
    flex: 1 1 calc(50% - 0.4rem);
    min-width: calc(50% - 0.4rem);
  }

  .admin-filter-field--range {
    flex: 1 1 100%;
    min-width: 0;
  }

  .admin-filter-field--actions {
    flex: 1 1 100%;
  }

  .admin-filter-field--amount .admin-filter-range .form-control {
    max-width: none;
  }
}

@media (max-width: 575.98px) {
  .admin-list-toolbar .form-inline.w-100 .admin-list-toolbar-actions {
    width: 100%;
    margin-left: 0;
  }

  .admin-filter-field,
  .admin-filter-field--grow,
  .admin-filter-field--range,
  .admin-filter-field--amount,
  .admin-filter-field--actions {
    flex: 1 1 100%;
    min-width: 0;
  }

  .admin-filter-field__spacer {
    display: none;
  }
}

body.admin-app.admin-list-layout .admin-list-scroll {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

body.admin-app.admin-list-layout .admin-list-scroll .table {
  margin-bottom: 0;
  width: max-content;
  min-width: 100%;
}

body.admin-app.admin-list-layout .admin-list-scroll .table th,
body.admin-app.admin-list-layout .admin-list-scroll .table td {
  white-space: nowrap;
}

body.admin-app.admin-list-layout .admin-list-scroll .table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
  box-shadow: inset 0 -1px 0 #dee2e6;
}

/* Mobile: page scrolls vertically; table scrolls horizontally */
@media (max-width: 991.98px) {
  body.admin-app.admin-list-layout .content-wrapper > .content.admin-content-list,
  body.admin-app.admin-list-layout .content-wrapper > .content.admin-content-list > .container-fluid.admin-container-list,
  body.admin-app.admin-list-layout .admin-list-page {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  body.admin-app.admin-list-layout .admin-list-card {
    height: auto;
    max-height: none;
    overflow: hidden;
    margin-bottom: 0.75rem;
  }

  body.admin-app.admin-list-layout .admin-list-scroll {
    flex: none;
    overflow-x: auto;
    overflow-y: hidden;
  }

  body.admin-app.admin-list-layout .admin-list-scroll .table thead th {
    position: static;
    box-shadow: none;
  }
}

.admin-list-footer {
  flex: 0 0 auto;
}

.admin-list-search {
  min-width: 180px;
  max-width: 280px;
}

.admin-filter-datetime {
  width: auto;
  min-width: 11.5rem;
}

.admin-ms {
  position: relative;
  min-width: 8rem;
}

.admin-ms__toggle {
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 1.5rem;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.55rem center;
  background-size: 8px 10px;
  cursor: pointer;
}

.admin-ms__menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  min-width: 10rem;
  max-height: 14rem;
  overflow: auto;
  padding: 0.35rem 0;
  margin: 0;
  list-style: none;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
}

.admin-ms__item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0.28rem 0.65rem;
  font-size: 0.8125rem;
  font-weight: 400;
  color: #1f2937;
  cursor: pointer;
  white-space: nowrap;
}

.admin-ms__item--all {
  font-weight: 600;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 0.15rem;
  padding-bottom: 0.4rem;
}

.admin-ms__item:hover {
  background: #f3f4f6;
}

.admin-ms__item input {
  margin: 0;
  flex: 0 0 auto;
}

.invoice-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
}

.invoice-summary--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.invoice-summary--auto {
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
}

.invoice-summary--row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.invoice-summary--row .invoice-summary__item {
  flex: 1 1 8.5rem;
  min-width: 8.5rem;
  max-width: 100%;
  padding: 0.5rem 0.55rem;
}

.invoice-summary__item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e6e8ec;
}

.invoice-summary__label {
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
  word-break: normal;
  overflow-wrap: break-word;
}

.invoice-summary__value {
  color: #111827;
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  word-break: normal;
  overflow-wrap: break-word;
}

.invoice-summary__item.is-awaiting {
  background: #fff7ed;
  border-color: #fed7aa;
}

.invoice-summary__item.is-paid {
  background: #ecfdf3;
  border-color: #bbf7d0;
}

.invoice-summary__item.is-paid .invoice-summary__value {
  color: #00a844;
}

.invoice-summary__item.is-expired {
  background: #f3f4f6;
  border-color: #e5e7eb;
}

.invoice-summary__item.is-total {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.invoice-summary__item.is-api {
  background: #f0f9ff;
  border-color: #bae6fd;
}

.invoice-summary__item.is-scan {
  background: #eef2ff;
  border-color: #c7d2fe;
}

.invoice-summary__item.is-confirmed {
  background: #ecfdf3;
  border-color: #bbf7d0;
}

.invoice-summary__item.is-confirmed .invoice-summary__value {
  color: #00a844;
}

.invoice-summary__item.is-unconfirmed {
  background: #fffbeb;
  border-color: #fde68a;
}

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

  .invoice-summary--3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575.98px) {
  .invoice-summary {
    grid-template-columns: 1fr;
  }
}

/* ── Responsive ── */

@media (max-width: 991.98px) {
  .content-wrapper,
  .main-footer {
    margin-left: 0 !important;
  }

  .main-header .nav-link {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

@media (max-width: 767.98px) {
  .content-header {
    padding: 12px 0.5rem;
  }

  .content-header h1 {
    font-size: 1.35rem;
  }

  .content {
    padding: 0 0.5rem 1rem;
  }

  .stat-card {
    margin-bottom: 12px;
  }

  .stat-card .stat-value {
    font-size: 1.25rem;
  }

  .stat-card .card-body {
    padding: 0.95rem !important;
  }

  .stat-card .stat-icon {
    width: 36px;
    height: 36px;
    font-size: 13px;
  }

  .admin-user-full {
    display: none !important;
  }

  .admin-user-short {
    display: inline !important;
  }
}

@media (min-width: 768px) {
  .admin-user-short {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .login-page {
    padding: 20px 12px;
    align-items: flex-start;
    padding-top: max(20px, env(safe-area-inset-top));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }

  .login-bg-blob--1 {
    width: 280px;
    height: 280px;
    top: -80px;
    right: -60px;
  }

  .login-bg-blob--2 {
    width: 220px;
    height: 220px;
    bottom: -70px;
    left: -40px;
  }

  .login-card {
    padding: 26px 18px 22px;
    border-radius: 20px;
  }

  .login-brand-title {
    font-size: 20px;
  }

  .login-input-wrap input {
    padding: 13px 44px 13px 42px;
    font-size: 16px;
  }

  .login-submit {
    font-size: 16px;
    padding: 15px;
    min-height: 48px;
  }

  .login-footer {
    font-size: 12px;
    margin-top: 20px;
  }
}

@media (max-width: 360px) {
  .login-badge {
    font-size: 12px;
    padding: 5px 12px;
  }

  .login-brand-box {
    padding: 16px;
  }
}

/* —— 开放 API 页 —— */
.merchant-api-page .merchant-api-card {
  box-shadow: var(--cash-card-shadow);
  border: 1px solid var(--cash-border);
  border-radius: 8px;
  overflow: hidden;
}

.merchant-api-page .merchant-api-card > .card-header {
  background: #fff;
  border-bottom: 1px solid var(--cash-border);
  padding: 0.75rem 1rem;
}

.merchant-api-page .merchant-api-card > .card-body {
  padding: 1rem 1.1rem;
}

.merchant-api-page .merchant-api-card > .card-footer {
  background: #fafbfc;
  border-top: 1px solid var(--cash-border);
  font-size: 12px;
}

.merchant-api-page .merchant-api-empty {
  text-align: center;
  padding: 1.25rem 0.5rem 0.5rem;
}

.merchant-api-page .merchant-api-empty__icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 0.75rem;
  border-radius: 10px;
  background: var(--cash-green-soft);
  color: var(--cash-green-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.merchant-api-page .merchant-api-empty__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--cash-ink);
}

.merchant-api-page .merchant-api-empty__desc {
  font-size: 12px;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

.merchant-api-page .merchant-api-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  padding: 0.55rem 0.75rem;
  background: #f8faf9;
  border: 1px solid var(--cash-border);
  border-radius: 6px;
  font-size: 12px;
}

.merchant-api-page .merchant-api-form .form-group {
  margin-bottom: 0.85rem;
}

.merchant-api-page .merchant-api-form label {
  font-size: 12px !important;
  margin-bottom: 0.3rem;
  color: #374151;
}

.merchant-api-page .merchant-api-form .form-control-sm,
.merchant-api-page .merchant-api-form .form-text {
  font-size: 12px !important;
}

.merchant-api-page .merchant-api-toggle {
  border: none;
  cursor: pointer;
  line-height: 1.4;
}

.merchant-api-page .merchant-api-toggle:hover {
  filter: brightness(0.95);
}

.merchant-api-page .merchant-api-sort {
  display: inline-flex;
  align-items: center;
}

.merchant-api-page .merchant-api-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.merchant-api-page .merchant-api-actions .btn {
  font-size: 12px !important;
}

.merchant-api-page .badge-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 0.25em 0.55em;
}

.merchant-api-page .merchant-api-code {
  font-size: 11px !important;
  color: #0f766e;
  background: #ecfdf5;
  padding: 0.12em 0.4em;
  border-radius: 3px;
}

.merchant-api-page .table-actions .btn-icon {
  width: 22px;
  height: 22px;
  margin: 0 0.1rem;
}

.merchant-api-page .table-actions .btn-icon i {
  font-size: 12px;
}

/* 店铺列表：换U冷却倒计时 */
.store-cooldown-cell {
  min-width: 88px;
  white-space: nowrap;
}

.store-cooldown-text {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  line-height: 1.3;
}

.store-cooldown-cell.is-ready .store-cooldown-text {
  color: #059669;
}

.store-cooldown-bar {
  height: 4px;
  margin-top: 4px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.store-cooldown-bar > span {
  display: block;
  height: 100%;
  width: 0;
  background: #10b981;
  border-radius: 999px;
  transition: width 0.4s linear;
}

.store-cooldown-cell.is-ready .store-cooldown-bar > span {
  background: #9ca3af;
}
