@font-face {
  font-family: 'Inter';
  src: url('/static/fonts/Inter-Variable.ttf') format('truetype');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('/static/fonts/Inter-Italic-Variable.ttf') format('truetype');
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #07080a;
  --panel: #101318;
  --panel-soft: #151b22;
  --text: #f2efe5;
  --muted: #a59c86;
  --gold: #d9b35f;
  --gold-soft: #7f6938;
  --danger: #df7f74;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  line-height: 1.48;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  color: var(--text);
  background:
    radial-gradient(65rem 45rem at 10% -10%, rgba(217, 179, 95, 0.15), transparent),
    radial-gradient(40rem 25rem at 100% 0%, rgba(82, 113, 151, 0.15), transparent),
    var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

h1,
h2,
h3,
.big {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  letter-spacing: 0.005em;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.shell {
  width: min(1280px, calc(100vw - 1rem));
  margin: 1.6rem auto 2.2rem;
}

.bootstrap-status {
  margin-bottom: 0.9rem;
}

.bootstrap-status h3 {
  font-size: 1rem;
}

.bootstrap-status.error-state {
  border-color: rgba(224, 127, 127, 0.45);
}

.progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(217, 179, 95, 0.18);
  overflow: hidden;
  margin-top: 0.45rem;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #cfa34c, #f1cf83);
  transition: width 220ms ease;
}

.panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.01), rgba(255, 255, 255, 0)) var(--panel);
  border: 1px solid rgba(217, 179, 95, 0.16);
  border-radius: 18px;
  padding: 1.2rem;
  backdrop-filter: blur(2px);
  min-width: 0;
}

.auth-panel {
  max-width: 440px;
  margin: 10vh auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 1.1rem;
}

.topbar .row.gap {
  flex-wrap: wrap;
}

.update-panel {
  margin-bottom: 1.1rem;
}

#update-sha256 {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.grid {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: 1fr;
  margin-bottom: 1.1rem;
}

.stack {
  display: grid;
  gap: 0.85rem;
}

.compact {
  margin-bottom: 1.1rem;
}

.row {
  display: flex;
  align-items: center;
  min-width: 0;
}

.gap {
  gap: 0.6rem;
}

.spread {
  justify-content: space-between;
}

.sep {
  border: 0;
  border-top: 1px solid rgba(217, 179, 95, 0.12);
  margin: 1rem 0;
}

label {
  display: grid;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
}

p,
td,
th,
strong {
  overflow-wrap: anywhere;
}

input,
select,
button {
  border-radius: 10px;
  border: 1px solid rgba(217, 179, 95, 0.25);
  background: var(--panel-soft);
  color: var(--text);
  padding: 0.62rem 0.72rem;
  font: inherit;
  max-width: 100%;
}

button {
  cursor: pointer;
}

button:hover {
  border-color: rgba(217, 179, 95, 0.55);
}

button.primary {
  background: linear-gradient(160deg, var(--gold), #b2904d);
  color: #2f240e;
  border: none;
  font-weight: 600;
}

button.danger {
  border-color: rgba(224, 127, 127, 0.45);
  color: #f6c1c1;
}

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

.error {
  color: var(--danger);
  min-height: 1.2rem;
}

.big {
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  color: var(--gold);
}

.delta {
  margin-top: 0.2rem;
  margin-bottom: 0.4rem;
}

.delta.up {
  color: #62d495;
}

.delta.down {
  color: #e07f7f;
}

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

.metrics-row {
  display: flex;
  gap: 1.1rem;
  margin: 0.75rem 0 1.1rem;
  flex-wrap: wrap;
}

.metrics-row p {
  font-weight: 500;
}

.range-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.5rem;
}

.range-btn {
  padding: 0.2rem 0.45rem;
  font-size: 0.82rem;
  border-radius: 999px;
}

.range-btn.active {
  background: rgba(217, 179, 95, 0.2);
  border-color: rgba(217, 179, 95, 0.55);
}

#holdings-list > div,
#vault-list > button,
#activity-feed > div {
  border: 1px solid rgba(217, 179, 95, 0.18);
  border-radius: 10px;
  padding: 0.72rem;
  background: rgba(255, 255, 255, 0.01);
}

#vault-list > button {
  width: 100%;
  text-align: left;
  transition: transform 120ms ease, border-color 120ms ease, background-color 120ms ease;
}

#vault-list > button:hover {
  border-color: rgba(217, 179, 95, 0.5);
  background: rgba(217, 179, 95, 0.08);
  transform: translateY(-1px);
}

#vault-list > button.selected {
  border-color: rgba(217, 179, 95, 0.72);
  background: rgba(217, 179, 95, 0.18);
}

.asset-head {
  margin-bottom: 0.6rem;
}

#vault-actions {
  margin-top: 0.7rem;
  margin-bottom: 0.7rem;
}

#vault-rename-input {
  flex: 1;
}

.grid-2 {
  display: grid;
  gap: 0.72rem;
  grid-template-columns: 1fr;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0;
}

.tab {
  background: transparent;
  border-color: rgba(217, 179, 95, 0.22);
}

.tab.active {
  background: rgba(217, 179, 95, 0.17);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  line-height: 1.45;
}

#entries-table,
#sales-table,
#tax-events-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

#entries-table table,
#sales-table table,
#tax-events-table table {
  min-width: 760px;
}

.entries-toolbar {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 0.7rem;
}

.entries-left-tools {
  flex-wrap: wrap;
}

#entries-search {
  min-width: min(320px, 100%);
}

.entries-page-wrap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.entries-pagination {
  justify-content: flex-end;
}

.entry-sort-btn {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 0;
  margin: 0;
  font-weight: 600;
  cursor: pointer;
}

.entry-sort-btn:hover {
  color: var(--gold);
  text-decoration: underline;
}

td,
th {
  border-bottom: 1px solid rgba(217, 179, 95, 0.16);
  padding: 0.58rem 0.45rem;
  text-align: left;
}

.hidden {
  display: none !important;
}

@media (min-width: 960px) {
  .grid {
    grid-template-columns: 1.2fr 1fr;
  }

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

@media (max-width: 720px) {
  .shell {
    width: min(1280px, calc(100vw - 0.8rem));
    margin: 0.5rem auto 1rem;
  }

  .panel {
    padding: 0.9rem;
  }

  #vault-actions {
    flex-wrap: wrap;
  }

  #vault-actions > * {
    width: 100%;
  }

  #entries-search {
    width: 100%;
    min-width: 0;
  }

  .entries-pagination {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}
