* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    background: white;
    padding: 40px 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 2.5em;
}

.subtitle {
    color: #666;
    font-size: 1.1em;
}

.header-links {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
    flex-wrap: wrap;
}

.header-link {
    display: inline-block;
    padding: 10px 24px;
    background: linear-gradient(135deg, #0052a3 0%, #0097a7 100%);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.95em;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 82, 163, 0.2);
}

.header-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 82, 163, 0.4);
    background: linear-gradient(135deg, #0097a7 0%, #0052a3 100%);
}

.header-link:active {
    transform: translateY(0);
}

.filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.filter-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.filter-section label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1em;
}

select {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    transition: border-color 0.3s;
    background: white;
}

select:hover,
select:focus {
    border-color: #0052a3;
    outline: none;
}

.search-box {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    grid-column: 1 / -1;
}

.search-box input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.search-box input:focus {
    border-color: #667eea;
    outline: none;
}

.results-info {
    background: white;
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-weight: 600;
    color: #0052a3;
}

.spare-proposal-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.spare-proposal-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s;
    cursor: pointer;
}

.spare-proposal-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.card-header {
    background: linear-gradient(135deg, #0052a3 0%, #0097a7 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.card-number {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
}

.card-title {
    font-size: 1.4em;
    font-weight: 700;
    margin-bottom: 10px;
    flex: 1;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.tag {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.85em;
    display: inline-block;
}

.card-content {
    padding: 20px;
}

.info-row {
    display: grid;
    grid-template-columns: 150px 1fr;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.info-row:last-of-type {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: #0052a3;
}

.info-value {
    color: #555;
    margin-left: 20px;
}

.economic-table {
    margin: 20px 0;
    overflow-x: auto;
}

.economic-table table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #ddd;
}

.economic-table th,
.economic-table td {
    padding: 10px 12px;
    text-align: right;
    border: 1px solid #ddd;
}

.economic-table th {
    background: #f5f5f5;
    font-weight: 600;
    color: #333;
}

.economic-table tr:nth-child(odd) {
    background: #fafafa;
}

.economic-table td:first-child {
    text-align: left;
}

.sagsfremstilling {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

.sagsfremstilling h4 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.05em;
}

.sagsfremstilling-content {
    color: #666;
    line-height: 1.8;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.no-results {
    background: white;
    padding: 40px;
    border-radius: 8px;
    text-align: center;
    color: #999;
    font-size: 1.1em;
}

.hidden {
    display: none;
}

@media (max-width: 768px) {
    .filters {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 1.8em;
    }

    .card-header {
        flex-direction: column;
    }

    .card-number {
        align-self: flex-start;
    }

    .info-row {
        grid-template-columns: 1fr;
    }

    .info-value {
        margin-left: 0;
        margin-top: 5px;
    }
}

.loading {
    text-align: center;
    padding: 40px;
    color: white;
    font-size: 1.2em;
}

.dashboard {
    background: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.statistics-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.statistics-section h2 {
    color: #0052a3;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.statistics-help {
    color: #666;
    font-size: 0.95em;
    margin-bottom: 15px;
    font-style: italic;
}

.clear-filter-btn {
    margin-top: 15px;
    padding: 8px 16px;
    background: #0052a3;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s;
}

.clear-filter-btn:hover {
    background: #003d7a;
}

.statistics-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #ddd;
}

.statistics-table th,
.statistics-table td {
    padding: 15px;
    text-align: center;
    border: 1px solid #ddd;
}

.statistics-table th {
    background: linear-gradient(135deg, #0052a3 0%, #0097a7 100%);
    color: white;
    font-weight: 600;
}

.statistics-table td:first-child {
    text-align: left;
    font-weight: 500;
    background: #f9f9f9;
}

.statistics-table tbody tr:nth-child(odd) {
    background: #fafafa;
}

.statistics-table tbody tr:hover {
    background: #f0f4f8;
}

.subpage-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.subpage-meta {
    color: #666;
    font-size: 0.95em;
    margin-bottom: 15px;
}

.subpage-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

.subpage-controls label {
    font-weight: 600;
    color: #333;
}

.subpage-controls select {
    width: auto;
    min-width: 240px;
}

.sort-note {
    color: #666;
    font-size: 0.9em;
}

.table-wrap {
    overflow-x: auto;
}

.chart-section {
    margin: 18px 0 22px;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f7f9fc;
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.chart-header h2 {
    font-size: 1.2em;
    color: #1f3b57;
}

.chart-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-controls label {
    font-weight: 600;
    color: #333;
}

.chart-controls select {
    width: auto;
}

.chart-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    color: #4b5563;
    font-size: 0.9em;
    margin-bottom: 12px;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legend-swatch {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    display: inline-block;
}

.swatch-2025-csv {
    background: #0d7aa1;
}

.swatch-2026-csv {
    background: #219ebc;
}

.swatch-2026-json {
    background: #23a891;
}

.swatch-2027-json {
    background: #2a9d8f;
}

.legend-note {
    font-style: italic;
}

.bar-2026 {
    background: #219ebc;
}

.bar-2025-csv {
    background: #0d7aa1;
}

.bar-2026-csv {
    background: #219ebc;
}

.bar-2026-json {
    background: #23a891;
}

.bar-2027-json {
    background: #2a9d8f;
}

.distribution-chart {
    display: block;
}

.distribution-columns {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: stretch;
}

.distribution-y-axis {
    display: none;
}

.distribution-tick {
    transform: none;
}

.distribution-plot {
    position: relative;
    min-height: 260px;
    padding-top: 2px;
    padding-bottom: 2px;
}

.distribution-grid {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(
        to bottom,
        rgba(148, 163, 184, 0.35) 0,
        rgba(148, 163, 184, 0.35) 1px,
        transparent 1px,
        transparent 20%
    );
    background-size: 100% 20%;
    pointer-events: none;
}

.distribution-columns-row {
    position: relative;
    display: grid;
    grid-template-columns: repeat(6, minmax(120px, 1fr));
    gap: 14px;
    height: 100%;
    align-items: end;
}

.distribution-column {
    display: grid;
    grid-template-rows: 1fr auto auto;
    gap: 8px;
    height: 100%;
}

.distribution-column-bars {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    align-items: end;
    height: 100%;
}

.distribution-column-bar {
    width: 100%;
    border-radius: 6px 6px 0 0;
    min-height: 4px;
}

.distribution-column-label {
    font-weight: 600;
    color: #1f3b57;
    font-size: 0.85em;
    text-align: center;
}

.distribution-column-values {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    text-align: center;
    font-size: 0.8em;
    color: #374151;
    line-height: 1.3;
}

.distribution-column-value {
    font-variant-numeric: tabular-nums;
}

@media (max-width: 900px) {
    .distribution-columns-row {
        grid-template-columns: repeat(3, minmax(120px, 1fr));
    }

    .distribution-plot {
        min-height: 220px;
    }
}

@media (max-width: 600px) {
    .distribution-plot {
        min-height: 200px;
        overflow-x: auto;
    }

    .distribution-columns-row {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
        min-width: 320px;
    }

    .distribution-column-label {
        font-size: 0.8em;
    }

    .distribution-column-values {
        font-size: 0.75em;
    }
}



.chart-empty {
    color: #6b7280;
    font-style: italic;
}

.subpage-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #ddd;
}

.subpage-table th,
.subpage-table td {
    padding: 12px 14px;
    border: 1px solid #ddd;
    text-align: left;
}

.subpage-table th {
    background: linear-gradient(135deg, #0052a3 0%, #0097a7 100%);
    color: white;
    font-weight: 600;
}

.subpage-table tbody tr:nth-child(odd) {
    background: #fafafa;
}

.subpage-table td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.subpage-table tr.group-row {
    background: #eef3f8;
    font-weight: 600;
}

.subpage-table tr.grand-total-row {
    background: #dfeaf6;
    font-weight: 700;
}

.loading-cell {
    text-align: center;
    color: #666;
    padding: 24px 12px;
}

.statistics-table tbody td:not(:first-child) {
    cursor: pointer;
    transition: background-color 0.2s;
}

.statistics-table tbody td:not(:first-child):hover {
    background: #e3f2fd !important;
    font-weight: 600;
}

.zero-cases {
    color: #d4af37;
    font-weight: 600;
    cursor: default !important;
}

.zero-cases:hover {
    background: inherit !important;
}

