/* BGB Admin — design system (light/dark), no dependencies. Icons: inline Lucide sprite (resources/views/admin/partials/icons.blade.php). */
:root {
  color-scheme: light;
  /* BGB-Farben: Weiß und Anthrazit ohne Blaustich, Rot (#e1111f wie auf der Website) nur für Aktion und Auswahl */
  --bg: #ffffff; --surface: #ffffff; --surface-2: #fafafa; --surface-3: #f3f3f3; --border: #e6e6e6; --border-strong: #949494;
  --text: #151619; --text-2: #3a3b3d; --muted: #616161; --faint: #6b6b6b;   /* auf Weiß 6,2:1 bzw. 5,3:1 – lesbar auch bei kleiner Schrift */
  --accent: #e1111f; --accent-hover: #b30d18; --accent-soft: #fdeced; --accent-ring: rgba(225, 17, 31, .22); --on-accent: #fff;
  --accent-ink: #b30d18;   /* rote Schrift auf --accent-soft: 6,2:1 (#e1111f erreicht dort nur 4,3:1) */
  --ok: #15803d; --ok-soft: #dcfce7; --warn: #b45309; --warn-soft: #fef3c7; --info: #3a3b3d; --info-soft: #f3f3f3; --danger: #b91c1c; --danger-soft: #fee2e2;
  --shadow-sm: 0 1px 2px rgba(21, 22, 25, .06); --shadow-md: 0 8px 24px rgba(21, 22, 25, .10); --shadow-lg: 0 24px 60px rgba(21, 22, 25, .22);
  --radius-sm: 7px; --radius: 10px; --radius-lg: 14px;
  --sidebar-w: 248px; --topbar-h: 58px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  /* Anthrazit statt Blauschwarz */
  --bg: #121314; --surface: #1b1c1e; --surface-2: #222326; --surface-3: #2a2b2e; --border: #2e2f33; --border-strong: #76777c;
  --text: #f3f3f3; --text-2: #d4d4d5; --muted: #a3a3a6; --faint: #959598;   /* auf der Kartenfläche 6,8:1 bzw. 5,7:1 */
  --accent: #ff5a63; --accent-hover: #ff7880; --accent-soft: rgba(225, 17, 31, .16); --accent-ring: rgba(255, 90, 99, .32); --on-accent: #fff;
  --accent-ink: var(--accent);
  --ok: #4ade80; --ok-soft: rgba(74, 222, 128, .14); --warn: #fbbf24; --warn-soft: rgba(251, 191, 36, .14); --info: #d4d4d5; --info-soft: rgba(255, 255, 255, .08); --danger: #f87171; --danger-soft: rgba(248, 113, 113, .16);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45); --shadow-md: 0 8px 24px rgba(0, 0, 0, .5); --shadow-lg: 0 24px 60px rgba(0, 0, 0, .65);
}

*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; }
body.adm { margin: 0; min-height: 100%; font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
img { max-width: 100%; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
.adm-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; vertical-align: -3px; }
.i--sm { width: 15px; height: 15px; }
.i--lg { width: 22px; height: 22px; }
.adm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Shell ---------- */
.adm-shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.adm-sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 14px 12px 12px; }
.adm-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 14.5px; }
.adm-brand__mark { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 15px; letter-spacing: .02em; }
.adm-brand__logo { width: 32px; height: 32px; border-radius: 50%; display: block; flex: 0 0 auto; }
.adm-brand small { display: block; font-weight: 500; color: var(--muted); font-size: 11.5px; margin-top: 1px; }
.adm-nav { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.adm-nav__group { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 14px 10px 5px; }
.adm-nav__link { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--text-2); text-decoration: none; font-weight: 500; font-size: 13.5px; border: 0; background: none; width: 100%; text-align: left; cursor: pointer; font-family: inherit; }
.adm-nav__link .i { opacity: .8; }
.adm-nav__link:hover { background: var(--surface-2); color: var(--text); }
.adm-nav__link.is-active { background: var(--accent-soft); color: var(--accent-ink); }
.adm-nav__link.is-active .i { opacity: 1; }
.adm-badge { margin-left: auto; background: var(--accent); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 1px 7px; min-width: 20px; text-align: center; line-height: 16px; }
.adm-sidebar__foot { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.adm-theme { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: transparent; box-shadow: inset 0 0 0 1px var(--border); border-radius: 8px; padding: 3px; }
.adm-theme button { border: 0; background: none; border-radius: 6px; height: 28px; display: grid; place-items: center; color: var(--muted); cursor: pointer; }
.adm-theme button.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.adm-theme .i { width: 16px; height: 16px; }
.adm-user { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; text-decoration: none; color: var(--text); }
.adm-user:hover { background: var(--surface-2); }
.adm-user__name { font-weight: 600; font-size: 13px; line-height: 1.2; }
.adm-user__role { color: var(--muted); font-size: 11.5px; }
.adm-user .adm-btn--icon { margin-left: auto; }
.adm-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-3); color: var(--text-2); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: 0 0 auto; }
/* Listen-Avatare hellgrau, nur der eigene in der Seitenleiste kräftig – hell schwarz, im Dunkelmodus hell */
.adm-user .adm-avatar { background: var(--text); color: var(--surface); }

.adm-body { min-width: 0; display: flex; flex-direction: column; }
.adm-topbar { position: sticky; top: 0; z-index: 40; height: var(--topbar-h); display: flex; align-items: center; gap: 12px; padding: 0 24px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.adm-topbar__title { min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; }
.adm-crumb { color: var(--muted); font-weight: 500; text-decoration: none; }
.adm-crumb:hover { color: var(--text); }
.adm-crumb + .i { width: 14px; height: 14px; color: var(--faint); }
.adm-topbar__spacer { flex: 1; }
.adm-search { position: relative; width: 280px; max-width: 40vw; }
.adm-search .i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.adm-search input { width: 100%; height: 36px; padding: 0 60px 0 34px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
.adm-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.adm-search kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
.adm-kbd { font-family: var(--font); font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; background: var(--surface-2); line-height: 16px; }
.adm-menu-btn { display: none; }
.adm-main { padding: 24px 28px 72px; width: 100%; max-width: 1320px; }
.adm-main--narrow { max-width: 1120px; }

/* ---------- Type ---------- */
.adm-h1 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.adm-h2 { font-size: 15px; font-weight: 600; }
.adm-h3 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.adm-muted { color: var(--muted); }
.adm-faint { color: var(--faint); }
.adm-small { font-size: 12.5px; }
.adm-right { text-align: right; }
.adm-nowrap { white-space: nowrap; }
.adm-inline { display: inline; }
.adm-mono { font-family: var(--mono); font-size: 12.5px; }
.adm-link { color: var(--text); text-decoration: none; }
.adm-link:hover { color: var(--accent); }
.adm-stack { display: flex; flex-direction: column; gap: 16px; }
.adm-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.adm-grow { flex: 1; min-width: 0; }

/* ---------- Page head / action bar ---------- */
.adm-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.adm-head__text p { margin: 4px 0 0; color: var(--muted); }
.adm-head__actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.adm-actionbar { position: sticky; top: var(--topbar-h); z-index: 30; display: flex; align-items: center; gap: 12px; padding: 12px 0; margin: -8px 0 16px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); flex-wrap: wrap; }
.adm-actionbar .adm-h1 { font-size: 20px; }
.adm-actionbar__meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; flex-wrap: wrap; }
.adm-actionbar__actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.adm-dirty { display: none; color: var(--warn); font-size: 12.5px; font-weight: 500; }
form.is-dirty .adm-dirty { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- Cards / grids ---------- */
.adm-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 22px; margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.adm-card--flush { padding: 0; overflow: hidden; }
.adm-card--flush > .adm-table-wrap { border: 0; border-radius: 0; }
.adm-card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.adm-card--flush .adm-card__head { padding: 16px 20px 0; margin-bottom: 12px; }
.adm-card__head .adm-h2 { display: flex; align-items: center; gap: 8px; }
.adm-card__head .adm-h2 .i { color: var(--muted); }
.adm-grid-2 { display: grid; grid-template-columns: 1fr; gap: 0 24px; }
.adm-grid-3 { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 900px) { .adm-grid-2 { grid-template-columns: 1fr 1fr; } .adm-grid-3 { grid-template-columns: 1fr 1fr 1fr; } }
/* Übersicht: drei Spalten erst ab 720 px Inhaltsbreite – bei 901–1023 px mit Seitenleiste lief die dritte Karte über
   (gemessen bis 117 px); darunter zwei Spalten, die dritte Karte über die volle Breite */
@media (min-width: 900px) {
  @container adm-main (width < 720px) {
    .adm-grid-3 { grid-template-columns: 1fr 1fr; }
    .adm-grid-3 > :nth-child(3) { grid-column: 1 / -1; }
  }
}
.adm-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.adm-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; text-decoration: none; color: var(--text); display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow-sm); transition: border-color .15s, transform .15s; }
.adm-tile:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.adm-tile__icon { width: 34px; height: 34px; border-radius: 9px; background: transparent; color: var(--text); display: grid; place-items: center; }
.adm-tile--alert .adm-tile__icon { background: var(--accent-soft); color: var(--accent); }
.adm-tile__num { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.adm-tile__label { color: var(--muted); font-size: 12.5px; }
.adm-list { list-style: none; margin: 0; padding: 0; }
.adm-list li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.adm-list li:last-child { border-bottom: 0; }
.adm-list__icon { width: 28px; height: 28px; border-radius: 8px; background: transparent; color: var(--text); display: grid; place-items: center; flex: 0 0 auto; }
.adm-list__icon .i { width: 15px; height: 15px; }
.adm-list__text { min-width: 0; flex: 1; }
.adm-list__text a { color: var(--text); text-decoration: none; font-weight: 500; }
.adm-list__text a:hover { color: var(--accent); }
.adm-list__meta { color: var(--muted); font-size: 12px; white-space: nowrap; }
.adm-quick { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Flash / toasts ---------- */
.adm-flash { border-radius: var(--radius); padding: 12px 16px; margin-bottom: 18px; border: 1px solid; display: flex; gap: 10px; align-items: flex-start; }
.adm-flash--ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.adm-flash--err { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.adm-flash ul { margin: 4px 0 0; padding-left: 18px; }
.adm-toasts { position: fixed; right: 20px; bottom: 20px; z-index: 1200; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 40px)); }
.adm-toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--ok); border-radius: var(--radius); box-shadow: var(--shadow-md); animation: adm-toast-in .2s ease-out; font-size: 13.5px; }
.adm-toast--err { border-left-color: var(--danger); }
.adm-toast--warn { border-left-color: var(--warn); }
.adm-toast .i { color: var(--ok); margin-top: 1px; }
.adm-toast--err .i { color: var(--danger); }
.adm-toast--warn .i { color: var(--warn); }
.adm-toast__text { flex: 1; }
.adm-toast__text ul { margin: 4px 0 0; padding-left: 16px; }
.adm-toast__close { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0; line-height: 0; }
.adm-toast.is-leaving { opacity: 0; transform: translateY(6px); transition: .2s; }
@keyframes adm-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Forms ---------- */
.adm-field { display: block; margin-bottom: 16px; }
.adm-label { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--text); }
.adm-label em { color: var(--accent); font-style: normal; }
.adm-input { width: 100%; height: 38px; border: 1px solid var(--border-strong); border-radius: 8px; padding: 0 12px; font: inherit; color: var(--text); background: var(--surface); transition: border-color .12s, box-shadow .12s; }
.adm-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.adm-input::placeholder { color: var(--faint); }
.adm-input--small { width: auto; max-width: 100%; height: 32px; padding: 0 10px; font-size: 13px; }
textarea.adm-input { height: auto; min-height: 96px; padding: 9px 12px; resize: vertical; line-height: 1.5; }
select.adm-input { appearance: none; -webkit-appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b6b6b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.adm-help { display: block; color: var(--muted); font-size: 12.5px; margin-top: 5px; line-height: 1.45; }
.adm-note { display: flex; gap: 8px; background: var(--info-soft); color: var(--info); border-radius: 8px; padding: 10px 12px; margin-bottom: 16px; font-size: 13px; }
.adm-check { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.adm-check input { width: 17px; height: 17px; accent-color: var(--accent); margin: 0; }
.adm-switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.adm-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.adm-switch__track { width: 38px; height: 22px; border-radius: 999px; background: var(--border-strong); position: relative; transition: background .15s; flex: 0 0 auto; }
.adm-switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: transform .15s; }
.adm-switch input:checked + .adm-switch__track { background: var(--ok); }
.adm-switch input:checked + .adm-switch__track::after { transform: translateX(16px); }
.adm-switch input:focus-visible + .adm-switch__track { box-shadow: 0 0 0 3px var(--accent-ring); }
.adm-counter { color: var(--muted); font-weight: 400; margin-left: auto; font-size: 12px; }
.adm-counter.is-over { color: var(--danger); }
.adm-filter { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.adm-form-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
@media (min-width: 1080px) { .adm-form-layout { grid-template-columns: minmax(0, 1fr) 320px; } .adm-form-layout__side { position: sticky; top: calc(var(--topbar-h) + 68px); } }
.adm-form-layout__side .adm-card { padding: 18px 20px; }
.adm-form-layout__side .adm-field:last-child { margin-bottom: 0; }
.adm-fieldset { border: 0; padding: 0; margin: 0 0 18px; }
.adm-fieldset legend { font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 0; margin-bottom: 10px; }

/* ---------- Buttons ---------- */
.adm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); border-radius: 8px; padding: 0 14px; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1; white-space: nowrap; transition: background .12s, border-color .12s, color .12s; }
.adm-btn:hover { background: var(--surface-2); border-color: var(--faint); }
.adm-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
.adm-btn .i { width: 16px; height: 16px; }
.adm-btn--primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
/* Dark mode: das helle Rot trägt weiße Schrift nur mit 3,0:1 – der Button bekommt deshalb das BGB-Rot der hellen Ansicht (4,9:1) */
:root[data-theme="dark"] .adm-btn--primary { background: #e1111f; border-color: #e1111f; }
:root[data-theme="dark"] .adm-btn--primary:hover { background: #b30d18; border-color: #b30d18; }
.adm-btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.adm-btn--danger { color: var(--danger); border-color: transparent; background: transparent; }
.adm-btn--danger:hover { background: var(--danger-soft); border-color: transparent; }
.adm-btn--ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.adm-btn--ghost:hover { background: var(--surface-3); border-color: transparent; color: var(--text); }
.adm-btn--small { height: 30px; padding: 0 10px; font-size: 12.5px; }
.adm-btn--small .i { width: 14px; height: 14px; }
.adm-btn--icon { width: 32px; height: 32px; padding: 0; border-color: transparent; background: transparent; color: var(--muted); }
.adm-btn--icon:hover { background: var(--surface-3); border-color: transparent; color: var(--text); }
.adm-btn--icon.adm-btn--danger:hover { background: var(--danger-soft); color: var(--danger); }
.adm-btn--block { width: 100%; }
.adm-btn[disabled] { opacity: .55; cursor: default; }
.adm-upload-btn { cursor: pointer; }
.adm-btn-group { display: inline-flex; gap: 6px; }

/* ---------- Tables ---------- */
.adm-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.adm-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.adm-table th, .adm-table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.adm-table th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; background: var(--surface-2); white-space: nowrap; }
.adm-table tbody tr:last-child td { border-bottom: 0; }
.adm-table tbody tr:hover td { background: var(--surface-2); }
.adm-table tr.is-unread td { font-weight: 600; }
.adm-table tr.is-unread td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.adm-table a { color: var(--text); text-decoration: none; }
.adm-table a:hover { color: var(--accent); }
.adm-table__title { font-weight: 600; }
.adm-table__sub { color: var(--muted); font-size: 12px; font-weight: 400; }
.adm-table td.adm-actions { text-align: right; white-space: nowrap; }
.adm-table td.adm-mono, .adm-table td .adm-mono { overflow-wrap: anywhere; }
/* Marken bleiben einzeilig (im Galerie-Papierkorb brach „Mir sind Grüscht“ um); dafür darf dort das Löschdatum umbrechen */
.adm-table .adm-tag { white-space: nowrap; }
.adm-table td.adm-actions .adm-btn--icon { opacity: .75; }
.adm-table tr:hover td.adm-actions .adm-btn--icon { opacity: 1; }
.adm-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; background: var(--surface-3); display: block; border: 1px solid var(--border); }
.adm-thumb--wide { width: 64px; height: 44px; }
.adm-drag { cursor: grab; color: var(--faint); width: 30px; padding-right: 0 !important; }
.adm-drag:hover { color: var(--text); }
/* Tastatur-Alternative: nur sichtbar, wenn sie gebraucht wird (Fokus oder Zeile unter dem Zeiger) */
.adm-move { display: inline-flex; flex-direction: column; gap: 1px; margin-left: 2px; vertical-align: middle; }
.adm-move__btn { border: 1px solid transparent; background: none; color: var(--faint); cursor: pointer; border-radius: 4px; line-height: 1; padding: 1px 3px; font-size: 11px; opacity: 0; }
tr:hover .adm-move__btn, .adm-move__btn:focus-visible { opacity: 1; }
.adm-move__btn:hover { color: var(--text); border-color: var(--border-strong); }
.adm-move__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
tr.is-dragging { opacity: .4; }
.adm-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 9px 2px 7px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.adm-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .85; }
.adm-pill--ok { background: var(--ok-soft); color: var(--ok); }
.adm-pill--warn { background: var(--warn-soft); color: var(--warn); }
.adm-pill--new { background: var(--accent-soft); color: var(--accent-ink); }
.adm-pill--info { background: var(--info-soft); color: var(--info); }
.adm-tag { display: inline-block; font-size: 11.5px; padding: 1px 7px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); }
.adm-dl { display: grid; grid-template-columns: 120px 1fr; gap: 8px 14px; margin: 0 0 18px; }
.adm-dl dt { color: var(--muted); }
.adm-dl dd { margin: 0; }
.adm-dl--wide { grid-template-columns: 200px 1fr; }
.adm-dl--wide dd { overflow-wrap: anywhere; }
/* Systeminfo: lange Werte und Abzeichen drückten die Karten über den Rand (320–1280 px, bis 441 px) */
.adm-grid-2:has(.adm-dl--wide) { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .adm-grid-2:has(.adm-dl--wide) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.adm-dl--wide .adm-pill { white-space: normal; }
.adm-card:has(> .adm-dl--wide) { container: adm-card / inline-size; }
@container adm-card (width < 460px) {
  .adm-dl--wide { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .adm-dl--wide dd + dt { margin-top: 10px; }
}
.adm-pre { white-space: pre-wrap; background: var(--surface-2); border-radius: var(--radius); padding: 14px 16px; line-height: 1.55; border: 1px solid var(--border); }
.adm-pagination { margin-top: 14px; }
.adm-pagination nav { display: flex; justify-content: center; }
.adm-pagination .pagination { list-style: none; display: flex; gap: 4px; padding: 0; margin: 0; }
.adm-pagination .page-link { display: inline-block; padding: 6px 11px; border: 1px solid var(--border); border-radius: 7px; text-decoration: none; color: var(--text); background: var(--surface); font-size: 13px; }
.adm-pagination .active .page-link { background: var(--accent); color: #fff; border-color: var(--accent); }
.adm-empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.adm-empty__icon { width: 52px; height: 52px; border-radius: 50%; background: var(--surface-3); color: var(--muted); display: grid; place-items: center; margin: 0 auto 12px; }
.adm-empty__icon .i { width: 24px; height: 24px; }
.adm-empty h3 { color: var(--text); font-size: 15px; margin-bottom: 4px; }
.adm-empty p { margin: 0 0 14px; }

/* ---------- Tabs ---------- */
.adm-tabs__nav { display: flex; gap: 2px; flex-wrap: wrap; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.adm-tabs__btn { border: 0; background: none; padding: 9px 12px; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; border-radius: 6px 6px 0 0; }
.adm-tabs__btn:hover { color: var(--text); background: var(--surface-2); }
.adm-tabs__btn.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.adm-tabs__panel { display: none; }
.adm-tabs__panel.is-active { display: block; }

/* ---------- Media field / picker ---------- */
.adm-media-field__box { display: flex; gap: 14px; align-items: center; border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 10px; background: var(--surface-2); }
.adm-media-field__preview { width: 120px; height: 84px; display: flex; align-items: center; justify-content: center; background: var(--surface); border-radius: 8px; overflow: hidden; border: 1px solid var(--border); flex: 0 0 120px; }
.adm-media-field__preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.adm-media-field__actions { display: flex; flex-direction: column; gap: 6px; }
.adm-file-chip { display: inline-block; background: var(--surface-3); border-radius: 6px; padding: 4px 8px; font-size: 12px; font-weight: 600; word-break: break-all; color: var(--text-2); }
.adm-media-library { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.adm-media-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-sm); }
.adm-media-item__thumb { height: 140px; background: var(--surface-3); display: flex; align-items: center; justify-content: center; background-image: linear-gradient(45deg, var(--surface-2) 25%, transparent 25%, transparent 75%, var(--surface-2) 75%), linear-gradient(45deg, var(--surface-2) 25%, transparent 25%, transparent 75%, var(--surface-2) 75%); background-size: 16px 16px; background-position: 0 0, 8px 8px; }
.adm-media-item__thumb img { width: 100%; height: 100%; object-fit: contain; }
.adm-media-item__form { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.adm-media-item__name { font-weight: 600; font-size: 12.5px; word-break: break-all; }
.adm-media-item__actions { display: flex; gap: 2px; flex-wrap: wrap; margin-top: 2px; }
.adm-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.adm-modal[hidden] { display: none; }
.adm-modal__backdrop { position: absolute; inset: 0; background: rgba(21, 22, 25, .55); backdrop-filter: blur(2px); }
.adm-modal__box { position: relative; background: var(--surface); border-radius: var(--radius-lg); width: min(1100px, 100%); max-height: 90vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); border: 1px solid var(--border); }
.adm-modal__box--small { width: min(520px, 100%); }
.adm-modal__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.adm-modal__head .adm-h2 { margin: 0; }
.adm-modal__tools { display: flex; gap: 8px; align-items: center; }
.adm-modal__body { padding: 16px 18px; overflow: auto; flex: 1; }
.adm-modal__foot { padding: 10px 18px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.adm-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.adm-media-grid button { border: 2px solid transparent; background: var(--surface-2); border-radius: 10px; padding: 0; cursor: pointer; overflow: hidden; display: flex; flex-direction: column; text-align: left; font: inherit; color: var(--text); }
.adm-media-grid button:hover, .adm-media-grid button:focus-visible { border-color: var(--accent); outline: none; }
.adm-media-grid .thumb { width: 100%; height: 110px; object-fit: cover; display: block; background: var(--surface-3); }
.adm-media-grid .thumb--file { display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--muted); }
.adm-media-grid .name { font-size: 11.5px; padding: 6px 8px; word-break: break-all; }

/* ---------- Editor (basic; replaced by the TipTap editor in phase 2) ---------- */
.adm-editor { border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; background: var(--surface); }
.adm-editor:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.adm-editor__toolbar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.adm-editor__toolbar button { border: 1px solid transparent; background: none; border-radius: 6px; min-width: 30px; height: 30px; padding: 0 7px; font: inherit; font-size: 13px; cursor: pointer; color: var(--text-2); }
.adm-editor__toolbar button:hover { background: var(--surface-3); color: var(--text); }
.adm-editor__toolbar button.is-active { background: var(--accent-soft); color: var(--accent-ink); }
.adm-editor__sep { width: 1px; background: var(--border); margin: 4px 4px; }
.adm-editor__area { min-height: 200px; padding: 12px 14px; line-height: 1.6; outline: none; }
.adm-editor__area p { margin: 0 0 .8em; }
.adm-editor__area h2 { font-size: 1.3em; margin: .8em 0 .4em; }
.adm-editor__area h3 { font-size: 1.1em; margin: .8em 0 .4em; }
.adm-editor__area a { color: var(--accent); }
.adm-editor__source { border: 0; border-radius: 0; min-height: 200px; font-family: var(--mono); font-size: 12.5px; }
.adm-editor.is-source .adm-editor__area { display: none; }
.adm-editor.is-source .adm-editor__source { display: block !important; }

/* ---------- Editor (TipTap) ---------- */
.adm-editor__prose { min-height: 220px; padding: 12px 14px; outline: none; line-height: 1.6; }
.adm-editor__prose p.is-editor-empty:first-child::before { color: var(--faint); content: attr(data-placeholder); float: left; height: 0; pointer-events: none; }
.adm-editor__prose img { max-width: 100%; height: auto; border-radius: 6px; display: block; margin: .6em 0; }
.adm-editor__prose img.ProseMirror-selectednode { outline: 3px solid var(--accent-ring); }
.adm-editor__prose blockquote { border-left: 3px solid var(--border-strong); margin: .8em 0; padding: .2em 0 .2em 14px; color: var(--text-2); }
.adm-editor__prose hr { border: 0; border-top: 1px solid var(--border-strong); margin: 1em 0; }
.adm-editor__prose ul, .adm-editor__prose ol { padding-left: 1.4em; margin: 0 0 .8em; }
.adm-editor__area[hidden] { display: none; }
.adm-editor__toolbar button[disabled] { opacity: .4; cursor: default; }
.adm-editor__toolbar button[disabled]:hover { background: none; }

/* ---------- Media library: drop zone, chips, bulk bar, focal point ---------- */
.adm-dropzone { display: flex; align-items: center; gap: 14px; border: 2px dashed var(--border-strong); border-radius: var(--radius-lg); padding: 16px 18px; margin-bottom: 16px; background: var(--surface); color: var(--text-2); transition: border-color .12s, background .12s; flex-wrap: wrap; }
.adm-dropzone > .i--lg { color: var(--muted); }
.adm-dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.adm-dropzone.is-over .adm-dropzone__pick { color: var(--accent-ink); }
.adm-dropzone__pick { color: var(--accent); cursor: pointer; text-decoration: underline; font-weight: 600; }
.adm-progress { margin-left: auto; width: 240px; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.adm-progress[hidden] { display: none; }
.adm-progress__track { flex: 1; height: 6px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.adm-progress__bar { height: 100%; width: 0; background: var(--accent); transition: width .15s; }
.adm-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.adm-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); text-decoration: none; font-size: 12.5px; font-weight: 600; }
.adm-chip span { color: var(--muted); font-weight: 500; }
.adm-chip:hover { border-color: var(--border-strong); color: var(--text); }
.adm-chip.is-active { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.adm-chip.is-active span { color: inherit; opacity: .8; }
.adm-bulk { position: sticky; top: calc(var(--topbar-h) + 8px); z-index: 25; display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin-bottom: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); flex-wrap: wrap; }
.adm-bulk[hidden] { display: none; }
.adm-media-item { position: relative; }
.adm-media-item__select { position: absolute; top: 8px; left: 8px; z-index: 2; background: var(--surface); border-radius: 6px; padding: 4px; box-shadow: var(--shadow-sm); display: flex; opacity: .9; cursor: pointer; }
.adm-media-item__select input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); cursor: pointer; display: block; }
.adm-media-item.is-selected { outline: 2px solid var(--accent); }
.adm-media-item__thumb { text-decoration: none; }
a.adm-media-item__name { color: var(--text); text-decoration: none; }
a.adm-media-item__name:hover { color: var(--accent); }
.adm-focal { position: relative; display: inline-block; max-width: 100%; cursor: crosshair; user-select: none; -webkit-user-select: none; border-radius: 8px; overflow: hidden; background: var(--surface-3); touch-action: none; }
.adm-focal img { display: block; max-width: 100%; max-height: 62vh; width: auto; height: auto; }
.adm-focal__dot { position: absolute; width: 26px; height: 26px; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 0 0 2px var(--accent), 0 2px 8px rgba(0, 0, 0, .5); transform: translate(-50%, -50%); pointer-events: none; }
.adm-focal__previews { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.adm-focal__preview { border-radius: 8px; overflow: hidden; background: var(--surface-3); border: 1px solid var(--border); }
.adm-focal__preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.adm-focal__preview--wide { width: 200px; height: 112px; }
.adm-focal__preview--square { width: 112px; height: 112px; }
.adm-focal__preview--tall { width: 84px; height: 112px; }
.adm-table--compact th, .adm-table--compact td { padding: 7px 10px; font-size: 13px; }

/* ---------- Lists: selection, quick status, revisions ---------- */
.adm-table__check { width: 36px; padding-right: 0 !important; }
.adm-table__check input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); cursor: pointer; display: block; }
.adm-table tr.is-selected td { background: var(--accent-soft); }
.adm-switch--small { font-size: 12.5px; font-weight: 600; gap: 8px; }
.adm-switch--small .adm-switch__track { width: 32px; height: 18px; }
.adm-switch--small .adm-switch__track::after { width: 12px; height: 12px; }
.adm-switch--small input:checked + .adm-switch__track::after { transform: translateX(14px); }
.adm-switch input[disabled] + .adm-switch__track { opacity: .5; }
.adm-revisions li { align-items: center; }
.adm-revisions__time { display: block; font-weight: 600; font-size: 13px; }
.adm-btn--ghost.is-active { background: var(--accent-soft); color: var(--accent-ink); }

/* ---------- Lists as cards ----------
   Unter 700 px Inhaltsbreite – am Handy, aber auch in Fenstern um 900–1000 px mit Seitenleiste – passt die breiteste
   Liste (Neuigkeiten, rund 675 px) nicht mehr: die Tabelle wischte seitlich, die Aktionen lagen außer Sicht. Dort wird
   jede Zeile eine Karte. Ziehen am Griff braucht eine Maus: Griff und Hinweis im Seitenkopf entfallen gemeinsam. */
.adm-main:has(.adm-table--cards), .adm-main:has(> .adm-grid-3) { container: adm-main / inline-size; }
@container adm-main (width < 700px) {
  .adm-hide-cards { display: none; }
  .adm-table-wrap:has(> .adm-table--cards) { overflow: visible; border: 0; border-radius: 0; background: transparent; }
  .adm-table--cards { display: block; }
  .adm-table--cards thead { display: none; }
  /* minmax(0, 1fr): ein überlanges Wort darf die Karten nicht breiter als die Spalte machen */
  .adm-table--cards tbody { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .adm-table--cards tbody tr { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 12px 12px 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
  .adm-table--cards td { padding: 0; border: 0; min-width: 0; overflow-wrap: anywhere; }
  .adm-table--cards tbody tr:hover td, .adm-table--cards tr.is-selected td { background: transparent; }
  .adm-table--cards tr.is-selected { background: var(--accent-soft); border-color: transparent; }
  .adm-table--cards tr.is-unread { box-shadow: inset 3px 0 0 var(--accent); }
  .adm-table--cards tr.is-unread td:first-child { box-shadow: none; }
  .adm-table--cards td.adm-drag { display: none; }
  .adm-table--cards td.adm-table__check { width: auto; }
  .adm-table--cards td.adm-table__check, .adm-table--cards td:has(> .adm-thumb) { order: -2; }
  /* erste Zeile: Auswahl, Bild, Titel; darunter Status, Angaben und Aktionen */
  .adm-table--cards td:has(.adm-table__title) { order: -1; flex: 1 1 calc(100% - 64px); }
  .adm-table--cards tr:has(.adm-thumb) td:has(.adm-table__title) { flex-basis: calc(100% - 130px); }
  /* lange Texte (Nachricht, Protokoll-Eintrag, Adressen) direkt unter den Titel; freie Texte in eigener Zeile */
  .adm-table--cards td.adm-card-line { order: -1; flex: 1 1 100%; }
  .adm-table--cards td.adm-card-text { flex: 1 1 100%; }
  .adm-table--cards td:has(> .adm-card-hide) { display: none; }
  /* der Spaltenname steht vor dem Wert – im Stil der Spaltenköpfe am Desktop */
  .adm-table--cards td[data-label]::before { content: attr(data-label); margin-right: 6px; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
  .adm-table--cards td.adm-actions { margin-left: auto; }
}

/* ---------- Profile: two-factor ---------- */
.adm-qr { display: inline-block; background: #fff; padding: 10px; border-radius: 10px; border: 1px solid var(--border); margin-bottom: 8px; }
.adm-qr svg { display: block; width: 200px; height: 200px; }
.adm-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; margin-top: 10px; }
.adm-codes code { font-family: var(--mono); font-size: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; text-align: center; color: var(--text); }

/* ---------- Search results / dashboard widgets ---------- */
.adm-results__group { margin-bottom: 18px; }
.adm-check-list li { align-items: flex-start; }
.adm-check-list .i { margin-top: 3px; }
.adm-check-list .is-ok { color: var(--ok); }
.adm-check-list .is-warn { color: var(--warn); }

/* ---------- Login ---------- */
.adm-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: radial-gradient(1200px 600px at 50% -10%, var(--accent-soft), transparent 60%), var(--bg); }
.adm-login__card { width: 400px; max-width: 100%; padding: 32px 32px 28px; }
.adm-login__brand { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 0 0 22px; }
.adm-login__logo { width: 220px; max-width: 85%; height: auto; display: block; }
:root[data-theme="dark"] .adm-login__logo { background: #fff; padding: 10px 14px; border-radius: 10px; }
.adm-login__title { font-weight: 600; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.adm-login .adm-check { margin: 4px 0 16px; }
.adm-login__foot { text-align: center; margin-top: 16px; font-size: 13px; }

/* ---------- Mobile ---------- */
.adm-backdrop { display: none; position: fixed; inset: 0; background: rgba(21, 22, 25, .45); z-index: 45; }
@media (max-width: 900px) {
  .adm-shell { grid-template-columns: 1fr; }
  .adm-sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w); height: auto; z-index: 50; transform: translateX(-100%); transition: transform .2s ease-out; box-shadow: none; }
  body.nav-open .adm-sidebar { transform: none; box-shadow: var(--shadow-lg); }
  body.nav-open .adm-backdrop { display: block; }
  .adm-menu-btn { display: inline-flex; }
  .adm-topbar { padding: 0 14px; gap: 8px; }
  .adm-search { width: 100%; max-width: none; flex: 1; }
  .adm-search kbd { display: none; }
  .adm-main { padding: 18px 14px 60px; }
  .adm-actionbar { top: var(--topbar-h); }
  .adm-topbar__title { display: none; }
  .adm-tiles { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .adm-tile { padding: 14px; }
  .adm-tile__num { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) { .adm-sidebar, .adm-tile, .adm-toast { transition: none; animation: none; } }
