/* ==========================================================================
   OpenAWO – Asset Management
   Farbwelt der Arbeiterwohlfahrt: AWO-Rot (RAL 3020), Schwarz, Weiß
   plus fünf Sekundärfarben. Keine externen Schriften (datenschutzfreundlich).
   ========================================================================== */

:root {
    /* Primär */
    --awo-rot: #cc0605;           /* RAL 3020 Verkehrsrot (Bildschirm-Näherung) */
    --awo-rot-dunkel: #a50504;
    --awo-rot-hell: #fdeceb;
    --schwarz: #141414;
    --weiss: #ffffff;

    /* Sekundär */
    --awo-violett: #5560a4;
    --awo-gelb: #fecd1b;
    --awo-orange: #ec7405;
    --awo-blau: #009ee0;
    --awo-gruen: #79b530;

    /* Neutral */
    --text: #1c1c1e;
    --text-muted: #6b6b73;
    --bg: #f5f5f7;
    --surface: #ffffff;
    --border: #e7e7ec;
    --border-strong: #d4d4dc;

    /* Form */
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 1px 2px rgba(20, 20, 20, .04), 0 6px 24px rgba(20, 20, 20, .06);
    --focus: 0 0 0 3px rgba(204, 6, 5, .22);
    --sidebar-w: 256px;

    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.icon { width: 18px; height: 18px; flex: none; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --------------------------------------------------------------------------
   Grundlayout
   -------------------------------------------------------------------------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
    position: sticky; top: 0;
    width: var(--sidebar-w); height: 100vh;
    flex: none;
    display: flex; flex-direction: column;
    background: var(--schwarz);
    color: #f2f2f2;
    padding: 22px 14px 18px;
    border-top: 4px solid var(--awo-rot);
}

.brand {
    display: flex; align-items: center; gap: 12px;
    padding: 4px 10px 22px;
    text-decoration: none;
}
.brand-mark {
    display: grid; place-items: center;
    width: 40px; height: 40px;
    border-radius: 11px;
    background: var(--awo-rot);
    color: var(--weiss);
    box-shadow: 0 6px 18px rgba(204, 6, 5, .35);
}
.brand-mark .icon { width: 22px; height: 22px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 17px; letter-spacing: -.01em; }
.brand-text small { font-size: 12.5px; color: #a7a7ae; }

.nav { flex: 1; overflow-y: auto; }
.nav-group { margin-bottom: 18px; }
.nav-group-title {
    padding: 0 12px 6px;
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .08em;
    color: #85858d;
}
.nav-item {
    position: relative;
    display: flex; align-items: center; gap: 11px;
    padding: 9px 12px;
    margin-bottom: 2px;
    border-radius: var(--radius-sm);
    color: #d6d6dc;
    text-decoration: none;
    font-weight: 500;
    transition: background .15s, color .15s;
}
a.nav-item:hover { background: rgba(255, 255, 255, .07); color: var(--weiss); }
.nav-item.is-active {
    background: var(--awo-rot);
    color: var(--weiss);
}
.nav-item.is-disabled { color: #6c6c74; cursor: default; }
.nav-soon {
    margin-left: auto;
    font-style: normal; font-size: 10.5px; font-weight: 600;
    padding: 1px 7px; border-radius: 99px;
    background: rgba(255, 255, 255, .07); color: #8d8d95;
}
.sidebar-foot {
    padding: 12px 12px 0;
    border-top: 1px solid rgba(255, 255, 255, .08);
    font-size: 12.5px; color: #85858d;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar { display: none; }

.content {
    width: 100%;
    max-width: 1120px;
    padding: 36px 40px 64px;
}

/* --------------------------------------------------------------------------
   Seitenkopf
   -------------------------------------------------------------------------- */
.page-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 16px; flex-wrap: wrap;
    margin-bottom: 24px;
}
.eyebrow {
    margin: 0 0 4px;
    font-size: 12px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .09em;
    color: var(--awo-rot);
}
h1 {
    margin: 0;
    font-size: 30px; line-height: 1.15; font-weight: 750;
    letter-spacing: -.02em;
}
.page-sub { margin: 6px 0 0; color: var(--text-muted); }

.breadcrumb {
    display: flex; gap: 8px; align-items: center;
    margin-bottom: 14px;
    font-size: 13.5px; color: var(--text-muted);
}
.breadcrumb a { text-decoration: none; color: var(--text-muted); }
.breadcrumb a:hover { color: var(--awo-rot); }

/* --------------------------------------------------------------------------
   Karten
   -------------------------------------------------------------------------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.card-form { max-width: 680px; padding: 28px; overflow: visible; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 40px; padding: 0 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font: inherit; font-weight: 600; font-size: 14.5px;
    text-decoration: none; white-space: nowrap;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }

.btn-primary { background: var(--awo-rot); color: var(--weiss); box-shadow: 0 4px 14px rgba(204, 6, 5, .25); }
.btn-primary:hover { background: var(--awo-rot-dunkel); }

.btn-secondary { background: var(--weiss); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { border-color: var(--schwarz); }

.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: #ececf0; color: var(--text); }

.btn-danger { background: var(--awo-rot); color: var(--weiss); }
.btn-danger:hover { background: var(--awo-rot-dunkel); }

.icon-btn {
    display: inline-grid; place-items: center;
    width: 36px; height: 36px;
    border: 0; border-radius: var(--radius-sm);
    background: transparent; color: var(--text-muted);
    cursor: pointer;
    transition: background .15s, color .15s;
}
.icon-btn:hover { background: #efeff3; color: var(--text); }
.icon-btn:focus-visible { outline: none; box-shadow: var(--focus); }
.icon-btn-danger:hover { background: var(--awo-rot-hell); color: var(--awo-rot); }

/* --------------------------------------------------------------------------
   Werkzeugleiste & Suche
   -------------------------------------------------------------------------- */
.toolbar {
    display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
}
.search {
    position: relative;
    flex: 1 1 240px; max-width: 380px;
}
.search .icon {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); pointer-events: none;
}
.search input {
    width: 100%; height: 40px;
    padding: 0 12px 0 40px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--weiss);
    font: inherit; color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}
.select-wrap select, .field select {
    height: 40px;
    padding: 0 38px 0 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--weiss) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b6b73' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 16px;
    font: inherit; color: var(--text);
    appearance: none; -webkit-appearance: none;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}
.select-wrap select { max-width: 250px; }
.select-wrap select:focus, .field select:focus { outline: none; border-color: var(--awo-rot); box-shadow: var(--focus); }
.search input:focus { outline: none; border-color: var(--awo-rot); box-shadow: var(--focus); }

/* --------------------------------------------------------------------------
   Tabelle
   -------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 13px 18px; text-align: left; vertical-align: middle; }
.table thead th {
    background: #fafafb;
    border-bottom: 1px solid var(--border);
    font-size: 12px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .06em;
    color: var(--text-muted);
}
.table tbody tr { border-bottom: 1px solid var(--border); transition: background .12s; }
.table tbody tr:last-child { border-bottom: 0; }
.table tbody tr:hover { background: #fbfbfc; }

.th-sort { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; white-space: nowrap; }
.th-sort:hover, .th-sort.is-sorted { color: var(--text); }
.th-sort .icon { width: 14px; height: 14px; color: var(--awo-rot); }

.cell-strong a { font-weight: 600; text-decoration: none; }
.cell-strong a:hover { color: var(--awo-rot); }

.col-kurz { width: 160px; }
.col-date { width: 190px; white-space: nowrap; font-size: 14px; }
.col-actions { width: 104px; text-align: right !important; white-space: nowrap; }

.muted { color: var(--text-muted); }
.table-foot { margin: 0; padding: 12px 18px; border-top: 1px solid var(--border); font-size: 13.5px; }

.col-num { width: 110px; text-align: center !important; font-variant-numeric: tabular-nums; }
.col-firma { width: 130px; }
.col-kontakt { font-size: 14px; }
.mail-link { color: var(--text-muted); text-decoration: none; word-break: break-all; }
.mail-link:hover { color: var(--awo-rot); text-decoration: underline; }
.count-link {
    display: inline-grid; place-items: center;
    min-width: 30px; height: 26px; padding: 0 8px;
    border-radius: 99px;
    background: #f0f0f4; color: var(--text);
    font-weight: 600; font-size: 13.5px; text-decoration: none;
}
.count-link:hover { background: var(--awo-rot-hell); color: var(--awo-rot); }

/* Kurzname-Etiketten in den AWO-Sekundärfarben */
.tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 13px; font-weight: 700; letter-spacing: .02em;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.tag-0 { background: #eceefa; color: var(--awo-violett); }
.tag-1 { background: #fff6d6; color: #7a5b00; }
.tag-2 { background: #fdeedf; color: #b25600; }
.tag-3 { background: #e0f4fc; color: #00739f; }
.tag-4 { background: #edf6e2; color: #4d7a17; }

/* Leerer Zustand */
.empty { padding: 56px 24px; text-align: center; }
.empty-icon {
    display: inline-grid; place-items: center;
    width: 64px; height: 64px; margin-bottom: 14px;
    border-radius: 18px;
    background: var(--awo-rot-hell); color: var(--awo-rot);
}
.empty-icon .icon { width: 30px; height: 30px; }
.empty h2 { margin: 0 0 6px; font-size: 19px; }
.empty p { margin: 0 auto 20px; max-width: 420px; color: var(--text-muted); }

/* --------------------------------------------------------------------------
   Formulare
   -------------------------------------------------------------------------- */
.field { margin-bottom: 22px; }
.field-short { max-width: 280px; }
.field label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 14px; }
.req { color: var(--awo-rot); }
.field input {
    width: 100%; height: 44px;
    padding: 0 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--weiss);
    font: inherit; font-size: 15px; color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}
.field select { width: 100%; height: 44px; padding-left: 14px; font-size: 15px; }
.has-error select { border-color: var(--awo-rot); background-color: #fffafa; }
.field-row { display: grid; grid-template-columns: 140px 1fr; gap: 16px; }
.field-row-half { grid-template-columns: 1fr 1fr; }
.form-section {
    margin: 8px 0 16px; padding-top: 22px;
    border-top: 1px solid var(--border);
    font-size: 13px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .08em;
    color: var(--awo-rot);
}
.field input::placeholder { color: #a5a5ad; }
.field input:focus { outline: none; border-color: var(--awo-rot); box-shadow: var(--focus); }
.field textarea {
    width: 100%; min-height: 100px;
    padding: 10px 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--weiss);
    font: inherit; font-size: 15px; line-height: 1.5; color: var(--text);
    resize: vertical;
    transition: border-color .15s, box-shadow .15s;
}
.field textarea::placeholder { color: #a5a5ad; }
.field textarea:focus { outline: none; border-color: var(--awo-rot); box-shadow: var(--focus); }
.has-error textarea { border-color: var(--awo-rot); background: #fffafa; }
.field-hint { margin: 6px 0 0; font-size: 13px; color: var(--text-muted); }
.field-error { margin: 6px 0 0; font-size: 13px; font-weight: 600; color: var(--awo-rot); }
.has-error input { border-color: var(--awo-rot); background: #fffafa; }

.meta { font-size: 13px; margin: 0 0 6px; }

.form-actions {
    display: flex; justify-content: flex-end; gap: 10px;
    margin-top: 26px; padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* Foto-Feld */
.label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 14px; }
.foto-feld { display: flex; gap: 20px; align-items: flex-start; }
.foto-vorschau {
    position: relative;
    flex: none;
    width: 200px; aspect-ratio: 4 / 3;
    border-radius: var(--radius);
    overflow: hidden;
    background: #f0f0f4;
    border: 1px solid var(--border);
    transition: opacity .15s, filter .15s;
}
.foto-vorschau img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.foto-platzhalter {
    position: absolute; inset: 0;
    display: none; place-items: center;
    color: #b4b4bc;
}
.foto-vorschau.is-leer .foto-platzhalter { display: grid; }
.foto-vorschau.is-leer { border-style: dashed; border-color: var(--border-strong); }
.foto-platzhalter .icon { width: 36px; height: 36px; }
.foto-vorschau.is-entfernt { opacity: .35; filter: grayscale(1); }
.foto-aktionen { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding-top: 4px; }
.foto-aktionen .field-hint { margin: 0; }
.foto-waehlen { position: relative; overflow: hidden; }
.foto-waehlen input[type=file] {
    position: absolute; inset: 0;
    opacity: 0; cursor: pointer;
    font-size: 0;
}
.foto-waehlen:focus-within { box-shadow: var(--focus); border-color: var(--awo-rot); }
.field label.btn { display: inline-flex; margin-bottom: 0; font-size: 14.5px; }
.field label.check { display: inline-flex; margin-bottom: 0; font-weight: 500; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--awo-rot); }
.has-error .foto-vorschau { border-color: var(--awo-rot); }

/* Vorschaubild in der Liste */
.standort-link { display: inline-flex; align-items: center; gap: 12px; }
.thumb {
    flex: none;
    display: grid; place-items: center;
    width: 44px; height: 44px;
    border-radius: 10px;
    overflow: hidden;
    background: #f0f0f4; color: #a5a5ad;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .icon { width: 18px; height: 18px; }

/* Combobox (durchsuchbare Auswahl) */
.combobox { position: relative; }
.field .combobox-input { padding-right: 76px; }
.combobox-toggle, .combobox-clear {
    position: absolute; top: 50%; transform: translateY(-50%);
    display: grid; place-items: center;
    width: 30px; height: 30px;
    border: 0; border-radius: 7px;
    background: transparent; color: var(--text-muted);
    cursor: pointer;
}
.combobox-toggle { right: 8px; }
.combobox-clear { right: 40px; display: none; }
.combobox.hat-wert .combobox-clear { display: grid; }
.combobox-toggle:hover, .combobox-clear:hover { background: #efeff3; color: var(--text); }
.combobox-toggle svg, .combobox-clear svg { width: 16px; height: 16px; transition: transform .15s; }
.combobox.is-open .combobox-toggle svg { transform: rotate(180deg); }
.combobox-liste {
    position: absolute; z-index: 25;
    top: calc(100% + 6px); left: 0; right: 0;
    max-height: 300px; overflow-y: auto;
    margin: 0; padding: 6px;
    list-style: none;
    background: var(--weiss);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 12px 32px rgba(20, 20, 20, .14);
}
.combobox-liste li[role=option] {
    display: flex; flex-direction: column;
    padding: 8px 12px 8px 34px;
    border-radius: 7px;
    cursor: pointer;
    position: relative;
}
.combobox-liste li.is-active { background: #f3f3f6; }
.combobox-liste li[aria-selected=true] { color: var(--awo-rot); }
.combobox-liste li[aria-selected=true]::before {
    content: ""; position: absolute; left: 13px; top: 13px;
    width: 10px; height: 6px;
    border-left: 2px solid var(--awo-rot); border-bottom: 2px solid var(--awo-rot);
    transform: rotate(-45deg);
}
.combobox-label { font-weight: 600; }
.combobox-sub { font-size: 13px; color: var(--text-muted); }
.combobox-liste mark { background: #fff1bf; color: inherit; border-radius: 3px; padding: 0 1px; }
.combobox-liste li.combobox-aktion {
    margin-top: 4px; padding: 9px 12px 9px 34px;
    border-top: 1px solid var(--border);
    border-radius: 0 0 7px 7px;
    color: var(--awo-rot); font-weight: 600;
}
.combobox-liste li.combobox-aktion::before {
    content: "+"; position: absolute; left: 13px; top: 6px;
    font-size: 18px; font-weight: 600;
}
.combobox-liste li.combobox-aktion.is-active { background: var(--awo-rot-hell); }
.combobox-leer { padding: 10px 12px; color: var(--text-muted); font-size: 14px; }
.has-error .combobox-input { border-color: var(--awo-rot); background: #fffafa; }

/* Assets */
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; letter-spacing: .01em; }
.cell-strong .mono { font-weight: 700; }
.field input.mono { font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; font-size: 15px; }
.status {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 3px 10px 3px 8px; border-radius: 99px;
    font-size: 13px; font-weight: 600; white-space: nowrap;
}
.status i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.status-1 { background: #f0f0f4; color: #6b6b73; }                       /* Unbekannt */
.status-2 { background: #eceefa; color: var(--awo-violett); }             /* In Bestellung */
.status-3 { background: #fdeedf; color: #b25600; }                        /* In Vorbereitung */
.status-4 { background: #fff6d6; color: #7a5b00; }                        /* Zur Abholung bereit */
.status-4 i { background: var(--awo-gelb); box-shadow: 0 0 0 1px #c99a00; }
.status-5 { background: #edf6e2; color: #4d7a17; }                        /* Im Einsatz */
.status-6 { background: #2a2a2e; color: #f2f2f2; }                        /* Verschrottet */
.status-7 { background: #e0f4fc; color: #00739f; }                        /* Im Rücklauf */
.field select.select-status { width: 100%; height: 44px; padding-left: 14px; font-size: 15px; }

/* Bereiche im Formular (z. B. Einkauf, Standort, Leasing) */
.form-gruppe {
    margin: 26px 0 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fbfbfc;
}
.form-gruppe + .form-gruppe { margin-top: 16px; }
.form-gruppe-kopf {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 18px;
    list-style: none;
}
.form-gruppe-kopf::-webkit-details-marker { display: none; }
.form-gruppe-kopf strong { display: block; font-size: 15.5px; }
.form-gruppe-kopf small { display: block; font-size: 13px; color: var(--text-muted); }
.form-gruppe-icon {
    display: grid; place-items: center; flex: none;
    width: 34px; height: 34px; border-radius: 10px;
    background: var(--awo-rot-hell); color: var(--awo-rot);
}
.form-gruppe-icon .icon { width: 17px; height: 17px; }
.form-gruppe-inhalt { padding: 2px 18px 2px; }
.form-gruppe-inhalt > .field:last-child, .form-gruppe-inhalt > .field-row:last-child .field { margin-bottom: 18px; }
.form-gruppe-klappbar > .form-gruppe-kopf { cursor: pointer; border-radius: var(--radius); }
.form-gruppe-klappbar > .form-gruppe-kopf:hover { background: #f4f4f7; }
.form-gruppe-klappbar > .form-gruppe-kopf:focus-visible { outline: none; box-shadow: var(--focus); }
.form-gruppe-pfeil { margin-left: auto; color: var(--text-muted); transition: transform .15s; }
.form-gruppe-klappbar[open] > .form-gruppe-kopf .form-gruppe-pfeil { transform: rotate(180deg); }
.form-gruppe-klappbar[open] > .form-gruppe-kopf { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.form-gruppe .field input, .form-gruppe .field textarea, .form-gruppe .field select { background-color: var(--weiss); }
.form-gruppe + .meta, .form-gruppe ~ .meta { margin-top: 18px; }

/* Eingabe mit Einheit (Euro) und Datum */
.input-einheit { position: relative; }
.input-einheit input { padding-right: 36px !important; text-align: right; font-variant-numeric: tabular-nums; }
.input-einheit span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.field input[type=date] { font-variant-numeric: tabular-nums; }

/* Rechte-Matrix (Benutzergruppen) */
.rechte-hinweis { margin: -6px 0 16px; }
.rechte-matrix { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 20px; }
.rechte-matrix table { width: 100%; border-collapse: collapse; }
.rechte-matrix th, .rechte-matrix td { padding: 9px 16px; text-align: left; font-size: 14.5px; }
.rechte-matrix thead th {
    background: #fafafb; border-bottom: 1px solid var(--border);
    font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted);
    vertical-align: bottom;
}
.rechte-matrix tbody th[scope=row] { font-weight: 500; }
.rechte-matrix tbody tr + tr { border-top: 1px solid #f0f0f3; }
.rechte-matrix tbody tr:not(.rechte-gruppe):hover { background: #fbfbfc; }
.rechte-gruppe th {
    padding-top: 14px !important; padding-bottom: 6px !important;
    font-size: 11px !important; font-weight: 700 !important;
    text-transform: uppercase; letter-spacing: .08em; color: var(--awo-rot);
    background: var(--weiss);
}
.rechte-spalte { width: 130px; text-align: center !important; }
.rechte-spalte > span { display: block; }
.rechte-alle {
    display: inline-flex; align-items: center; gap: 5px; margin-top: 6px;
    font-size: 11.5px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text-muted);
    cursor: pointer;
}
.rechte-alle input { width: 14px; height: 14px; accent-color: var(--awo-rot); cursor: pointer; }
.recht-check { display: inline-grid; place-items: center; cursor: pointer; padding: 4px; }
.recht-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.recht-check span {
    display: grid; place-items: center;
    width: 22px; height: 22px;
    border: 2px solid var(--border-strong); border-radius: 6px;
    background: var(--weiss);
    transition: background .12s, border-color .12s;
}
.recht-check span::after {
    content: ""; width: 10px; height: 5px; margin-top: -3px;
    border-left: 2.5px solid var(--weiss); border-bottom: 2.5px solid var(--weiss);
    transform: rotate(-45deg); opacity: 0;
}
.recht-check:hover span { border-color: var(--awo-rot); }
.recht-check input:checked + span { background: var(--awo-rot); border-color: var(--awo-rot); }
.recht-check input:checked + span::after { opacity: 1; }
.recht-check input:focus-visible + span { box-shadow: var(--focus); }
.recht-chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 9px; border-radius: 99px;
    font-size: 12.5px; font-weight: 600;
}
.recht-chip b { font-variant-numeric: tabular-nums; }
.recht-bearbeiten { background: #e0f4fc; color: #00739f; }
.recht-loeschen { background: var(--awo-rot-hell); color: var(--awo-rot-dunkel); }

/* Benutzerkonto */
.check-gross { align-items: flex-start !important; gap: 12px !important; font-size: 15px !important; }
.check-gross input { width: 18px !important; height: 18px !important; margin-top: 2px; }
.check-gross .field-hint { display: block; margin-top: 2px; }
.login-badge {
    display: inline-flex; align-items: center; gap: 4px;
    margin-left: 4px; padding: 2px 8px; border-radius: 99px;
    background: #eff7e6; color: #3b5f12; font-size: 12px; font-weight: 600;
    vertical-align: middle;
}
.login-badge .icon { width: 12px; height: 12px; }

/* Personen */
.person-link { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.person-link:hover strong { color: var(--awo-rot); }
.avatar {
    flex: none;
    display: grid; place-items: center;
    width: 40px; height: 40px;
    border-radius: 50%;
    font-size: 14px; font-weight: 700; letter-spacing: .02em;
}
.avatar-0 { background: #eceefa; color: var(--awo-violett); }
.avatar-1 { background: #fff6d6; color: #7a5b00; }
.avatar-2 { background: #fdeedf; color: #b25600; }
.avatar-3 { background: #e0f4fc; color: #00739f; }
.avatar-4 { background: #edf6e2; color: #4d7a17; }
.small { font-size: 13px; }
.kontakt-liste { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.kontakt-liste li { display: flex; align-items: center; gap: 7px; line-height: 1.7; }
.kontakt-liste .icon { width: 14px; height: 14px; color: #a5a5ad; }
.kontakt-liste a { text-decoration: none; color: var(--text); }
.kontakt-liste a:hover { color: var(--awo-rot); text-decoration: underline; }
.col-user { width: 210px; }
.user-tag {
    display: inline-block; padding: 2px 8px;
    border-radius: 6px; background: #f0f0f4;
    font: 600 13px ui-monospace, SFMono-Regular, Consolas, monospace;
}
.plain-link { text-decoration: none; }
.ext-link { display: inline-flex; align-items: center; gap: 5px; color: var(--text); text-decoration: none; font-size: 14px; }
.ext-link .icon { width: 13px; height: 13px; color: #a5a5ad; }
.ext-link:hover { color: var(--awo-rot); }
.ext-link:hover .icon { color: var(--awo-rot); }
.col-neben { font-size: 14px; }
.cell-strong a.tag { font-weight: 700; }
a.tag { text-decoration: none; }
a.tag:hover { filter: brightness(.96); text-decoration: underline; }
.plain-link:hover { color: var(--awo-rot); text-decoration: underline; }
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    height: 32px; padding: 0 10px;
    border-radius: 99px;
    background: var(--awo-rot-hell); color: var(--awo-rot-dunkel);
    font-size: 13.5px; font-weight: 600; text-decoration: none;
}
.chip .icon { width: 15px; height: 15px; }
.chip:hover { background: #fbd9d8; }
.info-box {
    display: flex; gap: 12px; align-items: flex-start;
    margin: 4px 0 20px; padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: #f6f6f9; font-size: 14px;
}
.info-box .icon { color: var(--awo-rot); margin-top: 2px; }
.info-box a { color: var(--text); font-weight: 600; }

/* --------------------------------------------------------------------------
   Meldungen
   -------------------------------------------------------------------------- */
.flash {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 12px 12px 16px;
    margin-bottom: 18px;
    border-radius: var(--radius-sm);
    border-left: 4px solid;
    font-weight: 500;
    animation: flash-in .25s ease-out;
}
.flash-erfolg { background: #eff7e6; border-color: var(--awo-gruen); color: #3b5f12; }
.flash-fehler { background: var(--awo-rot-hell); border-color: var(--awo-rot); color: #8d0403; }
.flash-info   { background: #e6f5fc; border-color: var(--awo-blau); color: #005f87; }
.flash-close {
    display: grid; place-items: center;
    width: 28px; height: 28px; border: 0; border-radius: 7px;
    background: transparent; color: inherit; opacity: .6; cursor: pointer;
}
.flash-close:hover { opacity: 1; background: rgba(0, 0, 0, .05); }
.flash.is-leaving { opacity: 0; transform: translateY(-4px); transition: opacity .25s, transform .25s; }

@keyframes flash-in { from { opacity: 0; transform: translateY(-4px); } }

/* --------------------------------------------------------------------------
   Dialog
   -------------------------------------------------------------------------- */
.dialog {
    width: min(440px, calc(100vw - 32px));
    padding: 0;
    border: 0; border-radius: 18px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, .25);
    color: var(--text);
}
.dialog > form { padding: 28px; }
.dialog::backdrop { background: rgba(20, 20, 20, .45); backdrop-filter: blur(2px); }
.dialog[open] { animation: dialog-in .18s ease-out; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.dialog-icon {
    display: grid; place-items: center;
    width: 48px; height: 48px; margin-bottom: 14px;
    border-radius: 14px;
    background: var(--awo-rot-hell); color: var(--awo-rot);
}
.dialog-icon .icon { width: 24px; height: 24px; }
.dialog h2 { margin: 0 0 8px; font-size: 20px; }
.dialog p { margin: 0; color: var(--text-muted); }
.dialog p strong { color: var(--text); }
.dialog-form { width: min(580px, calc(100vw - 32px)); }
.dialog-form .field { margin-bottom: 16px; }
.dialog-form .field-hint { margin: -4px 0 0; }
.dialog-kopf { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.dialog-kopf .dialog-icon { margin-bottom: 0; flex: none; }
.dialog-kopf h2 { margin: 2px 0 4px; }
.dialog-icon-neutral { background: #eceefa; color: var(--awo-violett); }
.field-ok {
    margin: 8px 0 0; padding: 8px 12px;
    border-radius: 8px; background: #eff7e6; color: #3b5f12;
    font-size: 13.5px; font-weight: 600;
}
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }


/* ==========================================================================
   Anmeldung & Benutzerkonto
   ========================================================================== */
.seite-einfach {
    min-height: 100vh;
    background:
        radial-gradient(1200px 500px at 50% -10%, var(--awo-rot-hell), transparent 70%),
        var(--bg);
}
.einfach { width: min(440px, calc(100vw - 32px)); margin: 0 auto; padding: 56px 0 48px; }
.einfach-marke { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 24px; }
.einfach-marke .brand-text strong { font-size: 19px; }
.einfach-marke .brand-text small { color: var(--text-muted); }
.einfach-karte {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 4px solid var(--awo-rot);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 30px 30px 26px;
}
.einfach-karte h1 { font-size: 24px; margin-bottom: 6px; }
.einfach-sub { margin: 0 0 20px; color: var(--text-muted); }
.einfach-link { margin: 18px 0 0; text-align: center; font-size: 14px; }
.einfach-link a { color: var(--text-muted); }
.einfach-link a:hover { color: var(--awo-rot); }
.btn-breit { width: 100%; height: 46px; margin-top: 6px; }
.einfach-karte code { font-size: 13px; background: #f0f0f4; padding: 1px 5px; border-radius: 5px; }

.passwort-eingabe { position: relative; }
.passwort-eingabe input { padding-right: 48px !important; }
.passwort-zeigen { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.passwort-zeigen.is-aktiv { color: var(--awo-rot); }
.field-hint.ok { color: #4d7a17; font-weight: 600; }

/* Benutzer in der Seitenleiste */
.benutzer-box {
    display: flex; align-items: center; gap: 6px;
    margin: 0 -2px 10px; padding: 10px 8px 10px 10px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, .05);
}
.benutzer-name { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; text-decoration: none; color: #f2f2f2; }
.benutzer-name .avatar { width: 34px; height: 34px; font-size: 12.5px; }
.benutzer-name span:last-child { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.benutzer-name strong { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.benutzer-name small { font-size: 12px; color: #a7a7ae; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.benutzer-name:hover strong { color: var(--weiss); text-decoration: underline; }
.benutzer-box form { margin: 0; }
.benutzer-abmelden { color: #a7a7ae; }
.benutzer-abmelden:hover { background: rgba(255, 255, 255, .1); color: var(--weiss); }

/* Hinweisfenster "Keine Berechtigung" */
.dialog > .dialog-inhalt { padding: 28px; }
.dialog-icon-warnung { background: #fff6d6; color: #7a5b00; }

/* Benutzerkonto im Personenformular */
.feldgruppe { border: 0; margin: 0; padding: 0; min-width: 0; }
.feldgruppe[disabled] { opacity: .6; }
.combobox.is-gesperrt .combobox-input { background: #f5f5f7; cursor: not-allowed; }
.hinweis-zeile {
    display: flex; gap: 8px; align-items: flex-start;
    margin: -6px 0 16px; padding: 10px 12px;
    border-radius: var(--radius-sm); background: #f6f6f9;
    font-size: 13.5px; color: var(--text-muted);
}
.hinweis-zeile .icon { width: 16px; height: 16px; margin-top: 2px; color: #a5a5ad; }
.konto-status {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    margin: 4px 0 20px; padding: 14px 16px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.konto-status > div:first-child { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.konto-status .login-badge { margin-left: 0; }
.konto-aktionen { display: flex; gap: 8px; flex-wrap: wrap; }
.konto-aktionen .btn { height: 36px; font-size: 13.5px; }
.einmal-link p { margin: 2px 0 10px; }
.kopier-zeile { display: flex; gap: 8px; }
.kopier-zeile input {
    flex: 1; min-width: 0; height: 38px; padding: 0 10px;
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    font: 12.5px ui-monospace, SFMono-Regular, Consolas, monospace; background: var(--weiss);
}

/* Mein Konto */
.angaben { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 24px; margin: 0 0 6px; }
.angaben div { min-width: 0; }
.angaben dt { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.angaben dd { margin: 3px 0 0; font-size: 15px; overflow-wrap: anywhere; }

/* Anmeldeprotokoll */
.protokoll-status { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 500; }
.protokoll-status i { width: 8px; height: 8px; border-radius: 50%; }
.protokoll-status.ok i { background: var(--awo-gruen); }
.protokoll-status.fehler i { background: var(--awo-rot); }
.protokoll-status.fehler { color: var(--awo-rot-dunkel); }
.rechte-zusatz { display: block; font-size: 12px; font-weight: 400; color: var(--text-muted); }

/* --------------------------------------------------------------------------
   Mobil
   -------------------------------------------------------------------------- */
@media (max-width: 860px) {
    .sidebar {
        position: fixed; left: 0; z-index: 50;
        transform: translateX(-100%);
        transition: transform .22s ease-out;
    }
    body.menu-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
    body.menu-open::after {
        content: ""; position: fixed; inset: 0; z-index: 40;
        background: rgba(20, 20, 20, .4);
    }

    .topbar {
        position: sticky; top: 0; z-index: 30;
        display: flex; align-items: center; gap: 8px;
        height: 56px; padding: 0 10px;
        background: var(--weiss);
        border-bottom: 1px solid var(--border);
        border-top: 3px solid var(--awo-rot);
    }
    .topbar-title { font-weight: 650; }

    .content { padding: 22px 16px 48px; }
    h1 { font-size: 25px; }
    .page-head .btn { width: 100%; }

    .col-date { display: none; }
    .col-kurz { width: auto; }
    .col-num { display: none; }
    .col-firma { width: auto; }
    .select-wrap { flex: 1 1 100%; }
    .select-wrap select { max-width: none; width: 100%; }
    .field-row { grid-template-columns: 110px 1fr; gap: 12px; }
    .field-row-half { grid-template-columns: 1fr; gap: 0; }
    .form-gruppe-kopf { padding: 12px 14px; }
    .form-gruppe-inhalt { padding: 2px 14px; }
    .col-kontakt { display: none; }
    .col-user { display: none; }
    .angaben { grid-template-columns: 1fr; }
    .einfach { padding-top: 32px; }
    .einfach-karte { padding: 24px 20px; }
    .status { font-size: 12px; padding: 2px 8px 2px 7px; }
    .table td.col-neben:nth-child(n+3), .table th.col-neben:nth-child(n+3) { display: none; }
    .foto-feld { flex-direction: column; }
    .foto-vorschau { width: 100%; }
    .thumb { width: 36px; height: 36px; }
    .col-actions { width: 84px; }
    .icon-btn { width: 34px; }
    .table th, .table td { padding: 12px 12px; }
    .card-form { padding: 20px; }
    .field-short { max-width: none; }
}
