:root {
    --primary-button-color: rgb(0, 147, 195);
    --primary-button-bg-color: #eff6fa;

}

body {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    font-size: 14px;
    background-color: #f9f9f9;
}

input, select {
    height: 40px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-weight: 500;
}
input[disabled], select[disabled] {
    color: #000;
}
button {
    border-radius: 8px;
    border: 1px solid #ccc;
    padding: 10px 20px;
}
button:hover {
    background-color: #bbb;
}
option {
    height: 40px;
}

p, h1, h2, h3, h4 {
    padding: 0;
    margin: 0;
    margin-block: 0;
}

a {
    color: var(--primary-button-color);
}

* {
    font-family: Montserrat, Arial, sans-serif;
    box-sizing: border-box; /* Исправлено на border-box */
}

.hidden {
    display: none !important;
}

.no-wrap {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.text-right {
    text-align: right !important;
}
.text-center {
    text-align: center;
}

.status {
    border-radius: 10px;
    text-align: center;
}
.status.primary {
    background-color: #0093c3;
    color: #d6eef5;
}
.status.secondary {
    background-color: #ecedee;
    color: #8a8d93;
}
.status.error {
    background-color: #ffe2e3;
    color: #ff5d62;
}
.status.success {
    background-color: #e4f6d6;
    color: #56ca00;
}
.status.warning {
    background-color: #fff3d6;
    color: #ffb400;
}
.status.info {
    background-color: #daf2ff;
    color: #16b1ff;
}


.header {
    display: flex;
    align-items: center;
    background-color: #007bff; /* Цвет шапки */
    padding: 10px 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    color: white; /* Цвет текста */
}
.header-off {
    margin-top: -70px;
}

.header h1 {
    margin: 0;
    flex-grow: 1;
    text-align: center;
}

.burger {
    font-size: 24px;
    border: none;
    background: none;
    cursor: pointer;
    color: white; /* Цвет иконки бургер */
}

.sidebar {
    width: 240px;
    background-color: #fff;
    box-shadow: rgba(0,0,0,0.1) 2px 0 20px;
    /*padding: 20px;*/
    position: fixed;
    top: 00px; /* Высота шапки */
    bottom: 0;
    left: 0;
    transition: transform 0.3s ease-in-out;
    z-index: 999;
    overflow-y: auto;
}

.sidebar.hidden {
    transform: translateX(-100%);
}

.nav ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.nav li {
    /*margin: 15px 0;*/
    height: 50px;

}
.nav li.active {
    background-color: #eff6fa;
}

.nav a {
    /*margin-left: 20px;*/
    margin-left: 10px;
    text-decoration: none;
    color: #333;
    display: flex;
    align-items: center;
    line-height: 50px;
}
.nav li.active a {
    color: var(--primary-button-color);
}

.nav a i {
    margin-right: 10px;
    width: 20px;
}



.sidebar {
    width: 250px; /* Полная ширина панели */
    transition: width 0.3s ease; /* Анимация для плавного перехода ширины */
    overflow: hidden; /* Скрытие содержимого при сворачивании */
    white-space: nowrap; /* Отключить перенос слов */
}

.sidebar.collapsed {
    width: 70px; /* Ширина панели, когда она свернута */
}

.sidebar ul {
    padding-left: 0;
    transition: opacity 0.3s ease; /* Анимация для плавного перехода прозрачности текста */
}

.sidebar ul li a {
    display: flex; /* Разместить иконку и текст в строку */
    align-items: center;
    padding: 10px;
    color: #333;
    text-decoration: none;
    height: 50px;
    line-height: 50px;
}
.sidebar ul li:hover {
    background-color: #f0f0f0;
}
.sidebar ul li a i {
    min-width: 30px; /* Задаем фиксированную ширину для иконок */
    text-align: center;
    font-size: 18px;
}

.sidebar.collapsed ul li a span {
    display: none; /* Скрываем текст при свернутой панели */
}

.sidebar.collapsed ul li a:hover span {
    display: inline; /* Показываем текст при наведении на элемент */
}

.nav-header {
    display: flex;
    align-items: center;
    padding: 10px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #ddd;
}

.nav-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #333;
    outline: none;
}

.nav-toggle-btn.active {
    color: #007bff;
}

.nav-toggle-btn i {
    transition: transform 0.3s ease;
}

.nav-toggle-btn.active i {
    transform: rotate(180deg);
}





@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .main-content {
        margin-left: 0;
    }

    .burger {
        display: block;
    }
}


.page {
    /*margin-left: 240px;*/
    margin-left: 90px;
    padding: 40px 40px 40px 40px; /* Учитываем высоту шапки */
}

.main-content {
    border-radius: 1px;
    background-color: #ffffff;
    box-shadow: rgba(0,0,0,0.1) 0 0 20px;
    flex-grow: 1;
    transition: margin-left 0.3s ease-in-out;
}

.search-and-add {
    padding: 10px 20px 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    /*margin-bottom: 20px;*/
}

.search-and-add input {
    padding: 10px;
    width: 300px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.add-project-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.add-project-btn i {
    margin-right: 5px;
}

.add-project-btn:hover {
    background-color: #0056b3;
}

.loader {
    border: 16px solid #f3f3f3;
    border-top: 16px solid #3498db;
    border-radius: 50%;
    width: 120px;
    height: 120px;
    animation: spin 2s linear infinite;
    margin: 20px auto;
    /*display: none;*/
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.table-container {
    width: 100%;
    overflow-x: auto;
}
.table {
    background-color: #fff;
    width: 100%;
    border-collapse: collapse;
    /*display: none; !* Изначально скрыта *!*/
}
.table th, .table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
    font-weight: 500;
}
.table th {
    background-color: #f1f1f1;
    position: relative;
    padding-right: 20px;
    font-size: 12px;
}
.table th i {
    position: absolute;
    right: 10px;
    top: 10px;
}
.table tr:hover {
    background-color: var(--primary-button-bg-color);
    cursor: pointer;
}

.status {
    padding: 5px 10px;
    border-radius: 4px;
    color: white;
    background-color: #bbb;
}
.status.draft {
    background-color: #6c757d;
}
.status.funding {
    background-color: #17a2b8;
}

.debtor {
    color: red;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    padding: 20px 0;
}
.pagination button {
    padding: 10px 20px;
    border: none;
    background-color: #007bff;
    color: white;
    cursor: pointer;
    border-radius: 4px;
    margin: 0 5px;
}
.pagination button:disabled {
    background-color: #ccc;
}
.pagination span {
    margin: 0 10px;
}

.search-form {
    display: flex;
    border: 1px solid #ccc;
    border-radius: 4px;
    overflow: hidden;
    background-color: white;
}
.search-form input {
    flex: 1;
    padding: 10px;
    border: none;
    outline: none;
}
.search-form button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
}
.search-form button:hover {
    background-color: #0056b3;
}

ul.debtor-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}
.debtor-list li {
    list-style-type: none;
    padding: 4px;
    margin: 4px 4px 0 0;
    border-radius: 5px;
    border: 1px solid #ff3d77;
    color: #ff3d77;
    /*white-space: nowrap;*/
    display: inline-block;
}


.form {
    /*max-height: 60vh;*/
    /*overflow-y: auto;*/
    padding: 20px 20px 80px 20px;
}

.form table th {
    font-weight: 400;
    font-size: 12px;
}

.form-header, .form-footer {
    flex-shrink: 0;
    display: flex;
    width: 100%;
}
.form-header {
    padding: 20px 20px 20px 20px;
    border-bottom: 1px solid #bbb;
    box-shadow: rgba(0, 0, 0, 0.1) 0 1px 6px;
    padding-right: 40px;
}
.form-footer {
    padding: 20px 20px 20px 20px;
    border-top: 1px solid #bbb;
    box-shadow: rgba(0, 0, 0, 0.1) 0 -1px 6px;
    gap: 10px;
}
.form-header select {
    margin: 0;
    max-width: 200px;
    margin-right: 20px;
}
.form-header select.status {
    border-radius: 10px;
}
.form-header select.status[disabled] {
    border: none;
    -webkit-appearance: none;  /* Убирает стрелку в WebKit-браузерах (Chrome, Safari) */
    -moz-appearance: none;     /* Убирает стрелку в Firefox */
    appearance: none;          /* Убирает стрелку в других поддерживающих браузерах */
}
option {
    background-color: #fff !important;
    color: #000 !important;
    text-align: left !important;
}
.form-header h2 {
    margin: 0;
    width: 100%;
    font-size: 18px;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.form-header-edit {
    /*width: 40px;*/
    flex-shrink: 0;
    margin-right: 20px;
}

.payment-confirmed-ctl {
    display: flex;
    justify-content: center;
    align-items: center;
}

.form-body label {
    display: block;
    margin: 10px 0 5px;
    text-transform: uppercase;
    font-size: 10px;
}
.form-body input,
.form-body textarea,
.form-body select {
    width: 100%;
    margin-bottom: 10px;
}
.form-body textarea {
    height: 80px;
}
.form-body {
    flex-grow: 1;
    overflow-y: auto;
}

.form-row {
    display: flex;
    justify-content: space-between;
    position: relative;
    gap: 10px;
}
.form-row.column {
    display: block;
}
.form-column {
    width: 48%;
    position: relative;
}
.form-column-100 {
    width: 100%;
}
.form-column-icon-fixed {
    width: 60px;
    flex-shrink: 0;
}
.form-row-column a {
    margin: 10px 0 15px 0;
    display: block;
}

.close {
    color: var(--primary-button-color);
    float: right;
    font-size: 28px;
    /* font-weight: bold; */
    position: absolute;
    right: 16px;
    top: 26px;
    border-radius: 8px;
    width: 30px;
    height: 30px;
    /* background-color: #ee9966; */
    text-align: center;
    line-height: 30px;
    font-size: 34px;
    font-weight: 300;
}
.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.modal-open {
    overflow: hidden;
}
.modal-content {
    position: relative;
    background-color: #fefefe;
    margin: auto auto;
    /* padding: 20px; */
    border: 1px solid #888;
    width: 80%;
    max-height: 90%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-width: 900px;
    border-radius: 10px;
    box-shadow: rgba(0, 0, 0, 0.1) 0 0 30px;
}

.dropdown-content {
    position: absolute;
    background-color: #f9f9f9;
    min-width: 160px;
    box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
    z-index: 1000;
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid #ddd;
    max-width: 100%;
    margin-top: -10px;
}
.dropdown-item {
    padding: 8px 16px;
    cursor: pointer;
}
.dropdown-item:hover, .dropdown-item.dropdown-active {
    background-color: #f1f1f1;
}
.bold {
    font-weight: 600;
}

.selected-debtors {
    margin-top: 10px;
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 4px;
    background-color: #f9f9f9;
    max-height: 150px;
    overflow-y: auto;
}

.debtor-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px;
    border-bottom: 1px solid #ddd;
}
.debtor-item:last-child {
    border-bottom: none;
}
.debtor-item button {
    background: none;
    border: none;
    color: #ff0000;
    cursor: pointer;
}
.debtor-item button:hover {
    color: #cc0000;
}

.dropdown-results {
    position: absolute;
    background-color: white;
    border: 1px solid #ccc;
    max-height: 200px;
    overflow-y: auto;
    width: 100%;
    z-index: 1000;
    margin-top: -10px;
    max-width: 100%;
}

.missing-field {
    border: 2px solid red;
}

.invalid label {
    color: #f00;
}
.invalid input {
    border-color: #f00;
    outline-color: #f00;
}

.multi-select-search-field {
    display: inline-block;
}
.multi-select-search-field[disabled] {
    display: none;
}


.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.main-burger {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
}
.main-card {
    background-color: #fff;
    border-radius: 8px;
    padding: 10px;
    /* text-align: center; */
    box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.1);
    margin: 10px;
    flex: 1;
}
.main-card i {
    font-size: 24px;
    margin-bottom: 10px;
    border-radius: 50%;
    background-color: #477786;
    display: inline-block;
    width: 50px;
    line-height: 50px;
    text-align: center;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    color: #fff;
}
.main-projects h4 {
    margin: 5px 0;
}
.main-projects h3,
.main-card h3 {
    font-size: 28px;
    font-weight: 500;
    margin: 0 0;
}
.main-card .color-red {
    background-color: #cc0000;
}
.main-card .color-green {
    background-color: #008100;
}
.main-card .color-blue {
    background-color: #0093c3;
}
.main-chart-container {
    /*background-color: #fff;*/
    border-radius: 8px;
    /* padding: 20px; */
    /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); */
    /* margin: 20px 0; */
    width: calc(100% - 320px);
    margin-left: 20px;
    margin-top: 20px;
    height: 100%;
}
.main-stats {
    display: flex;
    justify-content: space-between;
    margin: 20px 0;
}
.main-projects {
    /*background-color: #fff;*/
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
}
.main-project {
    display: flex;
    justify-content: space-between;
    margin: 10px 0;
}
.main-progress-bar {
    width: 100px;
    height: 10px;
    background-color: #e0e0e0;
    border-radius: 5px;
}
.main-progress {
    height: 10px;
    background-color: #76c7c0;
    border-radius: 5px;
}
.main-stats-row {
    display: flex;
    align-items: center;
}
.main-stats-column {
    display: flex;
    flex-direction: column;
    /*flex-shrink: 1;*/
    min-width: 300px;
}
.main-stats-column-header {
    line-height: 20px;
    height: unset;
    text-align: center;
    margin: 20px 0;
}
.main-card.hor {
    display: flex;
    flex-direction: row;
    box-shadow: none;
}
.main-card.hor i {
    background-color: #fff;
    border-radius: 4px;
    color: #1792b8;
    /* box-shadow: rgba(0, 0, 0, 0.1) 0 0 3px; */
    height: 40px;
    font-size: 20px;
    line-height: 40px;
    width: 40px;
    margin-right: 10px;
    border: 1px solid #1792b8;
    margin-top: 7px;
}
.main-chart {
    padding: 0 10px;
    margin-left: 10px;
}
.main .main-content {
    max-width: 1024px;
    background-color: #f9f9f9;
    margin: auto;
}


.login-container {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    margin: auto auto;
    height: 300px;
    width: 400px;
}
.login-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}
.login-form {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
    width: 400px;
}
.login-form h2 {
    text-align: center;
    margin-bottom: 30px;
}
.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: #007bff;
    z-index: 20;
}

.hidden {
    display: none;
}
.disabled {
    pointer-events: none;
    opacity: 0.5;
}

.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
}
.form-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.login-form button {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 4px;
    background-color: #007bff;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
}
.login-form button:hover {
    background-color: #0056b3;
}
.login-form .error-message {
    margin-top: 10px;
    color: red;
    text-align: center;
}

.tabpage-container {
    position: relative;
}
.tabpage-container .tabpage-tab-indicator {
    width: 25%; /* Индикатор занимает равную долю вкладки */
}
.tabpage-tabs {
    display: flex;
    justify-content: space-around;
    position: relative;
    padding-bottom: 10px;
}
.tabpage-tab {
    cursor: pointer;
    padding: 10px 20px;
    color: #888888;
    font-weight: bold;
    position: relative;
    transition: color 0.3s ease;
    text-align: center; /* Добавляем центрирование текста */
    flex: 1; /* Вкладки занимают равное пространство */
}
.tabpage-tab.active {
    color: #7f3fc6;
}
.tabpage-tab:hover {
    color: #7f3fc6;
}
.tabpage-tab-indicator {
    position: absolute;
    bottom: 0;
    height: 2px;
    background-color: #7f3fc6;
    transition: left 0.3s ease, width 0.3s ease;
}
.tabpage-content {
    padding: 20px;
}
.tabpage-panel {
    display: none;
}
.tabpage-panel.active {
    display: block;
}
.tabpage-tabs {
    display: flex;
    justify-content: space-around;
    position: relative;
    padding-bottom: 0; /* Убираем отступ снизу */
}


/* CSS */
.page-table-settings {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    max-height: 80%;
    background: white;
    border: 1px solid #ccc;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    display: none;
    flex-direction: column;

    z-index: 1200;
}

.page-table-settings-dialog {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: auto;
}

.page-table-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f5f5f5;
    border-bottom: 1px solid #ccc;
}

.page-table-settings-close {
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
}

.page-table-settings-tabs {
    display: flex;
}

.page-table-settings-tab {
    flex: 1;
    padding: 10px;
    cursor: pointer;
    text-align: center;
    background: #eaeaea;
    border: 1px solid #ccc;
    border-bottom: none;
}

.page-table-settings-tab.active {
    background: #fff;
    border-bottom: 1px solid #fff;
}

.page-table-settings-content {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
}

.page-table-settings-footer {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: #f5f5f5;
    border-top: 1px solid #ccc;
}

.page-table-settings-filters,
.page-table-settings-columns {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.page-table-settings-filters>div>label {
    display: flex;
    align-items: center;
    gap: 10px   ;
    justify-content: space-between;
    margin-top: 10px;
}
.page-table-settings-columns>div>label {
    display: flex;
    align-items: center;
    gap: 10px   ;
}



.document-delete-btn {
    display: none;
}
.editable .document-delete-btn {
    display: inline;
}



.condition-row {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.cond-field {
    width: 150px;
}
.cond-op {
    width: 50px;
}
.condition-row select,
.condition-row input {
    padding: 4px;
    font-size: 14px;
}

.remove-cond {
    background: none;
    border: none;
    color: red;
    font-size: 16px;
    cursor: pointer;
}

.add-cond-btn {
    margin-top: 8px;
    padding: 4px 8px;
    font-size: 14px;
    cursor: pointer;
}



/* Style for the loader */
.button-loader {
    filter: brightness(0.75); /* Dims the button text */
    position: relative; /* Ensures correct positioning of the loader */
}

.button-loader::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin-top: -10px;
    margin-left: -10px;
    border: 2px solid #ccc;
    border-top-color: #000;
    border-radius: 50%;
    animation: button-loader-spin 1s linear infinite; /* Spins infinitely */
}

@keyframes button-loader-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}
