/* ==========================================================================
   BOTERA – společné levé boční menu (identita C1) + karty rozcestníku
   Claudý pro Boba, 29. 9. 2026. Používá se na všech stránkách s .header-compact.
   Jen na širokých obrazovkách (≥ 1000 px); na tabletu zůstává lišta nahoře.
   ========================================================================== */
@media (min-width: 1000px) {
  :root { --side-w: 300px; --side-gap: 14px; }
  body { padding-left: calc(var(--side-w) + var(--side-gap) * 2); }

  .header-compact {
    position: fixed !important; top: var(--side-gap) !important; left: var(--side-gap); bottom: var(--side-gap);
    width: var(--side-w); margin: 0 !important; z-index: 120;
    background: linear-gradient(172deg, #9676de 0%, #7c5acb 46%, #6443b6 100%) !important;
    border-radius: 26px !important; box-shadow: 0 18px 50px rgba(60, 30, 140, .32), inset 0 1px 0 rgba(255, 255, 255, .25) !important;
    overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .35) transparent;
    color: #fff; display: flex; flex-direction: column;
  }
  .header-inner { flex-direction: column !important; align-items: stretch !important; flex-wrap: nowrap !important; gap: 12px !important; padding: 20px 18px 12px !important; }
  .header-inner > * { max-width: 100%; min-width: 0; margin-left: 0 !important; margin-right: 0 !important; }
  .header-brand { order: -3; align-self: center !important; }
  .header-logo-img { max-width: 240px !important; height: auto !important; filter: drop-shadow(0 4px 12px rgba(40, 15, 110, .35)); }
  .header-clock {
    order: -2; align-self: center !important; font-size: 22px !important; color: #fff !important; text-shadow: 0 1px 2px rgba(0, 0, 0, .38) !important;
    letter-spacing: 3px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .25); border-radius: 14px; padding: 4px 16px;
  }
  .header-badges { flex-wrap: wrap; justify-content: center; gap: 6px; }
  .header-actions { display: flex; justify-content: center; gap: 8px; }
  .header-compact input[type="text"], .header-compact input[type="search"], .header-compact select {
    width: 100%; box-sizing: border-box; font-size: 16px; border-radius: 14px;
    background: rgba(255, 255, 255, .16) !important; border: 1px solid rgba(255, 255, 255, .3) !important; color: #fff !important;
  }
  .header-compact select option { color: #2d2350; }
  .header-compact input::placeholder { color: rgba(255, 255, 255, .8); }
  .header-compact input:focus { outline: none; background: rgba(255, 255, 255, .24) !important; border-color: rgba(255, 255, 255, .7) !important; }
  .logout-btn { display: none !important; } /* odhlášení je dole v menu */

  /* ── menu stránek ── */
  .bs-nav { display: flex; flex-direction: column; gap: 2px; padding: 6px 12px 16px; margin-top: 4px; border-top: 1px solid rgba(255, 255, 255, .2); }
  .bs-sec { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .72); padding: 12px 8px 6px; }
  .bs-link {
    display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 14px; color: #fff; text-decoration: none;
    font-size: 15.5px; font-weight: 700; text-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: background .15s, transform .15s;
  }
  .bs-link:hover { background: rgba(255, 255, 255, .14); }
  .bs-link.on { background: #fff; color: #5b3dae; text-shadow: none; box-shadow: 0 6px 14px rgba(40, 15, 110, .26); }
  .bs-link .bs-ic { width: 32px; height: 32px; border-radius: 10px; flex: none; }
  .bs-link .bs-ic svg { width: 18px; height: 18px; }
  .bs-link span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bs-sec-sm { margin-top: 10px; padding-top: 14px; font-size: 10.5px; opacity: .8; }
  .bs-tech { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
  .bs-tl {
    display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 10px; color: rgba(255, 255, 255, .82); text-decoration: none;
    font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden;
  }
  .bs-tl svg { width: 14px; height: 14px; flex: none; opacity: .85; }
  .bs-tl span { overflow: hidden; text-overflow: ellipsis; }
  .bs-tl:hover { background: rgba(255, 255, 255, .12); color: #fff; }
  .bs-tl.on { background: rgba(255, 255, 255, .9); color: #5b3dae; }
}
@media (max-width: 999px) { .bs-nav { display: none; } }

/* dlaždice s ikonou (menu i karty) */
.bs-ic { display: inline-flex; align-items: center; justify-content: center; color: #fff; box-shadow: 0 6px 14px rgba(40, 15, 110, .28), inset 0 1px 0 rgba(255, 255, 255, .35); }
.bs-ic svg { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .35)); }

/* ── karty rozcestníku ── */
.bs-cards { padding: 4px 0 24px; }
.bs-h { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 900; color: #2d2350; margin: 6px 4px 14px; }
.bs-h svg { width: 24px; height: 24px; color: #9178c4; }
.bs-h2 { margin-top: 30px; font-size: 18px; color: #4b4470; }
.bs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.bs-grid-top { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.bs-card {
  position: relative; display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: 22px; text-decoration: none;
  background: #fff; border: 1px solid rgba(145, 120, 196, .18); box-shadow: 0 8px 22px rgba(60, 30, 140, .08);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.bs-card:hover { transform: translateY(-3px); border-color: rgba(145, 120, 196, .55); box-shadow: 0 16px 34px rgba(60, 30, 140, .18); }
.bs-card .bs-ic { width: 52px; height: 52px; border-radius: 16px; flex: none; }
.bs-card .bs-ic svg { width: 27px; height: 27px; }
.bs-card.big { padding: 22px 22px; }
.bs-card.big .bs-ic { width: 64px; height: 64px; border-radius: 19px; }
.bs-card.big .bs-ic svg { width: 32px; height: 32px; }
.bs-cb { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bs-cb b { font-size: 18px; font-weight: 800; color: #2d2350; display: flex; align-items: center; gap: 6px; }
.bs-card.big .bs-cb b { font-size: 20px; }
.bs-cb small { font-size: 14px; color: #6b6588; line-height: 1.35; }
.bs-ext svg { width: 15px; height: 15px; color: #9178c4; }

/* v2 – štítky v hlavičce a přepínač motivu (29. 9. 2026) */
@media (min-width: 1000px) {
  .header-compact .header-badges > *, .header-compact .badge {
    background: rgba(255, 255, 255, .16) !important; border: 1px solid rgba(255, 255, 255, .3) !important; color: #fff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .3); border-radius: 999px !important; font-size: 12.5px !important; font-weight: 700 !important; text-decoration: none;
  }
  .header-compact .header-badges > a:hover { background: rgba(255, 255, 255, .26) !important; }
  .theme-toggle { left: auto !important; right: 18px !important; }
}

/* v3 – statistiky v hlavičce (Naskladnění: Dnes / Týden / Celkem) pod sebou jako řádky */
@media (min-width: 1000px) {
  .header-compact .header-stats {
    display: flex !important; flex-direction: column !important; gap: 4px !important; width: 100%; padding: 6px !important;
    background: rgba(255, 255, 255, .12) !important; border: 1px solid rgba(255, 255, 255, .25) !important; border-radius: 14px !important; box-shadow: none !important;
  }
  .header-compact .hstat {
    display: flex !important; flex-direction: row !important; justify-content: space-between !important; align-items: baseline; gap: 8px;
    padding: 5px 10px !important; border: 0 !important; border-radius: 10px; background: transparent !important; min-width: 0 !important;
  }
  .header-compact .hstat + .hstat { border-top: 1px solid rgba(255, 255, 255, .15) !important; border-radius: 0; }
  .header-compact .hstat-label { color: rgba(255, 255, 255, .8) !important; font-size: 12px !important; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
  .header-compact .hstat-val { color: #fff !important; font-size: 15px !important; font-weight: 800; white-space: nowrap; text-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
}

/* v4 – stránky s hlavičkou jako Multiadmin (Výstupní kontrola): dlaždice počtů, hledání, filtry, Načíst, statistiky, lišta Naposledy */
@media (min-width: 1000px) {
  .header-compact .ma-stats { display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
  .header-compact .ma-stat {
    background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22) !important; border-radius: 14px;
    padding: 8px 10px !important; display: flex; flex-direction: column; align-items: flex-start; min-width: 0;
  }
  .header-compact .ma-stat[style*="border-left"] { border-left-width: 5px !important; border-left-style: solid !important; }
  .header-compact .ma-stat-num { color: #fff !important; font-size: 24px !important; line-height: 1.1; text-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
  .header-compact .ma-stat-label { color: rgba(255, 255, 255, .85) !important; font-size: 11.5px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .header-compact .ma-search-wrap { width: 100% !important; max-width: none !important; flex: none !important; }
  .header-compact .ma-search { width: 100% !important; max-width: none !important; padding: 12px 14px; }
  .header-compact .ma-filter-wrap { flex-wrap: wrap; gap: 6px; }
  .header-compact #refreshBtn {
    width: 100%; justify-content: center; font-size: 17px; font-weight: 800; padding: 12px 16px; border-radius: 16px;
    background: linear-gradient(135deg, #FF69B4, #EE82EE 55%, #9370DB) !important; border: 0 !important; color: #fff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .38); box-shadow: 0 10px 24px rgba(40, 15, 110, .35);
  }
  .header-compact .vk-carrier-btn {
    width: 100%; justify-content: center; font-size: 15px; font-weight: 700; border-radius: 14px;
    background: rgba(255, 255, 255, .14) !important; border: 1px solid rgba(255, 255, 255, .3) !important; color: #fff !important;
  }
  .header-compact .vk-stats-bar { display: grid !important; grid-template-columns: 1fr 1fr; gap: 6px; padding: 6px !important; border-radius: 14px !important; background: rgba(255, 255, 255, .12) !important; border: 1px solid rgba(255, 255, 255, .25) !important; }
  .header-compact .vk-stat-sep { display: none !important; }
  .header-compact .vk-stat-box { min-width: 0 !important; padding: 4px 6px !important; }
  .header-compact .vk-stat-val { color: #fff !important; font-size: 18px !important; }
  .header-compact .vk-stat-label { color: rgba(255, 255, 255, .8) !important; }
  #maRecentLog { left: calc(var(--side-w) + var(--side-gap)) !important; right: 0; width: auto !important; }
}

/* v5 – skupiny prvků v hlavičce se lámou do šířky panelu (Náklady: hledání + odkazy) */
@media (min-width: 1000px) {
  .header-inner > div:not(.header-brand):not(.header-clock):not(.ma-stats):not(.vk-stats-bar):not(.header-stats) { flex-wrap: wrap !important; justify-content: center; gap: 6px; }
  .header-compact .header-search-wrap { width: 100% !important; flex: 1 1 100% !important; max-width: none !important; }
  .header-compact .header-search-wrap input { width: 100% !important; }
  .header-inner > div > a:not(.header-brand) {
    color: #fff !important; text-decoration: none; font-size: 13px; font-weight: 700; padding: 5px 10px; border-radius: 999px;
    background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .25); text-shadow: 0 1px 2px rgba(0, 0, 0, .3);
  }
  .header-inner > div > a:not(.header-brand):hover { background: rgba(255, 255, 255, .26); }
}

@media (min-width: 1000px) { .header-compact .header-clock { margin-left: auto !important; margin-right: auto !important; } }

/* v7 – „ZÁLOŽKA“ podle identity S1 (Bobo 29. 9. 2026): položka pod myší / aktivní stránka zbělá do barvy stránky
   a vnitřně zaoblenými rohy vteče ven z panelu. Panel proto navazuje na stránku bez mezery vpravo. */
@media (min-width: 1000px) {
  :root { --bs-tab: var(--bg-body, #f1f5f9); }
  body { padding-left: calc(var(--side-w) + var(--side-gap)) !important; }
  .header-compact { border-radius: 26px 0 0 26px !important; }
  .bs-nav { padding-right: 0 !important; }
  .bs-link { position: relative; margin-right: 0; border-radius: 16px 0 0 16px; transition: background-color .18s, color .18s; }
  .bs-link::before, .bs-link::after { content: ""; position: absolute; right: 0; width: 18px; height: 18px; pointer-events: none; opacity: 0; transition: opacity .18s ease; }
  .bs-link::before { top: -18px; background: radial-gradient(circle at 0 0, transparent 17.5px, var(--bs-tab) 18px); }
  .bs-link::after { bottom: -18px; background: radial-gradient(circle at 0 100%, transparent 17.5px, var(--bs-tab) 18px); }
  /* pod myší vždy; aktivní stránka jen když myš není v menu (jako otevřený e-mail v HEADu) */
  .bs-link:hover, .bs-nav:not(:hover) .bs-link.on { background: var(--bs-tab) !important; color: #5b3dae !important; text-shadow: none !important; box-shadow: none !important; z-index: 2; }
  .bs-link:hover::before, .bs-link:hover::after, .bs-nav:not(:hover) .bs-link.on::before, .bs-nav:not(:hover) .bs-link.on::after { opacity: 1; }
  .bs-link.on { background: transparent; color: #fff; box-shadow: none; }
  .bs-nav:hover .bs-link.on:not(:hover) { background: rgba(255, 255, 255, .14); }
  /* obsah stránky začíná hned za panelem – malý vnitřní odstup, ať nelepí */
  .content-wrap { padding-left: 18px !important; }
}

/* v8 – OBLIČEJ PŘIHLÁŠENÉHO: přetékající odznáček na kartě aktuální stránky (Claudý 30. 9. 2026) */
@media (min-width: 1000px) {
  .bs-link.has-me { padding-right: 74px; z-index: 3 !important; }
  .bs-link.has-me > span:nth-last-child(2) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bs-link.has-me > .bs-me { overflow: visible !important; white-space: normal !important; }
  .bs-me {
    position: absolute; right: 10px; top: 50%; width: 58px; height: 58px; margin-top: -29px; z-index: 4; box-sizing: border-box;
    border-radius: 50%; padding: 3px; cursor: pointer;
    background: linear-gradient(135deg, #FF69B4, #9370DB 55%, #6d4cbe);
    box-shadow: 0 0 0 3px #fff, 0 10px 24px rgba(60, 30, 140, .38);
    transition: transform .22s cubic-bezier(.34, 1.56, .64, 1), box-shadow .2s;
    animation: bsMeIn .55s cubic-bezier(.34, 1.56, .64, 1) both;
  }
  .bs-me img, .bs-me b {
    display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; box-sizing: border-box;
    border-radius: 50%; border: 2px solid #fff; object-fit: cover; background: #fff;
  }
  .bs-me b { background: transparent; color: #fff; font-size: 24px; font-weight: 900; text-shadow: 0 1px 2px rgba(0, 0, 0, .38); }
  .bs-me-dot { position: absolute; right: 0; bottom: 1px; width: 15px; height: 15px; border-radius: 50%;
    background: linear-gradient(135deg, #00FA9A, #00b894); border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(0, 120, 90, .4); }
  .bs-me-cam { position: absolute; inset: 3px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: rgba(60, 30, 140, .55); color: #fff; opacity: 0; transition: opacity .18s; }
  .bs-me-cam svg { width: 22px; height: 22px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .4)); }
  .bs-me:hover { transform: scale(1.1) rotate(-4deg); box-shadow: 0 0 0 3px #fff, 0 14px 30px rgba(60, 30, 140, .45); }
  .bs-me:hover .bs-me-cam { opacity: 1; }
  .bs-me.busy { animation: bsMeBusy 1s linear infinite; }
  .bs-me.pop { animation: bsMeIn .55s cubic-bezier(.34, 1.56, .64, 1) both; }
  @keyframes bsMeIn { from { transform: scale(.3) rotate(-25deg); opacity: 0; } to { transform: none; opacity: 1; } }
  @keyframes bsMeBusy { to { transform: rotate(360deg); } }
}
