/* ── Shared transparency hub styles (Phase 2-4) ──────────────────────── */

/* Stat bar */
.tr-stat-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 8px;
}
.tr-stat {
  background: var(--surface);
  padding: 20px 24px;
  text-align: center;
}
.tr-stat-num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 26px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}
.tr-stat-num.rr-red   { color: #c26a62; }
.tr-stat-num.rr-gold  { color: var(--gold); }
.tr-stat-num.rr-green { color: #5f9e78; }
.tr-stat-label {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
@media (max-width: 640px) { .tr-stat-bar { grid-template-columns: repeat(2, 1fr); } }

/* Filter bar */
.tr-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.tr-filter-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  font-family: inherit;
}
.tr-filter-btn:hover,
.tr-filter-btn.active {
  background: var(--gold);
  color: #0a0e1a;
  border-color: var(--gold);
  font-weight: 600;
}

/* Year picker (inline in section label) */
.tr-year-picker {
  display: inline-flex;
  gap: 4px;
  margin-left: 12px;
  vertical-align: middle;
}
.tr-year-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 3px 9px;
  border-radius: 3px;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  transition: background .12s;
}
.tr-year-btn.active,
.tr-year-btn:hover {
  background: var(--gold);
  color: #0a0e1a;
  border-color: var(--gold);
  font-weight: 600;
}

/* Source / fallback */
.tr-source-note {
  font-size: 11px;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 40px;
  margin-bottom: 48px;
  line-height: 1.7;
}
.tr-fallback-banner {
  background: color-mix(in srgb, #c26a62 15%, var(--surface) 85%);
  border: 1px solid #c26a62;
  color: #c26a62;
  padding: 10px 16px;
  border-radius: 4px;
  font-size: 12px;
  margin-bottom: 20px;
}

/* ── Phase 2: Konsulenter ───────────────────────────────────────────── */

.kons-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 8px;
}
.kons-bar-row { display: flex; flex-direction: column; gap: 4px; }
.kons-bar-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
}
.kons-bar-name  { color: var(--text); font-weight: 500; min-width: 280px; }
.kons-bar-val   { color: var(--gold); font-family: 'IBM Plex Mono', monospace; font-size: 12px; margin-left: auto; }
.kons-bar-track {
  height: 28px;
  background: color-mix(in srgb, var(--surface) 60%, #0a0b0e 40%);
  border-radius: 3px;
  overflow: hidden;
}
.kons-bar-fill {
  height: 100%;
  background: color-mix(in srgb, var(--gold) 30%, transparent 70%);
  border-radius: 3px;
  transition: width .4s ease;
  overflow: hidden;
}
.kons-bar-cats { display: flex; height: 100%; }
.kons-cat-seg[data-cat="it"]          { background: #c9a84c; opacity: .85; }
.kons-cat-seg[data-cat="management"]  { background: #5f9e78; opacity: .85; }
.kons-cat-seg[data-cat="legal"]       { background: #7a8fa6; opacity: .85; }
.kons-cat-seg[data-cat="engineering"] { background: #a07850; opacity: .85; }
.kons-cat-seg[data-cat="other"]       { background: #6a6a7a; opacity: .85; }
.kons-bar-note {
  font-size: 11px;
  color: var(--text-dim);
  padding-left: 2px;
  line-height: 1.5;
}

/* Trend chart */
.kons-trend-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 24px;
  overflow-x: auto;
}
.kons-trend-inner {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 120px;
  min-width: 500px;
}
.kons-trend-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
  cursor: pointer;
}
.kons-trend-col:hover .kons-trend-bar,
.kons-trend-col.active .kons-trend-bar { background: var(--gold); }
.kons-trend-bar {
  width: 100%;
  background: color-mix(in srgb, var(--gold) 40%, var(--border) 60%);
  border-radius: 3px 3px 0 0;
  transition: background .2s, height .4s ease;
}
.kons-trend-val  { font-size: 10px; color: var(--text-dim); font-family: 'IBM Plex Mono', monospace; }
.kons-trend-year { font-size: 11px; color: var(--text-dim); }

/* Category grid */
.kons-cat-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.kons-cat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
}
.kons-cat-swatch { width: 24px; height: 6px; border-radius: 3px; margin-bottom: 8px; }
.kons-cat-label  { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; line-height: 1.4; }
.kons-cat-pct    { font-size: 20px; font-weight: 700; color: var(--gold); font-family: 'IBM Plex Mono', monospace; }
.kons-cat-bar-wrap { height: 4px; background: var(--border); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.kons-cat-bar { height: 100%; border-radius: 2px; }
@media (max-width: 800px) { .kons-cat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .kons-bar-name { min-width: 0; } }

/* ── Phase 3: Udbud ─────────────────────────────────────────────────── */

.udbud-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.udbud-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color .2s;
}
.udbud-card:hover { border-color: var(--gold); }
.udbud-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.udbud-cpv {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: 3px 8px;
  border-radius: 3px;
}
.cpv-72 { background: color-mix(in srgb, #c9a84c 20%, var(--surface)); color: var(--gold); border: 1px solid #c9a84c; }
.cpv-79 { background: color-mix(in srgb, #5f9e78 20%, var(--surface)); color: #5f9e78;     border: 1px solid #5f9e78; }
.cpv-other { background: var(--border); color: var(--text-dim); border: 1px solid var(--border); }
.udbud-val { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--text); font-weight: 600; margin-left: auto; }
.udbud-date { font-size: 11px; color: var(--text-dim); }
.udbud-title { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.4; }
.udbud-buyer { font-size: 12px; color: var(--text-muted); }
.udbud-deadline { font-size: 11px; color: var(--text-dim); }
.udbud-card-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.udbud-cpv-code { font-size: 10px; color: var(--text-dim); font-family: 'IBM Plex Mono', monospace; }
.udbud-id       { font-size: 10px; color: var(--text-dim); margin-left: auto; }
.udbud-link {
  font-size: 11px;
  color: var(--gold);
  text-decoration: none;
  margin-left: auto;
}
.udbud-link:hover { text-decoration: underline; }

/* ── Phase 4: Rigsrevisionen ────────────────────────────────────────── */

.rr-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
}
.rr-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  transition: border-color .2s;
}
.rr-card:hover { border-color: var(--gold); }
.rr-card-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px;
  background: color-mix(in srgb, var(--surface) 80%, #0a0b0e 20%);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.rr-sev {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 3px;
  margin-top: 2px;
}
.rr-sev-kritisk    { background: color-mix(in srgb, #c26a62 20%, var(--surface)); color: #c26a62; border: 1px solid #c26a62; }
.rr-sev-alvorlig   { background: color-mix(in srgb, #c9a84c 15%, var(--surface)); color: var(--gold); border: 1px solid var(--gold); }
.rr-sev-bemærkning { background: var(--border); color: var(--text-dim); border: 1px solid var(--border); }
.rr-card-meta { flex: 1; min-width: 0; }
.rr-title    { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.rr-sub      { font-size: 11px; color: var(--text-dim); }
.rr-ministry { color: var(--gold); }
.rr-topic    { color: var(--text-muted); }
.rr-followup {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 3px;
}
.rr-followup-open    { background: color-mix(in srgb, #c26a62 15%, var(--surface)); color: #c26a62; border: 1px solid #c26a62; }
.rr-followup-ongoing { background: color-mix(in srgb, #c9a84c 15%, var(--surface)); color: var(--gold); border: 1px solid var(--gold); }
.rr-followup-closed  { background: color-mix(in srgb, #5f9e78 15%, var(--surface)); color: #5f9e78; border: 1px solid #5f9e78; }
.rr-card-body  { padding: 18px 20px; }
.rr-findings {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rr-findings li {
  font-size: 13px;
  color: var(--text-muted);
  padding-left: 16px;
  position: relative;
  line-height: 1.5;
}
.rr-findings li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--text-dim);
}
.rr-rec {
  font-size: 12px;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--surface) 60%, #0a0b0e 40%);
  border-left: 2px solid var(--gold);
  padding: 8px 12px;
  margin-bottom: 10px;
  border-radius: 0 3px 3px 0;
  line-height: 1.5;
}
.rr-rec-label { color: var(--gold); font-weight: 600; margin-right: 4px; }
.rr-followup-note {
  font-size: 11px;
  color: var(--text-dim);
  border-left: 2px solid var(--border);
  padding: 6px 10px;
  margin-bottom: 12px;
  line-height: 1.5;
}
.rr-card-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.rr-cost  { font-size: 12px; color: var(--text-dim); }
.rr-cost b { color: #c26a62; font-family: 'IBM Plex Mono', monospace; }
.rr-link {
  font-size: 12px;
  color: var(--gold);
  text-decoration: none;
  margin-left: auto;
}
.rr-link:hover { text-decoration: underline; }
