/* BootVerwaltung – gemeinsames Stylesheet für Web und App.
   Ziel: hoher Kontrast, große Touch-Ziele (min. 44px), mobil zuerst. */
:root {
    --blau: #0b3d66;
    --blau-dunkel: #072a47;
    --akzent: #0a7d3b;
    --rot: #b3261e;
    --orange: #a85a00;
    --grau: #5a6470;
    --hinter: #eef2f6;
    --karte: #ffffff;
    --rand: #c9d3dd;
    --text: #111a22;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 17px;
    color: var(--text);
    background: var(--hinter);
}

a { color: var(--blau); }
h1 { font-size: 1.6rem; margin: .4rem 0 .8rem; }
h2 { font-size: 1.2rem; margin: 0 0 .6rem; }
h1:focus { outline: none; }
code { background: #e3e9ef; padding: 0 .3em; border-radius: 4px; }

/* ---------- Layout ---------- */
.status-bar-safe-area { height: env(safe-area-inset-top); background: var(--blau-dunkel); }
.kopf {
    position: sticky; top: 0; z-index: 1000;
    background: var(--blau-dunkel); color: #fff;
    display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1rem;
    padding: .4rem .8rem;
    box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.marke { color: #fff; font-weight: 700; font-size: 1.15rem; text-decoration: none; padding: .5rem 0; }
.hauptnav { display: flex; gap: .25rem; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.hauptnav a {
    color: #fff; text-decoration: none; white-space: nowrap;
    padding: .65rem .9rem; border-radius: 8px; min-height: 44px; display: flex; align-items: center;
}
.hauptnav a:hover { background: rgba(255,255,255,.15); }
.hauptnav a.active { background: #fff; color: var(--blau-dunkel); font-weight: 700; }

.inhalt { max-width: 1100px; margin: 0 auto; padding: 1rem .8rem 4rem; }

/* ---------- Bausteine ---------- */
.karte {
    background: var(--karte); border: 1px solid var(--rand); border-radius: 12px;
    padding: 1rem; margin-bottom: 1rem;
}
.zeile-kopf { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.grau { color: var(--grau); }
.laden { color: var(--grau); font-style: italic; }
.rechts { margin-left: auto; }
.versteckt { display: none; }
.brotkrumen { margin: 0; }
.notizen { white-space: pre-wrap; background: #f6f8fa; border-left: 4px solid var(--blau); padding: .6rem .8rem; border-radius: 4px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .3rem;
    min-height: 44px; padding: .5rem 1rem;
    border: 2px solid var(--blau); border-radius: 8px;
    background: #fff; color: var(--blau); font: inherit; font-weight: 600;
    text-decoration: none; cursor: pointer; user-select: none;
}
.btn:hover { background: #e6eef6; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primaer { background: var(--akzent); border-color: var(--akzent); color: #fff; }
.btn.primaer:hover { background: #086530; }
.btn.gefahr { background: #fff; border-color: var(--rot); color: var(--rot); }
.btn.gefahr:hover { background: var(--rot); color: #fff; }
.btn.aktiv { background: var(--blau); color: #fff; }
.btn.klein { min-height: 40px; padding: .3rem .7rem; font-size: .9rem; }
.knopfleiste { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; align-items: center; }
.filter { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }

.badge {
    display: inline-block; padding: .15rem .55rem; border-radius: 999px;
    font-size: .85rem; font-weight: 700; white-space: nowrap; vertical-align: middle;
}
.status-offen { background: var(--rot); color: #fff; }
.status-inarbeit { background: var(--orange); color: #fff; }
.status-erledigt { background: var(--akzent); color: #fff; }
.badge.neutral { background: #dde4eb; color: var(--text); }
.badges { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .3rem; }

.meldung { padding: .8rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-weight: 600; }
.meldung.fehler { background: #fde7e6; color: #7a1610; border: 2px solid var(--rot); }
.meldung.info { background: #e3f4ea; color: #064d24; border: 2px solid var(--akzent); }

/* ---------- Listen ---------- */
.liste { list-style: none; margin: 0; padding: 0; }
.liste > li { border-bottom: 1px solid var(--rand); }
.liste > li:last-child { border-bottom: none; }
.liste > li > a {
    display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem;
    padding: .75rem .3rem; min-height: 48px; color: var(--text); text-decoration: none;
}
.liste > li > a:hover { background: #f1f5f9; }
ul.karte { padding: .2rem 1rem; }

.dok-zeile { display: flex; align-items: center; gap: .7rem; padding: .7rem .2rem; flex-wrap: wrap; }
.dok-icon { font-size: 1.6rem; }
.dok-text { flex: 1 1 220px; display: flex; flex-direction: column; gap: .15rem; }
.dok-text a { color: var(--text); }
.dok-aktionen { display: flex; gap: .4rem; flex-wrap: wrap; }

/* ---------- Dashboard ---------- */
.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.kachel {
    background: var(--blau); color: #fff; border-radius: 12px; padding: 1rem;
    display: flex; flex-direction: column; text-decoration: none; min-height: 100px;
}
.kachel .zahl { font-size: 2.2rem; font-weight: 800; line-height: 1.1; }
.kachel .zahl.klein { font-size: 1.4rem; }
.kachel.warn { background: var(--rot); }
.kachel.info { background: var(--orange); }
.kachel.alarm { background: #6b0f0a; }
.kachel.neutral { background: #33414f; }

/* ---------- Boote ---------- */
.suche { width: 100%; min-height: 48px; font: inherit; padding: .5rem .8rem; border: 2px solid var(--rand); border-radius: 8px; margin-bottom: 1rem; }
.boot-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.boot-karte {
    background: #fff; border: 1px solid var(--rand); border-radius: 12px; overflow: hidden;
    color: var(--text); text-decoration: none; display: flex; flex-direction: column;
}
.boot-karte:hover { box-shadow: 0 3px 10px rgba(0,0,0,.15); }
.boot-karte img, .bild-platzhalter { width: 100%; height: 160px; object-fit: cover; background: #d7e2ec; }
.bild-platzhalter { display: flex; align-items: center; justify-content: center; font-size: 3.5rem; }
.boot-karte-text { padding: .8rem; display: flex; flex-direction: column; gap: .15rem; }

.boot-kopf { display: flex; flex-wrap: wrap; gap: 1rem; }
.titelbild { width: 320px; max-width: 100%; border-radius: 10px; object-fit: cover; }
.titelbild-vorschau { max-width: 260px; max-height: 200px; border-radius: 8px; display: block; margin-bottom: .5rem; }
.stammdaten { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; flex: 1 1 260px; }
.stammdaten dt { color: var(--grau); font-weight: 600; }
.stammdaten dd { margin: 0; }
.boot-kopf .notizen { flex-basis: 100%; }

/* ---------- Formulare ---------- */
.formular { display: flex; flex-direction: column; gap: .8rem; }
.formular label { display: flex; flex-direction: column; gap: .25rem; font-weight: 600; }
.formular label.btn { flex-direction: row; }
.formular label.check { flex-direction: row; align-items: center; gap: .5rem; }
.formular input:not([type=checkbox]):not([type=file]), .formular select, .formular textarea,
.unterformular input, .unterformular select {
    font: inherit; font-weight: 400; min-height: 46px; padding: .45rem .7rem;
    border: 2px solid var(--rand); border-radius: 8px; background: #fff; color: var(--text); width: 100%;
}
.formular input:focus, .formular select:focus, .formular textarea:focus { border-color: var(--blau); outline: none; }
.formular input[type=checkbox] { width: 24px; height: 24px; }
.zwei-spalten { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .8rem; }
.unterformular { background: #f4f7fa; border: 1px dashed var(--rand); border-radius: 10px; padding: .8rem; margin-bottom: 1rem; }
.titelbild-bereich { border: 1px solid var(--rand); border-radius: 10px; padding: .8rem; }
.valid.modified:not([type=checkbox]) { border-color: #26b050 !important; }
.invalid { border-color: var(--rot) !important; }
.validation-message, .validation-errors { color: var(--rot); font-weight: 600; }

/* ---------- Galerie / Lightbox ---------- */
.galerie { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .5rem; margin-top: .8rem; }
.galerie-bild { padding: 0; border: 2px solid var(--rand); border-radius: 8px; overflow: hidden; cursor: pointer; aspect-ratio: 1; background: #ddd; }
.galerie-bild img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lightbox {
    position: fixed; inset: 0; z-index: 99999; background: rgba(0,0,0,.92);
    display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1rem;
}
.lightbox img { max-width: 100%; max-height: calc(100vh - 140px); object-fit: contain; }
.lightbox-leiste { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: center; margin-top: .8rem; color: #fff; }

/* ---------- Dialog ---------- */
.dialog-hintergrund { position: fixed; inset: 0; z-index: 99990; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.dialog { background: #fff; border-radius: 12px; padding: 1.2rem; max-width: 480px; width: 100%; }

/* ---------- Blazor-Fehleranzeige ---------- */
#blazor-error-ui {
    background: #fde7e6; color: #7a1610; border-top: 3px solid var(--rot);
    bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2); display: none; left: 0;
    padding: .8rem 1.25rem; position: fixed; width: 100%; z-index: 100000; font-weight: 600;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; font-size: 1.3rem; }

@media (max-width: 600px) {
    html, body { font-size: 16px; }
    .inhalt { padding: .7rem .5rem 4rem; }
    .stammdaten { grid-template-columns: 1fr; }
    .stammdaten dd { margin-bottom: .4rem; }
}
