html {
    cursor: url('icons/cursor-grain.svg'), auto;
    background: #FFEECC;

    font-family: "Ubuntu", sans-serif;
    color: #1E1E1E;
}

body {
    margin: 0;
    padding: 0;
}

#wrapper {
    max-width: calc(1200px + 64px);
    width: 100%;
    padding: 0 32px;
    box-sizing: border-box;
    margin: 120px auto 60px;
}


/* Шрифты */

.center {
    width: fit-content;
    margin: 0 auto;
}

.title {
    font-size: 20px;
    font-weight: 500;
    line-height: 120%;
    color: #1E1E1E;
}

.sub-title {
    font-size: 18px;
    font-weight: 500;
    line-height: 120%;
    color: #1E1E1E;
}



/* Шапка */

#header {
    display: flex;
    flex-wrap: nowrap;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    position: fixed;
    z-index: 1000;
    top: 0;
    width: 100%;
    padding: 12px 32px;
    box-sizing: border-box;
    box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.5);
    background: #FFEECC;
}

    #header-logo {
        font-size: 28px;
        font-weight: 500;
        line-height: 120%;
    }

    #header-menu a {
        font-size: 16px;
        font-weight: 500;
        line-height: 120%;
        color: #1E1E1E;
        text-decoration: none;
    }

    #header-menu a:hover {
        color: #577BFF;
    }

    
    #header-account {
        display: flex;
        align-items: center;
    }
    
    #user-info {
        display: flex;
        align-items: center;
        margin-right: 12px;
        font-weight: 500;
    }
    
    #user-name {
        font-size: 16px;
        line-height: 120%;
    }

    #logout-button {
        padding: 8px 16px;
        border-radius: 8px;
        background: #FB5884;
        cursor: pointer;
        transition: all 0.3s ease-in-out;
        
        font-size: 16px;
        font-weight: 400;
        line-height: 100%;
        text-align: center;
        color: #FFF;
    }
    
    #logout-button:hover {
        box-shadow: 0px 3px 5px 0px rgba(0, 0, 0, 0.2);
        background: #D93866;
    }



/* Модальное окно аутентификации */

.modal {
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;

    position: fixed;
    top: 0;
    left: 0;

    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    max-width: 450px;
    width: 100%;

    padding: 24px;
    /* box-sizing: border-box; */
    border-radius: 16px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    background-color: #FFEECC;
}

.close-button {
    position: absolute;
    top: 16px;
    right: 16px;

    font-size: 24px;
    font-weight: bold;
    line-height: 120%;
    cursor: pointer;
}

.auth-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #E2D4BA;
}

.auth-tab {
    padding: 10px 20px;
    box-sizing: border-box;
    cursor: pointer;
    
    font-weight: 500;
    transition: all 0.2s ease;
}

.auth-tab.active {
    color: #577BFF;
    border-bottom: 2px solid #577BFF;
    margin-bottom: -2px;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 20px;

    font-size: 22px;
    line-height: 120%;
    color: #1E1E1E;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;

    font-size: 14px;
    font-weight: 500;
    line-height: 120%;
}

.form-group input {
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
    border-radius: 8px;
    border: 1px solid #E2D4BA;
    background-color: #FFF;

    font-family: "Ubuntu", sans-serif;
    font-size: 16px;
    line-height: 120%;
}

.form-group input:focus {
    outline: none;
    border-color: #99AFFF;
    box-shadow: 0 0 0 2px rgba(153, 175, 255, 0.3);
}

.error-message {
    min-height: 18px;
    margin: 12px 0;

    font-size: 14px;
    line-height: 18px;
    color: #FB5884;
}

.input-error {
    display: none;
    color: #ff4d4d;
    font-size: 12px;
    margin-top: 4px;
    padding-left: 4px;
}

.input-error.active {
    display: block;
}

input.error {
    border-color: #ff4d4d !important;
    background-color: #fff5f5 !important;
}

/* Стили для поля ввода телефона */
input[type="tel"] {
    border: 1px solid #ccc;
    padding: 8px;
}

input[type="tel"]:focus {
    outline: none;
    border-color: #4a90e2;
}

input[type="tel"].error:focus {
    border-color: #ff0000;
} 

.auth-submit {
    width: 100%;
    padding: 12px;
    box-sizing: border-box;
    border: none;
    border-radius: 8px;
    background-color: #99AFFF;

    font-family: "Ubuntu", sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 120%;
    color: white;
    cursor: pointer;

    transition: all 0.3s ease;
}

.auth-submit:hover {
    background-color: #577BFF;
    box-shadow: 0px 3px 5px 0px rgba(0, 0, 0, 0.2);
}

/* Стили для модального окна создания транзакции */
#transaction-modal .modal-content {
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    margin: 20px;
    padding-right: 16px;
}

/* Стилизация скроллбара */
#transaction-modal .modal-content::-webkit-scrollbar {
    width: 8px;
}

#transaction-modal .modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
}

#transaction-modal .modal-content::-webkit-scrollbar-thumb {
    background: #99AFFF;
    border-radius: 4px;
    transition: all 0.3s ease;
}

#transaction-modal .modal-content::-webkit-scrollbar-thumb:hover {
    background: #577BFF;
}

#transaction-modal .form-group select,
#transaction-modal .form-group textarea {
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
    border-radius: 8px;
    border: 1px solid #E2D4BA;
    background-color: #FFF;

    font-family: "Ubuntu", sans-serif;
    font-size: 16px;
    line-height: 120%;
}

#transaction-modal .form-group select:focus,
#transaction-modal .form-group textarea:focus {
    outline: none;
    border-color: #99AFFF;
    box-shadow: 0 0 0 2px rgba(153, 175, 255, 0.3);
}

#transaction-modal .form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Стили для сетки формы */
.transaction-form-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.transaction-form-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
}

.transaction-form-column h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
    line-height: 120%;
    color: #1E1E1E;

    padding-bottom: 5px;
    border-bottom: 1px solid var(--border-color);
}

/* Стили для горизонтального расположения полей */
.transaction-form-column > div:not(h3) {
    display: flex;
    flex-direction: column;
    margin-bottom: -16px;
}

/* Основная информация */
.transaction-form-column:nth-child(1) .form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0 16px;
}

/* Информация об отправителе */
.transaction-form-column:nth-child(2) .form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* Информация о получателе */
.transaction-form-column:nth-child(3) .form-row {
    display: grid;
    gap: 16px;
}

.transaction-form-column:nth-child(3) .form-row:first-child {
    grid-template-columns: repeat(3, 1fr);
}

.transaction-form-column:nth-child(3) .form-row:last-child {
    grid-template-columns: repeat(2, 1fr);
}

/* Фильтр */

#filter {
    display: grid;
    grid-template-columns: 1fr 1.5fr max-content;
    align-items: start;
    gap: 16px;
}

    .block {
        width: 100%;
        height: 100%;
        padding: 20px 16px;
        box-sizing: border-box;
        border-radius: 12px;
        box-shadow: 0px 3px 5px 0px rgba(0, 0, 0, 0.1);
        background: #FFDC8B;
    }

    .filter-form {
        display: grid;
        gap: 12px;
        margin-top: 16px;
    }

    .filter-form .form-group {
        margin-bottom: 0;
    }

    .filter-form label {
        display: block;
        margin-bottom: 4px;
        font-size: 14px;
        font-weight: 500;
        line-height: 120%;
        color: #1E1E1E;
    }

    .filter-form input,
    .filter-form select {
        width: 100%;
        padding: 8px 12px;
        box-sizing: border-box;
        border-radius: 8px;
        border: 1px solid #E2D4BA;
        background-color: #FFF;
        font-family: "Ubuntu", sans-serif;
        font-size: 14px;
        line-height: 120%;
    }

    .filter-form input:focus,
    .filter-form select:focus {
        outline: none;
        border-color: #99AFFF;
        box-shadow: 0 0 0 2px rgba(153, 175, 255, 0.3);
    }

    .filter-form input::placeholder {
        color: #999;
    }

    .filter-form input[type="datetime-local"] {
        width: 100%;
        padding: 8px 12px;
        box-sizing: border-box;
        border-radius: 8px;
        border: 1px solid #E2D4BA;
        background-color: #FFF;
        font-family: "Ubuntu", sans-serif;
        font-size: 14px;
        line-height: 120%;
        color: #1E1E1E;
    }

    .filter-form input[type="datetime-local"]::-webkit-calendar-picker-indicator {
        cursor: pointer;
        padding: 4px;
        margin-right: 4px;
        opacity: 0.6;
        transition: opacity 0.2s ease;
    }

    .filter-form input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
        opacity: 1;
    }

    .filter-form input[type="datetime-local"]:focus {
        outline: none;
        border-color: #99AFFF;
        box-shadow: 0 0 0 2px rgba(153, 175, 255, 0.3);
    }

    .filter-form .filter-main-fields {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .filter-form .ti-details-content {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .additional-params-toggle {
        display: inline-flex;
        align-items: center;
        padding: 6px 12px;
        border-radius: 6px;
        background: rgba(87, 123, 255, 0.1);
        cursor: pointer;
        user-select: none;
        transition: all 0.2s ease;
        
        font-size: 14px;
        font-weight: 500;
        line-height: 120%;
        color: #577BFF;
    }

    .additional-params-toggle:hover {
        background: rgba(87, 123, 255, 0.2);
    }

    .additional-params-toggle::after {
        content: '';
        width: 16px;
        height: 16px;
        margin-left: 6px;
        background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23577BFF"><path d="M7 10l5 5 5-5z"/></svg>') no-repeat center;
        transform: rotate(-90deg);
        transition: transform 0.3s ease;
    }

    .additional-params-toggle.active::after {
        transform: rotate(0);
    }

    .additional-params {
        display: grid;
        gap: 12px;
        max-height: 0;
        opacity: 0;
        visibility: hidden;
        overflow: hidden;
        transition: max-height 0.3s ease-in-out, 
                    opacity 0.2s ease-in-out, 
                    visibility 0.2s ease-in-out;
    }

    .additional-params.active {
        max-height: 500px;
        opacity: 1;
        visibility: visible;
    }

    #filter-buttons {
        display: flex;
        flex-wrap: nowrap;
        flex-direction: column;
        gap: 8px;
    }

        .filter-button {
            width: 100%;
            padding: 12px 16px;
            box-sizing: border-box;
            border-radius: 8px;
            background: #99AFFF;
            transition: all 0.3s ease-in-out;

            font-size: 18px;
            font-weight: 400;
            line-height: 100%;
            text-align: center;
            color: #FFF;
        }

        .filter-button:hover {
            box-shadow: 0px 3px 5px 0px rgba(0, 0, 0, 0.2);
            background: #577BFF;
        }

        .filter-button.disabled {
            background: #E2E2E2;
            color: #999;
            cursor: not-allowed;
            pointer-events: none;
        }



/* Сводка и Дашборды */

#summary {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: min-content min-content;
    gap: 20px 16px;

    margin-top: 40px;
}

    #summary .block {
        cursor: pointer;
    }
    
    #button-1 {
        grid-row: 1 / 2;
        grid-column: 1 / 2;
    }
    
    #button-2 {
        grid-row: 1 / 2;
        grid-column: 2 / 3;
    }

    .checkbox {
        display: none;
    }

        .checkbox:checked + .block {
            background-color: #FFC15F;
        }
        
        .checkbox:checked + label + .tabs-content {
            display: block;
        }

    .tabs-content {
        grid-row: 2 / 3;
        grid-column: 1 / 3;
        display: none;
    }



/* Транзакции */

#transactions {
    margin-top: 40px;
}

    #transaction-new {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0;

        cursor: pointer;
        border: 3px dashed #8BFF92;
        background: rgba(198, 255, 202, 0.5);

        /* Отключаем тень и анимацию */
        box-shadow: none;
        transform: none;
        transition: all 0.3s ease;
    }

    #transaction-new:hover {
        transform: none;
        box-shadow: none;
        border-color: #5FD665;
        background: rgba(198, 255, 202, 0.7);
    }

    #transactions-list {
        display: flex;
        flex-wrap: nowrap;
        flex-direction: column;
        gap: 16px;
    
        margin-top: 20px;
    }

        .transaction-item {
            display: grid;
            align-items: start;
            grid-template-columns: 1fr min-content;
            gap: 16px;

            width: 100%;
            min-height: 80px;
            padding: 20px;
            box-sizing: border-box;
            border-radius: 16px;
            background: #F9E1FF;

            /* Добавляем тень и анимацию */
            box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
            transition: all 0.3s ease;
        }

        .transaction-item:hover {
            transform: translateY(-4px);
            box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.15);
        }

            .ti-buttons {
                display: flex;
                flex-wrap: nowrap;
                align-items: center;
                flex-direction: row;
                gap: 12px;
            }

                .ti__button {
                    width: 40px;
                    height: 40px;
                    border-radius: 50%;
                    transition: all 0.2s ease-in-out;
                }

                .ti__button:hover {
                    box-shadow: 0px 3px 5px 0px rgba(0, 0, 0, 0.2);
                }

                #ti-edit {
                    background: #FFF url('./icons/edit-square.svg') center / 24px no-repeat;
                }

                #ti-apply {
                    background: #C6FFCA url('./icons/check.svg') center / 24px no-repeat;
                }

                #ti-delete {
                    background: #FB5884 url('./icons/delete.svg') center / 24px no-repeat;
                }

.ti-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ti-main-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ti-amount {
    font-size: 20px;
    font-weight: 500;
    line-height: 120%;
}

.ti-amount-sign {
    color: #666666;
    font-size: 18px;
    line-height: 120%;
}

.ti-type, .ti-status {
    width: fit-content;
}

.ti-type {
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    line-height: 120%;
}

.ti-type.income {
    background: #C6FFCA;
    color: #2D882D;
}

.ti-type.expense {
    background: #FFD6D6;
    color: #882D2D;
}

.ti-status {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    line-height: 120%;
}

.ti-status.new {
    background: #E2E2E2;
    color: #4A4A4A;
}

.ti-status.confirmed {
    background: #FFE4B5;
    color: #B76E00;
}

.ti-status.processing {
    background: #B5D8FF;
    color: #0057B7;
}

.ti-status.cancelled {
    background: #FFB5B5;
    color: #B70000;
}

.ti-status.completed {
    background: #C6FFCA;
    color: #2D882D;
}

.ti-status.deleted {
    background: #D3D3D3;
    color: #404040;
}

.ti-status.refund {
    background: #E4B5FF;
    color: #8B00B7;
}

.ti-secondary-info {
    display: grid;
    grid-template-columns: 1fr 4fr 1fr;
    gap: 16px;
}

.ti-amount-block {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    min-width: 180px;
}

.ti-details-block {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 20px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    flex-grow: 1;
}

.ti-date-group {
    min-width: 160px;
}

.ti-info-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.ti-info-label {
    font-size: 12px;
    font-weight: 500;
    line-height: 120%;
    color: #666666;
    white-space: nowrap;
}

.ti-info-value {
    font-size: 14px;
    line-height: 120%;
    color: #1E1E1E;
    overflow: hidden;
    text-overflow: ellipsis;
    /* white-space: nowrap; */
}

.ti-comment {
    font-style: italic;
}

.ti-category {
    font-weight: 500;
}

.ti-details {
    margin-top: 12px;
}

.ti-details-toggle {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 6px;
    background: rgba(87, 123, 255, 0.1);
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    
    font-size: 14px;
    font-weight: 500;
    line-height: 120%;
    color: #577BFF;
}

.ti-details-toggle:hover {
    background: rgba(87, 123, 255, 0.2);
}

.ti-details-toggle::after {
    content: '';
    width: 16px;
    height: 16px;
    margin-left: 6px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23577BFF"><path d="M7 10l5 5 5-5z"/></svg>') no-repeat center;
    transform: rotate(-90deg);
    transition: transform 0.3s ease;
}

.ti-details-toggle.active::after {
    transform: rotate(0);
}

.ti-details-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 0;
    margin-top: 0;
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    transition: max-height 0.3s ease-in-out, 
                opacity 0.2s ease-in-out, 
                visibility 0.2s ease-in-out,
                padding 0.3s ease-in-out,
                margin-top 0.3s ease-in-out;
}

.ti-details-content.active {
    padding: 12px 16px;
    margin-top: 12px;
    max-height: 500px;
    opacity: 1;
    visibility: visible;
}

.ti-detail-item {
    font-size: 14px;
    line-height: 120%;
}

.ti-detail-label {
    font-size: 12px;
    font-weight: 500;
    line-height: 120%;
    color: #666666;
    margin-bottom: 4px;
}

.ti-detail-value {
    font-weight: 500;
    line-height: 120%;
    color: #1E1E1E;
}



/* Отключение поддержки экранов меньше 900px */
@media screen and (max-width: 899px) {
    body::before {
        content: "Приложение не поддерживает экраны меньше 900px. Пожалуйста, используйте экран большего размера.";
        display: block;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 9999;

        width: 80%;
        max-width: 540px;
        padding: 20px 16px;
        box-sizing: border-box;
        border-radius: 12px;

        box-shadow: 0px 3px 5px 0px rgba(0, 0, 0, 0.1);
        background: #FFDC8B;

        text-align: center;
        font-size: 18px;
        font-weight: 500;
        line-height: 120%;
        color: #1E1E1E;
    }
    
    body > div {
        display: none !important;
    }
}
/* Стили для полей фильтров с ошибками */
#filter input.error {
    border-color: #ff4d4d !important;
    background-color: #fff5f5 !important;
}

#filter .input-error {
    display: none;
    color: #ff4d4d;
    font-size: 12px;
    margin-top: 4px;
    padding-left: 4px;
}

#filter .input-error.active {
    display: block;
}
