/* ---------- aplikační shell ---------- */
.app { display: flex; min-height: 100vh; min-height: 100dvh; align-items: stretch; }

.sidebar {
  flex: 0 0 var(--sidebar-w); width: var(--sidebar-w);
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px; padding: 20px 12px 12px;
  background: var(--ink); color: var(--text-on-dark);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 14px 18px; color: #FFFFFF; text-decoration: none; }
.brand:hover { color: #FFFFFF; }
.brand img { display: block; flex: none; width: 48px; height: 48px; }
.brand__name { font-family: var(--font-head); font-size: 13px; font-weight: 700; letter-spacing: .06em; line-height: 1.25; }
.brand__sub { display: block; margin-top: 2px; font-family: var(--font-body); font-size: var(--fs-xs); font-weight: 400; letter-spacing: 0; color: var(--muted-on-dark); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__group { padding: 16px 14px 6px; font-family: var(--font-head); font-size: var(--fs-xs); font-weight: 600; color: #8E8E8B; }
.nav__group:first-child { padding-top: 6px; }
.nav__item {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: var(--touch); padding: 0 14px;
  border-radius: var(--radius); font-size: var(--fs-base); text-align: left; text-decoration: none;
  color: var(--text-on-dark); background: transparent;
  transition: background-color .12s var(--ease);
}
.nav__item:hover { background: #1C1C1B; color: #FFFFFF; }
.nav__item svg { flex: none; }
.nav__item[aria-current="page"] { background: #FFFFFF; color: var(--ink); font-weight: 600; }
.nav__item--error { color: #F2A99B; }

.userbox { margin-top: auto; border-top: 1px solid #2B2B2B; padding: 16px 14px 4px; display: flex; flex-direction: column; gap: 2px; }
.userbox__name { font-size: var(--fs-sm); font-weight: 600; color: #FFFFFF; overflow-wrap: anywhere; }
.userbox__role { font-size: var(--fs-xs); color: var(--muted-on-dark); }
.userbox__out {
  align-self: flex-start; margin-top: 6px; display: inline-flex; align-items: center; gap: 8px; min-height: var(--touch);
  padding: 0; border: 0; background: transparent; color: var(--text-on-dark); font: inherit; font-size: var(--fs-sm); cursor: pointer;
}
.userbox__out:hover { color: #FFFFFF; text-decoration: underline; }

.content { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px;
  min-height: var(--topbar-h); padding: 6px var(--gutter);
  background: var(--paper); border-bottom: 1px solid var(--line);
}
.crumb { font-size: var(--fs-sm); color: var(--muted); display: flex; align-items: center; gap: 8px; min-width: 0; }
.crumb strong { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__brand { display: none; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--font-head); font-weight: 700; font-size: 12px; letter-spacing: .06em; }
.topbar__brand img { width: 34px; height: 34px; display: block; }
.menu-btn { display: none; flex: none; margin-left: -8px; border-color: transparent; background: transparent; }
.menu-btn:hover { background: var(--bg); border-color: var(--line-strong); }

.main { padding: 28px var(--gutter) 56px; width: 100%; max-width: var(--content-max); }
.main:focus { outline: none; }
.main > .stack { min-width: 0; }
.scrim { display: none; }

@media (max-width: 960px) {
  .sidebar {
    position: fixed; z-index: 60; left: 0; top: 0; bottom: 0;
    width: min(86vw, 300px); flex-basis: auto;
    transform: translateX(-102%); visibility: hidden;
    transition: transform .22s var(--ease), visibility 0s linear .22s;
    box-shadow: var(--shadow-pop);
  }
  .app.nav-open .sidebar { transform: none; visibility: visible; transition: transform .22s var(--ease); }
  .scrim { position: fixed; z-index: 50; inset: 0; background: rgba(10, 10, 10, .5); }
  .app.nav-open .scrim { display: block; }
  .menu-btn { display: inline-flex; }
  .crumb { display: none; }
  .topbar__brand { display: inline-flex; }
  .main { padding-top: 20px; padding-bottom: 40px; }
  h1 { font-size: 24px; }
}

/* ---------- přihlášení a stavové obrazovky ---------- */
.auth { display: flex; flex-wrap: wrap; min-height: 100vh; min-height: 100dvh; }
.auth__aside {
  flex: 1 1 420px; display: flex; flex-direction: column; justify-content: space-between; gap: 48px;
  padding: 56px; background: var(--ink); color: #FFFFFF;
}
.auth__brand { display: flex; align-items: center; gap: 14px; }
.auth__brand img { width: 72px; height: 72px; display: block; flex: none; }
.auth__brand-name { font-family: var(--font-head); font-size: 16px; font-weight: 700; letter-spacing: .08em; }
.auth__brand-sub { display: block; margin-top: 2px; font-size: var(--fs-sm); color: var(--muted-on-dark); letter-spacing: 0; font-family: var(--font-body); font-weight: 400; }
.auth__pitch { display: flex; flex-direction: column; gap: 20px; max-width: 460px; }
.auth__pitch h1 { font-size: 40px; line-height: 1.15; }
.auth__pitch p { font-size: 16px; color: #D0D0CD; }
.auth__areas { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: var(--fs-sm); color: var(--muted-on-dark); }
.auth__main { flex: 1 1 420px; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 56px 32px; }
.auth__panel { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 24px; }
.auth__panel h2 { font-size: 26px; }
.auth__panel .lead { color: var(--muted); margin-top: 6px; }
.auth__form { display: flex; flex-direction: column; gap: 20px; }
.auth__row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.auth__row label { font-size: var(--fs-sm); font-weight: 600; }
.auth__row .linkbtn { font-weight: 500; }
.auth__foot { border-top: 1px solid var(--line); padding-top: 16px; font-size: var(--fs-sm); color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.auth .field { min-height: 48px; font-size: var(--fs-md); }
.auth .btn { min-height: 48px; font-size: var(--fs-md); }

@media (max-width: 760px) {
  .auth { flex-direction: column; flex-wrap: nowrap; }
  .auth__aside { flex: none; width: 100%; padding: 20px 16px; gap: 0; }
  .auth__pitch, .auth__areas { display: none; }
  .auth__brand img { width: 52px; height: 52px; }
  .auth__main { padding: 28px 16px 40px; align-items: flex-start; }
  .auth__panel h2 { font-size: 24px; }
}

/* stav bez kontextu shellu (nenastaveno, chyba načtení) */
.center-screen { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.center-card { width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: 16px; padding: 28px; }
.center-card .brand-row { display: flex; align-items: center; gap: 12px; }
.center-card .brand-row img { width: 44px; height: 44px; }
.center-card code, .code { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: 13px; background: var(--neutral-bg); padding: 2px 6px; border-radius: 4px; }
.center-card ol { list-style: decimal; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.boot { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; }
.boot img { width: 64px; height: 64px; opacity: .9; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
