/* ─── DASHBOARD LAYOUT ─── */
.dash-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.dash-nav-inner {
  max-width: 100%;
  height: 100%;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dash-brand {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--fg-primary);
  text-decoration: none;
}

.dash-nav-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.dash-nav-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(0, 229, 160, 0.2);
  padding: 0.25rem 0.6rem;
  border-radius: 2px;
}

.dash-nav-time {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--fg-muted);
}

.dash-layout {
  display: flex;
  padding-top: 56px;
  min-height: 100vh;
}

/* ─── SIDEBAR ─── */
.dash-sidebar {
  width: 280px;
  flex-shrink: 0;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 1.5rem 1rem;
  overflow-y: auto;
  height: calc(100vh - 56px);
  position: sticky;
  top: 56px;
}

.sidebar-section {
  margin-bottom: 2rem;
}

.sidebar-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--fg-muted);
  margin-bottom: 0.75rem;
  padding-left: 2px;
}

/* Summary cards */
.summary-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem;
  text-align: center;
}

.summary-card.summary-critical { border-color: rgba(255, 107, 74, 0.4); }
.summary-card.summary-high { border-color: rgba(255, 165, 0, 0.3); }
.summary-card.summary-clean { border-color: rgba(0, 229, 160, 0.2); }

.summary-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--fg-primary);
  line-height: 1;
  margin-bottom: 0.3rem;
}

.summary-critical .summary-num { color: var(--warning); }
.summary-high .summary-num { color: #ffaa00; }
.summary-clean .summary-num { color: var(--accent); }

.summary-desc {
  font-size: 0.7rem;
  color: var(--fg-muted);
}

/* Add wallet form */
.add-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dash-input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--fg-primary);
  padding: 0.55rem 0.75rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

.dash-input:focus {
  border-color: var(--accent);
}

.dash-input::placeholder { color: var(--fg-muted); }

.btn-primary {
  background: var(--accent);
  color: #0a0a0f;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 4px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-primary:hover { opacity: 0.88; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.form-error {
  font-size: 0.78rem;
  color: var(--warning);
  margin-top: 0.25rem;
}

/* Wallet list */
.wallet-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 400px;
  overflow-y: auto;
}

.wallet-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s;
}

.wallet-item:hover,
.wallet-item.active {
  border-color: var(--accent);
}

.wallet-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.2rem;
}

.wallet-addr {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--fg-primary);
}

.wallet-label-text {
  font-size: 0.72rem;
  color: var(--fg-muted);
  margin-top: 0.15rem;
}

.risk-bar-wrap {
  height: 2px;
  background: var(--border);
  border-radius: 1px;
  margin-top: 0.5rem;
}

.risk-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 1px;
  transition: width 0.3s;
}

/* ─── MAIN CONTENT ─── */
.dash-main {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  min-width: 0;
}

.main-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.main-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.2rem;
}

.main-subtitle {
  font-size: 0.82rem;
  color: var(--fg-muted);
}

.header-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.btn-back {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
  margin-bottom: 0.4rem;
  display: block;
}

/* ─── RISK BADGE ─── */
.risk-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  font-weight: 600;
  white-space: nowrap;
}

.risk-critical { background: rgba(255, 107, 74, 0.2); color: #ff6b4a; border: 1px solid rgba(255,107,74,0.3); }
.risk-high     { background: rgba(255, 170, 0, 0.15); color: #ffaa00; border: 1px solid rgba(255,170,0,0.3); }
.risk-medium   { background: rgba(255, 220, 80, 0.1); color: #ffdc50; border: 1px solid rgba(255,220,80,0.2); }
.risk-low      { background: rgba(0, 229, 160, 0.1); color: var(--accent); border: 1px solid rgba(0,229,160,0.15); }
.risk-clean    { background: rgba(0, 229, 160, 0.1); color: var(--accent); border: 1px solid rgba(0,229,160,0.15); }
.risk-unknown  { background: var(--bg-card); color: var(--fg-muted); border: 1px solid var(--border); }

/* ─── REPORT TABLE ─── */
.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.report-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--fg-muted);
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.report-table td {
  padding: 0.75rem;
  border-bottom: 1px solid rgba(34, 34, 51, 0.6);
  vertical-align: middle;
}

.report-table tr:hover td {
  background: var(--bg-secondary);
}

.mono { font-family: var(--font-mono); font-size: 0.82rem; }
.td-addr { min-width: 150px; }
.td-label { display: block; font-size: 0.7rem; color: var(--fg-muted); margin-top: 0.1rem; }

.score-critical { color: var(--warning); font-weight: 600; }
.score-high { color: #ffaa00; font-weight: 600; }
.score-ok { color: var(--fg-secondary); }

/* ─── RISK PANEL ─── */
.risk-panel {
  display: grid;
  grid-template-columns: auto 1fr 2fr;
  gap: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  align-items: start;
}

.risk-gauge {
  text-align: center;
  min-width: 80px;
}

.risk-gauge-num {
  font-family: var(--font-mono);
  font-size: 3rem;
  font-weight: 700;
  color: var(--fg-primary);
  line-height: 1;
}

.risk-gauge-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: var(--fg-muted);
  margin-top: 0.3rem;
}

.risk-badge-lg {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.35rem 0.8rem;
  border-radius: 4px;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.risk-summary-text {
  font-size: 0.9rem;
  color: var(--fg-secondary);
  line-height: 1.6;
}

.risk-signals {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.signal-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.6rem 0.75rem;
  background: var(--bg-secondary);
  border-radius: 4px;
  border-left: 3px solid transparent;
}

.signal-item.sig-high { border-left-color: var(--warning); }
.signal-item.sig-medium { border-left-color: #ffaa00; }
.signal-item.sig-low { border-left-color: var(--accent); }

.signal-type {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--fg-muted);
  min-width: 80px;
  text-transform: uppercase;
}

.signal-desc {
  font-size: 0.82rem;
  color: var(--fg-secondary);
}

/* ─── WALLET REPORTS LIST ─── */
.section-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--fg-muted);
  margin-bottom: 0.75rem;
}

.wallet-reports-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.report-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.report-row:hover { border-color: var(--fg-muted); }

.report-row-left {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.report-row-date {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--fg-primary);
}

.report-row-meta {
  font-size: 0.75rem;
  color: var(--fg-muted);
}

/* ─── BUTTONS ─── */
.btn-analyze {
  background: var(--accent);
  color: #0a0a0f;
  border: none;
  padding: 0.55rem 1.1rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: opacity 0.2s;
}

.btn-analyze:hover { opacity: 0.85; }
.btn-analyze:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-danger-sm {
  background: none;
  border: 1px solid rgba(255, 107, 74, 0.3);
  color: var(--warning);
  padding: 0.5rem 0.9rem;
  border-radius: 4px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-danger-sm:hover { background: rgba(255, 107, 74, 0.1); }

.btn-small {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--fg-secondary);
  padding: 0.3rem 0.7rem;
  border-radius: 3px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: border-color 0.15s;
}

.btn-small:hover { border-color: var(--fg-muted); }

/* ─── SPINNER ─── */
.spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(0,0,0,0.3);
  border-top-color: #0a0a0f;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── MODAL ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  max-width: 680px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 2rem;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--fg-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

.modal-close:hover { color: var(--fg-primary); }

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

.modal-section-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: var(--fg-muted);
  text-transform: uppercase;
  margin: 1.25rem 0 0.5rem;
}

.modal-summary {
  font-size: 0.9rem;
  color: var(--fg-secondary);
  line-height: 1.7;
  background: var(--bg-secondary);
  border-radius: 4px;
  padding: 1rem;
}

.modal-stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.modal-stat {
  background: var(--bg-secondary);
  border-radius: 4px;
  padding: 0.75rem;
  text-align: center;
}

.modal-stat-val {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--fg-primary);
  display: block;
}

.modal-stat-label {
  font-size: 0.7rem;
  color: var(--fg-muted);
}

/* ─── EMPTY STATES ─── */
.empty-state {
  font-size: 0.82rem;
  color: var(--fg-muted);
  padding: 0.5rem 0.25rem;
}

.empty-panel {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--fg-secondary);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--fg-muted);
}

.loading-text {
  font-size: 0.82rem;
  color: var(--fg-muted);
  font-family: var(--font-mono);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .dash-layout { flex-direction: column; }
  .dash-sidebar { width: 100%; height: auto; position: static; border-right: none; border-bottom: 1px solid var(--border); }
  .dash-main { padding: 1.25rem; }
  .risk-panel { grid-template-columns: 1fr; }
  .modal-stat-row { grid-template-columns: 1fr 1fr; }
}
