/* TrackBTC Pro App */

:root {
  --bg: #06131d;
  --bg-alt: #071824;
  --panel: #0a1f2e;
  --panel-strong: #0b1825;
  --border: rgba(56, 189, 248, 0.22);
  --border-strong: rgba(56, 189, 248, 0.38);
  --text: #dbeafe;
  --title: #e0f7ff;
  --muted: #94a3b8;
  --muted-2: #64748b;
  --accent: #38bdf8;
  --accent-warm: #f8c56d;
  --danger: #ef4444;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(6, 19, 29, 0.98) 0%, rgba(6, 19, 29, 0.9) 58%, rgba(6, 19, 29, 0.74) 100%),
    repeating-linear-gradient(0deg, rgba(56, 189, 248, 0.08) 0, rgba(56, 189, 248, 0.08) 1px, transparent 1px, transparent 44px),
    repeating-linear-gradient(90deg, rgba(242, 174, 78, 0.08) 0, rgba(242, 174, 78, 0.08) 1px, transparent 1px, transparent 88px),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: var(--accent-warm);
  font-weight: 800;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

h1 {
  color: var(--title);
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.04;
}

h2 {
  color: var(--title);
  font-size: 15px;
  line-height: 1.25;
}

p {
  color: var(--muted);
  line-height: 1.56;
}

code {
  color: var(--accent-warm);
  font-family: var(--mono);
  overflow-wrap: anywhere;
}

.app-shell {
  width: min(1180px, calc(100vw - 36px));
  margin: 0 auto;
  padding: 20px 0 34px;
}

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

.brand,
.app-header-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.app-header-brand:hover {
  text-decoration: none;
}

.brand strong,
.app-header-brand strong {
  color: var(--accent);
  font-size: 20px;
}

.nav-actions,
.app-header-actions,
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.app-header-actions a {
  color: var(--accent-warm);
  font-size: 13px;
}

.app-header-identity {
  max-width: 260px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.logout-form {
  margin: 0;
}

.nav-button {
  min-height: 34px;
  border-color: rgba(148, 163, 184, 0.32);
  background: var(--panel);
  color: var(--text);
  font-size: 12px;
}

.hero {
  padding: 42px 0 30px;
  border-top: 1px solid rgba(56, 189, 248, 0.12);
  border-bottom: 1px solid rgba(56, 189, 248, 0.18);
}

.hero.compact {
  padding: 28px 0 22px;
}

.kicker {
  color: var(--title);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lede {
  max-width: 760px;
  margin-top: 12px;
  color: #cbd5e1;
  font-size: 16px;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.stack {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.report-group {
  display: grid;
  gap: 12px;
  padding: 18px 0 4px;
}

.report-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.report-group-head h2 {
  font-size: 20px;
}

.report-group-head span,
.report-card-type {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.report-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.report-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(10, 31, 46, 0.88);
}

.report-card h3 {
  margin-top: 7px;
  color: var(--title);
  font-size: 22px;
  line-height: 1.2;
}

.report-card p {
  margin-top: 8px;
}

.report-card .button {
  margin-top: 16px;
}

.technical-details {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.technical-details summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.technical-details dl {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 10px;
  margin: 12px 0 0;
  font-size: 11px;
}

.technical-details dt {
  color: var(--muted);
}

.technical-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(10, 31, 46, 0.88);
}

.card.alt {
  background: rgba(7, 24, 36, 0.9);
}

.card h2,
.card h3 {
  margin-bottom: 12px;
}

.form-grid {
  display: grid;
  gap: 11px;
}

label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

input {
  min-height: 42px;
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 6px;
  background: rgba(6, 19, 29, 0.72);
  color: var(--text);
  font: inherit;
  padding: 0 12px;
}

input:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(56, 189, 248, 0.22);
}

button,
.button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--accent);
  color: #03131f;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  padding: 8px 13px;
}

button.secondary,
button.logout,
.button.secondary {
  background: var(--panel);
  color: var(--text);
}

button:hover,
.button:hover {
  filter: brightness(1.08);
  text-decoration: none;
}

.status-line {
  min-height: 24px;
  color: var(--muted);
  font-size: 13px;
}

.meta-line {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 0;
}

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

.metric dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.metric dd {
  margin: 7px 0 0;
  color: var(--accent);
  font-size: 18px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(10, 31, 46, 0.76);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(56, 189, 248, 0.14);
  text-align: left;
  vertical-align: top;
}

th {
  background: rgba(10, 31, 46, 0.96);
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

tr:nth-child(even) td {
  background: rgba(7, 24, 36, 0.9);
}

tr:nth-child(odd) td {
  background: rgba(6, 19, 29, 0.88);
}

tr:hover td {
  background: rgba(56, 189, 248, 0.1);
}

.empty {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(10, 31, 46, 0.86);
  color: var(--muted);
}

.json-preview {
  overflow: auto;
  max-height: 560px;
  margin: 0;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 6px;
  background: #0b111d;
  color: #eaf2f8;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
}

.report-lead {
  color: var(--title);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.35;
}

.note-grid,
.section-grid {
  display: grid;
  gap: 12px;
}

.note-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.note-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(10, 31, 46, 0.86);
}

.note-card h3,
.section-panel h2 {
  margin: 0;
  color: var(--title);
  font-size: 15px;
  line-height: 1.3;
}

.note-card strong {
  display: block;
  margin-top: 9px;
  color: var(--accent-warm);
  font-size: 18px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.note-card p {
  margin-top: 8px;
  font-size: 13px;
}

.section-panel {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(7, 24, 36, 0.92);
}

.section-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.section-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.mini-stat {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 6px;
  background: rgba(6, 19, 29, 0.58);
}

.mini-stat span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mini-stat strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.row-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.report-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: rgba(6, 19, 29, 0.64);
}

.rank-badge {
  min-width: 0;
  height: 34px;
  border: 1px solid rgba(248, 197, 109, 0.34);
  border-radius: 6px;
  color: var(--accent-warm);
  display: grid;
  font-size: 12px;
  font-weight: 900;
  place-items: center;
}

.row-title {
  color: var(--title);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.row-meta,
.evidence-line {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.row-value {
  color: var(--accent);
  font-weight: 900;
}

.source-panel summary {
  color: var(--accent-warm);
  cursor: pointer;
  font-weight: 900;
}

.source-panel .json-preview {
  margin-top: 12px;
}

@media (max-width: 760px) {
  .app-nav,
  .app-header-nav,
  .hero-header {
    align-items: flex-start;
    display: grid;
  }

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

  .app-header-actions {
    justify-content: flex-start;
  }

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

  .section-head {
    display: grid;
  }

  .section-stats {
    grid-template-columns: 1fr 1fr;
  }
}

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

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

  .section-stats {
    grid-template-columns: 1fr;
  }

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