/* Zentrales Seiten-Layout des Portals (Projektleiste links, Menü rechts, Hauptbereich).
   Wird von portal_head() auf JEDER Seite geladen. Was eine Seite zusätzlich braucht,
   liegt in ihrem eigenen Stylesheet (Layout-Parameter 'css'). */

/* Startseite: linke Projektleiste + Kacheln */
div.pj-home { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: calc(100vh - 60px); }
.pj-side { border-right: 1px solid #2a2a2a; padding: 16px 14px; background: #141414; }
.pj-side-title { font-weight: 700; font-size: 1.05rem; margin: 0 0 10px; }
.pj-grp { margin-bottom: 14px; }
.pj-grp-h { font-weight: 700; font-size: .95rem; margin: 6px 0; }
.pj-sub-h { font-size: .85rem; opacity: .7; margin: 8px 0 2px 8px; }
.pj-side-link { display: block; padding: 6px 10px; border-radius: 8px; color: inherit; text-decoration: none; font-size: .9rem; }
.pj-side-link.is-sub { margin-left: 18px; }
.pj-side-link:hover { background: rgba(255,255,255,.06); }
.pj-side-link.is-current { background: rgba(255,255,255,.1); font-weight: 600; }
.pj-main { padding: 24px; min-width: 0; overflow-x: auto; } /* breite Tabellen scrollen nur im Mittelteil */
@media (max-width: 760px) {
  div.pj-home { grid-template-columns: 1fr; }
  .pj-side { border-right: 0; border-bottom: 1px solid #2a2a2a; }
}
.pj-side-text { cursor: default; }
.pj-side-text:hover { background: none; }
.pj-plain { display: block; }
.pj-grp + .pj-grp { border-top: 1px solid #2a2a2a; margin-top: 12px; padding-top: 12px; }

/* Menü wie Bild 1 */
.pj-side { padding: 18px 14px; }
.pj-side-title { display: none; }
.pj-grp-h { font-size: 1.05rem; font-weight: 700; margin: 2px 0 8px; }
.pj-sub-h { font-size: .9rem; font-weight: 400; opacity: .6; margin: 10px 0 4px 10px; }
.pj-side-link { font-size: .95rem; margin-left: 10px; padding: 6px 10px; }
.pj-side-link.is-sub { margin-left: 22px; padding-left: 14px; border-left: 1px solid #3a3a3a; border-radius: 0 8px 8px 0; }
.pj-side-link.is-current { background: #1d2b42; color: #fff; font-weight: 600; }

/* Ladetracker: Menü rechts */
div.pj-has-right { grid-template-columns: 240px minmax(0, 1fr) 220px; }
.pj-has-right .pj-side { grid-column: 1; grid-row: 1; }
.pj-has-right .pj-main { grid-column: 2; grid-row: 1; }
.pj-right { grid-column: 3; grid-row: 1; border-left: 1px solid #2a2a2a; padding: 18px 12px; background: #141414; display: flex; flex-direction: column; gap: 4px; align-self: stretch; }
.pj-right a { display: block; padding: 8px 12px; border-radius: 8px; color: inherit; text-decoration: none; font-size: .95rem; }
.pj-right a:hover { background: rgba(255,255,255,.06); }
.pj-right a.active { background: #16351f; color: #4ade80; font-weight: 600; }
@media (max-width: 900px) {
  div.pj-has-right { grid-template-columns: 1fr; }
  .pj-has-right .pj-side, .pj-has-right .pj-main, .pj-right { grid-column: 1; grid-row: auto; }
  .pj-right { border-left: 0; border-bottom: 1px solid #2a2a2a; flex-direction: row; flex-wrap: wrap; }
}

/* Breite Tabellen (.full-bleed): nicht auf die Fensterbreite ausbrechen,
   sondern die ganze Breite des Mittelteils nutzen. */
.pj-main .full-bleed { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
.pj-main .container:has(.full-bleed) { max-width: none; }

/* Statistik-Box: fester Bestandteil des Layouts, unten in der rechten Spalte (nur wo es die Spalte gibt, ab 901px) */
.pj-stats { display: none; }
@media (min-width: 901px) {
  body:has(.pj-has-right) .pj-stats { display: block; position: fixed; right: 12px; bottom: 12px; width: 196px; z-index: 4;
    padding: 12px; border: 1px solid #2a2a2a; border-radius: 10px; background: #1a1a19; font-size: .82rem; color: #c3c2b7; }
}
.pj-stats-t { font-weight: 700; color: #fff; margin-bottom: 8px; font-size: .85rem; }
.pj-stats dl { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; }
.pj-stats dt { color: #898781; }
.pj-stats dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.pj-stats .tot { color: #fff; font-weight: 700; border-top: 1px solid #2a2a2a; padding-top: 4px; margin-top: 2px; }
.pj-stats details { margin-top: 8px; border-top: 1px solid #2a2a2a; padding-top: 6px; }
.pj-stats summary { cursor: pointer; color: #898781; }
.pj-stats ul { list-style: none; margin: 6px 0 0; padding: 0; max-height: 160px; overflow: auto; }
.pj-stats li { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
.pj-stats li span:last-child { color: #898781; white-space: nowrap; }
.pj-stats-s { margin-top: 8px; font-size: .72rem; color: #898781; }
