/* Stilar för rapport.html — TB-rapport-tabell i A4 landscape. */

.rapport-tabell {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.rapport-tabell thead th {
  background: #f5f5f4;
  color: #44403c;
  font-weight: 600;
  text-align: right;
  padding: 0.5rem 0.625rem;
  border-bottom: 1px solid #e7e5e4;
  position: sticky;
  top: 0;
  white-space: nowrap;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.rapport-tabell thead th:first-child {
  text-align: left;
  min-width: 200px;
}

.rapport-tabell tbody td {
  padding: 0.375rem 0.625rem;
  border-top: 1px solid #f5f5f4;
  text-align: right;
  white-space: nowrap;
}

.rapport-tabell tbody td:first-child {
  text-align: left;
  font-weight: 500;
}

.rapport-tabell tbody tr:hover {
  background: #fafaf9;
}

/* Summa-rader: TB1, TB2, Res före boksl disp */
.rapport-tabell tbody tr.summa-rad {
  background: #fef3e8;
  font-weight: 600;
  border-top: 2px solid #fde1c2;
}

.rapport-tabell tbody tr.summa-rad td:first-child {
  color: #C5601A;
}

/* Negativa belopp i röd */
.belopp-negativ {
  color: #b91c1c;
}

/* KPI-section */
.rapport-tabell tbody tr.kpi-rad {
  background: #f5f5f4;
}

.rapport-tabell tbody tr.kpi-rad td:first-child {
  font-weight: 500;
  color: #57534e;
}

.rapport-tabell tbody tr.kpi-header td {
  background: #44403c;
  color: white;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  padding: 0.5rem 0.625rem;
}

/* KPI-mål: värde inom intervall = grön, utanför = röd */
.kpi-i-mal { color: #15803d; }
.kpi-ej-mal { color: #b91c1c; }

/* Sektionsindelare (Omkostnader-grupp etc) */
.rapport-tabell tbody tr.section-rad td {
  background: #fafaf9;
  font-style: italic;
  color: #78716c;
  font-size: 0.75rem;
  padding: 0.5rem 0.625rem;
  border-top: 1px solid #e7e5e4;
}

/* Sammanfattningsbox överst */
#rapport-meta strong {
  color: #1c1917;
  margin-right: 0.25rem;
}

/* Flagga-stilar */
.flagga {
  border-left: 4px solid;
  padding: 0.625rem 0.875rem;
  border-radius: 0 0.375rem 0.375rem 0;
  font-size: 0.875rem;
}
.flagga-info {
  background: #eff6ff;
  border-left-color: #3b82f6;
  color: #1e3a8a;
}
.flagga-warn {
  background: #fef3c7;
  border-left-color: #f59e0b;
  color: #78350f;
}
.flagga-kritisk {
  background: #fee2e2;
  border-left-color: #dc2626;
  color: #7f1d1d;
}
.flagga .flagga-typ {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 0.5rem;
  opacity: 0.7;
}

/* Print = A4 landscape — matchar mall-PDF */
@media print {
  @page {
    size: A4 landscape;
    margin: 1cm;
  }
  body { background: white; }
  header { display: none; }
  footer { display: none; }
  main { padding: 0; max-width: none; }
  #demo-banner {
    position: static;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  #rapport-info { display: none; }
  .rapport-tabell {
    font-size: 0.7rem;
  }
  .rapport-tabell tbody td {
    padding: 0.2rem 0.4rem;
  }
  .demo-watermark::before {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
