:root {
  --bg: #0c1116;
  --panel: #151d25;
  --panel-2: #1b2630;
  --line: rgba(255,255,255,.12);
  --ink: #edf5f1;
  --muted: #9ba9a5;
  --brand: #ffc44d;
  --ok: #44d483;
  --danger: #ff7171;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Arial, Helvetica, sans-serif;
}

h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.8rem; }
h2 { margin-bottom: 14px; font-size: 1.2rem; }

.admin-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px;
  background: #101820;
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.brand span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #281900;
  background: var(--brand);
  border-radius: 8px;
  font-weight: 900;
}

.brand strong { font-size: 1rem; }

.sidebar nav {
  display: grid;
  gap: 8px;
}

.sidebar a,
.button-link,
button {
  min-height: 38px;
  padding: 9px 12px;
  color: #251700;
  background: var(--brand);
  border: 0;
  border-radius: 6px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.sidebar a {
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
}

.sidebar a.active {
  color: #251700;
  background: var(--brand);
  border-color: rgba(255, 196, 77, .85);
  box-shadow: 0 0 0 2px rgba(255, 196, 77, .16);
}

.content {
  min-width: 0;
  padding: 22px;
}

.topbar,
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

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

.topbar-chip-box {
  min-width: 112px;
  padding: 7px 12px;
  color: #251700;
  background: var(--brand);
  border-radius: 8px;
  text-align: right;
}

.topbar-chip-box span {
  display: block;
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.topbar-chip-box strong {
  display: block;
  font-size: 1rem;
}

.topbar span,
.eyebrow,
label {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.chip-box {
  min-width: 130px;
  padding: 10px 14px;
  color: #251700;
  background: var(--brand);
  border-radius: 8px;
  text-align: right;
}

.chip-box span {
  display: block;
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.chip-box strong {
  display: block;
  font-size: 1.25rem;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.panel,
.login-panel {
  margin-bottom: 16px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.login-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.login-panel {
  width: min(100%, 420px);
}

form,
.filters {
  display: grid;
  gap: 10px;
}

.filters {
  grid-template-columns: repeat(4, minmax(120px, 1fr)) auto;
  align-items: end;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
}

textarea { min-height: 72px; resize: vertical; }

.password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px;
  gap: 8px;
}

.alert {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 6px;
}

.success { background: rgba(68, 212, 131, .14); border: 1px solid rgba(68, 212, 131, .32); }
.danger, .field-validation-error { color: #ffd5d5; background: rgba(255, 113, 113, .12); }

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric {
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 6px;
  font-size: 1.35rem;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}

.wide-table {
  min-width: 1180px;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: .76rem;
  text-transform: uppercase;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.section-title,
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.pager {
  margin-top: 14px;
  margin-bottom: 0;
}

.small {
  min-height: 30px;
  padding: 6px 10px;
  font-size: .82rem;
}

.disabled {
  opacity: .48;
  pointer-events: none;
}

.profit { color: var(--ok); }
.loss { color: var(--danger); }
.muted { color: var(--muted); }

.highlight-transfer-row {
  background: rgba(255, 196, 77, .14);
  box-shadow: inset 4px 0 0 var(--brand);
}

.highlight-transfer-row td {
  border-bottom-color: rgba(255, 196, 77, .28);
}

.status-pill {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 7px;
  color: #06351d;
  background: var(--ok);
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 900;
  text-transform: uppercase;
}

@media (max-width: 920px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .sidebar nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .content { padding: 16px; }
  .grid.two,
  .grid.three,
  .cards,
  .filters {
    grid-template-columns: 1fr;
  }

  .topbar,
  .page-head,
  .topbar-actions,
  .section-title,
  .pager {
    align-items: stretch;
    flex-direction: column;
  }
}
