/* Bereich Verwaltung (Präfix vw-) */

.vw-seite { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }

/* Meldungen */
.vw-toast { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: 8px; border: 1px solid; }
.vw-toast.ok, .vw-alert.ok { background: #e7f7ec; border-color: #bce7c6; color: #1c7a3a; }
.vw-toast.info, .vw-alert.info { background: #e8f3ff; border-color: #c7e4fb; color: #235b7e; }
.vw-toast.warn, .vw-alert.warn { background: #fdf1da; border-color: #f5d9a8; color: #9a6206; }
.vw-toast.danger, .vw-alert.danger { background: #fbe9e6; border-color: #f0b9b0; color: #a01b1b; }
.vw-alert.neutral { background: #f1f4f5; border-color: #e1e8eb; color: #2c3332; }
.vw-toast-zu { flex: none; width: 28px; height: 28px; padding: 0; border: 1px solid #d3d3d2; border-radius: 4px; background: #fff; color: #3f3f3e; cursor: pointer; font-size: 16px; line-height: 1; }
.vw-alert { padding: 10px 14px; border-radius: 8px; border: 1px solid; font-size: 13px; margin: 0; }
.vw-alert ul { margin: 6px 0; padding-left: 18px; }

/* Karten */
.vw-karte { background: #fff; border: 1px solid var(--km-rand); border-radius: 8px; box-shadow: var(--km-kachel-schatten); overflow: hidden; }
.vw-karte-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-height: 48px; box-sizing: border-box; padding: 8px 16px; background: var(--km-gruen); color: #2c3332; }
.vw-karte-kopf h2 { margin: 0; font-size: 17px; }
.vw-kopf-rot { background: #fbe9e6; color: #a01b1b; }
.vw-kopf-rot h2 { color: #a01b1b; }
.vw-karte-inhalt { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.vw-karte-fuss { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--km-rand); background: #fafbfb; }
.vw-karte-fuss.innen { padding: 10px 0 0; background: transparent; }
.vw-zwei { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px; align-items: start; }
.vw-raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }

/* Filter und Formulare */
.vw-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; }
.vw-filter label, .vw-felder label, .vw-feld-schmal, .vw-feld-breit { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--km-text-gedimmt); }
.vw-seite input:not([type=checkbox]), .vw-seite select, .vw-seite textarea { font: inherit; font-size: 14px; padding: 5px 8px; border: 1px solid #d3d3d2; border-radius: 4px; background: #fff; color: #000; box-sizing: border-box; }
.vw-seite input:disabled, .vw-seite select:disabled, .vw-seite textarea:disabled { background: #f2f2f2; color: #5c636a; }
.vw-filter input[type=search] { min-width: 240px; }
.vw-feld-breit input, .vw-feld-breit select { min-width: 280px; }
.vw-feld-schmal input { width: 120px; }
.vw-check { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 6px; font-size: 14px !important; color: #000 !important; cursor: pointer; }
.vw-felder { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.vw-block { border: 1px solid var(--km-rand); border-radius: 8px; padding: 10px 14px 12px; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.vw-block legend { font-weight: 600; padding: 0 6px; }
.vw-teamwahl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; }

/* Tabellen */
.vw-tabelle-rahmen { overflow-x: auto; }
.vw-tabelle { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.vw-tabelle th { text-align: left; font-weight: 600; padding: 8px; border-bottom: 2px solid var(--km-rand); white-space: nowrap; }
.vw-tabelle td { padding: 7px 8px; border-bottom: 1px solid #eef0f1; vertical-align: top; }
.vw-tabelle tbody tr:nth-child(even) { background: #f9fbfb; }
.vw-tabelle tbody tr.vw-auswahl, .vw-tabelle tbody tr.vw-auswahl:nth-child(even) { background: var(--km-blau-hell); box-shadow: inset 3px 0 0 var(--km-blau); }
.vw-tabelle tbody tr.vw-neu { background: #e7f7ec; }
.vw-tabelle-fest { height: 62vh; overflow-y: auto; }
.vw-tabelle-fest .vw-tabelle th { position: sticky; top: 0; z-index: 2; background: #fff; border-bottom: 0; box-shadow: 0 1px 0 #d3d3d2; }
.vw-tabelle-fest .vw-tabelle td { height: 58px; }
.vw-tabelle.vw-kompakt td { padding: 5px 6px; }
.vw-mitte { text-align: center !important; }
.vw-rechtsb { text-align: right !important; }
.vw-nowrap { white-space: nowrap; }
.vw-einzeilig { max-width: 360px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vw-mono { font-family: Consolas, "SFMono-Regular", Menlo, monospace; font-size: 12.5px; }
.vw-link { border: 0; background: transparent; padding: 0; font: inherit; color: var(--km-fokus); cursor: pointer; text-align: left; }
.vw-link:hover { text-decoration: underline; }
.vw-seitenzahl { align-self: center; }
.vw-klein-btn { min-height: 26px; padding: 2px 10px; font-size: 12.5px; }

/* Mitarbeiter */
.vw-person { display: flex; align-items: center; gap: 8px; }
.vw-chip { display: inline-block; margin: 1px 4px 1px 0; padding: 1px 8px; border-radius: 10px; background: #e1e8eb; font-size: 12px; white-space: nowrap; }
.vw-chip.knopf { border: 0; cursor: pointer; font: inherit; font-size: 12px; }
.vw-chip.knopf:hover { background: var(--km-blau-hell); }
.vw-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.vw-ohne-team { color: #c06a00; font-style: italic; font-size: 12.5px; }
.vw-orange { color: #c06a00; font-weight: 600; }
.vw-kompetenzen { display: inline-flex; gap: 3px; }
.vw-komp { display: inline-block; min-width: 24px; text-align: center; padding: 1px 3px; border-radius: 4px; font-size: 11.5px; background: #f1f3f5; color: #8a8f94; border: 1px solid #e9ecef; }
.vw-komp.an { background: #d6f2a4; color: #2c3332; border-color: #acde79; font-weight: 600; }
.vw-komp-wahl { display: flex; flex-direction: column; gap: 6px; }
.vw-komp-zeile { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 8px; }
.vw-komp-knopf { min-width: 44px; padding: 4px 6px; border-radius: 4px; border: 1px solid #d3d3d2; background: #f1f3f5; font: inherit; font-weight: 600; cursor: pointer; }
.vw-komp-knopf.an { background: #d6f2a4; border-color: #acde79; }
.vw-komp-knopf:disabled { cursor: default; }

/* Rollen */
.vw-legende { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--km-text-gedimmt); }
.vw-matrix td, .vw-matrix th { vertical-align: middle; }
.vw-zelle { border: 0; background: transparent; padding: 2px; cursor: pointer; }
.vw-geaendert { background: #ffffcc !important; }
.km-badge.neutral.leer { opacity: .7; }

/* Diagnose */
.vw-punkt { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; background: #aec6d5; vertical-align: middle; }
.vw-punkt.ok { background: #198754; }
.vw-punkt.warn { background: #ffc107; }
.vw-punkt.danger { background: #dc3545; }
.vw-punkt.info { background: #1f7fcf; }
.vw-quellen { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.vw-quelle { border: 1px solid var(--km-rand); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.vw-quelle p { margin: 0; }

/* Protokoll */
.vw-json { margin: 4px 0 0; padding: 10px; border-radius: 6px; background: #f6f8f9; border: 1px solid #e9ecef; font-size: 12.5px; white-space: pre-wrap; word-break: break-word; }
.vw-json.nachher { background: #f0f6e9; border-color: #d6e9c0; }

/* Datenschutz */
.vw-fristen { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; align-items: start; }
.vw-frist { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 8px; border: 1px solid #e9ecef; background: #f8f9fa; }
.vw-frist-titel { font-size: 13px; font-weight: 600; min-height: 34px; }
.vw-frist input { width: 100px; font-size: 20px !important; font-weight: 700; color: #146c43 !important; }
.vw-btn-rot { border-color: #f0b9b0 !important; color: #a01b1b !important; background: #fff; }
.vw-btn-rot:hover { background: #fbe9e6 !important; }
.vw-btn-loeschen { background: #dc3545 !important; border-color: #dc3545 !important; color: #fff !important; }
.vw-btn-loeschen:disabled { background: #adb5bd !important; border-color: #adb5bd !important; cursor: not-allowed; }
.vw-lauf { border: 1px solid var(--km-rand); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.vw-schritte { display: flex; flex-wrap: wrap; gap: 6px; }
.vw-schritt-details { margin: 0; padding-left: 18px; font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.vw-schritt-details li > button { margin-top: 4px; }

/* Dialog */
.vw-dialog-hintergrund { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.35); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow: auto; }
.vw-dialog { width: min(620px, 100%); background: #fff; border-radius: 8px; box-shadow: 0 8px 32px rgba(0,0,0,.25); overflow: hidden; }
.vw-dialog .km-formular input, .vw-dialog .km-formular select, .vw-dialog .km-formular textarea { font: inherit; font-size: 14px; padding: 5px 8px; border: 1px solid #d3d3d2; border-radius: 4px; }

/* Einstellungen */
.vw-zugaenge { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.vw-zwischen { margin: 6px 0 0; font-size: 14px; color: #2c3332; border-bottom: 1px solid var(--km-rand); padding-bottom: 4px; }
.vw-einstellungen { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px 16px; }
.vw-einstellung { display: flex; flex-direction: column; gap: 3px; padding: 6px 8px; border-radius: 6px; }
.vw-einstellung > label:not(.vw-check) { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.vw-wert { display: flex; align-items: center; gap: 6px; }
.vw-wert input[type=number] { width: 100px; }
.vw-wert textarea { width: 100%; }
.vw-zuletzt { font-style: italic; }
.vw-wirkt { color: #2c3332; }

@media (max-width: 700px) {
    .vw-felder, .vw-teamwahl { grid-template-columns: 1fr; }
    .vw-zwei, .vw-raster { grid-template-columns: 1fr; }
}
.vw-gruppe { display: flex; gap: 8px; align-items: center; }
.vw-gruppe input { flex: 1; min-width: 0; }

/* Virtuelles Scrollen im DxGrid: feste Höhe nötig, Seitenumbruch ist abgeschaltet */
.vw-grid-virtuell { height: min(70vh, 720px); }

/* Mitarbeiter: Disposition der Techniker (Leiste über der Liste, Abschnitt im Detail) */
.vw-tech-leiste { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding: 8px 14px; border: 1px solid var(--km-rand); border-radius: 8px; background: #fff; font-size: 13px; }
.vw-tech-leiste strong { font-size: 16px; }
.vw-tech-leiste .vw-tech-warn strong { color: #9a6206; }
.vw-tech-leiste .km-rechts { margin-left: auto; }
.vw-geozeile { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.vw-felder .vw-feld-voll { grid-column: 1 / -1; }
.vw-felder input[type=number] { width: 100%; }

/* Importartikel (vw-ia-) */
.vw-ia-hinweis { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.vw-ia-hinweis > a { margin-left: auto; }
.vw-ia-mehr { flex: 0 0 auto; }
.vw-ia-mehr[open] { flex: 1 1 100%; }
.vw-ia-mehr > summary { display: inline-block; cursor: pointer; font-size: 12px; color: var(--km-fokus); }
.vw-ia-mehr > p { margin: 6px 0 0; }
.vw-ia-suche { display: flex; flex-direction: column; gap: 4px; min-width: 0; max-width: 640px; }
.vw-ia-suche > label { font-size: 12px; color: var(--km-text-gedimmt); }
.vw-ia-suchbox { position: relative; }
.vw-ia-suchbox input[type="search"] { width: 100%; min-height: 32px; }
.vw-ia-treffer { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 2px); max-height: 260px; overflow-y: auto; background: #fff; border: 1px solid #b8bec4; border-radius: 4px; box-shadow: 0 4px 16px rgba(0, 0, 0, .18); }
.vw-ia-treffer button { display: block; width: 100%; padding: 6px 10px; border: 0; border-bottom: 1px solid #eceff1; background: transparent; font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.vw-ia-treffer button:hover { background: var(--km-blau-hell); }
.vw-ia-treffer button span { color: var(--km-text-gedimmt); }
.vw-ia-hilfe { font-size: 12px; color: var(--km-text-gedimmt); }
.vw-ia-hilfe.vw-ia-warnt { color: #9a6206; }
.vw-ia-scroll { max-height: calc(100vh - 380px); overflow: auto; border: 1px solid var(--km-rand); border-radius: 6px; }
.vw-ia-scroll .vw-tabelle th { position: sticky; top: 0; z-index: 2; background: #fff; border-bottom: 0; box-shadow: 0 1px 0 #d3d3d2; }
.vw-ia-artnr { font-family: Consolas, "SFMono-Regular", Menlo, monospace; font-size: 12px; }
.vw-ia-aktionen { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; justify-content: flex-end; min-width: 150px; }
.vw-ia-leer { padding: 20px 10px; color: var(--km-text-gedimmt); text-align: center; }

/* Deeplinks (Einstellungen › Deeplinks) */
.vw-dl-details > td { background: #f8f9fa; }
.vw-dl-raster { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 20px; align-items: start; }
.vw-dl-links h3, .vw-dl-qr h3 { margin: 10px 0 4px; font-size: 13px; }
.vw-dl-links .vw-gruppe input { font-family: Consolas, "SFMono-Regular", Menlo, monospace; font-size: 12.5px; }
.vw-dl-code { width: 100%; margin-bottom: 6px; font-size: 12px; }
.vw-dl-qr { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.vw-dl-qr-bild { width: 200px; height: 200px; background: #fff; border: 1px solid var(--km-rand); padding: 6px; }
.vw-dl-qr-bild svg { width: 100%; height: 100%; display: block; }
.vw-dl-zeile { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vw-dl-zeile label { display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 700px) { .vw-dl-raster, .vw-dl-zeile { grid-template-columns: 1fr; } }

/* Systemprotokoll: Farben je Stufe (dunkelrot = Critical, Orange abgestuft, schwarz = Information) */
.vw-log-grid { height: 65vh; }
.vw-log-filter { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.vw-log-grid .vw-log-critical td { color: #8b0000; font-weight: 700; }
.vw-log-grid .vw-log-error td { color: #c2410c; font-weight: 600; }
.vw-log-grid .vw-log-warning td { color: #f08c00; }
.vw-log-grid .vw-log-info td { color: #000; }
.vw-log-grid .vw-log-debug td { color: #6b7280; }
