:root {
  --bg: #f5f0eb;
  --surface: #fffcf9;
  --surface-soft: #f9f4ef;
  --line: #e8ddd3;
  --line-strong: #d4c4b4;
  --text: #2a1e14;
  --text-soft: #6b5242;
  --text-muted: #9e8372;
  --brand: #c4541a;
  --brand-soft: #fff1ea;
  --ok: #2da05e;
  --warn: #d48c0e;
  --danger: #c93a3a;
  --info: #2686b5;
  --sidebar-width: 232px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  font-family: 'IBM Plex Sans', sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
}

h1,
h2,
h3,
h4,
h5 {
  font-family: 'Manrope', sans-serif;
}

.app-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--surface-soft);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}

.brand-row {
  height: 66px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  background: var(--brand);
}

.brand-row h2 {
  font-size: 1rem;
  line-height: 1.1;
}

.brand-row p {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.menu {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.menu section {
  margin-bottom: 16px;
}

.menu h3 {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--text-muted);
  padding: 8px 14px;
}

.item {
  display: block;
  text-decoration: none;
  color: var(--text-soft);
  font-weight: 600;
  font-size: 0.94rem;
  padding: 9px 14px;
  margin: 1px 0;
  border-left: 3px solid transparent;
}

.item:hover {
  background: #f0e8e0;
  color: var(--text);
}

.item.active {
  color: var(--brand);
  background: #fdeede;
  border-left-color: var(--brand);
}

.menu-dropdown {
  margin: 1px 0;
}

.menu-dropdown summary {
  list-style: none;
  cursor: pointer;
  position: relative;
  padding-right: 26px;
}

.menu-dropdown summary::-webkit-details-marker {
  display: none;
}

.menu-dropdown summary::after {
  content: '+';
  position: absolute;
  right: 12px;
  top: 9px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-muted);
}

.menu-dropdown[open] summary::after {
  content: '-';
}

.submenu {
  margin: 2px 0 6px;
}

.subitem {
  display: block;
  text-decoration: none;
  color: #6a7a90;
  font-weight: 600;
  font-size: 0.86rem;
  padding: 7px 14px 7px 30px;
  border-left: 3px solid transparent;
}

.subitem:hover {
  background: #f0e8e0;
  color: var(--text);
}

.subitem.active {
  color: var(--brand);
  background: #fdeede;
  border-left-color: var(--brand);
}

.sidebar-footer {
  border-top: 1px solid var(--line);
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  background: #a0462a;
}

.sidebar-footer strong {
  display: block;
  font-size: 0.84rem;
}

.sidebar-footer small {
  color: var(--text-muted);
  font-size: 0.73rem;
}

.main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  height: 54px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar h1 {
  font-size: 1.1rem;
  font-weight: 700;
}

.menu-toggle {
  display: none;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-right input {
  width: 300px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  font: inherit;
  font-size: 0.86rem;
  color: var(--text);
  background: var(--surface-soft);
}

.topbar-right span {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.logout-link {
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
  color: #42566f;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  background: #fff;
}

.logout-link:hover {
  color: #27374a;
  border-color: var(--line-strong);
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: 12px 18px 18px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(160px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.kpi {
  background: var(--surface);
  border: 1px solid #eadfd5;
  border-left-width: 4px;
  border-radius: 0;
  padding: 8px 10px;
  min-height: 88px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.kpi-blue { border-left-color: var(--brand); }
.kpi-green { border-left-color: var(--ok); }
.kpi-cyan { border-left-color: var(--info); }
.kpi-orange { border-left-color: var(--warn); }
.kpi-teal { border-left-color: #17a2a4; }
.kpi-slate { border-left-color: #b08c78; }

.kpi p {
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.kpi h4 {
  font-size: 1.35rem;
  line-height: 1;
  margin-bottom: 3px;
}

.kpi-cyan h4,
.kpi-teal h4 {
  font-size: 1.08rem;
}

.kpi small {
  font-size: 0.72rem;
  color: var(--text-soft);
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
}

.panel {
  background: var(--surface);
  border-radius: 10px;
  min-height: 220px;
}

.span-5 { grid-column: span 5; }
.span-4 { grid-column: span 4; }
.span-2 { grid-column: span 2; }
.span-7  { grid-column: span 7; }
.span-8  { grid-column: span 8; }
.span-12 { grid-column: span 12; }

.panel header {
  min-height: 40px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.panel h5 {
  font-size: 0.98rem;
  font-weight: 700;
}

.panel strong {
  font-size: 0.8rem;
  color: var(--text-soft);
}

.mock-chart {
  height: 180px;
  margin: 12px;
  border-radius: 8px;
  background-color: #f9f1ea;
  background-image:
    linear-gradient(to bottom, rgba(160, 120, 80, 0.14) 1px, transparent 1px),
    linear-gradient(110deg, transparent 0 10%, rgba(196, 84, 26, 0.10) 35%, transparent 65%),
    linear-gradient(145deg, transparent 0 45%, rgba(196, 84, 26, 0.38) 47%, rgba(196, 84, 26, 0.60) 50%, rgba(196, 84, 26, 0.30) 58%, transparent 65%);
  background-size: 100% 24%, 100% 100%, 100% 100%;
  background-repeat: repeat-y, no-repeat, no-repeat;
}

.chart-b {
  background-image:
    linear-gradient(to bottom, rgba(160, 120, 80, 0.14) 1px, transparent 1px),
    linear-gradient(110deg, transparent 0 10%, rgba(45, 160, 94, 0.12) 35%, transparent 65%),
    linear-gradient(145deg, transparent 0 40%, rgba(45, 160, 94, 0.34) 44%, rgba(45, 160, 94, 0.62) 50%, rgba(45, 160, 94, 0.3) 58%, transparent 65%);
}

.bar-chart {
  height: 180px;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  align-items: end;
  gap: 5px;
}

.bar-chart span {
  background: linear-gradient(180deg, #f0a97c, #c4541a);
  border-radius: 3px 3px 0 0;
  min-height: 4px;
}

.donut-wrap {
  padding: 10px;
}

.donut {
  width: 108px;
  height: 108px;
  margin: 0 auto 10px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
}

.donut::after {
  content: '';
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
}

.donut span {
  position: relative;
  z-index: 1;
  font-size: 1rem;
  font-weight: 800;
}

.donut-delivery {
  /* legacy static donut — kept for reference, dynamic donuts use inline style */
  background: conic-gradient(var(--ok) 0 336deg, #ecf1f7 336deg);
}

.donut-payment {
  background: conic-gradient(#5f6de0 0 190deg, #1f9fd8 190deg 286deg, #2db965 286deg 350deg, #f3a433 350deg);
}

.donut-wrap ul {
  list-style: none;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

/* Alias used in the new dashboard */
.donut-list {
  list-style: none;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.donut-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.84rem;
  padding: 4px 0;
}

.donut-list b {
  font-weight: 600;
}

/* ── Dashboard SVG charts ────────────────────────────────────── */

.dash-chart-wrap {
  margin: 8px 10px 10px;
  padding: 8px 8px 2px;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(196, 84, 26, 0.07), rgba(196, 84, 26, 0) 60%),
    linear-gradient(0deg, #fffaf6, #fffaf6);
}

.dash-svg {
  display: block;
  width: 100%;
  height: 126px;
}

.dash-chart-labels {
  display: flex;
  justify-content: space-around;
  padding: 2px 2px 8px;
}

.dash-chart-labels span {
  font-size: 0.66rem;
  color: var(--text-muted);
  font-weight: 600;
  text-align: center;
  flex: 1;
}

.chart-empty-msg {
  padding: 24px 12px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.dash-content {
  padding-top: 10px;
}

.dash-content .kpi-grid {
  margin-bottom: 10px;
  gap: 8px;
}

.dash-content .kpi {
  padding: 9px 10px;
}

.dash-content .panel {
  min-height: 186px;
  border: 1px solid #f0e5db;
  box-shadow: 0 2px 10px rgba(86, 52, 24, 0.05);
}

.dash-content .panel header {
  min-height: 36px;
  padding: 8px 12px;
}

.dash-content .panel h5 {
  font-size: 0.9rem;
}

.dash-content .panel strong {
  font-size: 0.76rem;
}

.dash-panel-grid {
  gap: 10px;
}

/* ── KPI size overrides ──────────────────────────────────────── */

.kpi-h4-md { font-size: 1.3rem !important; }
.kpi-h4-sm { font-size: 1.05rem !important; }

/* ── Dashboard metrics list (KYC summary) ───────────────────── */

.dash-metrics {
  padding: 8px 12px;
}

.dash-metrics div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.86rem;
}

.dash-metrics div:last-child {
  border-bottom: 0;
}

.dash-metrics span {
  color: var(--text-soft);
}

.dash-metrics strong {
  font-weight: 800;
  font-size: 1.02rem;
}

.dash-metrics strong.ok     { color: var(--ok); }
.dash-metrics strong.warn   { color: var(--warn); }
.dash-metrics strong.danger { color: var(--danger); }

/* ── Panel header link ───────────────────────────────────────── */

.panel-link {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--brand);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.12s;
}

.panel-link:hover {
  background: var(--brand-soft);
}

/* ── Recent transactions table ───────────────────────────────── */

.dash-tx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.dash-tx-table thead th {
  text-align: left;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--text-muted);
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
}

.dash-tx-table tbody td {
  padding: 8px 12px;
  color: var(--text);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.dash-tx-table tbody tr:last-child td {
  border-bottom: none;
}

.dash-tx-table .mono {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.74rem;
  color: var(--text-soft);
}

.dash-tx-table .amount {
  font-weight: 700;
}

/* ── Status tags ─────────────────────────────────────────────── */

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: lowercase;
  letter-spacing: 0.02em;
}

.tag-ok      { background: #d4f0e2; color: #1c6e43; }
.tag-danger  { background: #fde8e8; color: #8b1c1c; }
.tag-warn    { background: #fef3d8; color: #7a5500; }
.tag-neutral { background: #eee7e0; color: var(--text-soft); }

.donut-wrap li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.84rem;
  padding: 4px 0;
}

.donut-wrap b {
  color: var(--text-soft);
  font-weight: 600;
}

.metrics {
  padding: 10px 14px;
}

.metrics div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}

.metrics div:last-child {
  border-bottom: 0;
}

.metrics span {
  color: var(--text-soft);
}

.metrics strong {
  font-weight: 700;
}

.metrics strong.ok {
  color: var(--ok);
}

.metrics strong.danger {
  color: var(--danger);
}

.users-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.users-page-head h2 {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.users-page-head p {
  font-size: 0.82rem;
  color: var(--text-soft);
}

.users-page-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.new-user-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-soft);
  background: var(--surface);
  border: 1px solid var(--line);
}

.new-user-btn:hover {
  background: #f0e8e0;
  color: var(--text);
}

.tx-summary-grid {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}

.tx-summary-grid .kpi {
  min-height: 62px;
  padding: 6px 8px;
}

.tx-summary-grid .kpi p {
  font-size: 0.56rem;
  margin-bottom: 2px;
}

.tx-summary-grid .kpi h4 {
  font-size: 1.02rem;
  margin-bottom: 1px;
}

.tx-summary-grid .kpi small {
  font-size: 0.66rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 700;
  color: #fff;
  background: var(--brand);
}

.btn-primary:hover {
  background: #a8431a;
}

.users-table-panel {
  min-height: auto;
}

.users-table-wrap {
  overflow-x: auto;
}

.users-alert {
  margin: 10px 14px 0;
  border: 1px solid #f0c9c9;
  background: #fff6f6;
  color: #b13737;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.82rem;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
}

.users-table th,
.users-table td {
  text-align: left;
  font-size: 0.84rem;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.users-table th {
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.users-table tbody tr:hover {
  background: #faf3ee;
}

.users-table tbody tr.row-link {
  cursor: pointer;
}

.users-table tbody tr.row-link:hover {
  background: #fdeede;
}

.wtx-kpis {
  margin-bottom: 10px;
}

.wtx-top-kpis {
  margin-bottom: 8px;
  gap: 8px;
}

.wtx-top-kpis .cd-kpi {
  min-height: 64px;
  padding: 9px 10px;
  gap: 4px;
}

.wtx-top-kpis .cd-kpi p {
  margin: 0;
  font-size: 0.58rem;
  letter-spacing: 0.08em;
}

.wtx-top-kpis .cd-kpi h4 {
  margin: 0;
  font-family: 'Manrope', sans-serif;
  font-size: 1rem;
  line-height: 1.1;
  color: var(--text);
}

.wtx-top-kpis .cd-kpi small {
  font-size: 0.62rem;
}

.wtx-filter-id {
  max-width: 120px;
  height: 38px;
  padding-left: 10px;
}

.wtx-user-cell {
  min-width: 160px;
}

.wtx-user-id {
  display: block;
  font-size: 0.76rem;
  color: var(--text-soft);
}

.wtx-user-name {
  display: block;
  font-weight: 700;
  color: var(--text);
  margin-top: 1px;
}

.wtx-user-email {
  display: block;
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 2px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.users-public-id {
  display: inline-flex;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  border: 1px solid rgba(196, 84, 26, 0.16);
}

.users-phone-pill {
  display: inline-flex;
  align-items: center;
  margin-top: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(196, 84, 26, 0.08);
  color: var(--brand);
  font-size: 0.74rem;
  font-weight: 700;
}

.users-phone-empty {
  display: inline-block;
  margin-top: 6px;
  color: var(--text-soft);
  font-size: 0.74rem;
}

.wtx-type-badge,
.wtx-ref-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 0.71rem;
  font-weight: 700;
  text-transform: lowercase;
  letter-spacing: 0.03em;
  background: #efe8e1;
  color: var(--text-soft);
}

.wtx-ref-cell {
  min-width: 130px;
}

.wtx-ref-id {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.wtx-desc {
  max-width: 360px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wtx-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
}

.wtx-action-muted {
  color: var(--text-muted);
  font-size: 0.76rem;
}

.wtx-refund-meta {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.users-pagination .page-btn-active {
  background: var(--brand);
  color: #fff;
}

.cards-public-link,
.cards-user-link {
  color: var(--brand);
  text-decoration: none;
  font-weight: 700;
}

.cards-public-link:hover,
.cards-user-link:hover {
  text-decoration: underline;
}

.cards-public-link:focus-visible,
.cards-user-link:focus-visible {
  outline: 2px solid rgba(196, 84, 26, 0.35);
  outline-offset: 2px;
  border-radius: 4px;
}

.tx-user-link {
  color: var(--brand);
  text-decoration: none;
  font-weight: 700;
}

.tx-user-link:hover {
  text-decoration: underline;
}

/* KYC list */
.kyc-open-link {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brand);
  border: 1.5px solid var(--brand);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.kyc-open-link:hover {
  background: var(--brand);
  color: #fff;
}

.users-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 18px 14px;
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  height: 24px;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: lowercase;
}

.tag.ok {
  color: #1f8f52;
  background: #e8f7ef;
}

.tag.warn {
  color: #9d6d1f;
  background: #fff4e3;
}

.tag.info {
  color: #1f7aa6;
  background: #e7f5fc;
}

.tag.danger {
  color: #b23a3a;
  background: #fdecec;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-soft);
  background: var(--bg-soft);
  border: 1px solid var(--line);
}

.btn-secondary:hover {
  background: #ece4dc;
}

.users-filter-bar {
  margin-bottom: 10px;
}

.users-filter-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-search-wrap {
  flex: 1;
  min-width: 220px;
  position: relative;
}

.filter-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.filter-search {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 36px;
  border: none;
  border-radius: 10px;
  background: var(--surface);
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--text);
  outline: none;
  box-shadow: inset 0 0 0 1.5px transparent;
  transition: box-shadow 0.15s;
}

.filter-search::placeholder {
  color: var(--text-muted);
}

.filter-search:focus {
  box-shadow: inset 0 0 0 1.5px var(--brand);
}

.filter-pills {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border-radius: 10px;
  padding: 4px;
}

.filter-pill {
  height: 30px;
  padding: 0 14px;
  border: none;
  border-radius: 7px;
  background: transparent;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-soft);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
}

.filter-pill:hover {
  background: #f0e8e0;
  color: var(--text);
}

.filter-pill.active {
  background: var(--brand);
  color: #fff;
}

.filter-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-take {
  height: 38px;
  padding: 0 10px;
  border: none;
  border-radius: 10px;
  background: var(--surface);
  font-family: inherit;
  font-size: 0.82rem;
  color: var(--text-soft);
  cursor: pointer;
  outline: none;
}

.filter-clear {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 8px;
  border-radius: 8px;
  transition: color 0.12s, background 0.12s;
  white-space: nowrap;
}

.filter-clear:hover {
  color: var(--danger);
  background: #fdeede;
}

.users-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 0 4px;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  border: none;
  background: var(--surface);
  font-size: 0.84rem;
  color: var(--text-soft);
  text-decoration: none;
  font-weight: 600;
}

.page-btn:not(.disabled):hover {
  background: #f0e8e0;
  color: var(--text);
}

.page-btn.disabled {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

.page-info {
  font-size: 0.84rem;
  color: var(--text-muted);
}

.page-info {
  font-size: 0.84rem;
  color: var(--text-muted);
}

/* ── User Details ─────────────────────────────────── */

.topbar-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 5px 8px;
  border-radius: 7px;
  transition: background 0.12s, color 0.12s;
}

.topbar-back:hover {
  background: #f0e8e0;
  color: var(--text);
}

.ud-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  margin: 0 auto 16px;
  padding: 12px 14px;
  background: #fcf8f5;
  border-radius: 10px;
}

.ud-header-info {
  flex: 1;
  min-width: 0;
}

.ud-avatar {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--brand);
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.ud-header-info h2 {
  font-size: 1.2rem;
  margin-bottom: 2px;
}

.ud-header-info p {
  font-size: 0.84rem;
  color: var(--text-soft);
  margin-bottom: 8px;
}

.ud-header-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-left: 0;
}

.ud-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

.ud-tabs {
  grid-column: 1 / -1;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.ud-tab-panel-hidden {
  display: none;
}

.ud-tabs-sticky {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--bg);
  padding: 4px 0;
  margin-bottom: 2px;
}

.ud-tab-btn {
  border: none;
  background: #f2e9e1;
  color: var(--text-soft);
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.ud-tab-btn.active {
  background: var(--brand);
  color: #fff;
}

.ud-tab-btn:focus-visible {
  outline: 2px solid rgba(196, 84, 26, 0.45);
  outline-offset: 1px;
}

.ud-section-hidden {
  display: none;
}

.ud-grid [data-ud-section] {
  animation: udPanelIn 0.14s ease;
}

@keyframes udPanelIn {
  from {
    opacity: 0;
    transform: translateY(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ud-panel {
  min-height: auto;
}

.ud-panel-wide {
  grid-column: 1 / -1;
}

.ud-dl {
  padding: 4px 0 8px;
}

.ud-dl > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--line);
}

.ud-dl > div:last-child {
  border-bottom: none;
}

.ud-dl dt {
  flex: 0 0 130px;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.ud-dl dd {
  flex: 1;
  font-size: 0.88rem;
  color: var(--text);
  word-break: break-all;
}

.ud-dl dd.mono {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-soft);
}

/* KYC two-column layout */
.ud-kyc-layout {
  display: flex;
  gap: 0;
  align-items: flex-start;
}

.ud-kyc-info {
  flex: 1;
  min-width: 0;
}

.ud-kyc-docs {
  flex: 0 0 auto;
  width: min(520px, 42%);
  border-left: 1px solid var(--line);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ud-docs-heading {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.ud-doc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.ud-doc-card {
  display: block;
  text-decoration: none;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  transition: box-shadow 0.15s, border-color 0.15s;
}

.ud-doc-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.ud-doc-thumb {
  width: 100%;
  height: 130px;
  overflow: hidden;
  position: relative;
  background: var(--bg);
}

.ud-doc-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s;
}

.ud-doc-card:hover .ud-doc-thumb img {
  transform: scale(1.03);
}

.ud-doc-thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(42,30,20,0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s;
}

.ud-doc-card:hover .ud-doc-thumb-overlay {
  background: rgba(42,30,20,0.22);
}

.ud-doc-thumb-overlay span {
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  opacity: 0;
  transition: opacity 0.18s;
  background: rgba(42,30,20,0.55);
  padding: 4px 12px;
  border-radius: 20px;
}

.ud-doc-card:hover .ud-doc-thumb-overlay span {
  opacity: 1;
}

.ud-doc-meta {
  padding: 8px 12px 10px;
  border-top: 1px solid var(--line);
}

.ud-doc-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.ud-doc-link {
  display: block;
  text-decoration: none;
  font-size: 0.75rem;
  color: var(--brand);
  font-weight: 500;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 6px 10px;
  background: var(--brand-soft);
  border-radius: 6px;
  border: 1px solid var(--line);
  transition: border-color 0.15s;
}

.ud-doc-link:hover {
  border-color: var(--brand);
}

.ud-table-wrap {
  overflow-x: auto;
}

.ud-table {
  width: 100%;
  border-collapse: collapse;
}

.ud-table th,
.ud-table td {
  text-align: left;
  font-size: 0.8rem;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.ud-table th {
  color: var(--text-muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.ud-table tbody tr:hover {
  background: #faf3ee;
}

.card-raw {
  white-space: pre-wrap;
  margin: 0;
  background: #fcf7f3;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  max-height: 360px;
  overflow: auto;
}

/* ── Card Details Enhancement ──────────────────────────────── */

.cd-hero {
  min-height: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  border: 0;
  border-radius: 6px;
  background: #fcf8f5;
  box-shadow: none;
}

.cd-hero-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.cd-hero .ud-header-info {
  min-width: 0;
}

.cd-hero .ud-header-info h2 {
  font-size: 1.26rem;
  margin-bottom: 4px;
}

.cd-hero .ud-header-info p {
  margin-bottom: 6px;
}

.cd-hero .ud-header-tags {
  margin-left: 0;
}

.cd-hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.cd-hero-link-btn {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 6px;
  background: #f3ece6;
  border: 0;
  color: var(--text);
}

.cd-kpi-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0 12px;
}

.cd-kpi {
  grid-column: span 2;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #fffdfa 0%, #fbf6f1 100%);
  border: 0;
  border-radius: 8px;
  min-height: 78px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  box-shadow: none;
}

.cd-kpi-featured {
  grid-column: span 4;
}

.cd-kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cd-kpi small {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 700;
}

.cd-kpi strong {
  font-family: 'Manrope', sans-serif;
  font-size: 1.08rem;
  color: var(--text);
  line-height: 1.05;
  margin: 0;
}

.cd-kpi-value-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.cd-kpi-featured strong {
  font-size: 1.8rem;
}

.cd-kpi-currency,
.cd-kpi-meta {
  color: var(--text-soft);
}

.cd-kpi-currency {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-bottom: 3px;
}

.cd-kpi-meta {
  font-size: 0.76rem;
  line-height: 1.25;
}

.cd-kpi-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(196, 84, 26, 0.1);
  color: var(--brand);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cd-kpi-chip-muted {
  background: rgba(102, 90, 78, 0.1);
  color: var(--text-soft);
}

.cd-kpi-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.32;
  flex: 0 0 auto;
}

.cd-kpi-balance { border-left: 2px solid var(--brand); }
.cd-kpi-status  { border-left: 2px solid var(--info); }
.cd-kpi-tx      { border-left: 2px solid var(--ok); }
.cd-kpi-update  { border-left: 2px solid var(--warn); }

.cd-grid {
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 14px;
}

.cd-panel {
  border: 0;
  border-radius: 6px;
  background: #fffdfb;
  box-shadow: none;
}

.cd-panel .ud-dl dt {
  flex-basis: 140px;
}

/* card detail — misc */
.cd-empty {
  color: var(--text-soft);
  font-size: 0.88rem;
  padding: 12px 0;
  margin: 0;
}

.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  margin-left: 4px;
  vertical-align: middle;
}

.cd-summary-grid {
  margin-bottom: 16px;
}

.cd-fee-note {
  margin-top: 12px;
  padding: 10px 14px;
  background: #fdf7f3;
  border-left: 3px solid var(--warn);
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--text-soft);
}

/* operation forms */
.cd-op-desc {
  font-size: 0.82rem;
  color: var(--text-soft);
  margin: 0 0 14px;
}

.cd-op-desc code {
  font-family: 'Fira Mono', 'Courier New', monospace;
  font-size: 0.79rem;
  background: #f3ece7;
  padding: 1px 5px;
  border-radius: 3px;
}

.cd-op-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cd-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cd-field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-soft);
}

.cd-field input[type=text],
.cd-field input[type=number] {
  padding: 8px 10px;
  border: 1px solid #ddd4cb;
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s;
  width: 100%;
  box-sizing: border-box;
}

.cd-field input:focus {
  outline: none;
  border-color: var(--brand);
}

.cd-op-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.cd-op-btn {
  padding: 9px 20px;
  border: none;
  border-radius: 7px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.cd-op-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.cd-op-btn-ok     { background: var(--ok-bg, #d4edda); color: #155724; }
.cd-op-btn-danger { background: #fde8e8; color: #842029; }
.cd-op-btn-warn   { background: #fff3cd; color: #664d03; }

.cd-op-result {
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: 4px;
}

.cd-op-result.cd-op-ok    { background: #d4edda; color: #155724; border-left: 3px solid #28a745; }
.cd-op-result.cd-op-error { background: #fde8e8; color: #842029; border-left: 3px solid #dc3545; }

/* operation trigger buttons in tab */
.cd-ops-triggers {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 4px;
  border-radius: 7px;
  background: #f3ece6;
}

.cd-op-trigger {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 5px;
  font-size: 0.87rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, background-color 0.15s;
  box-shadow: none;
}

.cd-op-trigger:hover { opacity: 0.85; }
.cd-op-trigger-ok     { background: #eaf4ea; color: #1b5e20; }
.cd-op-trigger-danger { background: #f9ebeb; color: #842029; }
.cd-op-trigger-warn   { background: #faf4e5; color: #5d4000; }

/* modal */
.cd-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30, 18, 10, 0.38);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.cd-modal-overlay[hidden] { display: none; }

.cd-modal {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #ede4dc;
  width: 100%;
  max-width: 440px;
  padding: 0;
  box-shadow: 0 8px 32px rgba(30, 18, 10, 0.12);
}

.cd-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid #ede4dc;
}

.cd-modal-header h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.cd-modal-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text-soft);
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
}

.cd-modal-close:hover { background: #f3ece7; }

.cd-modal-body {
  padding: 16px 20px 20px;
}

.cd-modal-body .cd-op-form { gap: 10px; }

.cd-op-btn-cancel {
  background: #f3f3f3;
  color: var(--text-soft);
  border: 1px solid #ddd;
}

/* cards-list status tabs */
.cards-status-tabs {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  border-bottom: 2px solid #ede4dc;
  padding-bottom: 0;
}

.cards-status-tab {
  padding: 7px 16px;
  border: none;
  background: none;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-soft);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  border-radius: 4px 4px 0 0;
  text-decoration: none;
  transition: color 0.15s;
  display: inline-block;
}

.cards-status-tab:hover { color: var(--text); }
.cards-status-tab.active { color: var(--brand); border-bottom-color: var(--brand); }

@media (max-width: 1360px) {
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }

  .span-5 {

    grid-column: span 6;
  }

  .span-2 {
    grid-column: span 12;
  }

  .span-4 {
    grid-column: span 6;
  }

  .span-7,
  .span-8 {
    grid-column: span 12;
  }
}

@media (max-width: 980px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 9;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .menu-toggle {
    display: inline-grid;
    place-items: center;
  }

  .topbar-right input {
    width: 220px;
  }

  .span-5,
  .span-7,
  .span-8,
  .span-4,
  .span-2 {
    grid-column: span 12;
  }

  .tx-summary-grid {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .users-page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .users-page-head-actions {
    width: 100%;
  }

  .new-user-btn {
    width: 100%;
  }

  .ud-header {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .ud-header-tags {
    margin-left: 0;
  }

  .cd-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .cd-hero-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .cd-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cd-kpi,
  .cd-kpi-featured {
    grid-column: span 1;
  }

  .cd-grid {
    grid-template-columns: 1fr;
  }

  .dash-svg {
    height: 112px;
  }

  .donut {
    width: 96px;
    height: 96px;
  }

  .donut::after {
    width: 64px;
    height: 64px;
  }
}

@media (max-width: 700px) {
  .topbar {
    height: auto;
    padding: 10px 12px;
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-right {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .tx-summary-grid {
    grid-template-columns: 1fr;
  }

  .topbar-right input {
    width: 100%;
  }

  .content {
    padding: 10px 12px 14px;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .users-page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .cd-kpi-grid {
    grid-template-columns: 1fr;
  }

  .cd-kpi,
  .cd-kpi-featured {
    grid-column: auto;
  }

  .cd-kpi-featured strong {
    font-size: 1.45rem;
  }

  .cd-grid {
    grid-template-columns: 1fr;
  }
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 15%, #eff4ff 0, transparent 38%),
    radial-gradient(circle at 85% 85%, #eaf8f3 0, transparent 36%),
    #f3f5f9;
}

.login-shell {
  width: min(980px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  overflow: hidden;
}

.login-brand {
  padding: 42px;
  background: linear-gradient(165deg, #f8fbff, #f2f7ff 55%, #edf4ff);
  border-right: 1px solid var(--line);
}

.brand-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: #e9f0ff;
  color: var(--brand);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.login-brand h1 {
  font-size: 2rem;
  margin-bottom: 12px;
}

.login-brand p {
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 18px;
}

.login-brand ul {
  list-style: none;
  display: grid;
  gap: 9px;
}

.login-brand li {
  font-size: 0.88rem;
  color: #34495f;
  padding-left: 18px;
  position: relative;
}

.login-brand li::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--brand);
  position: absolute;
  left: 0;
  top: 7px;
}

.login-card {
  padding: 42px 34px;
}

.login-card h2 {
  font-size: 1.4rem;
  margin-bottom: 6px;
}

.login-hint {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 20px;
}

.login-error {
  border: 1px solid #f0c9c9;
  background: #fff6f6;
  color: #b13737;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.84rem;
  margin-bottom: 16px;
}

.login-form {
  display: grid;
  gap: 11px;
}

.login-form label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #3e526a;
}

.login-form input {
  width: 100%;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 0 12px;
  font: inherit;
  color: var(--text);
  background: #fff;
}

.login-form input:focus {
  outline: none;
  border-color: #96add3;
}

.login-form button {
  margin-top: 8px;
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}

.login-form button:hover {
  background: #274eb0;
}

@media (max-width: 860px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-brand {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}
