/* Eigene Anpassungen für die HvO Einsatzprotokolle (ergänzt styles.css aus SB Admin Pro, übernommen aus dem HvO Dienstplan) */
/* Farben nach Styleguide Feuerwehr Ilvesheim: Hintergrund Dunkelgrau #242431
   (nur auf der Login-Seite als Seiten-Hintergrund verwendet, siehe .bg-brand-dark),
   Akzentfarbe Rot #FF1619 (als Bootstrap-Primärfarbe in styles.css hinterlegt),
   außerdem Beige #C3A36B und Neongelb #FAF825 (nur für "heute"/Hervorhebungen),
   Weiß/Schwarz. */

:root {
    --brand-beige: #C3A36B;
    --brand-yellow: #FAF825;
    --brand-dark: #242431;
    --brand-red: #FF1619;
}

/* Nur für die Login-Seite (dort explizit als Klasse gesetzt) - alle anderen Seiten
   behalten den hellen Standard-Seitenhintergrund des Themes bei. */
.bg-brand-dark {
    background-color: var(--brand-dark) !important;
}

/* --- Hausschrift: Roboto FWI (ersetzt das Theme-Standardfont "Metropolis") -
   Lokal eingebunden (woff2 mit ttf-Fallback), keine externe Schriftart-CDN nötig. */

@font-face {
    font-family: "Roboto FWI";
    src: url("../fonts/roboto/Roboto-Thin.woff2") format("woff2"),
         url("../fonts/roboto/Roboto-Thin.ttf") format("truetype");
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Roboto FWI";
    src: url("../fonts/roboto/Roboto-ThinItalic.woff2") format("woff2"),
         url("../fonts/roboto/Roboto-ThinItalic.ttf") format("truetype");
    font-weight: 100;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: "Roboto FWI";
    src: url("../fonts/roboto/Roboto-Light.woff2") format("woff2"),
         url("../fonts/roboto/Roboto-Light.ttf") format("truetype");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Roboto FWI";
    src: url("../fonts/roboto/Roboto-LightItalic.woff2") format("woff2"),
         url("../fonts/roboto/Roboto-LightItalic.ttf") format("truetype");
    font-weight: 300;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: "Roboto FWI";
    src: url("../fonts/roboto/Roboto-Regular.woff2") format("woff2"),
         url("../fonts/roboto/Roboto-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Roboto FWI";
    src: url("../fonts/roboto/Roboto-Italic.woff2") format("woff2"),
         url("../fonts/roboto/Roboto-Italic.ttf") format("truetype");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: "Roboto FWI";
    src: url("../fonts/roboto/Roboto-Medium.woff2") format("woff2"),
         url("../fonts/roboto/Roboto-Medium.ttf") format("truetype");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Roboto FWI";
    src: url("../fonts/roboto/Roboto-MediumItalic.woff2") format("woff2"),
         url("../fonts/roboto/Roboto-MediumItalic.ttf") format("truetype");
    font-weight: 500;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: "Roboto FWI";
    src: url("../fonts/roboto/Roboto-Bold.woff2") format("woff2"),
         url("../fonts/roboto/Roboto-Bold.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Roboto FWI";
    src: url("../fonts/roboto/Roboto-BoldItalic.woff2") format("woff2"),
         url("../fonts/roboto/Roboto-BoldItalic.ttf") format("truetype");
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: "Roboto FWI";
    src: url("../fonts/roboto/Roboto-Black.woff2") format("woff2"),
         url("../fonts/roboto/Roboto-Black.ttf") format("truetype");
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Roboto FWI";
    src: url("../fonts/roboto/Roboto-BlackItalic.woff2") format("woff2"),
         url("../fonts/roboto/Roboto-BlackItalic.ttf") format("truetype");
    font-weight: 900;
    font-style: italic;
    font-display: swap;
}

:root {
    --bs-body-font-family: "Roboto FWI", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

body,
.btn,
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.tooltip, .popover {
    font-family: "Roboto FWI", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji" !important;
}

/* --- Marke: Logo & Topnav ------------------------------------------------- */

.navbar-brand-logo {
    height: 44px;
    width: auto;
    display: block;
    max-width: 100%;
}

/* Höhere Spezifität als die Theme-Regel ".topnav .navbar-brand img" (SB Admin Pro),
   damit die größere Logo-Höhe im Topnav tatsächlich greift. */
.topnav .navbar-brand img.navbar-brand-logo {
    height: 44px;
}

.topnav {
    border-bottom: 3px solid var(--brand-red);
}

/* --- Marke: dunkle Seitenleiste in der Hausfarbe Dunkelgrau --------------- */

.sidenav-dark {
    background-color: var(--brand-dark) !important;
}

.sidenav-dark .sidenav-menu .nav-link.active,
.sidenav-dark .sidenav-menu .nav-link:hover {
    background-color: rgba(255, 22, 25, 0.18);
    border-left: 3px solid var(--brand-red);
    padding-left: calc(1.5rem - 3px);
}

.sidenav-dark .sidenav-footer {
    background-color: rgba(0, 0, 0, 0.35) !important;
}

/* --- Marke: Neongelb für "heute" / Hervorhebungen (unabhängig von der
   Akzentfarbe, war schon vor Version 7 so) -------------------------------- */

.bg-brand-yellow-soft {
    background-color: rgba(250, 248, 37, 0.35) !important;
}

.badge-brand-yellow {
    background-color: var(--brand-yellow);
    color: #242431;
}

/* =====================================================================
   Einsatzprotokoll
   ===================================================================== */

.fw-500 {
    font-weight: 500;
}

/* Übersicht: ganze Zeile anklickbar */
.protokoll-table tbody tr.protokoll-row {
    cursor: pointer;
}

/* Status-Badges (offen / abgeschlossen) */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 500;
}
.status-badge svg {
    width: 0.8rem;
    height: 0.8rem;
}
.status-open {
    background-color: rgba(250, 248, 37, 0.55);
    color: var(--brand-dark);
}
.status-closed {
    background-color: var(--brand-dark);
    color: #fff;
}

/* Sprungleiste zu den Abschnitten (klebt unter der Topnav) */
.section-nav {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.35rem;
    overflow-x: auto;
    position: sticky;
    top: calc(3.625rem + 3px);
    z-index: 5;
    padding: 0.6rem 0;
    margin-left: -0.25rem;
    padding-left: 0.25rem;
    background-color: #f2f6fc;
    scrollbar-width: none;
}
.section-nav::-webkit-scrollbar {
    display: none;
}
.section-nav a {
    white-space: nowrap;
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--brand-dark);
    background-color: #fff;
    border: 1px solid #dbe1ea;
    text-decoration: none;
}
.section-nav a:hover {
    border-color: var(--brand-red);
    color: var(--brand-red);
}

/* Abschnitte: Karte mit Kopfzeile (Nummer + Icon + Titel) */
.p-section {
    scroll-margin-top: 7.5rem;
}
.card > .card-header.p-head,
.card-header.p-head .p-head-title {
    color: var(--brand-dark) !important;
}
.p-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
    font-size: 1rem;
    color: var(--brand-dark);
    background-color: #fff;
    border-bottom: 1px solid #e3e8ef;
    border-left: 4px solid var(--brand-red);
    border-top-left-radius: 0.35rem;
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
}
.p-head-num {
    flex: 0 0 auto;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background-color: var(--brand-red);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.p-head-icon {
    width: 1.05rem;
    height: 1.05rem;
    color: #8a929c;
}
.p-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #4a515b;
    margin-bottom: 0.5rem;
}
.p-divider {
    border-top: 1px dashed #dbe1ea;
    margin: 1.5rem 0 1.25rem;
}
.protokoll-form .form-label.small {
    font-weight: 500;
    color: #4a515b;
    margin-bottom: 0.3rem;
}

/* Ankreuzfelder als große, gut antippbare Buttons (Tablet im Fahrzeug) */
.chk-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}
.chk-group.chk-stack {
    flex-direction: column;
    align-items: stretch;
}
.btn-choice {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid #c5ccd6;
    background-color: #fff;
    color: #363d47;
    font-weight: 400;
    padding: 0.45rem 0.75rem;
    text-align: left;
    justify-content: flex-start;
    line-height: 1.25;
}
.btn-choice:hover {
    border-color: var(--brand-dark);
    color: #363d47;
}
.choice-box {
    flex: 0 0 auto;
    width: 1.05rem;
    height: 1.05rem;
    border: 2px solid #8a929c;
    border-radius: 3px;
    background-color: #fff;
    position: relative;
}
.choice-box.choice-radio {
    border-radius: 50%;
}
.btn-check:checked + .btn-choice {
    background-color: rgba(255, 22, 25, 0.07);
    border-color: var(--brand-red);
    color: #1b1f24;
    font-weight: 500;
}
.btn-check:checked + .btn-choice .choice-box {
    background-color: var(--brand-red);
    border-color: var(--brand-red);
}
.btn-check:checked + .btn-choice .choice-box::after {
    content: "";
    position: absolute;
    left: 0.28rem;
    top: 0.05rem;
    width: 0.32rem;
    height: 0.6rem;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.btn-check:focus-visible + .btn-choice,
.btn-check:focus-visible + .kraft-tile,
.btn-check:focus-visible + .lagerung-pic {
    box-shadow: 0 0 0 0.2rem rgba(255, 22, 25, 0.25);
}
fieldset:disabled .btn-choice {
    opacity: 1;
}

/* Schmerzskala 0-10: über die volle Breite, Farbverlauf grün -> rot */
.pain-scale {
    display: grid !important;
    grid-template-columns: repeat(11, minmax(0, 1fr));
    gap: 0.35rem;
}
.pain-scale .btn-choice {
    justify-content: center;
    font-weight: 600;
    padding-left: 0;
    padding-right: 0;
    min-height: 2.9rem;
    border-bottom: 4px solid var(--pain-color, #c5ccd6);
}
.pain-scale .choice-box {
    display: none;
}
.pain-scale .btn-check:checked + .btn-choice {
    background-color: var(--pain-color, var(--brand-red));
    border-color: var(--pain-color, var(--brand-red));
    color: #fff;
}
.pain-scale label:nth-of-type(1)  { --pain-color: #1e9e62; }
.pain-scale label:nth-of-type(2)  { --pain-color: #3fa857; }
.pain-scale label:nth-of-type(3)  { --pain-color: #6bb24a; }
.pain-scale label:nth-of-type(4)  { --pain-color: #9bba3c; }
.pain-scale label:nth-of-type(5)  { --pain-color: #c7bd2f; }
.pain-scale label:nth-of-type(6)  { --pain-color: #e8b526; }
.pain-scale label:nth-of-type(7)  { --pain-color: #f29a24; }
.pain-scale label:nth-of-type(8)  { --pain-color: #f27b22; }
.pain-scale label:nth-of-type(9)  { --pain-color: #ee5a22; }
.pain-scale label:nth-of-type(10) { --pain-color: #e63622; }
.pain-scale label:nth-of-type(11) { --pain-color: #c8102e; }
.pain-legend {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #8a929c;
    margin-top: 0.3rem;
}

/* ROSC */
.rosc-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.rosc-row .btn-choice {
    white-space: nowrap;
}

/* Einsatzmittel-Zeilen */
.em-row + .em-row {
    margin-top: 0.9rem;
    padding-top: 0.9rem;
    border-top: 1px dashed #dbe1ea;
}

/* SAMPLER */
.sampler-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 0.5rem 1.25rem;
}
.sampler-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}
.sampler-letter {
    flex: 0 0 2.4rem;
    height: calc(1.5em + 0.875rem + 2px);
    border-radius: 0.35rem;
    background-color: var(--brand-dark);
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}
textarea.autosize {
    resize: vertical;
    overflow: hidden;
}

/* Einsatzkräfte als Kachel-Raster */
.kraft-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 0.5rem;
}
.kraft-tile {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    height: 100%;
    padding: 0.45rem 0.6rem;
    border: 1px solid #c5ccd6;
    border-radius: 0.5rem;
    background-color: #fff;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.1s, background-color 0.1s;
}
.kraft-tile:hover {
    border-color: var(--brand-dark);
}
.kraft-avatar {
    flex: 0 0 auto;
    min-width: 2.3rem;
    height: 2.3rem;
    padding: 0 0.3rem;
    border-radius: 1.15rem;
    background-color: #e9edf2;
    color: var(--brand-dark);
    font-weight: 700;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.kraft-name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.875rem;
    line-height: 1.2;
    color: #363d47;
}
.kraft-du {
    color: #8a929c;
    font-size: 0.75rem;
}
.kraft-check-icon {
    flex: 0 0 auto;
    width: 1.3rem;
    height: 1.3rem;
    border-radius: 50%;
    border: 2px solid #c5ccd6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: transparent;
}
.kraft-check-icon svg {
    width: 0.85rem;
    height: 0.85rem;
    stroke-width: 3;
}
.btn-check:checked + .kraft-tile {
    border-color: var(--brand-red);
    background-color: rgba(255, 22, 25, 0.06);
}
.btn-check:checked + .kraft-tile .kraft-avatar {
    background-color: var(--brand-red);
    color: #fff;
}
.btn-check:checked + .kraft-tile .kraft-check-icon {
    background-color: var(--brand-red);
    border-color: var(--brand-red);
    color: #fff;
}
.btn-check[data-locked] + .kraft-tile {
    cursor: default;
}

/* Körperschema */
.befund-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.befund-tool {
    border: 1px solid #c5ccd6;
    background-color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 400;
}
.befund-dot {
    display: inline-flex;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background-color: var(--tool-color);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    align-items: center;
    justify-content: center;
}
.btn-check:checked + .befund-tool {
    border-color: var(--tool-color);
    box-shadow: 0 0 0 2px var(--tool-color);
    font-weight: 600;
}
.body-diagram {
    display: flex;
    gap: 1rem;
    justify-content: center;
    background-color: #f8f9fc;
    border: 1px solid #e0e5ec;
    border-radius: 0.5rem;
    padding: 0.75rem;
}
.body-view {
    flex: 1 1 0;
    max-width: 210px;
    text-align: center;
}
.body-view-label {
    font-weight: 700;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}
.body-svg {
    width: 100%;
    height: auto;
    display: block;
}
.body-region {
    stroke: #6b7280;
    stroke-width: 1.2;
    fill: #fff;
    transition: fill 0.1s;
}
.body-svg-interactive .body-region {
    cursor: pointer;
}
.body-svg-interactive .body-region:hover,
.body-svg-interactive .body-region:focus {
    stroke: var(--brand-red);
    stroke-width: 2;
    outline: none;
}
.body-region.has-befund {
    stroke: #1b1f24;
    stroke-width: 1.6;
}
.body-letters {
    font-weight: 700;
    fill: #1b1f24;
    pointer-events: none;
    font-family: Arial, sans-serif;
}
.body-side {
    font-size: 11px;
    font-weight: 700;
    fill: #1b1f24;
    font-family: Arial, sans-serif;
}
.befund-list-item {
    padding: 0.2rem 0;
    border-bottom: 1px dashed #e0e5ec;
}
.befund-badge {
    border: 0;
    color: #fff;
    font-weight: 500;
}

/* Lagerung als anklickbare Piktogramme */
.lagerung-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.6rem;
}
.lagerung-pic {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    border: 1px solid #c5ccd6;
    border-radius: 0.6rem;
    padding: 0.75rem 0.5rem 0.6rem;
    text-align: center;
    cursor: pointer;
    background-color: #fff;
    color: #7a828c;
    user-select: none;
    transition: border-color 0.1s, color 0.1s;
}
.lagerung-pic:hover {
    border-color: var(--brand-dark);
    color: var(--brand-dark);
}
.lagerung-pic svg {
    width: 100%;
    max-width: 130px;
    height: 58px;
    display: block;
}
.lagerung-label {
    font-size: 0.78rem;
    line-height: 1.2;
    color: #4a515b;
}
.lagerung-check {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 50%;
    border: 2px solid #c5ccd6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: transparent;
}
.lagerung-check svg {
    width: 0.8rem;
    height: 0.8rem;
    stroke-width: 3;
}
.btn-check:checked + .lagerung-pic {
    border-color: var(--brand-red);
    box-shadow: 0 0 0 1px var(--brand-red);
    color: var(--brand-red);
    background-color: rgba(255, 22, 25, 0.05);
}
.btn-check:checked + .lagerung-pic .lagerung-label {
    color: #1b1f24;
    font-weight: 600;
}
.btn-check:checked + .lagerung-pic .lagerung-check {
    background-color: var(--brand-red);
    border-color: var(--brand-red);
    color: #fff;
}

/* Werte-Tabelle */
.werte-table {
    min-width: 540px;
}
.werte-table th,
.werte-table td {
    vertical-align: middle;
    border-bottom-color: #eef1f5;
}
.werte-table th.werte-label {
    width: 7.5rem;
    white-space: nowrap;
    font-weight: 600;
    font-size: 0.8rem;
    color: #4a515b;
    text-align: left;
    padding-left: 0;
}
.werte-table th.werte-head {
    font-size: 0.75rem;
    font-weight: 600;
    color: #8a929c;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.werte-table td {
    min-width: 8.5rem;
}
.werte-table .input-group-text {
    font-size: 0.7rem;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
    min-width: 2.9rem;
    justify-content: center;
}

/* Einsatzmittel: Eingabe mit Auswahlliste */
.suggest-wrap {
    position: relative;
}
.suggest-input {
    padding-right: 2.2rem;
}
.suggest-caret {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    color: #8a929c;
    cursor: pointer;
    display: inline-flex;
}
.suggest-caret svg {
    width: 1rem;
    height: 1rem;
}
.suggest-menu {
    top: 100%;
    left: 0;
    right: 0;
    width: auto;
    margin-top: 0.125rem;
    max-height: 240px;
    overflow-y: auto;
    z-index: 1060;
}

/* Bericht & Textbausteine */
.bericht-textarea {
    min-height: 22rem;
    line-height: 1.55;
    resize: vertical;
}
.baustein-bar {
    background-color: #fff8e1;
    border: 1px solid #f3dd8a;
    border-left: 4px solid #e8b526;
    border-radius: 0.5rem;
    padding: 0.75rem 0.9rem;
}
.baustein-bar-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 0.85rem;
    color: #5c4a0c;
    margin-bottom: 0.6rem;
}
.baustein-bar-head svg {
    width: 1rem;
    height: 1rem;
    color: #d49a00;
}
.baustein-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}
.btn-baustein {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background-color: #fff;
    border: 1px solid #e0c56a;
    color: #3d3310;
    font-weight: 500;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
}
.btn-baustein svg {
    width: 0.95rem;
    height: 0.95rem;
    color: #d49a00;
}
.btn-baustein:hover,
.btn-baustein:focus {
    background-color: #ffefb8;
    border-color: #d49a00;
    color: #3d3310;
}
.btn-baustein.flash {
    background-color: #1e9e62;
    border-color: #1e9e62;
    color: #fff;
}
.baustein-menu {
    width: 22rem;
    max-width: 90vw;
    max-height: 22rem;
    overflow-y: auto;
}
.baustein-menu .dropdown-item {
    white-space: normal;
}

/* Status des automatischen Speicherns */
.autosave-status {
    font-size: 0.8rem;
    color: #8a929c;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}
.autosave-status::before {
    content: "";
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background-color: #c5ccd6;
    flex: 0 0 auto;
}
.autosave-status.is-ok { color: #1e7a4c; }
.autosave-status.is-ok::before { background-color: #1e9e62; }
.autosave-status.is-dirty::before { background-color: #e8b526; }
.autosave-status.is-saving::before { background-color: #2e6bd8; animation: autosave-pulse 0.8s infinite alternate; }
.autosave-status.is-error { color: #c8102e; font-weight: 500; }
.autosave-status.is-error::before { background-color: #c8102e; }
@keyframes autosave-pulse { from { opacity: 0.3; } to { opacity: 1; } }

/* Schwebende Speichern-Leiste */
.save-bar {
    position: sticky;
    bottom: 0;
    z-index: 20;
    margin-bottom: 1rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.12);
    border-top: 3px solid var(--brand-red);
}

/* Änderungsverlauf */
.change-table {
    font-size: 0.8rem;
}
.change-table th {
    font-size: 0.75rem;
    color: #8a929c;
}
.change-table td {
    vertical-align: top;
}
.change-old {
    background-color: rgba(255, 22, 25, 0.05);
    text-decoration: line-through;
    text-decoration-color: rgba(255, 22, 25, 0.5);
    color: #6b7280;
}
.change-new {
    background-color: rgba(30, 158, 98, 0.07);
}

/* Lesemodus / abgeschlossen: Eingabefelder wie Text darstellen */
.is-readonly .form-control:disabled {
    background-color: #fbfcfd;
    color: #1b1f24;
    opacity: 1;
}
.is-readonly .btn-choice,
.is-readonly .kraft-tile,
.is-readonly .lagerung-pic {
    pointer-events: none;
}
.is-readonly .btn-check:not(:checked) + .btn-choice,
.is-readonly .btn-check:not(:checked) + .lagerung-pic {
    opacity: 0.45;
}
.is-readonly .btn-now {
    display: none;
}

textarea.form-control {
    line-height: 1.5;
}

.alert-closed {
    background-color: #eceef1;
    border-color: #d4d8de;
    color: var(--brand-dark);
}

@media (max-width: 575.98px) {
    .save-bar .card-body {
        flex-wrap: nowrap !important;
    }
    .save-bar .btn {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

/* ---------------------------------------------------------------------
   Tablets & Touch-Geräte (Hauptgeräte neben dem PC)
   --------------------------------------------------------------------- */
@media (pointer: coarse) {
    /* iPad/Android zoomen sonst beim Antippen kleiner Eingabefelder hinein */
    .form-control,
    .form-select,
    .form-control-sm,
    .form-select-sm,
    .input-group-sm > .form-control {
        font-size: 16px;
    }
    .form-control,
    .form-select {
        min-height: 2.9rem;
    }
    .btn-choice,
    .kraft-tile,
    .btn-now {
        min-height: 2.9rem;
    }
    .btn-sm {
        min-height: 2.4rem;
    }
    .body-view {
        max-width: 240px;
    }
    .section-nav a {
        padding: 0.5rem 0.9rem;
    }
    .werte-table td {
        min-width: 9.5rem;
    }
}

/* Tablet hochkant / kleine Laptops: Seitenleiste ist eingeklappt, Inhalt nutzt die volle Breite */
@media (min-width: 768px) and (max-width: 1199.98px) {
    .kraft-grid {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    }
    .lagerung-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 767.98px) {
    .lagerung-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .pain-scale {
        gap: 0.2rem;
    }
    .pain-scale .btn-choice {
        font-size: 0.85rem;
    }
    .save-bar .autosave-status {
        display: none;
    }
}

/* Speichern-Leiste: Statusanzeige unterhalb der Knöpfe, sobald es eng wird */
@media (max-width: 1399.98px) {
    .save-bar .autosave-status {
        order: 10;
        flex-basis: 100%;
    }
}
