/*
 * Badwerke PIM -- was ueber Filaments Standard hinausgeht.
 *
 * Reines CSS ohne Build-Schritt: `php artisan filament:assets` kopiert die
 * Datei nach public/css/app/badwerke.css (Schritt 4 des Deployments).
 * Filaments Panel-CSS enthaelt keine Tailwind-Utilities -- eigene Views
 * und HTML-Fragmente brauchen deshalb eigene Klassen. Sie heissen bw-*.
 *
 * Farben kommen aus Filaments Palette (--primary-*, --gray-*, ...), damit
 * jedes Panel seine eigene Hausfarbe traegt; die beiden Markentoene fuer
 * den Bereichswechsel liefert App\Support\Branding\Brand als
 * --bw-navy und --bw-teal.
 */

/* ------------------------------------------------------------------ */
/* 1. Bereiche: die Kopfleiste ist das Erkennungszeichen               */
/* ------------------------------------------------------------------ */

/* Produktpflege: marineblaue Kopfleiste, helle Bildmarke. */
.fi-panel-admin .fi-topbar {
    background: var(--primary-600);
    box-shadow: none;
    --tw-ring-color: transparent;
}

.dark .fi-panel-admin .fi-topbar {
    background: var(--primary-800);
}

.fi-panel-admin .fi-topbar .fi-logo-light {
    display: none;
}

.fi-panel-admin .fi-topbar .fi-logo-dark {
    display: flex;
}

.fi-panel-admin .fi-topbar .fi-icon-btn {
    color: rgb(255 255 255 / 0.75);
}

.fi-panel-admin .fi-topbar .fi-icon-btn:hover,
.fi-panel-admin .fi-topbar .fi-icon-btn:focus-visible {
    color: #fff;
}

.fi-panel-admin .fi-topbar .fi-input-wrp {
    background: rgb(255 255 255 / 0.12);
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.25);
}

.fi-panel-admin .fi-topbar .fi-input-wrp:focus-within {
    background: rgb(255 255 255 / 0.18);
    box-shadow: inset 0 0 0 2px rgb(255 255 255 / 0.6);
}

.fi-panel-admin .fi-topbar .fi-input-wrp .fi-icon,
.fi-panel-admin .fi-topbar .fi-input {
    color: #fff;
}

.fi-panel-admin .fi-topbar .fi-input::placeholder {
    color: rgb(255 255 255 / 0.65);
}

.fi-panel-admin .fi-topbar .fi-badge {
    background: #fff;
    color: var(--primary-700);
}

/* Arbeitsbereich: helle Kopfleiste mit dem Gruenblau als Kante. */
.fi-panel-intern .fi-topbar {
    box-shadow:
        inset 0 3px 0 0 var(--primary-400),
        0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.dark .fi-panel-intern .fi-topbar {
    box-shadow: inset 0 3px 0 0 var(--primary-500);
}

/* ------------------------------------------------------------------ */
/* 2. Bereichswechsel oben in der Seitenleiste                          */
/* ------------------------------------------------------------------ */

.bw-area {
    margin-bottom: -1rem;
}

.bw-area-switch {
    display: flex;
    gap: 2px;
    padding: 3px;
    border-radius: 0.75rem;
    background: var(--gray-100);
}

.dark .bw-area-switch {
    background: rgb(255 255 255 / 0.06);
}

.bw-area-switch-item {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.375rem 0.5rem;
    border-radius: 0.6rem;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.25rem;
    color: var(--gray-500);
    text-decoration: none;
    transition: color 75ms, background-color 75ms;
}

.bw-area-switch-item:hover {
    color: var(--gray-900);
}

.dark .bw-area-switch-item:hover {
    color: #fff;
}

.bw-area-switch-item.bw-current {
    background: #fff;
    color: var(--gray-950);
    box-shadow:
        0 1px 2px rgb(0 0 0 / 0.08),
        0 0 0 1px rgb(0 0 0 / 0.04);
}

.dark .bw-area-switch-item.bw-current {
    background: rgb(255 255 255 / 0.1);
    color: #fff;
    box-shadow: none;
}

.bw-area-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    background: var(--gray-100);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--gray-600);
}

.dark .bw-area-badge {
    background: rgb(255 255 255 / 0.06);
    color: var(--gray-300);
}

.bw-area-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background: var(--gray-300);
    flex-shrink: 0;
}

.bw-area-switch-item[data-area-id='admin'] .bw-area-dot,
.bw-area[data-area='admin'] .bw-area-badge .bw-area-dot {
    background: var(--bw-navy);
}

.bw-area-switch-item[data-area-id='intern'] .bw-area-dot,
.bw-area[data-area='intern'] .bw-area-badge .bw-area-dot {
    background: var(--bw-teal);
}

.dark .bw-area-switch-item[data-area-id='admin'] .bw-area-dot,
.dark .bw-area[data-area='admin'] .bw-area-badge .bw-area-dot {
    background: color-mix(in oklab, var(--bw-navy) 55%, #fff);
}

.bw-area-description {
    margin: 0.5rem 0.25rem 0;
    font-size: 0.75rem;
    line-height: 1rem;
    color: var(--gray-500);
}

/*
 * Eingeklappte Seitenleiste: nur noch die Punkte, uebereinander -- sonst
 * hielte der Text die Leiste auf voller Breite, und Einklappen bewirkte
 * nichts. Die Bezeichnung steht dann im Tooltip.
 */
.fi-sidebar:not(.fi-sidebar-open) .bw-area-description,
.fi-sidebar:not(.fi-sidebar-open) .bw-area-label {
    display: none;
}

.fi-sidebar:not(.fi-sidebar-open) .bw-area-switch {
    flex-direction: column;
    gap: 4px;
    padding: 4px;
}

.fi-sidebar:not(.fi-sidebar-open) .bw-area-switch-item,
.fi-sidebar:not(.fi-sidebar-open) .bw-area-badge {
    padding: 0.5rem 0;
    justify-content: center;
}

.fi-sidebar:not(.fi-sidebar-open) .bw-area-badge {
    display: flex;
    border-radius: 0.6rem;
}

.fi-sidebar:not(.fi-sidebar-open) .bw-area-dot {
    width: 0.625rem;
    height: 0.625rem;
}

/* ------------------------------------------------------------------ */
/* 3. Kleine Bausteine fuer HTML-Fragmente in Formularen und Listen     */
/* ------------------------------------------------------------------ */

.bw-muted {
    color: var(--gray-500);
}

.dark .bw-muted {
    color: var(--gray-400);
}

/* Was ueberfaellig ist -- im Wochenplan und im Materialbedarf. */
.bw-danger {
    color: var(--danger-600);
    font-weight: 600;
}

.dark .bw-danger {
    color: var(--danger-400);
}

/* Zahlen im Wochenplan, die zu den Modulen fuehren. */
a.bw-pill,
a.bw-plan-link {
    text-decoration: none;
    cursor: pointer;
}

a.bw-pill:hover,
a.bw-plan-link:hover {
    outline: 2px solid var(--primary-400);
    outline-offset: 1px;
}

.bw-small {
    font-size: 0.75rem;
    line-height: 1rem;
}

.bw-strong {
    font-weight: 500;
}

.bw-price {
    font-size: 1.75rem;
    line-height: 2rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--gray-950);
    font-variant-numeric: tabular-nums;
}

.dark .bw-price {
    color: #fff;
}

.bw-flag {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.125rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--warning-50);
    color: var(--warning-700);
    box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--warning-600) 15%, transparent);
    vertical-align: middle;
}

.dark .bw-flag {
    background: color-mix(in oklab, var(--warning-400) 12%, transparent);
    color: var(--warning-300);
}

.bw-groups {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.bw-groups-item {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    padding: 0.2rem 0.6rem;
    border-radius: 0.5rem;
    background: var(--gray-50);
    box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.05);
    font-size: 0.8125rem;
    color: var(--gray-600);
}

.dark .bw-groups-item {
    background: rgb(255 255 255 / 0.05);
    color: var(--gray-300);
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.08);
}

.bw-groups-item strong {
    color: var(--gray-950);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.dark .bw-groups-item strong {
    color: #fff;
}

/* Ergebnisblock der Kalkulation: leicht in Hausfarbe getoent. */
.fi-section.bw-result {
    background: color-mix(in oklab, var(--primary-50) 55%, #fff);
}

.dark .fi-section.bw-result {
    background: color-mix(in oklab, var(--primary-400) 6%, var(--gray-900));
}

/* Dateiliste (Zeichnungen im Kundenportal). */
.bw-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.bw-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.625rem 0;
    border-top: 1px solid var(--gray-200);
    font-size: 0.875rem;
}

.dark .bw-list-item {
    border-color: rgb(255 255 255 / 0.1);
}

.bw-list-item:first-child {
    border-top: 0;
}

.bw-list-item .fi-link {
    flex-shrink: 0;
}

/* ------------------------------------------------------------------ */
/* 4. Wochenplan                                                        */
/* ------------------------------------------------------------------ */

.bw-plan-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem 1.5rem;
}

.bw-plan-filter {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    min-width: 18rem;
    flex: 1 1 18rem;
    max-width: 32rem;
}

.bw-plan-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bw-plan-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    margin-left: auto;
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.dark .bw-plan-legend {
    color: var(--gray-400);
}

.bw-plan-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.bw-plan-card {
    border-radius: 0.75rem;
    background: #fff;
    box-shadow:
        0 1px 2px 0 rgb(0 0 0 / 0.05),
        0 0 0 1px rgb(0 0 0 / 0.05);
    overflow: hidden;
}

.dark .bw-plan-card {
    background: var(--gray-900);
    box-shadow: 0 0 0 1px rgb(255 255 255 / 0.1);
}

.bw-plan-scroll {
    overflow-x: auto;
}

.bw-plan {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
    color: var(--gray-700);
}

.dark .bw-plan {
    color: var(--gray-300);
}

.bw-plan th,
.bw-plan td {
    padding: 0.625rem 0.5rem;
    border-bottom: 1px solid var(--gray-200);
    vertical-align: middle;
    white-space: nowrap;
}

.dark .bw-plan th,
.dark .bw-plan td {
    border-bottom-color: rgb(255 255 255 / 0.08);
}

.bw-plan thead th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-600);
    text-align: center;
}

.dark .bw-plan thead th {
    background: var(--gray-800);
    color: var(--gray-300);
}

.bw-plan-months th {
    padding: 0.375rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--gray-500);
    border-left: 1px solid var(--gray-200);
}

.dark .bw-plan-months th {
    border-left-color: rgb(255 255 255 / 0.08);
}

.bw-plan-months th:first-child {
    border-left: 0;
}

.bw-plan .bw-plan-first {
    position: sticky;
    left: 0;
    z-index: 1;
    text-align: left;
    padding-left: 1.25rem;
    min-width: 16rem;
    background: inherit;
}

.bw-plan thead .bw-plan-first {
    background: var(--gray-50);
}

.dark .bw-plan thead .bw-plan-first {
    background: var(--gray-800);
}

.bw-plan tbody .bw-plan-first {
    background: #fff;
}

.dark .bw-plan tbody .bw-plan-first {
    background: var(--gray-900);
}

.bw-plan .bw-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.bw-plan .bw-open {
    color: var(--gray-400);
}

.bw-plan .bw-open.bw-has-open {
    color: var(--warning-600);
    font-weight: 600;
}

.bw-plan-week {
    min-width: 4.25rem;
}

.bw-plan-week .bw-kw {
    display: block;
    font-weight: 600;
    color: var(--gray-700);
}

.dark .bw-plan-week .bw-kw {
    color: var(--gray-200);
}

.bw-plan-week .bw-date {
    display: block;
    margin-top: 0.125rem;
    font-size: 0.6875rem;
    font-weight: 400;
    color: var(--gray-500);
}

.bw-plan .bw-today {
    background: color-mix(in oklab, var(--primary-50) 70%, #fff);
}

.bw-plan thead .bw-today {
    background: var(--primary-100);
}

.bw-plan thead .bw-today .bw-kw {
    color: var(--primary-700);
}

.dark .bw-plan .bw-today {
    background: color-mix(in oklab, var(--primary-400) 8%, var(--gray-900));
}

.dark .bw-plan thead .bw-today {
    background: color-mix(in oklab, var(--primary-400) 18%, var(--gray-800));
}

.dark .bw-plan thead .bw-today .bw-kw {
    color: var(--primary-300);
}

.bw-plan-variant .bw-code {
    display: block;
    font-weight: 600;
    color: var(--gray-950);
}

.dark .bw-plan-variant .bw-code {
    color: #fff;
}

.bw-plan-variant .bw-sub {
    display: block;
    margin-top: 0.125rem;
    font-size: 0.75rem;
    color: var(--gray-500);
    white-space: normal;
    max-width: 22rem;
}

.bw-plan-cell {
    text-align: center;
}

.bw-plan-cell-inner {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    min-width: 2.5rem;
}

.bw-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1.25rem;
}

.bw-pill-production {
    background: var(--primary-600);
    color: #fff;
}

.dark .bw-pill-production {
    background: var(--primary-500);
    color: var(--gray-950);
}

.bw-pill-material {
    background: transparent;
    color: var(--info-700);
    box-shadow: inset 0 0 0 1.5px var(--info-400);
}

.dark .bw-pill-material {
    color: var(--info-300);
    box-shadow: inset 0 0 0 1.5px var(--info-500);
}

.bw-pill-empty {
    color: var(--gray-300);
    font-weight: 400;
}

.dark .bw-pill-empty {
    color: var(--gray-600);
}

.bw-plan tfoot td,
.bw-plan tfoot th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-800);
    border-bottom: 0;
    border-top: 1px solid var(--gray-200);
}

.dark .bw-plan tfoot td,
.dark .bw-plan tfoot th {
    background: var(--gray-800);
    color: var(--gray-100);
    border-top-color: rgb(255 255 255 / 0.08);
}

.bw-plan tfoot .bw-plan-first {
    background: var(--gray-50);
}

.dark .bw-plan tfoot .bw-plan-first {
    background: var(--gray-800);
}

.bw-plan-empty {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--gray-500);
}

.bw-plan-empty p {
    max-width: 32rem;
    margin: 0.5rem auto 0;
    font-size: 0.875rem;
}

.bw-plan-empty strong {
    display: block;
    font-size: 1rem;
    color: var(--gray-800);
}

.dark .bw-plan-empty strong {
    color: var(--gray-100);
}

/* Legende: dieselben Pillen wie in der Tabelle, nur ohne Zahl. */
.bw-plan-legend .bw-pill {
    min-width: 1.5rem;
    padding: 0;
    height: 1rem;
    line-height: 1rem;
}

/* ------------------------------------------------------------------ */
/* 5. Statistik (Produktpflege -> System -> Statistik)                  */
/* ------------------------------------------------------------------ */

.bw-stats {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

/* Kennzahlen oben: sechs Kacheln, farbige Kante links. */
.bw-stats-headline {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
    gap: 1rem;
}

.bw-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1.125rem 1.25rem 1.125rem 1.5rem;
    border-radius: 0.875rem;
    background: #fff;
    box-shadow:
        0 1px 2px 0 rgb(0 0 0 / 0.05),
        0 0 0 1px rgb(0 0 0 / 0.05);
    overflow: hidden;
}

.dark .bw-tile {
    background: var(--gray-900);
    box-shadow: 0 0 0 1px rgb(255 255 255 / 0.1);
}

.bw-tile::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 0.375rem;
    background: var(--bw-tone, var(--gray-400));
}

.bw-tile-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-500);
}

.dark .bw-tile-label {
    color: var(--gray-400);
}

.bw-tile-value {
    font-size: 1.875rem;
    line-height: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--gray-950);
    font-variant-numeric: tabular-nums;
}

.dark .bw-tile-value {
    color: #fff;
}

.bw-tile-hint {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* Toene -- eine Variable, die Kacheln, Balken und Pillen gemeinsam nutzen. */
[data-tone='primary'] { --bw-tone: var(--primary-500); }
[data-tone='info'] { --bw-tone: var(--info-500); }
[data-tone='success'] { --bw-tone: var(--success-500); }
[data-tone='warning'] { --bw-tone: var(--warning-500); }
[data-tone='danger'] { --bw-tone: var(--danger-500); }
[data-tone='gray'] { --bw-tone: var(--gray-400); }

/* Gruppen: Ueberschrift, Diagramme, Kartenraster. */
.bw-stats-group {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.bw-stats-group-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
}

.dark .bw-stats-group-header {
    border-color: rgb(255 255 255 / 0.1);
}

.bw-stats-group-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--gray-950);
}

.dark .bw-stats-group-title {
    color: #fff;
}

.bw-stats-group-description {
    margin: 0.25rem 0 0;
    font-size: 0.875rem;
    color: var(--gray-500);
}

.bw-stats-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
    gap: 1rem;
}

/*
 * Karten unterschiedlicher Hoehe ohne Loecher: CSS-Spalten statt Raster.
 * Der Browser verteilt die Karten selbst, eine Karte bricht nie um.
 */
.bw-stats-grid {
    columns: 2 22rem;
    column-gap: 1rem;
}

.bw-stats-grid-2 {
    columns: 2 26rem;
}

/* Karten. */
.bw-card {
    break-inside: avoid;
    margin-bottom: 1rem;
    border-radius: 0.875rem;
    background: #fff;
    box-shadow:
        0 1px 2px 0 rgb(0 0 0 / 0.05),
        0 0 0 1px rgb(0 0 0 / 0.05);
}

.dark .bw-card {
    background: var(--gray-900);
    box-shadow: 0 0 0 1px rgb(255 255 255 / 0.1);
}

.bw-card-header {
    padding: 1rem 1.25rem 0.75rem;
    border-bottom: 1px solid var(--gray-100);
}

.dark .bw-card-header {
    border-color: rgb(255 255 255 / 0.08);
}

.bw-card-title {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-950);
}

.dark .bw-card-title {
    color: #fff;
}

.bw-card-description {
    margin: 0.125rem 0 0;
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.bw-card-body {
    display: flex;
    flex-direction: column;
    padding: 0.25rem 1.25rem 0.75rem;
}

.bw-card-body > * {
    padding: 0.625rem 0;
    border-top: 1px solid var(--gray-100);
}

.dark .bw-card-body > * {
    border-color: rgb(255 255 255 / 0.06);
}

.bw-card-body > *:first-child {
    border-top: 0;
}

/* Bezeichnung / Wert. */
.bw-kv {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.bw-kv-label {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.dark .bw-kv-label {
    color: var(--gray-300);
}

.bw-kv-value {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    font-size: 0.875rem;
    color: var(--gray-950);
    font-variant-numeric: tabular-nums;
}

.dark .bw-kv-value {
    color: #fff;
}

.bw-kv-value strong {
    font-weight: 600;
}

.bw-kv[data-tone='danger'] .bw-kv-value strong { color: var(--danger-600); }
.bw-kv[data-tone='success'] .bw-kv-value strong { color: var(--success-600); }
.bw-kv[data-tone='warning'] .bw-kv-value strong { color: var(--warning-600); }

.bw-kv-value small {
    font-size: 0.75rem;
    color: var(--gray-500);
    max-width: 22rem;
}

/* Fortschritt und Verteilungen. */
.bw-progress-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.375rem;
}

.bw-progress-figure {
    font-size: 0.8125rem;
    color: var(--gray-500);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.bw-progress-figure strong {
    color: var(--gray-950);
    font-weight: 600;
}

.dark .bw-progress-figure strong {
    color: #fff;
}

.bw-bar-track {
    display: block;
    height: 0.5rem;
    border-radius: 9999px;
    background: var(--gray-100);
    overflow: hidden;
}

.dark .bw-bar-track {
    background: rgb(255 255 255 / 0.08);
}

.bw-bar-fill {
    display: block;
    height: 100%;
    border-radius: 9999px;
    background: var(--bw-tone, var(--primary-500));
    transition: width 300ms ease-out;
}

.bw-bars-row {
    display: grid;
    grid-template-columns: minmax(6rem, 11rem) 1fr 3rem;
    align-items: center;
    gap: 0.75rem;
    padding: 0.2rem 0;
    font-size: 0.8125rem;
}

.bw-bars-name {
    color: var(--gray-600);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dark .bw-bars-name {
    color: var(--gray-300);
}

.bw-bars-row .bw-bar-track {
    height: 0.375rem;
}

.bw-bars-count {
    text-align: right;
    font-weight: 600;
    color: var(--gray-950);
    font-variant-numeric: tabular-nums;
}

.dark .bw-bars-count {
    color: #fff;
}

.bw-empty {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--gray-400);
}

/* ------------------------------------------------------------------ */
/* 5a. Systemzustand, Sprungleiste, Reiter                              */
/* ------------------------------------------------------------------ */

/* Sprungleiste: bleibt unter der Kopfleiste kleben. */
.bw-stats-jump {
    position: sticky;
    top: calc(4rem + 0.5rem);
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem;
    border-radius: 9999px;
    background: color-mix(in oklab, #fff 85%, transparent);
    backdrop-filter: blur(8px);
    box-shadow:
        0 1px 2px 0 rgb(0 0 0 / 0.05),
        0 0 0 1px rgb(0 0 0 / 0.05);
}

.dark .bw-stats-jump {
    background: color-mix(in oklab, var(--gray-900) 85%, transparent);
    box-shadow: 0 0 0 1px rgb(255 255 255 / 0.1);
}

.bw-stats-jump-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.375rem 0.875rem;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-600);
    text-decoration: none;
    transition: background-color 75ms, color 75ms;
}

.bw-stats-jump-item:hover {
    background: var(--gray-100);
    color: var(--gray-950);
}

.dark .bw-stats-jump-item {
    color: var(--gray-300);
}

.dark .bw-stats-jump-item:hover {
    background: rgb(255 255 255 / 0.08);
    color: #fff;
}

.bw-stats-jump-stand {
    margin-left: auto;
    padding: 0 0.875rem;
    font-size: 0.75rem;
    color: var(--gray-500);
}

.bw-stats-jump-dot,
.bw-health-badge {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background: var(--gray-400);
    flex-shrink: 0;
}

.bw-health-badge {
    width: 0.875rem;
    height: 0.875rem;
    margin-top: 0.3rem;
    box-shadow: 0 0 0 4px color-mix(in oklab, var(--bw-level, var(--gray-400)) 20%, transparent);
}

[data-level='ok'] { --bw-level: var(--success-500); }
[data-level='warning'] { --bw-level: var(--warning-500); }
[data-level='danger'] { --bw-level: var(--danger-500); }
[data-level='info'] { --bw-level: var(--info-500); }

.bw-stats-jump-dot,
.bw-health-badge {
    background: var(--bw-level, var(--gray-400));
}

/* Der Zustand: eine Karte, links farbig gerahmt nach der schlechtesten Stufe. */
.bw-health {
    border-radius: 0.875rem;
    background: #fff;
    box-shadow:
        0 1px 2px 0 rgb(0 0 0 / 0.05),
        0 0 0 1px rgb(0 0 0 / 0.05);
    border-left: 0.375rem solid var(--bw-level, var(--gray-400));
    overflow: hidden;
}

.dark .bw-health {
    background: var(--gray-900);
    box-shadow: 0 0 0 1px rgb(255 255 255 / 0.1);
}

.bw-health-header {
    padding: 1.125rem 1.5rem 1rem;
    border-bottom: 1px solid var(--gray-100);
}

.dark .bw-health-header {
    border-color: rgb(255 255 255 / 0.08);
}

.bw-health-headline {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
}

.bw-health-list {
    margin: 0;
    padding: 0.25rem 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(26rem, 1fr));
}

.bw-health-item {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
}

.dark .bw-health-item {
    border-color: rgb(255 255 255 / 0.06);
}

.bw-health-item[data-level='danger'] {
    background: color-mix(in oklab, var(--danger-50) 60%, #fff);
}

.bw-health-item[data-level='warning'] {
    background: color-mix(in oklab, var(--warning-50) 60%, #fff);
}

.dark .bw-health-item[data-level='danger'] {
    background: color-mix(in oklab, var(--danger-400) 8%, transparent);
}

.dark .bw-health-item[data-level='warning'] {
    background: color-mix(in oklab, var(--warning-400) 8%, transparent);
}

.bw-health-pill {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    min-width: 6rem;
    margin-top: 0.1rem;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--bw-level, var(--gray-600));
    background: color-mix(in oklab, var(--bw-level, var(--gray-400)) 12%, transparent);
}

.bw-health-pill::before {
    content: '';
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background: currentColor;
}

.bw-health-body {
    flex: 1 1 0;
    min-width: 0;
}

.bw-health-line {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.75rem;
}

.bw-health-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-950);
}

.dark .bw-health-label {
    color: #fff;
}

.bw-health-value {
    font-size: 0.875rem;
    color: var(--gray-700);
    font-variant-numeric: tabular-nums;
}

.dark .bw-health-value {
    color: var(--gray-200);
}

.bw-health-hint {
    margin: 0.2rem 0 0;
    font-size: 0.8125rem;
    line-height: 1.25rem;
    color: var(--gray-500);
    overflow-wrap: anywhere;
}

.dark .bw-health-hint {
    color: var(--gray-400);
}

/* Reiter PIM-Daten / System. */
.bw-stats-tabs {
    align-self: flex-start;
}

.bw-stats-panel {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.bw-stats-panel > .bw-stats-group-description {
    margin: 0;
}

[x-cloak] {
    display: none !important;
}

/* Listen (groesste Tabellen). */
.bw-dl {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.25rem 1rem;
    margin: 0.5rem 0 0;
    font-size: 0.8125rem;
}

.bw-dl dt {
    color: var(--gray-600);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dark .bw-dl dt {
    color: var(--gray-300);
}

.bw-dl dd {
    margin: 0;
    text-align: right;
    color: var(--gray-950);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.dark .bw-dl dd {
    color: #fff;
}

/* ------------------------------------------------------------------ */
/* 6. Seitenbeschreibung und Handbuch                                   */
/* ------------------------------------------------------------------ */

/* Ein Satz unter der Ueberschrift: was diese Seite ist. */
.bw-guide {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    background: color-mix(in oklab, var(--primary-50) 60%, #fff);
    box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--primary-500) 18%, transparent);
    font-size: 0.875rem;
    line-height: 1.4rem;
    color: var(--gray-700);
}

.dark .bw-guide {
    background: color-mix(in oklab, var(--primary-400) 8%, var(--gray-900));
    box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--primary-400) 25%, transparent);
    color: var(--gray-200);
}

.bw-guide-icon {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.1rem;
    color: var(--primary-600);
}

.dark .bw-guide-icon {
    color: var(--primary-400);
}

.bw-guide-text {
    flex: 1 1 24rem;
    margin: 0;
}

.bw-guide-link {
    flex-shrink: 0;
    align-self: center;
    font-weight: 500;
    color: var(--primary-700);
    text-decoration: none;
    white-space: nowrap;
}

.bw-guide-link:hover {
    text-decoration: underline;
}

.dark .bw-guide-link {
    color: var(--primary-300);
}

/* Handbuch: Kapitel links, Text rechts. */
.bw-help {
    display: grid;
    grid-template-columns: minmax(14rem, 17rem) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 900px) {
    .bw-help {
        grid-template-columns: minmax(0, 1fr);
    }
}

.bw-help-nav {
    position: sticky;
    top: 5rem;
    padding: 0.75rem;
    border-radius: 0.875rem;
    background: #fff;
    box-shadow:
        0 1px 2px 0 rgb(0 0 0 / 0.05),
        0 0 0 1px rgb(0 0 0 / 0.05);
}

.dark .bw-help-nav {
    background: var(--gray-900);
    box-shadow: 0 0 0 1px rgb(255 255 255 / 0.1);
}

.bw-help-nav-title {
    margin: 0.25rem 0.5rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--gray-500);
}

.bw-help-chapters {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bw-help-chapter {
    display: block;
    padding: 0.5rem 0.625rem;
    border-radius: 0.6rem;
    text-decoration: none;
    color: var(--gray-700);
}

.dark .bw-help-chapter {
    color: var(--gray-300);
}

.bw-help-chapter:hover {
    background: var(--gray-50);
}

.dark .bw-help-chapter:hover {
    background: rgb(255 255 255 / 0.05);
}

.bw-help-chapter.bw-current {
    background: color-mix(in oklab, var(--primary-50) 70%, #fff);
    color: var(--primary-800);
}

.dark .bw-help-chapter.bw-current {
    background: color-mix(in oklab, var(--primary-400) 12%, transparent);
    color: var(--primary-200);
}

.bw-help-chapter-title {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
}

.bw-help-chapter-summary {
    display: block;
    margin-top: 0.125rem;
    font-size: 0.75rem;
    line-height: 1rem;
    color: var(--gray-500);
}

.bw-help-chapter.bw-current .bw-help-chapter-summary {
    color: var(--primary-700);
}

.dark .bw-help-chapter.bw-current .bw-help-chapter-summary {
    color: var(--primary-300);
}

/* Der Text: Typografie fuer gerendertes Markdown. */
.bw-doc {
    padding: 1.75rem 2rem 2.25rem;
    border-radius: 0.875rem;
    background: #fff;
    box-shadow:
        0 1px 2px 0 rgb(0 0 0 / 0.05),
        0 0 0 1px rgb(0 0 0 / 0.05);
    font-size: 0.9375rem;
    line-height: 1.65;
    color: var(--gray-800);
    max-width: 52rem;
}

.dark .bw-doc {
    background: var(--gray-900);
    box-shadow: 0 0 0 1px rgb(255 255 255 / 0.1);
    color: var(--gray-200);
}

.bw-doc > :first-child {
    margin-top: 0;
}

.bw-doc h1 {
    margin: 0 0 1rem;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--gray-950);
}

.bw-doc h2 {
    margin: 2.25rem 0 0.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--gray-950);
}

.bw-doc h3 {
    margin: 1.75rem 0 0.5rem;
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--gray-950);
}

.bw-doc h4 {
    margin: 1.25rem 0 0.375rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-900);
}

.dark .bw-doc h1,
.dark .bw-doc h2,
.dark .bw-doc h3,
.dark .bw-doc h4 {
    color: #fff;
}

.dark .bw-doc h2 {
    border-color: rgb(255 255 255 / 0.1);
}

.bw-doc-anchor {
    margin-left: 0.4rem;
    font-weight: 400;
    color: var(--gray-300);
    text-decoration: none;
    opacity: 0;
    transition: opacity 75ms;
}

.bw-doc h2:hover .bw-doc-anchor,
.bw-doc h3:hover .bw-doc-anchor {
    opacity: 1;
}

.bw-doc-anchor:hover {
    color: var(--primary-600);
}

.bw-doc p {
    margin: 0 0 1rem;
}

.bw-doc a {
    color: var(--primary-700);
    text-decoration: underline;
    text-decoration-color: color-mix(in oklab, var(--primary-500) 40%, transparent);
    text-underline-offset: 2px;
}

.bw-doc a:hover {
    text-decoration-color: var(--primary-600);
}

.dark .bw-doc a {
    color: var(--primary-300);
}

.bw-doc ul,
.bw-doc ol {
    margin: 0 0 1rem;
    padding-left: 1.5rem;
}

.bw-doc li {
    margin: 0.25rem 0;
}

.bw-doc li > ul,
.bw-doc li > ol {
    margin-bottom: 0.25rem;
}

.bw-doc strong {
    font-weight: 600;
    color: var(--gray-950);
}

.dark .bw-doc strong {
    color: #fff;
}

.bw-doc code {
    padding: 0.1rem 0.35rem;
    border-radius: 0.3rem;
    background: var(--gray-100);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.8125rem;
    color: var(--gray-800);
}

.dark .bw-doc code {
    background: rgb(255 255 255 / 0.08);
    color: var(--gray-100);
}

.bw-doc pre {
    margin: 0 0 1rem;
    padding: 0.875rem 1rem;
    border-radius: 0.6rem;
    background: var(--gray-50);
    box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.05);
    overflow-x: auto;
}

.dark .bw-doc pre {
    background: rgb(255 255 255 / 0.04);
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.08);
}

.bw-doc pre code {
    padding: 0;
    background: transparent;
}

.bw-doc blockquote {
    margin: 0 0 1rem;
    padding: 0.625rem 1rem;
    border-left: 3px solid var(--primary-400);
    border-radius: 0 0.5rem 0.5rem 0;
    background: color-mix(in oklab, var(--primary-50) 60%, #fff);
    color: var(--gray-700);
}

.dark .bw-doc blockquote {
    background: color-mix(in oklab, var(--primary-400) 8%, transparent);
    color: var(--gray-200);
}

.bw-doc blockquote p:last-child {
    margin-bottom: 0;
}

.bw-doc table {
    width: 100%;
    margin: 0 0 1.25rem;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.bw-doc th,
.bw-doc td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--gray-200);
    text-align: left;
    vertical-align: top;
}

.dark .bw-doc th,
.dark .bw-doc td {
    border-color: rgb(255 255 255 / 0.1);
}

.bw-doc th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
}

.dark .bw-doc th {
    background: var(--gray-800);
    color: var(--gray-200);
}

.bw-doc hr {
    margin: 2rem 0;
    border: 0;
    border-top: 1px solid var(--gray-200);
}

.bw-doc img {
    max-width: 100%;
    border-radius: 0.5rem;
}

.bw-doc kbd {
    padding: 0.1rem 0.4rem;
    border-radius: 0.3rem;
    background: var(--gray-100);
    box-shadow: inset 0 -1px 0 rgb(0 0 0 / 0.15);
    font-family: inherit;
    font-size: 0.8125rem;
}

/* Materialbedarf: Lieferant als Zwischenueberschrift im Plan-Raster. */
.bw-demand .bw-demand-supplier th,
.bw-demand .bw-demand-supplier td {
    background: var(--gray-100);
    font-weight: 700;
    color: var(--gray-900);
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.75rem;
}

.bw-demand .bw-demand-supplier td.bw-num {
    text-align: right;
    text-transform: none;
    letter-spacing: 0;
}

.dark .bw-demand .bw-demand-supplier th,
.dark .bw-demand .bw-demand-supplier td {
    background: var(--gray-800);
    color: var(--gray-100);
}

/* Materialbedarf: Bestellungen rechts, Fehlmenge rot, zu spaet gelb. */
.bw-demand .bw-demand-orders {
    border-left: 2px solid var(--gray-300);
}

.dark .bw-demand .bw-demand-orders {
    border-left-color: var(--gray-600);
}

.bw-demand .bw-demand-missing {
    color: var(--danger-600);
    background: var(--danger-50);
    font-weight: 700;
}

.dark .bw-demand .bw-demand-missing {
    color: var(--danger-400);
    background: transparent;
}

.bw-demand .bw-demand-late {
    color: var(--warning-600);
    font-weight: 600;
}

.bw-demand .bw-demand-covered {
    color: var(--success-600);
}

/* Nachkalkulation: Schritte eingerueckt, Abweichungen gefaerbt. */
.bw-post .bw-post-step {
    padding-left: 1.75rem;
    font-weight: 400;
    color: var(--gray-700);
}

.dark .bw-post .bw-post-step {
    color: var(--gray-300);
}

.bw-delta-bad {
    color: var(--danger-600);
    font-weight: 600;
}

.bw-delta-good {
    color: var(--success-600);
}

.dark .bw-delta-bad {
    color: var(--danger-400);
}

.dark .bw-delta-good {
    color: var(--success-400);
}

/* Nachkalkulation: vom Soll uebernommene Stunden und zu wenig Gemessenes. */
.bw-post-assumed {
    font-style: italic;
    color: var(--gray-500);
}

.bw-post-low {
    color: var(--warning-600);
    font-weight: 500;
}

.dark .bw-post-low {
    color: var(--warning-400);
}

.bw-post-note {
    margin: 0;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    background: var(--warning-50);
    color: var(--warning-800);
}

.dark .bw-post-note {
    background: color-mix(in oklab, var(--warning-400) 10%, transparent);
    color: var(--warning-300);
}

/* Aktivitaetsprotokoll: Aenderungstabelle im Dialog. */
.bw-changes {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.bw-changes th,
.bw-changes td {
    padding: 0.375rem 0.5rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--gray-200);
    word-break: break-word;
}

.bw-changes thead th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-500);
}

.bw-changes tbody th {
    font-weight: 600;
    color: var(--gray-800);
    white-space: nowrap;
}

.bw-changes td:nth-child(2) {
    color: var(--gray-500);
    text-decoration: line-through;
}

.dark .bw-changes th,
.dark .bw-changes td {
    border-bottom-color: rgb(255 255 255 / 0.08);
}

.dark .bw-changes tbody th {
    color: var(--gray-100);
}

/* ------------------------------------------------------------------ */
/* 7. 3D-Modell (Badtyp intern, Projekt im Portal)                      */
/* ------------------------------------------------------------------ */

/* Drei Spalten: Variantenauswahl, Viewer, Angaben. Schmal untereinander. */
.bw-model {
    display: grid;
    grid-template-columns: minmax(0, 13rem) minmax(0, 1fr) minmax(0, 18rem);
    gap: 1rem;
    align-items: start;
}

@media (max-width: 1279px) {
    .bw-model {
        grid-template-columns: minmax(0, 1fr);
    }
}

.bw-model-nav {
    border-radius: 0.75rem;
    background: #fff;
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
    outline: 1px solid rgb(0 0 0 / 0.05);
    padding: 0.5rem;
    font-size: 0.8125rem;
}

.dark .bw-model-nav {
    background: var(--gray-900);
    outline-color: rgb(255 255 255 / 0.1);
}

.bw-model-nav ul {
    list-style: none;
    margin: 0 0 0.5rem;
    padding: 0;
}

.bw-model-nav-type {
    padding: 0.5rem 0.5rem 0.25rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-500);
}

.bw-model-nav-item {
    display: block;
    padding: 0.375rem 0.5rem;
    border-radius: 0.5rem;
    color: var(--gray-700);
}

.bw-model-nav-item:hover {
    background: var(--gray-50);
}

.bw-model-nav-item.bw-current {
    background: var(--primary-50);
    color: var(--primary-700);
    font-weight: 600;
}

.dark .bw-model-nav-item {
    color: var(--gray-300);
}

.dark .bw-model-nav-item:hover {
    background: rgb(255 255 255 / 0.05);
}

.dark .bw-model-nav-item.bw-current {
    background: rgb(255 255 255 / 0.08);
    color: var(--primary-400);
}

/* Der Viewer: feste Hoehe, die Zeichenflaeche fuellt sie. */
.bw-viewer {
    position: relative;
    height: min(70vh, 640px);
    min-height: 360px;
    border-radius: 0.75rem;
    overflow: hidden;
    background: #f4f6f8;
    outline: 1px solid rgb(0 0 0 / 0.08);
}

.dark .bw-viewer {
    outline-color: rgb(255 255 255 / 0.1);
}

.bw-viewer-canvas {
    position: absolute;
    inset: 0;
}

.bw-viewer-canvas canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    touch-action: none;
}

.bw-viewer-toolbar {
    position: absolute;
    z-index: 2;
    top: 0.75rem;
    left: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem;
    border-radius: 0.625rem;
    background: rgb(255 255 255 / 0.92);
    box-shadow: 0 1px 3px rgb(0 0 0 / 0.12);
}

.bw-viewer-btn {
    padding: 0.3125rem 0.625rem;
    border-radius: 0.4375rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-700);
    background: transparent;
    cursor: pointer;
}

.bw-viewer-btn:hover:not(:disabled) {
    background: var(--gray-100);
}

.bw-viewer-btn[aria-pressed="true"],
.bw-viewer-btn[aria-pressed="true"]:hover:not(:disabled) {
    background: var(--bw-navy);
    color: #fff;
}

.bw-viewer-btn:disabled {
    opacity: 0.45;
    cursor: default;
}

.bw-viewer-sep {
    width: 1px;
    height: 1.25rem;
    margin: 0 0.25rem;
    background: var(--gray-200);
}

.bw-viewer-status {
    position: absolute;
    z-index: 2;
    left: 50%;
    bottom: 1rem;
    transform: translateX(-50%);
    padding: 0.5rem 0.875rem;
    border-radius: 0.5rem;
    background: rgb(17 62 109 / 0.9);
    color: #fff;
    font-size: 0.8125rem;
}

.bw-viewer-status[hidden] {
    display: none;
}

.bw-viewer-status.bw-viewer-status-error {
    background: var(--danger-600);
}

.bw-viewer-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    color: var(--gray-600);
    font-size: 0.875rem;
}

.bw-viewer-empty p {
    max-width: 32rem;
}

/* Angaben rechts. */
.bw-model-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border-radius: 0.75rem;
    background: #fff;
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
    outline: 1px solid rgb(0 0 0 / 0.05);
    padding: 1rem;
    font-size: 0.8125rem;
}

.dark .bw-model-info {
    background: var(--gray-900);
    outline-color: rgb(255 255 255 / 0.1);
    color: var(--gray-300);
}

.bw-model-info-title {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-950);
}

.dark .bw-model-info-title {
    color: #fff;
}

.bw-model-note p,
.bw-model-note ul {
    margin: 0.375rem 0 0;
    color: var(--gray-600);
}

.bw-model-note ul {
    padding-left: 1rem;
    list-style: disc;
}

.dark .bw-model-note p,
.dark .bw-model-note ul {
    color: var(--gray-400);
}

.bw-viewer-hint {
    margin: 0.375rem 0 0;
    color: var(--gray-500);
}

.bw-viewer-selection-kind {
    margin-top: 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--primary-600);
}

.bw-viewer-selection-name {
    font-weight: 600;
    color: var(--gray-950);
}

.dark .bw-viewer-selection-name {
    color: #fff;
}

.bw-viewer-selection-description {
    margin: 0.25rem 0 0;
    color: var(--gray-600);
}

.bw-viewer-pset {
    margin-top: 0.75rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-500);
}

/* Produkttexte sind lang: Name ueber Wert statt nebeneinander. */
.bw-viewer-dl {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    margin-top: 0.25rem;
}

.bw-viewer-dl dt {
    margin-top: 0.375rem;
    white-space: normal;
}

.bw-viewer-dl dd {
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
}

/* Rueckfragen am Badtyp (BathTypeQuestionsAction) */
.bw-thread {
    display: grid;
    gap: 0.75rem;
    max-height: 24rem;
    overflow-y: auto;
}

.bw-thread-item {
    max-width: 85%;
    padding: 0.625rem 0.875rem;
    border-radius: 0.75rem;
    background: var(--gray-100);
}

.dark .bw-thread-item {
    background: rgb(255 255 255 / 0.06);
}

.bw-thread-ours {
    justify-self: end;
    background: color-mix(in oklab, var(--primary-50) 70%, #fff);
}

.dark .bw-thread-ours {
    background: color-mix(in oklab, var(--primary-400) 12%, var(--gray-900));
}

.bw-thread-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
    font-size: 0.75rem;
    color: var(--gray-500);
}

.bw-thread-body {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    white-space: normal;
    overflow-wrap: anywhere;
}

.bw-thread-empty {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* Vorschau "Preisliste einlesen" */
.bw-import-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

.bw-import-scroll {
    max-height: 24rem;
    overflow: auto;
    border-radius: 0.5rem;
    box-shadow: 0 0 0 1px rgb(0 0 0 / 0.08);
}

.dark .bw-import-scroll {
    box-shadow: 0 0 0 1px rgb(255 255 255 / 0.1);
}

.bw-import thead th {
    position: sticky;
    top: 0;
    z-index: 1;
}

.bw-import td {
    white-space: normal;
}

.bw-plan tbody tr.bw-import-notable td {
    background: color-mix(in oklab, var(--danger-50) 80%, #fff);
}

.dark .bw-plan tbody tr.bw-import-notable td {
    background: color-mix(in oklab, var(--danger-400) 10%, var(--gray-900));
}

.bw-import-unmatched {
    margin-top: 0.75rem;
    font-size: 0.875rem;
}

.bw-import-unmatched summary {
    cursor: pointer;
    font-weight: 500;
}

.bw-import-unmatched ul {
    max-height: 12rem;
    overflow: auto;
    margin: 0.5rem 0 0;
    padding-left: 1.25rem;
    list-style: disc;
}

.bw-import-error {
    color: var(--danger-600);
}

.dark .bw-import-error {
    color: var(--danger-400);
}

.bw-import-muted {
    margin-left: 0.375rem;
    color: var(--gray-500);
}

/* Testbetrieb: E-Mails umgeleitet (MAIL_REDIRECT_TO) */
.bw-mail-redirect {
    margin-bottom: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    background: color-mix(in oklab, var(--warning-100) 70%, #fff);
    box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--warning-500) 35%, transparent);
    font-size: 0.875rem;
    color: var(--warning-900);
}

.dark .bw-mail-redirect {
    background: color-mix(in oklab, var(--warning-400) 10%, var(--gray-900));
    box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--warning-400) 30%, transparent);
    color: var(--warning-200);
}

/* Verteilungsraster: Varianten x Geschosse (ProjectDistribution) */
.bw-grid td,
.bw-grid th {
    padding: 0.375rem 0.5rem;
}

.bw-grid-type th {
    background: var(--gray-50);
    text-align: left;
    font-weight: 600;
}

.dark .bw-grid-type th {
    background: rgb(255 255 255 / 0.03);
}

.bw-grid-muted {
    margin-left: 0.375rem;
    font-weight: 400;
    color: var(--gray-500);
}

.bw-grid-input {
    width: 4.5rem;
    padding: 0.25rem 0.375rem;
    border-radius: 0.375rem;
    border: 1px solid var(--gray-300);
    background: #fff;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.dark .bw-grid-input {
    border-color: rgb(255 255 255 / 0.15);
    background: var(--gray-950);
    color: var(--gray-100);
}

.bw-grid-input:focus {
    outline: 2px solid var(--primary-500);
    outline-offset: 0;
}

.bw-grid-locked {
    display: inline-block;
    width: 4.5rem;
    padding: 0.25rem 0.375rem;
    color: var(--gray-500);
    cursor: help;
}

.bw-grid-hint,
.bw-grid-error {
    display: block;
    font-size: 0.75rem;
    line-height: 1rem;
}

.bw-grid-hint {
    color: var(--gray-500);
}

.bw-grid-error {
    white-space: normal;
    max-width: 10rem;
    margin-left: auto;
    color: var(--danger-600);
}

.dark .bw-grid-error {
    color: var(--danger-400);
}

.bw-grid-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
}

.bw-plan tbody .bw-grid-type .bw-plan-first,
.bw-plan tfoot th,
.bw-plan tfoot .bw-plan-first {
    background: var(--gray-50);
}

.dark .bw-plan tbody .bw-grid-type .bw-plan-first,
.dark .bw-plan tfoot th,
.dark .bw-plan tfoot .bw-plan-first {
    background: var(--gray-800);
}

/* Station in der Halle (ModuleStation): fuer Tablet und Handy */
.bw-station {
    display: grid;
    gap: 1rem;
    max-width: 48rem;
}

.bw-station-head,
.bw-station-next,
.bw-station-card {
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    background: #fff;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05), 0 0 0 1px rgb(0 0 0 / 0.05);
}

.dark .bw-station-head,
.dark .bw-station-next,
.dark .bw-station-card {
    background: var(--gray-900);
    box-shadow: 0 0 0 1px rgb(255 255 255 / 0.1);
}

.bw-station-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem;
}

.bw-station-project {
    font-weight: 600;
}

.bw-station-meta,
.bw-station-hint,
.bw-station-label {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.bw-station-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.bw-station-progress {
    font-size: 1.25rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.bw-station-next {
    box-shadow: inset 0 0 0 2px var(--primary-500);
}

.bw-station-step {
    margin: 0.25rem 0 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.bw-station-done {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--success-600);
}

.bw-station-wait {
    margin-top: 0.5rem;
    font-weight: 600;
    color: var(--warning-700);
}

.dark .bw-station-wait {
    color: var(--warning-400);
}

.bw-station-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.bw-station-hours {
    display: grid;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.bw-station-hours input {
    width: 7rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid var(--gray-300);
    font-size: 1.125rem;
    text-align: right;
    background: #fff;
}

.dark .bw-station-hours input {
    border-color: rgb(255 255 255 / 0.15);
    background: var(--gray-950);
    color: var(--gray-100);
}

.bw-station-error {
    margin-top: 0.5rem;
    color: var(--danger-600);
}

.bw-station-title {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.bw-station-steps {
    display: grid;
    gap: 0.25rem;
}

.bw-station-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    padding: 0.5rem 0.25rem;
    border-bottom: 1px solid var(--gray-100);
}

.dark .bw-station-row {
    border-bottom-color: rgb(255 255 255 / 0.06);
}

.bw-station-row.bw-current {
    font-weight: 600;
}

.bw-station-row-name {
    flex: 1 1 12rem;
}

.bw-station-row-hours {
    font-size: 0.875rem;
    color: var(--gray-500);
    font-variant-numeric: tabular-nums;
}

/* Ist vom Soll uebernommen, nicht eingetragen */
.bw-station-assumed {
    font-style: italic;
}

.bw-station-upload {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    margin-bottom: 0.75rem;
    border-radius: 0.5rem;
    background: var(--primary-600);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.bw-station-upload input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.bw-station-photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
    gap: 0.5rem;
}

.bw-station-photos a {
    display: grid;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--gray-500);
}

.bw-station-photos img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 0.5rem;
}

/* Karosserie am Badtyp: Plattenbedarf je Wand und Wandabwicklungen. */
.bw-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.bw-body-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
}

.bw-body-table th,
.bw-body-table td {
    padding: 0.25rem 0.5rem;
    border-bottom: 1px solid var(--gray-200);
    text-align: right;
}

.bw-body-table th:first-child,
.bw-body-table td:first-child,
.bw-body-table th:nth-child(3),
.bw-body-table td:nth-child(3),
.bw-body-table th:nth-child(4),
.bw-body-table td:nth-child(4),
.bw-body-table th:nth-child(5),
.bw-body-table td:nth-child(5) {
    text-align: left;
}

.bw-body-table th {
    color: var(--gray-600);
    font-weight: 600;
}

.bw-body-table tfoot td {
    font-weight: 600;
    border-bottom: 0;
}

.dark .bw-body-table th,
.dark .bw-body-table td {
    border-color: var(--gray-700);
}

.bw-body-warnings {
    margin: 0;
    padding-left: 1.25rem;
    list-style: disc;
    font-size: 0.8125rem;
    color: var(--warning-700);
}

.dark .bw-body-warnings {
    color: var(--warning-400);
}

.bw-body-sketches {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: 0.75rem;
}

.bw-body-sketch {
    margin: 0;
    padding: 0.5rem;
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    background: #fff;
}

.bw-body-sketch svg {
    width: 100%;
    height: auto;
}

/* Planimport: Ablagefeld und Bericht. */
.bw-plan-drop {
    padding: 1.5rem;
    border: 2px dashed var(--gray-300);
    border-radius: 0.75rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bw-plan-drop[data-dragging] {
    border-color: var(--primary-500);
    background: var(--primary-50);
}

.dark .bw-plan-drop {
    border-color: var(--gray-600);
}

.bw-plan-drop-pick {
    color: var(--primary-600);
    text-decoration: underline;
    cursor: pointer;
}

.bw-plan-drop-status:empty {
    display: none;
}

.bw-import-report td {
    text-align: left;
    vertical-align: top;
}

.bw-body-floor-plan {
    max-width: 100%;
    max-height: 22rem;
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    background: #fff;
}
