* { box-sizing: border-box; }
html, body { width: 100%; overflow-x: hidden; }
html { background: #1c2530; }
body {
    font-family: Arial, sans-serif; margin: 0; padding: 16px; color: #222;
    min-height: 100vh; background: linear-gradient(180deg, #1c2530, #33465c);
}
.container { max-width: 1100px; margin: 0 auto; }
h1 {
    text-align: center; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,0.5);
    font-size: 1.5em; margin: 24px 0 16px;
}
.nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 16px; }
.nav a {
    background: rgba(255,255,255,0.92); color: #b8541a; text-decoration: none;
    font-weight: bold; padding: 10px 18px; border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.nav a.aktiv { background: #b8541a; color: #fff; }

form.entry-form {
    background: rgba(255,255,255,0.97); border: 1px solid #ccc; border-radius: 10px;
    padding: 16px; margin-bottom: 24px; box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
form.entry-form .full { grid-column: 1 / -1; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.row3 > div { min-width: 0; }
.row4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 8px; }
.row4 > div { min-width: 0; }
label { display: block; font-size: 0.85em; font-weight: bold; margin-bottom: 5px; }
input, select, textarea {
    width: 100%; padding: 12px 10px; box-sizing: border-box;
    border: 1px solid #bbb; border-radius: 6px; font-size: 16px;
}
.checkbox-felt { display: flex; align-items: center; width: 100%; }
.checkbox-felt input[type="checkbox"] {
    position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none;
}
.checkbox-felt label {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin: 0;
    width: 100%; min-height: 46px; box-sizing: border-box;
    padding: 8px 16px; border-radius: 20px; cursor: pointer; user-select: none;
    background: #eef2f5; color: #33465c; font-size: 0.95em; font-weight: bold;
    box-shadow: inset 0 0 0 1px #d5dbe0;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.checkbox-felt label:hover { background: #e2e8ed; }
.checkbox-felt label::before {
    content: ''; flex: none; width: 18px; height: 18px; border-radius: 5px;
    background: #fff; box-shadow: inset 0 0 0 2px #b7c0c8;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; line-height: 1; color: transparent;
    transition: background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}
.checkbox-felt input[type="checkbox"]:checked + label {
    background: #1a8a5e; color: #fff; box-shadow: none;
}
.checkbox-felt input[type="checkbox"]:checked + label::before {
    content: '✓'; background: #fff; box-shadow: none; color: #1a8a5e;
}
.checkbox-felt input[type="checkbox"]:focus-visible + label {
    outline: 2px solid #1a8a5e; outline-offset: 2px;
}
button {
    grid-column: 1 / -1; padding: 16px; background: #b8541a; color: #fff;
    border: none; border-radius: 6px; font-size: 1.1em; font-weight: bold; cursor: pointer;
}
button:hover, button:active { background: #954217; }
.fejl { background: #fdd; border: 1px solid #c00; padding: 10px; border-radius: 4px; margin-bottom: 15px; }
.ok { background: #dcf5dc; border: 1px solid #4a4; padding: 10px; border-radius: 4px; margin-bottom: 15px; color: #1a6b1a; }
.syn-banner {
    padding: 10px 14px; border-radius: 8px; margin-bottom: 15px; font-weight: bold;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.syn-banner.syn-ok { background: #dcf5dc; border: 1px solid #4a4; color: #1a6b1a; }
.syn-banner.syn-snart { background: #fff3cd; border: 1px solid #e0b400; color: #8a6d00; }
.syn-banner.syn-udloebet { background: #fdd; border: 1px solid #c00; color: #a00; }
.syn-badge {
    display: inline-block; padding: 3px 8px; border-radius: 12px; margin-bottom: 8px;
    font-size: 0.7em; font-weight: bold;
}
.syn-badge.syn-ok { background: #dcf5dc; color: #1a6b1a; }
.syn-badge.syn-snart { background: #fff3cd; color: #8a6d00; }
.syn-badge.syn-udloebet { background: #fdd; color: #a00; }

.table-wrap {
    overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3); margin-bottom: 20px;
}
table { width: 100%; border-collapse: collapse; background: rgba(255,255,255,0.98); font-size: 0.85em; }
th, td { border: 1px solid #ddd; padding: 6px 8px; text-align: center; white-space: nowrap; }
thead th { background: #33465c; color: #fff; }
tbody tr:nth-child(even) { background: #f2f4f6; }
.ikke-fuld { color: #999; font-style: italic; }
.handling-celle { display: flex; gap: 8px; justify-content: center; align-items: center; white-space: nowrap; }
.handling-celle a { text-decoration: none; font-size: 1.1em; }
.handling-slet-form { display: inline; margin: 0; }
.handling-slet-form button {
    grid-column: auto; width: auto; padding: 2px 4px; background: transparent; color: inherit;
    border: none; border-radius: 4px; font-size: 1.1em; font-weight: normal; cursor: pointer;
}
.handling-slet-form button:hover { background: #fdd; }

.card {
    background: rgba(255,255,255,0.97); border: 1px solid #ccc; border-radius: 10px;
    padding: 16px; margin-bottom: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.card h2 { margin: 0 0 12px; font-size: 1.05em; color: #0b0b0b; }
.biler-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 200px)); gap: 14px; margin-bottom: 20px; }
.biler-grid .card { margin-bottom: 0; padding: 10px; min-width: 0; }
.biler-grid .card h2 { font-size: 0.95em; margin: 0 0 4px; }
.biler-grid .card p { font-size: 0.8em !important; }

.bil-knapper { display: flex; gap: 4px; flex-wrap: nowrap; margin-top: 4px; }
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 2px;
    padding: 4px 6px; border-radius: 14px; border: none; white-space: nowrap;
    font-size: 0.66em; font-weight: bold; text-decoration: none; cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.18);
    transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 3px 9px rgba(0,0,0,0.25); }
.btn:active { transform: translateY(0); box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.btn-primary { background: #1a8a5e; color: #fff; }
.btn-primary:hover { background: #157048; }
.btn-secondary { background: #eef2f5; color: #33465c; box-shadow: inset 0 0 0 1px #d5dbe0; }
.btn-secondary:hover { background: #dde3e8; }
.btn-danger { background: #fdeceb; color: #c0392b; box-shadow: inset 0 0 0 1px #f6cdc9; }
.btn-danger:hover { background: #c0392b; color: #fff; box-shadow: 0 3px 9px rgba(192,57,43,0.35); }
.bil-kort { border: 2px solid transparent; transition: border-color 0.15s, transform 0.15s; }
.bil-kort.valgt { border-color: #1a8a5e; }
.bil-billede-link { display: block; position: relative; text-decoration: none; margin-bottom: 8px; }
.bil-billede-link:hover .bil-billede { transform: scale(1.02); }
.bil-billede {
    width: 100%; height: 100px; object-fit: contain; border-radius: 6px;
    display: block; background: #e8e8e8; transition: transform 0.15s;
}
.bil-billede-pladsholder {
    display: flex; align-items: center; justify-content: center;
    font-size: 2em; color: #aaa;
}
.bil-valgt-maerke {
    position: absolute; top: 6px; right: 6px; background: rgba(26,138,94,0.92); color: #fff;
    font-size: 0.65em; font-weight: bold; padding: 3px 8px; border-radius: 20px;
}
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stats-grid .card { margin-bottom: 0; min-width: 0; }
.stat-hero-row {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px;
    margin-bottom: 20px;
}
.stat-tile {
    background: rgba(255,255,255,0.97); border-radius: 10px; padding: 14px 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3); text-align: center; color: #0b0b0b;
    min-width: 0;
}
.stat-tile .stat-label {
    font-size: 0.75em; color: #52514e; margin-bottom: 4px;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.stat-tile .stat-value { font-size: 1.6em; font-weight: bold; }
.stat-tile .stat-value .enhed { font-size: 0.5em; font-weight: normal; color: #52514e; margin-left: 2px; }
.stat-tile .stat-delta { font-size: 0.7em; margin-top: 4px; font-weight: bold; }
.stat-delta.op { color: #1a8a5e; }
.stat-delta.ned { color: #c0392b; }
.chart-empty { color: #52514e; font-size: 0.9em; }
.chart-svg { width: 100%; height: 220px; display: block; animation: chart-vaagn-op 0.4s ease-out; }
@keyframes chart-vaagn-op { from { opacity: 0; } to { opacity: 1; } }
.chart-linje { animation: chart-tegn 1.1s ease-out forwards; }
@keyframes chart-tegn { to { stroke-dashoffset: 0; } }
.chart-prik {
    transform-box: fill-box; transform-origin: center;
    animation: chart-prik-ind 0.35s ease-out backwards;
}
@keyframes chart-prik-ind { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: scale(1); } }
.chart-puls {
    transform-box: fill-box; transform-origin: center;
    animation: chart-puls 2.2s ease-out infinite;
}
@keyframes chart-puls {
    0% { transform: scale(0.7); opacity: 0.7; }
    75% { transform: scale(2.4); opacity: 0; }
    100% { transform: scale(2.4); opacity: 0; }
}

@media (max-width: 640px) {
    body { padding: 10px; }
    h1 { font-size: 1.2em; }
    .syn-banner { text-align: center; }
    form.entry-form { grid-template-columns: 1fr; padding: 14px; gap: 12px; }
    .row3 { grid-template-columns: 1fr; }
    .row4 { grid-template-columns: 1fr 1fr; }
    input, select, textarea { padding: 14px 12px; }
    button { padding: 18px; font-size: 1.15em; }
    .nav { gap: 6px; }
    .nav a { padding: 8px 12px; font-size: 0.8em; }
    .stat-hero-row { grid-template-columns: repeat(2, 1fr); }
    .stat-tile .stat-value { font-size: 1.3em; }
    .biler-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .biler-grid .card { padding: 8px; }
    .bil-billede, .bil-billede-pladsholder { height: 80px; }
}
