/* Dílna — rozvržení: levé menu, horní lišta, spodní lišta na mobilu, stránka, přihlášení. */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }

/* ---------- levé menu ---------- */
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh; background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 16px 18px 14px; text-decoration: none !important; color: var(--text); }
.brand .logo-mark { width: 34px; height: 34px; border-radius: 10px; }
.brand .logo-mark::before { left: 9px; top: 8px; width: 11px; height: 17px; border-width: 2.5px; }
.brand .logo-mark::after { width: 11px; height: 11px; }
.brand b { display: block; font-size: 16px; letter-spacing: -.01em; }
.brand small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 500; margin-top: -2px; }
.nav { padding: 6px 10px; display: flex; flex-direction: column; gap: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; min-height: 38px; padding: 0 10px; border-radius: 9px; color: var(--text-2); font-weight: 550; font-size: 13.5px;
  text-decoration: none !important; position: relative; transition: background var(--t-fast), color var(--t-fast);
}
.nav-item svg { width: 19px; height: 19px; color: var(--muted); flex: none; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.on { background: var(--primary-soft); color: var(--primary); }
.nav-item.on svg { color: var(--primary); }
.nav-item .badge { margin-left: auto; }
.nav-item .cnt { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 600; }
.nav-sec { padding: 14px 20px 6px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; display: flex; align-items: center; }
.nav-sec a { margin-left: auto; color: var(--muted); display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; }
.nav-sec a:hover { background: var(--surface-2); color: var(--text); }
.nav-sec a svg { width: 15px; height: 15px; }
.nav-projects { overflow-y: auto; flex: 1; padding: 0 10px 10px; scrollbar-width: thin; }
.nav-proj { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 0 10px; border-radius: 8px; color: var(--text-2); font-size: 13px; text-decoration: none !important; }
.nav-proj:hover { background: var(--surface-2); color: var(--text); }
.nav-proj.on { background: var(--surface-2); color: var(--text); font-weight: 600; }
.nav-proj .sq { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.nav-proj .ellipsis { flex: 1; }
.sidebar-foot { border-top: 1px solid var(--border); padding: 10px; display: flex; align-items: center; gap: 8px; }
.me-btn { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; border: 0; background: none; padding: 6px 8px; border-radius: 9px; text-align: left; }
.me-btn:hover { background: var(--surface-2); }
.me-btn b { display: block; font-size: 13px; }
.me-btn small { display: block; font-size: 11.5px; color: var(--muted); }

/* ---------- hlavní sloupec ---------- */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 15; height: var(--topbar-h); display: flex; align-items: center; gap: 10px; padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar .tb-title { display: none; font-weight: 650; font-size: 16px; min-width: 0; }
.search-trigger {
  display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px 0 12px; width: min(460px, 46vw); border: 1px solid var(--border);
  background: var(--surface); border-radius: var(--r); color: var(--muted); font-size: 13.5px; text-align: left;
}
.search-trigger:hover { border-color: var(--border-strong); }
.search-trigger svg { width: 17px; height: 17px; }
.search-trigger span { flex: 1; }
.tb-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.bell .badge { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; font-size: 11px; box-shadow: 0 0 0 2px var(--bg); }
.page { padding: 24px 28px 48px; width: 100%; max-width: 1440px; margin: 0 auto; min-width: 0; }
.page-h { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-h h1 { font-size: 24px; }
.page-h .sub { color: var(--muted); margin-top: 2px; }
.page-h .acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.bottomnav { display: none; }
.mobile-only { display: none !important; }

/* ---------- tablet: úzké menu (ikony) ---------- */
@media (max-width: 1100px) and (min-width: 769px) {
  .app { grid-template-columns: 72px minmax(0, 1fr); }
  .brand { justify-content: center; padding: 16px 0 12px; }
  .brand > div, .nav-item span, .nav-item .cnt, .nav-sec, .nav-projects, .me-btn > div { display: none; }
  .nav { padding: 6px 12px; }
  .nav-item { justify-content: center; padding: 0; min-height: 44px; }
  .nav-item .badge { position: absolute; top: 4px; right: 4px; margin: 0; }
  .sidebar-foot { flex-direction: column; padding: 10px 6px; }
  .me-btn { justify-content: center; padding: 6px 0; }
  .page { padding: 20px 20px 40px; }
}

/* ---------- mobil ---------- */
@media (max-width: 768px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .topbar { padding: 0 6px 0 14px; padding-top: env(safe-area-inset-top); height: calc(var(--topbar-h) + env(safe-area-inset-top)); }
  .topbar .tb-title { display: flex; align-items: center; gap: 8px; flex: 1; }
  .topbar .tb-title .logo-mark { width: 28px; height: 28px; border-radius: 8px; }
  .topbar .tb-title .logo-mark::before { left: 7px; top: 6px; width: 9px; height: 15px; border-width: 2.5px; }
  .topbar .tb-title .logo-mark::after { width: 9px; height: 9px; }
  .search-trigger { display: none; }
  .tb-actions { margin-left: 0; }
  .desktop-only { display: none !important; }
  .mobile-only { display: revert !important; }
  .page { padding: 16px 14px calc(var(--bottomnav-h) + 28px + env(safe-area-inset-bottom)); }
  .page-h h1 { font-size: 21px; }
  .page-h .acts { margin-left: 0; width: 100%; }
  .bottomnav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--border);
  }
  .bn-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 600;
    text-decoration: none !important; border: 0; background: none; position: relative; -webkit-tap-highlight-color: transparent; min-height: 44px;
  }
  .bn-item svg { width: 23px; height: 23px; }
  .bn-item.on { color: var(--primary); }
  .bn-item .badge { position: absolute; top: 6px; left: calc(50% + 6px); }
  .bn-add { display: grid; place-items: center; }
  .bn-add span { width: 48px; height: 48px; border-radius: 16px; background: var(--primary); color: var(--primary-text); display: grid; place-items: center; box-shadow: var(--shadow); }
  .bn-add svg { width: 24px; height: 24px; }
}

/* ---------- přihlášení ---------- */
.login-wrap { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.login-side {
  background: radial-gradient(1200px 600px at 0% 0%, color-mix(in srgb, var(--primary) 30%, transparent), transparent 60%), #0e1a1b;
  color: #e9f2f1; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
}
.login-side .brand { padding: 0; color: #fff; }
.login-side .brand small { color: #9fb7b4; }
.login-side h1 { margin-bottom: 12px; font-size: 34px; line-height: 1.15; max-width: 460px; letter-spacing: -.02em; }
.login-side p { color: #a9bebb; max-width: 440px; font-size: 15px; }
.login-feats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 22px; max-width: 460px; font-size: 13.5px; color: #c8d9d6; }
.login-feats div { display: flex; gap: 8px; align-items: center; }
.login-feats svg { width: 16px; height: 16px; color: var(--accent); flex: none; }
.login-main { display: flex; flex-direction: column; justify-content: center; padding: 40px clamp(20px, 6vw, 72px); background: var(--surface); }
.login-main h2 { font-size: 22px; margin-bottom: 4px; }
.people { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 18px 0 22px; }
.person {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px 12px; border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--surface); text-align: center; transition: all var(--t-fast); min-width: 0;
}
.person:hover { border-color: var(--primary); background: var(--primary-soft); transform: translateY(-1px); }
.person b { font-size: 14px; }
.person small { font-size: 11.5px; color: var(--muted); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.person .pill { height: 20px; font-size: 11px; }
.login-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12.5px; margin: 4px 0 16px; }
.login-or::before, .login-or::after { content: ""; height: 1px; background: var(--border); flex: 1; }
.login-form { display: grid; gap: 12px; max-width: 420px; }
@media (max-width: 900px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-side { padding: 28px 20px 24px; gap: 18px; }
  .login-side h1 { font-size: 24px; }
  .login-feats { display: none; }
  .login-main { padding: 24px 16px 40px; justify-content: flex-start; }
  .people { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* flex potomci se nesmí roztáhnout přes šířku (vodorovné přetečení na mobilu) */
.toolbar > *, .vtools > *, .fb-slot, .fbar > * { min-width: 0; max-width: 100%; }
