/* Uklad aplikacji: komputer = lewy sidebar + gorny pasek; telefon = dolna nawigacja + przycisk skanowania. */
.shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 14px; padding: 18px 14px;
  background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px; }
.brand img { width: 38px; height: 38px; border-radius: 10px; }
.brand b { display: block; font-size: 1.05rem; }
.brand span { display: block; font-size: .78rem; color: var(--muted); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { display: grid; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 10px;
  color: #334057; font-weight: 600; text-decoration: none;
}
.nav a:hover { background: #f1f4fa; }
.nav a.active { background: var(--primary); color: #fff; }
.nav .badge-count { margin-left: auto; background: var(--accent); color: #fff; border-radius: 999px; font-size: .72rem; padding: 1px 8px; }
.nav h4 { margin: 14px 12px 4px; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.sidebar .grow { flex: 1; }
.me { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 700; flex: none; }
.me div { min-width: 0; flex: 1; }
.me b, .me span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me span { font-size: .78rem; color: var(--muted); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 28px;
  background: rgba(244, 246, 251, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.search { position: relative; flex: 1; max-width: 560px; }
.search input { padding-left: 42px; background: var(--surface); }
.search .ico { position: absolute; left: 13px; top: 12px; color: var(--faint); }
.search-results {
  position: absolute; left: 0; right: 0; top: 50px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(18, 26, 43, .14); overflow: hidden; z-index: 30;
}
.search-results a { display: block; padding: 10px 14px; color: var(--text); border-bottom: 1px solid var(--line); }
.search-results a:last-child { border-bottom: 0; }
.search-results a:hover { background: #f3f6fb; text-decoration: none; }
.topbar .spacer { flex: 1; }
.content { padding: 24px 28px 48px; display: grid; gap: 20px; align-content: start; max-width: 1500px; width: 100%; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.page-head p { color: var(--muted); margin-top: 2px; }

.bottomnav { display: none; }
.fab-scan { display: none; }
.mobile-only { display: none; }
@media (max-width: 960px) { .mobile-only { display: inline-flex; } .topbar .btn.accent { display: none; } }

@media (max-width: 960px) {
  .shell { display: block; }
  .sidebar { display: none; }
  .topbar { padding: 10px 14px; }
  .content { padding: 16px 14px 120px; }
  .bottomnav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottomnav a {
    display: grid; justify-items: center; gap: 2px; padding: 6px 0; font-size: .7rem; font-weight: 600; color: var(--muted); text-decoration: none;
  }
  .bottomnav a.active { color: var(--primary); }
  .bottomnav a.scan-slot { visibility: hidden; }
  .fab-scan {
    display: grid; place-items: center; position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); width: 64px; height: 64px;
    margin-left: -32px; z-index: 50; border-radius: 50%; background: var(--accent); color: #fff; border: 4px solid var(--bg);
    box-shadow: 0 8px 22px rgba(249, 115, 22, .45); cursor: pointer;
  }
  .page-head h1 { font-size: 1.35rem; }
  .form-grid.two { grid-template-columns: minmax(0, 1fr); }
}
