/* =============================================================================
 *  Seiten-Bausteine (Design einheitlich, Stufe 2)
 *  Regeln, die vorher identisch in vielen Seiten standen (Toasts, Anleitung,
 *  Leer-Zustände, FAQ, Komponentenlisten, Maßnahmen-Details …).
 *  Eingebunden in layouts/base.php und custom-base.php direkt vor dem
 *  Seiteninhalt – also an derselben Stelle wie vorher die Style-Blöcke der
 *  Seiten, damit sich gegenüber light-/dark-mode.css nichts verschiebt.
 *  Seitenspezifische Regeln bleiben in den Seiten.
 * ============================================================================= */

.qc-empty { padding:24px; color:#6b7280; font-size:14px; }

.qc-faq {
    background:#f8fafc; border:1px solid #eef0f3; border-radius:10px;
    padding:16px 18px;
}

.qc-faq h4 { margin:0 0 6px; font-weight:700; font-size:15px; color:#1f2937; }

.qc-faq p { margin:0; font-size:13px; color:#6b7280; line-height:1.6; }

.anleitung-overlay {
    position:fixed; inset:0; z-index:12000;
    display:none; align-items:center; justify-content:center;
    padding:24px;
    background:rgba(75,80,86,.5);
    -webkit-backdrop-filter: grayscale(1) blur(2px);
    backdrop-filter: grayscale(1) blur(2px);
}

.anleitung-overlay.is-open { display:flex; }

.anleitung-box {
    background:#fff; width:1600px; max-width:96vw; max-height:88vh; overflow:auto;
    border-radius:14px; box-shadow:0 16px 40px rgba(0,0,0,.25);
}

.anleitung-head {
    display:flex; align-items:center; justify-content:space-between; gap:12px;
    padding:16px 20px; border-bottom:1px solid #efefef;
    position:sticky; top:0; background:#fff;
}

.anleitung-head h5 { margin:0; font-weight:700; font-size:16px; }

.anleitung-body { padding:18px 20px; font-size:14px; color:#374151; line-height:1.6; }

.anleitung-body img { max-width:100%; height:auto; }

.anleitung-close { background:transparent; border:none; font-size:22px; line-height:1; cursor:pointer; color:#6b7280; }

.anleitung-close:hover { color:#111; }

.import-kpis { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }

.import-kpi {
    font-size: 12px; padding: 5px 10px; border-radius: 999px;
    background: #f1f5f9; color: #334155; border: 1px solid #e2e8f0;
}

.import-kpi.kpi-blue { background: #eff6ff; border-color: #93c5fd; color: #1e40af; }

.import-kpi.kpi-red  { background: #fee2e2; border-color: #fca5a5; color: #7f1d1d; }

.import-list { font-size: 12px; border-radius: 10px; padding: 10px 14px; margin-top: 10px; }

.import-list ul { margin: 6px 0 0 18px; padding: 0; }

.import-list-error { background: #fee2e2; border: 1px solid #fca5a5; color: #7f1d1d; }

.import-list-warn  { background: #fef9c3; border: 1px solid #fde047; color: #713f12; }

.import-info {
    font-size: 12px; color: #334155; background: #f8fafc;
    border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 14px;
}

.import-info ul { margin: 6px 0 0 18px; padding: 0; }

.bk-modal-counter { font-size: 12px; color: #64748b; }

.bk-modal-counter strong { color: #1f6dff; font-weight: 700; }

.bk-empty {
    padding: 30px 16px; text-align: center;
    color: #9ca3af; font-size: 12px;
}

.chart-box-gauge { position: relative; width: 100%; height: 200px; }

.gauge-center .gauge-value { font-size: 26px; font-weight: 700; color: #0f172a; line-height: 1; }

.gauge-center .gauge-label {
    font-size: 11px; font-weight: 500; color: #6b7280;
    text-transform: uppercase; letter-spacing: 0.4px;
}

.modal-window-large { max-width: 820px; }

.bk-readonly-hint {
    background:#eef2f7; border:1px solid #cbd5e1; color:#334155;
    padding:8px 12px; margin-bottom:14px; border-radius:8px; font-size:13px;
}

.std-comp-list {
    max-height: 360px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fafafa;
    padding: 4px;
}

.std-comp-list::-webkit-scrollbar { width: 8px; }

.std-comp-list::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

.std-comp-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 4px;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    cursor: pointer;
}

.std-comp-item:hover { background: #eef5ff; border-color: #c7d8f3; }

.std-comp-item input[type="checkbox"] {
    margin-top: 3px;
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: #1f6dff;
}

.std-comp-item .std-comp-content { flex: 1; min-width: 0; }

.std-comp-item .std-comp-nr {
    font-size: 11px;
    font-weight: 700;
    color: #1f6dff;
    background: #dbeafe;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-right: 6px;
}

.std-comp-item .std-comp-name { font-size: 13px; font-weight: 600; color: #0f172a; }

.std-comp-item .std-comp-beschr {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
    line-height: 1.4;
}

.std-comp-item.checked { background: #eff6ff; border-color: #1f6dff; }

.std-comp-counter {
    font-size: 12px;
    font-weight: 600;
    color: #1f6dff;
    padding: 6px 12px;
    background: #eff6ff;
    border-radius: 6px;
    display: inline-block;
}

.std-comp-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.std-comp-toolbar a {
    font-size: 12px;
    color: #1f6dff;
    text-decoration: none;
    cursor: pointer;
}

.std-comp-toolbar a:hover { text-decoration: underline; }

.std-comp-empty {
    text-align: center;
    padding: 30px 16px;
    color: #9ca3af;
    font-size: 13px;
}

.std-comp-empty i {
    font-size: 32px;
    opacity: 0.4;
    display: block;
    margin-bottom: 8px;
}

.bk-modal-title-text {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 600px;
}

.ma-table thead { background: #f8fafc; }

.ma-detail-row td {
    padding: 0 !important; background: #f8fafc !important;
    border-top: 1px solid #e5e7eb;
}

.ma-detail-content strong {
    display: block; font-weight: 700; color: #0f172a;
    margin-bottom: 4px; text-transform: uppercase;
    font-size: 10px; letter-spacing: 0.4px;
}

.ma-html-content {
    font-size: 12px; color: #475569; line-height: 1.65;
}

.ma-html-content p  { margin: 6px 0; }

.ma-html-content hr {
    border: 0; border-top: 1px solid #e5e7eb; margin: 8px 0;
}

.cia-bar {
    display: flex;
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    background: #f1f5f9;
    margin-top: 12px;
}

.cia-bar > div {
    height: 100%;
    transition: width 0.6s ease;
}

.cia-legend {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    font-size: 11px;
    color: #6b7280;
    flex-wrap: wrap;
}

.cia-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.flash-warn  { background: #fef3c7; border: 1px solid #f59e0b; color: #78350f; }

.success-toast, .error-toast {
    position: fixed;
    top: 20px;
    right: -350px;
    z-index: 999999;
}

.success-toast.show,
    .error-toast.show {
    right: 20px;
}

.page-wrap { padding: 24px 24px 18px; }   /* oben 24px wie auf allen Seiten */

/* =============================================================================
   Einheitliche Abstände zwischen Karten
   Eine Karte hat nach unten 24px (bzw. den Wert aus ihrem style-Attribut).
   Folgt direkt eine Karte mit zusätzlichem Abstand nach oben (mt-3 = 16px),
   wären es 40px – hier entfällt der Zusatz, es bleiben 24px.
   Karten mit eigenem margin-bottom im style-Attribut (eng gestapelte
   Seitenleisten, 6px) sind ausgenommen: dort sorgt mt-3 für den Abstand.
   ============================================================================= */
.card.custom-card:not([style*="margin-bottom"]) + .card.custom-card.mt-3 { margin-top: 0 !important; }

/* =============================================================================
   Einheitliche Rundung der Karten: 14px, auch wo die Seite keine angibt.
   Eine Angabe im style-Attribut der Karte hat weiter Vorrang.
   ============================================================================= */
.card.custom-card { border-radius: 14px; }
