:root {
    /* UI settings: меняйте значения здесь */
    --ui-font-size-sm: 0.9rem;
    --ui-font-size-base: 0.95rem;
    --ui-font-size-lg: 1rem;
    --ui-gap-sm: 0.35rem;
    --ui-gap-base: 0.5rem;
    --ui-gap-lg: 0.7rem;
    --ui-padding-y-sm: 0.22rem;
    --ui-padding-x-sm: 0.5rem;
    --ui-padding-card: 0.75rem;
    --ui-radius-sm: 10px;
    --ui-radius-base: 12px;
    --ui-radius-lg: 18px;

    --ct-logo-lg-height: 30px;
    --ct-logo-sm-height: 30px;
    
    /* --ct-leftbar-width-calendar: 300px; */

}

html,
body {
    height: 100%;
    overflow: hidden;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
}

.wrapper {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.logo-lg img {
    margin-top: 10px;
    width: 150px;
    height: auto;
}

.leftside-menu {
    padding-bottom: 0; /* Убрал у меню снизу отступ */
}
.content-page {
    padding-bottom: 0 !important; /* Убрал у контента снизу отступ */
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#register-toolbar {
    flex: 0 0 auto;
}

.content-page > .content,
#swup {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.topbar-module-trigger {
    min-width: 300px;
    display: inline-flex;
    align-items: center;
    gap: var(--ui-gap-lg);
    padding: var(--ui-padding-y-sm) var(--ui-padding-x-sm);
    border-radius: var(--ui-radius-base);
    background: transparent;
    color: #2b5b71;
    font-size: var(--ui-font-size-base);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.topbar-module-trigger:hover,
.topbar-module-trigger:focus {
    color: #21495b;
    background: rgba(120, 185, 216, 0.08);
}

.topbar-module-trigger::after {
    margin-left: auto;
}

.topbar-module-trigger-icon {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(120, 185, 216, 0.12);
    color: #2f96be;
    font-size: var(--ui-font-size-lg);
    flex: 0 0 auto;
    border-radius: var(--ui-radius-sm);
}

.topbar-module-trigger-text {
    min-width: 0;
    line-height: 1.2;
}

.topbar-module-menu {
    min-width: 320px;
    border: 1px solid rgba(120, 185, 216, 0.18);
    border-radius: var(--ui-radius-lg);
    padding: var(--ui-gap-base);
    box-shadow: 0 18px 40px rgba(27, 88, 114, 0.14);
}

.topbar-module-menu .dropdown-item {
    display: flex;
    align-items: center;
    border-radius: var(--ui-radius-base);
    padding: var(--ui-gap-lg) 0.85rem;
    font-weight: 600;
    color: #315c70;
}

.topbar-module-menu .dropdown-item i {
    font-size: 1.1rem;
    color: #2f96be;
}

.topbar-module-menu .dropdown-item.active,
.topbar-module-menu .dropdown-item:active,
.topbar-module-menu .dropdown-item:hover {
    background: rgba(120, 185, 216, 0.14);
    color: #1f4b5f;
}

/* topbar bonus */
/* Меняйте значения прямо здесь */
.topbar-bonus-item {
    padding: 1px 5px 0 0px;
}

.topbar-bonus-link {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    padding: 0.25rem 0;
    color: #315c70;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    line-height: 1.1;
}

.topbar-bonus-link:hover,
.topbar-bonus-link:focus {
    color: #1f4b5f;
}

.topbar-bonus {
    border-bottom: 1px solid #6c757d;
    padding-bottom: 0px; 
}

.topbar-bonus-label {
    opacity: 0.8;
    font-size: 1.1rem;
}

.topbar-bonus-value {
    font-size: 1.2rem;
    letter-spacing: 0.02em;
    line-height: 0.9;
}

.topbar-bonus-icon {
    font-size: 1.2rem;
    opacity: 0.9;
    line-height: 0.9;    
}

html[data-theme=dark] .topbar-module-trigger,
[data-theme=dark] .topbar-module-trigger {
    background: transparent;
    color: #e6eef6;
}

html[data-theme=dark] .topbar-module-trigger:hover,
[data-theme=dark] .topbar-module-trigger:hover,
html[data-theme=dark] .topbar-module-trigger:focus,
[data-theme=dark] .topbar-module-trigger:focus {
    background: rgba(120, 185, 216, 0.08);
    color: #ffffff;
}

html[data-theme=dark] .topbar-module-trigger-icon,
[data-theme=dark] .topbar-module-trigger-icon {
    background: rgba(120, 185, 216, 0.12);
    color: #7fc6e1;
}

html[data-theme=dark] .topbar-module-menu,
[data-theme=dark] .topbar-module-menu {
    background: #313a46;
    border-color: #465364;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

html[data-theme=dark] .topbar-module-menu .dropdown-item,
[data-theme=dark] .topbar-module-menu .dropdown-item {
    color: #dce8f3;
}

html[data-theme=dark] .topbar-module-menu .dropdown-item i,
[data-theme=dark] .topbar-module-menu .dropdown-item i {
    color: #7fc6e1;
}

html[data-theme=dark] .topbar-module-menu .dropdown-item.active,
[data-theme=dark] .topbar-module-menu .dropdown-item.active,
html[data-theme=dark] .topbar-module-menu .dropdown-item:hover,
[data-theme=dark] .topbar-module-menu .dropdown-item:hover,
html[data-theme=dark] .topbar-module-menu .dropdown-item:active,
[data-theme=dark] .topbar-module-menu .dropdown-item:active {
    background: rgba(120, 185, 216, 0.14);
    color: #ffffff;
}

html[data-theme=dark] .topbar-bonus-link,
[data-theme=dark] .topbar-bonus-link {
    color: #dce8f3;
}

html[data-theme=dark] .topbar-bonus-link:hover,
[data-theme=dark] .topbar-bonus-link:hover,
html[data-theme=dark] .topbar-bonus-link:focus,
[data-theme=dark] .topbar-bonus-link:focus {
    color: #ffffff;
}

.scroll-card {
    height: auto;
    overflow: visible;
}

.scroll-card .table-responsive {
    max-height: calc(100vh - 255px);
    overflow-y: auto;
}

@media (max-width: 991.98px) {
    .scroll-card .table-responsive {
        max-height: calc(100vh - 305px);
    }
}

@media (max-width: 575.98px) {
    .scroll-card .table-responsive {
        max-height: calc(100vh - 335px);
    }
}

html[data-theme=dark] .scroll-card,
[data-theme=dark] .scroll-card {
    background-color: #313a46;
    border-color: #465364;
}

html[data-theme=dark] #register-toolbar .card,
[data-theme=dark] #register-toolbar .card,
html[data-theme=dark] #register-toolbar .card-body,
[data-theme=dark] #register-toolbar .card-body {
    background-color: #313a46;
    border-color: #465364;
}

html[data-theme=dark] .scroll-card .card-body,
[data-theme=dark] .scroll-card .card-body,
html[data-theme=dark] .scroll-card .table-responsive,
[data-theme=dark] .scroll-card .table-responsive {
    background-color: #313a46;
}

html[data-theme=dark] .scroll-card .table-light,
[data-theme=dark] .scroll-card .table-light,
html[data-theme=dark] .scroll-card .table-light th,
[data-theme=dark] .scroll-card .table-light th,
html[data-theme=dark] .scroll-card .table-light td,
[data-theme=dark] .scroll-card .table-light td {
    background-color: #2a333d;
    color: #dce8f3;
    border-color: #465364;
}

html[data-theme=dark] .scroll-card .table > :not(caption) > * > *,
[data-theme=dark] .scroll-card .table > :not(caption) > * > * {
    border-color: #465364;
}

html[data-theme=dark] .content-page > .content,
[data-theme=dark] .content-page > .content,
html[data-theme=dark] #swup,
[data-theme=dark] #swup {
    background-color: var(--ct-body-bg);
    scrollbar-color: #566272 #2a333d;
}

html[data-theme=dark] .content-page > .content::-webkit-scrollbar,
[data-theme=dark] .content-page > .content::-webkit-scrollbar,
html[data-theme=dark] #swup::-webkit-scrollbar,
[data-theme=dark] #swup::-webkit-scrollbar {
    width: 8px;
}

html[data-theme=dark] .content-page > .content::-webkit-scrollbar-track,
[data-theme=dark] .content-page > .content::-webkit-scrollbar-track,
html[data-theme=dark] #swup::-webkit-scrollbar-track,
[data-theme=dark] #swup::-webkit-scrollbar-track {
    background: #2a333d;
}

html[data-theme=dark] .content-page > .content::-webkit-scrollbar-thumb,
[data-theme=dark] .content-page > .content::-webkit-scrollbar-thumb,
html[data-theme=dark] #swup::-webkit-scrollbar-thumb,
[data-theme=dark] #swup::-webkit-scrollbar-thumb {
    background: #566272;
    border-radius: 4px;
}

html[data-theme=dark] .content-page > .content::-webkit-scrollbar-thumb:hover,
[data-theme=dark] .content-page > .content::-webkit-scrollbar-thumb:hover,
html[data-theme=dark] #swup::-webkit-scrollbar-thumb:hover,
[data-theme=dark] #swup::-webkit-scrollbar-thumb:hover {
    background: #697689;
}

html[data-theme=dark] .scroll-card::-webkit-scrollbar,
[data-theme=dark] .scroll-card::-webkit-scrollbar {
    width: 8px;
}

html[data-theme=dark] .scroll-card::-webkit-scrollbar-track,
[data-theme=dark] .scroll-card::-webkit-scrollbar-track {
    background: #2a333d;
}

html[data-theme=dark] .scroll-card::-webkit-scrollbar-thumb,
[data-theme=dark] .scroll-card::-webkit-scrollbar-thumb {
    background: #566272;
    border-radius: 4px;
}

html[data-theme=dark] .scroll-card::-webkit-scrollbar-thumb:hover,
[data-theme=dark] .scroll-card::-webkit-scrollbar-thumb:hover {
    background: #697689;
}

@media (max-width: 767.98px) {
    :root {
        --mobile-topbar-offset: 104px;
    }

    html,
    body,
    .wrapper,
    .content-page {
        height: auto;
        min-height: 100dvh;
    }

    html {
        overflow-y: auto;
    }

    body {
        overflow-x: hidden;
        overflow-y: auto;
    }

    .wrapper,
    .content-page {
        overflow-x: hidden;
        overflow-y: visible;
    }

    .navbar-custom {
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        z-index: 1045;
        transform: none !important;
    }

    .content-page {
        padding-top: calc(var(--mobile-topbar-offset) + env(safe-area-inset-top)) !important;
    }

    .content-page > .content,
    #swup {
        overflow-y: visible;
    }


    .navbar-custom .topbar-menu {
        margin: -22px -23px 0px 0px;
    }

    .navbar-custom .topbar {
        min-height: auto;
        padding-top: max(0.5rem, env(safe-area-inset-top));
        padding-bottom: 0.5rem;
    }

    .topbar-bonus {
        border-bottom: 1px solid #6c757d;
        padding-bottom: 0px; 
        margin-right: 10px;
    }

    .topbar-bonus-value {
        font-size: 1rem;
        letter-spacing: 0.02em;
        line-height: 0.9;
    }

    .topbar-bonus-icon {
        font-size: 1rem;
        opacity: 0.9;
        line-height: 0.9;    
    }

    .navbar-custom .topbar.container-fluid {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
        column-gap: 0.75rem;
        row-gap: 0.75rem;
        padding-top: 15px !important;
    }

    .navbar-custom .topbar .d-flex.align-items-center.gap-lg-2.gap-1 {
        width: auto;
        min-width: 0;
        display: flex;
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 0.5rem !important;
        margin: 0;
        justify-content: flex-start;
        align-items: flex-start !important;
    }

    .navbar-custom .topbar .ms-2,
    .navbar-custom .topbar .ms-1 {
        margin-left: 0 !important;
    }

    .navbar-custom .topbar img[alt="logo"] {
        width: 132px !important;
        max-width: 100%;
        height: auto;
    }

    .topbar-module-dropdown {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start;
        min-width: 0;
        position: relative;
        margin-left: -3px;
    }

    .topbar-module-trigger {
        width: 100% !important;
        min-width: 0;
        max-width: 100%;
        font-size: var(--ui-font-size-sm);
        padding-left: 0;
        justify-content: flex-start;
        text-align: left;
    }

    .topbar-module-menu {
        position: absolute !important;
        top: calc(100% + 0.5rem) !important;
        left: 0 !important;
        inset: auto auto auto 0 !important;
        transform: none !important;
        margin-top: 0.5rem !important;
        min-width: min(100vw - 1.5rem, 320px);
        width: min(100vw - 1.5rem, 320px);
        z-index: 1055;
    }

    .topbar-menu {
        width: auto;
        display: flex !important;
        flex-wrap: nowrap;
        justify-content: flex-end;
        align-items: center;
        align-self: start;
        margin: 0;
        gap: 0.5rem !important;
        padding-left: 0;
        white-space: nowrap;
    }

    .topbar-menu > li {
        flex: 0 0 auto;
    }


    #register-toolbar .card {
        margin-bottom: 0.75rem !important;
    }

    #register-toolbar .card-body {
        padding: var(--ui-padding-card) !important;
    }

    #register-toolbar .d-flex {
        align-items: stretch !important;
    }

    #register-toolbar .form-select,
    #register-toolbar .form-control,
    #register-toolbar .btn {
        width: 100%;
        max-width: 100% !important;
    }

    .content-page > .content {
        padding-top: 0.5rem !important;
    }

    .scroll-card {
        height: auto;
        max-height: none;
        overflow-x: visible;
        overflow-y: visible;
    }

    .table-responsive {
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
    }

    .table-responsive .table,
    .table-responsive .table th,
    .table-responsive .table td,
    .table-responsive .table-light th,
    .table-responsive .table-light td {
        white-space: nowrap;
    }
}
.dropdown-toggle::after {
    display: none;
}
/*было сделано для выпадаюшего списка работников */
.list-group-item {
    padding: 6px 15px 6px 11px;
}

#profile .avatar-lg {
    height: 10rem;
    width: 10rem;
}

.timeline-icon {
    font-size: 13px !important;
}

#documents .list-group-item {
    padding: 4px 15px 4px 11px;
}


/* Устанавливаем 100% высоту для board */
.board {
    height: 100%;
    flex-direction: column; /* Если нужно вертикальное распределение */
}

/* Делаем блок tasks прокручиваемым */
.tasks {
    overflow-y: auto; /* Прокрутка по вертикали */
    min-height: 100%; /* Ограничиваем высоту, чтобы не выходило за границы board */
    /* box-sizing: border-box; */ /* Чтобы отступы учитывались в общей высоте */
    margin: 0px;
}
.tasks.tasks:not(:last-child) {
    margin-right: 0.25rem;
}

/* Расписание: базовые размеры колонок */
.board .tasks {
    width: 14rem;
    padding: 0 0.5rem;
}
.board .tasks.time-scale {
    width: 4rem;
    padding: 0;
}
.board .tasks .task-header {
    margin: 0 -0.5rem;
}

.rasp > :not(caption) > * > * {
    padding: 0.2rem 0.1rem 0.1rem 0.1em;
}
.popover {
    max-width: 340px; /* Максимальная ширина */
    width: 340px;     /* Фиксированная ширина */
}


.choices__inner {
    min-height: 38px;
    padding: 2.5px 7.5px 3.75px;
    background-color: transparent;
    font-size: .9rem;
}

.choices[data-type*=select-one] .choices__inner {
    padding-bottom: 0;
}

.dropdown-menu {
    width: auto !important;
}

html[data-theme=dark] .toast,
[data-theme=dark] .toast {
    background-color: #313a46;
    color: #e6eef6;
    border: 1px solid #465364;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

html[data-theme=dark] .toast .toast-header,
[data-theme=dark] .toast .toast-header {
    background-color: #2a333d;
    color: #d7e8f5;
    border-bottom-color: #465364;
}

html[data-theme=dark] .toast .toast-header strong,
[data-theme=dark] .toast .toast-header strong,
html[data-theme=dark] .toast .toast-header small,
[data-theme=dark] .toast .toast-header small {
    color: #d7e8f5 !important;
}

html[data-theme=dark] .toast .toast-body,
[data-theme=dark] .toast .toast-body {
    color: #eef4fa;
}

html[data-theme=dark] .toast .btn-close,
[data-theme=dark] .toast .btn-close {
    filter: invert(1) grayscale(100%);
}

/* Темная тема для tasks и task-header */
html[data-theme=dark] .tasks,
[data-theme=dark] .tasks {
  background-color: var(--ct-body-bg);
  border-color: var(--ct-gray-300);
}

html[data-theme=dark] .tasks .task-header,
[data-theme=dark] .tasks .task-header {
  background-color: var(--ct-card-bg-custom);
  color: var(--ct-body-color);
  border-bottom-color: var(--ct-gray-300);
}

/* Стили для скроллбара в темной теме */
html[data-theme=dark] .tasks::-webkit-scrollbar,
[data-theme=dark] .tasks::-webkit-scrollbar {
  width: 8px;
}

html[data-theme=dark] .tasks::-webkit-scrollbar-track,
[data-theme=dark] .tasks::-webkit-scrollbar-track {
  background: var(--ct-body-bg);
}

html[data-theme=dark] .tasks::-webkit-scrollbar-thumb,
[data-theme=dark] .tasks::-webkit-scrollbar-thumb {
  background: var(--ct-gray-300);
  border-radius: 4px;
}

html[data-theme=dark] .tasks::-webkit-scrollbar-thumb:hover,
[data-theme=dark] .tasks::-webkit-scrollbar-thumb:hover {
  background: var(--ct-gray-400);
}

/* ---------------- */
/* КАЛЕНДАРЬ В МЕНЮ */
/* ---------------- */
html[data-sidenav-size=condensed]:not([data-layout=topnav]) .wrapper .leftside-menu .side-nav .side-nav-item:hover .side-nav-link {
    width: calc(250px + var(--ct-leftbar-width-sm));
}

html[data-sidenav-size=condensed]:not([data-layout=topnav]) .wrapper .leftside-menu .side-nav .side-nav-item:hover > .collapse > ul {
    padding: 0 !important; /* Для календаря при свернутом виде в меню */
    width: 250px;
}

/* Для отображение иконки календаря при сварачивание меню */
html[data-sidenav-size=condensed]:not([data-layout=topnav]) .wrapper .leftside-menu .uil-calendar-alt {
    display: block !important;
}

/* Относительное позиционирование для side-nav-item с календарем в свернутом меню */
html[data-sidenav-size=condensed]:not([data-layout=topnav]) .wrapper .leftside-menu .side-nav-item.calendar-item {
    position: relative;
}

/* Скрываем календарь в свернутом меню */
html[data-sidenav-size=condensed]:not([data-layout=topnav]) .wrapper .leftside-menu #calendar {
    display: none !important;
}

/* Показываем календарь при наведении на элемент меню */
html[data-sidenav-size=condensed]:not([data-layout=topnav]) .wrapper .leftside-menu .side-nav-item:hover #calendar {
    display: block !important;
    position: absolute;
    left: var(--ct-leftbar-width-sm);
    top: 0;
    background: var(--ct-menu-bg);
    box-shadow: 0 0 35px 0 rgba(154, 161, 171, 0.15);
    z-index: 1000;
    padding: 1rem 0.5rem 0.25rem 0.5rem;
}

/* Убираем padding для календаря в свернутом меню */
html[data-sidenav-size=condensed]:not([data-layout=topnav]) .wrapper .leftside-menu .side-nav-item:hover #calendar > ul {
    padding: 0 !important;
    width: 250px;
}

/* Скрываем календарь в режиме sm-hover */
html[data-sidenav-size=sm-hover]:not([data-layout=topnav]) .wrapper .leftside-menu #calendar {
    display: none !important;
}

/* Показываем календарь при наведении в режиме sm-hover */
html[data-sidenav-size=sm-hover]:not([data-layout=topnav]) .wrapper .leftside-menu:hover #calendar,
html[data-sidenav-size=sm-hover-active]:not([data-layout=topnav]) .wrapper .leftside-menu #calendar {
    display: block !important;
}

/* Стили для календаря в режиме sm-hover при наведении */
html[data-sidenav-size=sm-hover]:not([data-layout=topnav]) .wrapper .leftside-menu:hover .side-nav-item #calendar,
html[data-sidenav-size=sm-hover-active]:not([data-layout=topnav]) .wrapper .leftside-menu .side-nav-item #calendar {
    position: relative;
}

html[data-sidenav-size=sm-hover]:not([data-layout=topnav]) .wrapper .leftside-menu:hover #calendar > ul,
html[data-sidenav-size=sm-hover-active]:not([data-layout=topnav]) .wrapper .leftside-menu #calendar > ul {
    padding: 0 10px !important;
}

/* Дополнение для таблицы еще меньше чем table-sm */
.table-xs tr {
    line-height: 1; /* Уменьшает высоту строки */
}
.table-xs td {
    padding: 0.4rem; /* Уменьшает внутренние отступы */
}
