/* NVPD – NoctoraV Police Department
   Farbwelt nach dem Wappen: Schwarz, Weiß, Silber. Statusfarben nur für Bedeutung. */
:root {
  --bg: #07080a;
  --bg-2: #0c0e11;
  --surface: #111418;
  --surface-2: #171b20;
  --surface-3: #1e232a;
  --border: #252a32;
  --border-strong: #353c46;
  --text: #eceef1;
  --text-2: #b9bfc8;
  --muted: #8a919c;
  --silver: #d4d8de;
  --silver-dim: #9aa1ab;
  --accent: #f2f4f7;
  --accent-text: #0a0b0d;
  --ok: #3fb97a;   --ok-bg: rgba(63, 185, 122, .12);
  --warn: #e0a43a; --warn-bg: rgba(224, 164, 58, .12);
  --bad: #ef5b5b;  --bad-bg: rgba(239, 91, 91, .12);
  --info: #7aa7e6; --info-bg: rgba(122, 167, 230, .12);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px -12px rgba(0, 0, 0, .6);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --sidebar: 264px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }
a { color: var(--silver); text-decoration: none; }
a:hover { color: #fff; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; color: #fff; }
h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 1em; }
code, .mono { font-family: var(--mono); font-size: .92em; }
pre { font-family: var(--mono); font-size: 12px; white-space: pre-wrap; word-break: break-word; margin: .5rem 0 0; color: var(--text-2); }
hr { border: 0; border-top: 1px solid var(--border); }
::selection { background: rgba(255, 255, 255, .2); }
:focus-visible { outline: 2px solid var(--silver); outline-offset: 2px; border-radius: 4px; }

.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: #fff; color: #000; padding: 8px 12px; border-radius: 6px; }
.skip:focus { left: 8px; }

.icon { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.pad { padding: 16px 20px; }
.grow { flex: 1; }
.dimmed { opacity: .6; }
.inline { display: inline; margin: 0; }

.row { display: flex; align-items: center; }
.row.gap, .gap { gap: 10px; }
.row.wrap, .wrap { flex-wrap: wrap; }
.row.between, .between { justify-content: space-between; }
.row.end, .end { justify-content: flex-end; }
.stack { display: flex; flex-direction: column; gap: 14px; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }

.eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--silver-dim); margin-bottom: .45rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font: 600 .92rem/1.2 var(--font); cursor: pointer; transition: background .15s, border-color .15s, color .15s, transform .05s; white-space: nowrap; color: var(--text); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(180deg, #fff, #d9dde3); color: var(--accent-text); border-color: #fff; }
.btn-primary:hover { background: #fff; color: #000; }
.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); color: #fff; border-color: #48505c; }
.btn-ok { background: var(--ok-bg); border-color: rgba(63, 185, 122, .4); color: #8de0b3; }
.btn-ok:hover { background: rgba(63, 185, 122, .2); color: #b7f0cf; }
.btn-warn { background: var(--warn-bg); border-color: rgba(224, 164, 58, .4); color: #f1c878; }
.btn-warn:hover { background: rgba(224, 164, 58, .2); color: #ffd995; }
.btn-danger { background: var(--bad-bg); border-color: rgba(239, 91, 91, .4); color: #ff9a9a; }
.btn-danger:hover { background: rgba(239, 91, 91, .2); color: #ffc0c0; }
.btn-sm { padding: 6px 11px; font-size: .84rem; }
.btn-lg { padding: 13px 22px; font-size: 1rem; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--radius-sm); border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-3); color: #fff; }
.icon-btn.danger:hover { color: var(--bad); background: var(--bad-bg); }
.link-btn { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; font: inherit; display: inline-flex; gap: 4px; align-items: center; }
.link-btn.danger:hover { color: var(--bad); }
.link-btn .icon { width: 14px; height: 14px; }

/* ------------------------------------------------------------------ Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 600; line-height: 1.6; white-space: nowrap; border: 1px solid transparent; }
.badge .icon { width: 12px; height: 12px; }
.badge-ok { background: var(--ok-bg); color: #8de0b3; border-color: rgba(63, 185, 122, .3); }
.badge-warn { background: var(--warn-bg); color: #f1c878; border-color: rgba(224, 164, 58, .3); }
.badge-bad { background: var(--bad-bg); color: #ff9a9a; border-color: rgba(239, 91, 91, .3); }
.badge-info { background: var(--info-bg); color: #a9c8f2; border-color: rgba(122, 167, 230, .3); }
.badge-muted { background: var(--surface-3); color: var(--text-2); border-color: var(--border); }
.badge-group { background: transparent; border-color: var(--border-strong); color: var(--text-2); }
.badge-leitungsebene { border-color: rgba(255, 255, 255, .5); color: #fff; }
.badge-leitungsrat { border-color: rgba(212, 216, 222, .4); color: var(--silver); }
.tag { display: inline-block; padding: 1px 7px; border-radius: 5px; font-size: .74rem; font-weight: 700; background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border); }
.tag-lead { border-color: rgba(255, 255, 255, .45); color: #fff; }
.tag-ok { color: #8de0b3; border-color: rgba(63, 185, 122, .35); }
.tag-bad { color: #ff9a9a; border-color: rgba(239, 91, 91, .35); }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.unit-short { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 2px 8px; border-radius: 5px;
  background: linear-gradient(180deg, #2a3038, #1c2027); border: 1px solid var(--border-strong); color: var(--silver); }
.req { color: var(--bad); }

/* ------------------------------------------------------------------ Cards */
.card { background: linear-gradient(180deg, var(--surface), var(--bg-2)); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card-title { display: flex; align-items: center; gap: 8px; font-size: 1rem; margin-bottom: 14px; }
.card-title .icon { color: var(--silver-dim); }
.table-card { padding: 0; overflow: hidden; }
.table-card > .card-head { padding: 16px 20px 0; }
.table-card .card-title.pad { margin: 0; }
a.card { display: block; color: inherit; transition: border-color .15s, transform .15s, background .15s; }
a.card:hover { border-color: var(--border-strong); transform: translateY(-2px); background: linear-gradient(180deg, var(--surface-2), var(--surface)); }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-dash { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-record { grid-template-columns: 320px minmax(0, 1fr); align-items: start; }
.span-2 { grid-column: span 2; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; align-items: start; }

.empty { text-align: center; padding: 28px 16px; color: var(--text-2); }
.empty p { margin: 0 0 4px; }

.notice { padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); margin-bottom: 16px; display: flex; gap: 8px; align-items: flex-start; }
.notice-warn { border-color: rgba(224, 164, 58, .35); background: var(--warn-bg); color: #f1d39c; }

/* ------------------------------------------------------------------ Forms */
label { display: flex; flex-direction: column; gap: 6px; font-size: .88rem; font-weight: 600; color: var(--text-2); }
input, select, textarea { font: 400 .95rem/1.4 var(--font); color: var(--text); background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 9px 11px; width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--silver-dim); box-shadow: 0 0 0 3px rgba(212, 216, 222, .12); }
input:disabled { opacity: .6; }
textarea { resize: vertical; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239aa1ab' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }
input[type=checkbox] { width: 17px; height: 17px; accent-color: #e9ecf0; flex: none; margin: 0; padding: 0; }
.hint { font-weight: 400; color: var(--muted); font-size: .8rem; }
.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 500; color: var(--text); cursor: pointer; }
.check-inline { align-self: end; padding-bottom: 10px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 16px; }
.fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px 16px; margin: 0; }
.fieldset legend { padding: 0 6px; font-weight: 700; font-size: .85rem; color: var(--silver); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 18px; }
.form-card { max-width: 920px; }
.confirm-check { padding: 10px 12px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); }

.filters { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px; margin-bottom: 16px; align-items: center; }
.filters select { width: auto; flex: 1 1 150px; }
.search { position: relative; flex: 2 1 240px; display: block; }
.search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 36px; }

/* ------------------------------------------------------------------ Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--bg-2); white-space: nowrap; }
.table td { padding: 11px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr[data-href] { cursor: pointer; }
.table tbody tr:hover td { background: rgba(255, 255, 255, .02); }
.table td a strong { color: #fff; }
.table .cat-row th { background: var(--surface-2); color: var(--silver); font-size: .75rem; }
.table input:not([type=checkbox]) { padding: 6px 9px; }

.matrix th.rank-col { writing-mode: vertical-rl; transform: rotate(180deg); text-transform: none; letter-spacing: 0; font-size: .8rem; padding: 12px 6px; height: 150px; text-align: left; vertical-align: bottom; color: var(--text-2); }
.matrix th.rank-leitungsebene { color: #fff; }
.matrix td { padding: 8px 6px; }
.matrix .sticky { position: sticky; left: 0; z-index: 1; background: var(--surface); min-width: 260px; }
.matrix thead .sticky { background: var(--bg-2); vertical-align: bottom; }
.matrix .cat-row .sticky { background: var(--surface-2); }
.perm-name { font-weight: 500; text-transform: none !important; letter-spacing: 0 !important; color: var(--text) !important; font-size: .88rem !important; }
.perm-name small { display: block; font-weight: 400; font-size: .76rem; }

.audit-details summary { cursor: pointer; color: var(--muted); font-size: .85rem; }
.audit-details pre { max-width: 460px; }

.pagination { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; gap: 10px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; font-size: .92rem; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: #fff; border-color: #fff; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip { padding: 6px 13px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--text-2); font-size: .85rem; font-weight: 600; }
.chip:hover { color: #fff; border-color: #4a525e; }
.chip.active { background: #fff; color: #000; border-color: #fff; }

/* ------------------------------------------------------------------ Flash / Dialog */
.flashes { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: min(440px, calc(100vw - 32px)); }
.flash { display: flex; align-items: flex-start; gap: 10px; padding: 12px 10px 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border-strong); box-shadow: 0 12px 30px rgba(0, 0, 0, .5); transition: opacity .4s, transform .4s; }
.flash > span { flex: 1; padding-top: 1px; }
.flash .icon-btn { width: 26px; height: 26px; margin: -3px 0; }
.flash-success .icon:first-child { color: var(--ok); }
.flash-info .icon:first-child { color: var(--info); }
.flash-error { border-color: rgba(239, 91, 91, .5); }
.flash-error .icon:first-child { color: var(--bad); }
.flash.fade { opacity: 0; transform: translateY(8px); pointer-events: none; }

.dialog { border: 1px solid var(--border-strong); border-radius: 14px; background: var(--surface); color: var(--text); padding: 0; width: min(520px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(0, 0, 0, .7); }
.dialog::backdrop { background: rgba(0, 0, 0, .65); backdrop-filter: blur(3px); }
.dialog-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dialog-head h2 { margin: 0; font-size: 1.15rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

.banner { display: flex; gap: 10px; align-items: center; padding: 10px 24px; font-weight: 600; font-size: .9rem; }
.banner-warn { background: var(--warn-bg); color: #f1d39c; border-bottom: 1px solid rgba(224, 164, 58, .3); }

/* ------------------------------------------------------------------ Public site */
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(7, 8, 10, .82); backdrop-filter: saturate(140%) blur(12px); border-bottom: 1px solid var(--border); }
.site-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; }
.brand img { }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 1.1rem; letter-spacing: .12em; }
.brand-text small { font-size: .68rem; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav > a:not(.btn) { padding: 8px 12px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 600; font-size: .92rem; }
.site-nav > a:not(.btn):hover { color: #fff; background: var(--surface-2); }
.site-nav > a.active { color: #fff; }
.site-nav .btn { margin-left: 8px; }
.nav-toggle { display: none; }
.public-main { padding-top: 32px; padding-bottom: 64px; min-height: 60vh; }

.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--border);
  background: radial-gradient(900px 500px at 75% 40%, rgba(255, 255, 255, .07), transparent 60%), radial-gradient(600px 400px at 10% 100%, rgba(122, 167, 230, .05), transparent 60%), var(--bg); }
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px); background-size: 48px 48px; mask-image: radial-gradient(ellipse at 70% 50%, #000 20%, transparent 70%); }
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr .9fr; gap: 24px; align-items: center; padding-top: 40px; padding-bottom: 48px; }
.hero h1 { font-size: clamp(2.2rem, 5.2vw, 4rem); font-weight: 900; letter-spacing: -.02em; text-transform: uppercase; line-height: 1.02;
  background: linear-gradient(180deg, #fff 30%, #9aa1ab); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { font-size: 1.15rem; color: var(--text-2); margin-bottom: 28px; font-style: italic; }
.hero-logo { justify-self: center; width: min(100%, 520px); filter: drop-shadow(0 0 60px rgba(255, 255, 255, .08)); }

.stats-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-top: -1px; transform: translateY(-50%); position: relative; z-index: 2; max-width: 900px; }
.stat { background: var(--surface); padding: 18px 20px; text-align: center; }
.stat strong { display: block; font-size: 1.8rem; font-weight: 900; color: #fff; }
.stat span { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }

.section { margin-top: 48px; }
.section-head { margin-bottom: 18px; align-items: flex-end; }
.section-head h2 { font-size: 1.6rem; margin: 0; }
.prose p:last-child { margin-bottom: 0; }
.lead { font-size: 1.08rem; color: var(--text-2); }
.about .prose { max-width: 820px; }

.unit-card h3, .unit-card h2 { margin: 12px 0 6px; }
.unit-card p { margin: 0 0 8px; }
.unit-card-lg p { margin-bottom: 14px; }
.more { display: inline-flex; align-items: center; gap: 4px; color: var(--silver); font-weight: 600; font-size: .9rem; }
.more .icon { width: 16px; height: 16px; }

.press-card h3 { margin-bottom: 6px; }
.press-card p { margin-bottom: 10px; }

.change-list { list-style: none; margin: 0; padding: 0; }
.change-list li { display: grid; grid-template-columns: 140px 1fr auto; gap: 14px; align-items: baseline; padding: 11px 0; border-bottom: 1px solid var(--border); }
.change-list li:last-child { border-bottom: 0; }
.change-type { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--silver-dim); }
.split .change-list li { grid-template-columns: 1fr auto; }
.split .change-type { grid-column: 1 / -1; margin-bottom: -10px; }

.cta { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 32px; background: radial-gradient(600px 200px at 100% 0, rgba(255, 255, 255, .06), transparent), var(--surface); }
.cta h2 { font-size: 1.6rem; }
.cta p { margin: 0; max-width: 640px; }

.page-hero { margin-bottom: 28px; }
.page-hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin-bottom: 10px; }
.page-hero .unit-short { margin-bottom: 12px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .9rem; font-weight: 600; margin-bottom: 18px; }
.back-link:hover { color: #fff; }

.check-list { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.check-list li { position: relative; padding-left: 24px; }
.check-list li::before { content: ""; position: absolute; left: 2px; top: .5em; width: 10px; height: 6px; border-left: 2px solid var(--silver); border-bottom: 2px solid var(--silver); transform: rotate(-45deg); }
.person-card strong { display: block; font-size: 1.05rem; color: #fff; }

.article { max-width: 760px; }
.article h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.article .prose { font-size: 1.04rem; color: var(--text-2); }
.article-foot { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--border); }

.auth-card { max-width: 440px; margin: 24px auto; text-align: center; padding: 32px; display: flex; flex-direction: column; gap: 14px; }
.auth-card .stack { text-align: left; }
.auth-logo { margin: -10px auto 0; }
.dev-login { text-align: left; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 10px 14px; }
.dev-login summary { cursor: pointer; color: var(--warn); font-weight: 600; font-size: .88rem; }
.dev-login form { margin-top: 12px; }

.error-page { text-align: center; padding: 60px 0; max-width: 520px; margin: 0 auto; }
.error-page .row { justify-content: center; }
.error-code { font-size: 5rem; font-weight: 900; line-height: 1; color: transparent; -webkit-text-stroke: 1px var(--border-strong); margin-bottom: 12px; }

.site-footer { border-top: 1px solid var(--border); background: var(--bg-2); padding: 36px 0; }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 18px 24px; align-items: center; }
.footer-brand { display: flex; gap: 14px; align-items: center; }
.footer-brand img { }
.footer-brand p { margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-links a { color: var(--muted); font-size: .9rem; }
.footer-links a:hover { color: #fff; }
.footer-note { grid-column: 1 / -1; margin: 0; }

/* ------------------------------------------------------------------ Portal */
.portal { display: block; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: var(--bg-2); border-right: 1px solid var(--border); display: flex; flex-direction: column; z-index: 50; }
.sidebar-brand { padding: 18px 18px 14px; border-bottom: 1px solid var(--border); }
.side-nav { flex: 1; overflow-y: auto; padding: 10px 10px 16px; }
.side-group { padding: 6px 0; }
.side-group + .side-group { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 10px; }
.side-label { font-size: .68rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 4px 10px 6px; }
.side-nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 600; font-size: .92rem; }
.side-nav a:hover { background: var(--surface-2); color: #fff; }
.side-nav a.active { background: var(--surface-3); color: #fff; box-shadow: inset 2px 0 0 #fff; }
.side-nav a .icon { color: var(--silver-dim); }
.side-nav a.active .icon { color: #fff; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; border-top: 1px solid var(--border); }
.side-user-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.side-user-text strong { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-text small { color: var(--muted); font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-3); object-fit: cover; flex: none; }
.portal-main { margin-left: var(--sidebar); min-height: 100vh; }
.topbar { display: none; }
.portal-content { padding: 28px 32px 64px; max-width: 1320px; }
.scrim { display: none; }

.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-header h1 { margin: 0; }
.page-header .sub { margin: 6px 0 0; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.profile-card { display: flex; flex-direction: column; gap: 16px; }
.profile-top { display: flex; gap: 14px; align-items: center; }
.profile-name { font-size: 1.15rem; color: #fff; }
.sn-badge { font-family: var(--mono); font-weight: 800; font-size: .95rem; letter-spacing: .04em; padding: 10px 12px; border-radius: 10px; background: linear-gradient(180deg, #2b313a, #171b20); border: 1px solid var(--border-strong); color: #fff; white-space: nowrap; }
.sn-lg { font-size: 1.2rem; padding: 14px 16px; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 9px 16px; margin: 0 0 14px; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; }

.announcements { display: flex; flex-direction: column; gap: 8px; }
.announcement { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--bg); }
.announcement summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; list-style: none; }
.announcement summary::-webkit-details-marker { display: none; }
.announcement summary strong { flex: 1; min-width: 140px; }
.announcement .prose { margin-top: 10px; color: var(--text-2); font-size: .93rem; }

.unit-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.unit-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.unit-list li:last-child { border-bottom: 0; }
.unit-list a, .unit-list li > span:first-child { display: flex; gap: 10px; align-items: center; color: var(--text); font-weight: 600; }
.unit-add { margin-top: 12px; }
.unit-add select { flex: 1; }

.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.mini-stat { display: flex; flex-direction: column; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); }
.mini-stat strong { font-size: 1.6rem; font-weight: 900; color: #fff; }
.mini-stat span { color: var(--muted); font-size: .82rem; }
a.mini-stat:hover { border-color: var(--border-strong); }

.dist-card { margin-bottom: 16px; padding: 14px 20px; }
.dist-card summary { cursor: pointer; }
.dist { display: grid; gap: 6px; margin-top: 14px; }
.dist-row { display: grid; grid-template-columns: 170px 1fr 36px; gap: 12px; align-items: center; color: var(--text-2); font-size: .88rem; padding: 2px 0; }
.dist-row strong { text-align: right; color: #fff; }
.dist-bar { height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.dist-bar span { display: block; height: 100%; background: linear-gradient(90deg, #8f97a3, #fff); border-radius: 99px; }

.record-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.record-id { flex: 1; min-width: 220px; }
.record-id h1 { margin: 0 0 8px; }
.record-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding: 0 0 22px 30px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot { position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 2px solid var(--silver-dim); }
.tl-hire .tl-dot, .tl-rehire .tl-dot, .tl-promotion .tl-dot, .tl-unsuspension .tl-dot, .tl-praise .tl-dot { border-color: var(--ok); }
.tl-demotion .tl-dot, .tl-suspension .tl-dot { border-color: var(--warn); }
.tl-termination .tl-dot, .tl-discipline .tl-dot { border-color: var(--bad); }
.tl-unit_join .tl-dot, .tl-unit_leave .tl-dot, .tl-unit_transfer .tl-dot, .tl-unit_role .tl-dot { border-color: var(--info); }
.tl-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.tl-head time { margin-left: auto; }
.tl-title { display: block; color: #fff; }
.tl-details { color: var(--text-2); font-size: .92rem; margin-top: 4px; }
.tl-details p { margin-bottom: .5em; }
.tl-foot { display: flex; gap: 14px; margin-top: 4px; align-items: center; }

.add-member { padding: 16px 20px 20px; border-top: 1px solid var(--border); }
.add-member select { flex: 2 1 200px; width: auto; }
.add-member input { flex: 1 1 160px; width: auto; }
.add-member select[name=role] { flex: 0 1 150px; }
.small-head { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 16px 0 10px; }
.add-member .small-head { margin-top: 0; }

/* ------------------------------------------------------------------ Responsive */
@media (max-width: 1100px) {
  .grid-record { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: none; box-shadow: 20px 0 60px rgba(0, 0, 0, .6); }
  .portal-main { margin-left: 0; }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--bg-2); position: sticky; top: 0; z-index: 30; }
  .topbar .brand img { }
  .nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 45; }
  .portal-content { padding: 20px 16px 48px; }
  .grid-dash { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .hero-inner { grid-template-columns: 1fr; text-align: center; padding-top: 24px; }
  .hero-inner .row { justify-content: center; }
  .hero-inner .eyebrow { justify-content: center; }
  .hero-logo { order: -1; width: min(70%, 340px); }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .nav-toggle { display: inline-grid; }
  .site-nav { display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch; padding: 12px 16px 18px; background: var(--bg-2); border-bottom: 1px solid var(--border); }
  .site-nav.open { display: flex; }
  .site-nav .btn { margin: 8px 0 0; }
  .site-nav form .btn { width: 100%; }
  .container { padding: 0 16px; }
  .stats-strip { transform: none; margin-top: 20px; }
  .stat strong { font-size: 1.4rem; }
  .change-list li { grid-template-columns: 1fr auto; }
  .change-type { grid-column: 1 / -1; margin-bottom: -10px; }
  .cta { flex-direction: column; align-items: flex-start; padding: 22px; }
  .footer-inner { grid-template-columns: 1fr; }
  .dist-row { grid-template-columns: 110px 1fr 30px; }
  .kv dd { text-align: left; }
  .table th, .table td { padding: 10px 12px; }
  .page-header { align-items: flex-start; }
  .filters select { flex: 1 1 calc(50% - 10px); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Startseite: Units immer gleichmäßig in 3 Spalten */
.grid-units { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 960px) { .grid-units { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid-units { grid-template-columns: 1fr; } }

.notice-link { color: inherit; }
.notice-link:hover { border-color: rgba(224, 164, 58, .6); color: #ffe2a8; }
.card-head-row { margin-bottom: 14px; }
.card-head-row .card-title { margin: 0; }

.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; flex: none; }
.dot-ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(63, 185, 122, .18); }
.dot-warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(224, 164, 58, .18); }
.dot-bad { background: var(--bad); box-shadow: 0 0 0 3px rgba(239, 91, 91, .18); }
.record-id h1 .status-dot { width: 13px; height: 13px; vertical-align: 6px; margin-right: 12px; }

/* Unit hinzufügen in der Personalakte: untereinander, volle Breite */
.unit-add { flex-direction: column; align-items: stretch; }
.unit-add select, .unit-add .btn { width: 100%; }
/* kompakte Personalupdates im Dashboard */
.compact-changes .change-list li { grid-template-columns: 1fr auto; padding: 8px 0; }
.compact-changes .change-type { grid-column: 1 / -1; margin-bottom: -8px; }

/* ---- Eigene Auswahllisten ---- */
.dd { position: relative; min-width: 0; }
.filters .dd { flex: 1 1 150px; }
.add-member .dd { flex: 2 1 200px; }
.dd-native { position: absolute !important; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.dd-btn { width: 100%; text-align: left; font: 400 .95rem/1.4 var(--font); color: var(--text); background: var(--bg); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 9px 30px 9px 11px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239aa1ab' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
.dd-btn:focus-visible, .dd.open .dd-btn { outline: none; border-color: var(--silver-dim); box-shadow: 0 0 0 3px rgba(212, 216, 222, .12); }
.dd-btn.dd-placeholder { color: var(--muted); }
.dd.dd-invalid .dd-btn { border-color: var(--bad); }
.dd-list { display: none; position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 80; max-height: 260px; overflow-y: auto;
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: 0 16px 40px rgba(0, 0, 0, .55); padding: 4px; }
.dd.up .dd-list { top: auto; bottom: calc(100% + 4px); }
.dd.open .dd-list { display: block; }
.dd-item { padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: .93rem; color: var(--text); }
.dd-item:hover { background: var(--surface-3); }
.dd-item.selected { background: rgba(255, 255, 255, .1); font-weight: 600; }
.dd-item.disabled { opacity: .45; cursor: default; }
.table-wrap:has(.dd.open) { overflow: visible; }
.dialog { overflow: visible; }

/* Glocke */
.bell { position: relative; }
.bell.active { background: var(--surface-3); color: #fff; }
.bell-count { position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--bad); color: #fff; font-size: .68rem; font-weight: 800; display: grid; place-items: center; line-height: 1; }
.sidebar-brand { gap: 8px; }
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-list li { border-bottom: 1px solid var(--border); }
.notif-list li:last-child { border-bottom: 0; }
.notif-list a, .notif-list .notif { display: grid; grid-template-columns: 10px 1fr auto; gap: 12px; padding: 14px 20px; color: var(--text); align-items: baseline; }
.notif-list a:hover { background: rgba(255,255,255,.02); }
.notif-list .unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--info); align-self: center; }
.notif-list .read .unread-dot { background: transparent; }
.notif-list .read strong { font-weight: 500; color: var(--text-2); }
.notif-list p { margin: 2px 0 0; color: var(--muted); font-size: .88rem; }

/* ===================== Phase 2 ===================== */
.section-title { font-size: 1.05rem; margin: 26px 0 12px; color: var(--silver); }
.section-gap { margin-top: 16px; }
.section-tools { margin-bottom: 4px; }
.chip-sep { width: 1px; background: var(--border-strong); margin: 0 4px; }
.inline-label { flex-direction: row; align-items: center; gap: 8px; }
.inline-label .dd { min-width: 120px; }
.kv-left dd { text-align: left; }
.stats-row.compact .mini-stat { padding: 10px 12px; }
.stats-row.compact .mini-stat strong { font-size: 1.3rem; }

/* Stempeluhr */
.clock-state { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); margin-bottom: 14px; flex-wrap: wrap; }
.clock-state > div { flex: 1; min-width: 150px; }
.clock-led { width: 12px; height: 12px; border-radius: 50%; background: var(--surface-3); box-shadow: 0 0 0 4px rgba(255,255,255,.04); flex: none; }
.clock-state.on { border-color: rgba(63,185,122,.4); background: rgba(63,185,122,.06); }
.clock-state.on .clock-led { background: var(--ok); box-shadow: 0 0 0 4px rgba(63,185,122,.2); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(63,185,122,.08); } }
.clock-timer { font-family: var(--mono); font-size: 1.6rem; font-weight: 800; color: #fff; }
.time-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; margin: 2px 4px 2px 0; border-radius: 6px; background: var(--surface-3); border: 1px solid var(--border); font-family: var(--mono); font-size: .82rem; }
.time-chip.running { border-color: rgba(63,185,122,.5); color: #8de0b3; }
.time-chip.auto { border-color: rgba(224,164,58,.5); color: #f1c878; }
.week-nav { justify-content: space-between; }
.week-bars { display: grid; gap: 7px; }
.week-bar-row { display: grid; grid-template-columns: 52px 1fr 54px; gap: 10px; align-items: center; }
.week-bar-row strong { text-align: right; }
.dist-bar span.low { background: linear-gradient(90deg, #8a4a4a, var(--bad)); }
.table tfoot th { background: var(--bg-2); color: var(--text); font-size: .85rem; text-transform: none; letter-spacing: 0; }
.rank-list { list-style: none; margin: 0; padding: 0; counter-reset: r; }
.rank-list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.rank-list li:last-child { border-bottom: 0; }
ol.rank-list li::before { counter-increment: r; content: counter(r) "."; color: var(--muted); margin-right: 8px; }
ol.rank-list li > span { flex: 1; }

/* Kalender */
.grid-cal { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
.cal-card { padding: 16px; }
.cal-head h2 { margin: 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--border); border-left: 1px solid var(--border); margin-top: 10px; }
.cal-wd { padding: 6px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg-2); }
.cal-day { min-height: 96px; padding: 4px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day.other { background: rgba(0,0,0,.25); }
.cal-day.other .cal-num { color: var(--border-strong); }
.cal-day.today { background: rgba(255,255,255,.04); }
.cal-day.today .cal-num { background: #fff; color: #000; border-radius: 999px; padding: 0 7px; }
.cal-num { font-size: .8rem; font-weight: 700; color: var(--text-2); align-self: flex-start; }
.cal-ev { display: block; font-size: .74rem; padding: 2px 5px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; background: var(--surface-3); border-left: 3px solid var(--silver-dim); }
.cal-ev.ev-training, .badge.ev-training { border-color: var(--info); }
.cal-ev.ev-meeting, .badge.ev-meeting { border-color: var(--warn); }
.cal-ev.cancelled { text-decoration: line-through; opacity: .5; }
.badge.ev-training { background: var(--info-bg); color: #a9c8f2; }
.badge.ev-meeting { background: var(--warn-bg); color: #f1c878; }
.badge.ev-event { background: var(--surface-3); color: var(--text-2); border-color: var(--border); }
.agenda { list-style: none; margin: 0; padding: 0; }
.agenda li a { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); color: var(--text); }
.agenda li:last-child a { border-bottom: 0; }
.agenda time { font-family: var(--mono); font-size: .82rem; color: var(--silver); }
.people-pick summary { cursor: pointer; color: var(--text-2); margin: 10px 0; }

/* Bewerbungen */
.cta-inline { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.cta-inline h3 { margin: 0 0 4px; }
.cta-inline p { margin: 0; }
.app-card { display: flex; flex-direction: column; gap: 14px; }
.app-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; counter-reset: s; }
.app-steps li { position: relative; padding: 8px 8px 8px 30px; border-radius: 8px; background: var(--bg); border: 1px solid var(--border); font-size: .82rem; color: var(--muted); }
.app-steps li::before { counter-increment: s; content: counter(s); position: absolute; left: 8px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; font-size: .66rem; font-weight: 800; background: var(--surface-3); color: var(--text-2); }
.app-steps li.done { color: #fff; border-color: rgba(63,185,122,.4); }
.app-steps li.done::before { background: var(--ok); color: #000; }
.app-steps li.done.bad { border-color: rgba(239,91,91,.4); }
.app-steps li.done.bad::before { background: var(--bad); }
.interviews { display: flex; flex-direction: column; gap: 8px; }
.interview { display: flex; gap: 10px; padding: 10px 12px; border-radius: 8px; border: 1px solid rgba(224,164,58,.35); background: var(--warn-bg); }
.interview.done { border-color: rgba(63,185,122,.35); background: var(--ok-bg); }
.interview.cancelled { opacity: .55; border-color: var(--border); background: var(--bg); }
.interview p { margin: 4px 0 0; }
.answers dt { font-weight: 700; color: var(--silver); margin-top: 14px; font-size: .9rem; }
.answers dt:first-child { margin-top: 0; }
.answers dd { margin: 4px 0 0; color: var(--text-2); }
.notes { list-style: none; margin: 14px 0 0; padding: 0; }
.notes li { padding: 10px 0; border-top: 1px solid var(--border); }
.notes p { margin: 4px 0 0; color: var(--text-2); }
.stars { color: #f1c878; letter-spacing: 1px; }
.note-form textarea { min-height: 70px; }
.question-row { display: grid; grid-template-columns: 60px minmax(160px, 2fr) 150px minmax(140px, 1fr) auto auto; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.question-row.new { border-bottom: 0; padding-top: 16px; }
.question-row textarea { min-height: 40px; }
@media (max-width: 960px) {
  .grid-cal { grid-template-columns: 1fr; }
  .cal-day { min-height: 64px; }
  .cal-ev b { display: none; }
  .question-row { grid-template-columns: 1fr 1fr; }
  .app-steps { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Eigener Datums-/Zeit-Picker ---- */
.dtp { position: relative; display: flex; min-width: 0; }
.dtp-text { border-top-right-radius: 0; border-bottom-right-radius: 0; flex: 1; }
.dtp-btn { flex: none; width: 42px; border: 1px solid var(--border-strong); border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--surface-2); color: var(--text-2); cursor: pointer; display: grid; place-items: center; }
.dtp-btn:hover, .dtp.open .dtp-btn { color: #fff; background: var(--surface-3); }
.dtp-pop { display: none; position: absolute; top: calc(100% + 4px); left: 0; z-index: 90; width: 290px; padding: 12px; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: 0 16px 40px rgba(0,0,0,.6); }
.dtp.up .dtp-pop { top: auto; bottom: calc(100% + 4px); }
.dtp.open .dtp-pop { display: block; }
.dtp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.dtp-nav { width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--border-strong); background: transparent; color: var(--text); cursor: pointer; font-size: 1.1rem; }
.dtp-wd, .dtp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.dtp-wd span { font-size: .7rem; color: var(--muted); font-weight: 700; padding: 3px 0; }
.dtp-day { height: 32px; border: 0; border-radius: 6px; background: transparent; color: var(--text); cursor: pointer; font: 500 .88rem var(--font); }
.dtp-day:hover { background: var(--surface-3); }
.dtp-day.today { box-shadow: inset 0 0 0 1px var(--silver-dim); }
.dtp-day.sel { background: #fff; color: #000; font-weight: 800; }
.dtp-day:disabled { opacity: .3; cursor: default; }
.dtp-time { display: flex; align-items: center; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); color: var(--text-2); font-size: .88rem; }
.dtp-time span { flex: 1; }
.dtp-time input { width: 62px; text-align: center; padding: 6px; }
.dtp-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.dtp-clear { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; font-size: .85rem; }

.tab-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 4px; border-radius: 10px; background: var(--bad); color: #fff; font-size: .72rem; font-weight: 800; }

/* ---- Chat ---- */
.chat { display: flex; flex-direction: column; gap: 10px; }
.chat-log { max-height: 380px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px 2px; }
.msg { max-width: 82%; padding: 9px 12px; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--border); align-self: flex-start; }
.msg.mine { align-self: flex-end; background: rgba(122,167,230,.12); border-color: rgba(122,167,230,.3); }
.msg-meta { display: flex; gap: 10px; justify-content: space-between; font-size: .76rem; color: var(--muted); margin-bottom: 3px; }
.msg-meta strong { color: var(--text-2); }
.msg-body p { margin: 0; }
.msg-body p + p { margin-top: 6px; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; }
.chat-form textarea { flex: 1; min-height: 44px; }
.chat-empty { margin: 4px 0; }
.chat-details summary { cursor: pointer; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.chat-details[open] summary { margin-bottom: 10px; }

/* Beschriftung + Pflicht-Sternchen in einer Zeile, Eingabefeld darunter */
label:not(.check):not(.inline-label):not(.search) { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 4px; }
label:not(.check):not(.inline-label):not(.search) > :is(input, select, textarea, .dd, .dtp, .hint, datalist) { flex: 1 1 100%; }
.mine-tag { font-weight: 700; color: #a9c8f2; }
