/* Valtire Admin — Valtron DARK theme, top-tab layout
   Brand system from valtron.co.uk on a deep-navy canvas:
   - Fonts: DM Sans (titles + UI), Spectral (serif accents)
   - Deep navy #0E0E32 family backgrounds, white titles
   - Brand blue #1B6ECA (lifted to #4D9FFF for dark), logo gradient blue -> violet
   - Soft blue borders, 20-24px rounded boxes
   - Navigation: horizontal tabs across the top of the page (no side menu) */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0a0a26;
  --surface: #13133a;
  --surface-2: #1b1b47;
  --border: rgba(99, 125, 255, .22);
  --border-soft: rgba(99, 125, 255, .13);
  --title: #ffffff;
  --ink: rgba(237, 236, 247, .88);
  --muted: rgba(237, 236, 247, .52);
  --blue: #4d9fff;
  --violet: #a78bfa;
  --green: #5fbf7a;
  --red: #ff6b6b;
  --gold: #e8b33a;
  --shadow: 0 14px 36px rgba(0, 0, 10, .35);
  --grad: linear-gradient(135deg, #1b6eca, #7c3aed);
}

html { -webkit-font-smoothing: antialiased; }

body {
  font-family: "DM Sans", "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(ellipse 70% 40% at 50% -5%, rgba(27,110,202,.14), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.55;
  min-height: 100vh;
}

/* ----------------------------------------------------------- top nav + tabs */
.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 38, .82);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border-soft);
}

.topnav-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 14px 32px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.nav-brand img { width: 34px; height: 34px; }

.nav-wordmark {
  color: var(--title);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .22em;
}

.nav-tagline {
  font-family: "Spectral", Georgia, serif;
  font-style: italic;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .05em;
}

.nav-right { display: flex; align-items: center; gap: 16px; }
.admin-chip { font-weight: 700; font-size: 13.5px; color: var(--title); }
.logout { color: var(--muted); font-size: 13px; text-decoration: none; transition: color .18s; }
.logout:hover { color: var(--red); }

.tabs-wrap {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 32px 12px;
  overflow-x: auto;
}

.tabs {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background .18s ease, color .18s ease;
}

.tab:hover { background: rgba(99,125,255,.10); color: var(--title); }

.tab.active {
  background: var(--grad);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(27,110,202,.35);
}

.badge {
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
}

/* ------------------------------------------------------------------- main */
.main {
  max-width: 1320px;
  margin: 0 auto;
  padding: 30px 32px 60px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 26px;
}

.topbar h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--title);
  letter-spacing: -.015em;
}

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

/* ------------------------------------------------------------------ cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 26px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px 22px;
  box-shadow: var(--shadow);
}

.stat-label { color: var(--muted); font-size: 12.5px; font-weight: 500; }

.stat-value {
  font-size: 27px;
  font-weight: 700;
  color: var(--title);
  letter-spacing: -.01em;
  margin-top: 4px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 26px 28px;
  margin-bottom: 26px;
  box-shadow: var(--shadow);
}

.panel h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--title);
  margin-bottom: 16px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
}
@media (max-width: 1000px) { .grid-2 { grid-template-columns: 1fr; } }

/* ----------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; white-space: nowrap; }

th {
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

td { padding: 10px 12px; border-bottom: 1px solid var(--border-soft); }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: rgba(99,125,255,.05); }

.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; }
.muted { color: var(--muted); }
.pos { color: var(--green); font-weight: 500; }
.neg { color: var(--red); font-weight: 500; }

/* ------------------------------------------------------------------- tags */
.tag {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 11px;
  border-radius: 999px;
  background: rgba(237,236,247,.08);
  color: var(--muted);
}

.tag-forex   { background: rgba(77,159,255,.16);  color: var(--blue); }
.tag-gold    { background: rgba(232,179,58,.14);  color: var(--gold); }
.tag-crypto  { background: rgba(167,139,250,.15); color: var(--violet); }
.tag-buy     { background: rgba(95,191,122,.15);  color: var(--green); }
.tag-sell    { background: rgba(255,107,107,.14); color: var(--red); }
.tag-open    { background: rgba(77,159,255,.16);  color: var(--blue); }
.tag-closed  { background: rgba(237,236,247,.08); color: var(--muted); }
.tag-active  { background: rgba(95,191,122,.15);  color: var(--green); }
.tag-suspended, .tag-rejected { background: rgba(255,107,107,.14); color: var(--red); }
.tag-pending  { background: rgba(232,179,58,.14); color: var(--gold); }
.tag-approved { background: rgba(95,191,122,.15); color: var(--green); }

/* ------------------------------------------------------------------ forms */
input, select, button { font: inherit; color: var(--ink); }

input, select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 9px 15px;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}

input:focus, select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(77,159,255,.18);
}
input::placeholder { color: var(--muted); }
select option { background: var(--surface-2); color: var(--ink); }

.row-form { display: flex; flex-wrap: wrap; gap: 10px; }
.row-form input, .row-form select { flex: 1 1 160px; }
.row-form button { flex: 0 0 auto; }

.stack-form { display: flex; flex-direction: column; gap: 14px; max-width: 420px; }
.stack-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 500; }

.inline-form { display: inline-flex; gap: 6px; align-items: center; }
.input-sm { width: 112px; padding: 6px 12px; font-size: 13px; border-radius: 11px; }
.actions-cell { display: flex; gap: 8px; align-items: center; }
.actions-cell form { display: inline-flex; gap: 6px; }

.btn {
  background: rgba(237,236,247,.08);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 19px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--title);
  transition: background .18s ease, box-shadow .18s ease;
}

.btn:hover { background: rgba(237,236,247,.14); }
.btn-sm { padding: 5px 14px; font-size: 12.5px; }

.btn-primary {
  background: var(--grad);
  border: none;
  color: #fff;
  box-shadow: 0 6px 18px rgba(27,110,202,.35);
}
.btn-primary:hover { filter: brightness(1.1); box-shadow: 0 8px 22px rgba(124,58,237,.4); }

.btn-ok { background: rgba(95,191,122,.13); border-color: rgba(95,191,122,.35); color: var(--green); }
.btn-ok:hover { background: rgba(95,191,122,.22); }
.btn-danger { background: rgba(255,107,107,.12); border-color: rgba(255,107,107,.35); color: var(--red); }
.btn-danger:hover { background: rgba(255,107,107,.2); }

/* ------------------------------------------------------------------ flash */
.flash {
  padding: 12px 20px;
  border-radius: 16px;
  margin-bottom: 18px;
  font-weight: 500;
  font-size: 13.5px;
}
.flash-ok    { background: rgba(95,191,122,.10);  color: var(--green); border: 1px solid rgba(95,191,122,.35); }
.flash-error { background: rgba(255,107,107,.09); color: var(--red);   border: 1px solid rgba(255,107,107,.35); }

/* ------------------------------------------------------------------ login */
.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 55% 45% at 50% 0%, rgba(27,110,202,.18), transparent 70%),
    radial-gradient(ellipse 40% 35% at 85% 95%, rgba(124,58,237,.14), transparent 70%),
    var(--bg);
}

.login-card {
  width: min(410px, 92vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px 36px;
  box-shadow: 0 28px 70px rgba(0, 0, 10, .5);
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-bottom: 26px;
}

.login-brand img { width: 74px; height: 74px; }
.login-brand .nav-wordmark { font-size: 19px; }
.login-brand .nav-tagline { font-size: 12.5px; }

.login-card form { display: flex; flex-direction: column; gap: 15px; }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
.login-card .btn { margin-top: 8px; padding: 12px; font-size: 15px; }

.login-note {
  font-family: "Spectral", Georgia, serif;
  font-style: italic;
  text-align: center;
  margin-top: 24px;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: .08em;
}
