/* Teamfinder im Browser (seit 2.21). Farben und Formen wie das Teamfinder-Programm (UiKit). */
:root {
  --navy: #162B48; --navy2: #223C60; --blue: #2563EB; --blue-dark: #1D4ED8; --blue-soft: #E8F0FE; --blue-light: #60A5FA;
  --bg: #F3F5F9; --card: #FFFFFF; --line: #E3E7EE; --ink: #1F2937; --muted: #6B7280; --zebra: #FAFBFD;
  --ok: #15803D; --ok-bg: #DCFCE7; --warn: #A16207; --warn-bg: #FEF3C7; --bad: #B91C1C; --bad-bg: #FEE2E2;
  --grey: #4B5563; --grey-bg: #EEF0F3; --sky: #0369A1; --sky-bg: #E0F2FE; --over: #7F1D1D;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --side: 236px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.45 var(--font); color: var(--ink); background: var(--bg); overflow-x: hidden; }
h1, h2, h3, p { margin: 0; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
.noscript { padding: 24px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.grow { flex: 1 1 auto; min-width: 0; }
.nowrap { white-space: nowrap; }

/* ---------- Bedienelemente */
button, input, select, textarea { font: inherit; color: inherit; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 7px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; text-align: center; }
.btn:hover { background: #F7F8FA; }
.btn:active { background: var(--grey-bg); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn.ghost { border-color: transparent; background: none; color: var(--blue); }
.btn.ghost:hover { background: var(--grey-bg); }
.btn.danger { border-color: #F5C2C2; color: var(--bad); }
.btn.danger:hover { background: var(--bad-bg); }
.btn.mini { min-height: 30px; padding: 4px 10px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .55; cursor: default; }
input[type=text], input[type=password], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; min-height: 36px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
textarea { min-height: 84px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #9CA3AF; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .16); }
input:disabled, select:disabled, textarea:disabled { background: var(--zebra); color: var(--muted); }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; margin: 0; accent-color: var(--blue); flex: none; }
.check { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; }
.check input { margin-top: 2px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span.lab { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.field .hint { font-size: 12.5px; color: var(--muted); }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px 14px; }
.form .wide { grid-column: 1 / -1; }
.error { color: var(--bad); background: var(--bad-bg); border-radius: 8px; padding: 8px 10px; }

/* ---------- Anmeldung */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(280px, 5fr) 7fr; }
.login-brand { background: var(--navy); color: #fff; padding: 48px 44px; display: flex; flex-direction: column; justify-content: space-between; }
.login-brand .mark { display: flex; align-items: center; gap: 14px; }
.login-brand img { width: 48px; height: 48px; }
.login-brand .name { font-size: 26px; font-weight: 700; line-height: 1.1; }
.login-brand .firm { color: #C7D2E3; font-size: 13px; letter-spacing: .04em; }
.login-brand .claim { font-size: 30px; font-weight: 600; line-height: 1.2; max-width: 15em; }
.login-brand .foot { color: #9FB0C8; font-size: 12.5px; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.login-box { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; }
.login-box h1 { font-size: 22px; }
.login-box .btn { min-height: 42px; }
@media (max-width: 760px) {
  .login { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .login-brand { padding: 22px 20px; gap: 18px; }
  .login-brand .claim { font-size: 20px; }
  .login-brand .foot { display: none; }
  .login-form { align-items: flex-start; }
}

/* ---------- Rahmen: Navigation links, Inhalt rechts */
.shell { min-height: 100vh; }
.side { position: fixed; inset: 0 auto 0 0; width: var(--side); background: var(--navy); color: #C7D2E3; display: flex; flex-direction: column; padding: 18px 14px 14px; overflow-y: auto; z-index: 30; }
.brand { display: flex; align-items: center; gap: 12px; padding: 2px 4px 18px; color: #fff; }
.brand img { width: 34px; height: 34px; }
.brand .name { font-size: 18px; font-weight: 700; line-height: 1.1; }
.brand .firm { font-size: 11px; color: #C7D2E3; letter-spacing: .04em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 14px; border-radius: 10px; color: #C7D2E3; }
.nav a:hover { background: rgba(255, 255, 255, .06); text-decoration: none; }
.nav a.on { background: rgba(255, 255, 255, .13); color: #fff; font-weight: 600; }
.nav a.on::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--blue-light); }
.nav svg { width: 20px; height: 20px; flex: none; }
.nav .sep { height: 1px; background: rgba(255, 255, 255, .12); margin: 10px 6px; }
.side-foot { margin-top: auto; padding-top: 14px; display: flex; flex-direction: column; gap: 4px; }
.side-foot .who { padding: 4px 14px 6px; color: #fff; font-weight: 600; overflow-wrap: anywhere; }
.side-foot .who span { display: block; font-weight: 400; font-size: 12px; color: #9FB0C8; }
.side-foot button { all: unset; cursor: pointer; padding: 8px 14px; border-radius: 10px; color: #C7D2E3; }
.side-foot button:hover { background: rgba(255, 255, 255, .06); }
.side-foot button:focus-visible { outline: 2px solid var(--blue-light); }
.topbar { display: none; }
.main { margin-left: var(--side); padding: 22px 24px 40px; min-width: 0; }
.main-in { max-width: 1320px; display: flex; flex-direction: column; gap: 14px; }
.notes { margin-bottom: 14px; }
.banner { border-radius: 10px; padding: 9px 12px; background: var(--warn-bg); color: var(--warn); }
.banner.bad { background: var(--bad-bg); color: var(--bad); }
.banner.info { background: var(--blue-soft); color: var(--navy); }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.page-head h1 { font-size: 22px; line-height: 1.2; }
.page-head .sub { color: var(--muted); }
.page-head .actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; white-space: nowrap; margin-bottom: 4px; }
.back svg { width: 16px; height: 16px; flex: none; }
.scrim { display: none; }
@media (max-width: 900px) {
  .side { transform: translateX(-100%); transition: transform .18s ease; width: min(280px, 86vw); }
  .shell.open .side { transform: none; }
  .shell.open .scrim { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 25; }
  .topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; background: var(--navy); color: #fff; padding: 8px 12px; }
  .topbar button { all: unset; cursor: pointer; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; }
  .topbar button:focus-visible { outline: 2px solid var(--blue-light); }
  .topbar svg { width: 22px; height: 22px; }
  .topbar .t { font-weight: 700; font-size: 16px; }
  .main { margin-left: 0; padding: 16px 12px 32px; }
}
@media (prefers-reduced-motion: reduce) { .side { transition: none; } }

/* ---------- Karten, Listen, Tabellen */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; min-width: 0; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 10px; }
.card-head h2 { font-size: 16px; }
.card-head .sub { color: var(--muted); font-size: 12.5px; flex-basis: 100%; margin-top: -4px; }
.card-head .actions { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.card-head .actions select, .page-head .actions select { width: auto; max-width: 260px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; align-items: start; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.toolbar > input, .toolbar > select { width: auto; flex: 1 1 180px; max-width: 320px; }
.toolbar .check { align-items: center; }
.toolbar .check input { margin-top: 0; }
.toolbar .count { margin-left: auto; color: var(--muted); font-size: 12.5px; }
.kv { display: grid; grid-template-columns: minmax(110px, 34%) 1fr; gap: 6px 12px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.empty { color: var(--muted); padding: 18px 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--grey-bg); color: var(--grey); white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.blue { background: var(--blue-soft); color: var(--blue-dark); }
.chip.sky { background: var(--sky-bg); color: var(--sky); }
.chip.over { background: var(--over); color: #fff; }
.chip.x { cursor: pointer; border: 0; font-family: inherit; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.offscreen { position: fixed; left: -9999px; top: 0; width: 10px; height: 10px; opacity: 0; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none;
  background: var(--blue-soft); color: var(--blue-dark); }
.avatar.big { width: 56px; height: 56px; font-size: 19px; }
.person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person .n { font-weight: 600; overflow-wrap: anywhere; }
.person .s { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }

table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t th.sort { cursor: pointer; user-select: none; }
table.t th.sort:hover { color: var(--ink); }
table.t td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: break-word; }
table.t td.nowrap, table.t th.nowrap { white-space: nowrap; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr:nth-child(even) { background: var(--zebra); }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover { background: var(--blue-soft); }
table.t td.act { white-space: nowrap; text-align: right; }
table.t td.act .btn + .btn { margin-left: 4px; }
.card { container-type: inline-size; }
@container (max-width: 700px) {
  table.t thead { display: none; }
  table.t, table.t tbody, table.t tr, table.t td { display: block; width: 100%; }
  table.t tr { padding: 8px 2px; border-bottom: 1px solid var(--line); }
  table.t tr:last-child { border-bottom: 0; }
  table.t tbody tr:nth-child(even) { background: none; }
  table.t td { border: 0; padding: 2px 6px; display: grid; grid-template-columns: minmax(96px, 34%) 1fr; gap: 10px; justify-items: start; }
  table.t td::before { content: attr(data-l); color: var(--muted); font-size: 12.5px; }
  table.t td.lead { display: block; font-weight: 600; }
  table.t td.lead::before { content: none; }
  table.t td.act { text-align: left; display: block; padding-top: 6px; white-space: normal; }
  table.t td.act::before { content: none; }
  table.t td.act .btn { margin: 0 6px 4px 0; }
  table.t td.nowrap { white-space: normal; }
  table.t td.none { display: none; }
}

/* ---------- Rechte: Stufe je Bereich */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.seg span { display: block; padding: 6px 12px; font-size: 13px; white-space: nowrap; border-left: 1px solid var(--line); }
.seg label:first-child span { border-left: 0; }
.seg input:checked + span { background: var(--blue); color: #fff; font-weight: 600; }
.seg input:checked + span.none { background: var(--grey-bg); color: var(--grey); }
.seg input:disabled + span { color: #B6BCC6; cursor: default; background: var(--zebra); }
.seg input:checked:disabled + span { background: #A5B4CB; color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: -2px; }
.rights { display: flex; flex-direction: column; }
.right { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.right:last-child { border-bottom: 0; }
.right .n { font-weight: 600; }
.right .d { color: var(--muted); font-size: 12.5px; }
@media (max-width: 620px) { .right { grid-template-columns: 1fr; } }

/* ---------- Auslastung */
.util { display: grid; align-items: stretch; row-gap: 2px; }
.util .h { font-size: 11.5px; color: var(--muted); text-align: center; overflow: hidden; white-space: nowrap; }
.util .mo { font-weight: 700; color: var(--ink); text-align: left; padding-left: 2px; text-overflow: clip; }
.util .nm { padding: 4px 8px 4px 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.util .nm:hover { color: var(--blue); }
.util .cap { color: var(--muted); font-size: 12px; padding: 5px 8px 0 0; text-align: right; white-space: nowrap; }
.util .c { min-height: 26px; border: 0; padding: 0; margin: 0 1px; border-radius: 3px; font-size: 11.5px; line-height: 26px; text-align: center; overflow: hidden; cursor: pointer;
  background: var(--ok-bg); color: var(--ok); font-variant-numeric: tabular-nums; }
.util .c.z0 { background: var(--grey-bg); color: var(--grey); }
.util .c.z2 { background: var(--warn-bg); color: var(--warn); }
.util .c.z3 { background: var(--bad-bg); color: var(--bad); }
.util .c.z4 { background: var(--over); color: #fff; }
.util .c.part { outline: 1px dashed var(--grey); outline-offset: -2px; }
.util .c.now { box-shadow: inset 2px 0 0 var(--blue); }
.util .c.sel { outline: 2px solid var(--blue); outline-offset: -1px; }
.util.tight .c { font-size: 0; margin: 0; border-radius: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ---------- Dialog, Meldung */
dialog { border: 0; border-radius: 14px; padding: 0; width: min(580px, calc(100vw - 20px)); max-height: calc(100vh - 20px); color: var(--ink);
  box-shadow: 0 18px 50px rgba(15, 23, 42, .28); }
dialog.wide { width: min(820px, calc(100vw - 20px)); }
dialog::backdrop { background: rgba(15, 23, 42, .45); }
dialog form { display: flex; flex-direction: column; max-height: calc(100vh - 20px); }
dialog header { padding: 16px 18px 4px; }
dialog header h2 { font-size: 17px; }
dialog header p { color: var(--muted); margin-top: 2px; }
dialog .body { padding: 12px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
dialog footer { padding: 12px 18px 16px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 60;
  max-width: calc(100vw - 24px); box-shadow: 0 8px 24px rgba(15, 23, 42, .25); }
.toast.bad { background: var(--bad); }
.code { font-size: 20px; font-weight: 700; letter-spacing: .06em; font-variant-numeric: tabular-nums; background: var(--blue-soft); color: var(--navy); border-radius: 10px;
  padding: 10px 14px; text-align: center; user-select: all; overflow-wrap: anywhere; }
.codes { width: 100%; border-collapse: collapse; }
.codes td, .codes th { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.codes td.pw { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

@media print {
  body { background: #fff; }
  .side, .topbar, .toast, .no-print, dialog footer { display: none !important; }
  .main { margin: 0; padding: 0; }
  body.print-dialog .shell { display: none; }
  dialog { position: static; box-shadow: none; width: 100%; max-height: none; }
  dialog form, dialog .body { max-height: none; overflow: visible; }
}
