/* ═══════════════════════════════════════════════════════════════════════════
   Hey Larmah Exchange — Enterprise v2.0
   Design: Refined Crypto Dark — deep navy, sharp amber accents, geometric grid
   Font: IBM Plex Mono + IBM Plex Sans
   ═══════════════════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@300;400;500;600;700&family=Sora:wght@700;800&display=swap');

:root {
  /* Core palette */
  --bg-void:     #040609;
  --bg-base:     #070b12;
  --bg-surface:  #0c1220;
  --bg-raised:   #101828;
  --bg-hover:    #162035;
  --border:      rgba(255,255,255,.07);
  --border-lit:  rgba(255,255,255,.13);

  /* Brand colours */
  --amber:       #f59e0b;
  --amber-dim:   rgba(245,158,11,.55);
  --amber-glow:  rgba(245,158,11,.15);
  --teal:        #14b8a6;
  --teal-dim:    rgba(20,184,166,.45);
  --blue:        #3b82f6;
  --red:         #ef4444;
  --green:       #22c55e;
  --purple:      #a855f7;

  /* Text */
  --text:        #e8edf5;
  --text-dim:    rgba(232,237,245,.65);
  --text-faint:  rgba(232,237,245,.38);

  /* Sizing */
  --r:    10px;
  --r-sm: 7px;
  --r-lg: 16px;

  /* Shadows */
  --shadow-card: 0 4px 30px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.04);
  --shadow-btn:  0 2px 12px rgba(245,158,11,.3);
  --glow-amber:  0 0 0 1px rgba(245,158,11,.25), 0 0 30px rgba(245,158,11,.12);
  --glow-teal:   0 0 0 1px rgba(20,184,166,.25), 0 0 30px rgba(20,184,166,.10);
}

/* ─── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  background: var(--bg-void);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Grid background texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* Ambient glow orbs */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 400px at 15% 8%,  rgba(245,158,11,.06), transparent 60%),
    radial-gradient(ellipse 500px 350px at 85% 12%, rgba(20,184,166,.06),  transparent 60%),
    radial-gradient(ellipse 700px 500px at 50% 90%, rgba(59,130,246,.04),  transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ─── Top bar ─────────────────────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--amber), var(--teal), var(--blue), var(--amber));
  background-size: 300% 100%;
  animation: topbar-shift 6s linear infinite;
  z-index: 1000;
}
@keyframes topbar-shift { to { background-position: 300% 0; } }

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.wrap {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

/* ─── Header ─────────────────────────────────────────────────────────────── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Sora', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: #040609;
  letter-spacing: .5px;
  box-shadow: var(--shadow-btn);
  flex-shrink: 0;
}

.brand-text h1 {
  font-family: 'Sora', sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.3px;
  color: var(--text);
}

.brand-text .sub {
  font-size: 12px;
  color: var(--text-faint);
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: .3px;
}

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

/* ─── Announcements bar ───────────────────────────────────────────────────── */
.ann-bar {
  display: none;
  background: linear-gradient(90deg, rgba(245,158,11,.12), rgba(245,158,11,.06));
  border: 1px solid rgba(245,158,11,.25);
  border-radius: var(--r);
  padding: 10px 16px;
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--amber);
}
.ann-bar.show { display: block; }

/* ─── Tabs (page navigation) ─────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 5px;
  overflow-x: auto;
}

.tab-btn {
  flex-shrink: 0;
  padding: 8px 18px;
  border-radius: var(--r-sm);
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .18s;
  white-space: nowrap;
  margin-top: 0;
}
.tab-btn:hover { background: var(--bg-hover); color: var(--text); transform: none; }
.tab-btn.active {
  background: linear-gradient(135deg, rgba(245,158,11,.18), rgba(245,158,11,.08));
  color: var(--amber);
  border: 1px solid rgba(245,158,11,.3);
  box-shadow: 0 2px 12px rgba(245,158,11,.1);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent);
}

.card-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title::before {
  content: '';
  width: 3px; height: 14px;
  background: var(--amber);
  border-radius: 2px;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 900px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 500px) {
  .grid-4 { grid-template-columns: 1fr; }
}
.gap { display: flex; flex-direction: column; gap: 16px; }

/* ─── Stat cards ─────────────────────────────────────────────────────────── */
.stat-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px;
}
.stat-card .label {
  font-size: 11px;
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 8px;
}
.stat-card .value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 24px;
  font-weight: 600;
  color: var(--amber);
}
.stat-card .value.teal { color: var(--teal); }
.stat-card .value.blue { color: var(--blue); }
.stat-card .value.green { color: var(--green); }
.stat-card .sub-value { font-size: 12px; color: var(--text-faint); margin-top: 4px; }

/* ─── Wallet display ─────────────────────────────────────────────────────── */
.wallet-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--r);
  margin-bottom: 10px;
  transition: border-color .15s;
}
.wallet-row:hover { border-color: var(--border-lit); }
.wallet-currency {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--amber);
  width: 52px;
  flex-shrink: 0;
}
.wallet-amounts { text-align: right; }
.wallet-available {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}
.wallet-locked {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 2px;
}

/* ─── Forms ──────────────────────────────────────────────────────────────── */
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 11px;
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 6px;
}
input, select, textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-raised);
  border: 1px solid var(--border-lit);
  border-radius: var(--r-sm);
  color: var(--text);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
input:focus, select:focus, textarea:focus {
  border-color: var(--amber);
  box-shadow: var(--glow-amber);
}
select option { background: var(--bg-raised); color: var(--text); }

/* ─── Buttons ────────────────────────────────────────────────────────────── */
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 20px;
  border-radius: var(--r-sm);
  border: none;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .1s, opacity .15s, box-shadow .15s;
  white-space: nowrap;
  text-decoration: none;
  margin-top: 0;
}
button:hover { transform: translateY(-1px); }
button:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #040609;
  box-shadow: var(--shadow-btn);
}
.btn-primary:hover { box-shadow: 0 4px 20px rgba(245,158,11,.4); }

.btn-secondary {
  background: var(--bg-raised);
  color: var(--text-dim);
  border: 1px solid var(--border-lit);
}
.btn-secondary:hover { border-color: var(--amber-dim); color: var(--text); }

.btn-teal {
  background: linear-gradient(135deg, #14b8a6, #0d9488);
  color: #040609;
}
.btn-danger {
  background: linear-gradient(135deg, rgba(239,68,68,.15), rgba(239,68,68,.08));
  color: var(--red);
  border: 1px solid rgba(239,68,68,.3);
}
.btn-danger:hover { background: linear-gradient(135deg, rgba(239,68,68,.25), rgba(239,68,68,.15)); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-full { width: 100%; margin-top: 4px; }
.btn-full + .btn-full { margin-top: 8px; }

/* ─── Pills / badges ─────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  letter-spacing: .5px;
}
.badge-amber  { background: rgba(245,158,11,.15); color: var(--amber);  border: 1px solid rgba(245,158,11,.3); }
.badge-teal   { background: rgba(20,184,166,.12);  color: var(--teal);   border: 1px solid rgba(20,184,166,.3); }
.badge-green  { background: rgba(34,197,94,.12);   color: var(--green);  border: 1px solid rgba(34,197,94,.3); }
.badge-red    { background: rgba(239,68,68,.12);   color: var(--red);    border: 1px solid rgba(239,68,68,.3); }
.badge-blue   { background: rgba(59,130,246,.12);  color: var(--blue);   border: 1px solid rgba(59,130,246,.3); }
.badge-gray   { background: rgba(255,255,255,.06); color: var(--text-dim); border: 1px solid var(--border-lit); }
.badge-admin  { background: rgba(168,85,247,.15); color: var(--purple);  border: 1px solid rgba(168,85,247,.3); }

/* ─── Messages ───────────────────────────────────────────────────────────── */
.msg {
  padding: 10px 14px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-family: 'IBM Plex Mono', monospace;
  min-height: 40px;
  margin-top: 12px;
  transition: all .2s;
}
.msg:empty { display: none; }
.msg.ok  { background: rgba(34,197,94,.08);  border: 1px solid rgba(34,197,94,.3);  color: var(--green); }
.msg.err { background: rgba(239,68,68,.08);  border: 1px solid rgba(239,68,68,.3);  color: var(--red); }
.msg.info{ background: rgba(59,130,246,.08); border: 1px solid rgba(59,130,246,.3); color: var(--blue); }

/* ─── Tables ─────────────────────────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; border-radius: var(--r); border: 1px solid var(--border); }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
thead th {
  padding: 10px 14px;
  background: var(--bg-raised);
  color: var(--text-faint);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  font-family: 'IBM Plex Mono', monospace;
  vertical-align: middle;
  color: var(--text-dim);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(255,255,255,.02); color: var(--text); }
.mono { font-family: 'IBM Plex Mono', monospace; }

/* ─── Order book ─────────────────────────────────────────────────────────── */
.ask { color: var(--red); }
.bid { color: var(--green); }

/* ─── KYC status ─────────────────────────────────────────────────────────── */
#kycStatusBadge { font-size: 13px; }

/* ─── Section divider ────────────────────────────────────────────────────── */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

/* ─── Auth pages (index.html) ────────────────────────────────────────────── */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.auth-box {
  width: 100%;
  max-width: 420px;
}
.auth-logo-wrap {
  text-align: center;
  margin-bottom: 36px;
}
.auth-logo {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Sora', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: #040609;
  box-shadow: 0 8px 30px rgba(245,158,11,.4);
  margin-bottom: 16px;
}
.auth-logo-wrap h1 {
  font-family: 'Sora', sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
}
.auth-logo-wrap p {
  font-size: 13px;
  color: var(--text-faint);
  margin-top: 6px;
  font-family: 'IBM Plex Mono', monospace;
}

.auth-tabs {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 24px;
}
.auth-tab {
  flex: 1;
  padding: 12px;
  background: var(--bg-surface);
  color: var(--text-dim);
  border: none;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  margin-top: 0;
}
.auth-tab:hover { background: var(--bg-hover); color: var(--text); transform: none; }
.auth-tab.active { background: linear-gradient(135deg, rgba(245,158,11,.15), rgba(245,158,11,.06)); color: var(--amber); }

.auth-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 28px; box-shadow: var(--shadow-card); }
.auth-form { display: none; }
.auth-form.active { display: block; }

.auth-footer { margin-top: 20px; text-align: center; font-size: 12px; color: var(--text-faint); }
.auth-footer a { color: var(--amber); text-decoration: none; }

/* ─── Scrollbar ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.2); }

/* ─── Link ───────────────────────────────────────────────────────────────── */
a { color: var(--amber); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Separator label ────────────────────────────────────────────────────── */
.sep-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 20px 0;
}
.sep-label::before, .sep-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ─── Spinner ────────────────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.2);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Utility ────────────────────────────────────────────────────────────── */
.text-amber { color: var(--amber); }
.text-teal  { color: var(--teal); }
.text-green { color: var(--green); }
.text-red   { color: var(--red); }
.text-dim   { color: var(--text-dim); }
.text-faint { color: var(--text-faint); }
.text-mono  { font-family: 'IBM Plex Mono', monospace; }
.text-sm    { font-size: 12px; }
.text-xs    { font-size: 11px; }
.mb0 { margin-bottom: 0; }
.mt0 { margin-top: 0; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.section-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
