/* ── DASHBOARD NAV ── */
.db-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.db-nav-link {
  font-size: 0.875rem;
  color: var(--fg-dim);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: var(--font);
  transition: color 0.15s, background 0.15s;
}
.db-nav-link:hover { color: var(--fg); background: var(--bg-elevated); }
.db-nav-link.active { color: var(--accent); }
.db-nav-btn { border: 1px solid var(--border); }

/* ── MAIN LAYOUT ── */
.db-main {
  min-height: calc(100vh - 65px);
  padding: 40px 0 80px;
}

.db-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.db-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}

.db-subtitle {
  color: var(--fg-dim);
  font-size: 0.9rem;
  font-family: var(--mono);
}

.db-cta-btn {
  text-decoration: none;
  font-size: 0.9rem;
  padding: 10px 20px;
  white-space: nowrap;
}

/* ── ALERT BANNER ── */
.alert-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(255, 77, 106, 0.1);
  border: 1px solid rgba(255, 77, 106, 0.35);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 24px;
}

.alert-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }

.alert-body { color: var(--fg); font-size: 0.9rem; line-height: 1.5; }

.alert-link {
  color: var(--red);
  font-weight: 600;
  text-decoration: none;
  margin-left: 4px;
}
.alert-link:hover { text-decoration: underline; }

/* ── CARDS ── */
.db-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.db-card-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-dim);
  margin-bottom: 20px;
}

.db-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.db-card-header .db-card-label { margin-bottom: 0; }
.db-card-link {
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
}
.db-card-link:hover { text-decoration: underline; }

/* ── HERO GRID (score + stats) ── */
.db-hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.db-score-card { display: flex; flex-direction: column; }

.db-score-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
}

.db-score-ring {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border-width: 6px;
  flex-shrink: 0;
}

.db-score-meta { flex: 1; }

.db-trend {
  font-size: 0.85rem;
  font-weight: 600;
  margin: 8px 0;
  font-family: var(--mono);
}
.trend-down { color: var(--accent); }
.trend-up   { color: var(--red); }
.trend-flat { color: var(--fg-dim); }

.db-score-detail {
  color: var(--fg-muted);
  font-size: 0.85rem;
  margin: 0;
}

.db-empty-score { color: var(--fg-dim); font-size: 0.9rem; }
.db-empty-score a { color: var(--accent); text-decoration: none; }

.db-stats-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-content: start;
}

.db-stat-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.db-stat-card .stat-num { font-size: 1.8rem; font-weight: 700; font-family: var(--mono); line-height: 1; }
.db-stat-card .stat-lbl { font-size: 0.8rem; color: var(--fg-muted); }
.db-stat-card.red    .stat-num { color: var(--red); }
.db-stat-card.yellow .stat-num { color: var(--yellow); }
.db-stat-card.green  .stat-num { color: var(--accent); }
.db-stat-card.accent .stat-num { color: var(--accent); }

/* ── TREND CHART ── */
.db-chart-card {}

.db-trend-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 120px;
  padding-top: 24px;
}

.chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}

.chart-bar-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  position: relative;
}

.chart-val {
  font-size: 0.7rem;
  font-family: var(--mono);
  color: var(--fg-dim);
  margin-bottom: 4px;
}

.chart-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: height 0.3s ease;
}

.risk-bar-critical { background: var(--red); }
.risk-bar-high     { background: var(--yellow); }
.risk-bar-medium   { background: #ff8c42; }
.risk-bar-low      { background: var(--accent); }

.chart-label {
  font-size: 0.7rem;
  color: var(--fg-dim);
  white-space: nowrap;
  font-family: var(--mono);
}

/* ── TWO-COLUMN LAYOUT ── */
.db-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

/* ── REMOVAL LIST ── */
.db-removal-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.db-removal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.db-removal-row:last-child { border-bottom: none; }

.db-removal-broker {
  display: flex;
  align-items: center;
  gap: 8px;
}

.db-removal-name {
  font-size: 0.9rem;
  font-weight: 500;
}

.db-removal-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

.status-pending    { background: rgba(144,144,168,0.12); color: var(--fg-muted); }
.status-submitted  { background: rgba(255,198,77,0.12);  color: var(--yellow);   }
.status-removed    { background: rgba(0,229,160,0.12);   color: var(--accent);   }
.status-reappeared { background: rgba(255,77,106,0.12);  color: var(--red);      }

/* dot colors */
.yellow-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: var(--yellow);
  display: inline-block;
}
.grey-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: var(--fg-dim);
  display: inline-block;
}

/* ── TIMELINE ── */
.db-timeline { display: flex; flex-direction: column; gap: 0; }

.db-timeline-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.db-timeline-item:last-child { border-bottom: none; }

.timeline-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.evt-removed .timeline-dot  { background: rgba(0,229,160,0.15);  border-color: var(--accent); }
.evt-alert   .timeline-dot  { background: rgba(255,77,106,0.15); border-color: var(--red); }

.timeline-body { flex: 1; min-width: 0; }
.timeline-label { font-size: 0.875rem; color: var(--fg); line-height: 1.4; }
.timeline-date  { font-size: 0.75rem; color: var(--fg-dim); margin-top: 2px; font-family: var(--mono); }

/* ── SCAN TABLE ── */
.db-scan-table { display: flex; flex-direction: column; gap: 0; }

.db-table-head {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 12px;
  padding: 8px 0 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-dim);
}

.db-table-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
  font-size: 0.9rem;
}
.db-table-row:last-child { border-bottom: none; }

.db-tbl-date  { color: var(--fg); font-family: var(--mono); font-size: 0.85rem; }
.db-tbl-found { color: var(--red); font-weight: 600; font-family: var(--mono); }
.db-tbl-checked { color: var(--fg-muted); font-family: var(--mono); }
.db-tbl-link { font-size: 0.85rem; color: var(--accent); text-decoration: none; white-space: nowrap; }
.db-tbl-link:hover { text-decoration: underline; }

/* ── EMPTY STATE ── */
.db-empty { text-align: center; padding: 32px 0; color: var(--fg-muted); }
.db-empty-link { color: var(--accent); text-decoration: none; font-size: 0.9rem; }
.db-empty-link:hover { text-decoration: underline; }

/* ── BROKER GRID (brokers page) ── */
.db-broker-section {}

.broker-section-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.reappeared-label { color: var(--red); }
.removed-label    { color: var(--accent); }
.broker-count {
  font-size: 0.9rem;
  font-weight: 700;
  font-family: var(--mono);
}

.db-broker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.db-broker-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.status-card-reappeared { border-color: rgba(255, 77, 106, 0.3); }
.status-card-removed    { border-color: rgba(0, 229, 160, 0.2); }

.broker-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.broker-card-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.broker-card-name strong {
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.broker-data-types { gap: 4px; }
.broker-card-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--fg-dim);
  font-family: var(--mono);
  align-items: center;
}
.date-confirmed { color: var(--accent); }
.date-alert     { color: var(--red); }

/* ── STATUS TABS (brokers page) ── */
.db-status-tabs {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.db-tab {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}
.db-tab.has-alert { border-color: rgba(255,77,106,0.4); }

.tab-alert-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
}

.tab-count {
  font-size: 1.4rem;
  font-weight: 700;
  font-family: var(--mono);
  line-height: 1;
}
.reappeared-count { color: var(--red); }
.pending-count    { color: var(--fg-muted); }
.submitted-count  { color: var(--yellow); }
.removed-count    { color: var(--accent); }

.tab-label { font-size: 0.8rem; color: var(--fg-dim); }

/* ── UPGRADE PAGE ── */
.upgrade-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .db-hero-grid  { grid-template-columns: 1fr; }
  .db-two-col    { grid-template-columns: 1fr; }
  .db-score-wrap { flex-direction: column; align-items: flex-start; gap: 16px; }
  .db-nav        { gap: 2px; }
  .db-nav-link   { padding: 6px 8px; font-size: 0.8rem; }
  .db-table-head, .db-table-row {
    grid-template-columns: 1fr 1fr auto;
  }
  .db-table-head span:nth-child(3),
  .db-table-head span:nth-child(4),
  .db-table-row  span:nth-child(3),
  .db-table-row  span:nth-child(4) { display: none; }
  .db-broker-grid { grid-template-columns: 1fr; }
  .db-status-tabs { gap: 8px; }
  .db-tab { padding: 10px 14px; }
}

/* ── REMOVAL ENGINE STATUS ── */
.status-card-failed { border-color: rgba(239, 68, 68, 0.3); }

.broker-method-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  color: var(--fg-dim);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
}

.date-eta {
  font-size: 0.75rem;
  color: #f59e0b;
}

.broker-error {
  font-size: 0.72rem;
  color: #f87171;
  cursor: default;
}

.db-removal-badge.status-failed {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}
