/* Farben mit fester Bedeutung (docs/ux-konzept.md, Abschnitt 7.3). Text auf den "-soft"-Flächen erfüllt WCAG AA. */
:root {
    color-scheme: light;
    --surface-canvas: #f3f6fa;
    --surface-card: #fff;
    --surface-subtle: #f8fafc;
    --border: #dfe5ec;
    --border-strong: #cbd5e1;
    --text-strong: #17263b;
    --text: #29394f;
    --text-muted: #5f6e82;
    --primary: #1769c5;
    --primary-hover: #1058a9;
    --primary-soft: #eaf3fd;
    --focus: #4b9bea;
    /* Passt, Relevant, Offen, Quelle aktuell */
    --positive: #12704a;
    --positive-soft: #e6f5ed;
    /* Prüfen, Später prüfen, Frist ≤ 7 Tage, Quelle veraltet */
    --caution: #8a5207;
    --caution-soft: #fff3dc;
    /* Passt nicht, Frist ≤ 3 Tage, Fehler, zerstörende Aktionen */
    --critical: #a3302a;
    --critical-soft: #fdeceb;
    /* Ausstehend, Ohne KI, Beendet, Pausiert */
    --neutral: #54637a;
    --neutral-soft: #eef1f5;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--surface-canvas);
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--surface-canvas); }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--surface-canvas); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

:focus-visible {
    outline: 3px solid rgba(75, 155, 234, .45);
    outline-offset: 2px;
}

h1 {
    margin: 0;
    color: var(--text-strong);
    font-size: 1.6rem;
    font-weight: 760;
    letter-spacing: -.03em;
    line-height: 1.2;
}

h1:focus { outline: none; }
h2 { margin: 0 0 12px; color: var(--text-strong); font-size: 1.05rem; font-weight: 720; letter-spacing: -.015em; }
h3 { color: var(--text-strong); }
p { line-height: 1.55; }
a { color: var(--primary); text-underline-offset: 2px; }
.muted { color: var(--text-muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.clamp-1, .clamp-2 { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; }
.clamp-1 { -webkit-line-clamp: 1; line-clamp: 1; }
.clamp-2 { -webkit-line-clamp: 2; line-clamp: 2; }

/* Seitenkopf (PageHeader) */
.page-head { margin-bottom: 14px; }
.page-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.page-head-copy { min-width: 0; }
.page-head-subtitle { max-width: 760px; margin: 4px 0 0; color: var(--text-muted); font-size: .9rem; }
.page-head-actions { flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 8px; color: var(--primary); font-size: .84rem; font-weight: 680; text-decoration: none; }
.back-link:hover { text-decoration: underline; }

/* Alte Kopfvariante der Verwaltungsseiten mit eigenem Inhalt */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; margin-bottom: 18px; }
.page-header p { max-width: 760px; margin: 5px 0 0; color: var(--text-muted); font-size: .9rem; }

.button {
    appearance: none;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    padding: 8px 14px;
    color: #34445a;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 34, 56, .04);
    font-size: .86rem;
    font-weight: 680;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background .14s ease, border-color .14s ease, box-shadow .14s ease;
}

.button:hover { border-color: #b6c3d2; background: var(--surface-subtle); }
.button.primary { border-color: var(--primary); color: #fff; background: var(--primary); box-shadow: 0 4px 10px rgba(23, 105, 197, .16); }
.button.primary:hover { border-color: var(--primary-hover); background: var(--primary-hover); }
.button.danger { border-color: #efbbb6; color: var(--critical); background: #fffafa; }
.button.danger:hover { border-color: var(--critical); background: var(--critical-soft); }
.button.small { min-height: 32px; padding: 5px 10px; font-size: .78rem; }
.button.full { width: 100%; }
.button:disabled { opacity: .52; cursor: not-allowed; }
.text-button { padding: 4px 0; border: 0; color: var(--primary); background: transparent; font-size: .8rem; font-weight: 680; cursor: pointer; }
.text-button:hover { text-decoration: underline; }
.icon-button { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 8px; color: var(--text-muted); background: transparent; cursor: pointer; }
.icon-button:hover { border-color: var(--border); color: var(--critical); background: #fff; }
.icon-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.card {
    min-width: 0;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-card);
    box-shadow: 0 1px 3px rgba(15, 36, 62, .04);
}

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); gap: 16px; margin-bottom: 22px; }
.metric { margin-top: 9px; color: var(--text-strong); font-size: 1.9rem; font-weight: 780; letter-spacing: -.04em; line-height: 1; }
.metric-label { color: var(--text-muted); font-size: .79rem; font-weight: 590; }

.table-wrap { position: relative; max-width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: 11px; background: #fff; }
.card > .table-wrap { margin: 0 -4px -4px; }
.table-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; color: var(--text-muted); font-size: .82rem; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 14px; border-bottom: 1px solid #e8edf3; text-align: left; vertical-align: top; }
th { color: #5b6a7e; background: #f7f9fc; font-size: .7rem; font-weight: 760; letter-spacing: .055em; text-transform: uppercase; white-space: nowrap; }
td { color: #35455a; font-size: .84rem; line-height: 1.45; }
tbody tr:hover { background: #fafcff; }
tr:last-child td { border-bottom: 0; }

/* Zähler und Kennzeichen in Verwaltungstabellen */
.badge { display: inline-flex; align-items: center; min-height: 22px; border-radius: 999px; padding: 3px 8px; color: var(--neutral); background: var(--neutral-soft); font-size: .7rem; font-weight: 720; white-space: nowrap; }
.badge.success { color: var(--positive); background: var(--positive-soft); }
.badge.warning { color: var(--caution); background: var(--caution-soft); }
.badge.danger { color: var(--critical); background: var(--critical-soft); }
.badge.info { color: var(--primary); background: var(--primary-soft); }

.alert { margin: 14px 0; padding: 12px 15px; border: 1px solid #b9dcfa; border-radius: 10px; color: #24537e; background: #eef7ff; line-height: 1.48; }
.alert.success { border-color: #a9e5c6; color: var(--positive); background: var(--positive-soft); }
.alert.danger { border-color: #f0bbb7; color: var(--critical); background: var(--critical-soft); }
.alert.warning { border-color: #f1d29a; color: var(--caution); background: var(--caution-soft); }
.alert a { color: inherit; font-weight: 700; }
.alert ul { margin: 6px 0 0; padding-left: 20px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 22px; }
.form-field { min-width: 0; display: grid; gap: 7px; }
.form-field.full { grid-column: 1 / -1; }
label { color: #3b4b60; font-size: .8rem; font-weight: 680; }
input, textarea, select { width: 100%; min-height: 40px; border: 1px solid var(--border-strong); border-radius: 9px; padding: 9px 11px; color: var(--text-strong); background: #fff; transition: border-color .14s ease, box-shadow .14s ease; }
input:hover, textarea:hover, select:hover { border-color: #aebdcd; }
input:focus, textarea:focus, select:focus { border-color: var(--focus); outline: none; box-shadow: 0 0 0 3px rgba(75, 155, 234, .16); }
textarea { min-height: 112px; resize: vertical; }
input[type="checkbox"] { width: 17px; min-height: 17px; accent-color: var(--primary); }
.checkbox-row { display: flex; align-items: center; gap: 9px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid #edf0f4; }
.validation-message { margin: 4px 0 0; color: var(--critical); font-size: .78rem; }
.empty { padding: 38px 20px; color: var(--text-muted); text-align: center; }
.actions { display: flex; flex-wrap: wrap; gap: 7px; }
.two-column { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
.section-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.section-header h2 { margin: 0; }
.section-link { color: var(--primary); font-size: .82rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.section-link:hover { text-decoration: underline; }
.code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .8rem; word-break: break-word; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }

/* Schalter (Aktiv/Pausiert, Abgelaufene zeigen) */
.switch { position: relative; display: inline-flex; align-items: center; gap: 9px; color: var(--text); font-size: .82rem; font-weight: 650; cursor: pointer; }
.switch input { position: absolute; width: 1px; height: 1px; min-height: 1px; opacity: 0; }
.switch-track { position: relative; width: 34px; height: 20px; flex: 0 0 34px; border-radius: 999px; background: #c5cfdb; transition: background .14s ease; }
.switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .14s ease; }
.switch input:checked + .switch-track { background: var(--positive); }
.switch input:checked + .switch-track::after { transform: translateX(14px); }
.switch input:focus-visible + .switch-track { outline: 3px solid rgba(75, 155, 234, .45); outline-offset: 2px; }
.switch input:disabled + .switch-track { opacity: .5; }

/* Chip-Familien (Abschnitt 7.2): Statuschip, Fristchip, Tag, dazu "Neu" */
.status-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; max-width: 100%; padding: 3px 9px; border-radius: 999px; color: var(--neutral); background: var(--neutral-soft); font-size: .72rem; line-height: 1.2; }
.status-chip strong { font-weight: 760; white-space: nowrap; }
.status-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: currentColor; }
.status-detail { min-width: 0; overflow: hidden; opacity: .9; text-overflow: ellipsis; white-space: nowrap; }
.status-detail::before { content: "· "; }
.status-chip.positive { color: var(--positive); background: var(--positive-soft); }
.status-chip.caution { color: var(--caution); background: var(--caution-soft); }
.status-chip.critical { color: var(--critical); background: var(--critical-soft); }
.status-chip.neutral { color: var(--neutral); background: var(--neutral-soft); }

.deadline-chip { display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 3px 9px; border: 1px solid var(--border); border-radius: 999px; color: var(--neutral); background: #fff; font-size: .72rem; white-space: nowrap; }
.deadline-chip svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; }
.deadline-chip strong { font-weight: 740; }
.deadline-chip-sep { opacity: .6; }
.deadline-chip.critical { border-color: #f0c2bc; color: var(--critical); background: var(--critical-soft); }
.deadline-chip.soon { border-color: #efd6a6; color: var(--caution); background: var(--caution-soft); }
.deadline-chip.comfortable { color: var(--positive); }
.deadline-chip.expired { color: var(--neutral); background: var(--neutral-soft); text-decoration: line-through; }

.insight-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.tag { display: inline-flex; align-items: center; min-height: 22px; padding: 2px 8px; border: 1px solid #e1e7ee; border-radius: 6px; color: #4f5f74; background: #fafbfd; font-size: .7rem; font-weight: 650; text-decoration: none; }
.tag.topic { border-color: #cfe2f6; color: var(--primary); background: #f2f8ff; }
a.tag.topic:hover { border-color: var(--primary); }
.new-pill { display: inline-flex; align-items: center; min-height: 22px; padding: 3px 8px; border-radius: 999px; color: #fff; background: var(--positive); font-size: .64rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }

/* Reiter als Links (ViewTabs) */
.view-tabs { display: flex; gap: 4px; margin: 0 0 10px; border-bottom: 1px solid var(--border); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.view-tab { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px 10px; color: var(--text-muted); font-size: .86rem; font-weight: 680; text-decoration: none; white-space: nowrap; }
.view-tab:hover { color: var(--text-strong); }
.view-tab.active { color: var(--primary); }
.view-tab.active::after { content: ""; position: absolute; inset: auto 8px 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--primary); }
.view-count { min-width: 22px; padding: 1px 7px; border-radius: 999px; color: var(--neutral); background: var(--neutral-soft); font-size: .7rem; font-weight: 760; text-align: center; }
.view-tab.active .view-count { color: #fff; background: var(--primary); }

/* Filterleiste (FilterBar, ActiveFilterChips) */
.filter-bar { margin-bottom: 8px; }
.filter-bar-toggle { display: none; }
.filter-bar-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.filter-bar-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; }
.filter-field { min-width: 150px; display: grid; gap: 4px; }
.filter-field label { color: var(--text-muted); font-size: .7rem; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.filter-field select { min-height: 36px; padding: 6px 30px 6px 10px; font-size: .84rem; }
.filter-bar-trailing { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.filter-more { position: relative; align-self: flex-end; }
.filter-more summary { min-height: 36px; display: inline-flex; align-items: center; padding: 6px 12px; border: 1px solid var(--border-strong); border-radius: 9px; color: var(--text); background: #fff; font-size: .84rem; font-weight: 680; list-style: none; cursor: pointer; }
.filter-more summary::-webkit-details-marker { display: none; }
.filter-more summary::after { content: "▾"; margin-left: 6px; color: var(--text-muted); }
.filter-more[open] summary::after { content: "▴"; }
.filter-more-panel { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; width: min(92vw, 340px); display: grid; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: 0 14px 34px rgba(15, 36, 62, .14); }
.filter-more-panel .filter-field { min-width: 0; }
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; font-size: .78rem; }
.active-filters-label { color: var(--text-muted); font-weight: 680; }
.active-filter { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 2px 9px; border: 1px solid #cfe2f6; border-radius: 999px; color: var(--primary); background: var(--primary-soft); font-size: .76rem; font-weight: 680; cursor: pointer; }
.active-filter:hover { border-color: var(--primary); }

/* Listenkarte (TenderListItem) */
.tender-list { display: grid; gap: 8px; }
.tender-item { display: flex; gap: 16px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: 0 1px 2px rgba(15, 36, 62, .035); transition: border-color .14s ease, opacity .2s ease, transform .2s ease; }
.tender-item:hover { border-color: #c7d3e0; }
.tender-item:focus-visible { outline: 3px solid rgba(75, 155, 234, .45); outline-offset: 2px; }
.tender-item.leaving { opacity: 0; transform: translateX(24px); }
.tender-item-main { min-width: 0; flex: 1 1 auto; display: grid; gap: 3px; align-content: start; }
.tender-item-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 2px; }
.tender-item-title { display: -webkit-box; margin: 0; overflow: hidden; font-size: 1rem; font-weight: 650; letter-spacing: -.01em; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.tender-item-title a { color: var(--text-strong); text-decoration: none; }
.tender-item-title a:hover { color: var(--primary); text-decoration: underline; }
.tender-item .official-title { margin: 0; }
.tender-item-meta { display: flex; flex-wrap: wrap; gap: 0 6px; margin: 0; color: var(--text-muted); font-size: .8rem; }
.meta-sep { color: #a3afbd; }
.tender-item-text { margin: 2px 0 0; color: #3c4c61; font-size: .86rem; line-height: 1.5; }
.tender-item-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; }
.tender-item-footer:has(.tender-item-signals:empty):not(:has(.tender-item-links)) { display: none; }
.tender-item-signals { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; color: var(--text-muted); font-size: .78rem; }
.tender-item-links { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-left: auto; }
.tender-item-more { display: grid; gap: 10px; margin-top: 8px; padding-top: 10px; border-top: 1px solid #edf1f5; font-size: .84rem; }
.tender-item-more p { margin: 0; }
.tender-item-aside { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 8px; }
.tender-item.compact { padding: 10px 14px; gap: 12px; }
.tender-item.compact .tender-item-title { font-size: .92rem; -webkit-line-clamp: 1; line-clamp: 1; }
.signal { display: inline-flex; align-items: center; gap: 4px; font-weight: 650; }
.signal.hurdle { color: var(--critical); }
.signal.question { color: var(--primary); }
.deadline-block { display: grid; justify-items: end; gap: 2px; min-width: 104px; text-align: right; }
.deadline-block span { color: var(--text-muted); font-size: .68rem; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.deadline-block strong { color: var(--text-strong); font-size: .86rem; }
.deadline-block small { font-size: .76rem; font-weight: 700; }
.deadline-block.critical small { color: var(--critical); }
.deadline-block.soon small { color: var(--caution); }
.deadline-block.comfortable small { color: var(--positive); }
.deadline-block.expired small, .deadline-block.no-deadline small { color: var(--neutral); }
.details-link { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; color: var(--primary); font-size: .78rem; font-weight: 760; text-decoration: none; }
.details-link:hover { text-decoration: underline; }
.list-loading { display: grid; gap: 8px; }
.list-loading span { height: 132px; border: 1px solid var(--border); border-radius: 12px; background: linear-gradient(90deg, #f5f8fb 0%, #fff 50%, #f5f8fb 100%); background-size: 200% 100%; animation: shimmer 1.2s ease-in-out infinite; }

@keyframes shimmer { to { background-position: -200% 0; } }
.load-more { display: flex; justify-content: center; margin-top: 14px; }

/* Menü "⋯" */
.overflow-menu { position: relative; }
.overflow-menu .icon-button svg { fill: currentColor; stroke: none; }
.overflow-menu .icon-button:hover { color: var(--text-strong); }
.overflow-menu-panel { position: absolute; z-index: 30; top: calc(100% + 4px); right: 0; min-width: 190px; display: grid; padding: 6px; border: 1px solid var(--border); border-radius: 10px; background: #fff; box-shadow: 0 14px 34px rgba(15, 36, 62, .16); }
.overflow-menu-panel button, .overflow-menu-panel a { padding: 8px 10px; border: 0; border-radius: 7px; color: var(--text); background: transparent; font-size: .84rem; font-weight: 620; text-align: left; text-decoration: none; cursor: pointer; }
.overflow-menu-panel button:hover, .overflow-menu-panel a:hover { background: var(--surface-subtle); }
.overflow-menu-panel button.danger { color: var(--critical); }
.overflow-menu-panel button.danger:hover { background: var(--critical-soft); }

/* Leerer Zustand (EmptyState) */
.empty-state { display: flex; align-items: flex-start; gap: 14px; padding: 22px; border: 1px dashed var(--border-strong); border-radius: 12px; background: #fff; }
.empty-state.compact { padding: 14px 16px; }
.empty-state-icon { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 10px; color: var(--primary); background: var(--primary-soft); font-size: 1.05rem; font-weight: 800; }
.empty-state-copy { display: grid; gap: 4px; }
.empty-state-copy strong { color: var(--text-strong); }
.empty-state-copy p { margin: 0; color: var(--text-muted); font-size: .88rem; }
.empty-state-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }

/* Meldungen (ToastHost) */
.toast-region { position: fixed; z-index: 400; right: 0; bottom: 18px; left: 0; display: flex; justify-content: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 14px; max-width: min(92vw, 560px); padding: 11px 12px 11px 16px; border-radius: 10px; color: #fff; background: #1d2b3e; box-shadow: 0 14px 36px rgba(7, 17, 31, .28); font-size: .88rem; pointer-events: auto; }
.toast.error { background: var(--critical); }
.toast-action { padding: 4px 8px; border: 0; border-radius: 6px; color: #9fd0ff; background: transparent; font-weight: 800; cursor: pointer; }
.toast-action:hover { background: rgba(255, 255, 255, .1); }
.toast-close { width: 28px; height: 28px; border: 0; border-radius: 6px; color: #c5d2e3; background: transparent; font-size: 1.1rem; cursor: pointer; }

/* Bestätigung (ConfirmDialog) */
.dialog-backdrop { position: fixed; inset: 0; z-index: 350; background: rgba(7, 17, 31, .45); }
.confirm-dialog { position: fixed; z-index: 360; top: 50%; left: 50%; width: min(92vw, 440px); margin: 0; padding: 22px; border: 0; border-radius: 14px; color: var(--text); background: #fff; box-shadow: 0 24px 60px rgba(7, 17, 31, .3); transform: translate(-50%, -50%); }
.confirm-dialog h2 { margin-bottom: 8px; }
.confirm-dialog p { margin: 0 0 18px; color: var(--text-muted); font-size: .9rem; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }

/* Chip-Eingabe und Begriffsgruppen (ChipInput, TermGroupEditor) */
.chip-input { min-height: 42px; padding: 4px 6px; border: 1px solid var(--border-strong); border-radius: 9px; background: #fff; }
.chip-input:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(75, 155, 234, .16); }
.chip-input.invalid { border-color: var(--critical); }
.chip-list { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin: 0; padding: 0; list-style: none; }
.chip { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; min-height: 28px; padding: 2px 2px 2px 10px; border: 1px solid #cfe2f6; border-radius: 7px; color: #18467a; background: var(--primary-soft); font-size: .82rem; font-weight: 620; }
.chip > span { overflow-wrap: anywhere; }
.chip-remove { width: 24px; height: 24px; display: grid; place-items: center; border: 0; border-radius: 5px; color: #4d6b8f; background: transparent; font-size: .95rem; cursor: pointer; }
.chip-remove:hover { color: var(--critical); background: #fff; }
.chip-entry { flex: 1 1 140px; min-width: 120px; }
.chip-entry input { min-height: 30px; padding: 4px 6px; border: 0; box-shadow: none; }
.chip-entry input:focus { box-shadow: none; }
.term-groups { display: grid; gap: 8px; }
.term-groups-lead { margin: 0; color: var(--text-muted); font-size: .82rem; }
.term-group { display: flex; align-items: flex-start; gap: 6px; }
.term-group > :first-child { flex: 1 1 auto; min-width: 0; }
.term-group-and { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.term-group-and::before, .term-group-and::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--border); }
.term-group-add { justify-self: start; }

/* Verwaltung: Unternavigation (AdminNav) */
.admin-nav { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0 0 18px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.admin-nav-group { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.admin-nav-title { margin-right: 4px; color: var(--text-muted); font-size: .66rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.admin-nav-links { display: flex; flex-wrap: wrap; gap: 2px; }
.admin-nav-links a { padding: 5px 9px; border-radius: 7px; color: var(--text); font-size: .82rem; font-weight: 650; text-decoration: none; }
.admin-nav-links a:hover { background: var(--surface-subtle); }
.admin-nav-links a.active { color: var(--primary); background: var(--primary-soft); }

/* KI-Inhalte: Steckbrief, Passung, Tiefenanalyse */
.official-title { margin: 2px 0 6px; color: var(--text-muted); font-size: .76rem; line-height: 1.4; }
.insight-summary { margin: 4px 0 10px; color: var(--text); font-size: .86rem; line-height: 1.55; }
.insight-lead { margin: 0 0 12px; color: var(--text-strong); font-size: .95rem; line-height: 1.6; }
.insight-pending { margin: 0; color: var(--text-muted); font-size: .78rem; font-style: italic; }
.ai-note { margin: 8px 0; color: var(--text-muted); font-size: .76rem; }
.ai-note pre { white-space: pre-wrap; font: inherit; }
.change-note { margin: 0 0 12px; padding: 9px 12px; border-radius: 9px; color: var(--caution); background: var(--caution-soft); font-size: .86rem; }
.change-hint { margin: 0; color: var(--caution); font-size: .8rem; }
.rationale { margin: 4px 0; padding: 9px 12px; border-radius: 9px; color: #173a52; background: #eef6fb; font-size: .86rem; line-height: 1.5; }
.rationale.fits { color: #134b33; background: #edf8f2; }
.rationale.check { color: #5e3b07; background: #fff7e8; }
.rationale.nofit { color: #6a2620; background: #fcf1f0; }
.signal-list { display: grid; gap: 4px; margin: 6px 0 0; padding: 0; list-style: none; font-size: .82rem; }
.signal-list li { position: relative; padding-left: 20px; line-height: 1.45; }
.signal-list li::before { position: absolute; left: 0; top: 0; width: 15px; text-align: center; font-weight: 800; }
.signal-list.hurdles li { color: #8f2c25; }
.signal-list.hurdles li::before { content: "!"; }
.signal-list.questions li { color: #3f5168; }
.signal-list.questions li::before { content: "?"; color: var(--primary); }
.signal-list.checks li::before { content: "✓"; color: var(--positive); }
.signal-title { color: var(--text-muted); font-size: .68rem; font-weight: 780; letter-spacing: .05em; text-transform: uppercase; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--border-strong); border-top-color: var(--primary); border-radius: 50%; animation: kraken-spin .9s linear infinite; }
@keyframes kraken-spin { to { transform: rotate(360deg); } }
.dossier { margin-top: 10px; font-size: .9rem; line-height: 1.6; }
.dossier h3 { margin: 18px 0 6px; font-size: 1rem; }
.dossier p { margin: 4px 0; }
.dossier .dossier-bullet { position: relative; padding-left: 16px; }
.dossier .dossier-bullet::before { content: "•"; position: absolute; left: 2px; color: var(--text-muted); }
.dossier sup a, .question sup a { color: var(--primary); font-size: .7rem; text-decoration: none; }
.footnotes { margin-top: 12px; font-size: .8rem; }
.footnotes ol { padding-left: 22px; }
.footnotes li { margin: 6px 0; }
.question { margin: 10px 0; padding: 10px 12px; border-left: 3px solid var(--border-strong); background: var(--surface-subtle); font-size: .88rem; }
.question p { margin: 4px 0; }
.question-form { display: flex; gap: 8px; margin-top: 10px; }
.question-form input { flex: 1; }
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.topic-tile { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 11px; color: var(--text-strong); background: #fff; text-decoration: none; font-size: .86rem; }
.topic-tile span { color: var(--text-muted); font-size: .76rem; }
.topic-tile:hover { border-color: var(--primary); }
.list-section { margin: 0 0 24px; }
.list-section > .section-header { margin-bottom: 10px; }

/* Einfache Einzelseiten außerhalb der App (Zugriff verweigert, Rückmeldung aus der E-Mail) */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 0, #dceeff, transparent 34%), linear-gradient(150deg, #f7f9fc, #edf3f9); }
.login-card { width: min(100%, 420px); padding: 36px; border: 1px solid var(--border); border-radius: 18px; background: #fff; box-shadow: 0 24px 65px rgba(16, 39, 69, .13); }
.login-card h1 { margin-bottom: 8px; }
.login-card form { display: grid; gap: 9px; margin-top: 25px; }

@media (max-width: 800px) {
    .form-grid,
    .two-column { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; gap: 15px; }
    .table-wrap table { min-width: 640px; }
}

@media (max-width: 767px) {
    .page-head-row { flex-direction: column; gap: 10px; }
    .filter-bar-toggle { display: inline-flex; }
    .filter-bar-body { display: none; margin-top: 10px; }
    .filter-bar.mobile-open .filter-bar-body { display: block; }
    .filter-bar-row { flex-direction: column; align-items: stretch; }
    .filter-field { min-width: 0; }
    .filter-bar-trailing { margin-left: 0; }
    .filter-more-panel { position: static; width: auto; margin-top: 8px; box-shadow: none; }
    .admin-nav { flex-wrap: nowrap; gap: 14px; padding: 6px 10px; overflow-x: auto; scrollbar-width: none; }
    .admin-nav-group, .admin-nav-links { flex-wrap: nowrap; white-space: nowrap; }
    .tender-item { flex-direction: column; gap: 10px; padding: 12px 13px; }
    .tender-item-aside { flex-direction: row; align-items: center; justify-content: flex-start; }
    .deadline-block { justify-items: start; text-align: left; }
    .empty-state { flex-direction: column; }
    .question-form { flex-direction: column; }
}

@media (max-width: 520px) {
    .card { padding: 16px; border-radius: 11px; }
    th, td { padding: 10px 11px; }
    .login-card { padding: 27px 23px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
    .tender-item.leaving { transform: none; }
}
