:root {
  --bg: #080c14;
  --surface: #0d1320;
  --surface-2: #111827;
  --surface-3: #1a2235;
  --border: #1e2d42;
  --border-bright: #2a3f5f;

  --brand: #0ea5e9;
  --brand-dim: #0284c7;
  --brand-glow: rgba(14, 165, 233, 0.15);

  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.1);
  --warn: #f59e0b;
  --warn-bg: rgba(245, 158, 11, 0.1);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.1);
  --neutral: #64748b;
  --neutral-bg: rgba(100, 116, 139, 0.12);

  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --text-muted: #4a5568;

  --sidebar-width: 240px;
  --font-scale: 1;
}

body.light-theme {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #f0f4fa;
  --surface-3: #e6edf7;
  --border: #d6dfec;
  --border-bright: #b8c7dc;

  --brand: #0b78c3;
  --brand-dim: #095f9a;
  --brand-glow: rgba(11, 120, 195, 0.15);

  --success: #12805c;
  --success-bg: rgba(18, 128, 92, 0.12);
  --warn: #b26a00;
  --warn-bg: rgba(178, 106, 0, 0.12);
  --danger: #bf2d2d;
  --danger-bg: rgba(191, 45, 45, 0.12);
  --neutral: #5f6e82;
  --neutral-bg: rgba(95, 110, 130, 0.12);

  --text: #10243a;
  --text-dim: #3d5875;
  --text-muted: #60758f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  font-size: calc(14px * var(--font-scale));
  line-height: 1.5;
}

/* ─── Layout ─────────────────────────────────── */

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}

/* ─── Sidebar ─────────────────────────────────── */

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-header {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
}

.logo {
  font-size: calc(18px * var(--font-scale));
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand);
}

.logo-sub {
  font-size: calc(9px * var(--font-scale));
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 3px;
  font-family: 'IBM Plex Mono', monospace;
}

.nav-section {
  padding: 14px 10px;
  flex: 1;
}

.nav-section-label {
  font-size: calc(9px * var(--font-scale));
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 10px 4px;
  font-family: 'IBM Plex Mono', monospace;
}

.nav-btn {
  display: flex;
  align-items: center;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  text-align: left;
  padding: 9px 12px;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 500;
  font-size: calc(13px * var(--font-scale));
  font-family: inherit;
  transition: all 130ms ease;
  margin-bottom: 1px;
  border-left: 2px solid transparent;
}

.nav-btn:hover {
  background: var(--surface-2);
  color: var(--text);
  border-left-color: var(--border-bright);
}

.nav-btn.active {
  background: var(--brand-glow);
  color: var(--brand);
  border-left-color: var(--brand);
  font-weight: 600;
}

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--border);
}

/* ─── Main Content ────────────────────────────── */

.main {
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 5;
  gap: 12px;
}

.page-title {
  font-size: calc(13px * var(--font-scale));
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 5px 12px;
  font-size: calc(12px * var(--font-scale));
  color: var(--text-dim);
}

.user-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
  flex-shrink: 0;
}

.content {
  padding: 24px;
  flex: 1;
}

/* ─── Page Header ─────────────────────────────── */

.page-header {
  margin-bottom: 20px;
}

.page-header h1 {
  font-size: calc(20px * var(--font-scale));
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0;
}

.page-header p {
  color: var(--text-muted);
  font-size: calc(12px * var(--font-scale));
  margin: 4px 0 0 0;
}

/* ─── Cards ───────────────────────────────────── */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  animation: rise 220ms ease;
}

.stat-card {
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--brand), transparent 70%);
}

.stat-label {
  font-size: calc(9px * var(--font-scale));
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-family: 'IBM Plex Mono', monospace;
}

.stat-value {
  margin-top: 10px;
  font-size: calc(26px * var(--font-scale));
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

/* ─── Section panels ──────────────────────────── */

.section-title {
  font-size: calc(12px * var(--font-scale));
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 14px 0;
  font-family: 'IBM Plex Mono', monospace;
}

/* ─── Alert banner ────────────────────────────── */

.alert-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  background: rgba(245, 158, 11, 0.07);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 10px;
  font-size: calc(12px * var(--font-scale));
  color: var(--warn);
  margin-bottom: 16px;
}

.alert-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 6px var(--warn);
  flex-shrink: 0;
}

/* ─── Tables ──────────────────────────────────── */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

thead {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

th {
  padding: 10px 14px;
  text-align: left;
  font-size: calc(9px * var(--font-scale));
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
  font-family: 'IBM Plex Mono', monospace;
}

td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  font-size: calc(13px * var(--font-scale));
  color: var(--text);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--surface-2);
}

td .row {
  gap: 6px;
  flex-wrap: nowrap;
}

td button.ghost {
  padding: 4px 10px;
  font-size: calc(11px * var(--font-scale));
}

/* ─── Forms ───────────────────────────────────── */

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.row > .field {
  flex: 1 1 200px;
}

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

.field > label {
  font-size: calc(9px * var(--font-scale));
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-family: 'IBM Plex Mono', monospace;
}

input,
select,
textarea {
  font: inherit;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--text);
  font-size: calc(13px * var(--font-scale));
  transition: border-color 130ms, box-shadow 130ms;
  width: 100%;
}

input::placeholder {
  color: var(--text-muted);
}

select option {
  background: var(--surface-2);
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

/* ─── Buttons ─────────────────────────────────── */

button {
  border: 0;
  background: var(--brand);
  color: #fff;
  border-radius: 8px;
  padding: 9px 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: calc(13px * var(--font-scale));
  letter-spacing: 0.01em;
  font-family: inherit;
  transition: all 130ms ease;
  white-space: nowrap;
  min-height: 36px;
}

button:hover {
  background: var(--brand-dim);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

button.ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
}

button.ghost:hover,
a.ghost:hover {
  background: var(--surface-2);
  border-color: var(--border-bright);
  color: var(--text);
  transform: none;
}

a.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: calc(12px * var(--font-scale));
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  min-height: 34px;
}

/* ─── Badges ──────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 5px;
  padding: 2px 8px;
  font-size: calc(10px * var(--font-scale));
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: 'IBM Plex Mono', monospace;
}

.badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.badge.success {
  color: var(--success);
  background: var(--success-bg);
}

.badge.success::before {
  background: var(--success);
}

.badge.warn {
  color: var(--warn);
  background: var(--warn-bg);
}

.badge.warn::before {
  background: var(--warn);
}

.badge.danger {
  color: var(--danger);
  background: var(--danger-bg);
}

.badge.danger::before {
  background: var(--danger);
}

.badge.neutral {
  color: var(--neutral);
  background: var(--neutral-bg);
}

.badge.neutral::before {
  background: var(--neutral);
}

/* ─── Mono util ───────────────────────────────── */

.mono {
  font-family: 'IBM Plex Mono', monospace;
  font-size: calc(11px * var(--font-scale));
  color: var(--text-muted);
}

td .mono {
  font-size: calc(11px * var(--font-scale));
  line-height: 1.4;
}

/* ─── Headings reset ──────────────────────────── */

h1, h2, h3 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h3 {
  font-size: calc(14px * var(--font-scale));
  color: var(--text);
}

/* ─── Status grid ─────────────────────────────── */

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.status-tile {
  padding: 16px 18px;
}

.status-label {
  font-size: calc(9px * var(--font-scale));
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.status-tile h3 {
  margin-top: 10px;
  font-size: calc(15px * var(--font-scale));
  font-weight: 700;
}

/* ─── Member onboarding: table vs card ─────────── */

/* Desktop: show table, hide cards */
.member-card-list { display: none; }
.member-table-view { display: block; }

/* ─── Member card (mobile) ─────────────────────── */

.member-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 10px;
  animation: rise 220ms ease;
}

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

.member-card-name {
  font-weight: 600;
  font-size: calc(14px * var(--font-scale));
  color: var(--text);
}

.member-card-id {
  font-size: calc(10px * var(--font-scale));
  color: var(--text-muted);
  margin-top: 2px;
  word-break: break-all;
}

.member-card-role {
  font-size: calc(11px * var(--font-scale));
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 3px 7px;
  white-space: nowrap;
  flex-shrink: 0;
}

.member-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.member-card-field {
  display: flex;
  align-items: center;
  gap: 6px;
}

.member-card-label {
  font-size: calc(9px * var(--font-scale));
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.member-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

/* ─── Auth Page ───────────────────────────────── */

.auth-page {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-wrap {
  width: 100%;
  max-width: 420px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo .mark {
  font-size: calc(26px * var(--font-scale));
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--brand);
  text-transform: uppercase;
}

.auth-logo .tagline {
  font-size: calc(10px * var(--font-scale));
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 5px;
  font-family: 'IBM Plex Mono', monospace;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
}

.auth-tabs {
  display: flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 3px;
  margin-bottom: 22px;
  gap: 3px;
}

.auth-tab {
  flex: 1;
  padding: 8px 12px;
  border-radius: 7px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: calc(12px * var(--font-scale));
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 130ms;
  text-align: center;
}

.auth-tab.active {
  background: var(--surface-3);
  color: var(--text);
  border-color: var(--border-bright);
}

.auth-hint {
  margin-top: 16px;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: calc(11px * var(--font-scale));
  color: var(--text-muted);
  line-height: 1.6;
}

.auth-hint strong {
  color: var(--brand);
  font-family: 'IBM Plex Mono', monospace;
}

.auth-submit {
  margin-top: 16px;
  width: 100%;
  padding: 11px;
}

/* ─── Field hint ──────────────────────────────── */

.field-hint {
  font-size: calc(11px * var(--font-scale));
  color: var(--text-muted);
  margin-top: 2px;
}

/* ─── Login OTP step ──────────────────────────── */

.otp-prompt {
  text-align: center;
  padding: 16px 0 18px;
}

.otp-prompt-icon {
  font-size: calc(28px * var(--font-scale));
  margin-bottom: 8px;
}

.otp-prompt-label {
  font-size: calc(13px * var(--font-scale));
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}

.otp-prompt-email {
  margin-top: 4px;
  font-size: calc(11px * var(--font-scale));
  color: var(--brand);
}

/* ─── TOTP setup box ──────────────────────────── */

.totp-setup-box {
  margin-top: 8px;
  padding: 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.totp-setup-title {
  font-size: calc(13px * var(--font-scale));
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
}

.qr-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.qr-wrap canvas {
  border-radius: 8px;
  border: 4px solid var(--surface-3);
}

.totp-manual-label {
  font-size: calc(11px * var(--font-scale));
  color: var(--text-muted);
  margin-bottom: 6px;
}

.totp-secret {
  padding: 10px 12px;
  background: var(--surface-3);
  border-radius: 7px;
  word-break: break-all;
  letter-spacing: 0.08em;
  color: var(--brand);
  font-size: calc(12px * var(--font-scale));
  user-select: all;
}

/* ─── Animations ──────────────────────────────── */

@keyframes rise {
  from {
    transform: translateY(6px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ─── Desktop-only: hide mobile controls ─────── */

.mob-menu-btn  { display: none; }
.drawer-close  { display: none; }
.drawer-overlay { display: none; }

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ─── Responsive ──────────────────────────────── */

@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
  }

  /* ─ Drawer ─ */
  .sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    height: 100dvh;
    z-index: 200;
    border-right: 1px solid var(--border-bright);
    box-shadow: none;
    flex-direction: column;
    transition: left 0.24s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.24s ease;
    overflow-y: auto;
  }

  .mob-nav-open .sidebar {
    left: 0;
    box-shadow: 4px 0 40px rgba(0, 0, 0, 0.55);
  }

  /* ─ Overlay ─ */
  .drawer-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 199;
    pointer-events: none;
    transition: background 0.24s ease;
  }

  .mob-nav-open .drawer-overlay {
    background: rgba(0, 0, 0, 0.52);
    pointer-events: auto;
  }

  /* ─ Sidebar header: logo + close button ─ */
  .sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    border-right: 0;
  }

  /* ─ Close (×) button ─ */
  .drawer-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: transparent;
    color: var(--text-muted);
    font-size: calc(14px * var(--font-scale));
    font-family: inherit;
    cursor: pointer;
    transition: background 0.13s, color 0.13s, border-color 0.13s;
  }

  .drawer-close:hover {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--border-bright);
  }

  /* ─ Nav section keeps vertical layout ─ */
  .nav-section {
    flex-direction: column;
    padding: 10px;
    gap: 0;
    overflow-x: visible;
  }

  .nav-section-label {
    display: block;
  }

  .sidebar-footer {
    display: flex;
    padding: 12px 10px;
    border-top: 1px solid var(--border);
  }

  .nav-btn {
    width: 100%;
    flex: none;
    border-left: 2px solid transparent;
    border-bottom: none;
    font-size: calc(13px * var(--font-scale));
    padding: 9px 12px;
    border-radius: 7px;
    margin-bottom: 1px;
  }

  .nav-btn.active {
    border-left-color: var(--brand);
    border-bottom: none;
  }

  .nav-btn:hover {
    border-left-color: var(--border-bright);
    border-bottom: none;
  }

  /* ─ Topbar ─ */
  .topbar {
    padding: 10px 16px;
    flex-direction: row;
    align-items: center;
  }

  .topbar-right {
    gap: 8px;
  }

  /* Hide role pill in topbar — it's in the drawer footer */
  .topbar .user-pill {
    display: none;
  }

  /* ─ Hamburger ─ */
  .mob-menu-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 0;
    cursor: pointer;
    transition: background 0.13s, border-color 0.13s;
  }

  .mob-menu-btn:hover {
    background: var(--surface-2);
    border-color: var(--border-bright);
  }

  .ham-line {
    display: block;
    width: 16px;
    height: 2px;
    background: var(--text-dim);
    border-radius: 2px;
  }

  /* ─ Member onboarding: swap to card list ─ */
  .member-table-view { display: none; }
  .member-card-list  { display: block; }

  /* ─ Content & cards ─ */
  .content {
    padding: 16px;
  }

  .card {
    padding: 14px;
  }

  .page-header h1 {
    font-size: calc(18px * var(--font-scale));
  }

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .status-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .row {
    gap: 10px;
  }

  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  td .row {
    flex-direction: column;
    gap: 6px;
  }

  td button.ghost,
  td a.ghost {
    width: 100%;
    justify-content: center;
  }

  .member-card-actions button,
  .member-card-actions a {
    flex: 1 1 auto;
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 560px) {
  body {
    font-size: calc(13px * var(--font-scale));
  }

  .auth-page {
    padding: 14px;
    align-items: flex-start;
  }

  .auth-wrap {
    max-width: 100%;
  }

  .auth-card {
    padding: 18px;
    border-radius: 12px;
  }

  .auth-logo {
    margin-bottom: 18px;
  }

  .content {
    padding: 12px;
  }

  .topbar {
    padding: 10px 12px;
  }

  .page-title {
    font-size: calc(12px * var(--font-scale));
  }

  .card-grid,
  .status-grid {
    grid-template-columns: 1fr;
  }

  th,
  td {
    padding: 9px 10px;
  }

  .stat-value {
    font-size: calc(22px * var(--font-scale));
  }

  .upload-zone {
    padding: 20px 14px;
  }
}

/* ─── KYC Upload Zone ─────────────────────────── */

.upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 2px dashed var(--border-bright);
  border-radius: 10px;
  padding: 28px 20px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: center;
}

.upload-zone:hover {
  border-color: var(--brand);
  background: var(--brand-glow);
}

.upload-zone-icon {
  font-size: calc(28px * var(--font-scale));
  line-height: 1;
}

.upload-zone-label {
  font-size: calc(14px * var(--font-scale));
  font-weight: 600;
  color: var(--text);
}

.upload-zone-hint {
  font-size: calc(11px * var(--font-scale));
  color: var(--text-muted);
}

.kyc-status-note {
  margin: 0 0 14px 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: calc(13px * var(--font-scale));
  font-weight: 600;
  line-height: 1.4;
}

.kyc-status-note.review {
  color: var(--warn);
  background: rgba(246, 189, 96, 0.14);
  border-color: rgba(246, 189, 96, 0.4);
}

.kyc-status-note.failed {
  color: var(--danger);
  background: rgba(229, 79, 79, 0.12);
  border-color: rgba(229, 79, 79, 0.35);
}

.kyc-status-note.info {
  color: var(--text-dim);
  background: rgba(89, 177, 255, 0.08);
  border-color: rgba(89, 177, 255, 0.3);
}

/* status tile text colours */
.success-text { color: var(--success); }
.warn-text    { color: var(--warn); }
.danger-text  { color: var(--danger); }

/* ─── CSP-safe utility classes ────────────────── */

.hidden       { display: none; }
.fw-500       { font-weight: 500; }
.fw-600       { font-weight: 600; }
.text-dim     { color: var(--text-dim); }
.flex-none    { flex: 0; }
.flex-full    { flex: 1; }
.field-full   { flex-basis: 100%; }
.mt-12        { margin-top: 12px; }
.mt-14        { margin-top: 14px; }
.mt-16        { margin-top: 16px; }
.card-mb      { margin-bottom: 14px; }
.card-top-gap { margin-top: 20px; }
.td-empty     { color: var(--text-muted); text-align: center; }
.empty-list   { color: var(--text-muted); text-align: center; padding: 20px 0; margin: 0; }

/* Row variants */
.row-align-end  { align-items: flex-end; margin-bottom: 14px; }
.row-inline     { align-items: center; gap: 8px; }

/* Checkbox group */
.checkbox-group { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.checkbox-input { width: auto !important; }

/* Admin first-time setup banner */
.setup-banner     { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.warn-dot         { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 8px var(--warn); flex-shrink: 0; }
.setup-warn-label { font-size: calc(13px * var(--font-scale)); font-weight: 700; color: var(--warn); letter-spacing: 0.04em; text-transform: uppercase; }
.setup-hint-text  { color: var(--text-muted); font-size: calc(12px * var(--font-scale)); margin: 0 0 20px 0; }

/* Product/transaction form sub-section titles */
.section-title-sub    { margin-top: 8px; }
.section-title-sub-lg { margin-top: 12px; }

/* Inline checkbox field (e.g. dual-use) */
.field-inline { flex-direction: row; align-items: center; gap: 8px; }
.label-reset  { margin: 0; }

/* Matching engine stats bar */
.match-stats     { display: flex; gap: 16px; margin-bottom: 16px; }
.match-stat-card { flex: 1; padding: 12px 16px; background: var(--surface-2); }
.stat-value-sm   { font-size: calc(20px * var(--font-scale)); }

/* Settings page */
.twofa-header        { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.section-title-inline { margin: 0; }
.settings-hint       { color: var(--text-muted); font-size: calc(12px * var(--font-scale)); margin: 0 0 14px 0; }
.settings-desc       { color: var(--text-dim); font-size: calc(13px * var(--font-scale)); margin: 0 0 14px 0; }

/* Nav account label top spacing */
.nav-label-account { margin-top: 8px; }

/* Startup error */
.startup-error-title { color: var(--danger); margin-bottom: 8px; }

/* ─── Remittance ──────────────────────────────── */

.rmt-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 20px;
}

.rmt-tab {
  flex: 1;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  border-radius: 7px;
  padding: 8px 14px;
  font-size: calc(13px * var(--font-scale));
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 130ms;
  min-height: unset;
  text-align: center;
}

.rmt-tab:hover {
  background: var(--surface-2);
  color: var(--text);
  transform: none;
}

.rmt-tab.active {
  background: var(--brand-glow);
  color: var(--brand);
  border-color: var(--brand);
}

.rmt-declaration-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.rmt-status-select {
  width: auto;
  padding: 5px 8px;
  font-size: calc(12px * var(--font-scale));
}

/* ─── Checkbox option labels ──────────────────── */

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-size: calc(13px * var(--font-scale));
  font-family: inherit;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text);
}

/* ─── Font scale controls ─────────────────────── */

.font-scale-group {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
}

.font-scale-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  border-radius: 5px;
  padding: 3px 7px;
  cursor: pointer;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  min-height: unset;
  letter-spacing: 0;
  transition: background 130ms, color 130ms;
}

.font-scale-btn:hover {
  background: var(--surface-3);
  color: var(--text);
  transform: none;
}

.font-scale-btn.active {
  background: var(--brand-glow);
  color: var(--brand);
}

.font-scale-btn:nth-child(1) { font-size: 10px; }
.font-scale-btn:nth-child(2) { font-size: 12px; }
.font-scale-btn:nth-child(3) { font-size: 15px; }

/* ═══════════════════════════════════════════════════════════════════════
   EXECUTIVE DASHBOARD
   ═══════════════════════════════════════════════════════════════════════ */

.exec-kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.stat-sub {
  font-size: calc(10px * var(--font-scale));
  color: var(--text-muted);
  margin-top: 4px;
  font-family: 'IBM Plex Mono', monospace;
}

/* ── Section header cards ── */
.exec-section-header {
  margin-bottom: 12px;
}
.exec-section-title {
  font-size: calc(14px * var(--font-scale));
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.exec-section-desc {
  font-size: calc(12px * var(--font-scale));
  color: var(--text-dim);
  line-height: 1.6;
}

/* ── Entity grid ── */
.exec-entity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.exec-entity-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--entity-color, var(--brand));
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 160ms ease, transform 120ms ease;
}
.exec-entity-card:hover {
  transform: translateY(-2px);
  border-color: var(--entity-color, var(--brand));
}

.exec-entity-icon {
  width: 40px;
  height: 40px;
  color: var(--entity-color, var(--brand));
}
.exec-entity-icon svg {
  width: 100%;
  height: 100%;
}

.exec-entity-name {
  font-size: calc(13px * var(--font-scale));
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.exec-entity-desc {
  font-size: calc(11px * var(--font-scale));
  color: var(--text-dim);
  line-height: 1.55;
  flex: 1;
}

.exec-entity-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.exec-entity-stats span {
  font-size: calc(10px * var(--font-scale));
  font-family: 'IBM Plex Mono', monospace;
  color: var(--entity-color, var(--brand));
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
}

/* ── Flow diagram ── */
.exec-flow-card {
  margin-bottom: 16px;
}

.exec-flow {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
  justify-content: center;
  padding: 16px 0;
  row-gap: 16px;
}

.exec-flow-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 90px;
  flex-shrink: 0;
}
.exec-flow-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}
.exec-flow-icon svg { width: 100%; height: 100%; }

.exec-flow-node-export  .exec-flow-icon { color: #34d399; border-color: #34d39940; }
.exec-flow-node-transport .exec-flow-icon { color: #fb923c; border-color: #fb923c40; }
.exec-flow-node-inspector .exec-flow-icon { color: #facc15; border-color: #facc1540; }
.exec-flow-node-bank    .exec-flow-icon { color: #38bdf8; border-color: #38bdf840; }
.exec-flow-node-importer .exec-flow-icon { color: #a78bfa; border-color: #a78bfa40; }

.exec-flow-label {
  font-size: calc(11px * var(--font-scale));
  font-weight: 700;
  color: var(--text);
}
.exec-flow-sub {
  font-size: calc(9px * var(--font-scale));
  color: var(--text-muted);
  text-align: center;
}

.exec-flow-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 72px;
  flex-shrink: 0;
}
.exec-flow-arrow svg {
  width: 60px;
  height: 24px;
  color: var(--border-bright);
}
.exec-flow-arrow span {
  font-size: calc(9px * var(--font-scale));
  color: var(--text-muted);
  font-family: 'IBM Plex Mono', monospace;
  text-align: center;
  white-space: nowrap;
}

.exec-flow-support {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 8px;
}
.exec-flow-support-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.exec-flow-support-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  margin-top: 2px;
}
.exec-flow-support-icon svg { width: 100%; height: 100%; }
.exec-flow-support-item strong {
  font-size: calc(11px * var(--font-scale));
  color: var(--text);
  display: block;
  margin-bottom: 2px;
}
.exec-flow-support-item .text-dim {
  font-size: calc(10px * var(--font-scale));
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Infrastructure grid ── */
.exec-infra-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.exec-infra-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  gap: 14px;
}

.exec-infra-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  color: var(--brand);
  margin-top: 2px;
}
.exec-infra-icon svg { width: 100%; height: 100%; }

.exec-infra-body { flex: 1; }

.exec-infra-title {
  font-size: calc(12px * var(--font-scale));
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.exec-infra-list {
  margin: 0;
  padding-left: 14px;
  list-style: disc;
}
.exec-infra-list li {
  font-size: calc(11px * var(--font-scale));
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 3px;
}
.exec-infra-list li::marker {
  color: var(--brand);
}

/* ── Responsive ── */
@media (max-width: 680px) {
  .exec-entity-grid { grid-template-columns: 1fr 1fr; }
  .exec-infra-grid  { grid-template-columns: 1fr; }
  .exec-flow        { gap: 4px; }
  .exec-flow-arrow  { width: 40px; }
  .exec-flow-arrow svg { width: 40px; }
}

/* ── Getting Started (Settings) ─────────────────────────────────────── */
.gs-card { margin-top: 24px; }
.gs-guide {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 20px;
}
.gs-guide:last-child { margin-bottom: 0; }
.gs-guide-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.gs-guide-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.gs-guide-icon svg { width: 18px; height: 18px; }
.gs-guide-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.gs-guide-intro {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.55;
}
.gs-steps { padding: 4px 0; }
.gs-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.gs-step:last-child { border-bottom: none; }
.gs-step:hover { background: var(--surface-2); }
.gs-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  font-family: var(--mono-font, 'IBM Plex Mono', monospace);
}
.gs-step-body { flex: 1; }
.gs-step-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}
.gs-step-detail {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.55;
}
.gs-step-detail strong { color: var(--text); font-weight: 600; }
