:root {
  --sidebar-width: 260px;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --ink: #0f172a;
  --muted: #64748b;
}

body.admin-body {
  background: #f1f5f9;
  color: var(--ink);
  min-height: 100vh;
}

.login-wrap {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(20, 184, 166, 0.18), transparent 32%),
    linear-gradient(180deg, #0f172a 0%, #134e4a 100%);
}

.login-card {
  border: 0;
  border-radius: 1.25rem;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
}

.admin-sidebar {
  width: var(--sidebar-width);
  background: #0f172a;
  min-height: 100vh;
}

.admin-sidebar .nav-link {
  color: rgba(255, 255, 255, 0.72);
  border-radius: 0.75rem;
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.35rem;
}

.admin-sidebar .nav-link.active,
.admin-sidebar .nav-link:hover {
  background: rgba(20, 184, 166, 0.16);
  color: #fff;
}

.admin-main {
  min-height: 100vh;
}

.stat-card {
  border: 0;
  border-radius: 1.1rem;
  overflow: hidden;
}

.stat-card .stat-value {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.table-card,
.chart-card {
  border: 0;
  border-radius: 1.1rem;
}

.json-view-pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: 0.75rem;
  max-height: 56vh;
  overflow: auto;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.btn-success.btn-sm[disabled],
.btn-secondary.btn-sm[disabled] {
  opacity: 1;
}

.table-card table th,
.table-card table td {
  white-space: nowrap;
  vertical-align: middle;
}

.table-card table td.cell-wrap {
  white-space: normal;
  max-width: 220px;
}

.table-card table td.cell-stack {
  white-space: nowrap;
  line-height: 1.35;
}

.cell-stack-line + .cell-stack-line {
  margin-top: 0.2rem;
}

.cell-stack-label {
  display: inline-block;
  min-width: 2em;
  color: var(--muted);
  font-size: 0.75rem;
}

.trace-pre,
.trace-log {
  background: #0f172a;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: 0.75rem;
  max-height: 62vh;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.trace-log .log-line {
  white-space: pre-wrap;
}

.trace-log .log-section {
  color: #5eead4;
  margin: 0.85rem 0 0.35rem;
}

.trace-log .log-hop {
  border-left: 3px solid #14b8a6;
  padding: 0.15rem 0 0.35rem 0.9rem;
  margin: 1rem 0;
}

.trace-log .log-json,
.trace-log .log-plain {
  display: block;
  background: #020617;
  border-radius: 0.5rem;
  padding: 0.75rem;
  margin: 0.35rem 0 0.6rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.trace-log .log-json {
  color: #a5f3fc;
}

.trace-log .log-plain {
  color: #e2e8f0;
}

.busy-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
}

.busy-overlay.d-none {
  display: none;
}

.wizard-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.wizard-step {
  text-align: center;
  padding: 0.65rem 0.5rem;
  border-bottom: 3px solid #e2e8f0;
  color: var(--muted);
  font-size: 0.9rem;
}

.wizard-step.active {
  border-bottom-color: var(--brand);
  color: var(--brand);
  font-weight: 600;
}

.wizard-step.done {
  border-bottom-color: #14b8a6;
  color: #0f766e;
}

.wizard-step.skip {
  opacity: 0.45;
  text-decoration: line-through;
}

.wizard-trace-log {
  max-height: 36vh;
}

.swal2-container {
  z-index: 2100;
}

.admin-swal {
  font-family: inherit;
  border-radius: 0.9rem !important;
}

.admin-swal .swal2-title {
  color: #0f172a;
}

.admin-swal .swal2-html-container {
  color: #64748b;
}

.topbar {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
}

@media (min-width: 992px) {
  .admin-content {
    margin-left: var(--sidebar-width);
  }
}

.bank-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 0.5rem;
  background: #fff;
  border: 1px solid #e2e8f0;
}

.bank-logo-lg {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 0.75rem;
  background: #fff;
  border: 1px solid #e2e8f0;
}

.remark-html {
  max-height: 50vh;
  overflow: auto;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1rem;
}

.config-split {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 1rem;
  align-items: stretch;
}

.config-group-list {
  max-height: calc(100vh - 260px);
  overflow: auto;
}

.config-group-item {
  border: 1px solid #e2e8f0;
  border-radius: 0.8rem;
  padding: 0.75rem 0.85rem;
  margin-bottom: 0.55rem;
  background: #fff;
  cursor: pointer;
}

.config-group-item:hover {
  border-color: #99f6e4;
}

.config-group-item.active {
  border-color: var(--brand);
  background: rgba(15, 118, 110, 0.08);
}

.config-group-item .group-actions {
  opacity: 0.72;
}

.color-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
  border: 1px solid rgba(15, 23, 42, 0.12);
  vertical-align: middle;
}

.cell-val {
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 991.98px) {
  .admin-sidebar {
    min-height: auto;
  }

  .config-split {
    grid-template-columns: 1fr;
  }

  .config-group-list {
    max-height: 280px;
  }
}
