:root {
    --hub-sidebar-width: 288px;
    --hub-sidebar-collapsed-width: 88px;
    --hub-sidebar-bg: #0f172a;
    --hub-sidebar-bg-2: #111827;
    --hub-sidebar-border: rgba(255, 255, 255, 0.08);
    --hub-sidebar-text: rgba(255, 255, 255, 0.92);
    --hub-sidebar-muted: rgba(255, 255, 255, 0.62);
    --hub-sidebar-hover: rgba(255, 255, 255, 0.08);
    --hub-sidebar-active:
        linear-gradient(
        135deg,
        rgba(59, 130, 246, 0.25),
        rgba(14, 165, 233, 0.18)
        );
    --hub-sidebar-shadow:
        0 18px 40px rgba(2, 6, 23, 0.28);
}


/* ==================================================
   ZÁKLAD STRÁNKY
   ================================================== */

body {
    padding-top: 0;
    padding-left: 0;
    transition: padding-left 0.2s ease;
}


/* ==================================================
   DESKTOPOVÉ ODSAZENÍ STRÁNKY
   Desktop začíná od 992 px
   ================================================== */

@media (min-width: 992px) {
    body {
        padding-left: var(--hub-sidebar-width);
    }

    body.hub-sidebar-collapsed {
        padding-left: var(--hub-sidebar-collapsed-width);
    }
}


/* ==================================================
   TABLET A MOBIL
   Bez levého odsazení
   ================================================== */

@media (max-width: 991.98px) {
    body,
    body.hub-sidebar-collapsed {
        padding-left: 0 !important;
    }
}


/* ==================================================
   MOBILNÍ OFFCANVAS
   ================================================== */

#hubSidebarMobile {
    height: 100vh;
    height: 100dvh;
    position: fixed;
    background-color: #13203c !important;
}


/* ==================================================
   ZNAČKA / LOGO
   ================================================== */

.hub-sidebar__brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;

    min-width: 0;

    color: #fff;
    text-decoration: none;

    font-weight: 700;
    letter-spacing: 0.02em;
}

.hub-sidebar__brand:hover {
    color: #fff;
}

.hub-sidebar__brand img {
    display: block;
    flex: 0 0 auto;
}

.hub-sidebar__brand-text {
    white-space: nowrap;
    transition: opacity 0.18s ease;
}


/* ==================================================
   SPOLEČNÝ SIDEBAR
   ================================================== */

.hub-sidebar {
    display: flex;
    flex-direction: column;

    width: 100%;
    height: 100%;

    background:
        radial-gradient(
        circle at top,
        rgba(59, 130, 246, 0.18),
        transparent 28%
        ),
        linear-gradient(
        180deg,
        var(--hub-sidebar-bg),
        var(--hub-sidebar-bg-2)
        );

    color: var(--hub-sidebar-text);
}


/* ==================================================
   DESKTOPOVÝ SIDEBAR
   ================================================== */

.hub-sidebar--desktop {
    position: fixed;
    inset: 0 auto 0 0;

    width: var(--hub-sidebar-width);

    z-index: 1030;

    border-right: 1px solid var(--hub-sidebar-border);
    box-shadow: var(--hub-sidebar-shadow);

    transition: width 0.2s ease;
}


/* Na tabletu a mobilu desktopový sidebar schovat */
@media (max-width: 991.98px) {
    .hub-sidebar--desktop {
        display: none !important;
    }
}


/* Na desktopu sidebar vždy zobrazit */
@media (min-width: 992px) {
    .hub-sidebar--desktop {
        display: flex !important;
    }
}


/* ==================================================
   HLAVIČKA SIDEBARU
   ================================================== */

.hub-sidebar__header {
    padding: 1.25rem 1.25rem 1rem;

    border-bottom: 1px solid var(--hub-sidebar-border);

    transition: padding 0.2s ease;
}

.hub-sidebar__header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 0.75rem;
}


/* ==================================================
   TLAČÍTKO PRO SBALENÍ DESKTOPOVÉHO MENU
   ================================================== */

.hub-sidebar__collapse-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 40px;
    height: 40px;
    flex: 0 0 40px;

    border: 0;
    border-radius: 12px;

    background: rgba(255, 255, 255, 0.08);
    color: #fff;

    cursor: pointer;

    transition:
        background-color 0.18s ease,
        transform 0.18s ease;
}

.hub-sidebar__collapse-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: translateY(-1px);
}


/* Tlačítko sbalení se na mobilu nepoužívá */
@media (max-width: 991.98px) {
    .hub-sidebar__collapse-btn {
        display: none !important;
    }
}


/* ==================================================
   POPISEK SIDEBARU
   ================================================== */

.hub-sidebar__caption {
    margin-top: 0.75rem;

    max-height: 50px;
    overflow: hidden;

    font-size: 0.75rem;
    color: var(--hub-sidebar-muted);

    transition:
        opacity 0.18s ease,
        max-height 0.18s ease,
        margin 0.18s ease;
}


/* ==================================================
   NAVIGACE
   ================================================== */

.hub-sidebar__nav {
    flex: 1;

    min-height: 0;

    overflow-y: auto;
    overflow-x: hidden;

    padding: 1rem 0.875rem;

    transition: padding 0.2s ease;

    scrollbar-width: thin;
    scrollbar-color:
        rgba(255, 255, 255, 0.18)
        transparent;
}

.hub-sidebar__nav::-webkit-scrollbar {
    width: 6px;
}

.hub-sidebar__nav::-webkit-scrollbar-track {
    background: transparent;
}

.hub-sidebar__nav::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
}

.hub-sidebar__menu {
    margin: 0;
    padding: 0;

    list-style: none;
}

.hub-sidebar__item {
    display: block;
}

.hub-sidebar__item + .hub-sidebar__item {
    margin-top: 0.375rem;
}


/* ==================================================
   ODKAZY A TLAČÍTKA MENU
   ================================================== */

.hub-sidebar__link,
.hub-sidebar__toggle,
.hub-sidebar__sublink {
    display: flex;
    align-items: center;
    justify-content: space-between;

    width: 100%;

    gap: 0.875rem;

    border: 0;
    border-radius: 16px;

    background: transparent;
    color: inherit;

    text-decoration: none;
    text-align: left;

    cursor: pointer;

    transition:
        background-color 0.18s ease,
        transform 0.18s ease,
        color 0.18s ease;
}

.hub-sidebar__link,
.hub-sidebar__toggle {
    padding: 0.85rem 0.95rem;
}

.hub-sidebar__link-main {
    display: inline-flex;
    align-items: center;

    min-width: 0;
    flex: 1;

    gap: 0.875rem;
}

.hub-sidebar__link-main span {
    min-width: 0;
    white-space: nowrap;
}

.hub-sidebar__link-main i,
.hub-sidebar__sublink i {
    flex: 0 0 20px;

    font-size: 1rem;
    line-height: 1;
    text-align: center;

    opacity: 0.92;
}

.hub-sidebar__toggle:hover,
.hub-sidebar__link:hover,
.hub-sidebar__sublink:hover {
    background: var(--hub-sidebar-hover);
    color: #fff;
}

.hub-sidebar__item.is-active > .hub-sidebar__link,
.hub-sidebar__item.is-active > .hub-sidebar__toggle,
.hub-sidebar__sublink.is-active {
    background: var(--hub-sidebar-active);
    color: #fff;

    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}


/* ==================================================
   ŠIPKA PODMENU
   ================================================== */

.hub-sidebar__chevron {
    flex: 0 0 auto;

    color: var(--hub-sidebar-muted);

    transition:
        transform 0.2s ease,
        color 0.18s ease;
}

.hub-sidebar__toggle[aria-expanded="true"]
.hub-sidebar__chevron {
    transform: rotate(180deg);
    color: #fff;
}


/* ==================================================
   PODMENU
   ================================================== */

.hub-sidebar__sub {
    display: none;

    margin: 0 0 0 0.5rem;
    padding: 0.4rem 0 0;

    list-style: none;
}

.hub-sidebar__sub.is-open {
    display: block;
}

.hub-sidebar__sub li + li {
    margin-top: 0.25rem;
}

.hub-sidebar__sublink {
    justify-content: flex-start;

    padding: 0.7rem 0.95rem 0.7rem 2.65rem;

    color: var(--hub-sidebar-muted);
}

.hub-sidebar__sublink span {
    white-space: nowrap;
}


/* ==================================================
   PATIČKA SIDEBARU
   ================================================== */

.hub-sidebar__footer {
    flex: 0 0 auto;

    padding: 1rem 0.95rem 1.15rem;

    color: #fff;

    border-top: 1px solid var(--hub-sidebar-border);

    background: rgba(15, 23, 42, 0.28);

    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    transition: padding 0.2s ease;
}

.hub-sidebar__company {
    margin-bottom: 0.9rem;
}

.hub-sidebar__company .ts-control,
.hub-sidebar__company .form-select {
    min-height: 42px;
    border-radius: 12px;
}


/* ==================================================
   UŽIVATEL
   ================================================== */

.hub-sidebar__user {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 0.75rem;
}

.hub-sidebar__user-meta {
    min-width: 0;
}

.hub-sidebar__user-meta > div {
    overflow: hidden;

    white-space: nowrap;
    text-overflow: ellipsis;
}

.hub-sidebar__user-name {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
}

.hub-sidebar__user-role {
    margin-top: 0.15rem;

    font-size: 0.75rem;
    color: var(--hub-sidebar-muted);
}

.hub-sidebar__logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 42px;
    height: 42px;
    flex: 0 0 42px;

    border-radius: 12px;

    color: #fff;
    text-decoration: none;

    background: rgba(255, 255, 255, 0.08);

    transition:
        background-color 0.18s ease,
        transform 0.18s ease;
}

.hub-sidebar__logout:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;

    transform: translateY(-1px);
}


/* ==================================================
   MOBILNÍ BOOTSTRAP OFFCANVAS
   ================================================== */

.offcanvas.hub-sidebar--mobile {
    width: min(88vw, 320px);

    border-right: 1px solid var(--hub-sidebar-border);

    background:
        linear-gradient(
        180deg,
        var(--hub-sidebar-bg),
        var(--hub-sidebar-bg-2)
        );

    color: #fff;
}

.offcanvas.hub-sidebar--mobile .offcanvas-header,
.offcanvas.hub-sidebar--mobile .offcanvas-body {
    padding: 0;
    background-color: #13203c;
}

.offcanvas.hub-sidebar--mobile .offcanvas-body {
    display: flex;
    flex-direction: column;

    height: 100%;
    overflow: hidden;
}

.hub-sidebar--mobile .btn-close {
    filter: invert(1);
    opacity: 0.9;
}

.hub-sidebar--mobile .btn-close:hover {
    opacity: 1;
}


/* Na desktopu mobilní offcanvas nepotřebujeme */
@media (min-width: 992px) {
    .hub-sidebar--mobile {
        display: none !important;
    }
}


/* ==================================================
   MOBILNÍ HAMBURGER
   ================================================== */

.hub-mobile-trigger {
    position: fixed;
    top: 14px;
    left: 14px;

    z-index: 1045;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 48px;
    height: 48px;

    padding: 0;

    border: 0;
    border-radius: 14px;

    background: rgba(15, 23, 42, 0.92);
    color: #fff;

    box-shadow:
        0 12px 24px rgba(15, 23, 42, 0.22);

    font-size: 1.45rem;
    line-height: 1;

    cursor: pointer;

    transition:
        background-color 0.18s ease,
        transform 0.18s ease;
}

.hub-mobile-trigger:hover {
    background: rgba(30, 41, 59, 0.96);
    color: #fff;

    transform: translateY(-1px);
}

.hub-mobile-trigger:focus-visible {
    outline: 3px solid rgba(59, 130, 246, 0.5);
    outline-offset: 3px;
}

.hub-mobile-trigger i {
    display: block;
    line-height: 1;
}


/* Hamburger pouze tablet a mobil */
@media (max-width: 991.98px) {
    .hub-mobile-trigger {
        display: inline-flex !important;
    }
}


/* Hamburger skrýt na desktopu */
@media (min-width: 992px) {
    .hub-mobile-trigger {
        display: none !important;
    }
}


/* ==================================================
   MOBILNÍ MENU – VŽDY ZOBRAZIT TEXTY
   Ochrana před body.hub-sidebar-collapsed
   ================================================== */

@media (max-width: 991.98px) {
    .hub-sidebar--mobile .hub-sidebar__brand-text,
    .hub-sidebar--mobile .hub-sidebar__caption,
    .hub-sidebar--mobile .hub-sidebar__user-meta,
    .hub-sidebar--mobile .hub-sidebar__company,
    .hub-sidebar--mobile .hub-sidebar__chevron,
    .hub-sidebar--mobile .hub-sidebar__link-main span,
    .hub-sidebar--mobile .hub-sidebar__sublink span {
        display: initial !important;
    }

    .hub-sidebar--mobile .hub-sidebar__brand {
        justify-content: flex-start;
        width: auto;
    }

    .hub-sidebar--mobile .hub-sidebar__header {
        padding: 1.25rem 1.25rem 1rem;
    }

    .hub-sidebar--mobile .hub-sidebar__nav {
        padding: 1rem 0.875rem;
    }

    .hub-sidebar--mobile .hub-sidebar__footer {
        padding: 1rem 0.95rem 1.15rem;
    }

    .hub-sidebar--mobile .hub-sidebar__item {
        display: block;
    }

    .hub-sidebar--mobile .hub-sidebar__link,
    .hub-sidebar--mobile .hub-sidebar__toggle {
        display: flex;

        width: 100%;
        height: auto;

        margin: 0;
        padding: 0.85rem 0.95rem;

        place-items: initial;
        justify-content: space-between !important;
        align-items: center !important;
    }

    .hub-sidebar--mobile .hub-sidebar__link-main {
        display: inline-flex;
        align-items: center;
        justify-content: flex-start;

        width: auto;
        min-width: 0;
        flex: 1;

        gap: 0.875rem;
    }

    .hub-sidebar--mobile .hub-sidebar__sublink {
        display: flex;

        width: 100%;
        height: auto;

        padding: 0.7rem 0.95rem 0.7rem 2.65rem;
    }

    .hub-sidebar--mobile .hub-sidebar__user {
        justify-content: space-between;
    }

    .hub-sidebar--mobile .hub-sidebar__logout {
        margin: 0;
    }
}


/* ==================================================
   SBALENÝ SIDEBAR – POUZE DESKTOP
   ================================================== */

@media (min-width: 992px) {
    body.hub-sidebar-collapsed .hub-sidebar--desktop {
        width: var(--hub-sidebar-collapsed-width);
    }

    body.hub-sidebar-collapsed
    .hub-sidebar--desktop
    .hub-sidebar__header {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    body.hub-sidebar-collapsed
    .hub-sidebar--desktop
    .hub-sidebar__footer {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    body.hub-sidebar-collapsed
    .hub-sidebar--desktop
    .hub-sidebar__nav {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    body.hub-sidebar-collapsed
    .hub-sidebar--desktop
    .hub-sidebar__brand {
        justify-content: center;
        width: 100%;
    }

    body.hub-sidebar-collapsed
    .hub-sidebar--desktop
    .hub-sidebar__brand-text,

    body.hub-sidebar-collapsed
    .hub-sidebar--desktop
    .hub-sidebar__caption,

    body.hub-sidebar-collapsed
    .hub-sidebar--desktop
    .hub-sidebar__user-meta,

    body.hub-sidebar-collapsed
    .hub-sidebar--desktop
    .hub-sidebar__company,

    body.hub-sidebar-collapsed
    .hub-sidebar--desktop
    .hub-sidebar__chevron,

    body.hub-sidebar-collapsed
    .hub-sidebar--desktop
    .hub-sidebar__link-main span,

    body.hub-sidebar-collapsed
    .hub-sidebar--desktop
    .hub-sidebar__sublink span {
        display: none !important;
    }

    body.hub-sidebar-collapsed
    .hub-sidebar--desktop
    .hub-sidebar__caption {
        max-height: 0;
        margin-top: 0;
    }

    body.hub-sidebar-collapsed
    .hub-sidebar--desktop
    .hub-sidebar__item {
        display: flex;
        justify-content: center;
    }

    body.hub-sidebar-collapsed
    .hub-sidebar--desktop
    .hub-sidebar__link,

    body.hub-sidebar-collapsed
    .hub-sidebar--desktop
    .hub-sidebar__toggle {
        display: grid;
        place-items: center;

        width: 56px;
        height: 56px;

        margin: 0 auto;
        padding: 0;

        justify-content: center !important;
        align-items: center !important;

        border-radius: 16px;
    }

    body.hub-sidebar-collapsed
    .hub-sidebar--desktop
    .hub-sidebar__link-main {
        display: flex;
        align-items: center;
        justify-content: center;

        width: auto;
        min-width: 0;
        flex: 0 0 auto;

        gap: 0;
    }

    body.hub-sidebar-collapsed
    .hub-sidebar--desktop
    .hub-sidebar__link-main i {
        flex: 0 0 auto;

        margin: 0;

        font-size: 1.1rem;
        line-height: 1;
        text-align: center;
    }

    body.hub-sidebar-collapsed
    .hub-sidebar--desktop
    .hub-sidebar__sub {
        display: none !important;
    }

    body.hub-sidebar-collapsed
    .hub-sidebar--desktop
    .hub-sidebar__sublink {
        padding: 0;
    }

    body.hub-sidebar-collapsed
    .hub-sidebar--desktop
    .hub-sidebar__user {
        justify-content: center;
    }

    body.hub-sidebar-collapsed
    .hub-sidebar--desktop
    .hub-sidebar__logout {
        margin: 0 auto;
    }

    body.hub-sidebar-collapsed
    .hub-sidebar--desktop
    .hub-sidebar__collapse-btn i {
        transform: rotate(180deg);
    }
}


/* ==================================================
   BARVY MOBILNÍHO MENU
   ================================================== */

.hub-sidebar--mobile .hub-sidebar__link,
.hub-sidebar--mobile .hub-sidebar__toggle {
    color: #fff;
}

.hub-sidebar--mobile .hub-sidebar__link-main,
.hub-sidebar--mobile .hub-sidebar__link-main span,
.hub-sidebar--mobile .hub-sidebar__link i,
.hub-sidebar--mobile .hub-sidebar__toggle i {
    color: inherit;
}


/* ==================================================
   MENŠÍ MOBILNÍ DISPLEJE
   ================================================== */

@media (max-width: 575.98px) {
    .offcanvas.hub-sidebar--mobile {
        width: min(90vw, 320px);
    }

    .hub-mobile-trigger {
        top: 10px;
        left: 10px;

        width: 46px;
        height: 46px;

        border-radius: 13px;
    }
}