/* ============================================================
   Karl-Rat – eigene Oberfläche (auf dem Verbund-Framework main.css) + Bürgerinfo-Portal.
   Barrierearm (BITV 2.0 / WCAG 2.1 AA – Grundlagen):
   • Text-Kontrast ≥ 4,5:1 (Gedämpft #4b5866 auf Weiß ≈ 7:1, Primär #0b4f9c ≈ 8:1)
   • sichtbarer Tastaturfokus, Sprunglink, Statusfarben nie allein bedeutungstragend
   • relative Schriftgrößen im Portal, Zoom bis 200 % ohne Verlust
   ============================================================ */
:root {
  --primary: #0b4f9c; --primary-2: #083d79; --accent: #0b4f9c;
  --muted: #4b5866; --text: #15202b; --border: #c9d3de;
  --km-ok: #146c3c; --km-warn: #7a5200; --km-crit: #b42318;
  --km-ok-bg: #e3f4ea; --km-warn-bg: #fbf1da; --km-crit-bg: #fbe6e6;
  --np: #6b2d8f; --np-bg: #f3e8fa;
  --focus: #ffbf47;
}
/* ---------- Grundlagen Barrierearmut ---------- */
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 1000; background: #000; color: #fff; padding: 10px 16px; font-weight: 700; }
.skip-link:focus { left: 8px; top: 8px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 5px #000;
}
main:focus { outline: none; }
.km [hidden] { display: none !important; }

/* ---------- Komponenten intern ---------- */
.km .page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin: 0 0 14px; }
.km .page-head .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.km h2 { font-size: 18px; margin: 0 0 10px; }
.km h3 { font-size: 16px; margin: 12px 0 6px; }
.km .badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12.5px; font-weight: 700; background: #e8edf3; color: #2b3846; border: 1px solid transparent; vertical-align: 1px; }
.km .b-ok { background: var(--km-ok-bg); color: var(--km-ok); border-color: #a9d8bd; }
.km .b-warn { background: var(--km-warn-bg); color: var(--km-warn); border-color: #e5c97e; }
.km .b-crit { background: var(--km-crit-bg); color: var(--km-crit); border-color: #efb4ae; }
.km .b-info { background: #e2ecf8; color: #0b4f9c; border-color: #b2c9e6; }
.km .b-np { background: var(--np-bg); color: var(--np); border-color: #d7b8ea; }
.km .tbl th { color: #2b3846; }
.km .tbl tr.dim td { color: var(--muted); }
.km .filter { max-width: 300px; margin: 0 0 8px; }
.km .tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin: 0 0 14px; }
.km .tabs a { padding: 8px 13px; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; font-weight: 600; font-size: 14px; }
.km .tabs a.on, .km .tabs a[aria-current] { color: var(--primary); border-color: var(--primary); }
.km .dl { display: grid; grid-template-columns: 200px 1fr; gap: 6px 14px; font-size: 14px; margin: 0; } .km .dl dt { color: var(--muted); font-weight: 600; } .km .dl dd { margin: 0; }
@media (max-width: 640px) { .km .dl { grid-template-columns: 1fr; } }
.km .grid2 { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; } @media (max-width: 900px) { .km .grid2 { grid-template-columns: 1fr; } }
.km textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); color: var(--text); font: inherit; min-height: 80px; }
.km .chk { display: flex; gap: 7px; align-items: center; color: var(--text); font-size: 14px; margin: 6px 0; }
.km .chk input { width: auto; }
.km .formrow { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; } .km .formrow > div { flex: 1 1 170px; }
.km .tbl-wrap { overflow-x: auto; }
.km .top { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin: 0 0 10px; background: var(--surface); }
.km .top.np { border-left: 5px solid var(--np); }
.km .top .top-h { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.km .top .top-h h3 { margin: 0; }
.km .res { border-left: 4px solid var(--primary); background: var(--surface-2); padding: 8px 12px; margin: 8px 0; border-radius: 0 8px 8px 0; }
.km .part-h { margin: 18px 0 8px; padding: 6px 10px; border-radius: 8px; background: #e2ecf8; color: #0b3a73; font-size: 15px; }
.km .part-h.np { background: var(--np-bg); color: var(--np); }
.km .frist-ok { color: var(--km-ok); font-weight: 700; } .km .frist-bad { color: var(--km-crit); font-weight: 700; }
.km details > summary { cursor: pointer; }
.km .btn-danger { background: #fff; color: var(--km-crit); border: 1px solid #efb4ae; }
.km .btn-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.km .small { font-size: 13px; } .km .wrap { word-break: break-word; }
.km .pager { display: flex; gap: 4px; flex-wrap: wrap; margin: 10px 0 0; }
.km .pager a, .km .pager span { padding: 4px 10px; border: 1px solid var(--border); border-radius: 7px; text-decoration: none; color: inherit; }
.km .pager .on { background: var(--primary); color: #fff; border-color: var(--primary); }
.km .cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.km .cal .cd { min-height: 70px; border: 1px solid var(--border); border-radius: 8px; padding: 4px 6px; font-size: 12.5px; background: var(--surface); }
.km .cal .cd.out { background: transparent; border-style: dashed; }
.km .cal .cd .dn { font-weight: 700; color: var(--muted); }
.km .cal .cd a { display: block; margin-top: 2px; text-decoration: none; color: var(--primary); font-weight: 600; }
.km .cal .wd { font-weight: 700; text-align: center; color: var(--muted); font-size: 12.5px; }
@media (max-width: 700px) { .km .cal { display: none; } }

/* ---------- Druck (Einladung, Niederschrift) ---------- */
.doc { max-width: 820px; margin: 24px auto; background: #fff; color: #111; border: 1px solid #c9d3de; border-radius: 10px; padding: 30px 38px; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.doc h1 { font-size: 22px; margin: 0 0 4px; } .doc h2 { font-size: 17px; border-bottom: 1px solid #c9d3de; padding-bottom: 4px; margin: 22px 0 8px; } .doc h3 { font-size: 15px; margin: 14px 0 4px; }
.doc .meta { color: #3d4a58; } .doc table { border-collapse: collapse; width: 100%; } .doc th, .doc td { text-align: left; padding: 4px 6px; border-bottom: 1px solid #dde3ec; vertical-align: top; }
.doc .res { border-left: 3px solid #0b4f9c; padding: 6px 10px; margin: 6px 0; background: #f4f7fb; }
.doc .sig { margin-top: 48px; display: flex; gap: 30px; } .doc .sig div { flex: 1; border-top: 1px solid #111; padding-top: 6px; text-align: center; font-size: 13px; color: #3d4a58; }
.doc-bar { max-width: 820px; margin: 14px auto 0; display: flex; gap: 8px; flex-wrap: wrap; }
.doc-bar a, .doc-bar button { padding: 7px 12px; border-radius: 8px; border: 1px solid #c9d3de; background: #fff; color: #0b4f9c; font-weight: 600; cursor: pointer; text-decoration: none; font-size: 14px; }
.doc .np-mark { color: #6b2d8f; font-weight: 700; }
@media print {
  .sidebar, .topbar, .app-footer, .noprint, .doc-bar { display: none !important; }
  .content { margin: 0 !important; padding: 0 !important; } body { background: #fff !important; }
  .doc { border: 0; margin: 0; padding: 0; max-width: none; }
  .km .panel { box-shadow: none; break-inside: avoid; }
}

/* ---------- Anmeldung ---------- */
.login-body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: #eef2f6; color: #15202b; display: flex; min-height: 100vh; align-items: center; justify-content: center; }
.login-box { background: #fff; border: 1px solid #c9d3de; border-radius: 16px; padding: 26px 28px; width: 360px; max-width: calc(100% - 32px); }
.login-box h1 { margin: 0; font-size: 22px; } .login-box .sub { color: #4b5866; margin: 2px 0 18px; }
.login-box label { display: block; font-size: 14px; color: #3d4a58; margin: 10px 0 4px; }
.login-box input { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #8a97a6; border-radius: 9px; font-size: 15px; }
.login-box .btn { display: inline-block; padding: 11px 14px; border-radius: 10px; font-weight: 700; text-decoration: none; text-align: center; border: 1px solid #0b4f9c; background: #fff; color: #0b4f9c; cursor: pointer; margin-top: 12px; }
.login-box .btn-primary { background: #0b4f9c; color: #fff; } .login-box .block { display: block; width: 100%; box-sizing: border-box; }
.login-box details { margin-top: 18px; color: #4b5866; } .login-box .flash.err { background: #fbe6e6; color: #b42318; padding: 9px 12px; border-radius: 9px; }

/* ============================================================
   Bürgerinfo-Portal (öffentlich) – eigenständig, ohne main.css
   ============================================================ */
.portal { margin: 0; background: #f4f6f9; color: #15202b; font: 100%/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
.portal a { color: #0b4f9c; text-underline-offset: 2px; } .portal a:hover { color: #083d79; }
.portal .p-head { background: #0b3a73; color: #fff; }
.portal .p-head .in { max-width: 1080px; margin: 0 auto; padding: 14px 16px; display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.portal .p-head .org { font-size: 1.25rem; font-weight: 800; color: #fff; text-decoration: none; }
.portal .p-head .org small { display: block; font-size: .85rem; font-weight: 500; color: #d6e2f2; }
.portal .p-nav { background: #fff; border-bottom: 1px solid #c9d3de; }
.portal .p-nav ul { max-width: 1080px; margin: 0 auto; padding: 0 16px; list-style: none; display: flex; flex-wrap: wrap; gap: 2px; }
.portal .p-nav a { display: block; padding: 12px 14px; text-decoration: none; font-weight: 600; color: #15202b; border-bottom: 3px solid transparent; }
.portal .p-nav a[aria-current] { border-color: #0b4f9c; color: #0b4f9c; }
.portal .p-search { display: flex; gap: 6px; }
.portal .p-search input { padding: 8px 10px; border: 1px solid #8a97a6; border-radius: 8px; font-size: 1rem; min-width: 200px; }
.portal .p-search button, .portal .pbtn { padding: 8px 14px; border: 2px solid #fff; background: transparent; color: #fff; border-radius: 8px; font-weight: 700; cursor: pointer; font-size: 1rem; }
.portal main { max-width: 1080px; margin: 0 auto; padding: 18px 16px 40px; }
.portal h1 { font-size: 1.65rem; margin: .3em 0 .4em; } .portal h2 { font-size: 1.3rem; margin: 1.4em 0 .5em; } .portal h3 { font-size: 1.1rem; margin: 1em 0 .3em; }
.portal .card { background: #fff; border: 1px solid #c9d3de; border-radius: 12px; padding: 16px 18px; margin: 0 0 14px; }
.portal .muted { color: #4b5866; }
.portal table { width: 100%; border-collapse: collapse; background: #fff; }
.portal th, .portal td { text-align: left; padding: 9px 10px; border-bottom: 1px solid #dde3ec; vertical-align: top; }
.portal th { background: #eef2f6; }
.portal caption { text-align: left; font-weight: 700; padding: 6px 0; }
.portal .tag { display: inline-block; padding: 1px 8px; border-radius: 12px; font-size: .85rem; font-weight: 700; border: 1px solid #b2c9e6; background: #e2ecf8; color: #0b3a73; }
.portal .tag.ok { background: #e3f4ea; color: #146c3c; border-color: #a9d8bd; } .portal .tag.bad { background: #fbe6e6; color: #b42318; border-color: #efb4ae; }
.portal .tag.cancel { background: #fbf1da; color: #7a5200; border-color: #e5c97e; }
.portal .top { border-top: 1px solid #dde3ec; padding: 12px 0; } .portal .top:first-child { border-top: 0; }
.portal .res { border-left: 4px solid #0b4f9c; background: #f4f7fb; padding: 8px 12px; margin: 8px 0; }
.portal .np-note { background: #f3e8fa; border: 1px solid #d7b8ea; color: #4a1f63; padding: 10px 14px; border-radius: 10px; }
.portal .files { list-style: none; padding: 0; margin: .4em 0; } .portal .files li { margin: .3em 0; }
.portal .feeds { display: flex; gap: 10px; flex-wrap: wrap; }
.portal .feeds a { padding: 6px 12px; border: 1px solid #0b4f9c; border-radius: 8px; text-decoration: none; font-weight: 600; background: #fff; }
.portal .p-foot { border-top: 1px solid #c9d3de; background: #fff; }
.portal .p-foot .in { max-width: 1080px; margin: 0 auto; padding: 14px 16px; font-size: .92rem; color: #4b5866; display: flex; gap: 14px; flex-wrap: wrap; }
.portal .pager { display: flex; gap: 4px; flex-wrap: wrap; margin: 12px 0; }
.portal .pager a, .portal .pager span { padding: 4px 10px; border: 1px solid #c9d3de; border-radius: 7px; text-decoration: none; background: #fff; }
.portal .pager .on { background: #0b4f9c; color: #fff; border-color: #0b4f9c; }
.portal form.filter { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; margin: 0 0 12px; }
.portal form.filter label { display: block; font-weight: 600; font-size: .95rem; }
.portal form.filter select, .portal form.filter input { padding: 7px 9px; border: 1px solid #8a97a6; border-radius: 8px; font-size: 1rem; }
.portal form.filter button { padding: 8px 14px; border: 0; background: #0b4f9c; color: #fff; border-radius: 8px; font-weight: 700; cursor: pointer; font-size: 1rem; }
@media (max-width: 640px) { .portal .p-search input { min-width: 0; flex: 1; } .portal table.resp thead { display: none; } .portal table.resp td { display: block; border: 0; padding: 3px 10px; } .portal table.resp tr { display: block; border-bottom: 1px solid #dde3ec; padding: 6px 0; } }
@media print { .portal .p-nav, .portal .p-search, .portal .feeds { display: none; } }
