/* Shared design tokens + components for the Arc Deposit Token dashboard pages.
   The original dashboard (index.html) keeps its inline styles; the nav menu styles
   here are also mirrored there so the "A" page switcher looks identical everywhere. */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f1f4;
  --border: #e2e4ea;
  --border-light: #edeef2;
  --text: #1a1d2b;
  --text-secondary: #4a4f63;
  --text-muted: #8b90a5;
  --accent: #2d5bff;
  --accent-hover: #1a44e6;
  --accent-bg: rgba(45, 91, 255, 0.06);
  --green: #0d8a5e;
  --green-bg: rgba(13, 138, 94, 0.07);
  --orange: #b8860b;
  --orange-bg: rgba(184, 134, 11, 0.07);
  --red: #c0392b;
  --red-bg: rgba(192, 57, 43, 0.07);
  --blue: #2168c8;
  --blue-bg: rgba(33, 104, 200, 0.07);
  --radius: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
  --shadow: 0 2px 8px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.mono { font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace; }

/* ─── Top bar ─────────────────────────────────────────────────────────────── */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-brand { display: flex; align-items: center; gap: 12px; }
.topbar h1 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: var(--text);
}
.topbar h1 span { color: var(--accent); }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.topbar-status {
  font-size: 12px;
  color: var(--text-muted);
  margin-right: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.status-dot {
  width: 7px; height: 7px;
  background: var(--green);
  border-radius: 50%;
  display: inline-block;
}

/* ─── Page-switcher menu (click the "A" logo) ─────────────────────────────── */
.nav-menu { position: relative; }
.topbar-logo {
  width: 28px; height: 28px;
  background: var(--accent);
  border: none;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  box-shadow: 0 0 0 0 rgba(45,91,255,0.0);
}
.topbar-logo:hover { background: var(--accent-hover); box-shadow: 0 0 0 3px rgba(45,91,255,0.15); }
.nav-dropdown {
  display: none;
  position: absolute;
  top: 38px;
  left: 0;
  min-width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);
  padding: 6px;
  z-index: 100;
}
.nav-menu.open .nav-dropdown { display: block; }
.nav-dropdown-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  font-weight: 600;
  padding: 8px 10px 4px;
}
.nav-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 7px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.12s;
}
.nav-item:hover { background: var(--surface-2); }
.nav-item.active { background: var(--accent-bg); }
.nav-item .nav-icon {
  width: 28px; height: 28px;
  flex: none;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  background: var(--surface-2);
}
.nav-item.active .nav-icon { background: var(--accent); color: #fff; }
.nav-item .nav-text { display: flex; flex-direction: column; }
.nav-item .nav-title { font-size: 13px; font-weight: 600; line-height: 1.3; }
.nav-item .nav-desc { font-size: 11px; color: var(--text-muted); line-height: 1.3; }

/* ─── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  padding: 7px 16px;
  border-radius: 6px;
  border: none;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1.4;
}
.btn-primary { background: var(--accent); color: white; box-shadow: 0 1px 2px rgba(45, 91, 255, 0.2); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline { background: var(--surface); color: var(--text-secondary); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--surface-2); border-color: #ccd0da; }

/* ─── Page container ──────────────────────────────────────────────────────── */
.page {
  max-width: 1160px;
  margin: 0 auto;
  padding: 32px;
}
.page-header { margin-bottom: 24px; }
.page-title { font-size: 22px; font-weight: 700; letter-spacing: -0.4px; }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ─── Cards / stats ───────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.stat-card { padding: 18px 20px; }
.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 500;
}
.stat-value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}
.stat-value.green { color: var(--green); }
.stat-value.blue { color: var(--blue); }
.stat-unit { font-size: 13px; font-weight: 500; color: var(--text-muted); margin-left: 4px; }

/* ─── Table ───────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data thead th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data tbody td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
  vertical-align: middle;
}
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text);
}
.cell-name { font-weight: 600; color: var(--text); }
.pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  background: var(--accent-bg);
  color: var(--accent);
  border: 1px solid rgba(45, 91, 255, 0.12);
  white-space: nowrap;
}
.pill.chain { background: var(--green-bg); color: var(--green); border-color: rgba(13,138,94,0.12); }
.pill.chain.sepolia { background: var(--blue-bg); color: var(--blue); border-color: rgba(33,104,200,0.12); }
.addr { font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace; font-size: 12px; color: var(--text-muted); }

.empty-state { text-align: center; padding: 48px 0; color: var(--text-muted); }
.empty-state .icon { font-size: 32px; margin-bottom: 10px; opacity: 0.3; }
.empty-state p { font-size: 13px; }

/* Modals + forms + small buttons (shared; previously duplicated inline per page) */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(26, 29, 43, 0.3); backdrop-filter: blur(4px);
  z-index: 100; align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 28px 32px; width: 460px; max-width: calc(100vw - 32px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);
  /* A tall modal (e.g. the interest-policy form) must never overflow the viewport with no way to reach the
     submit button — cap its height and let it scroll internally instead of forcing the user to zoom out. */
  max-height: calc(100vh - 32px); overflow-y: auto;
}
.modal h2 { font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.modal .modal-sub, .modal-sub { font-size: 12px; color: var(--text-muted); margin-bottom: 20px; }
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 12px; font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.4px; color: var(--text-muted); margin-bottom: 6px;
}
.form-group input {
  width: 100%; padding: 9px 12px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 14px; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-group input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(45, 91, 255, 0.1); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
.modal-status { font-size: 13px; color: var(--text-secondary); min-height: 18px; margin: 4px 0; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
/* REL-8 processing affordance — shared so every page that shows a spinner on a value-moving action
   renders it (admin/wallets/fiat-testing referenced .btn-spinner without defining it → blank span). */
.btn-spinner { display:inline-block; width:12px; height:12px; margin-right:7px; vertical-align:-2px; border:2px solid currentColor; border-right-color:transparent; border-radius:50%; animation:btnspin .6s linear infinite; }
@keyframes btnspin { to { transform: rotate(360deg); } }
/* Role-aware UI (operator-auth-rbac §2.6): admin-only controls render visibly DISABLED with an
   "admin only" tag for operations users — never hidden-but-broken, never clickable-but-dead. */
.role-locked { opacity: 0.45; cursor: not-allowed; }
.role-tag { display:inline-block; font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.5px; color:var(--text-muted); border:1px solid var(--border); border-radius:10px; padding:1px 7px; margin-left:6px; vertical-align:middle; }
