/* weiconet-Intranet — Topbar (oben, fix) + Sidebar (links). Struktur wie o4w,
   Skin in weiconet-CI (Lila/Cyan, hell). Sichtbar ab 900px; darunter Topbar +
   Kachel-Navigation. Reine Navigation — Server-RBAC bleibt unberuehrt. */

body.has-wnb { padding-top: 64px; }  /* 4px Streifen + 60px Bar */

/* ── Farbstreifen ganz oben ─────────────────────────────────────────────── */
.wtb-stripe { position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 200;
  background: linear-gradient(90deg, #FF3D5A, #FFB800, #79C4DB, #28006E); }

/* ── Topbar ─────────────────────────────────────────────────────────────── */
/* z-index (130) ueber der Sidebar (110). Aufbau wie EyeNet: Marke sitzt links
   im Sidebar-Streifen (feste 212px, deckt den Sidebar-Kopf), der Rest der Bar
   richtet sich am Content-Bereich rechts der Sidebar aus (gleicher 26px-Rand
   wie .wn-main), damit Topbar und Inhalt buendig sind. */
.wtb { position: fixed; top: 4px; left: 0; right: 0; height: 60px; z-index: 130;
  background: var(--wn-surface); border-bottom: 1px solid var(--wn-border);
  display: flex; align-items: center; padding: 0 26px 0 0; }
.wtb__brand { flex-shrink: 0; width: 212px; height: 100%; display: flex; align-items: center;
  padding-left: 20px; text-decoration: none; font-family: var(--wn-font-head); }
.wtb__brand b { font-size: 19px; font-weight: 800; color: var(--wn-purple); letter-spacing: -.01em; }
.wtb__left { display: flex; align-items: center; gap: 14px; min-width: 0; padding-left: 26px; }
.wtb__hello { font-size: 12px; color: var(--wn-ink-soft); white-space: nowrap; }
.wtb__hello b { color: var(--wn-purple); font-weight: 700; }
/* Center absolut in der Content-Mitte (rechts der Sidebar), damit es exakt
   ueber der Content-Spalte zentriert ist — unabhaengig von den Flex-Nachbarn. */
.wtb__center { position: absolute; left: 212px; right: 26px; text-align: center;
  font-family: var(--wn-font-head); font-size: 12px; font-weight: 800; letter-spacing: .14em;
  text-transform: uppercase; color: var(--wn-cyan-600); white-space: nowrap; pointer-events: none; }
.wtb__right { display: flex; align-items: center; gap: 12px; margin-left: auto; position: relative; z-index: 1; }
.wtb__clock { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; background: none;
  border: 0; cursor: pointer; padding: 2px 4px; font-family: var(--wn-font-head); line-height: 1.1; }
.wtb__date { font-size: 10px; font-weight: 700; color: var(--wn-ink-soft); letter-spacing: .06em; }
.wtb__time { font-size: 11px; font-weight: 800; color: var(--wn-purple); font-variant-numeric: tabular-nums; }
.wtb__clock:hover .wtb__date { color: var(--wn-cyan-600); }
.wtb__back { display: inline-flex; align-items: center; justify-content: center; height: 30px; padding: 0 14px;
  border: 1px solid var(--wn-cyan); border-radius: 6px; color: var(--wn-purple); background: transparent;
  text-decoration: none; font-family: var(--wn-font-head); font-size: 10px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; transition: background .15s, color .15s; }
.wtb__back:hover { background: var(--wn-cyan); color: #fff; }
/* Runder User-Avatar rechts (Initiale; Foto optional per img-Overlay) */
.wtb__ava { position: relative; flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
  overflow: hidden; display: flex; align-items: center; justify-content: center; text-decoration: none;
  font-family: var(--wn-font-head); font-weight: 800; font-size: 12px; color: #fff;
  background: var(--wn-purple); text-transform: uppercase; transition: box-shadow .15s; }
.wtb__ava:hover { box-shadow: 0 0 0 3px rgba(121,196,219,.4); }
.wtb__ava img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Portal-Suche */
.wtb__suche { position: relative; display: flex; align-items: center; gap: 8px; height: 36px;
  width: min(360px, 30vw); padding: 0 12px; background: rgba(40,0,110,.05); border-radius: 8px; }
.wtb__suche svg { width: 14px; height: 14px; color: var(--wn-ink-soft); flex-shrink: 0; }
.wtb__suche input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none;
  font-size: 13px; color: var(--wn-ink); font-family: var(--wn-font-body); }
.wtb-such { position: absolute; top: 42px; left: 0; width: max(100%, 300px); max-height: 400px; overflow-y: auto;
  background: var(--wn-surface); border: 1px solid var(--wn-border); border-radius: 8px;
  box-shadow: var(--wn-shadow); z-index: 150; }
.wtb-such[hidden] { display: none; }
.wtb-such__item { display: block; width: 100%; text-align: left; background: none; border: 0;
  border-bottom: 1px solid var(--wn-border-soft); padding: 9px 12px; cursor: pointer; font-family: inherit; }
.wtb-such__item:last-child { border-bottom: 0; }
.wtb-such__item:hover { background: var(--wn-bg); }
.wtb-such__titel { font-size: 13px; font-weight: 600; color: var(--wn-ink); }
.wtb-such__leer { padding: 14px 12px; font-size: 12px; color: var(--wn-ink-soft); }
@media (max-width: 900px) { .wtb__suche { display: none; } }
@media (max-width: 700px) { .wtb__center, .wtb__hello { display: none; } }

/* Icon-Buttons + Badges (To-do / Nachrichten) */
.wtb__icon { position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 32px; background: transparent; border: 1px solid var(--wn-border); border-radius: 7px;
  cursor: pointer; font-size: 16px; line-height: 1; transition: border-color .15s; }
.wtb__icon:hover { border-color: var(--wn-cyan); }
.wtb-badge { position: absolute; top: -7px; right: -7px; min-width: 17px; height: 17px; padding: 0 4px;
  box-sizing: border-box; border-radius: 9px; background: var(--wn-err); color: #fff; font-family: var(--wn-font-head);
  font-size: 9px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.wtb-badge.accent { background: var(--wn-cyan-600); }
.wtb-badge[hidden] { display: none; }

/* Kalender-Popover */
.wtb-kal { position: fixed; top: 68px; right: max(20px, calc((100% - 1180px) / 2 + 20px)); width: 252px;
  background: var(--wn-surface); border: 1px solid var(--wn-border); border-radius: 10px;
  box-shadow: var(--wn-shadow); padding: 14px; z-index: 150; }
.wtb-kal[hidden] { display: none; }
.wtb-kal__nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.wtb-kal__arrow { background: none; border: 0; cursor: pointer; color: var(--wn-ink-soft); font-size: 16px;
  font-weight: 800; padding: 2px 8px; border-radius: 4px; }
.wtb-kal__arrow:hover { color: var(--wn-purple); background: var(--wn-bg); }
.wtb-kal__titel { background: none; border: 0; cursor: pointer; font-family: var(--wn-font-head); font-size: 11px;
  font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--wn-purple); }
.wtb-kal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.wtb-kal__cell { font-family: var(--wn-font-head); font-size: 11px; text-align: center; padding: 5px 0;
  color: var(--wn-ink); border-radius: 4px; }
.wtb-kal__cell.head { font-size: 9px; font-weight: 700; color: var(--wn-ink-soft); text-transform: uppercase; }
.wtb-kal__cell.today { background: var(--wn-purple); color: #fff; font-weight: 800; }
.wtb-kal__cell.empty { color: transparent; }

/* Nachrichten-Panel */
.wch, .wtd { position: fixed; top: 68px; right: max(20px, calc((100% - 1180px) / 2 + 20px)); width: 340px;
  max-height: calc(100vh - 90px); display: flex; flex-direction: column; background: var(--wn-surface);
  border: 1px solid var(--wn-border); border-radius: 10px; box-shadow: var(--wn-shadow); z-index: 150; overflow: hidden; }
.wch[hidden], .wtd[hidden] { display: none; }
.wch__head, .wtd__head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--wn-border); }
.wch__titel, .wtd__titel { flex: 1; min-width: 0; font-family: var(--wn-font-head); font-size: 11px; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase; color: var(--wn-purple); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wch__back, .wch__x, .wtd__x { background: none; border: 0; cursor: pointer; color: var(--wn-ink-soft); font-size: 15px;
  font-weight: 800; padding: 2px 6px; border-radius: 4px; }
.wch__back:hover, .wch__x:hover, .wtd__x:hover { color: var(--wn-purple); background: var(--wn-bg); }
.wch__neu { background: none; border: 1px solid var(--wn-cyan); color: var(--wn-cyan-600); border-radius: 6px;
  cursor: pointer; font-family: var(--wn-font-head); font-size: 9px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; padding: 4px 8px; }
.wch__neu:hover { background: var(--wn-cyan); color: #fff; }
.wch__body, .wtd__body { flex: 1; overflow-y: auto; padding: 8px; }
.wch__leer, .wtd__leer { padding: 22px 10px; text-align: center; font-size: 12px; color: var(--wn-ink-soft); }
.wch-konv { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0;
  border-bottom: 1px solid var(--wn-border-soft); padding: 9px 6px; cursor: pointer; font-family: inherit; }
.wch-konv:hover { background: var(--wn-bg); }
.wch-konv__main { flex: 1; min-width: 0; }
.wch-konv__name { font-family: var(--wn-font-head); font-size: 12px; font-weight: 700; color: var(--wn-purple); }
.wch-konv__prev { font-size: 11px; color: var(--wn-ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wch-konv__zeit { font-size: 9px; color: var(--wn-ink-soft); white-space: nowrap; }
.wch-konv__n { min-width: 17px; height: 17px; padding: 0 4px; box-sizing: border-box; border-radius: 9px;
  background: var(--wn-err); color: #fff; font-size: 9px; font-weight: 800; display: flex; align-items: center;
  justify-content: center; margin-left: auto; }
.wch-kfilter { width: 100%; box-sizing: border-box; margin-bottom: 6px; padding: 7px 9px; border: 1px solid var(--wn-border);
  border-radius: 6px; font-size: 12px; font-family: inherit; color: var(--wn-ink); }
.wch-kfilter:focus { outline: none; border-color: var(--wn-cyan); }
.wch-msg { max-width: 82%; margin: 5px 0; }
.wch-msg.mir { margin-left: auto; }
.wch-msg__text { padding: 7px 10px; border-radius: 8px; border-bottom-left-radius: 2px; font-size: 12.5px; line-height: 1.45;
  white-space: pre-wrap; word-break: break-word; background: var(--wn-bg); color: var(--wn-ink); }
.wch-msg.mir .wch-msg__text { background: var(--wn-purple); color: #fff; border-radius: 8px; border-bottom-right-radius: 2px; }
.wch-msg__meta { display: flex; align-items: center; gap: 6px; padding: 2px 4px; font-size: 9px; color: var(--wn-ink-soft); }
.wch-msg.mir .wch-msg__meta { justify-content: flex-end; }
.wch-msg__act { background: none; border: 0; cursor: pointer; font-size: 11px; color: var(--wn-ink-soft); padding: 0 2px; }
.wch-msg__act:hover { color: var(--wn-err); }
.wch__send { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--wn-border); }
.wch__send[hidden] { display: none; }
.wch__send textarea { flex: 1; min-width: 0; resize: none; border: 1px solid var(--wn-border); border-radius: 6px;
  padding: 7px 9px; font-size: 12.5px; font-family: inherit; color: var(--wn-ink); }
.wch__send textarea:focus { outline: none; border-color: var(--wn-cyan); }
.wch__senden { align-self: flex-end; height: 30px; padding: 0 14px; border: 0; border-radius: 6px;
  background: var(--wn-purple); color: #fff; cursor: pointer; font-family: var(--wn-font-head); font-size: 10px;
  font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.wch__senden:hover { background: var(--wn-purple-700); }

/* To-do-Panel */
.wtd-item { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-bottom: 1px solid var(--wn-border-soft); }
.wtd-item input[type=checkbox] { width: 16px; height: 16px; flex-shrink: 0; accent-color: var(--wn-purple); cursor: pointer; }
.wtd-item__text { flex: 1; min-width: 0; font-size: 12.5px; color: var(--wn-ink); word-break: break-word; }
.wtd-item__text.done { text-decoration: line-through; color: var(--wn-ink-soft); }
.wtd-item__del { background: none; border: 0; cursor: pointer; font-size: 15px; color: var(--wn-ink-soft); padding: 0 2px; }
.wtd-item__del:hover { color: var(--wn-err); }
.wtd__add { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--wn-border); }
.wtd__add input { flex: 1; min-width: 0; border: 1px solid var(--wn-border); border-radius: 6px; padding: 7px 9px;
  font-size: 12.5px; font-family: inherit; color: var(--wn-ink); }
.wtd__add input:focus { outline: none; border-color: var(--wn-cyan); }
.wtd__addbtn { width: 34px; flex-shrink: 0; border: 0; border-radius: 6px; background: var(--wn-purple); color: #fff;
  font-size: 18px; cursor: pointer; }
.wtd__addbtn:hover { background: var(--wn-purple-700); }

/* ── Sidebar ────────────────────────────────────────────────────────────── */
.wsb { position: fixed; left: 0; top: 64px; bottom: 0; width: 212px; z-index: 110;
  background: var(--wn-surface); border-right: 1px solid var(--wn-border);
  display: none; flex-direction: column; padding: 0 10px 12px; overflow-y: auto;
  font-family: var(--wn-font-body); }
.wsb__label { margin-top: 14px; font-size: 9px; font-weight: 800; letter-spacing: .16em;
  text-transform: uppercase; color: var(--wn-ink-soft); padding: 6px 10px; }
.wsb__nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.wsb__sep { margin: 12px 0 4px; padding: 10px 10px 0; border-top: 1px solid var(--wn-border);
  font-size: 9px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
  color: var(--wn-ink-soft); }
.wsb__item { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 8px;
  color: var(--wn-ink-soft); font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; }
.wsb__item:hover { background: var(--wn-bg); color: var(--wn-purple); }
.wsb__item--on { background: rgba(121,196,219,.16); color: var(--wn-purple); }
.wsb__item svg { width: 16px; height: 16px; flex-shrink: 0; }

.wsb__user { flex-shrink: 0; margin-top: auto; padding: 12px 6px 6px; border-top: 1px solid var(--wn-border);
  display: flex; align-items: center; gap: 9px; cursor: pointer; border-radius: 8px; }
.wsb__user:hover { background: var(--wn-bg); }
.wsb__ava { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 10px; font-weight: 800; background: var(--wn-purple);
  color: #fff; flex-shrink: 0; font-family: var(--wn-font-head); }
.wsb__uname { min-width: 0; flex: 1; }
.wsb__uname b { display: block; font-size: 12px; font-weight: 700; color: var(--wn-purple);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wsb__uname span { display: block; font-size: 10.5px; color: var(--wn-ink-soft); }
.wsb__logout { flex-shrink: 0; margin-top: 8px; height: 36px; border: 1px solid var(--wn-border);
  border-radius: 8px; background: transparent; color: var(--wn-ink-soft); font-size: 11px;
  font-weight: 800; letter-spacing: .06em; text-transform: uppercase; cursor: pointer;
  font-family: var(--wn-font-head); }
.wsb__logout:hover { background: var(--wn-bg); border-color: var(--wn-cyan); color: var(--wn-purple); }

@media (min-width: 900px) {
  .wsb { display: flex; }
  body.has-wnb { padding-left: 212px; }
}
@media (pointer: coarse) { .wsb__item { padding: 13px 10px; } }
