:root {
  --bg: #02040f;
  --panel: #0c1122;
  --panel-2: #1e2638;
  --line: #2a3350;
  --text: #f1f4fa;
  --muted: #8d97b3;
  --olive: #6b7340;
  --olive-hi: #7d8650;
  --gold: #d6b94a;
  --connector: #3a4566;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  background-image: radial-gradient(900px 400px at 50% -100px, rgba(107,115,64,.18), transparent 70%);
  background-repeat: no-repeat;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

/* ---------- Top-Bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(2,4,15,.85); backdrop-filter: blur(10px);
  border-top: 1px solid #3a3f52; border-bottom: 1px solid #12172b;
}
.topbar-inner {
  max-width: 1200px; margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand img { width: 48px; height: 48px; object-fit: contain; }
.userbox { display: flex; align-items: center; gap: 10px; }
.u-avatar { border-radius: 50%; }
.u-name { font-weight: 600; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  background: var(--olive); color: #fff; font-weight: 600; font-size: 15px;
  padding: 10px 18px; border: 0; border-radius: 8px; cursor: pointer; text-decoration: none;
  transition: background .15s, transform .1s;
}
.btn:hover { background: var(--olive-hi); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, .card:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 2px;
}
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); padding: 6px 12px; font-size: 13px; }
.btn-ghost:hover { background: var(--panel-2); color: var(--text); }
.btn-block { width: 100%; margin-top: 18px; }

.flash {
  max-width: 560px; margin: 16px auto 0; padding: 12px 16px; border-radius: 8px;
  font-weight: 600; transition: opacity .4s; border: 1px solid;
}
.flash-ok  { background: rgba(107,115,64,.2); border-color: var(--olive); }
.flash-err { background: rgba(190,60,60,.15); border-color: #b34545; }
.flash.hide { opacity: 0; pointer-events: none; }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 64px 24px 40px; }
.hero img { margin: 0 auto 16px; width: 140px; height: 140px; object-fit: contain; filter: drop-shadow(0 8px 24px rgba(0,0,0,.6)); }
.hero h1 { margin: 0 0 8px; font-size: clamp(32px, 6vw, 52px); letter-spacing: .02em; }
.hero p { color: var(--muted); max-width: 520px; margin: 0 auto 24px; font-size: 17px; }

/* ---------- Sections ---------- */
.section { max-width: 1200px; margin: 0 auto; padding: 40px 24px; }
.section-title {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 0 0 32px; font-size: 20px; font-weight: 600;
}
.section-title svg { color: var(--olive-hi); }

/* ---------- Generalstab-Baum ---------- */
.tree { display: flex; flex-direction: column; align-items: center; }
.unit { display: flex; flex-direction: column; align-items: center; margin-bottom: 14px; }
.unit-logo {
  width: 72px; height: 72px; padding: 8px; border-radius: 14px;
  background: var(--panel-2); border: 1px solid var(--line);
  display: grid; place-items: center;
}
.unit-logo img { width: 100%; height: 100%; object-fit: contain; }
.unit h3 { margin: 10px 0 0; font-size: 21px; font-weight: 700; }

.card {
  width: 190px; padding: 16px 12px 14px; text-align: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.card:hover, .card:focus-visible { transform: translateY(-3px); border-color: var(--olive-hi); box-shadow: 0 10px 24px rgba(0,0,0,.45); }
.avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.name { font-size: 14px; line-height: 1.25; }
.title { font-size: 12px; color: var(--muted); }
.badge {
  font-size: 12px; font-weight: 600; padding: 2px 12px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--line);
}
.badge.r12 { color: var(--gold); border-color: rgba(214,185,74,.5); background: rgba(214,185,74,.1); }
.badge.r11 { color: #b9c47a; border-color: rgba(125,134,80,.6); background: rgba(107,115,64,.15); }

.stem { width: 2px; height: 36px; background: var(--connector); }
.stem.short { height: 26px; }

.branches {
  list-style: none; margin: 0; padding: 0;
  display: flex; justify-content: center; align-items: flex-start; gap: 24px 40px; flex-wrap: wrap;
}
.branch { position: relative; display: flex; flex-direction: column; align-items: center; padding-top: 36px; }
.level { display: flex; gap: 14px; justify-content: center; }

/* Verbindungslinien: senkrecht zu jedem Zweig + waagerechte Schiene */
.branch::before { /* senkrechter Abgang */
  content: ""; position: absolute; top: 0; left: 50%; width: 2px; height: 36px;
  background: var(--connector); transform: translateX(-1px);
}
.branch::after { /* waagerechte Schiene (über Lücken hinweg) */
  content: ""; position: absolute; top: 0; left: -20px; right: -20px; height: 2px; background: var(--connector);
}
.branch:first-child::after { left: 50%; }
.branch:last-child::after  { right: 50%; }
.branch:only-child::after  { display: none; }

/* ---------- Postfach ---------- */
.panel {
  max-width: 600px; margin: 0 auto; padding: 24px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
}
.panel-title { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font-size: 20px; }
.panel-title svg { color: var(--olive-hi); }
.muted { color: var(--muted); margin: 0 0 22px; }
.panel label { display: block; font-weight: 600; margin: 16px 0 8px; font-size: 14px; }
.req { color: var(--text); }

.field { position: relative; }
.field svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.field input[type] { padding-left: 42px; }
input[type=text], input[type=tel], input[type=number], input[type=date], input[type=datetime-local], textarea {
  width: 100%; padding: 11px 14px; font: inherit; color: var(--text);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  color-scheme: dark;   /* dunkle Kalender-/Zahlen-Bedienelemente des Browsers */
}
input[type=date]:focus-visible, input[type=datetime-local]:focus-visible, input[type=number]:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
input::placeholder, textarea::placeholder { color: #6d7794; }
textarea { resize: vertical; min-height: 110px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 40px 24px; border-top: 1px solid #12172b; margin-top: 40px; }

/* ---------- Kommando Zentrale (Sidebar-Layout) ---------- */
.shell { display: flex; min-height: calc(100vh - 66px); }
.sidebar {
  flex: none; width: 232px; padding: 24px 14px; position: sticky; top: 66px; align-self: flex-start;
  height: calc(100vh - 66px); display: flex; flex-direction: column; gap: 6px;
  background: rgba(12,17,34,.6); border-right: 1px solid #12172b;
}
.side-title { flex: none; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 0 12px 10px; }
/* Menü scrollt für sich, damit bei vielen aufgeklappten Dokumenten nichts über den Dienst-Knopf läuft */
.sidebar nav {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 2px;
  scrollbar-width: thin; scrollbar-color: #2a3358 transparent;
}
.sidebar nav::-webkit-scrollbar { width: 6px; }
.sidebar nav::-webkit-scrollbar-thumb { background: #2a3358; border-radius: 999px; }
.sidebar nav > * { flex: none; }
.side-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px;
  color: #c3cadf; text-decoration: none; font-weight: 600; font-size: 14px; border: 1px solid transparent;
}
.side-link:hover { background: var(--panel-2); color: var(--text); }
.side-link.active { background: rgba(107,115,64,.22); border-color: rgba(125,134,80,.5); color: #fff; }
.side-link.active svg { color: var(--olive-hi); }
.side-group { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); padding: 14px 12px 4px; margin-top: 6px; border-top: 1px solid #12172b; }
.side-sub { margin: 0; }
.side-sub-head {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 8px; cursor: pointer; list-style: none;
  color: #c3cadf; font-weight: 600; font-size: 14px; user-select: none;
}
.side-sub-head::-webkit-details-marker { display: none; }
.side-sub-head:hover { background: var(--panel-2); color: var(--text); }
.side-sub-head:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.side-sub-head .chev { flex: none; color: var(--muted); transition: transform .15s; }
.side-sub[open] > .side-sub-head .chev { transform: rotate(90deg); }
.side-count { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; }
.side-sub-items { margin: 2px 0 6px 12px; padding-left: 8px; border-left: 1px solid #1d2540; display: grid; gap: 1px; }
.side-sub-items .side-link { font-weight: 500; font-size: 13.5px; padding: 7px 10px; line-height: 1.3; }
.side-sub-items .side-link svg { display: none; }   /* Dokumente brauchen kein Icon, das wirkt ruhiger */
.side-back { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 9px 12px; margin-bottom: 4px; border-radius: 8px; color: #c3cadf; text-decoration: none; font-weight: 600; font-size: 14px; background: var(--panel-2); border: 1px solid var(--line); }
.side-back:hover { color: #fff; border-color: #43507a; }
.side-back svg { flex: none; color: var(--olive-hi); }
.side-back .muted-s { margin-left: auto; font-weight: 500; font-size: 12px; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-doc-title { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 14px 12px 2px; }
.side-subtitle { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: #8f9ab8; padding: 12px 12px 2px; }
.side-empty { padding: 4px 12px; font-size: 13px; color: #5d6785; font-style: italic; }
.duty-box { margin-top: auto; padding: 14px 12px 0; border-top: 1px solid #12172b; }
.duty-state { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 10px; }
.duty-state .dot { width: 9px; height: 9px; border-radius: 50%; background: #6d7794; }
.duty-state.on { color: #9bd39b; }
.duty-state.on .dot { background: #5fbf6a; box-shadow: 0 0 8px rgba(95,191,106,.8); }
.duty-box .btn-block { margin-top: 0; }
.btn-duty-on { background: #3f7d4a; }
.btn-duty-on:hover { background: #4a925a; }
.btn-duty-off { background: transparent; border: 1px solid #a64040; color: #f0a7a7; }
.btn-duty-off:hover { background: rgba(190,60,60,.2); }
.content { flex: 1; min-width: 0; padding: 40px clamp(20px, 3vw, 44px) 56px; }
.content .flash { margin: 0 auto 20px; max-width: 1050px; }
.cc-main { max-width: 1050px; margin: 0 auto; }
.cc-main.cc-wide { max-width: 1400px; }
@media (max-width: 560px) {   /* erst auf echten Handys wird die Leiste zum Block oben; in schmalen Fenstern bleibt sie seitlich und fest */
  .shell { flex-direction: column; }
  .sidebar { position: static; width: 100%; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px; border-right: 0; border-bottom: 1px solid #12172b; }
  .side-title { display: none; }
  .sidebar nav { overflow: visible; }
  .side-sub-items .side-link svg { display: inline; }
  .side-group, .side-empty { display: none; }
  .side-sub { flex-basis: 100%; }
  .duty-box { margin: 0 0 0 auto; padding: 0; border: 0; display: flex; align-items: center; gap: 12px; }
  .duty-state { margin: 0; }
  .duty-box .btn-block { width: auto; }
  .content { padding: 20px 16px 40px; }
}

/* ---------- Dokumente ---------- */
.doc { max-width: 780px; margin: 0 auto; padding: 36px 44px 28px; background: linear-gradient(180deg, #0f1528, var(--panel)); border: 1px solid var(--line); border-top: 4px solid var(--olive); border-radius: 6px 6px 14px 14px; box-shadow: 0 12px 36px rgba(0,0,0,.35); }
.doc-head { display: flex; align-items: center; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.doc-head img { object-fit: contain; }
.doc-org { font-size: 13px; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.doc-type { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.doc-title { margin: 26px 0 4px; font-size: 30px; letter-spacing: .01em; }
.doc-sub { margin: 0 0 20px; color: var(--muted); font-size: 16px; }
.doc-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 0 0 8px; padding: 14px 16px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; }
.doc-meta dt { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.doc-meta dd { margin: 2px 0 0; font-weight: 600; font-size: 14px; }
.vis { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); }
.vis::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.vis-all { color: #9bd39b; border-color: rgba(100,180,100,.5); background: rgba(100,180,100,.1); }
.vis-restricted { color: var(--gold); border-color: rgba(214,185,74,.5); background: rgba(214,185,74,.1); }
.rank-group { margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: rgba(30,38,56,.35); }
.rank-group-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; padding: 10px 14px; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.doc-table { width: 100%; border-collapse: collapse; }
.doc-table td { padding: 9px 14px; border-bottom: 1px solid #151b30; color: #d3d9ea; }
.doc-table tr:last-child td { border-bottom: 0; }
.doc-table .dt-rank { width: 110px; }
.doc-table .dt-code { width: 120px; font-weight: 700; white-space: nowrap; color: var(--olive-hi); }
.doc-link { color: #b9c47a; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(185,196,122,.5); }
.doc-link:hover { color: #d6e08f; text-decoration-color: currentColor; }
.doc-related-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.doc-related-list li { padding: 9px 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; }
.doc-sec { margin-top: 28px; }
.doc-sec h2 { display: flex; align-items: baseline; gap: 10px; margin: 0 0 10px; font-size: 18px; }
.doc-no { color: var(--olive-hi); font-size: 14px; font-weight: 700; letter-spacing: .04em; }
.doc-sec p { margin: 0 0 10px; color: #d3d9ea; line-height: 1.65; }
.doc-list { margin: 0; padding-left: 22px; color: #d3d9ea; line-height: 1.65; display: grid; gap: 8px; }
.doc-list li::marker { color: var(--olive-hi); font-weight: 700; }
.doc-example { margin-top: 14px; padding: 12px 14px; border: 1px dashed #43507a; border-radius: 10px; background: rgba(30,38,56,.5); }
.doc-example-label { display: block; margin-bottom: 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.doc-example-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.doc-foot { margin-top: 34px; padding-top: 14px; border-top: 1px solid var(--line); text-align: center; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #5d6785; }
@media (max-width: 760px) { .doc { padding: 24px 20px 20px; } .doc-title { font-size: 24px; } }

/* ---------- Leitstelle ---------- */
.badge.r9, .badge.r8, .badge.r7 { color: #a9c0e0; }
.table .num { width: 56px; text-align: center; color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.me-row { background: rgba(107,115,64,.08); }
.copy {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font: inherit; color: var(--text);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px;
  transition: background .15s, border-color .15s;
}
.copy:hover { border-color: var(--olive-hi); }
.copy.copied { background: rgba(107,115,64,.3); border-color: var(--olive-hi); }
.copy.copied::after { content: "Kopiert"; font-size: 12px; color: #b9c47a; }
.patrol-chip { display: inline-block; font-weight: 700; font-size: 13px; padding: 2px 10px; border-radius: 6px; background: rgba(214,185,74,.1); border: 1px solid rgba(214,185,74,.4); color: var(--gold); }
.status { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; }
.status.s-verfuegbar { color: #9bd39b; border-color: rgba(100,180,100,.5); background: rgba(100,180,100,.1); }
.status.s-einsatz { color: #f0b36b; border-color: rgba(230,150,60,.5); background: rgba(230,150,60,.1); }
.status.s-pause { color: #a9c0e0; border-color: rgba(120,150,200,.5); background: rgba(120,150,200,.1); }
.status.s-nicht_verfuegbar { color: #f0a7a7; border-color: rgba(190,60,60,.5); background: rgba(190,60,60,.1); }
.view-switch { display: inline-flex; padding: 4px; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.view-switch a { padding: 7px 14px; border-radius: 7px; font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; }
.view-switch a:hover { color: var(--text); }
.view-switch a.active { background: rgba(107,115,64,.3); color: #fff; box-shadow: inset 0 0 0 1px rgba(125,134,80,.6); }
/* Streifen-Ansicht */
.ps-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 20px; }
.ps-total { color: var(--muted); font-size: 14px; margin-right: 6px; }
.ps-total strong { color: var(--text); }
.patrol-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 20px; align-items: start; }
.patrol-box {
  --accent: var(--line);
  position: relative; overflow: hidden; padding: 18px 18px 16px;
  background: linear-gradient(180deg, #0f1528, var(--panel)); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.patrol-box::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--accent); }
.patrol-box.st-verfuegbar { --accent: #5fbf6a; }
.patrol-box.st-einsatz { --accent: #e6963c; }
.patrol-box.st-pause { --accent: #7896c8; }
.patrol-box.st-nicht_verfuegbar { --accent: #be3c3c; }
.patrol-box.mine { border-color: rgba(125,134,80,.7); box-shadow: 0 0 0 1px rgba(125,134,80,.35), 0 8px 24px rgba(0,0,0,.25); }
.patrol-box.none { --accent: transparent; border-style: dashed; background: transparent; box-shadow: none; }
.pb-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.pb-icon { flex: none; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); color: var(--accent, var(--muted)); }
.pb-title { flex: 1; min-width: 0; }
.pb-id { font-size: 18px; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.plate { display: inline-block; margin-top: 3px; padding: 1px 10px; border-radius: 5px; background: #e8ebf2; color: #11151f; border: 2px solid #8b93a8; font: 700 12px ui-monospace, Consolas, monospace; letter-spacing: .08em; }
.pb-count { flex: none; font-size: 12px; color: var(--muted); }
.pb-status { margin-bottom: 14px; }
.status-lg { font-size: 13px; padding: 5px 14px; }
.seg { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.seg-btn { font: inherit; font-size: 12.5px; font-weight: 600; padding: 7px 8px; border-radius: 8px; cursor: pointer; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); transition: background .15s, color .15s, border-color .15s; }
.seg-btn:hover { color: var(--text); border-color: #43507a; }
.seg-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.seg-btn.on.s-verfuegbar { color: #9bd39b; border-color: rgba(100,180,100,.7); background: rgba(100,180,100,.16); }
.seg-btn.on.s-einsatz { color: #f0b36b; border-color: rgba(230,150,60,.7); background: rgba(230,150,60,.16); }
.seg-btn.on.s-pause { color: #a9c0e0; border-color: rgba(120,150,200,.7); background: rgba(120,150,200,.16); }
.seg-btn.on.s-nicht_verfuegbar { color: #f0a7a7; border-color: rgba(190,60,60,.7); background: rgba(190,60,60,.16); }
.crew { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.crew-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: rgba(30,38,56,.7); border: 1px solid var(--line); border-radius: 10px; }
.crew-row.me-row { background: rgba(107,115,64,.16); border-color: rgba(125,134,80,.5); }
.crew-nr { flex: none; min-width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.crew-id { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.crew-name { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.crew-rank { font-size: 12px; color: var(--muted); }
.crew-row { flex-wrap: wrap; }
.crew-row .cell-select { max-width: 100%; }
.crew-id { min-width: 90px; }
.crew-actions { flex-basis: 100%; display: flex; gap: 8px; align-items: center; padding-left: 74px; }
.copy-sm { padding: 5px 7px; }
.copy-sm.copied::after { content: none; }
.copy-sm.copied { color: #b9c47a; }
.pb-foot { margin-top: 12px; text-align: right; }
.pb-foot .link-btn { padding: 0; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.cell-input, .cell-select {
  font: inherit; font-size: 13px; color: var(--text); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px;
}
.cell-input { width: 150px; font-family: ui-monospace, Consolas, monospace; }
.cell-select { cursor: pointer; width: auto; font-weight: 600; }
.cell-input:focus-visible, .cell-select:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.link-btn { background: none; border: 0; color: var(--muted); font: inherit; font-size: 12px; text-decoration: underline; cursor: pointer; padding: 0 0 0 6px; }
.link-btn:hover { color: #f0a7a7; }
.dialog {
  width: min(560px, calc(100vw - 32px)); padding: 24px; color: var(--text);
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
}
.dialog::backdrop { background: rgba(2,4,15,.75); backdrop-filter: blur(3px); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.dialog-head .login-close { position: static; }
.sub-title { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 22px 0 10px; }
.patrol-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.patrol-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; }

/* ---------- Abteilungen ---------- */
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 20px; }
.dept-fieldset { margin: 22px 0 0; padding: 14px 16px 18px; border: 1px solid var(--line); border-radius: 12px; }
.dept-fieldset legend { padding: 0 8px; font-weight: 700; font-size: 14px; }
.dept-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.dept-chip { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); color: #c3cadf; white-space: nowrap; }
.dept-chip.dc-leitung { color: var(--gold); border-color: rgba(214,185,74,.5); background: rgba(214,185,74,.1); }
.dept-chip.dc-stv { color: #b9c47a; border-color: rgba(125,134,80,.6); background: rgba(107,115,64,.15); }
.dept-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; align-items: start; }
.dept-card { background: linear-gradient(180deg, #0f1528, var(--panel)); border: 1px solid var(--line); border-top: 4px solid var(--olive); border-radius: 14px; padding: 18px; box-shadow: 0 8px 24px rgba(0,0,0,.25); scroll-margin-top: 90px; }
.dept-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.dept-head h2 { margin: 0; font-size: 18px; line-height: 1.25; min-width: 0; overflow-wrap: anywhere; }
.dept-head .muted-s { flex: none; white-space: nowrap; }   /* "X Personen" nie umbrechen */
.dept-group { margin-top: 14px; }
.dept-group h3 { margin: 0 0 6px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.dept-people { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.dp { display: flex; align-items: center; gap: 10px; padding: 7px 10px; background: rgba(30,38,56,.7); border: 1px solid var(--line); border-radius: 10px; }
.dp.me-row { background: rgba(107,115,64,.16); border-color: rgba(125,134,80,.5); }
.dp .dept-chip { margin-left: auto; flex: none; }
.dp-actions { margin-left: auto; display: flex; gap: 4px; flex: none; }
.icon-btn { width: 30px; height: 30px; display: grid; place-items: center; padding: 0; cursor: pointer; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); transition: background .15s, color .15s, border-color .15s; }
.icon-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.icon-btn.ib-up:hover   { color: #9bd39b; border-color: rgba(100,180,100,.7); background: rgba(100,180,100,.14); }
.icon-btn.ib-down:hover { color: #f0b36b; border-color: rgba(230,150,60,.7);  background: rgba(230,150,60,.14); }
.icon-btn.ib-x:hover    { color: #f0a7a7; border-color: rgba(190,60,60,.7);   background: rgba(190,60,60,.16); }
.btn-xs { padding: 3px 10px; font-size: 12px; }
.dp-id { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.dp-name { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.dp-rank { font-size: 12px; color: var(--muted); }
.dept-empty { padding: 7px 10px; font-size: 13px; font-style: italic; color: #5d6785; border: 1px dashed var(--line); border-radius: 10px; }
.dept-add { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.dept-add label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 8px; }
.dept-add-row { display: flex; gap: 8px; }
.dept-add-row select { flex: 1; min-width: 0; }
.dept-add-row .btn { flex: none; }
@media (max-width: 760px) { .grid3 { grid-template-columns: 1fr; } }

/* ---------- Sanktionen ---------- */
.sanc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 18px; align-items: start; }
.sanc { padding: 16px 18px; background: linear-gradient(180deg, #0f1528, var(--panel)); border: 1px solid var(--line); border-top: 4px solid var(--gold); border-radius: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.sanc-dienstsperre { border-top-color: #be3c3c; }
.sanc-revoked { opacity: .7; border-top-color: var(--line); }
.sanc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.sanc-who { display: flex; align-items: center; gap: 10px; }
.sanc-who > span { display: flex; flex-direction: column; line-height: 1.25; }
.sanc-name { font-weight: 700; font-size: 15px; }
.sanc-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.sanc-detail { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 12px 0 0; font-size: 16px; }
.sanc-reason { margin: 8px 0 0; padding: 10px 12px; background: rgba(30,38,56,.55); border: 1px solid var(--line); border-radius: 10px; line-height: 1.55; font-size: 14px; overflow-wrap: anywhere; }
.sanc-foot { margin: 8px 0 0; }
.sanc-revoke > summary { list-style: none; cursor: pointer; display: inline-block; }
.sanc-revoke > summary::-webkit-details-marker { display: none; }
.sanc-revoke[open] { flex-basis: 100%; }
.sanc-revoke .edu-add { margin-top: 8px; }
.sanc-list .edu-notice { margin-top: 10px; }
@media (max-width: 760px) { .sanc-list { grid-template-columns: 1fr; } }

/* ---------- Profil ---------- */
.u-link { text-decoration: none; color: var(--text); }
.u-link:hover { text-decoration: underline; }
.name-link { color: inherit; text-decoration: none; }
.name-link:hover { text-decoration: underline; }
.prof-hero { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; padding: 24px; background: linear-gradient(180deg, #0f1528, var(--panel)); border: 1px solid var(--line); border-top: 4px solid var(--olive); border-radius: 16px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.prof-avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 2px solid var(--line); background: var(--panel-2); flex: none; }
.prof-id { flex: 1; min-width: 220px; }
.prof-name { margin: 0 0 8px; font-size: 28px; line-height: 1.15; overflow-wrap: anywhere; }
.prof-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.prof-rank { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; }
.prof-banner { margin-bottom: 16px; padding: 10px 14px; border-radius: 10px; color: #f0b36b; background: rgba(230,150,60,.1); border: 1px solid rgba(230,150,60,.4); font-weight: 600; }
.prof-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; margin-top: 20px; align-items: start; }
.prof-card { padding: 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.prof-card h2 { margin: 0 0 14px; font-size: 17px; }
.prof-dl { display: grid; grid-template-columns: 150px 1fr; gap: 0; margin: 0; }
.prof-dl dt, .prof-dl dd { padding: 10px 0; border-bottom: 1px solid #151b30; }
.prof-dl dt { color: var(--muted); font-size: 13px; }
.prof-dl dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.prof-dl dt:last-of-type, .prof-dl dd:last-of-type { border-bottom: 0; }
.prof-sub { display: block; font-weight: 400; font-size: 12.5px; color: var(--muted); }
.prof-dept { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 12px; margin-bottom: 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; font-weight: 600; font-size: 14px; }
.prof-more { margin-top: 14px; }
@media (max-width: 900px) { .prof-grid { grid-template-columns: 1fr; } .prof-dl { grid-template-columns: 120px 1fr; } }

/* ---------- Ausbildung ---------- */
.edu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 20px; align-items: start; }
.edu-card { padding: 18px; background: linear-gradient(180deg, #0f1528, var(--panel)); border: 1px solid var(--line); border-top: 4px solid #7896c8; border-radius: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.edu-card.edu-abgeschlossen { border-top-color: #5fbf6a; }
.edu-card.edu-abgesagt, .edu-card.edu-abgelehnt { border-top-color: #be3c3c; opacity: .85; }
.edu-card.edu-ausstehend { border-top-color: var(--gold); }
.edu-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.edu-title { margin: 0 0 8px; font-size: 18px; line-height: 1.25; overflow-wrap: anywhere; }
.edu-when { font-size: 13px; color: var(--muted); white-space: nowrap; }
.edu-sec { margin: 0 0 12px; font-size: 17px; }
.edu-meta { margin: 10px 0 0; font-size: 13.5px; color: #c3cadf; }
.edu-desc { margin: 10px 0 0; color: #d3d9ea; line-height: 1.55; font-size: 14px; }
.edu-chip { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 1px 10px; margin-right: 6px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); color: #c3cadf; }
.edu-chip.s-geplant { color: #a9c0e0; border-color: rgba(120,150,200,.5); background: rgba(120,150,200,.1); }
.edu-chip.s-abgeschlossen { color: #9bd39b; border-color: rgba(100,180,100,.5); background: rgba(100,180,100,.1); }
.edu-chip.s-abgesagt, .edu-chip.ap-abgelehnt { color: #f0a7a7; border-color: rgba(190,60,60,.5); background: rgba(190,60,60,.1); }
.edu-chip.ap-ausstehend { color: var(--gold); border-color: rgba(214,185,74,.5); background: rgba(214,185,74,.1); }
.edu-chip.link { color: #e6a1d1; border-color: rgba(200,120,180,.5); background: rgba(200,120,180,.08); }
.edu-notice { margin: 12px 0 0; padding: 10px 12px; font-size: 13px; line-height: 1.5; color: var(--gold); background: rgba(214,185,74,.08); border: 1px solid rgba(214,185,74,.35); border-radius: 10px; }
.edu-notice-err { color: #f0a7a7; background: rgba(190,60,60,.1); border-color: rgba(190,60,60,.4); }
.edu-me { margin-top: 10px; font-size: 13px; color: #b9c47a; }
.edu-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.edu-actions .spacer { flex: 1; }
.edu-manage { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(30,38,56,.35); }
.edu-manage summary { cursor: pointer; padding: 9px 12px; font-weight: 600; font-size: 14px; list-style: none; }
.edu-manage summary::-webkit-details-marker { display: none; }
.edu-manage summary::before { content: "▸ "; color: var(--muted); }
.edu-manage[open] summary::before { content: "▾ "; }
.edu-manage > :not(summary) { margin-left: 12px; margin-right: 12px; }
.edu-manage > :last-child { margin-bottom: 12px; }
.edu-parts, .edu-list { list-style: none; margin: 6px 12px 10px; padding: 0; display: grid; gap: 6px; }
.edu-parts li { display: flex; align-items: center; gap: 10px; padding: 6px 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; flex-wrap: wrap; }
.edu-pname { flex: 1; min-width: 120px; font-size: 14px; font-weight: 600; }
.edu-pname .muted-s { font-weight: 400; display: block; }
.att { display: inline-flex; gap: 3px; }
.btn.att-btn { padding: 2px 9px; font-size: 13px; background: transparent; border: 1px solid var(--line); color: var(--muted); }
.btn.att-btn.on-anwesend { color: #9bd39b; border-color: rgba(100,180,100,.7); background: rgba(100,180,100,.16); }
.btn.att-btn.on-abwesend { color: #f0a7a7; border-color: rgba(190,60,60,.7); background: rgba(190,60,60,.16); }
.btn.att-btn.on-offen { color: var(--text); background: var(--panel); }
.btn.icon-x { padding: 3px 7px; background: transparent; border: 1px solid var(--line); color: var(--muted); }
.btn.icon-x:hover { color: #f0a7a7; border-color: rgba(190,60,60,.7); }
.edu-add { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.edu-add select, .edu-add input[type=text] { flex: 1; min-width: 130px; width: auto; padding: 7px 10px; font-size: 13px; }
.edu-signup { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; padding: 10px 12px; background: rgba(107,115,64,.1); border: 1px solid rgba(125,134,80,.4); border-radius: 10px; }
.edu-signed { font-size: 13.5px; font-weight: 600; color: #b9c47a; flex: 1; min-width: 180px; }
.edu-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.edu-tile { padding: 16px; text-align: center; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.edu-tile strong { display: block; font-size: 30px; line-height: 1.1; color: var(--text); }
.edu-tile span { font-size: 12.5px; color: var(--muted); }
.edu-two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.edu-list { margin: 0; }
.edu-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; }
@media (max-width: 900px) { .edu-two { grid-template-columns: 1fr; } .edu-grid { grid-template-columns: 1fr; } }

.readonly-field { padding: 11px 14px; font-weight: 600; background: rgba(30,38,56,.45); border: 1px dashed var(--line); border-radius: 8px; color: #c3cadf; }
.left-chip { display: inline-block; margin-top: 3px; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; color: #f0b36b; background: rgba(230,150,60,.12); border: 1px solid rgba(230,150,60,.45); }
.bot-chip { font-size: 12px; font-weight: 700; padding: 1px 10px; border-radius: 999px; border: 1px solid var(--line); }
.bot-chip.bot-on { color: #9bd39b; border-color: rgba(100,180,100,.5); background: rgba(100,180,100,.1); }
.bot-chip.bot-off { color: #f0b36b; border-color: rgba(230,150,60,.5); background: rgba(230,150,60,.1); }

/* ---------- Postfach, Protokoll, Archiv ---------- */
.side-badge { margin-left: auto; min-width: 20px; padding: 0 6px; text-align: center; font-size: 11px; font-weight: 700; line-height: 18px; color: #1a1d10; background: var(--gold); border-radius: 999px; }
.msg-list { display: grid; gap: 14px; }
.msg { padding: 16px 18px; background: linear-gradient(180deg, #0f1528, var(--panel)); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 12px; }
.msg-neu { border-left-color: var(--gold); }
.msg-gelesen { border-left-color: #7896c8; }
.msg-erledigt { border-left-color: #5fbf6a; opacity: .8; }
.msg-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.msg-name { font-size: 16px; margin-right: 8px; }
.msg-state { font-size: 11px; font-weight: 700; padding: 1px 9px; border-radius: 999px; border: 1px solid var(--line); }
.msg-state.st-neu { color: var(--gold); border-color: rgba(214,185,74,.5); background: rgba(214,185,74,.1); }
.msg-state.st-gelesen { color: #a9c0e0; border-color: rgba(120,150,200,.5); background: rgba(120,150,200,.1); }
.msg-state.st-erledigt { color: #9bd39b; border-color: rgba(100,180,100,.5); background: rgba(100,180,100,.1); }
.msg-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 10px 0 4px; }
.msg-text { margin: 10px 0 14px; line-height: 1.6; color: #d3d9ea; overflow-wrap: anywhere; }
.msg-actions { display: flex; flex-wrap: wrap; gap: 8px; }
/* Postfach: Karte mit Absender-Kreis, Relativzeit und klaren Aktionen */
.msg-list { max-width: 900px; }
.msg { display: flex; gap: 14px; padding: 16px 18px; }
.msg-avatar { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; font-weight: 800; font-size: 17px; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); }
.msg-neu .msg-avatar { color: var(--gold); border-color: rgba(214,185,74,.6); background: rgba(214,185,74,.1); }
.msg-erledigt .msg-avatar { color: #9bd39b; border-color: rgba(100,180,100,.5); background: rgba(100,180,100,.08); }
.msg-body { flex: 1; min-width: 0; }
.msg-who { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.msg-name { font-size: 16px; margin: 0; }
.msg-time { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.msg-meta { margin: 8px 0 0; }
.sender-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; color: #b9c47a; border: 1px solid rgba(125,134,80,.6); background: rgba(107,115,64,.15); }
.sender-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.msg-text { margin: 12px 0 14px; padding: 12px 14px; background: rgba(30,38,56,.55); border: 1px solid var(--line); border-radius: 10px; white-space: pre-wrap; line-height: 1.6; }
.msg-actions { align-items: center; }
.msg-actions .spacer { flex: 1; }
.btn-ok { background: #3f7d4a; }
.btn-ok:hover { background: #4a925a; }
@media (max-width: 560px) { .msg { padding: 14px; gap: 10px; } .msg-avatar { width: 34px; height: 34px; font-size: 15px; } }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 50; padding: 12px 18px; border-radius: 12px; font-weight: 600; text-decoration: none; color: var(--text); background: var(--panel); border: 1px solid rgba(214,185,74,.6); box-shadow: 0 12px 32px rgba(0,0,0,.5); opacity: 0; transform: translateY(12px); transition: opacity .3s, transform .3s; }
.toast.show { opacity: 1; transform: none; }
.toast::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 10px; border-radius: 50%; background: var(--gold); }
.table-audit td { vertical-align: top; }
.table-audit .nowrap { white-space: nowrap; }
.audit-details { font-size: 13px; color: #c3cadf; line-height: 1.5; min-width: 220px; }
.audit-act { font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); }
.audit-act.aa-member { color: #b9c47a; border-color: rgba(125,134,80,.6); background: rgba(107,115,64,.15); }
.audit-act.aa-dept { color: #a9c0e0; border-color: rgba(120,150,200,.5); background: rgba(120,150,200,.1); }
.audit-act.aa-edu { color: #e6a1d1; border-color: rgba(200,120,180,.5); background: rgba(200,120,180,.1); }
.audit-act.aa-sanction { color: #f0a7a7; border-color: rgba(190,60,60,.5); background: rgba(190,60,60,.1); }
.audit-act.aa-discord { color: #a9b4ff; border-color: rgba(114,137,218,.55); background: rgba(114,137,218,.12); }
.audit-act.aa-inbox { color: var(--gold); border-color: rgba(214,185,74,.5); background: rgba(214,185,74,.1); }
.pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 18px; }
.row-archived td { opacity: .75; }
.archive-link { font-size: 13px; color: var(--muted); }
.archive-link a { color: #c3cadf; }

/* ---------- Mitgliederverwaltung ---------- */
.section.wide { max-width: 1100px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-title { margin: 0 0 4px; font-size: 28px; }
.panel-wide { max-width: none; margin: 0 0 28px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.grid2 .span2 { grid-column: 1 / -1; }
.hint { color: var(--muted); font-weight: 400; font-size: 12px; }
select {
  width: 100%; padding: 11px 14px; font: inherit; color: var(--text);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
}
input[type=search] {
  flex: 1; min-width: 200px; padding: 10px 14px; font: inherit; color: var(--text);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
}
select:focus-visible, input[type=search]:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.form-actions { display: flex; gap: 10px; margin-top: 22px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.filters select { width: auto; min-width: 190px; }
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 16px; border-bottom: 1px solid #151b30; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: rgba(255,255,255,.02); }
.table .badge { white-space: nowrap; display: inline-block; }
/* Mitgliederliste: kompakter, damit auch lange Rangnamen nicht umbrechen */
.table-members th, .table-members td { padding: 9px 8px; white-space: nowrap; }
.table-members th { font-size: 11px; letter-spacing: .03em; }
.table-members th:first-child, .table-members td:first-child { padding-left: 16px; }
.table-members th:last-child, .table-members td:last-child { padding-right: 16px; }
.table-members td.name-cell { white-space: nowrap; }
.table-members .mono { font-size: 12px; }
.table-members .cell-name { width: max-content; flex-wrap: nowrap; }
.cn-text { display: flex; flex-direction: column; line-height: 1.25; }
.cn-line { display: flex; align-items: center; gap: 8px; }
.cn-id { font: 11.5px ui-monospace, Consolas, monospace; color: var(--muted); font-weight: 400; }
.table-members .actions .btn { padding: 4px 9px; font-size: 12px; }
.table-members th:last-child, .table-members td.actions { position: sticky; right: 0; background: var(--panel); box-shadow: -8px 0 8px -8px rgba(0,0,0,.6); }
.table-members tbody tr:hover td.actions { background: #0f1426; }
.rank-cell { display: flex; flex-direction: row; align-items: center; gap: 8px; white-space: nowrap; }
.rank-name { font-size: 13px; color: #c3cadf; }
.cell-name { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.avatar.sm { width: 32px; height: 32px; }
.you { font-size: 11px; background: rgba(107,115,64,.3); border: 1px solid var(--olive); border-radius: 999px; padding: 0 8px; font-weight: 600; }
.muted-s { color: var(--muted); font-size: 13px; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.actions { white-space: nowrap; text-align: right; }
.actions .btn { padding: 6px 12px; font-size: 13px; }
.inline { display: inline; }
.btn-danger { background: transparent; border: 1px solid #a64040; color: #f0a7a7; }
.btn-danger:hover { background: rgba(190,60,60,.2); }
@media (max-width: 760px) {
  .grid2 { grid-template-columns: 1fr; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .table td { border: 0; padding: 4px 16px; }
  .table td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: 12px; }
  .actions { text-align: left; padding-top: 8px; }
  .table-members td { white-space: normal; padding: 4px 16px; }
  .rank-cell { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; vertical-align: middle; }
}

/* ---------- Login ---------- */
.login-page {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(700px 500px at 50% 30%, rgba(107,115,64,.22), transparent 70%), var(--bg);
}
.login-card {
  position: relative; width: 100%; max-width: 440px; padding: 36px 32px 28px; text-align: center;
  background: linear-gradient(180deg, #0e1428, #080c1b); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0,0,0,.6);
}
.login-close {
  position: absolute; top: 10px; right: 14px; font-size: 26px; line-height: 1;
  color: var(--muted); text-decoration: none; padding: 4px 8px; border-radius: 6px;
}
.login-close:hover { color: var(--text); background: var(--panel-2); }
.login-logo { margin: 0 auto 14px; width: 120px; height: 120px; object-fit: contain; }
.login-card h1 { margin: 0; font-size: 28px; }
.login-sub { margin: 4px 0 0; color: var(--muted); }
.login-card hr { border: 0; height: 1px; margin: 24px 0; background: linear-gradient(90deg, transparent, var(--line), transparent); }
.btn-discord { background: #5865f2; padding: 13px 18px; margin-top: 0; }
.btn-discord:hover { background: #6d79f5; }
.alert {
  display: flex; gap: 12px; align-items: flex-start; text-align: left;
  margin-bottom: 18px; padding: 14px 16px; border-radius: 10px; font-weight: 600; font-size: 14px;
  background: rgba(190,60,60,.14); border: 1px solid #a64040; color: #f3b9b9;
}
.alert svg { flex: none; margin-top: 1px; }
.login-foot.login-made { margin: 22px 0 -14px; }
.made { margin-bottom: 4px; }
.login-foot { margin: 22px 0 0; font-size: 12px; color: var(--muted); }

/* ---------- Mobil ---------- */
@media (max-width: 760px) {
  .topbar-inner { padding: 10px 16px; }
  .u-name { display: none; }
  .section { padding: 32px 16px; }
  .branches { flex-direction: column; align-items: center; gap: 36px; }
  /* Auf dem Handy: keine Schiene, jeder Zweig hängt am Stamm */
  .branch::after { display: none; }
  .branch { padding-top: 0; }
  .branch::before { display: none; }
  .branches .branch + .branch { border-top: 1px solid var(--line); padding-top: 32px; width: 100%; }
  .level { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* Leitstelle: Funktionen und Einsätze */
.fn-chip { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 10px; margin: 0 4px 4px 0; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); color: #c3cadf; white-space: nowrap; }
.fn-chip.fn-leitstelle { color: #8fc9e8; border-color: rgba(90,160,210,.55); background: rgba(90,160,210,.12); }
.fn-chip.fn-sg_leitung { color: var(--gold); border-color: rgba(214,185,74,.55); background: rgba(214,185,74,.12); }
.fn-chip.fn-einsatzleitung { color: #f0b36b; border-color: rgba(230,150,60,.6); background: rgba(230,150,60,.13); }
.fn-chip.fn-staatsgefaengnis { color: #c7a6e6; border-color: rgba(160,120,200,.55); background: rgba(160,120,200,.12); }
.fn-chip.fn-op { color: #f0a7a7; border-color: rgba(190,60,60,.55); background: rgba(190,60,60,.12); }
.crew-fn { display: block; margin-top: 4px; }
.op-banner { margin: 0 0 16px; padding: 16px 18px; border: 1px solid rgba(190,60,60,.55); background: linear-gradient(180deg, rgba(190,60,60,.14), rgba(190,60,60,.06)); border-radius: 12px; }
.op-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.op-title { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; color: #fff; }
.op-live { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #f0a7a7; border: 1px solid rgba(190,60,60,.6); border-radius: 999px; padding: 1px 9px; }
.op-dot { width: 10px; height: 10px; border-radius: 50%; background: #e05555; box-shadow: 0 0 0 0 rgba(224,85,85,.7); animation: op-pulse 1.8s infinite; }
@keyframes op-pulse { 70% { box-shadow: 0 0 0 9px rgba(224,85,85,0); } 100% { box-shadow: 0 0 0 0 rgba(224,85,85,0); } }
.op-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.op-people { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.op-call { margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.op-lead { margin-top: 8px; font-size: 14px; }
.dept-chip.dc-lead { color: #f0b36b; border-color: rgba(230,150,60,.65); background: rgba(230,150,60,.14); font-weight: 700; }

/* Hinweis auf den Hoster unter dem Copyright */
.host { margin-top: 8px; font-size: 12px; color: var(--muted); }
.login-foot.host { margin-top: 6px; }
.host-ad { color: var(--gold); text-decoration: none; font-weight: 600; }
.host-ad:hover { text-decoration: underline; }
