/* Modified by BW-Tech GmbH */
/* Verwaltung des Marketplace. Farben und Formen wie die Storefront
   (storefront.css), Kontraste nach WCAG 2.2 AA. Keine Inline-Stile nötig. */

@font-face {
    font-family: "BW Inter";
    src: url("fonts/inter-400.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "BW Inter";
    src: url("fonts/inter-500.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "BW Inter";
    src: url("fonts/inter-600.woff2") format("woff2");
    font-weight: 600 800;
    font-style: normal;
    font-display: swap;
}

:root {
    --adm-bg: #f5f8fa;
    --adm-surface: #ffffff;
    --adm-soft: #edf7f7;
    --adm-text: #262b45;
    --adm-muted: #3f6173;
    --adm-primary: #386983;
    --adm-primary-dark: #244b61;
    --adm-accent: #00e4bd;
    --adm-accent-ink: #17495b;
    --adm-border: #d4dde7;
    --adm-input: #6b7f90;
    --adm-ok-bg: #dff3ea;
    --adm-ok-fg: #0b6844;
    --adm-warn-bg: #fdf3e1;
    --adm-warn-fg: #8a5300;
    --adm-danger-bg: #fdeaea;
    --adm-danger-fg: #8f1919;
    --adm-danger: #b42318;
    --adm-info-bg: #eaf3f7;
    --adm-shadow: 0 14px 36px rgba(26, 56, 76, .09);
    --adm-radius: 8px;
    --adm-font: "BW Inter", Inter, "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
    --adm-mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

/* ------------------------------------------------------------------ Kopf
   Gilt auch auf den älteren Verwaltungsseiten, deshalb ohne .adm davor. */

.adm-skip {
    position: absolute;
    z-index: 100;
    top: 12px;
    left: 16px;
    border-radius: var(--adm-radius);
    padding: 10px 16px;
    background: var(--adm-primary-dark);
    color: #fff;
    font: 600 16px/1.2 var(--adm-font);
    text-decoration: none;
    transform: translateY(-200%);
}

.adm-skip:focus-visible {
    transform: translateY(0);
    outline: 3px solid var(--adm-accent);
    outline-offset: 2px;
}

.adm-header {
    position: sticky;
    z-index: 20;
    top: 0;
    border-bottom: 1px solid var(--adm-border);
    background: rgba(255, 255, 255, .97);
    font-family: var(--adm-font);
}

.adm-header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    max-width: 1240px;
    min-height: 72px;
    margin: 0 auto;
    padding: 0 32px;
}

.adm-brand {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 12px;
    color: var(--adm-text);
    text-decoration: none;
}

.adm-brand img {
    display: block;
    width: 88px;
    height: 58px;
    object-fit: contain;
}

.adm-brand span {
    border-left: 1px solid var(--adm-border);
    padding-left: 12px;
    color: var(--adm-muted);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.adm-nav {
    display: flex;
    flex: 1 1 auto;
    align-items: stretch;
    align-self: stretch;
    gap: 4px;
}

.adm-nav a {
    display: inline-flex;
    position: relative;
    align-items: center;
    padding: 0 12px;
    color: var(--adm-muted);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
}

.adm-nav a::after {
    position: absolute;
    right: 12px;
    bottom: 0;
    left: 12px;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--adm-accent);
    content: "";
    opacity: 0;
}

.adm-nav a:hover,
.adm-nav a.is-active {
    color: var(--adm-primary-dark);
}

.adm-nav a.is-active::after {
    opacity: 1;
}

.adm-tools {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 12px;
}

.adm-tools form {
    margin: 0;
}

.adm-lang {
    display: inline-flex;
    gap: 4px;
    border: 1px solid var(--adm-border);
    border-radius: 999px;
    padding: 4px;
    background: var(--adm-surface);
}

.adm-lang a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 32px;
    border-radius: 999px;
    color: var(--adm-muted);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .04em;
    text-decoration: none;
}

.adm-lang a:hover {
    background: var(--adm-soft);
    color: var(--adm-primary-dark);
}

.adm-lang a.is-active {
    background: var(--adm-primary-dark);
    color: #fff;
}

.adm-header a:focus-visible,
.adm-header button:focus-visible {
    outline: 3px solid var(--adm-primary-dark);
    outline-offset: 2px;
}

/* ------------------------------------------------------------------ Seite */

html:has(body.adm) {
    scroll-padding-top: 96px;
}

body.adm {
    margin: 0;
    min-width: 320px;
    background: var(--adm-bg);
    color: var(--adm-text);
    font: 400 16px/1.5 var(--adm-font);
    -webkit-font-smoothing: antialiased;
}

.adm *,
.adm *::before,
.adm *::after {
    box-sizing: border-box;
}

.adm-main {
    max-width: 1240px;
    margin: 0 auto;
    padding: 32px 32px 72px;
}

.adm-main:focus {
    outline: none;
}

.adm-page {
    display: grid;
    gap: 24px;
}

.adm-page-narrow {
    max-width: 760px;
}

.adm h1,
.adm h2,
.adm h3 {
    margin: 0;
    color: var(--adm-text);
    font-weight: 600;
    letter-spacing: -.01em;
    line-height: 1.2;
}

.adm h1 {
    font-size: 32px;
}

.adm h2 {
    font-size: 20px;
}

.adm h3 {
    margin-top: 8px;
    font-size: 17px;
}

.adm p {
    margin: 0;
}

/* Ohne Spezifität, damit Knöpfe und andere Klassen die Linkfarbe überschreiben. */
:where(.adm a) {
    color: var(--adm-primary);
    text-underline-offset: 3px;
}

:where(.adm a):hover {
    color: var(--adm-primary-dark);
}

.adm a:focus-visible,
.adm button:focus-visible,
.adm input:focus-visible,
.adm select:focus-visible,
.adm textarea:focus-visible,
.adm summary:focus-visible,
.adm [tabindex]:focus-visible {
    outline: 3px solid var(--adm-primary-dark);
    outline-offset: 3px;
}

.adm-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px 24px;
}

.adm-head-text {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.adm-head h1 {
    overflow-wrap: anywhere;
}

/* Überschrift und Zustandsplakette nebeneinander; die Plakette gehört nicht zum h1. */
.adm-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

.adm-title-row .adm-badge {
    font-size: 15px;
}

/* Sprungleiste der Detailseite */
.adm-jump ul {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 20px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 15px;
}

.adm-jump a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-weight: 600;
}

.adm time {
    white-space: nowrap;
}

.adm-strong {
    display: block;
    font-weight: 600;
}

.adm-connected {
    font-size: 16px;
}

.adm-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding-left: 20px;
}

.adm-noroom {
    align-self: center;
    color: var(--adm-warn-fg);
    font-size: 14px;
    font-weight: 600;
}

.adm-noroom a {
    color: inherit;
}

.adm-head-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.adm-head-actions form {
    margin: 0;
}

.adm-eyebrow {
    color: var(--adm-primary);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.adm-lead {
    max-width: 68ch;
    color: var(--adm-muted);
    font-size: 17px;
}

.adm-meta {
    color: var(--adm-muted);
    font-size: 15px;
}

.adm-meta strong {
    color: var(--adm-text);
    font-weight: 600;
}

.adm-note {
    max-width: 72ch;
    border-left: 3px solid var(--adm-border);
    padding: 4px 0 4px 12px;
    color: var(--adm-muted);
    font-size: 15px;
}

.adm-back-wrap {
    margin-bottom: -8px;
}

.adm-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    font-weight: 600;
    text-decoration: none;
}

.adm-back:hover {
    text-decoration: underline;
}

.adm-muted {
    color: var(--adm-muted);
}

.adm-mono {
    font-family: var(--adm-mono);
    font-size: .95em;
}

.adm-sub {
    display: block;
    margin-top: 2px;
    color: var(--adm-muted);
    font-size: 14px;
    font-weight: 400;
}

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

/* ------------------------------------------------------------------ Karten */

.adm-card {
    display: grid;
    gap: 16px;
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius);
    padding: 24px;
    background: var(--adm-surface);
    box-shadow: var(--adm-shadow);
}

.adm-card-plain {
    box-shadow: none;
}

/* Leerer Abschnitt: nur Überschrift und eine Zeile. */
.adm-card-compact {
    gap: 8px;
    padding-block: 16px;
    box-shadow: none;
}

.adm-card > .adm-btn,
.adm-card > form {
    justify-self: start;
}

.adm-stack {
    display: grid;
    gap: 24px;
    align-content: start;
}

.adm-card-danger {
    border-color: #e9b8b4;
    box-shadow: inset 4px 0 0 var(--adm-danger), var(--adm-shadow);
}

.adm-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
}

.adm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
    gap: 24px;
    align-items: start;
}

.adm-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.adm-kpi {
    display: grid;
    gap: 4px;
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius);
    padding: 16px 20px;
    background: var(--adm-surface);
    box-shadow: inset 0 3px 0 var(--adm-accent);
}

.adm-kpi-warn {
    box-shadow: inset 0 3px 0 #d9a440;
}

.adm-kpi-value {
    font-size: 32px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.adm-kpi-label {
    color: var(--adm-muted);
    font-size: 15px;
}

.adm-kpi-sub {
    color: var(--adm-muted);
    font-size: 13px;
}

/* Kennzahl als Link auf die gefilterte Liste */
.adm-kpi-link {
    display: grid;
    gap: 4px;
    color: inherit;
    text-decoration: none;
}

.adm-kpi-link .adm-kpi-value {
    color: var(--adm-text);
}

.adm-kpi-link:hover .adm-kpi-label {
    color: var(--adm-primary-dark);
    text-decoration: underline;
}

/* ------------------------------------------------------------------ Hinweise */

.adm-alert {
    display: grid;
    gap: 12px;
    justify-items: start;
    border: 1px solid;
    border-radius: var(--adm-radius);
    padding: 12px 16px;
    font-size: 15px;
}

.adm-alert ul {
    margin: 0;
    padding-left: 20px;
}

.adm-alert a {
    color: inherit;
    font-weight: 600;
}

.adm-alert-ok {
    border-color: #9ad6bb;
    background: #e8f6ef;
    color: #0b5f3d;
}

.adm-alert-warn {
    border-color: #e8c27a;
    background: var(--adm-warn-bg);
    color: #6e4300;
}

.adm-alert-danger {
    border-color: #efb2b2;
    background: #fff0f0;
    color: var(--adm-danger-fg);
}

.adm-alert-info {
    border-color: #b7d3e0;
    background: var(--adm-info-bg);
    color: var(--adm-primary-dark);
}

.adm-error-summary:focus {
    outline: 3px solid var(--adm-danger);
    outline-offset: 2px;
}

/* Rückmeldung nach einer Aktion: bekommt beim Laden den Fokus. */
.adm-alert[data-flash]:focus {
    outline: 3px solid var(--adm-primary-dark);
    outline-offset: 2px;
}

.adm-alert-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.adm-empty {
    display: grid;
    gap: 12px;
    justify-items: start;
    border: 1px dashed var(--adm-input);
    border-radius: var(--adm-radius);
    padding: 24px;
    background: var(--adm-surface);
    color: var(--adm-muted);
}

.adm-empty-small {
    padding: 16px;
    background: #f9fbfc;
}

/* ------------------------------------------------------------------ Badges */

.adm-badge,
.adm-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.6;
    white-space: nowrap;
}

.adm-badge-ok {
    background: var(--adm-ok-bg);
    color: var(--adm-ok-fg);
}

.adm-badge-warn {
    background: var(--adm-warn-bg);
    color: var(--adm-warn-fg);
}

.adm-badge-danger {
    background: var(--adm-danger-bg);
    color: var(--adm-danger-fg);
}

.adm-chip {
    border: 1px solid var(--adm-border);
    background: #f4f7f9;
    color: var(--adm-muted);
    font-weight: 500;
    white-space: normal;
}

.adm-chip-warn {
    border-color: #ecd09e;
    background: var(--adm-warn-bg);
    color: var(--adm-warn-fg);
}

.adm-status-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.adm-flag {
    display: block;
    margin-top: 4px;
    color: var(--adm-warn-fg);
    font-size: 14px;
    font-weight: 500;
}

/* ------------------------------------------------------------------ Knöpfe */

.adm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    border: 1px solid var(--adm-input);
    border-radius: var(--adm-radius);
    padding: 0 16px;
    background: var(--adm-surface);
    color: var(--adm-text);
    font: 600 15px/1.2 var(--adm-font);
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.adm-btn:hover {
    border-color: var(--adm-primary-dark);
    background: var(--adm-soft);
    color: var(--adm-primary-dark);
}

.adm-btn-primary {
    border-color: var(--adm-primary);
    background: var(--adm-primary);
    color: #fff;
}

.adm-btn-primary:hover {
    border-color: var(--adm-primary-dark);
    background: var(--adm-primary-dark);
    color: #fff;
}

.adm-btn-danger {
    border-color: var(--adm-danger);
    color: var(--adm-danger);
}

.adm-btn-danger:hover {
    border-color: var(--adm-danger);
    background: var(--adm-danger);
    color: #fff;
}

/* Letzte Bestätigung einer zerstörenden Aktion: gefüllt und deutlich. */
.adm-btn-danger-solid,
.adm-btn-danger-solid:hover {
    border-color: var(--adm-danger);
    background: var(--adm-danger);
    color: #fff;
}

.adm-btn-danger-solid:hover {
    border-color: #8f1919;
    background: #8f1919;
}

.adm-btn-quiet {
    border-color: transparent;
    background: transparent;
    color: var(--adm-primary);
}

.adm-btn-quiet:hover {
    border-color: transparent;
    background: var(--adm-soft);
}

.adm-header .adm-btn-quiet {
    color: var(--adm-muted);
}

.adm-btn-sm {
    min-height: 40px;
    padding: 0 12px;
    font-size: 14px;
}

.adm-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.adm-row-actions form {
    margin: 0;
}

/* ------------------------------------------------------------------ Formulare */

.adm-form {
    display: grid;
    gap: 20px;
}

.adm-field {
    display: grid;
    gap: 6px;
}

.adm-field label,
.adm-group-label {
    color: var(--adm-text);
    font-size: 15px;
    font-weight: 600;
}

.adm-req {
    color: var(--adm-danger);
}

.adm input[type="text"],
.adm input[type="search"],
.adm input[type="password"],
.adm input[type="number"],
.adm input[type="date"],
.adm input:not([type]),
.adm select,
.adm textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--adm-input);
    border-radius: var(--adm-radius);
    padding: 8px 12px;
    background: var(--adm-surface);
    color: var(--adm-text);
    font: 400 16px/1.4 var(--adm-font);
}

.adm textarea {
    resize: vertical;
}

.adm input[aria-invalid="true"],
.adm textarea[aria-invalid="true"] {
    border: 2px solid var(--adm-danger);
}

.adm input:disabled {
    border-color: var(--adm-border);
    background: #f0f3f5;
    color: var(--adm-muted);
}

.adm-input-short {
    max-width: 160px;
}

.adm-input-date {
    max-width: 220px;
}

.adm-input-unit {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--adm-muted);
}

.adm-hint {
    color: var(--adm-muted);
    font-size: 14px;
}

.adm-field-error {
    color: var(--adm-danger-fg);
    font-size: 14px;
    font-weight: 600;
}

.adm-field-error::before {
    content: "✕ ";
}

.adm-fieldset,
.adm-reauth {
    display: grid;
    gap: 12px;
    margin: 0;
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius);
    padding: 16px;
}

.adm-reauth {
    border-color: #b7d3e0;
    background: var(--adm-info-bg);
}

.adm-fieldset legend,
.adm-reauth legend {
    padding: 0 6px;
    font-size: 15px;
    font-weight: 600;
}

.adm-subgroup {
    display: grid;
    gap: 8px;
    border-top: 1px solid var(--adm-border);
    padding-top: 12px;
}

.adm-choices {
    display: grid;
    gap: 8px;
}

.adm-choices-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
}

.adm-choice {
    display: grid;
    grid-template-columns: 24px 1fr;
    align-items: start;
    column-gap: 10px;
    min-height: 32px;
}

.adm-choice input {
    width: 20px;
    height: 20px;
    margin: 2px 0 0;
    accent-color: var(--adm-primary);
}

.adm-choice label {
    font-weight: 500;
    cursor: pointer;
}

.adm-choice .adm-hint {
    grid-column: 2;
}

.adm-choice-separate {
    border-top: 1px solid var(--adm-border);
    padding-top: 12px;
}

.adm-form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.adm-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 16px;
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius);
    padding: 16px;
    background: var(--adm-surface);
}

.adm-filter .adm-field {
    min-width: 160px;
}

/* Breit genug für den Platzhalter der Suche (Kunde, letzte 4 Zeichen, Server oder Kennung). */
.adm-field-grow {
    flex: 2 1 380px;
}

.adm-filter-actions {
    display: flex;
    gap: 8px;
}

.adm-inline-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
}

.adm-inline-form .adm-field {
    flex: 0 1 280px;
}

.adm-secret {
    display: flex;
    gap: 8px;
}

.adm-secret input {
    flex: 1 1 auto;
    min-width: 0;
    font-family: var(--adm-mono);
    font-size: 15px;
}

.adm-pre {
    margin: 0;
    overflow-x: auto;
    border-radius: var(--adm-radius);
    padding: 12px 16px;
    background: #17202d;
    color: #e3f2f8;
    font: 14px/1.5 var(--adm-mono);
    white-space: pre-wrap;
    word-break: break-all;
}

/* ------------------------------------------------------------------ Tabellen */

.adm-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius);
    background: var(--adm-surface);
}

.adm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.adm-table-keys {
    min-width: 760px;
}

.adm-table-wide {
    min-width: 760px;
}

.adm-table caption {
    padding: 12px 16px;
    color: var(--adm-muted);
    font-size: 14px;
    font-weight: 600;
    text-align: left;
}

.adm-table th,
.adm-table td {
    border-top: 1px solid var(--adm-border);
    padding: 12px 16px;
    text-align: left;
    vertical-align: top;
}

.adm-table thead th {
    background: #f3f6f8;
    color: var(--adm-muted);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .03em;
    text-transform: uppercase;
}

/* Breite Tabellen (Instanzen, Downloads): etwas enger, damit Zustand und
   Aktion am Desktop ohne seitliches Scrollen sichtbar bleiben. */
.adm-table-wide th,
.adm-table-wide td {
    padding-inline: 12px;
}

.adm-table tbody th {
    font-weight: 600;
}

.adm-table tbody tr {
    position: relative;
}

.adm-table tbody tr:hover {
    background: #f8fbfc;
}

.adm-row-link {
    color: var(--adm-primary-dark);
    font-weight: 600;
    text-decoration: none;
}

/* Ganze Zeile anklickbar, ohne verschachtelte Links. */
.adm-table-keys .adm-row-link::after {
    position: absolute;
    inset: 0;
    content: "";
}

.adm-table-keys .adm-row-link:hover {
    color: var(--adm-primary-dark);
    text-decoration: underline;
}

.adm-table-keys .adm-row-link:focus-visible {
    outline: none;
}

.adm-table-keys .adm-row-link:focus-visible::after {
    outline: 3px solid var(--adm-primary-dark);
    outline-offset: -3px;
}

/* ------------------------------------------------------------------ Kapazität und Balken */

.adm-meter {
    width: 100%;
    max-width: 160px;
    height: 10px;
    border: 0;
    border-radius: 999px;
    background: #d4dde7;
    vertical-align: middle;
}

.adm-meter::-webkit-meter-bar {
    border: 0;
    border-radius: 999px;
    background: #d4dde7;
}

.adm-meter::-webkit-meter-optimum-value,
.adm-meter::-webkit-meter-suboptimum-value,
.adm-meter::-webkit-meter-even-less-good-value {
    border-radius: 999px;
    background: var(--adm-primary);
}

.adm-meter::-moz-meter-bar {
    border-radius: 999px;
    background: var(--adm-primary);
}

.adm-meter.is-over::-webkit-meter-optimum-value,
.adm-meter.is-over::-webkit-meter-suboptimum-value,
.adm-meter.is-over::-webkit-meter-even-less-good-value {
    background: var(--adm-danger);
}

.adm-meter.is-over::-moz-meter-bar {
    background: var(--adm-danger);
}

.adm-capacity {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

.adm-capacity .adm-meter {
    width: 160px;
}

.adm-capacity-text {
    display: block;
    font-variant-numeric: tabular-nums;
}

.adm-capacity .adm-capacity-text {
    display: inline;
    color: var(--adm-muted);
    font-weight: 600;
}

.adm-table td .adm-chip {
    margin-top: 6px;
}

.adm-bars {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* minmax(0, …): Die Zeile darf schmaler werden als ihr Inhalt (Reflow bei 320 px). */
.adm-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto;
    align-items: center;
    gap: 12px;
}

.adm-bar .adm-meter {
    max-width: none;
}

.adm-bar-label {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.adm-bar-value {
    color: var(--adm-muted);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ Verlauf */

.adm-history {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.adm-history li {
    display: grid;
    grid-template-columns: 150px 120px 1fr;
    gap: 12px;
    border-top: 1px solid var(--adm-border);
    padding: 10px 0;
    font-size: 15px;
}

.adm-history li:first-child {
    border-top: 0;
}

.adm-history-time,
.adm-history-actor {
    color: var(--adm-muted);
    font-variant-numeric: tabular-nums;
}

.adm-history-text {
    overflow-wrap: anywhere;
}

/* ------------------------------------------------------------------ Dialog */

.adm-dialog {
    width: min(560px, calc(100% - 32px));
    max-height: calc(100% - 32px);
    border: 0;
    border-radius: 12px;
    padding: 24px;
    background: var(--adm-surface);
    color: var(--adm-text);
    box-shadow: 0 24px 64px rgba(23, 32, 45, .3);
}

.adm-dialog[open] {
    display: grid;
    gap: 16px;
}

.adm-dialog::backdrop {
    background: rgba(23, 32, 45, .5);
}

/* ------------------------------------------------------------------ Schmale Bildschirme */

@media (max-width: 960px) {
    .adm-header {
        position: static;
    }

    html:has(body.adm) {
        scroll-padding-top: 16px;
    }

    .adm-header-inner {
        flex-wrap: wrap;
        gap: 8px 16px;
        padding: 12px 16px;
    }

    .adm-nav {
        flex-wrap: wrap;
        order: 3;
        flex-basis: 100%;
        gap: 0;
    }

    .adm-nav a {
        min-height: 44px;
        padding: 0 10px;
    }

    .adm-tools {
        margin-left: auto;
    }
}

@media (max-width: 640px) {
    .adm-main {
        padding: 20px 16px 56px;
    }

    .adm h1 {
        font-size: 26px;
    }

    .adm-card {
        padding: 16px;
    }

    .adm-brand img {
        width: 64px;
        height: 42px;
    }

    .adm-brand span {
        font-size: 12px;
    }

    .adm-head-actions,
    .adm-form-actions {
        width: 100%;
    }

    .adm-head-actions .adm-btn,
    .adm-head-actions form,
    .adm-form-actions .adm-btn {
        flex: 1 1 auto;
    }

    .adm-head-actions form .adm-btn {
        width: 100%;
    }

    .adm-secret {
        flex-direction: column;
    }

    .adm-history li {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .adm-filter .adm-field {
        flex: 1 1 100%;
    }

    /* Tabellen als Karten: eine Karte je Zeile, die Spaltennamen stehen über
       den Werten (data-label). Die Kopfzeile bleibt für Screenreader da. */
    .adm-table-wrap-stack {
        overflow: visible;
        border: 0;
        background: transparent;
    }

    .adm-table-stack,
    .adm-table-stack tbody,
    .adm-table-stack tr,
    .adm-table-stack th,
    .adm-table-stack td {
        display: block;
    }

    .adm-table-stack {
        min-width: 0;
    }

    .adm-table-stack caption {
        display: block;
        padding: 0 0 8px;
    }

    .adm-table-stack thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .adm-table-stack tbody {
        display: grid;
        gap: 12px;
    }

    .adm-table-stack tbody tr {
        border: 1px solid var(--adm-border);
        border-radius: var(--adm-radius);
        padding: 12px 16px;
        background: var(--adm-surface);
    }

    .adm-table-stack th,
    .adm-table-stack td {
        border-top: 0;
        padding: 4px 0;
    }

    .adm-table-stack tbody th:first-child {
        padding-bottom: 8px;
    }

    .adm-table-stack [data-label]::before {
        content: attr(data-label);
        display: block;
        color: var(--adm-muted);
        font-size: 12px;
        font-weight: 600;
        letter-spacing: .03em;
        text-transform: uppercase;
    }

    .adm-table-stack .adm-num {
        text-align: left;
    }

    /* Lange Plaketten („abgelehnt: Instanz nicht freigegeben“) dürfen umbrechen. */
    .adm-table-stack .adm-badge {
        white-space: normal;
    }
}

@media (max-width: 480px) {
    /* Balken unter Name und Zahl statt dazwischen. */
    .adm-bar {
        grid-template-columns: minmax(0, 1fr) auto;
        row-gap: 4px;
    }

    .adm-bar .adm-meter {
        grid-column: 1 / -1;
        grid-row: 2;
    }
}

@media (prefers-reduced-motion: reduce) {
    .adm *,
    .adm-header * {
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
