/* górny pasek: po lewej powrót (tylko w ustawieniach) i logo, po prawej użytkownik, ustawienia, wylogowanie */
#topbar { flex:0 0 auto; display:flex; align-items:center; justify-content:space-between; gap:12px; height:56px; padding:0 18px; background:var(--topbar-p); border-bottom:1px solid var(--line); box-shadow:0 1px 6px rgba(0,0,0,.08); position:relative; z-index:5; }
/* górny pasek ma własne tło z motywu, więc dostaje własne kolory tekstu i podświetleń */
#topbar, #compactbar { --text:var(--bar-text); --muted:var(--bar-muted); --col:var(--bar-col); --line:var(--bar-line); color:var(--text); }
.tb-left, .tb-right { display:flex; align-items:center; gap:10px; min-width:0; }
#topbar svg { width:18px; height:18px; fill:none; stroke:var(--nav-s); stroke-width:2; stroke-linecap:round; stroke-linejoin:round; flex:0 0 auto; }

.brand { display:flex; align-items:center; gap:10px; font-weight:700; font-size:1.1rem; letter-spacing:.01em; }
.logo { width:32px; height:32px; border-radius:9px; display:inline-flex; align-items:center; justify-content:center; background:var(--bplus-p); color:#fff; box-shadow:0 2px 8px rgba(0,0,0,.25); }
#topbar .logo svg, .logo svg { width:20px; height:20px; fill:#fff; stroke:none; }


.who { display:flex; align-items:center; gap:10px; padding:4px 14px 4px 4px; border-radius:22px; background:var(--col); font-weight:600; font-size:.92rem; min-width:0; cursor:pointer; transition:background .12s; }
.who:hover { background:var(--line); }
.who #uname { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:200px; }
#topbar .who .who-caret { width:14px; height:14px; margin-left:-2px; flex:0 0 auto; stroke:currentColor; stroke-width:2.4; opacity:.7; }
#settingsLink:hover svg { transform:rotate(60deg); }
a.tb-icon { text-decoration:none; }
.avatar { width:30px; height:30px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; background:var(--avatar-p); color:var(--on-avatar); font-size:.78rem; font-weight:700; letter-spacing:.02em; flex:0 0 auto; }

.tb-icon { width:36px; height:36px; padding:0; border-radius:50%; background:transparent; color:var(--muted); display:inline-flex; align-items:center; justify-content:center; transition:background .15s, color .15s; }
.tb-icon svg { width:20px; height:20px; transition:transform .35s; }
.tb-icon:hover { background:var(--col); color:var(--text); }
#settingsBtn:hover svg { transform:rotate(60deg); }   /* obraca się tylko zębatka */
.tb-icon.on { background:var(--bp-p); color:var(--on-bp); }
#topbar .tb-icon.on svg { stroke:var(--on-bp); }

.tb-logout:hover { color:var(--danger); }
.tb-logout:hover svg { transform:none; }

@media (max-width: 700px), (max-height: 520px) and (pointer: coarse) {
  #topbar { padding:0 10px; }
  .who #uname { display:none; }
  .who { padding:4px 8px 4px 4px; }
  .tb-right { gap:4px; }
}

/* telefon: tryb kompaktowy – jedna wąska linia zamiast górnego paska, nagłówka projektu i panelu sprintów */
.tb-mobile { display:none; }
#compactbar { display:none; }
#compactbar svg { width:18px; height:18px; fill:none; stroke:var(--nav-s); stroke-width:2; stroke-linecap:round; stroke-linejoin:round; flex:0 0 auto; }
@media (max-width: 700px), (max-height: 520px) and (pointer: coarse) {
  .tb-mobile { display:inline-flex; }
  body.compact { --bar-h:42px; }
  body.compact #topbar, body.compact #phead, body.compact #sprintbar { display:none; }
  body.compact #compactbar { display:flex; align-items:center; gap:6px; flex:0 0 auto; height:42px; padding:0 8px; background:var(--topbar-p); border-bottom:1px solid var(--line); position:relative; z-index:5; }
  #compactbar .tb-icon { width:30px; height:30px; flex:0 0 auto; }
  .cb-title { flex:1; min-width:0; display:flex; align-items:baseline; overflow:hidden; white-space:nowrap; font-size:.95rem; }
  .cb-title b { flex:0 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; font-weight:700; }
  #cbSprint { flex:0 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; color:var(--muted); font-size:.82rem; }
  #cbSprint:not(:empty)::before { content:'·'; margin:0 6px; }
}

/* przyciski zwijania i rozwijania paska: wyraźne, w kolorze akcentu (żeby było je łatwo znaleźć) */
#collapseBtn, #expandBtn { background:var(--bp-p); color:var(--on-bp); box-shadow:0 1px 4px rgba(0,0,0,.35); }
#collapseBtn:hover, #expandBtn:hover { filter:brightness(1.12); }
#topbar #collapseBtn svg, #compactbar #expandBtn svg { width:22px; height:22px; stroke-width:3; stroke:var(--on-bp); }
#collapseBtn { width:38px; height:38px; }
#compactbar #expandBtn { width:36px; height:36px; }

/* przełącznik aplikacji (Kanban / Planner): aktywna aplikacja (.active) to duża, kolorowa ikona z dużym tytułem, druga (.inactive) – mała, stonowana pigułka-link */
.app-brand { display:inline-flex; align-items:center; text-decoration:none; color:inherit; min-width:0; }
.app-brand .app-ico { display:inline-flex; align-items:center; justify-content:center; flex:0 0 auto; }
#topbar .app-brand .app-ico svg { fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
#topbar .app-brand.kanban .app-ico svg { fill:currentColor; stroke:none; }
.app-brand.active { gap:11px; font-weight:800; font-size:1.45rem; }
.app-brand.active .app-ico { width:40px; height:40px; border-radius:12px; background:var(--bplus-p); color:var(--on-bplus); box-shadow:0 2px 8px rgba(0,0,0,.25); }
#topbar .app-brand.active .app-ico svg { width:25px; height:25px; }
.app-brand.inactive { gap:6px; padding:5px 11px; border-radius:16px; font-size:.85rem; font-weight:600; color:var(--muted); background:var(--col); box-shadow:inset 0 0 0 1px var(--line); }
.app-brand.inactive:hover, .app-brand.inactive:focus-visible { color:var(--text); box-shadow:inset 0 0 0 2px var(--accent); outline:0; }
#topbar .app-brand.inactive .app-ico svg { width:15px; height:15px; }
.tb-left { gap:12px; }
@media (max-width: 700px) { .app-brand.inactive .app-name { display:none; } .app-brand.inactive { padding:6px 8px; } }
@media (max-width: 480px) { .app-brand.active .app-name { display:none; } }

/* nazwa aplikacji w górnym pasku: zaokrąglona czcionka, pod nią (tylko w aktywnej aplikacji) dyskretny numer wersji; blok wyśrodkowany w pionie względem ikony */
.app-brand { font-family:'Nunito', ui-rounded, 'Varela Round', 'Quicksand', 'Trebuchet MS', 'Segoe UI Variable Display', system-ui, sans-serif; }
.app-brand .app-txt { display:flex; flex-direction:column; align-items:flex-start; justify-content:center; min-width:0; }
.app-brand.active .app-name { line-height:1.1; font-weight:800; letter-spacing:.005em; }
.app-brand .app-ver { font-size:11px; font-weight:700; line-height:1.1; color:var(--muted); letter-spacing:.02em; }
.app-brand .app-ver:empty, .app-brand.inactive .app-ver { display:none; }
