/* Основные стили */
* {
    font-family: 'Montserrat', sans-serif;
    --main-color: #004b8c;
    --second-color: rgb(69, 85, 100);
    --fon-color: #F1F6FB;
    --width-left: 14vw;
    --width-right: 85vw;
    --width-row-center: 20vw;
    --width-row-left: 25vw;
    --width-right-top-bar: 25vw;
    --width-line: 1vw;
    --header-height: 70px;
    --footer-height: 5vh;
    --fon-content-color: #c5d9f1;
}

/* Стили текста */
h1, h2, h3, h4 {
    font-size: clamp(16px, 2vw, 32px);
    transition: font-size 0.3s ease;
    line-height: 44px;
    font-weight: 600;
    color: var(--main-color);
    margin: 0;
}

p, span, a, li, label {
    font-size: clamp(10px, 1vw, 16px);
    transition: font-size 0.3s ease;
    line-height: 6vh;
    font-weight: 600;
    color: var(--main-color);
    margin: 0;
}
/*th, td {
    font-size: clamp(16px, 1vw, 16px);
}
*/

@-moz-document url-prefix() {
    .table-container {
        height: auto; /* Фикс высоты */
        min-height: 1px;
    }

    .table-header {
        height: auto;
        max-height: none;
    }
}
.table-body:empty {
    min-height: 100px; /* Минимальная высота для пустой таблицы */
    display: flex;
    align-items: center;
    justify-content: center;
}

    .table-body:empty::after {
        content: "Нет данных";
        color: #999;
    }
/* Стили для header */
header {
    height: auto;
}

    header .header-top .logo-container {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-self: center;
/*        border-radius: 10px 10px 0 0;*/
        position: sticky;
        top: 0;
    }

    header .header-top > * {
        background-color: var(--fon-color);
        border: 3px solid var(--main-color);
        box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
    }

    header .header-top .logo-container .logo-img {
        width: var(--width-left);
/*        height: calc(var(--width-left)/3.5);*/
        margin-left: 10px;
        display: flex;
        justify-content: center;
        align-self: center;
    }

    header .logo {
        width: 85%;
        height: 5%;
        min-height: 10px;
        object-fit: contain;
    }

    header .app-name {
        width: calc(var(--width-right) - var(--width-right-top-bar));
        display: flex;
        justify-content: left;
        align-self: center;
        margin-left: 1vw;
    }

    header .right-top-bar {
        width: var(--width-right-top-bar);
        display: flex;
        justify-content: right;
        padding-right: 40px;
        align-self: center;
    }

    header .session-info {
        width: 100%;
        height: auto;
        display: flex;
        justify-content: space-around;
        align-self: center;
        background-color: var(--fon-color);
        border: 3px solid var(--main-color);
        box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
        position: sticky;
        top: 0;
    }

    header .header-nav {
/*        display: flex;*/
        justify-content: space-around;
        align-self: center;
        padding-left: 5px;
    }

/* Стили для main */

.MAIN-MAIN {
    height: calc(100vh - var(--header-height) - var(--footer-height));
/*    height: auto;*/
    width: 100%;
}
main {
    height: auto;
    width: 100%;
}

    main .main-container {
        display: flex;
        justify-content: left;
        align-items: self-start;
        height: calc(100vh - var(--header-height) - var(--footer-height));
    }

    

    main aside {
        width: var(--width-left);
        height: auto;
        display: flex;
        justify-content: left;
        align-items: self-start;
        background-color: var(--fon-color);
        border-left: 3px solid var(--main-color);
        border-bottom: 3px solid var(--main-color);
/*        border-radius: 0 0 0 10px;*/
        box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
        height: calc(100vh - var(--header-height) - var(--footer-height));
        position: sticky;
        top: 0;
        overflow-y: auto;
    }

        main aside nav {
            width: 100%;
        }
        main aside .status {
            height: 4.5vh;
            line-height: 1;
            margin: 0;
            padding-left: 1vw;
        }
            main aside .status > * {
                padding-top:1vh;
                line-height: 1;
                margin: 0;
            }


    main .content-area {
        padding: 0;
        padding-left: var(--width-line);
        background-color: var(--main-color);
        border-color: black;
        border-width: 2px;
        border-style: solid;
        border-top: none;
        border-right: none;
        display: flex;
        justify-content: center;
        width: calc(100vw - var(--width-left) - var(--width-line));
    }

        main .content-area .page-content {
            background-color: white;
            padding: 1vh 1vw;
            height: auto;
            align-items: center;
            width: 100%;
        }

            main .content-area .page-content .controls-row{
                display:flex;
                align-items: center;
                justify-content: space-between;

            }
            /* Стили для навигационной панели */
    ul.tree-menu {
        margin: 0;
        list-style-type: none;
        text-align: center;
        padding: 0;
    }

    ul.tree-menu li {
        margin: 10px 0;
        display: inline-block;
        width: calc(100% - 20px);
        text-align: left;
        
    }

        ul.tree-menu li a {
            display: block;
            text-decoration: none;
            color: white;
            background-color: var(--second-color);
            border-radius: 5px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
            transition: background-color 0.3s ease;

        }
        ul.tree-menu li .list {
            display: flex;
            align-items: center;
/*            justify-content: space-between;*/
            text-decoration: none;
            color: white;
            background-color: var(--second-color);
            border-radius: 5px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
            transition: background-color 0.3s ease;
            padding-left: 1vw;
        }
            ul.tree-menu li .list:hover {
                background-color: var(--main-color);
            }
/*            ul.tree-menu li a:hover {
                background-color: var(--main-color);
            }*/

        ul.tree-menu li:not(:last-child) {
            margin-bottom: 10px;
        }


/* Стили для выпадающего меню */
li.dropdown-nav {
    position: relative;
    list-style: none;
    width: 100%;
}

a.dropdown-toggle-nav {
    cursor: pointer;
    display: block;
    text-decoration: none;
    border-radius: 5px;
    width: 100%;
    box-sizing: border-box;
}

ul.dropdown-menu-nav {
    display: none;
    position: absolute;
    margin: 0;
    padding: 0;
    list-style: none;
    padding-top: 2px;
    border-radius: 5px;
    border-width: 2px;
    border-block-color: var(--fon-color);
    width: 100%;
    left: 0;
    box-sizing: border-box;
    min-width: 0;
}

    ul.dropdown-menu-nav li {
        margin: 0;
        padding: 0;
        background-color: var(--fon-color);
        width: 100%;
    }

        ul.dropdown-menu-nav li a {
            display: block;
            text-decoration: none;
            color: white;
            background-color: var(--second-color);
            border: 5px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
            transition: background-color 0.3s ease;
            margin: 0;
            width: 100%;
            box-sizing: border-box;
        }

    ul.dropdown-menu-nav li {
        margin-bottom: 5px !important;
    }

        ul.dropdown-menu-nav li:first-child {
            margin-top: 4px !important;
        }

        ul.dropdown-menu-nav li a:hover {
            background: var(--main-color);
        }

    ul.dropdown-menu-nav.show {
        display: block;
    }



/* Стили для body */
body {
    margin: 0;
    height: 100vh;
    overflow: hidden;
}

.main-container {
    height: calc(100vh - var(--header-height));
    display: flex;
}

.content-area {
/*    overflow-y: auto;*/
    height: calc(100vh - var(--header-height) - var(--footer-height));
}

.table-manager {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
/*    padding: 16px 0px;*/
/*    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dadce0;*/
/*    margin-bottom: 20px;*/
/*    font-family: 'Roboto', 'Google Sans', Arial, sans-serif;*/
}

.table-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    margin: 0;
}

/*.stat-label {
    font-size: 14px;
    color: #5f6368;
    white-space: nowrap;
}*/

/*.stat-value {
    font-size: 14px;
    font-weight: 500;
    color: #202124;
    background-color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid #dadce0;
    min-width: 40px;
    text-align: center;
}*/

.table-item input {
    width: 80px;
    padding: 6px 12px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 14px;
    color: #202124;
}

    .table-item input:focus {
        outline: none;
        border-color: #1a73e8;
        box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
    }

/* Стили для кнопок, если добавятся */
/*.primary-btn {
    background-color: #1a73e8;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
}

    .primary-btn:hover {
        background-color: #1967d2;
    }*/


/* Стили для footer */
footer {
    display: flex;
    align-items: center;
    justify-content: center;
/*    width: calc(100vw - var(--width-left) -var(--width-line));*/
    width: 100vw;
/*    border-top: none !important;*/
    background-color: var(--fon-color);
    background-color: var(--fon-color);
    border: 3px solid var(--main-color);
    height: var(--footer-height);
}

    footer .footer-left {
        width: var(--width-left);

    }

    footer .footer-container {
        width: auto;
/*        border-top: 1px solid var(--second-color);*/
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: right;
        padding-right: 20px;
/*        padding-left: var(--width-line);*/
    }
    footer .footer-content {
        width: auto;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    footer .footer-div{
        padding-left: 4vw;


    }
    /* Стили для контекстного меню */
    .custom-context-menu {
        display: none;
        position: fixed;
        background-color: white;
        border: 1px solid #ddd;
        border-radius: 4px;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
        z-index: 1000;
        min-width: 180px;
    }

.menu-item {
    padding: 8px 12px;
    cursor: pointer;
}

    .menu-item:hover {
        background-color: #f5f5f5;
    }

/* Стили для поиска и подсветки */
.search-highlight {
    background-color: #ffeb3b;
    color: #000;
    font-weight: bold;
/*    padding: 2px 0;
    border-radius: 3px;*/
}

/* Стили для таблицы */

/* Контейнер для таблицы с прокруткой */
/*.table-container {
    max-height: 600px;
    overflow-y: auto;
}*/

/* Фиксированный заголовок */
.thead-fixed {
    position: sticky;
/*    top: 0;
    background: white;
    z-index: 10;
    box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);*/

}

/* Стили строк */

[data-show-in-table="false"] {
    display: none;
}

.Device-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
/*    margin-bottom: 1vh;*/
}

    .Device-tabs .tab-btn {
        padding: 0px 20px;
        background: none;
        border: none;
        border-bottom: 3px solid transparent;
        cursor: pointer;
        font-weight: 600;
        color: var(--second-color);
        text-decoration: none; /* Убираем подчеркивание у ссылок */
    }

        .Device-tabs .tab-btn.active {
            border-bottom-color: var(--main-color);
            color: var(--main-color);
        }

        .Device-tabs .tab-btn:hover {
            color: var(--main-color); /* Эффект при наведении */
        }
    .Device-tabs .tab-btn {
        transition: all 0.3s ease;
    }

.btn, .sel {
    background-color: var(--second-color);
    color: white;
    border: none;
    padding: min(8px, 0.5vw) min(15px, 0.5vh);
    border-radius: 4px;
    cursor: pointer;
    max-width: 100%;
    white-space: nowrap;
}

    /* ИСПРАВЛЕННЫЙ СЕЛЕКТОР: */
    .btn:hover {
        background-color: var(--main-color)
    }

    .sel:hover {
        background-color: var(--main-color);
    }

    /* Убираем подсветку когда select открыт (в фокусе) */
    .sel:focus, .sel:active {
        background-color: var(--second-color) !important;
    }
.sel {
    /* Remove the default arrow */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    /* Add a custom arrow */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 35px;
}
.sel_main, .btn_main {
    background-color: var(--fon-color);
    color: black;
    border: none;
    padding: min(8px, 0.5vw) min(15px, 0.5vh);
    border-radius: 3px;
    cursor: pointer;
    max-width: 100%;
    white-space: nowrap;
    border: 1px solid var(--main-color);
}
    .sel_main:hover, .btn_main:hover {
        background-color: var(--fon-content-color);
        /*        color: white;*/
    }

/* Убираем подсветку когда select открыт (в фокусе) */
    .sel_main:focus, .sel_main:active {
        background-color: var(--fon-color) !important;
        color: black;
    }

.sel_main {
    /* Remove the default arrow */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    /* Add a custom arrow */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 35px;
}

.pagination-controls {
    display: flex;
    align-items: center;
    /*    gap: 10px;*/
    /*    margin: 20px 0;*/
    padding-top: clamp(5px, 1vh, 12px);
}

.pagination-btn {
    padding: 0vh 0vw;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 4px;
}

    .pagination-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

    .pagination-btn:hover:not(:disabled) {
        background: var(--fon-color);
    }

.page-numbers {
    display: flex;
    align-items: center;
    min-height: clamp(15px, 2vh, 30px);
}

.page-number {
    padding: clamp(5px, 1vh, 12px) clamp(7px, 1vw, 10px);
    line-height: 1;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 4px;
    min-width: 2vw;
    text-align: center;
/*    max-width: 3vw;
    min-height: 2vh;*/
    margin: 0 3px;
}

    .page-number.active {
        background: var(--fon-content-color);
/*        color: white;*/
/*        border-color: var(--main-color);*/
    }

.page-info {
    margin-left: 15px;
    font-weight: bold;
}

.page-size-selector {
    margin: 10px 0;
}

    .page-size-selector select {
        padding: 5px;
        border: 1px solid #ddd;
        border-radius: 4px;
    }


.disabled {
    opacity: 0.6;
    pointer-events: none;
    cursor: not-allowed;
    text-decoration: none;
}
.page-info {
    margin-left: 1vw;
    font-weight: bold;
}
.page-size-selector {
    margin: 0 0;
}

/*.admin_show {
    visibility: hidden;
}*/

.filter-container {
  position: relative;
  display: inline-block;
}

.filter-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border: 1px solid #ccc;
  padding: 10px;
  z-index: 1000;
  min-width: 200px;
  white-space: nowrap;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  margin-top: 5px;
}

.dropdown-content {
  max-height: 300px;
  overflow-y: auto;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  cursor: pointer;
  border-radius: 3px;
  transition: background-color 0.2s;
}

.checkbox-item:hover {
  background-color: #f5f5f5;
}

.checkbox-item input[type="checkbox"] {
  cursor: pointer;
}

.checkbox-item span {
  user-select: none;
}

.dropdown-content::-webkit-scrollbar {
  width: 6px;
}

.dropdown-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.dropdown-content::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}
