body {
    font: 16px system-ui, sans-serif;
    margin: 0;
    color: #222;
    background: #fafafa;
}

header {
    background: #222;
    color: #fff;
    padding: .7em 1em;
    display: flex;
    gap: 1em;
    flex-wrap: wrap;
}
header a    { color: #fff; }
header span { margin-left: auto; }

main {
    max-width: 900px;
    margin: auto;
    padding: 1em;
}

table { border-collapse: collapse; width: 100%; }
td, th {
    padding: .4em;
    border-bottom: 1px solid #ddd;
    text-align: left;
}

label { display: block; margin: .6em 0; }
input, select, textarea {
    width: 100%;
    padding: .4em;
    box-sizing: border-box;
}
fieldset { border: 0; padding: 0; }

button, .btn {
    background: #2a5db0;
    color: #fff;
    border: 0;
    padding: .5em 1em;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}
.danger { background: #b3261e; }

.msg {
    background: #e8f3e8;
    padding: .6em;
    word-break: break-all;
}

.row { display: flex; gap: 1em; }
.row label { flex: 1; }

form.inline { display: flex; gap: .4em; }
form.inline select { width: auto; }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1em;
}
.grid > * {
    background: #fff;
    border: 1px solid #ddd;
    padding: .5em;
    color: inherit;
    text-decoration: none;
}
.grid img {
    width: 100%;
    height: 150px;
    object-fit: contain;
    background: #000;
}
.grid form { margin-top: .3em; }

/* Advarsel om ikke-gemte ændringer (se guard.js) */
.unsaved {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f5a623;
    color: #222;
    padding: .6em 1em;
    text-align: center;
    font-weight: 600;
    z-index: 10;
    pointer-events: none; /* kan aldrig blokere et klik på knapper nedenunder */
}
body.has-unsaved { padding-bottom: 4em; }
form.dirty button:not(.danger) { outline: 3px solid #f5a623; }

/* Værker med manglende data (oversigten) */
.grid > a.incomplete { border-color: #d97706; }
.warn {
    display: inline-block;
    margin-top: .4em;
    padding: .15em .5em;
    background: #fff3cd;
    color: #8a4b00;
    border-radius: 3px;
    font-size: .8em;
}
.warn-text { color: #8a4b00; }

/* Billedfremviser (se lightbox.js) */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
}
.lightbox[hidden] { display: none; }
.lightbox img {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
}
.lightbox button {
    position: absolute;
    background: rgba(255, 255, 255, .2);
    font-size: 1.4em;
    padding: .4em .7em;
}
.lb-close { top: .5em; right: .5em; }
.lb-prev  { left: .5em; top: 50%; }
.lb-next  { right: .5em; top: 50%; }
.lightbox.single .lb-prev, .lightbox.single .lb-next { display: none; }

/* Filtre i værkoversigten */
.filters { display: flex; gap: 1em; flex-wrap: wrap; align-items: end; }
.filters label { margin: 0; flex: 1; min-width: 140px; }
form.inline input { width: auto; flex: 1; }
