:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --panel: #ffffff;
  --ink: #111827;
  --muted: #667085;
  --line: #e5e7eb;
  --soft: #f1f5f9;
  --green: #059669;
  --red: #dc2626;
  --amber: #d97706;
  --blue: #2563eb;
  --shadow: 0 12px 36px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.45;
  letter-spacing: 0;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 48px;
}

.admin-shell {
  max-width: 980px;
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--ink);
  font-weight: 800;
  font-size: 20px;
  text-decoration: none;
}

.brand img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: 8px;
  background: white;
}

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

.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  text-decoration: none;
}

.icon-link svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.text-link {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-size: 13px;
  font-weight: 800;
}

.status-pill.warning {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #c2410c;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.summary-card {
  min-height: 136px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.summary-card.primary {
  background: #0f172a;
  color: white;
}

.summary-card .label,
.label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.summary-card.primary .label,
.summary-card.primary .muted {
  color: rgba(255, 255, 255, 0.72);
}

.summary-card strong {
  display: block;
  margin-top: 12px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1;
  letter-spacing: 0;
}

.muted {
  color: var(--muted);
}

.positive {
  color: var(--green);
}

.negative {
  color: var(--red);
}

.panel {
  margin-top: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: 0;
}

h2 {
  font-size: 22px;
}

.allocation-bar {
  display: flex;
  overflow: hidden;
  height: 10px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: var(--soft);
}

.allocation-bar span {
  min-width: 4px;
}

.asset-list {
  display: grid;
}

.asset-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.4fr) minmax(120px, 0.8fr) minmax(150px, 1fr) minmax(150px, 1fr);
  gap: 16px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.asset-row:last-child {
  border-bottom: 0;
}

.asset-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.asset-main strong,
.asset-main span,
.asset-metric strong,
.asset-metric span {
  display: block;
}

.asset-main span:not(.coin),
.asset-metric span:not(.label) {
  color: var(--muted);
}

.coin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  color: white;
  font-size: 15px;
  font-weight: 900;
}

.asset-metric {
  min-width: 0;
}

.asset-metric strong {
  margin-top: 2px;
  overflow-wrap: anywhere;
  font-size: 18px;
}

.asset-metric.pnl strong,
.asset-metric.pnl span:not(.label) {
  color: inherit;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

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

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-form label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.admin-form label span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.admin-form .wide {
  grid-column: 1 / -1;
}

input,
select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.primary-button,
.ghost-button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  font-weight: 900;
  cursor: pointer;
}

.primary-button {
  align-self: end;
  padding: 0 18px;
  background: var(--ink);
  color: white;
}

.ghost-button {
  padding: 0 12px;
  border: 1px solid var(--line);
  background: white;
  color: var(--red);
}

.row-action {
  text-align: right;
}

.empty-state,
.empty-page {
  color: var(--muted);
}

@media (max-width: 820px) {
  .shell {
    width: min(100% - 24px, 680px);
    padding-top: 14px;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .summary-card {
    min-height: 116px;
  }

  .section-head {
    display: grid;
  }

  .asset-row {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .asset-main {
    grid-column: 1 / -1;
  }

  .admin-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .brand span {
    font-size: 18px;
  }

  .panel,
  .summary-card {
    padding: 16px;
  }

  h1 {
    font-size: 23px;
  }

  .asset-row {
    grid-template-columns: 1fr;
  }
}
