/*
 * William Walker UI foundation — reusable components.
 *
 * All component selectors are prefixed with .ww- so they can coexist with
 * Bootstrap and existing page-specific CSS while views migrate one by one.
 */

/* Buttons ---------------------------------------------------------------- */

.ww-button {
    align-items: center;
    appearance: none;
    background: var(--ww-color-surface);
    border: 1px solid var(--ww-color-border);
    border-radius: var(--ww-radius-sm);
    color: var(--ww-color-text);
    cursor: pointer;
    display: inline-flex;
    font-family: var(--ww-font-sans);
    font-size: var(--ww-font-size-sm);
    font-weight: var(--ww-font-weight-semibold);
    gap: var(--ww-space-2);
    justify-content: center;
    line-height: 1;
    min-block-size: var(--ww-control-height);
    padding: 0 var(--ww-space-3);
    text-align: center;
    text-decoration: none;
    transition: background-color var(--ww-duration-fast) var(--ww-ease-standard), border-color var(--ww-duration-fast) var(--ww-ease-standard), box-shadow var(--ww-duration-fast) var(--ww-ease-standard), color var(--ww-duration-fast) var(--ww-ease-standard), transform var(--ww-duration-fast) var(--ww-ease-standard);
    user-select: none;
    white-space: nowrap;
}

.ww-button:hover {
    background: var(--ww-color-surface-subtle);
    border-color: #c9c9c1;
    color: var(--ww-color-text);
}

.ww-button:active {
    transform: translateY(1px);
}

.ww-button:focus-visible,
.ww-icon-button:focus-visible,
.ww-input:focus-visible,
.ww-select:focus-visible,
.ww-textarea:focus-visible {
    outline: 2px solid var(--ww-color-focus);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--ww-color-focus-ring);
}

.ww-button--primary {
    background: var(--ww-color-brand);
    border-color: var(--ww-color-brand);
    color: #ffffff;
}

.ww-button--primary:hover {
    background: var(--ww-color-brand-strong);
    border-color: var(--ww-color-brand-strong);
    color: #ffffff;
}

/* Sekundäraktion wie in Shopify Admin: weiße Fläche, Rand, kein Farbton.
 * Nur die Hauptaktion eines Bereichs trägt die Markenfarbe (--primary). */
.ww-button--secondary {
    background: var(--ww-color-surface);
    border-color: var(--ww-color-border);
    box-shadow: var(--ww-shadow-xs);
    color: var(--ww-color-text);
}

.ww-button--secondary:hover {
    background: var(--ww-color-surface-subtle);
    border-color: var(--ww-color-text-tertiary);
    color: var(--ww-color-text);
}

.ww-button--quiet {
    background: transparent;
    border-color: transparent;
    color: var(--ww-color-text-muted);
}

.ww-button--quiet:hover {
    background: var(--ww-color-surface-subtle);
    border-color: transparent;
    color: var(--ww-color-brand-strong);
}

.ww-button--danger {
    background: var(--ww-color-danger);
    border-color: var(--ww-color-danger);
    color: #ffffff;
}

.ww-button--danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
    color: #ffffff;
}

.ww-button--danger-outline {
    background: var(--ww-color-surface);
    border-color: #f1aaaa;
    color: #991b1b;
}

.ww-button--danger-outline:hover {
    background: var(--ww-color-danger-subtle);
    border-color: var(--ww-color-danger);
    color: #991b1b;
}

.ww-button--sm {
    font-size: var(--ww-font-size-xs);
    min-block-size: var(--ww-control-height-sm);
    padding-inline: var(--ww-space-2);
}

.ww-button--lg {
    font-size: var(--ww-font-size-md);
    min-block-size: var(--ww-control-height-lg);
    padding-inline: var(--ww-space-4);
}

.ww-button--block {
    inline-size: 100%;
}

.ww-button:disabled,
.ww-button[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: .55;
    pointer-events: none;
    transform: none;
}

.ww-icon-button {
    align-items: center;
    appearance: none;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--ww-radius-sm);
    color: var(--ww-color-text-muted);
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 auto;
    inline-size: var(--ww-control-height);
    justify-content: center;
    min-block-size: var(--ww-control-height);
    padding: 0;
    transition: background-color var(--ww-duration-fast) var(--ww-ease-standard), border-color var(--ww-duration-fast) var(--ww-ease-standard), color var(--ww-duration-fast) var(--ww-ease-standard);
}

.ww-icon-button:hover {
    background: var(--ww-color-surface-subtle);
    border-color: var(--ww-color-border);
    color: var(--ww-color-brand-strong);
}

.ww-button :where(svg, .ww-button__icon),
.ww-icon-button :where(svg, .ww-icon-button__icon) {
    block-size: 1rem;
    flex: 0 0 auto;
    inline-size: 1rem;
}

/* Zeilen-Aktionen (WW.rowActions, static/js/ww-row-actions.js): Symbole mit
   Tooltip, die Hauptaktion mit Text, alles in einer Zeile. */
.ww-icon-button--sm {
    border-color: var(--ww-color-border);
    inline-size: var(--ww-control-height-sm);
    min-block-size: var(--ww-control-height-sm);
}

.ww-icon-button--danger:hover {
    background: var(--ww-color-danger-subtle);
    border-color: var(--ww-color-danger);
    color: var(--ww-color-danger);
}

.ww-icon-button--warning {
    background: var(--ww-color-warning-subtle);
    border-color: var(--ww-color-warning);
    color: var(--ww-color-text);
}

.ww-icon-button--warning:hover {
    background: var(--ww-color-warning-subtle);
    border-color: var(--ww-color-warning);
    color: var(--ww-color-text);
}

.ww-row-actions {
    align-items: center;
    display: inline-flex;
    flex-wrap: nowrap;
    gap: var(--ww-space-1);
    justify-content: flex-end;
    white-space: nowrap;
}

.ww-row-actions > .ww-button {
    white-space: nowrap;
}

.ww-tooltip {
    background: var(--ww-color-text);
    border-radius: var(--ww-radius-xs);
    box-shadow: var(--ww-shadow-md);
    color: var(--ww-color-surface);
    font-size: var(--ww-font-size-xs);
    font-weight: var(--ww-font-weight-semibold);
    line-height: var(--ww-line-height-normal);
    max-inline-size: min(18rem, calc(100vw - 1rem));
    padding: var(--ww-space-1) var(--ww-space-2);
    pointer-events: none;
    position: fixed;
    z-index: calc(var(--ww-z-toast) + 1);
}

.ww-tooltip[hidden] {
    display: none;
}

/* Page headers ----------------------------------------------------------- */

.ww-page-header {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--ww-space-2) var(--ww-space-4);
    justify-content: space-between;
    margin-block-end: var(--ww-space-3);
}

.ww-page-header__content {
    min-inline-size: 0;
}

.ww-page-header__eyebrow {
    color: var(--ww-color-text-muted);
    display: block;
    font-size: var(--ww-font-size-xs);
    font-weight: var(--ww-font-weight-bold);
    letter-spacing: .08em;
    margin-block-end: var(--ww-space-1);
    text-transform: uppercase;
}

.ww-page-header__title {
    color: var(--ww-color-text);
    font-size: var(--ww-font-size-xl);
    font-weight: var(--ww-font-weight-bold);
    letter-spacing: -.01em;
    line-height: var(--ww-line-height-tight);
    margin: 0;
}

.ww-page-header__subtitle {
    color: var(--ww-color-text-muted);
    font-size: var(--ww-font-size-base);
    margin: var(--ww-space-1) 0 0;
    max-inline-size: 48rem;
}

.ww-page-header__actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--ww-space-2);
}

/* Fields and filter bars ------------------------------------------------ */

.ww-field {
    display: grid;
    gap: var(--ww-space-1);
    min-inline-size: 0;
}

.ww-field__label {
    color: var(--ww-color-text-muted);
    font-size: var(--ww-font-size-sm);
    font-weight: var(--ww-font-weight-medium);
}

.ww-field__hint,
.ww-field__error {
    font-size: var(--ww-font-size-xs);
    line-height: var(--ww-line-height-normal);
}

.ww-field__hint {
    color: var(--ww-color-text-muted);
}

.ww-field__error {
    color: var(--ww-color-danger);
}

.ww-input,
.ww-select,
.ww-textarea {
    background: var(--ww-color-surface);
    border: 1px solid var(--ww-color-border);
    border-radius: var(--ww-radius-sm);
    color: var(--ww-color-text);
    font-family: var(--ww-font-sans);
    font-size: var(--ww-font-size-sm);
    inline-size: 100%;
    line-height: 1.3;
    min-block-size: var(--ww-control-height);
    padding: 0 var(--ww-space-3);
    transition: border-color var(--ww-duration-fast) var(--ww-ease-standard), box-shadow var(--ww-duration-fast) var(--ww-ease-standard);
}

.ww-textarea {
    min-block-size: 6rem;
    padding-block: var(--ww-space-2);
    resize: vertical;
}

.ww-select {
    cursor: pointer;
}

.ww-input::placeholder,
.ww-textarea::placeholder {
    color: var(--ww-color-text-tertiary);
}

.ww-input:hover,
.ww-select:hover,
.ww-textarea:hover {
    border-color: #c9c9c1;
}

.ww-input[aria-invalid="true"],
.ww-select[aria-invalid="true"],
.ww-textarea[aria-invalid="true"] {
    border-color: var(--ww-color-danger);
}

.ww-filterbar {
    align-items: end;
    background: var(--ww-color-surface);
    border: 1px solid var(--ww-color-border);
    border-radius: var(--ww-radius-md);
    display: flex;
    flex-wrap: wrap;
    gap: var(--ww-space-2);
    margin-block-end: var(--ww-space-3);
    padding: var(--ww-space-2);
}

.ww-filterbar__fields {
    align-items: end;
    display: flex;
    flex: 1 1 30rem;
    flex-wrap: wrap;
    gap: var(--ww-space-3);
}

.ww-filterbar__field {
    flex: 1 1 10rem;
}

.ww-filterbar__field--search {
    flex-basis: 15rem;
}

.ww-filterbar__actions {
    align-items: center;
    display: flex;
    flex: 0 1 auto;
    flex-wrap: wrap;
    gap: var(--ww-space-2);
}

.ww-filterbar__divider {
    align-self: stretch;
    background: var(--ww-color-border-subtle);
    inline-size: 1px;
}

/* Cards ------------------------------------------------------------------ */

.ww-card {
    background: var(--ww-color-surface);
    border: 1px solid var(--ww-color-border);
    border-radius: var(--ww-radius-lg);
    box-shadow: var(--ww-shadow-xs);
    color: var(--ww-color-text);
    overflow: clip;
}

.ww-card--flat {
    box-shadow: none;
}

.ww-card--interactive {
    transition: border-color var(--ww-duration-fast) var(--ww-ease-standard), box-shadow var(--ww-duration-fast) var(--ww-ease-standard), transform var(--ww-duration-fast) var(--ww-ease-standard);
}

.ww-card--interactive:hover {
    border-color: #c9c9c1;
    box-shadow: var(--ww-shadow-sm);
    transform: translateY(-1px);
}

.ww-card__header,
.ww-card__footer {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--ww-space-3);
    justify-content: space-between;
    padding: var(--ww-space-3) var(--ww-space-4);
}

.ww-card__header {
    border-block-end: 1px solid var(--ww-color-border-subtle);
}

.ww-card__footer {
    border-block-start: 1px solid var(--ww-color-border-subtle);
}

.ww-card__body {
    padding: var(--ww-space-4);
}

.ww-card__title {
    /* Ein Bild für alle Kartentitel, gleich ob h2, h3 oder div: base.html setzt
     * Überschriften sonst auf die Titelschrift mit eigener Farbe und Laufweite. */
    color: var(--ww-color-text);
    font-family: var(--ww-font-sans);
    font-size: var(--ww-font-size-md);
    letter-spacing: 0;
    font-weight: var(--ww-font-weight-bold);
    line-height: var(--ww-line-height-tight);
    margin: 0;
}

.ww-card__description {
    color: var(--ww-color-text-muted);
    font-size: var(--ww-font-size-sm);
    margin: var(--ww-space-1) 0 0;
}

/* Dashboard metrics ----------------------------------------------------- */

/*
 * These primitives deliberately do not prescribe a dashboard's data or
 * interaction model.  They give operational dashboards one stable visual
 * grammar while their domain-specific charts and workflows remain local.
 */
.ww-metric-grid {
    /* Flaches Kennzahlenband: eine Fläche mit Haarlinien statt einzelner
     * Karten. Jede Zelle zeichnet ihre Linie nach rechts und unten und ragt
     * um diese Linie über; der Rahmen schneidet den Überstand ab. So stimmen
     * die Linien auch, wenn das Band umbricht. */
    background: var(--ww-color-surface);
    border: 1px solid var(--ww-color-border);
    border-radius: var(--ww-radius-lg);
    display: grid;
    gap: 0;
    grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
    overflow: clip;
}

.ww-metric-grid > .ww-metric-card {
    background: transparent;
    min-block-size: 0;
    border: 0;
    border-block-end: 1px solid var(--ww-color-border-subtle);
    border-inline-end: 1px solid var(--ww-color-border-subtle);
    border-radius: 0;
    box-shadow: none;
    margin: 0 -1px -1px 0;
}

.ww-metric-grid > .ww-metric-card--interactive:hover {
    background: var(--ww-color-surface-subtle);
    border-color: var(--ww-color-border-subtle);
    box-shadow: none;
    transform: none;
}

.ww-metric-card {
    border: 0;
    border-radius: 0;
    box-shadow: 1px 0 0 var(--ww-color-border-subtle), 0 1px 0 var(--ww-color-border-subtle);
}

.ww-metric-grid > .ww-metric-card--interactive:hover {
    background: var(--ww-color-surface-subtle);
    box-shadow: 1px 0 0 var(--ww-color-border-subtle), 0 1px 0 var(--ww-color-border-subtle);
    transform: none;
}

.ww-metric-card {
    background: var(--ww-color-surface);
    border: 1px solid var(--ww-color-border);
    border-radius: var(--ww-radius-lg);
    color: var(--ww-color-text);
    align-content: start;
    display: grid;
    gap: var(--ww-space-1);
    padding: var(--ww-space-2) var(--ww-space-3);
    position: relative;
}

.ww-metric-card--interactive {
    cursor: pointer;
    text-decoration: none;
    transition: border-color var(--ww-duration-fast) var(--ww-ease-standard), box-shadow var(--ww-duration-fast) var(--ww-ease-standard), transform var(--ww-duration-fast) var(--ww-ease-standard);
}

.ww-metric-card--interactive:hover {
    border-color: #b8d7c6;
    box-shadow: var(--ww-shadow-sm);
    color: var(--ww-color-text);
    transform: translateY(-1px);
}

.ww-metric-card--interactive:focus-visible {
    outline: 2px solid var(--ww-color-focus);
    outline-offset: 2px;
}

.ww-metric-card__top,
.ww-metric-card__bottom {
    align-items: center;
    display: flex;
    gap: var(--ww-space-2);
    justify-content: space-between;
}

.ww-metric-card__icon {
    align-items: center;
    background: var(--ww-color-brand-subtle);
    border-radius: var(--ww-radius-sm);
    color: var(--ww-color-brand-strong);
    display: inline-flex;
    flex: 0 0 auto;
    inline-size: 1.75rem;
    justify-content: center;
    min-block-size: 1.75rem;
}

.ww-metric-card__icon :where(svg, img) {
    block-size: 1rem;
    inline-size: 1rem;
}

.ww-metric-card__value {
    color: var(--ww-color-text);
    font-size: var(--ww-font-size-lg);
    font-variant-numeric: tabular-nums;
    font-weight: var(--ww-font-weight-semibold);
    letter-spacing: -.01em;
    line-height: var(--ww-line-height-tight);
}

.ww-metric-card__label {
    color: var(--ww-color-text-muted);
    font-size: var(--ww-font-size-sm);
    font-weight: var(--ww-font-weight-medium);
    line-height: var(--ww-line-height-tight);
}

.ww-dashboard-grid {
    display: grid;
    gap: var(--ww-space-4);
    grid-template-columns: repeat(12, minmax(0, 1fr));
}

.ww-dashboard-grid > * {
    grid-column: span 12;
    min-inline-size: 0;
}

.ww-dashboard-grid__half {
    grid-column: span 6;
}

.ww-dashboard-grid__third {
    grid-column: span 4;
}

.ww-section-label {
    color: var(--ww-color-text-muted);
    font-size: var(--ww-font-size-sm);
    font-weight: var(--ww-font-weight-semibold);
}

.ww-empty-state {
    align-items: center;
    color: var(--ww-color-text-muted);
    display: flex;
    font-size: var(--ww-font-size-base);
    justify-content: center;
    min-block-size: 8rem;
    padding: var(--ww-space-6);
    text-align: center;
}

/* Status badges ---------------------------------------------------------- */

.ww-status {
    align-items: center;
    background: var(--ww-color-neutral-subtle);
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--ww-color-neutral);
    display: inline-flex;
    font-size: var(--ww-font-size-xs);
    font-weight: var(--ww-font-weight-semibold);
    gap: var(--ww-space-1);
    line-height: 1.2;
    max-inline-size: 100%;
    padding: .25rem .5rem;
    vertical-align: middle;
}

.ww-status__dot {
    background: currentColor;
    border-radius: 50%;
    block-size: .4rem;
    flex: 0 0 auto;
    inline-size: .4rem;
}

.ww-status--success {
    background: var(--ww-color-success-subtle);
    color: #166534;
}

.ww-status--warning {
    background: var(--ww-color-warning-subtle);
    color: #92400e;
}

.ww-status--danger {
    background: var(--ww-color-danger-subtle);
    color: #991b1b;
}

.ww-status--info {
    background: var(--ww-color-info-subtle);
    color: var(--ww-color-info);
}

.ww-status--brand {
    background: var(--ww-color-brand-subtle);
    color: var(--ww-color-brand-strong);
}

.ww-status--outline {
    background: transparent;
    border-color: currentColor;
}

/* Data tables ------------------------------------------------------------ */

.ww-table-scroll {
    -webkit-overflow-scrolling: touch;
    background: var(--ww-color-surface);
    border: 1px solid var(--ww-color-border);
    border-radius: var(--ww-radius-lg);
    overscroll-behavior-inline: contain;
    overflow: auto;
    /* Keep comparison tables discoverable without permanently reserving a
       thick platform scrollbar next to their data.  Keyboard focus exposes
       the thumb just like hover does. */
    scrollbar-color: transparent transparent;
    scrollbar-gutter: auto;
    scrollbar-width: thin;
}

/* Eine Tabelle scrollt seitlich, nie in einem eigenen Fenster nach unten
   (Alexander 13.11.2026): mit fester Höhe fing die Tabelle das Mausrad ab,
   und die Seite ließ sich nur noch neben der Tabelle bewegen. Viele Seiten
   setzen die Höhe selbst (auch inline), deshalb hier mit Vorrang. Dialoge,
   Popover und der Vertrieb (eigener Bereich) bleiben, wie sie sind; eine
   Seite, die bewusst ein Fenster will, setzt .ww-table-scroll--bounded. */
.ww-app-content .ww-table-scroll:not(.ww-table-scroll--bounded, :where(dialog, .ww-dialog, [role="dialog"], .modal, .modal-box, .ww-popover, .crm-body) .ww-table-scroll) {
    max-block-size: none !important;
    overscroll-behavior-block: auto;
}

.ww-table-scroll::-webkit-scrollbar {
    block-size: .45rem;
    inline-size: .45rem;
}

.ww-table-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.ww-table-scroll::-webkit-scrollbar-thumb {
    background: transparent;
    border: 2px solid transparent;
    border-radius: 999px;
    background-clip: padding-box;
}

.ww-table-scroll:is(:hover, :focus-within) {
    scrollbar-color: rgba(45, 106, 79, .42) transparent;
}

.ww-table-scroll:is(:hover, :focus-within)::-webkit-scrollbar-thumb {
    background-color: rgba(45, 106, 79, .42);
}

.ww-table-scroll:focus-visible {
    outline: 2px solid var(--ww-color-focus);
    outline-offset: 2px;
}

/* Legacy workspaces still have a number of locally named scroll regions
 * (for example ``*-table-scroll`` and ``*-list-scroll``).  Give those
 * regions the same quiet, on-intent scrollbar treatment while they are
 * incrementally migrated to .ww-table-scroll.  This avoids permanent grey
 * gutters in the actual application workspace without hiding keyboard or
 * pointer scrolling. */
.ww-ui :is([class*="scroll"], [data-ww-scroll-region]) {
    scrollbar-color: transparent transparent;
    scrollbar-gutter: auto;
    scrollbar-width: thin;
}

.ww-ui :is([class*="scroll"], [data-ww-scroll-region])::-webkit-scrollbar {
    block-size: .45rem;
    inline-size: .45rem;
}

.ww-ui :is([class*="scroll"], [data-ww-scroll-region])::-webkit-scrollbar-track {
    background: transparent;
}

.ww-ui :is([class*="scroll"], [data-ww-scroll-region])::-webkit-scrollbar-thumb {
    background: transparent;
    border: 2px solid transparent;
    border-radius: 999px;
    background-clip: padding-box;
}

.ww-ui :is([class*="scroll"], [data-ww-scroll-region]):is(:hover, :focus-within) {
    scrollbar-color: rgba(45, 106, 79, .42) transparent;
}

.ww-ui :is([class*="scroll"], [data-ww-scroll-region]):is(:hover, :focus-within)::-webkit-scrollbar-thumb {
    background-color: rgba(45, 106, 79, .42);
}

/* ww-scroll-hint.js setzt das, solange der zugehörige Bereich nichts zu scrollen hat;
 * gewinnt bewusst gegen Seitenregeln, die den Hinweis per @container einblenden. */
.ww-scroll-hint--idle {
    display: none !important;
}

.ww-table-scroll__hint {
    border-block-end: 1px solid var(--ww-color-border-subtle);
    color: var(--ww-color-text-muted);
    display: none;
    font-size: var(--ww-font-size-xs);
    margin: 0;
    padding: var(--ww-space-2) var(--ww-space-3);
}

/* A generic table can stay readable on compact page containers without
 * squashing its columns. Give the scroll wrapper tabindex/role/aria-label in
 * the template whenever a horizontal scroll can occur. */
@container ww-page (max-width: 72rem) {
    .ww-table-scroll__hint {
        display: block;
    }
}

.ww-data-table {
    border-collapse: separate;
    border-spacing: 0;
    color: var(--ww-color-text);
    font-size: var(--ww-font-size-base);
    inline-size: 100%;
    min-inline-size: 42rem;
}

.ww-data-table caption {
    caption-side: bottom;
    color: var(--ww-color-text-muted);
    font-size: var(--ww-font-size-xs);
    padding: var(--ww-space-2) var(--ww-space-4);
    text-align: start;
}

.ww-data-table :where(th, td) {
    border-block-end: 1px solid var(--ww-color-border-subtle);
    padding: var(--ww-space-2) var(--ww-space-3);
    text-align: start;
    vertical-align: middle;
}

.ww-data-table thead th {
    background: var(--ww-color-surface-subtle);
    color: var(--ww-color-text-muted);
    font-size: var(--ww-font-size-sm);
    font-weight: var(--ww-font-weight-medium);
    padding-block: .4375rem;
    white-space: nowrap;
}

.ww-data-table tbody tr {
    background: var(--ww-color-surface);
    transition: background-color var(--ww-duration-fast) var(--ww-ease-standard);
}

.ww-data-table tbody tr:hover {
    background: #fcfcfa;
}

.ww-data-table tbody tr:last-child :where(th, td) {
    border-block-end: 0;
}

.ww-data-table :where(th, td).ww-data-table__numeric {
    font-variant-numeric: tabular-nums;
    text-align: end;
}

.ww-data-table :where(th, td).ww-data-table__actions {
    inline-size: 1%;
    text-align: end;
    white-space: nowrap;
}

.ww-data-table [aria-sort] > .ww-data-table__sort {
    align-items: center;
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: inherit;
    gap: var(--ww-space-1);
    letter-spacing: inherit;
    padding: 0;
    text-transform: inherit;
}

.ww-data-table [aria-sort] > .ww-data-table__sort:hover {
    color: var(--ww-color-brand-strong);
}

.ww-data-table [aria-sort="ascending"] > .ww-data-table__sort::after,
.ww-data-table [aria-sort="descending"] > .ww-data-table__sort::after {
    color: var(--ww-color-brand);
    font-size: .7em;
}

.ww-data-table [aria-sort="ascending"] > .ww-data-table__sort::after {
    content: "▲";
}

.ww-data-table [aria-sort="descending"] > .ww-data-table__sort::after {
    content: "▼";
}

.ww-data-table__primary {
    color: var(--ww-color-text);
    font-weight: var(--ww-font-weight-semibold);
}

.ww-data-table__secondary {
    color: var(--ww-color-text-muted);
    display: block;
    font-size: var(--ww-font-size-xs);
    margin-block-start: .15rem;
}

.ww-data-table__empty td {
    color: var(--ww-color-text-muted);
    padding-block: var(--ww-space-10);
    text-align: center;
}

/* Dialogs and sheets ----------------------------------------------------- */

.ww-dialog {
    background: var(--ww-color-surface);
    border: 1px solid var(--ww-color-border);
    border-radius: var(--ww-radius-lg);
    box-shadow: var(--ww-shadow-lg);
    color: var(--ww-color-text);
    inline-size: min(38rem, calc(100vw - 2rem));
    margin: auto;
    max-block-size: min(48rem, calc(100dvb - 2rem));
    max-inline-size: calc(100vw - 2rem);
    overflow: auto;
    padding: 0;
}

.ww-dialog:not([open]) {
    display: none;
}

.ww-dialog::backdrop {
    background: rgba(18, 30, 24, .45);
}

.ww-dialog__header,
.ww-dialog__footer {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--ww-space-3);
    justify-content: space-between;
    padding: var(--ww-space-4) var(--ww-space-5);
}

.ww-dialog__header {
    border-block-end: 1px solid var(--ww-color-border-subtle);
}

.ww-dialog__body {
    padding: var(--ww-space-5);
}

.ww-dialog__footer {
    border-block-start: 1px solid var(--ww-color-border-subtle);
    justify-content: flex-end;
}

.ww-dialog__title {
    font-size: var(--ww-font-size-lg);
    font-weight: var(--ww-font-weight-bold);
    line-height: var(--ww-line-height-tight);
    margin: 0;
}

.ww-dialog__description {
    color: var(--ww-color-text-muted);
    font-size: var(--ww-font-size-sm);
    margin: var(--ww-space-1) 0 0;
}

/* Scanfeld mit Tastatur-Umschalter (WwScanKit.scanField, RM-21 G-0354) */
.ww-scan-field {
    align-items: stretch;
    display: flex;
    gap: var(--ww-space-2);
    min-inline-size: 0;
}

.ww-scan-field > input {
    flex: 1 1 auto;
    min-inline-size: 0;
}

.ww-scan-field > .ww-icon-button {
    block-size: auto;
    border-color: var(--ww-color-border);
    inline-size: 2.75rem;
    min-block-size: 2.75rem;
}

.ww-scan-field > .ww-icon-button[aria-pressed="true"] {
    background: var(--ww-color-brand-subtle);
    border-color: var(--ww-color-brand);
    color: var(--ww-color-brand-strong);
}

/* Der Umschalter holt nur die Bildschirmtastatur (Handscanner, Tablet). Mit
   Maus und echter Tastatur bewirkt er nichts und entfällt. */
@media (hover: hover) and (pointer: fine) {
    .ww-icon-button[data-ww-scan-toggle] {
        display: none;
    }
}

/* WW.dialog (static/js/ww-dialog.js): Meldung mit Zeilenumbrüchen, Eingabe, Scan-Hinweis */
.ww-dialog__message {
    margin: 0;
    overflow-wrap: anywhere;
    white-space: pre-line;
}

.ww-dialog__input {
    inline-size: 100%;
    margin-block-start: var(--ww-space-3);
}

.ww-dialog__hint {
    color: var(--ww-color-warning);
    font-size: var(--ww-font-size-sm);
    font-weight: var(--ww-font-weight-bold);
    margin: var(--ww-space-3) 0 0;
}

.ww-dialog__footer > .ww-button {
    min-block-size: 2.75rem;
}

.ww-dialog-backdrop {
    align-items: center;
    background: rgba(18, 30, 24, .45);
    display: grid;
    inset: 0;
    justify-items: center;
    padding: var(--ww-space-4);
    position: fixed;
    z-index: var(--ww-z-dialog);
}

.ww-dialog-backdrop[hidden] {
    display: none;
}

.ww-dialog-backdrop > .ww-dialog {
    display: block;
}

.ww-dialog--sheet {
    block-size: 100dvb;
    border-radius: var(--ww-radius-lg) 0 0 var(--ww-radius-lg);
    inline-size: min(32rem, calc(100vw - 2rem));
    margin: 0 0 0 auto;
    max-block-size: 100dvb;
}

.ww-dialog--sheet[open] {
    display: flex;
    flex-direction: column;
}

.ww-dialog--sheet .ww-dialog__body {
    overflow: auto;
}

@media (max-width: 44rem) {
    /* iOS zoomt beim Fokus in Felder unter 16 px (RM-21, G-0572) */
    .ww-input,
    .ww-select,
    .ww-textarea {
        font-size: var(--ww-font-size-lg);
    }

    .ww-metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ww-dashboard-grid {
        gap: var(--ww-space-3);
    }

    .ww-dashboard-grid__half,
    .ww-dashboard-grid__third {
        grid-column: span 12;
    }

    .ww-page-header {
        align-items: stretch;
        margin-block-end: var(--ww-space-4);
    }

    .ww-page-header__actions {
        inline-size: 100%;
    }

    .ww-page-header__actions > .ww-button {
        flex: 1 1 auto;
    }

    .ww-filterbar__actions {
        inline-size: 100%;
    }

    .ww-filterbar__actions > .ww-button {
        flex: 1 1 auto;
    }

    .ww-filterbar__divider {
        block-size: 1px;
        inline-size: 100%;
    }

    .ww-card__header,
    .ww-card__footer,
    .ww-card__body,
    .ww-dialog__header,
    .ww-dialog__footer,
    .ww-dialog__body {
        padding-inline: var(--ww-space-4);
    }

    .ww-dialog {
        inline-size: calc(100vw - 1rem);
        max-block-size: calc(100dvb - 1rem);
    }

    .ww-dialog--sheet {
        border-radius: var(--ww-radius-lg) var(--ww-radius-lg) 0 0;
        block-size: min(90dvb, 44rem);
        inline-size: 100vw;
        margin: auto 0 0;
    }
}

/* ── Pick-Zeile: Lagerplatz, Farbe, Groesse ──────────────────────────────
   Was der Picker im Regal sucht, stand bisher in derselben 0.68rem-Zeile wie
   SKU und Barcode - also gleich klein wie Angaben, die beim Greifen niemand
   liest. Diese Zeile hebt genau die drei Dinge heraus, nach denen gegriffen
   wird, und laesst den Rest klein.                                        */
/* Der erste Entwurf hielt die Zeile mit nowrap zusammen und liess sie seitlich
   scrollen. Am Packplatz war das falsch herum gedacht: was rechts aus der
   Karte lief, war schlicht weg (Alexander, Screenshot vom 13.08. - die
   Groesse endete als "Standard ("). Lieber eine zweite Reihe als eine
   abgeschnittene Angabe. Durch den Kurznamen und den gekuerzten Farbchip
   passt die Zeile jetzt ohnehin fast immer. */
.pick-row {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    align-items: center;
    margin: .3rem 0 .35rem;
}

.pick-chip { flex-shrink: 0; max-inline-size: 100%; }

/* Der Produktname wurde mit "..." abgeschnitten - gerade bei den langen
   Namen ("Hochwertige Leder Hundeleine Twisted Sand (Beige) - Klein (XS-S)")
   stand am Packplatz nicht mehr da, welches Produkt gemeint ist. Er darf
   jetzt auf zwei Zeilen laufen und wird erst danach gekuerzt. */
.item-card .item-card-name {
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: initial;
    line-height: 1.25;
}

.pick-chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem .55rem;
    border-radius: 6px;
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: .01em;
    white-space: nowrap;
}

/* Lagerplatz fuehrt die Zeile an: hoechster Kontrast, Ziffernbreite fest,
   damit Regal und Fach beim Ueberfliegen an derselben Stelle stehen. */
.pick-chip--loc {
    background: var(--ww-color-text);
    color: var(--ww-color-surface);
    font-family: var(--ww-font-mono);
    font-size: 1.15rem;
    font-variant-numeric: tabular-nums;
    padding-inline: .65rem;
}

.pick-chip--desk {
    background: var(--ww-color-neutral-subtle);
    color: var(--ww-color-neutral);
}

/* Retourentisch-Pick: bewusst so laut wie der Lagerplatz, aber in Warnfarbe, damit niemand
   aus Gewohnheit ins Regal greift. */
.pick-chip--return {
    background: var(--ww-color-warning);
    color: var(--ww-color-text);
    font-size: 1.15rem;
    padding-inline: .65rem;
}

.pick-return {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--ww-space-2);
    padding: var(--ww-space-2) var(--ww-space-3);
    border: 2px solid var(--ww-color-warning);
    border-radius: var(--ww-radius-md);
    background: var(--ww-color-warning-subtle);
    color: var(--ww-color-text);
    font-weight: 600;
}

.pick-return__tag {
    padding: .1rem .5rem;
    border-radius: var(--ww-radius-sm);
    background: var(--ww-color-warning);
    text-transform: uppercase;
    letter-spacing: .03em;
    font-size: .78rem;
    white-space: nowrap;
}

.pick-section {
    margin: var(--ww-space-3) 0 var(--ww-space-2);
    padding: var(--ww-space-2) var(--ww-space-3);
    border-radius: var(--ww-radius-md);
    background: var(--ww-color-neutral-subtle);
    font-weight: 700;
}

.pick-section--return {
    background: var(--ww-color-warning);
    color: var(--ww-color-text);
}

.pick-chip--size {
    background: var(--ww-color-warning-subtle);
    color: var(--ww-color-text);
    border: 1px solid var(--ww-color-warning);
}

.pick-chip--color {
    background: var(--ww-color-surface);
    color: var(--ww-color-text);
    border: 1px solid var(--ww-color-border);
}

.pick-swatch {
    inline-size: 1rem;
    block-size: 1rem;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
}

/* Kompakte Zeile (gescannt oder versendet): Variante als kleine Chips hinter
   dem Kurznamen, damit Größe und Farbe auch zusammengeklappt lesbar bleiben. */
.pick-chips--compact {
    display: inline-flex;
    flex-wrap: wrap;
    gap: var(--ww-space-1);
    margin-inline-start: var(--ww-space-2);
    vertical-align: middle;
}

.pick-chips--compact .pick-chip,
.pick-chips--compact .pick-chip--loc {
    font-size: var(--ww-font-size-xs);
    font-weight: var(--ww-font-weight-bold);
    gap: .2rem;
    padding: .05rem .4rem;
}

.pick-chips--compact .pick-swatch {
    block-size: .65rem;
    inline-size: .65rem;
}

/* Am Packplatz wird auf Abstand gelesen, oft im Vorbeigehen. */
@media (min-width: 1024px) {
    .pick-chip { font-size: 1.15rem; }
    .pick-chip--loc { font-size: 1.3rem; }
    .pick-swatch { inline-size: 1.1rem; block-size: 1.1rem; }
    .pick-chips--compact .pick-chip { font-size: var(--ww-font-size-xs); }
    .pick-chips--compact .pick-swatch { inline-size: .65rem; block-size: .65rem; }
}

/* Hundemarke (Gravur): die Marke wird ueber die Bestellnummer gesucht. Die
   Nummer steht deshalb in jeder Pick-Ansicht als erste Angabe und am
   groessten, Name, Platz und Gravur folgen kleiner darunter
   (LogistikShared.dogtagOrderHtml, Alexander 13.11.2026). */
.pick-dogtag-order {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 var(--ww-space-2);
    margin: 0 0 var(--ww-space-1);
    padding: var(--ww-space-1) var(--ww-space-2);
    border-inline-start: 4px solid var(--ww-color-brand);
    border-radius: var(--ww-radius-sm);
    background: var(--ww-color-brand-subtle);
    color: var(--ww-color-text);
    line-height: var(--ww-line-height-tight);
}

.pick-dogtag-order__label {
    font-size: var(--ww-font-size-sm);
    font-weight: var(--ww-font-weight-semibold);
    color: var(--ww-color-text-muted);
}

.pick-dogtag-order__number {
    font-family: var(--ww-font-mono);
    font-size: 1.9rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: .02em;
    overflow-wrap: anywhere;
}

.pick-dogtag-order__target {
    font-size: var(--ww-font-size-md);
    font-weight: var(--ww-font-weight-bold);
}

.item-card:has(> .item-card-info > .pick-dogtag-order) .item-card-name,
.pick-item--dogtag .pick-item-name,
.sp-line.is-dogtag .sp-line__name {
    font-size: var(--ww-font-size-sm);
}

.sp-line.is-dogtag .sp-line__loc { font-size: var(--ww-font-size-md); }
.sp-line.is-dogtag .sp-line__qty strong { font-size: var(--ww-font-size-xl); }

/* Erledigte Positionen treten zurueck, sonst konkurrieren sie optisch mit
   dem, was noch zu greifen ist. */
.item-card.done .pick-row,
.item-card.fulfilled .pick-row { opacity: .5; }

/* ---------- Unternavigation als Tabs (Muster .pim-tabs, allgemein) ---------- */
.ww-subtabs {
    border-block-end: 1px solid var(--ww-color-border);
    display: flex;
    flex-wrap: wrap;
    gap: var(--ww-space-1);
    margin-block-end: var(--ww-space-4);
}
.ww-subtabs a, .ww-subtabs button {
    background: none;
    border: 0;
    border-block-end: 2px solid transparent;
    color: var(--ww-color-text-muted);
    font-size: var(--ww-font-size-sm);
    font-weight: var(--ww-font-weight-medium);
    padding: var(--ww-space-2) var(--ww-space-3);
    text-decoration: none;
}
.ww-subtabs a:hover, .ww-subtabs button:hover { color: var(--ww-color-text); }
.ww-subtabs [aria-current="page"], .ww-subtabs [aria-selected="true"] { border-block-end-color: var(--ww-color-brand); color: var(--ww-color-text); }
.ww-subtabs__count {
    background: var(--ww-color-warning-subtle);
    border-radius: 999px;
    color: var(--ww-color-warning);
    font-size: var(--ww-font-size-xs);
    margin-inline-start: var(--ww-space-1);
    padding: 0 .4rem;
}
.ww-subtabs__count--danger { background: var(--ww-color-danger-subtle); color: var(--ww-color-danger); }
@media (max-width: 640px) {
    .ww-subtabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .ww-subtabs a, .ww-subtabs button { white-space: nowrap; }
}

/* ---------- Zeitleiste / Verlauf (Muster .crm-timeline, allgemein) ---------- */
.ww-timeline { display: flex; flex-direction: column; }
.ww-tl { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: .75rem; }
.ww-tl__rail { display: flex; flex-direction: column; align-items: center; }
.ww-tl__dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--ww-color-neutral-subtle); color: var(--ww-color-neutral); font-size: .75rem; }
.ww-tl__dot--success { background: var(--ww-color-success-subtle); color: var(--ww-color-success); }
.ww-tl__dot--info { background: var(--ww-color-info-subtle); color: var(--ww-color-info); }
.ww-tl__dot--warning { background: var(--ww-color-warning-subtle); color: var(--ww-color-warning); }
.ww-tl__dot--danger { background: var(--ww-color-danger-subtle); color: var(--ww-color-danger); }
.ww-tl__line { flex: 1; width: 1px; background: var(--ww-color-border); min-height: 12px; }
.ww-tl__body { padding: .2rem 0 1.1rem; display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.ww-tl__meta { display: flex; gap: .5rem; font-size: .8rem; color: var(--ww-color-text-tertiary); flex-wrap: wrap; }
.ww-tl__meta b { color: var(--ww-color-text); font-size: .85rem; }
.ww-tl__text { font-size: .875rem; line-height: 1.5; color: var(--ww-color-text-muted); white-space: pre-wrap; }

/* ---------- Kanban (Muster .crm-kanban, allgemein) ---------- */
.ww-kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); gap: .625rem; overflow-x: auto; align-items: start; padding-bottom: .5rem; }
.ww-kanban__col { background: var(--ww-color-neutral-subtle); border-radius: var(--ww-radius-md, 10px); padding: .625rem; display: flex; flex-direction: column; gap: .5rem; min-height: 320px; }
.ww-kanban__col.is-over { outline: 2px dashed var(--ww-color-brand); }
.ww-kanban__head { display: flex; justify-content: space-between; align-items: center; font-size: var(--ww-font-size-sm); font-weight: var(--ww-font-weight-medium); color: var(--ww-color-text); padding: 0 .125rem .25rem; }
.ww-kanban__card { background: var(--ww-color-surface); border-radius: 9px; border: 1.5px solid transparent; padding: .65rem .7rem; display: flex; flex-direction: column; gap: .4rem; box-shadow: var(--ww-shadow-sm, 0 1px 2px rgba(0,0,0,.06)); cursor: pointer; color: inherit; text-decoration: none; }
.ww-kanban__card:hover { box-shadow: var(--ww-shadow-md, 0 2px 8px rgba(0,0,0,.08)); }
.ww-kanban__card.is-alert { border-color: var(--ww-color-danger); }
.ww-progress { height: 6px; border-radius: 999px; background: var(--ww-color-border-subtle); overflow: hidden; }
.ww-progress > span { display: block; height: 100%; background: var(--ww-color-brand); border-radius: inherit; }
.ww-progress--warning > span { background: var(--ww-color-warning); }
.ww-progress--danger > span { background: var(--ww-color-danger); }

/* ---------- Erklärung „So funktioniert's“ (Seitenkopf-Ergänzung) ---------- */
.ww-howto { background: var(--ww-color-surface-subtle); border: 1px solid var(--ww-color-border-subtle); border-radius: var(--ww-radius-md, 10px); padding: var(--ww-space-3) var(--ww-space-4); margin-block-end: var(--ww-space-4); font-size: var(--ww-font-size-sm); color: var(--ww-color-text-muted); }
.ww-howto ol { display: flex; flex-wrap: wrap; gap: var(--ww-space-2) var(--ww-space-5); margin: var(--ww-space-2) 0 0; padding-inline-start: 1.1rem; }
.ww-howto details { margin-top: var(--ww-space-2); }
.ww-howto summary { cursor: pointer; color: var(--ww-color-brand); }

/* Popover und Aktionsmenü (static/js/ww-popover.js) ---------------------- */

.ww-popover {
    background: var(--ww-color-surface-raised);
    border: 1px solid var(--ww-color-border);
    border-radius: var(--ww-radius-lg);
    box-shadow: var(--ww-shadow-md);
    color: var(--ww-color-text);
    font-size: var(--ww-font-size-base);
    inline-size: max-content;
    min-inline-size: 12rem;
    overflow: auto;
    overscroll-behavior: contain;
    padding: var(--ww-space-2);
    position: fixed;
    z-index: var(--ww-z-dropdown);
}

.ww-popover--menu {
    min-inline-size: 11rem;
    padding: var(--ww-space-1);
}

.ww-popover__title {
    color: var(--ww-color-text-muted);
    font-size: var(--ww-font-size-sm);
    font-weight: var(--ww-font-weight-medium);
    padding: var(--ww-space-1) var(--ww-space-2) var(--ww-space-2);
}

.ww-menu {
    display: grid;
    gap: 1px;
}

.ww-menu__item {
    align-items: center;
    appearance: none;
    background: transparent;
    border: 0;
    border-radius: var(--ww-radius-xs);
    color: var(--ww-color-text);
    cursor: pointer;
    display: flex;
    font: inherit;
    gap: var(--ww-space-2);
    inline-size: 100%;
    min-block-size: var(--ww-control-height-sm);
    padding: var(--ww-space-1) var(--ww-space-2);
    text-align: start;
    text-decoration: none;
}

.ww-menu__item:is(:hover, :focus-visible) {
    background: var(--ww-color-neutral-subtle);
    color: var(--ww-color-text);
    outline: none;
}

.ww-menu__item--danger {
    color: var(--ww-color-danger);
}

.ww-menu__item:disabled {
    color: var(--ww-color-text-tertiary);
    cursor: default;
}

.ww-menu__divider {
    background: var(--ww-color-border-subtle);
    block-size: 1px;
    margin: var(--ww-space-1) 0;
}

/* Positionsliste im Popover (Bild, Titel, Variante, SKU, Menge) */
.ww-item-list {
    display: grid;
    inline-size: min(22rem, 86vw);
}

.ww-item-list__row {
    align-items: start;
    border-block-start: 1px solid var(--ww-color-border-subtle);
    display: grid;
    gap: var(--ww-space-2) var(--ww-space-3);
    grid-template-columns: 2.5rem minmax(0, 1fr) auto;
    padding: var(--ww-space-2);
}

.ww-item-list__row:first-child {
    border-block-start: 0;
}

.ww-item-list__thumb {
    background: var(--ww-color-neutral-subtle);
    block-size: 2.5rem;
    border-radius: var(--ww-radius-xs);
    inline-size: 2.5rem;
    object-fit: contain;
}

.ww-item-list__title {
    font-weight: var(--ww-font-weight-medium);
    overflow-wrap: anywhere;
}

.ww-item-list__meta {
    color: var(--ww-color-text-muted);
    font-size: var(--ww-font-size-sm);
}

.ww-item-list__qty {
    color: var(--ww-color-text-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Knopf, der wie Text in der Zeile steht und ein Popover öffnet */
.ww-inline-trigger {
    appearance: none;
    background: transparent;
    border: 0;
    border-radius: var(--ww-radius-xs);
    color: inherit;
    cursor: pointer;
    font: inherit;
    margin-inline: calc(var(--ww-space-2) * -1);
    padding: var(--ww-space-1) var(--ww-space-2);
    white-space: nowrap;
}

.ww-inline-trigger::after {
    color: var(--ww-color-text-muted);
    content: "▾";
    font-size: .625rem;
    margin-inline-start: var(--ww-space-1);
}

.ww-inline-trigger:is(:hover, [aria-expanded="true"]) {
    background: var(--ww-color-neutral-subtle);
}

.ww-inline-trigger--danger {
    color: var(--ww-color-danger);
    font-weight: var(--ww-font-weight-semibold);
}

/* Hinweiszeile: Warnungen als Pillen statt als Kasten -------------------- */

.ww-notice-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--ww-space-2);
}

.ww-notice-row:empty {
    display: none;
}

.ww-notice-row__label {
    color: var(--ww-color-text-muted);
    font-size: var(--ww-font-size-sm);
}

:is(a, button).ww-status {
    appearance: none;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
}

:is(a, button).ww-status:hover {
    border-color: currentColor;
}

:is(a, button).ww-status[aria-pressed="true"] {
    border-color: currentColor;
}

.ww-status--lg {
    font-size: var(--ww-font-size-sm);
    padding: .3125rem .625rem;
}

/* Ansichten: feste Filter als ruhige Reiter vor der Suche ---------------- */

.ww-views {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}

.ww-views__item {
    appearance: none;
    background: transparent;
    border: 0;
    border-radius: var(--ww-radius-xs);
    color: var(--ww-color-text-muted);
    cursor: pointer;
    font: inherit;
    font-weight: var(--ww-font-weight-medium);
    min-block-size: 1.75rem;
    padding: 0 var(--ww-space-3);
    text-decoration: none;
    white-space: nowrap;
}

/* Als Link (Ansichten mit eigener URL): ohne Unterstrich und Linkfarbe aus .ww-ui a */
.ww-ui a.ww-views__item,
a.ww-views__item {
    align-items: center;
    color: var(--ww-color-text-muted);
    display: inline-flex;
    text-decoration: none;
}

.ww-views__item:hover {
    background: var(--ww-color-neutral-subtle);
    color: var(--ww-color-text);
}

.ww-views__item:is([aria-pressed="true"], [aria-current="page"]),
.ww-ui a.ww-views__item:is([aria-pressed="true"], [aria-current="page"]) {
    background: var(--ww-color-neutral-subtle);
    color: var(--ww-color-text);
    font-weight: var(--ww-font-weight-semibold);
}

/* Auswahl-Leiste über einer Tabelle -------------------------------------- */

.ww-bulkbar {
    align-items: center;
    background: var(--ww-color-brand-subtle);
    border-block-end: 1px solid var(--ww-color-border-subtle);
    display: flex;
    flex-wrap: wrap;
    gap: var(--ww-space-2);
    padding: var(--ww-space-2) var(--ww-space-3);
}

.ww-bulkbar__count {
    font-weight: var(--ww-font-weight-semibold);
    margin-inline-end: var(--ww-space-1);
}

/* Listen-Tabelle: eine Zeile je Vorgang, Auswahl, Aktionen am Ende ------- */

.ww-data-table--index :where(th, td) {
    white-space: nowrap;
}

.ww-data-table--index tbody tr[aria-selected="true"] {
    background: var(--ww-color-brand-subtle);
}

.ww-data-table--index tbody tr[data-tone="danger"] {
    box-shadow: inset 3px 0 0 var(--ww-color-danger);
}

.ww-data-table--index tbody tr[data-tone="warning"] {
    box-shadow: inset 3px 0 0 var(--ww-color-warning);
}

.ww-data-table__check {
    inline-size: 1%;
    padding-inline-end: 0;
}

.ww-data-table__truncate {
    display: block;
    max-inline-size: 14rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ww-data-table__muted {
    color: var(--ww-color-text-muted);
}

.ww-tag {
    background: var(--ww-color-neutral-subtle);
    border-radius: var(--ww-radius-xs);
    color: var(--ww-color-neutral);
    display: inline-block;
    font-size: var(--ww-font-size-xs);
    font-weight: var(--ww-font-weight-semibold);
    line-height: 1.125rem;
    margin-inline-start: var(--ww-space-1);
    padding: 0 .3125rem;
    vertical-align: 1px;
}

.ww-tag--info {
    background: var(--ww-color-info-subtle);
    color: var(--ww-color-info);
}

.ww-tag--brand {
    background: var(--ww-color-brand-subtle);
    color: var(--ww-color-brand-strong);
}

.ww-tag--warning {
    background: var(--ww-color-warning-subtle);
    color: var(--ww-color-warning);
}

.ww-tag--danger {
    background: var(--ww-color-danger-subtle);
    color: var(--ww-color-danger);
}

/* Eine Tabelle direkt in einer Karte nutzt deren Rahmen, kein zweiter Rahmen. */
.ww-card > .ww-table-scroll {
    border: 0;
    border-radius: 0;
}

/* Serienscan und Mengeneingabe beim Picken (static/js/ww-batch-scan.js) ---- */

.ww-scan-notice {
    background: var(--ww-color-danger-subtle);
    border: 2px solid var(--ww-color-danger);
    border-radius: var(--ww-radius-md);
    color: var(--ww-color-danger);
    font-size: var(--ww-font-size-lg);
    font-weight: var(--ww-font-weight-bold);
    margin: 0 0 var(--ww-space-2);
    overflow-wrap: anywhere;
    padding: var(--ww-space-3) var(--ww-space-4);
}

.ww-scan-notice[hidden],
.ww-qty-offer[hidden] {
    display: none;
}

.ww-qty-offer {
    align-items: center;
    background: var(--ww-color-info-subtle);
    border: 1px solid var(--ww-color-info);
    border-radius: var(--ww-radius-md);
    color: var(--ww-color-info);
    display: flex;
    flex-wrap: wrap;
    gap: var(--ww-space-2) var(--ww-space-3);
    justify-content: space-between;
    margin-block-end: var(--ww-space-2);
    padding: var(--ww-space-2) var(--ww-space-3);
}

.ww-qty-offer__text {
    flex: 1 1 12rem;
    font-size: var(--ww-font-size-md);
    font-weight: var(--ww-font-weight-semibold);
    min-inline-size: 0;
    overflow-wrap: anywhere;
}

.ww-qty-offer > .ww-button {
    min-block-size: 3rem;
}

.ww-qty-dialog {
    inline-size: min(24rem, calc(100vw - 2rem));
}

.ww-qty-pad__value {
    border: 1px solid var(--ww-color-border);
    border-radius: var(--ww-radius-md);
    display: block;
    font-size: var(--ww-font-size-2xl);
    font-weight: var(--ww-font-weight-bold);
    margin-block: var(--ww-space-3);
    padding: var(--ww-space-2) var(--ww-space-4);
    text-align: center;
}

.ww-qty-pad {
    display: grid;
    gap: var(--ww-space-2);
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ww-qty-pad__key {
    font-size: var(--ww-font-size-xl);
    min-block-size: 3.5rem;
}

.ww-qty-dialog .ww-dialog__footer > .ww-button {
    flex: 1 1 8rem;
    min-block-size: 3.5rem;
}

/* Ressourcenliste ---------------------------------------------------------
 * Eine Zeile je Objekt wie Shopifys Lagerort-Karte: Name mit Nebenangabe,
 * Art als Status, Menge rechtsbündig, Aktion dezent am Zeilenende. Spalten
 * stehen über alle Zeilen bündig (subgrid). Kein Kachelgitter mehr für
 * Lagerplätze, Behälter oder Positionen.
 *
 * <ul class="ww-resource-list">
 *   <li class="ww-resource-list__head"><span>Platz</span><span>Art</span><span>Menge</span><span></span></li>
 *   <li class="ww-resource-list__item">
 *     <div class="ww-resource-list__main"><span class="ww-resource-list__title">A-03-A02</span>
 *       <span class="ww-resource-list__meta">Pickfach</span></div>
 *     <span class="ww-status ww-status--success">Pickplatz 1</span>
 *     <span class="ww-resource-list__value">14 Stk</span>
 *     <div class="ww-resource-list__actions">…</div>
 *   </li>
 * </ul>
 */
.ww-resource-list {
    column-gap: var(--ww-space-4);
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content max-content minmax(max-content, auto);
    list-style: none;
    margin: 0;
    padding: 0;
}

.ww-resource-list__head,
.ww-resource-list__item {
    align-items: center;
    border-block-start: 1px solid var(--ww-color-border-subtle);
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: subgrid;
    min-block-size: 2.5rem;
    padding-block: var(--ww-space-1);
}

.ww-resource-list__head {
    border-block-start: 0;
    color: var(--ww-color-text-muted);
    font-size: var(--ww-font-size-xs);
    font-weight: var(--ww-font-weight-medium);
    min-block-size: 0;
    padding-block: 0 var(--ww-space-1);
}

.ww-resource-list__item > .ww-status {
    justify-self: start;
}

.ww-resource-list__head > :nth-child(3),
.ww-resource-list__value {
    text-align: end;
}

.ww-resource-list__head + .ww-resource-list__item,
.ww-resource-list > .ww-resource-list__item:first-child {
    border-block-start-color: var(--ww-color-border);
}

.ww-resource-list > .ww-resource-list__item:first-child {
    border-block-start: 0;
}

.ww-resource-list__main {
    display: flex;
    flex-wrap: wrap;
    gap: 0 var(--ww-space-2);
    align-items: baseline;
    min-inline-size: 0;
}

.ww-resource-list__title {
    font-weight: var(--ww-font-weight-semibold);
    overflow-wrap: anywhere;
}

.ww-resource-list__title a {
    color: inherit;
    text-decoration: none;
}

.ww-resource-list__title a:hover {
    text-decoration: underline;
}

.ww-resource-list__meta {
    color: var(--ww-color-text-muted);
    font-size: var(--ww-font-size-sm);
}

.ww-resource-list__value {
    font-variant-numeric: tabular-nums;
    font-weight: var(--ww-font-weight-semibold);
    white-space: nowrap;
}

.ww-resource-list__actions {
    display: flex;
    gap: var(--ww-space-1);
    justify-content: flex-end;
}

.ww-resource-list__actions .ww-button--quiet {
    color: rgb(var(--ww-color-link-rgb));
}

/* Summenzeile über der Liste, z. B. "Zugriff 14 Stk" */
.ww-resource-list__summary {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: var(--ww-space-1) var(--ww-space-4);
    margin-block-end: var(--ww-space-2);
}

.ww-resource-list__summary strong {
    font-size: var(--ww-font-size-md);
    font-variant-numeric: tabular-nums;
}

.ww-resource-list__summary span {
    color: var(--ww-color-text-muted);
}

@supports not (grid-template-columns: subgrid) {
    .ww-resource-list__head,
    .ww-resource-list__item {
        grid-template-columns: minmax(0, 1fr) 7rem 5rem 11rem;
    }
}

/* Schmale Arbeitsfläche: Name und Menge oben, Art und Aktion darunter */
@container ww-page (max-width: 36rem) {
    .ww-resource-list {
        grid-template-columns: minmax(0, 1fr) max-content;
    }

    .ww-resource-list__head {
        display: none;
    }

    .ww-resource-list__item {
        grid-template-columns: minmax(0, 1fr) max-content;
        padding-block: var(--ww-space-2);
        row-gap: var(--ww-space-1);
    }

    .ww-resource-list__main { grid-column: 1; grid-row: 1; }
    .ww-resource-list__value { grid-column: 2; grid-row: 1; }
    .ww-resource-list__item > .ww-status { grid-column: 1; grid-row: 2; }
    .ww-resource-list__actions { grid-column: 2; grid-row: 2; }
}

/*
 * DataTables-Blättern im Stil der Zweitknöpfe (.ww-button--secondary) statt
 * Bootstrap-blau. Gilt für jede Tabelle mit DataTables, ohne Änderung je Seite:
 * Bootstrap-5-Markup (.pagination .page-item .page-link) und das einfache
 * Markup (.paginate_button). Aktuelle Seite hell in der Markenfarbe.
 */
.dataTables_wrapper .dataTables_paginate .pagination {
    flex-wrap: wrap;
    gap: var(--ww-space-1);
    margin: 0;
}

.dataTables_wrapper .dataTables_paginate .page-link,
.dataTables_wrapper .dataTables_paginate .paginate_button:not(.page-item) {
    align-items: center;
    background: var(--ww-color-surface);
    border: 1px solid var(--ww-color-border);
    border-radius: var(--ww-radius-sm) !important;
    box-shadow: none;
    color: var(--ww-color-text);
    display: inline-flex;
    font-size: var(--ww-font-size-sm);
    font-weight: var(--ww-font-weight-medium);
    justify-content: center;
    margin: 0;
    min-block-size: var(--ww-control-height-sm);
    min-inline-size: var(--ww-control-height-sm);
    padding: 0 var(--ww-space-3);
}

.dataTables_wrapper .dataTables_paginate .page-link:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button:not(.page-item):hover {
    background: var(--ww-color-surface-subtle);
    border-color: var(--ww-color-text-tertiary);
    color: var(--ww-color-text);
}

.dataTables_wrapper .dataTables_paginate .page-link:focus,
.dataTables_wrapper .dataTables_paginate .paginate_button:not(.page-item):focus {
    box-shadow: 0 0 0 3px var(--ww-color-focus-ring);
    outline: none;
}

.dataTables_wrapper .dataTables_paginate .page-item.active .page-link,
.dataTables_wrapper .dataTables_paginate .paginate_button:not(.page-item).current {
    background: var(--ww-color-brand-subtle);
    border-color: var(--ww-color-brand-subtle);
    color: var(--ww-color-brand-strong);
    font-weight: var(--ww-font-weight-semibold);
}

.dataTables_wrapper .dataTables_paginate .page-item.disabled .page-link,
.dataTables_wrapper .dataTables_paginate .paginate_button:not(.page-item).disabled {
    background: var(--ww-color-surface);
    border-color: var(--ww-color-border-subtle);
    color: var(--ww-color-text-tertiary);
}

/* Leiste unter einer gekürzten Tabelle (ww-row-limit.js): "25 von 153 … · Alle 153 anzeigen". */
.ww-row-limit {
    align-items: center;
    border-block-start: 1px solid var(--ww-color-border-subtle);
    color: var(--ww-color-text-muted);
    display: flex;
    flex-wrap: wrap;
    font-size: var(--ww-font-size-xs);
    gap: var(--ww-space-3);
    justify-content: space-between;
    padding: var(--ww-space-2) var(--ww-space-4);
}

.ww-row-limit[hidden] {
    display: none;
}

/* Platz-Wähler ohne Scanner (static/js/ww-location-picker.js): Regal, dann die nächsten
   Stufen als Kacheln, oder tippen und aus Vorschlägen wählen. Große Ziele für Touch. */
.ww-loc-picker {
    display: grid;
    gap: var(--ww-space-2);
    margin-block: var(--ww-space-3);
}

.ww-loc-picker__toggle {
    justify-self: start;
}

.ww-loc-picker__panel {
    background: var(--ww-color-surface-subtle);
    border: 1px solid var(--ww-color-border-subtle);
    border-radius: var(--ww-radius-lg);
    display: grid;
    gap: var(--ww-space-3);
    padding: var(--ww-space-3);
}

.ww-loc-picker__panel[hidden],
.ww-loc-picker__crumbs[hidden],
.ww-loc-picker__heading[hidden],
.ww-loc-picker__tiles[hidden],
.ww-loc-picker__suggestions[hidden] {
    display: none;
}

.ww-loc-picker__search {
    font-size: var(--ww-font-size-lg);
    min-block-size: 3rem;
}

.ww-loc-picker__suggestions {
    display: grid;
    gap: var(--ww-space-1);
}

.ww-loc-picker__suggestion,
.ww-loc-picker__tile {
    align-items: start;
    background: var(--ww-color-surface);
    border: 1px solid var(--ww-color-border);
    border-radius: var(--ww-radius-md);
    color: var(--ww-color-text);
    cursor: pointer;
    display: grid;
    gap: var(--ww-space-1);
    min-block-size: 3rem;
    padding: var(--ww-space-2) var(--ww-space-3);
    text-align: start;
}

.ww-loc-picker__suggestion {
    align-items: center;
    grid-template-columns: 1fr auto;
}

.ww-loc-picker__suggestion:hover,
.ww-loc-picker__suggestion:focus-visible,
.ww-loc-picker__tile:hover,
.ww-loc-picker__tile:focus-visible {
    border-color: var(--ww-color-brand);
    box-shadow: var(--ww-shadow-sm);
}

.ww-loc-picker__tiles {
    display: grid;
    gap: var(--ww-space-2);
    grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
}

.ww-loc-picker__tile--place {
    background: var(--ww-color-brand-subtle);
}

.ww-loc-picker__name {
    font-size: var(--ww-font-size-lg);
    overflow-wrap: anywhere;
    font-weight: var(--ww-font-weight-semibold);
}

.ww-loc-picker__meta {
    color: var(--ww-color-text-muted);
    font-size: var(--ww-font-size-xs);
}

.ww-loc-picker__meta.is-empty {
    color: var(--ww-color-success);
}

.ww-loc-picker__bar {
    background: var(--ww-color-border-subtle);
    border-radius: var(--ww-radius-xs);
    block-size: .3rem;
    display: block;
    overflow: hidden;
}

.ww-loc-picker__bar-fill {
    background: var(--ww-color-brand);
    block-size: 100%;
    display: block;
}

.ww-loc-picker__crumbs {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--ww-space-1);
}

.ww-loc-picker__crumb {
    background: none;
    border: 0;
    border-radius: var(--ww-radius-sm);
    color: var(--ww-color-brand-strong);
    cursor: pointer;
    font-weight: var(--ww-font-weight-medium);
    min-block-size: 2.25rem;
    padding: 0 var(--ww-space-2);
}

.ww-loc-picker__crumb[aria-current="step"] {
    color: var(--ww-color-text);
}

.ww-loc-picker__sep,
.ww-loc-picker__heading,
.ww-loc-picker__status,
.ww-loc-picker__none {
    color: var(--ww-color-text-muted);
    margin: 0;
}

.ww-loc-picker__status:empty {
    display: none;
}
