@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Archivo:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap");

:root {
  --ink: #09090d;
  --panel: #111116;
  --panel-2: #16161d;
  --panel-3: #1c1c25;
  --line: #252530;
  --line-soft: #1b1b24;
  --text: #eceae4;
  --muted: #8a8a96;
  --muted-2: #7a7882;
  --amber: #f2a93b;
  --amber-soft: #f7c878;
  --amber-dim: rgba(242,169,59,0.12);
  --mint: #5ee0bb;
  --mint-dim: rgba(94,224,187,0.1);
  --rose: #f0746a;
  --rose-dim: rgba(240,116,106,0.1);
  --blue: #6cb6ff;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 24px 60px -20px rgba(0,0,0,0.9);
  --sidebar-w: 230px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: "Archivo", system-ui, sans-serif;
  background: var(--ink);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Background atmosphere */
body::before {
  content: "";
  position: fixed; inset: 0;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 100% 60% at 60% 0%, #000 0%, transparent 70%);
  mask-image: radial-gradient(ellipse 100% 60% at 60% 0%, #000 0%, transparent 70%);
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: "";
  position: fixed; top: -200px; left: 60%;
  transform: translateX(-50%);
  width: 800px; height: 500px;
  background: radial-gradient(circle, rgba(242,169,59,0.1), transparent 60%);
  filter: blur(50px);
  pointer-events: none; z-index: 0;
}

/* ---- Layout ---- */
.layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--panel) 0%, #0e0e14 100%);
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  gap: 6px;
  overflow-y: auto;
}

.main-content {
  flex: 1;
  min-width: 0;
  padding: 28px 32px 64px;
  max-width: 860px;
}

/* ---- Brand ---- */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px 20px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 8px;
}
.brand .mark {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: linear-gradient(140deg, var(--amber), #c97f1d);
  display: grid; place-items: center;
  box-shadow: 0 4px 14px -4px rgba(242,169,59,0.6);
  flex-shrink: 0;
}
.brand .mark svg { width: 17px; height: 17px; }
.brand-text { flex: 1; min-width: 0; }
.brand-name {
  font-family: "Fraunces", serif;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.brand-sub {
  font-family: "JetBrains Mono", monospace;
  font-size: 9.5px;
  color: var(--muted-2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.env-badge {
  font-family: "JetBrains Mono", monospace;
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--amber-soft);
  border: 1px solid rgba(242,169,59,0.25);
  background: rgba(242,169,59,0.07);
  padding: 3px 6px;
  border-radius: 999px;
  flex-shrink: 0;
}

/* ---- Sidebar Nav ---- */
.nav-list { list-style: none; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.15s, background 0.15s;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; transition: color 0.15s; }
.nav-item:hover { color: var(--text); background: var(--panel-3); }
.nav-item.active { color: var(--amber); background: var(--amber-dim); }
.nav-item.active svg { color: var(--amber); }

.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}
.powered {
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  color: var(--muted-2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
}

/* ---- Page header ---- */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.page-title {
  font-family: "Fraunces", serif;
  font-weight: 500; font-size: 26px;
  letter-spacing: -0.02em;
}
.page-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ---- Cards ---- */
.card {
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card .pad { padding: 22px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 20px; }

.screen { animation: rise 0.4s cubic-bezier(0.2,0.8,0.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.18em;
  color: var(--muted-2); margin-bottom: 8px;
}
.title {
  font-family: "Fraunces", serif; font-weight: 500;
  font-size: 23px; letter-spacing: -0.015em; line-height: 1.15; margin-bottom: 5px;
}
.subtitle { color: var(--muted); font-size: 13px; line-height: 1.55; margin-bottom: 20px; }

/* ---- Stat cards ---- */
.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: "";
  position: absolute; top: 0; right: 0;
  width: 80px; height: 80px;
  background: radial-gradient(circle, var(--amber-dim), transparent 70%);
  pointer-events: none;
}
.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.stat-value { font-family: "Fraunces", serif; font-size: 32px; font-weight: 500; letter-spacing: -0.02em; line-height: 1; }
.stat-value .sym { color: var(--amber); }
.stat-value .cur { font-size: 14px; color: var(--muted); font-family: "JetBrains Mono", monospace; letter-spacing: 0; margin-left: 5px; }
.stat-sub { font-size: 11.5px; color: var(--muted); margin-top: 6px; font-family: "JetBrains Mono", monospace; }

/* ---- Customer list ---- */
.customers-grid { display: flex; flex-direction: column; gap: 10px; }
.customer-row {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  display: flex; align-items: center; gap: 14px;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
}
.customer-row:hover { border-color: rgba(242,169,59,0.4); background: var(--panel-2); }
.customer-avatar {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(140deg, var(--panel-3), #12121a);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  font-family: "Fraunces", serif; font-size: 16px; color: var(--amber-soft);
  flex-shrink: 0;
}
.customer-info { flex: 1; min-width: 0; }
.customer-name { font-size: 14px; font-weight: 600; }
.customer-email { font-size: 11.5px; color: var(--muted); font-family: "JetBrains Mono", monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.customer-meta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.status-badge {
  font-family: "JetBrains Mono", monospace; font-size: 9.5px;
  text-transform: uppercase; letter-spacing: 0.1em;
  padding: 3px 8px; border-radius: 999px;
}
.status-badge.active { color: var(--mint); border: 1px solid rgba(94,224,187,0.3); background: var(--mint-dim); }
.status-badge.pending { color: var(--amber-soft); border: 1px solid rgba(242,169,59,0.3); background: var(--amber-dim); }
.status-badge.inactive { color: var(--muted); border: 1px solid var(--line); background: var(--panel-3); }
.status-badge.failed { color: var(--rose); border: 1px solid rgba(240,116,106,0.3); background: var(--rose-dim); }

/* ---- Balance card (customer detail) ---- */
.balance-card { position: relative; }
.balance-card .pad { padding: 26px 22px 20px; }
.balance-card::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at 80% -10%, rgba(242,169,59,0.12), transparent 55%);
  pointer-events: none;
}
.acct-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.acct-row .who { display: flex; align-items: center; gap: 11px; }
.avatar {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(140deg, var(--panel-3), #12121a);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  font-family: "Fraunces", serif; font-size: 16px; color: var(--amber-soft);
}
.who .name { font-weight: 600; font-size: 14px; }
.who .sub { font-size: 11px; color: var(--muted); font-family: "JetBrains Mono", monospace; }
.chip {
  font-family: "JetBrains Mono", monospace; font-size: 9.5px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--mint); border: 1px solid rgba(94,224,187,0.3);
  background: var(--mint-dim); padding: 4px 8px; border-radius: 999px;
}
.balance-label {
  font-family: "JetBrains Mono", monospace; font-size: 10px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted-2); margin-bottom: 5px;
}
.balance {
  font-family: "Fraunces", serif; font-weight: 500;
  font-size: 48px; letter-spacing: -0.02em; line-height: 1;
  display: flex; align-items: baseline; gap: 7px;
}
.balance .cur { font-size: 15px; color: var(--muted); font-family: "JetBrains Mono", monospace; letter-spacing: 0; align-self: flex-start; margin-top: 5px; }
.balance .sym { color: var(--amber); }
.account-id {
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between;
}
.account-id .lbl { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.account-id .val { font-family: "JetBrains Mono", monospace; font-size: 11px; color: var(--muted); }

/* ---- Actions grid ---- */
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.actions.three { grid-template-columns: 1fr 1fr 1fr; }
.action {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; cursor: pointer;
  transition: border-color 0.18s, transform 0.1s, background 0.18s;
  text-align: left; color: var(--text);
}
.action:hover { border-color: rgba(242,169,59,0.4); background: var(--panel-2); }
.action:active { transform: scale(0.98); }
.action .ic {
  width: 32px; height: 32px; border-radius: 9px; margin-bottom: 10px;
  display: grid; place-items: center;
  background: var(--amber-dim); color: var(--amber);
}
.action.mint .ic { background: var(--mint-dim); color: var(--mint); }
.action.blue .ic { background: rgba(108,182,255,0.1); color: var(--blue); }
.action.rose .ic { background: var(--rose-dim); color: var(--rose); }
.action.purple .ic { background: rgba(167,139,250,0.1); color: #a78bfa; }
.action .ic svg { width: 16px; height: 16px; }
.action h3 { font-size: 13.5px; font-weight: 600; margin-bottom: 2px; color: var(--text); }
.action p { font-size: 11.5px; color: var(--muted); line-height: 1.4; }

/* ---- Platform / Admin ---- */
.platform-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.platform-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 18px 20px;
}
.platform-card-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); margin-bottom: 14px; font-weight: 600;
  display: flex; align-items: center; gap: 7px;
}
.platform-card-title svg { width: 13px; height: 13px; opacity: 0.7; }
.kv-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 12.5px; }
.kv-row:last-child { border-bottom: none; }
.kv-row .k { color: var(--muted); }
.kv-row .v { font-family: "JetBrains Mono", monospace; font-size: 11.5px; color: var(--text); }
.kv-row .v.ok { color: var(--mint); }
.kv-row .v.warn { color: var(--amber-soft); }
.kv-row .v.err { color: var(--rose); }
.acct-platform-card {
  background: linear-gradient(135deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 16px 18px; margin-bottom: 10px;
  display: flex; align-items: center; gap: 14px;
}
.acct-platform-bal { font-family: "Fraunces", serif; font-size: 24px; font-weight: 500; color: var(--amber); }
.acct-platform-sub { font-size: 10.5px; color: var(--muted); font-family: "JetBrains Mono", monospace; }
.inv-row {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 16px; display: flex; align-items: center; gap: 12px; margin-bottom: 8px;
}
.inv-row .inv-email { flex: 1; font-size: 13.5px; }
.inv-row .inv-sub { font-size: 11px; color: var(--muted); font-family: "JetBrains Mono", monospace; }
.uma-row {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 16px; display: flex; align-items: center; gap: 12px; margin-bottom: 8px;
}
.uma-address { font-family: "JetBrains Mono", monospace; font-size: 12.5px; color: var(--amber-soft); flex: 1; }

/* ---- KYC link ---- */
.kyc-link-box {
  background: var(--mint-dim); border: 1px solid rgba(94,224,187,0.3);
  border-radius: var(--radius-sm); padding: 12px 14px; margin-top: 10px;
  font-family: "JetBrains Mono", monospace; font-size: 11px;
  color: var(--mint); word-break: break-all;
  display: flex; align-items: flex-start; gap: 8px;
}

/* ---- Forms ---- */
.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); margin-bottom: 6px; font-weight: 600;
}
.field input, .field select, .field textarea {
  width: 100%; background: var(--ink); border: 1px solid var(--line);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: "Archivo", sans-serif; font-size: 14px; padding: 11px 13px;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(242,169,59,0.1);
}
.field input::placeholder { color: var(--muted-2); }
.field select option { background: var(--panel-2); }
.row { display: flex; gap: 12px; }
.row .field { flex: 1; }

/* ---- Buttons ---- */
.btn {
  width: 100%; border: none; border-radius: var(--radius-sm);
  font-family: "Archivo", sans-serif; font-weight: 600; font-size: 14px; padding: 13px;
  cursor: pointer; transition: transform 0.1s, filter 0.18s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:active { transform: scale(0.985); }
.btn-primary { background: var(--amber); color: #1a1206; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--panel-3); color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { background: #222228; }
.btn-danger { background: rgba(240,116,106,0.15); color: var(--rose); border: 1px solid rgba(240,116,106,0.3); }
.btn-danger:hover { background: rgba(240,116,106,0.22); }
.btn-sm { padding: 8px 14px; font-size: 12.5px; width: auto; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn.loading { color: transparent; position: relative; pointer-events: none; }
.btn.loading::after {
  content: ""; position: absolute; width: 16px; height: 16px;
  border: 2px solid rgba(0,0,0,0.25); border-top-color: #1a1206;
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
.btn-ghost.loading::after { border-color: rgba(255,255,255,0.15); border-top-color: var(--text); }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-row { display: flex; gap: 10px; margin-top: 4px; }
.btn-row .btn { width: auto; flex: 1; }
.btn-pair { display: flex; gap: 10px; }
.btn-pair .btn { flex: 1; }

/* ---- Destination type grid ---- */
.dest-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.dest-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 14px 16px; cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
  display: flex; align-items: center; gap: 12px;
}
.dest-card:hover { border-color: rgba(242,169,59,0.5); background: var(--panel-2); }
.dest-flag { font-size: 22px; flex-shrink: 0; }
.dest-info .dest-name { font-size: 13.5px; font-weight: 600; }
.dest-info .dest-rail { font-size: 11px; color: var(--muted); font-family: "JetBrains Mono", monospace; }

/* ---- Quote summary ---- */
.summary {
  background: var(--ink); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 2px 16px; margin: 16px 0;
}
.summary .line {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 0; border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}
.summary .line:last-child { border-bottom: none; }
.summary .line .k { color: var(--muted); }
.summary .line .v { font-family: "JetBrains Mono", monospace; font-weight: 500; }
.summary .line.total .k { color: var(--text); font-weight: 600; }
.summary .line.total .v { color: var(--amber); font-size: 15.5px; }

/* ---- OTP ---- */
.otp-wrap { text-align: center; margin: 10px 0; }
.otp-input {
  width: 100%; text-align: center;
  font-family: "JetBrains Mono", monospace; font-size: 26px; letter-spacing: 0.5em;
  background: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--text); padding: 16px 0 16px 0.5em;
}
.otp-input:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(242,169,59,0.1); }
.hint { font-size: 11.5px; color: var(--muted); margin-top: 10px; line-height: 1.5; }
.hint code { font-family: "JetBrains Mono", monospace; color: var(--amber-soft); background: var(--amber-dim); padding: 2px 5px; border-radius: 4px; }

/* ---- Step ticker ---- */
.steps { margin: 8px 0; }
.step { display: flex; align-items: center; gap: 12px; padding: 10px 0; font-size: 13px; color: var(--muted-2); transition: color 0.3s; }
.step .dot { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; border: 1.5px solid var(--line); display: grid; place-items: center; transition: all 0.3s; font-size: 10.5px; }
.step.active { color: var(--text); }
.step.active .dot { border-color: var(--amber); }
.step.done { color: var(--muted); }
.step.done .dot { border-color: var(--mint); background: var(--mint); color: #06231b; }
.step .spinner { width: 11px; height: 11px; border: 2px solid rgba(242,169,59,0.3); border-top-color: var(--amber); border-radius: 50%; animation: spin 0.7s linear infinite; }

/* ---- Rate cards ---- */
.rates-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.rate-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 16px 18px; transition: border-color 0.18s;
}
.rate-card:hover { border-color: rgba(242,169,59,0.3); }
.rate-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.rate-flag { font-size: 24px; }
.rate-currency { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.rate-currency-name { font-size: 11px; color: var(--muted); }
.rate-value { font-family: "JetBrains Mono", monospace; font-size: 22px; font-weight: 600; color: var(--amber); margin-bottom: 4px; }
.rate-details { display: flex; gap: 12px; font-size: 10.5px; color: var(--muted); font-family: "JetBrains Mono", monospace; }
.rate-rail { color: var(--mint); font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 8px; }

/* ---- Transaction list ---- */
.tx-filter { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-btn {
  padding: 6px 14px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  border: 1px solid var(--line); background: var(--panel); color: var(--muted); cursor: pointer;
  transition: all 0.15s; font-family: "Archivo", sans-serif;
}
.filter-btn:hover { color: var(--text); border-color: var(--muted); }
.filter-btn.active { background: var(--amber-dim); border-color: rgba(242,169,59,0.4); color: var(--amber); }

.tx-list { display: flex; flex-direction: column; gap: 8px; }
.tx-row {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px 16px; display: flex; align-items: center; gap: 14px;
  transition: background 0.15s;
}
.tx-row:hover { background: var(--panel-2); }
.tx-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.tx-icon.in { background: var(--mint-dim); color: var(--mint); }
.tx-icon.out { background: var(--amber-dim); color: var(--amber); }
.tx-icon svg { width: 16px; height: 16px; }
.tx-meta { flex: 1; min-width: 0; }
.tx-title { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-sub { font-size: 11px; color: var(--muted); font-family: "JetBrains Mono", monospace; }
.tx-right { text-align: right; flex-shrink: 0; }
.tx-amount { font-family: "JetBrains Mono", monospace; font-weight: 600; font-size: 13.5px; }
.tx-amount.in { color: var(--mint); }
.tx-status { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.tx-actions { display: flex; gap: 6px; }
.tx-actions .btn { padding: 5px 10px; font-size: 11.5px; }

/* ---- External accounts list ---- */
.ext-accounts { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.ext-account-row {
  background: var(--panel-3); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
}
.ext-account-flag { font-size: 20px; }
.ext-account-info { flex: 1; }
.ext-account-name { font-size: 13px; font-weight: 500; }
.ext-account-detail { font-size: 11px; color: var(--muted); font-family: "JetBrains Mono", monospace; }

/* ---- Back / sheet header ---- */
.sheet-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.back {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  background: var(--panel-3); border: 1px solid var(--line);
  display: grid; place-items: center; cursor: pointer; color: var(--text);
  transition: background 0.15s;
}
.back:hover { background: #222228; }
.back svg { width: 15px; height: 15px; }
.sheet-head .ttl { font-family: "Fraunces", serif; font-weight: 500; font-size: 20px; letter-spacing: -0.01em; }

/* ---- Success ---- */
.success { text-align: center; padding: 12px 4px 8px; }
.success .seal {
  width: 60px; height: 60px; border-radius: 50%; margin: 0 auto 16px;
  background: rgba(94,224,187,0.1); border: 1px solid rgba(94,224,187,0.4);
  display: grid; place-items: center; color: var(--mint);
  animation: pop 0.5s cubic-bezier(0.2,1.4,0.4,1) both;
}
@keyframes pop { from { transform: scale(0.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.success .seal svg { width: 28px; height: 28px; }
.success h2 { font-family: "Fraunces", serif; font-weight: 500; font-size: 21px; margin-bottom: 7px; }
.success p { color: var(--muted); font-size: 13px; line-height: 1.55; margin-bottom: 4px; }
.success .txid { font-family: "JetBrains Mono", monospace; font-size: 10px; color: var(--muted-2); margin: 14px 0 20px; word-break: break-all; }

/* ---- Toasts ---- */
.toasts { position: fixed; top: 16px; right: 20px; z-index: 50; display: flex; flex-direction: column; gap: 9px; pointer-events: none; }
.toast {
  background: var(--panel-2); border: 1px solid var(--line);
  border-left: 3px solid var(--mint); border-radius: 11px;
  padding: 12px 14px; box-shadow: var(--shadow); width: 280px;
  display: flex; align-items: center; gap: 10px;
  animation: slideIn 0.35s cubic-bezier(0.2,0.8,0.2,1) both;
}
.toast.amber { border-left-color: var(--amber); }
.toast.rose { border-left-color: var(--rose); }
.toast .ic { color: var(--mint); flex-shrink: 0; }
.toast.amber .ic { color: var(--amber); }
.toast.rose .ic { color: var(--rose); }
.toast .ic svg { width: 17px; height: 17px; display: block; }
.toast .body .t { font-size: 12.5px; font-weight: 600; }
.toast .body .s { font-size: 11px; color: var(--muted); margin-top: 1px; }
@keyframes slideIn { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: translateX(0); } }

/* ---- Banners + notes ---- */
.banner {
  background: var(--rose-dim); border: 1px solid rgba(240,116,106,0.3);
  color: var(--rose); border-radius: var(--radius-sm); padding: 11px 13px;
  font-size: 12.5px; line-height: 1.5; margin-bottom: 14px;
}
.note {
  background: var(--amber-dim); border: 1px solid rgba(242,169,59,0.22);
  color: var(--amber-soft); border-radius: var(--radius-sm); padding: 10px 13px;
  font-size: 11.5px; line-height: 1.5; margin-top: 14px;
  display: flex; gap: 8px; align-items: flex-start;
}
.note svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 1px; }
.note-mint {
  background: var(--mint-dim); border: 1px solid rgba(94,224,187,0.2);
  color: var(--mint); border-radius: var(--radius-sm); padding: 10px 13px;
  font-size: 11.5px; line-height: 1.55; margin-top: 14px;
  display: flex; gap: 8px; align-items: flex-start;
}
.note-mint svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 1px; }

/* ---- Misc ---- */
.spacer-sm { height: 8px; }
.spacer { height: 16px; }
.divider { height: 1px; background: var(--line-soft); margin: 16px 0; }
.section-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted-2); margin: 16px 0 10px; font-weight: 600; }
.empty { text-align: center; padding: 36px 20px; color: var(--muted-2); }
.empty svg { width: 28px; height: 28px; margin-bottom: 10px; opacity: 0.4; display: block; margin-left: auto; margin-right: auto; }
.empty p { font-size: 13px; }
.mono { font-family: "JetBrains Mono", monospace; }
.text-amber { color: var(--amber); }
.text-mint { color: var(--mint); }
.text-muted { color: var(--muted); }
.text-rose { color: var(--rose); }
.flex-between { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }

/* ---- Sandbox panels ---- */
.sandbox-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sandbox-panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 20px;
}
.sandbox-panel .panel-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.sandbox-panel .panel-sub { font-size: 12px; color: var(--muted); margin-bottom: 16px; }

/* ---- Mobile bottom nav ---- */
@media (max-width: 720px) {
  .layout { flex-direction: column; }
  .sidebar {
    position: fixed; bottom: 0; left: 0; right: 0; top: auto;
    width: 100%; height: auto;
    flex-direction: column; padding: 0;
    border-right: none; border-top: 1px solid var(--line);
    z-index: 40;
  }
  .brand { display: none; }
  .sidebar-footer { display: none; }
  .nav-list {
    flex-direction: row; overflow-x: auto;
    padding: 8px 12px 8px;
    gap: 0;
    -ms-overflow-style: none; scrollbar-width: none;
  }
  .nav-list::-webkit-scrollbar { display: none; }
  .nav-item { flex-direction: column; gap: 3px; padding: 7px 14px; font-size: 9.5px; min-width: 0; white-space: nowrap; border-radius: 8px; }
  .nav-item svg { width: 18px; height: 18px; }
  .main-content { padding: 20px 16px 100px; }
  .dest-grid { grid-template-columns: 1fr; }
  .sandbox-panels { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .rates-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .toasts { right: 10px; left: 10px; width: auto; }
  .toast { width: 100%; }
}
@media (max-width: 500px) {
  .actions { grid-template-columns: 1fr 1fr; }
  .actions.three { grid-template-columns: 1fr 1fr; }
  .row { flex-direction: column; gap: 0; }
}

/* ════════════════════════════════════
   THEME TOGGLE BUTTON
════════════════════════════════════ */
.sidebar-footer {
  display: flex; align-items: center; gap: 10px;
}
.theme-toggle {
  width: 32px; height: 32px; flex-shrink: 0;
  background: var(--panel-3); border: 1px solid var(--line);
  border-radius: 8px; cursor: pointer; color: var(--muted);
  display: grid; place-items: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.theme-toggle:hover { background: var(--line); color: var(--text); border-color: var(--muted); }
.theme-toggle svg { width: 15px; height: 15px; display: block; }
.icon-sun  { display: block; }   /* visible in dark mode — "click for light" */
.icon-moon { display: none; }

/* ════════════════════════════════════
   SMOOTH THEME TRANSITION
   Applied for one frame via JS when switching
════════════════════════════════════ */
.theme-transitioning,
.theme-transitioning *,
.theme-transitioning *::before,
.theme-transitioning *::after {
  transition:
    background-color 0.25s ease,
    background 0.25s ease,
    border-color 0.25s ease,
    color 0.2s ease,
    box-shadow 0.25s ease !important;
}

/* ════════════════════════════════════
   LIGHT MODE — variable overrides
════════════════════════════════════ */
html[data-theme="light"] {
  --ink:        #f4f2ed;
  --panel:      #ffffff;
  --panel-2:    #f0ede8;
  --panel-3:    #e8e5df;
  --line:       #d6d3cc;
  --line-soft:  #e4e1da;
  --text:       #16141b;
  --muted:      #6e6b76;
  --muted-2:    #9e9ba5;
  /* Brand amber — darkened for contrast on light backgrounds */
  --amber:      #b86800;
  --amber-soft: #925200;
  --amber-dim:  rgba(184,104,0,0.09);
  /* Mint — darkened for contrast on light backgrounds */
  --mint:       #0a9068;
  --mint-dim:   rgba(10,144,104,0.09);
  /* Rose — slightly deeper */
  --rose:       #c83232;
  --rose-dim:   rgba(200,50,50,0.08);
  /* Blue */
  --blue:       #1d5ecf;
  /* Softer shadow on light */
  --shadow:     0 4px 24px -6px rgba(0,0,0,0.1), 0 1px 6px rgba(0,0,0,0.06);
}

/* System preference fallback (no JS toggle yet) */
@media (prefers-color-scheme: light) {
  html:not([data-theme="dark"]):not([data-theme="light"]) {
    --ink:        #f4f2ed;
    --panel:      #ffffff;
    --panel-2:    #f0ede8;
    --panel-3:    #e8e5df;
    --line:       #d6d3cc;
    --line-soft:  #e4e1da;
    --text:       #16141b;
    --muted:      #6e6b76;
    --muted-2:    #9e9ba5;
    --amber:      #b86800;
    --amber-soft: #925200;
    --amber-dim:  rgba(184,104,0,0.09);
    --mint:       #0a9068;
    --mint-dim:   rgba(10,144,104,0.09);
    --rose:       #c83232;
    --rose-dim:   rgba(200,50,50,0.08);
    --blue:       #1d5ecf;
    --shadow:     0 4px 24px -6px rgba(0,0,0,0.1), 0 1px 6px rgba(0,0,0,0.06);
  }
}

/* ---- Light mode component overrides ---- */

/* Background atmosphere */
html[data-theme="light"] body::before {
  background-image:
    linear-gradient(rgba(0,0,0,0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.07) 1px, transparent 1px);
  opacity: 0.6;
}
html[data-theme="light"] body::after {
  background: radial-gradient(circle, rgba(184,104,0,0.07), transparent 60%);
}

/* Sidebar */
html[data-theme="light"] .sidebar {
  background: linear-gradient(180deg, #ffffff 0%, #f7f5f0 100%);
  border-right-color: var(--line);
}

/* Brand mark glow — softer on light */
html[data-theme="light"] .brand .mark {
  box-shadow: 0 4px 12px -4px rgba(184,104,0,0.45);
}

/* Env badge */
html[data-theme="light"] .env-badge {
  border-color: rgba(184,104,0,0.3);
  background: rgba(184,104,0,0.08);
}

/* Theme toggle — show moon in light mode (click to go dark) */
html[data-theme="light"] .icon-sun  { display: none; }
html[data-theme="light"] .icon-moon { display: block; }

/* Cards — add a crisper border on white */
html[data-theme="light"] .card {
  background: linear-gradient(180deg, #ffffff 0%, #faf9f6 100%);
  border-color: var(--line);
}

/* Buttons — primary text flips to white on the darker amber */
html[data-theme="light"] .btn-primary {
  color: #ffffff;
}
html[data-theme="light"] .btn.loading::after {
  border-color: rgba(255,255,255,0.3);
  border-top-color: #ffffff;
}

/* Customer rows */
html[data-theme="light"] .customer-row { background: #ffffff; }
html[data-theme="light"] .customer-row:hover { background: var(--panel-2); }

/* Balance card glow */
html[data-theme="light"] .balance-card::before {
  background: radial-gradient(circle at 80% -10%, rgba(184,104,0,0.08), transparent 55%);
}

/* Stat card glow */
html[data-theme="light"] .stat-card::before {
  background: radial-gradient(circle, rgba(184,104,0,0.07), transparent 70%);
}

/* Action cards */
html[data-theme="light"] .action {
  background: #ffffff;
}
html[data-theme="light"] .action:hover {
  background: var(--panel-2);
  border-color: rgba(184,104,0,0.45);
}

/* Rate cards */
html[data-theme="light"] .rate-card { background: #ffffff; }

/* Transaction rows */
html[data-theme="light"] .tx-row { background: #ffffff; }
html[data-theme="light"] .tx-row:hover { background: var(--panel-2); }

/* External account rows */
html[data-theme="light"] .ext-account-row { background: var(--panel-2); }

/* Sandbox panels */
html[data-theme="light"] .sandbox-panel { background: #ffffff; }

/* Destination cards */
html[data-theme="light"] .dest-card { background: #ffffff; }
html[data-theme="light"] .dest-card:hover {
  background: var(--panel-2);
  border-color: rgba(184,104,0,0.5);
}

/* Summary block */
html[data-theme="light"] .summary { background: var(--panel-2); }

/* Notes */
html[data-theme="light"] .note {
  background: rgba(184,104,0,0.07);
  border-color: rgba(184,104,0,0.2);
}
html[data-theme="light"] .note-mint {
  background: rgba(10,144,104,0.07);
  border-color: rgba(10,144,104,0.2);
}
html[data-theme="light"] .banner {
  background: rgba(200,50,50,0.07);
  border-color: rgba(200,50,50,0.25);
}

/* Toast */
html[data-theme="light"] .toast {
  background: #ffffff;
  border-color: var(--line);
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

/* Filter buttons */
html[data-theme="light"] .filter-btn {
  background: #ffffff;
}

/* OTP input */
html[data-theme="light"] .otp-input { background: #ffffff; }

/* Input fields */
html[data-theme="light"] .field input,
html[data-theme="light"] .field select,
html[data-theme="light"] .field textarea {
  background: #ffffff;
  border-color: var(--line);
  color: var(--text);
}

/* Success seal */
html[data-theme="light"] .success .seal {
  background: rgba(10,144,104,0.1);
  border-color: rgba(10,144,104,0.35);
}

/* Back button */
html[data-theme="light"] .back { background: var(--panel-3); }
html[data-theme="light"] .back:hover { background: var(--line); }

/* Avatar */
html[data-theme="light"] .avatar,
html[data-theme="light"] .customer-avatar {
  background: linear-gradient(140deg, var(--panel-3), var(--panel-2));
}

/* Step spinner — amber still works on light */
html[data-theme="light"] .step.done .dot {
  background: var(--mint);
  color: #ffffff;
}

/* Chip — self-custody badge */
html[data-theme="light"] .chip {
  border-color: rgba(10,144,104,0.35);
  background: rgba(10,144,104,0.08);
}

/* Status badges — ensure contrast on light */
html[data-theme="light"] .status-badge.active {
  color: #0a7a58;
  border-color: rgba(10,122,88,0.35);
  background: rgba(10,122,88,0.08);
}
html[data-theme="light"] .status-badge.pending {
  color: #925200;
  border-color: rgba(146,82,0,0.3);
  background: rgba(146,82,0,0.08);
}
html[data-theme="light"] .status-badge.inactive {
  color: var(--muted);
}
html[data-theme="light"] .status-badge.failed {
  color: #c83232;
  border-color: rgba(200,50,50,0.3);
  background: rgba(200,50,50,0.07);
}

/* Powered-by text */
html[data-theme="light"] .powered { color: var(--muted-2); }

/* Mobile bottom nav in light mode */
@media (max-width: 720px) {
  html[data-theme="light"] .sidebar {
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top-color: var(--line);
  }
}
