/* =====================================================
   REPORT TABLE – CONTAINER & SPACING
   ===================================================== */

.guardian-report-table {
  overflow-x: hidden;
  margin-bottom: 28px;
}

/* Luft mellem 1.1 og 1.2 */
.guardian-report-table + .guardian-report-table {
  margin-top: 32px;
}


/* =====================================================
   TABLE BASICS
   ===================================================== */

.guardian-std-table th,
.guardian-std-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  overflow: visible;
}


/* =====================================================
   ROW TYPES
   ===================================================== */

/* Del-totaler (fx Bruttoformue, Skat) */
.guardian-row-subtotal td {
  font-weight: 600;
  background: rgba(201,168,76,0.07);
  border-top: 1px solid var(--border);
}

/* 🔴 OBS: legacy – må ikke vinde over highlight */
.guardian-row-final {
  background: transparent;
  border-top: none;
}


/* =====================================================
   INFO TOOLTIP
   ===================================================== */

.guardian-info {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(201,168,76,0.12);
  color: #C9A84C;
  font-size: 11px;
  font-weight: 600;
  cursor: help;
}

.guardian-info:hover .guardian-tooltip,
.guardian-info:focus .guardian-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.guardian-tooltip {
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);

  width: max-content;
  max-width: 320px;
  padding: 8px 10px;
  border-radius: 8px;

  background: #111;
  color: #fff;

  font-size: 12px;
  line-height: 1.4;

  white-space: normal;
  overflow-wrap: break-word;

  opacity: 0;
  pointer-events: none;
  z-index: 1000;
}


/* =====================================================
   TABLE HEADER
   ===================================================== */

.guardian-table-head {
  margin-bottom: 6px;
}

.guardian-table-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
}

.guardian-table-meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 2px;
}


/* =====================================================
   SECTION HEADER ROWS (underoverskrifter i tabeller)
   ===================================================== */

.guardian-row-section-header td {
  font-size: 0.70rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
  padding: 12px 8px 3px;
  border-bottom: none;
  background: transparent;
}

/* Første sektionsoverskrift: ingen ekstra top-padding */
.guardian-row-section-header:first-child td {
  padding-top: 4px;
}


/* =====================================================
   COLLAPSIBLE ROWS
   ===================================================== */

.guardian-std-table tr.collapsible {
  cursor: pointer;
}

.guardian-std-table tr.collapsible:hover {
  background: rgba(255,255,255,0.04);
}


/* =====================================================
   HIGHLIGHT / TOTAL ZONES (ÉN VISUEL SANDHED)
   ===================================================== */

/* Hele den grønne zone */
.guardian-row-highlight {
  background: rgba(201,168,76,0.09);
  font-weight: 600;
}

/* Total-rækken i zonen */
.guardian-row-highlight-end,
.guardian-row-total {
  font-weight: 600;
  background: rgba(201,168,76,0.09);
}


/* =====================================================
   SAFETY: INTET MÅ OVERRIDE TOTAL-HIGHLIGHT
   ===================================================== */

/* =====================================================
   Narrative / Indsigter (1.4)
===================================================== */

.guardian-narrative {
  margin-top: 12px;
  padding: 14px 16px;
  background: var(--surface-2, #1a2436);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.guardian-narrative h3 {
  margin: 0 0 4px 0;
  font-size: 15px;
  font-weight: 600;
}

.guardian-narrative-sub {
  margin-bottom: 10px;
  font-size: 12px;
}

.guardian-narrative-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.guardian-narrative-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid #e9efec;
}

.guardian-narrative-list li:first-child {
  border-top: none;
}

.narrative-dot {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: #C9A84C;
  flex-shrink: 0;
}

.narrative-text {
  font-size: 13px;
  line-height: 1.45;
}

/* Toggle-box content: lad narrative boksen styre looket */
.guardian-toggle-box__content {
  margin-top: 10px;
}

/* Sektion-heading inde i forklaringen */
.guardian-toggle-narrative__heading {
  margin: 12px 0 6px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

/* Spacer når du har "—" i lines[] */
.guardian-toggle-narrative__spacer {
  height: 6px;
}

/* Optional: gør summary mere “diskret link” */
.guardian-toggle-box__summary {
  font-size: 13px;
  color: var(--muted-text, #667085);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
}

.guardian-toggle-box__summary::-webkit-details-marker { display: none; }
.guardian-toggle-box__summary::marker { content: ""; }

.guardian-toggle-box__summary::before {
  content: "▸";
  font-size: 12px;
  transition: transform 0.15s ease;
}

.guardian-toggle-box[open] .guardian-toggle-box__summary::before {
  transform: rotate(90deg);
}

.guardian-toggle-narrative__section + .guardian-toggle-narrative__section {
  margin-top: 10px;
}

.guardian-toggle-narrative__heading {
  margin: 0 0 6px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

/* Hvis en sektion starter uden heading, så fjern ekstra top-luft */
.guardian-toggle-narrative__section:first-child .guardian-toggle-narrative__heading {
  margin-top: 0;
}


/* =====================================================
   PERIOD RANGE SELECTOR (BRUGES I 2.1 OG 2.2)
   ===================================================== */

.report-period-range__controls{
  display:flex;
  gap:10px;
  align-items:flex-end;
  flex-wrap:wrap;
  margin-bottom: 10px;
}

.report-period-range__field{
  display:grid;
  gap:6px;
}

.report-period-range__input{
  width:130px;
  padding:8px 10px;
  border-radius:10px;
  border:1px solid rgba(0,0,0,0.12);
  background: var(--surface-2, #1a2436);
}

.report-period-range__btn{
  padding:8px 12px;
  border-radius:10px;
  border:1px solid rgba(0,0,0,0.12);
  background:#fff;
  cursor:pointer;
}


/* =====================================================
   PERIOD RANGE SELECTOR – MATCH TABLE DENSITY
   ===================================================== */

.report-period-range {
  margin: 8px 0 12px;
}

/* Læg den lidt mere “table-like” */
.report-period-range .guardian-table-head {
  margin-bottom: 6px;
}

.report-period-range__controls {
  display: grid;
  grid-template-columns: 220px 220px auto;
  gap: 10px;
  align-items: end;
}

@media (max-width: 720px) {
  .report-period-range__controls {
    grid-template-columns: 1fr;
  }
}

/* Labels mindre */
.report-period-range__field {
  display: grid;
  gap: 4px;
}

.report-period-range__field .muted {
  font-size: 0.75rem; /* matcher meta */
}

/* Inputs: samme “tætte” typografi som tabel */
.report-period-range__input {
  width: 100%;
  height: 32px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2, #1a2436);

  font-size: 0.82rem;     /* matcher .guardian-std-table td */
  line-height: 1;
}

/* Actions: små knapper, tættere på bord-layout */
.report-period-range__actions {
  display: inline-flex;
  gap: 8px;
  justify-content: flex-start; /* så de “sidder” ved felterne */
  align-items: center;
  white-space: nowrap;
}

/* Base button */
.report-period-range__btn {
  height: 32px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 0.82rem;    /* samme som tabel */
  font-weight: 600;
  cursor: pointer;
}

/* Primary: match din grøn, men mindre “tung” */
.report-period-range__btn--apply {
  background: #C9A84C;
  color: #0D1420;
  border-color: transparent;
}

/* Secondary: diskret */
.report-period-range__btn--reset {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
}

/* Hover (diskret) */
.report-period-range__btn:hover {
  filter: brightness(0.98);
}

/* =====================================================
   TABLE SCROLL CONTAINER
   ===================================================== */
.guardian-table-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
}

.guardian-table-scroll .guardian-std-table { min-width: 820px; }

/* undtagelser */
.guardian-report-table.table-bridge .guardian-table-scroll .guardian-std-table{
  min-width: 0;
}
