/* Postfach-Atlas – Oberfläche im Data-at-Work-Look */

@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-style: normal; font-display: swap; src: url('fonts/ibm-plex-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 500; font-style: normal; font-display: swap; src: url('fonts/ibm-plex-sans-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 600; font-style: normal; font-display: swap; src: url('fonts/ibm-plex-sans-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 700; font-style: normal; font-display: swap; src: url('fonts/ibm-plex-sans-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 400; font-style: normal; font-display: swap; src: url('fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 500; font-style: normal; font-display: swap; src: url('fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2'); }

:root {
  --ink: #031E2F;
  --ink-2: #0E2A3D;
  --accent: #C0D904;
  --ground: #F3F4F1;
  --surface: #FFFFFF;
  --line: #E1E4DE;
  --line-soft: #EEF0EA;
  --line-strong: #C9CFC2;
  --text: #13202E;
  --text-2: #3A4654;
  --muted: #5B6675;
  --faint: #8A949F;
  --fa-bg: #DCEBFA; --fa-fg: #12457A; --fa-glow: #4FA3F7;
  --sa-bg: #FDE8D7; --sa-fg: #8A3B0B; --sa-glow: #FF9447;
  --sob-bg: #ECE7F7; --sob-fg: #4B3A86; --sob-glow: #B395FF;
  --ok-bg: #E3F4EE; --ok-fg: #0D5A43;
  --warn-bg: #FFF4D6; --warn-fg: #7A4B00; --warn-line: #F0D58C;
  --risk-bg: #FBE4E4; --risk-fg: #8E1F1F; --risk-line: #EDBDB4;
  --info-bg: #E6EEF6; --info-fg: #1F3A5F;
  --radius: 12px;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--text); font: 15px/1.5 'IBM Plex Sans', system-ui, sans-serif; }
a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:not([class]):hover { color: #000; }
h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
h2 { margin: 0; font-size: 17px; font-weight: 700; }
h3 { margin: 0; font-size: 15px; font-weight: 700; }
p { margin: 0; }
.mono { font-family: var(--mono); font-size: 13px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Kopfzeile ---------- */
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; padding: 12px 24px; background: var(--ink); color: #fff; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand:hover, .brand:focus-visible { color: #fff; }
.brand:hover .brand-mark { box-shadow: 0 0 0 4px rgba(192,217,4,.22); }
.brand-mark { transition: box-shadow .15s ease; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; background: var(--accent); }
.brand-mark svg { stroke: var(--ink); }
.brand-name { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name b { font-size: 18px; letter-spacing: -0.01em; }
.brand-name span { font-size: 12px; color: #A9B6C4; }
.tenant-pick { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #A9B6C4; }
.select-wrap { position: relative; display: inline-flex; align-items: center; }
.select-wrap select { appearance: none; -webkit-appearance: none; min-width: 230px; min-height: 40px; padding: 0 40px 0 14px; border-radius: 8px; border: 1px solid #33465A; background: #1A2B3D; color: #fff; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; color-scheme: dark; }
.select-wrap select option { background: #1A2B3D; color: #fff; }
.select-wrap svg { position: absolute; right: 14px; pointer-events: none; }
.topbar .spacer { flex: 1 1 auto; }
.sync-info { font-size: 13px; color: #C9D2DC; }
.sync-info .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--accent); }
.sync-info .dot.bad { background: #FF8A7A; }
.btn-top { min-height: 40px; padding: 0 14px; border-radius: 8px; border: 1px solid rgba(255,255,255,.22); background: transparent; color: #fff; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn-top:hover { background: rgba(255,255,255,.08); }
.me { position: relative; }
.me > button { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: var(--ink); font: inherit; font-size: 13px; font-weight: 700; border: 0; cursor: pointer; }
.me-menu { position: absolute; right: 0; top: 46px; z-index: 50; min-width: 220px; padding: 8px; background: #fff; color: var(--text); border-radius: 10px; box-shadow: 0 10px 30px rgba(3,30,47,.18); border: 1px solid var(--line); }
.me-menu .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line-soft); margin-bottom: 6px; font-size: 13px; }
.me-menu a, .me-menu button { display: block; width: 100%; padding: 9px 10px; border-radius: 6px; border: 0; background: none; text-align: left; font: inherit; font-size: 14px; color: var(--text); text-decoration: none; cursor: pointer; }
.me-menu a:hover, .me-menu button:hover { background: var(--ground); }

/* ---------- Grundlayout ---------- */
.shell { display: flex; flex-wrap: wrap; gap: 24px; padding: 24px; width: 100%; max-width: 1500px; margin: 0 auto; }
/* Seitenmenü: abgesetzte Karte, Icons, Lemon-Akzent für den aktiven Bereich */
.sidenav {
  flex: 0 0 256px; max-width: 100%; align-self: flex-start;
  position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow-y: auto; scrollbar-width: thin;
  display: flex; flex-direction: column; gap: 2px; padding: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 1px 2px rgba(3,30,47,.04), 0 8px 24px -12px rgba(3,30,47,.14);
}
.sidenav .sec { display: flex; align-items: center; gap: 10px; margin: 16px 8px 6px; font-size: 11px; font-weight: 700; letter-spacing: .09em; color: var(--faint); text-transform: uppercase; }
.sidenav .sec::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }
.sidenav .nav-item {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 10px 6px 8px;
  border-radius: 10px; color: var(--text-2); font-weight: 500; text-decoration: none;
  transition: background-color .15s ease, color .15s ease, transform .15s ease;
}
.sidenav .nav-item .ni {
  flex: 0 0 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px; background: #F1F3EE; color: #4A5868; transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.sidenav .nav-item .nl { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidenav .nav-item:hover { background: #F5F7F1; color: var(--ink); transform: translateX(2px); }
.sidenav .nav-item:hover .ni { background: #E9EFD2; color: var(--ink); }
.sidenav .nav-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sidenav .nav-item.on {
  background: linear-gradient(135deg, #031E2F 0%, #0B3049 100%); color: #fff; font-weight: 700;
  box-shadow: 0 6px 16px -8px rgba(3,30,47,.55); transform: none;
}
.sidenav .nav-item.on::before {
  content: ""; position: absolute; left: -12px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent);
}
.sidenav .nav-item.on .ni { background: var(--accent); color: var(--ink); box-shadow: 0 0 0 3px rgba(192,217,4,.18); }
.sidenav .cnt {
  flex: 0 0 auto; min-width: 26px; padding: 2px 8px; border-radius: 999px; text-align: center;
  font-size: 12px; font-weight: 700; line-height: 1.5; background: #EEF0EA; color: var(--muted);
}
.sidenav .cnt.alert { background: var(--risk-bg); color: var(--risk-fg); }
.sidenav .cnt.warn { background: var(--warn-bg); color: var(--warn-fg); }
.sidenav .cnt.tag { background: transparent; border: 1px solid var(--line-strong); font-family: var(--mono); font-size: 11px; letter-spacing: .04em; }
.sidenav .nav-item.on .cnt { background: rgba(255,255,255,.12); color: var(--accent); border-color: transparent; }
.sidenav .nav-item.on .cnt.alert { background: #FF8A7A; color: var(--ink); }
/* Mandanten-Kopf im Menü */
.nav-tenant { display: flex; align-items: center; gap: 12px; margin: 0 0 6px; padding: 12px; border-radius: 12px; background: linear-gradient(135deg, #031E2F 0%, #10364F 100%); color: #fff; }
.nav-tenant-av { flex: 0 0 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: rgba(192,217,4,.16); color: var(--accent); font-weight: 700; font-size: 13px; border: 1px solid rgba(192,217,4,.35); }
.nav-tenant-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.nav-tenant-txt b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-tenant-txt span { font-size: 12px; color: #A9B6C4; display: inline-flex; align-items: center; gap: 6px; }
.nav-tenant .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(192,217,4,.18); }
.nav-tenant .dot.bad { background: #FF8A7A; box-shadow: 0 0 0 3px rgba(255,138,122,.2); }
/* Untermenü Gruppen */
.sidenav .sub { display: flex; flex-direction: column; gap: 1px; margin: 4px 0 8px 23px; padding-left: 14px; border-left: 2px solid #E3E8D5; }
.sidenav .sub a { min-height: 32px; padding: 5px 10px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--text-2); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.sidenav .sub a:hover { background: #F5F7F1; color: var(--ink); }
.sidenav .sub a.on { background: #EEF3DA; color: var(--ink); font-weight: 700; }
.nav-items { display: flex; flex-direction: column; gap: 2px; }
.nav-toggle { display: none; }
@media (max-width: 860px) {
  .sidenav { flex: 1 1 100%; position: static; max-height: none; }
  .nav-toggle { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #F7F8F5; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
  .nav-toggle span { flex: 1; text-align: left; }
  .nav-toggle[aria-expanded="true"] svg:last-child { transform: rotate(180deg); }
  .nav-items { display: none; margin-top: 6px; }
  .sidenav.open .nav-items { display: flex; }
}
@media (prefers-reduced-motion: reduce) {
  .sidenav .nav-item, .sidenav .nav-item .ni { transition: none; }
  .sidenav .nav-item:hover { transform: none; }
}
.main { flex: 999 1 600px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; }
.page-head p { margin-top: 4px; color: var(--muted); }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 20px; }
.stack-s { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row-between { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.cols { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.cols > * { flex: 1 1 360px; min-width: 0; }

/* ---------- Karten ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card.pad { padding: 20px 22px; }
.card.strong { border: 2px solid var(--ink); }
.card-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.card-body { padding: 18px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { display: block; padding: 16px 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); text-decoration: none; }
.kpi .l { font-size: 13px; color: var(--muted); }
.kpi .v { font-size: 28px; font-weight: 700; margin-top: 4px; line-height: 1.2; }
.kpi.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.kpi.dark .l { color: #A9B6C4; }
.kpi.dark .v { color: var(--accent); }
.kpi.warn { background: #FFF8E6; border-color: var(--warn-line); color: var(--warn-fg); }
.kpi.warn .l { color: var(--warn-fg); }
.kpi.risk { background: #FBE9E6; border-color: var(--risk-line); color: var(--risk-fg); }
.kpi.risk .l { color: var(--risk-fg); }
a.kpi:hover { border-color: #A9B39A; }

/* ---------- Badges, Pills ---------- */
.badge, .pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.4; }
.badges { display: inline-flex; flex-wrap: wrap; gap: 5px; }
.b-fa { background: var(--fa-bg); color: var(--fa-fg); }
.b-sa { background: var(--sa-bg); color: var(--sa-fg); }
.b-sob { background: var(--sob-bg); color: var(--sob-fg); }
.s-ok { background: var(--ok-bg); color: var(--ok-fg); font-weight: 700; }
.s-warn { background: var(--warn-bg); color: var(--warn-fg); font-weight: 700; }
.s-risk { background: var(--risk-bg); color: var(--risk-fg); font-weight: 700; }
.s-info { background: var(--info-bg); color: var(--info-fg); font-weight: 700; }
.s-muted { background: #EEF0EA; color: var(--text-2); }
.k-access { background: var(--fa-bg); color: var(--fa-fg); }
.k-signature { background: #DDF1EC; color: #0D5A50; }
.k-archive { background: #E9ECE5; color: #3A4654; }
.k-distribution { background: var(--sob-bg); color: var(--sob-fg); }
.k-team { background: #E3EAF6; color: #1F3A6B; }
.k-license { background: #F6ECDF; color: #6B4A22; }
.k-other { background: #EEF0EA; color: #3A4654; }
.vis-yes { color: var(--ok-fg); font-weight: 600; }
.vis-likely { color: var(--text-2); }
.vis-no { color: var(--warn-fg); font-weight: 700; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line-strong); background: #fff; color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #9EA79A; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--ink); font-weight: 700; }
.btn-primary:hover { filter: brightness(.96); border-color: var(--accent); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-2); }
.btn-danger { border-color: #E7C3C3; color: var(--risk-fg); }
.btn-danger:hover { border-color: #C98F8F; }
.btn-warn { border-color: #D9B85C; color: #6B4100; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn-link { background: none; border: 0; padding: 0; min-height: 0; font: inherit; font-weight: 600; color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; cursor: pointer; }
.btn-icon { width: 36px; min-height: 36px; padding: 0; }
button[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

/* ---------- Formulare ---------- */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=date], .field input[type=search], .field input[type=number], .field input[type=file], .field select, .field textarea,
.inp { min-height: 42px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-strong); background: #fff; font: inherit; font-size: 14px; font-weight: 400; color: var(--text); width: 100%; }
.field input[type=file] { padding: 8px; }
.field textarea, textarea.inp { padding: 10px 12px; min-height: 90px; resize: vertical; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; font-weight: 400; color: var(--text); cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--ink); flex: none; }
.check-list { display: flex; flex-direction: column; }
.check-list .check { padding: 10px 4px; border-bottom: 1px solid var(--line-soft); }
.search { position: relative; display: flex; align-items: center; flex: 1 1 260px; max-width: 380px; }
.search svg { position: absolute; left: 12px; pointer-events: none; }
.search input { padding-left: 38px; }
fieldset { border: 0; margin: 0; padding: 0; }

/* ---------- Meldungen ---------- */
.flash { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 16px; border-radius: 10px; font-size: 14px; font-weight: 500; }
.flash-ok { background: var(--ink); color: #fff; }
.flash-ok::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 2px; }
.flash-error { background: var(--risk-bg); color: var(--risk-fg); border: 1px solid var(--risk-line); }
.flash-info { background: var(--info-bg); color: var(--info-fg); }
.flash-secret { background: #FFF8E6; border: 1px solid var(--warn-line); color: #5C4A1F; flex-direction: column; align-items: flex-start; }
.flash-secret code { font-family: var(--mono); font-size: 18px; font-weight: 600; letter-spacing: .04em; color: var(--ink); background: #fff; padding: 6px 10px; border-radius: 6px; border: 1px solid var(--warn-line); user-select: all; }
.notice { padding: 14px 18px; border-radius: var(--radius); background: #FFF8E6; border: 1px solid var(--warn-line); color: #5C4A1F; font-size: 14px; line-height: 1.5; }
.notice strong { color: #6B4100; }
.notice.risk { background: #FBE9E6; border-color: var(--risk-line); color: var(--risk-fg); }
.notice.info { background: var(--info-bg); border-color: #C8D7E8; color: var(--info-fg); }
.empty { padding: 32px; text-align: center; background: #fff; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); }

/* ---------- Chips, Segmente ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: #fff; color: #2B3644; font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; }
.chip .n { font-size: 12px; opacity: .7; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 9px; background: #E7EAE3; }
.seg a { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; }
.seg a.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(15,30,46,.15); }

/* ---------- Avatare ---------- */
.av { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: #ECEFE4; color: var(--ink); font-size: 12px; font-weight: 700; }
.av.lg { width: 64px; height: 64px; font-size: 22px; background: var(--ink); color: var(--accent); }
.av.sm { width: 26px; height: 26px; font-size: 10px; }
.av-stack { display: inline-flex; padding-left: 6px; }
.av-stack .av { margin-left: -6px; border: 2px solid #fff; width: 32px; height: 32px; }
.av-stack .av.more { background: var(--ink); color: var(--accent); }
.person { display: flex; align-items: center; gap: 10px; }
.person .nm { display: flex; flex-direction: column; gap: 1px; }
.person .nm a, .person .nm b { font-weight: 600; font-size: 15px; }

/* ---------- Tabellen ---------- */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fff; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; font-size: 14px; }
.tbl th:first-child, .tbl td:first-child { padding-left: 18px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 18px; }
.tbl tbody tr:hover td { background: #F8F9F5; }
.tbl tr.sel td { background: #F2F5EA; }
.tbl tfoot td { background: #F7F8F5; font-weight: 700; font-size: 13px; }

/* ---------- Postfach-Kacheln ---------- */
.az { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 10px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.az a, .az span { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 6px; font-size: 13px; font-weight: 700; text-decoration: none; }
.az a { background: var(--ink); color: var(--accent); }
.az span { color: #B4BAB0; font-weight: 500; }
.letter-head { display: flex; align-items: center; gap: 12px; scroll-margin-top: 16px; }
.letter-head .lt { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; background: var(--ink); color: var(--accent); font-size: 16px; font-weight: 700; }
.letter-head .ln { flex: 1; height: 1px; background: #DDE1D8; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.tile { display: flex; flex-direction: column; gap: 12px; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); text-decoration: none; }
.tile:hover { border-color: #A9B39A; color: var(--text); }
.tile .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tile .ttl { display: flex; align-items: center; gap: 12px; font-size: 17px; font-weight: 600; min-width: 0; }
.tile .ttl span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-box { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex: none; border-radius: 8px; background: #F0F2EE; border: 1px solid var(--line); }
.tile .purpose { font-size: 14px; color: var(--muted); line-height: 1.45; }
.tile .bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* ---------- Balken ---------- */
.bar { flex: 1; height: 8px; border-radius: 4px; background: #EEF0EA; overflow: hidden; min-width: 80px; }
.bar > i { display: block; height: 100%; border-radius: 4px; background: var(--ink); }
.bar.lg { height: 12px; border-radius: 6px; }
.bar > i.warn { background: #D09A1E; }
.bar > i.crit { background: #C2412D; }
.barline { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.c-crit { color: #B23A24; }
.c-warn { color: #9A6200; }

/* ---------- Hinweise ---------- */
.hint { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 16px 18px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); }
.hint.warn-box { background: #FFF8E6; border-color: var(--warn-line); }
.hint .body { display: flex; flex-direction: column; gap: 5px; flex: 1 1 360px; min-width: 0; }
.hint .body b { font-size: 15px; }
.hint .body span { font-size: 14px; color: var(--text-2); line-height: 1.5; }

/* ---------- Detailköpfe ---------- */
.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.meta-grid .k { font-size: 12px; color: var(--muted); }
.meta-grid .v { margin-top: 3px; font-size: 15px; font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; }
details.box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
details.box > summary { list-style: none; cursor: pointer; padding: 14px 18px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
details.box > summary::-webkit-details-marker { display: none; }
details.box > summary::after { content: '+'; font-size: 20px; color: var(--muted); }
details.box[open] > summary::after { content: '–'; }
details.box > .inner { padding: 0 18px 18px; }

/* ---------- Gruppen-Akkordeon ---------- */
.acc-row { border-bottom: 1px solid var(--line-soft); }
.acc-row > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 14px 18px; cursor: pointer; list-style: none; }
.acc-row > summary::-webkit-details-marker { display: none; }
.acc-row > summary:hover { background: #F8F9F5; }
.acc-row > summary .chev { transition: transform .2s; flex: none; }
.acc-row[open] > summary .chev { transform: rotate(180deg); }
.acc-row .acc-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; padding: 18px 18px 22px; background: #FAFBF8; border-top: 1px solid var(--line-soft); }
.member-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 10px 0 4px; border-radius: 999px; border: 1px solid #DDE1D8; background: #fff; font-size: 13px; font-weight: 600; color: var(--text); text-decoration: none; }

/* ---------- Schritte ---------- */
.steps { display: flex; flex-direction: column; }
.step { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; line-height: 1.4; }
.step .n { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; flex: none; border-radius: 6px; background: #ECEFE4; color: var(--ink); font-size: 11px; font-weight: 700; }
.step .err { display: block; margin-top: 4px; color: var(--risk-fg); font-size: 13px; font-family: var(--mono); white-space: pre-wrap; word-break: break-word; }
.preview-id { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 10px; background: var(--ink); color: #fff; }
.preview-id .mono { color: var(--accent); }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--ink); }
.auth-card { width: 100%; max-width: 420px; background: #fff; border-radius: 16px; padding: 32px; display: flex; flex-direction: column; gap: 18px; }
.auth-card .brand, .auth-card .brand:hover { color: var(--ink); }
.auth-card .brand-name span { color: var(--muted); }
.qr { display: flex; justify-content: center; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.qr svg, .qr canvas, .qr img { width: 200px; height: 200px; }

/* ---------- Matrix (dunkel) ---------- */
.dark-panel { position: relative; overflow: hidden; border-radius: 16px; background-color: var(--ink); background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px); background-size: 28px 28px; color: #fff; }
.mx { width: 100%; border-collapse: separate; border-spacing: 0; }
.mx th { padding: 18px 6px 14px; text-align: center; vertical-align: bottom; }
.mx th:first-child { text-align: left; padding-left: 18px; font-size: 12px; font-weight: 600; color: #A9B6C4; letter-spacing: .06em; }
.mx th a { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; color: #fff; text-decoration: none; font-size: 13px; font-weight: 700; max-width: 110px; }
.mx th a span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 110px; }
.mx th a .c { font-size: 11px; font-weight: 600; color: var(--accent); }
.mx td { padding: 7px 6px; border-top: 1px solid rgba(255,255,255,.07); text-align: center; }
.mx td:first-child { text-align: left; padding-left: 18px; }
.mx tr:hover td { background: rgba(255,255,255,.035); }
.pname { display: flex; align-items: center; gap: 12px; background: none; border: 0; padding: 4px 0; font: inherit; color: #fff; cursor: pointer; text-align: left; }
.pname .pav { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex: none; border-radius: 50%; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); color: var(--accent); font-size: 12px; font-weight: 700; transition: box-shadow .2s; }
.pname:hover .pav { box-shadow: 0 0 0 2px var(--accent), 0 0 16px rgba(192,217,4,.6); }
.pname .pn { display: flex; flex-direction: column; gap: 2px; }
.pname .pn b { font-size: 14px; font-weight: 600; }
.pname .pn span { font-size: 12px; color: #A9B6C4; }
.tag-dark { padding: 1px 7px; border-radius: 999px; background: #5A1E22; color: #FFC9C9; font-size: 10px; font-weight: 700; }
.mtile { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 52px; height: 44px; border-radius: 10px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); text-decoration: none; transition: box-shadow .2s, transform .2s, background .2s; }
.mtile:hover { transform: translateY(-2px); box-shadow: 0 0 0 2px var(--accent), 0 0 22px rgba(192,217,4,.45); background: rgba(255,255,255,.1); }
.mtile.grp { border-style: dashed; }
.mtile i { display: block; width: 28px; height: 5px; border-radius: 3px; }
.mtile i.fa { background: var(--fa-glow); box-shadow: 0 0 8px rgba(79,163,247,.7); }
.mtile i.sa { background: var(--sa-glow); box-shadow: 0 0 8px rgba(255,148,71,.7); }
.mtile i.sob { background: var(--sob-glow); box-shadow: 0 0 8px rgba(179,149,255,.7); }
.mdot { display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: rgba(255,255,255,.18); }
.lg-key { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.lg-key i { width: 18px; height: 6px; border-radius: 3px; display: inline-block; }

/* Fokus-Ansicht */
.focus { padding: 20px 24px 28px; }
.focus .scan { position: absolute; left: 0; right: 0; height: 140px; top: -140px; background: linear-gradient(180deg, transparent, rgba(192,217,4,.28), transparent); animation: scan 1.2s ease-out .15s 1 both; pointer-events: none; }
.focus-top { position: relative; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.btn-ghost-dark { min-height: 40px; padding: 0 14px; border-radius: 8px; border: 1px solid rgba(255,255,255,.22); background: transparent; color: #fff; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.btn-ghost-dark:hover { background: rgba(255,255,255,.08); color: #fff; }
.focus-grid { position: relative; display: flex; flex-wrap: wrap; gap: 28px; align-items: center; margin-top: 12px; }
.stage-wrap { flex: 1 1 440px; min-width: 0; }
.stage { position: relative; width: 100%; max-width: 600px; aspect-ratio: 1 / 1; margin: 0 auto; }
.stage .ring-a { position: absolute; left: 12%; top: 12%; width: 76%; height: 76%; border-radius: 50%; border: 1px dashed rgba(255,255,255,.16); animation: spin 60s linear infinite; }
.stage .ring-b { position: absolute; left: 30%; top: 30%; width: 40%; height: 40%; border-radius: 50%; border: 1px solid rgba(255,255,255,.08); animation: spin 90s linear infinite reverse; }
.ray { position: absolute; left: 50%; top: 50%; height: 2px; transform-origin: 0 50%; transform: rotate(var(--a)); animation: rayIn .8s cubic-bezier(.2,.8,.2,1) backwards; }
.ray.off { height: 0; border-top: 1px dashed rgba(255,255,255,.16); background: none !important; }
.pulse { position: absolute; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: #fff; box-shadow: 0 0 12px #fff; animation: travel 2.4s linear infinite; }
.core { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: inline-flex; align-items: center; justify-content: center; width: 104px; height: 104px; border-radius: 50%; background: var(--accent); color: var(--ink); font-size: 32px; font-weight: 700; box-shadow: 0 0 0 6px rgba(255,255,255,.06), 0 0 48px rgba(192,217,4,.55); z-index: 2; }
.core-ring { position: absolute; left: 50%; top: 50%; width: 112px; height: 112px; border-radius: 50%; border: 2px solid var(--accent); transform: translate(-50%, -50%); animation: ring 2.4s ease-out infinite; pointer-events: none; }
.node { position: absolute; transform: translate(-50%, -50%); min-width: 104px; max-width: 150px; padding: 9px 12px; border-radius: 12px; text-align: center; text-decoration: none; z-index: 3; animation: nodeIn .7s cubic-bezier(.2,.8,.2,1) backwards; transition: transform .2s; background: rgba(3,30,47,.88); }
.node:hover { transform: translate(-50%, -50%) scale(1.07); }
.node b { display: block; font-size: 13px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node span { display: block; margin-top: 3px; font-size: 11px; font-weight: 600; }
.node.off b { color: #8E9BA8; }
.focus-info { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.focus-info .eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .08em; color: var(--accent); }
.focus-info h2 { margin-top: 6px; font-size: 30px; letter-spacing: -0.02em; }
.focus-info .big { font-size: 52px; font-weight: 700; line-height: 1; color: var(--accent); }
.fbar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; }
.fbar i { display: block; height: 100%; border-radius: 3px; }
.fhint { padding: 12px 14px; border-radius: 10px; background: rgba(255,180,60,.1); border: 1px solid rgba(255,180,60,.35); font-size: 13px; line-height: 1.45; color: #FFE2B0; }
.morph-matrix { animation: morphMatrix .75s cubic-bezier(.2,.8,.2,1) both; transform-origin: 50% 0; }
.morph-focus { animation: morphFocus .9s cubic-bezier(.16,.84,.24,1) both; transform-origin: 50% 40%; }
@keyframes morphMatrix { 0% { opacity: 0; transform: perspective(1400px) rotateX(32deg) translateZ(-220px) scale(.88); filter: blur(6px); } 100% { opacity: 1; transform: none; filter: none; } }
@keyframes morphFocus { 0% { opacity: 0; transform: perspective(1400px) rotateY(-32deg) rotateX(14deg) translateZ(-320px) scale(.75); filter: blur(10px); } 55% { opacity: 1; filter: blur(0); } 100% { opacity: 1; transform: none; filter: none; } }
@keyframes scan { from { top: -140px; } to { top: 100%; } }
@keyframes rayIn { from { transform: rotate(var(--a)) scaleX(0); opacity: 0; } to { transform: rotate(var(--a)) scaleX(1); opacity: 1; } }
@keyframes travel { 0% { left: 0%; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { left: 100%; opacity: 0; } }
@keyframes nodeIn { from { opacity: 0; transform: translate(-50%, -50%) scale(.3); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes ring { from { transform: translate(-50%, -50%) scale(1); opacity: .75; } to { transform: translate(-50%, -50%) scale(1.9); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .morph-matrix, .morph-focus, .ray, .pulse, .node, .core-ring, .stage .ring-a, .stage .ring-b { animation: none !important; }
  .focus .scan { display: none; }
}

/* ---------- Druck (PDF-Nachweise, Berichte) ---------- */
.print-page { max-width: 900px; margin: 0 auto; padding: 32px; background: #fff; }
.print-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 16px; border-bottom: 3px solid var(--ink); margin-bottom: 20px; }
.print-head .logo { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.print-actions { display: flex; gap: 10px; justify-content: flex-end; max-width: 900px; margin: 20px auto 0; padding: 0 32px; }
.sign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 48px; }
.sign div { border-top: 1px solid var(--text); padding-top: 6px; font-size: 12px; color: var(--muted); }
@media print {
  body { background: #fff; font-size: 12px; }
  .no-print, .topbar, .sidenav { display: none !important; }
  .print-page { padding: 0; max-width: none; }
  .tbl td, .tbl th { padding: 6px 8px; }
  .card { border-color: #ccc; break-inside: avoid; }
  a { text-decoration: none; }
}

@media (max-width: 640px) {
  .shell { padding: 16px; }
  .topbar { padding: 12px 16px; }
  .select-wrap select { min-width: 180px; }
  h1 { font-size: 24px; }
}

/* Änderungen / Bericht */
.sgn { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; border-radius: 6px; font-weight: 700; font-family: 'IBM Plex Mono', monospace; }
.sgn.p { background: var(--ok-bg); color: var(--ok-fg); }
.sgn.m { background: var(--risk-bg); color: var(--risk-fg); }
.sgn.t { background: var(--info-bg); color: var(--info-fg); }
.diff-sec h3 { font-size: 15px; margin: 0; }
.report-sec { margin-top: 22px; }
.report-sec > h2 { font-size: 17px; margin: 0 0 8px; padding-bottom: 6px; border-bottom: 2px solid var(--accent); }
@media print { .report-sec { break-inside: avoid-page; } .no-print { display: none !important; } }
.print-page .kpis { grid-template-columns: repeat(5, 1fr); }
.print-page .kpi .v { font-size: 22px; }
