.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.modal-content {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 32px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.2);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 1);
    corner-shape: continuous;
    animation: modalSlideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 35px 25px 15px 25px;
    border-bottom: none;
    position: relative;
    text-align: center;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--heading-color);
    letter-spacing: -0.03em;
    margin: 0;
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #f2f2f7;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    background: #e5e5ea;
    transform: rotate(90deg);
}

.modal-close-btn img {
    width: 12px;
    height: 12px;
    opacity: 0.5;
}

.modal-body {
    padding: 10px 30px 25px 30px;
}

/* Стилизация формы */
.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 18px;
}

.form-group label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #8e8e93;
    text-transform: uppercase;
    margin-left: 4px;
    margin-bottom: 8px;
    letter-spacing: 0.05em;
}

.form-group select {
    appearance: none;
    background: #f2f2f7;
    border: 2px solid transparent;
    padding: 14px 18px;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--heading-color);
    cursor: pointer;
    transition: all 0.2s ease;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%238E8E93' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 18px center;
    background-size: 12px;
}

.form-group select:focus {
    outline: none;
    background-color: #ffffff;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(74, 108, 253, 0.1);
}

/* Стилизация выбора файла */
.file-label-modal {
    cursor: pointer;
    width: 100%;
    display: block;
}

.upload-btn-modal {
    background: #f8fafc;
    border: 2px dashed #d1d1d6;
    border-radius: 20px;
    padding: 30px 20px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.upload-btn-modal::before {
    content: "📄";
    font-size: 2.2rem;
    filter: grayscale(1) opacity(0.5);
    transition: all 0.3s ease;
}

.upload-btn-modal span {
    font-weight: 600;
    color: #636e72;
    font-size: 0.9rem;
    max-width: 200px;
    line-height: 1.4;
}

.file-label-modal:hover .upload-btn-modal {
    background: #fff;
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(74, 108, 253, 0.08);
}

.file-label-modal:hover .upload-btn-modal::before {
    filter: grayscale(0) opacity(1);
    transform: scale(1.1);
}

#modalFileInput {
    display: none;
}

/* Сообщения в модалке */
.modal-status {
    margin-top: 5px;
    min-height: 20px;
}

.modal-status .error-message, 
.modal-status .success-message {
    display: none;
    text-align: center;
    padding: 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0;
}

.modal-footer {
    padding: 0 30px 35px 30px;
    border-top: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-footer button {
    width: 100%;
    height: 54px;
    border-radius: 18px;
    font-size: 1.05rem;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
}

.apply-filter-btn {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 10px 20px rgba(74, 108, 253, 0.2);
}

.apply-filter-btn:hover {
    background: var(--accent-color-dark);
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(74, 108, 253, 0.3);
}

.apply-filter-btn:disabled {
    background: #d1d1d6;
    color: #8e8e93;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: transparent;
    color: #8e8e93;
    font-weight: 600;
    font-size: 0.95rem;
}

.btn-secondary:hover {
    color: #2c3e50;
    background: #f2f2f7;
}

/* PASSWORD MODAL STYLES */
.password-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5000;
    backdrop-filter: blur(25px);
}

.password-modal {
    background: #ffffff;
    padding: 45px 35px;
    border-radius: 34px;
    box-shadow: 0 40px 120px rgba(0,0,0,0.3);
    text-align: center;
    width: 90%;
    max-width: 400px;
    animation: modalSlideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.password-modal h2 {
    font-size: 1.6rem;
    font-weight: 900;
    margin-bottom: 12px;
    letter-spacing: -0.04em;
}

.password-modal p {
    color: #8e8e93;
    font-size: 0.95rem;
    margin-bottom: 30px;
}

.password-modal input[type="password"] {
    width: 100%;
    padding: 18px;
    border: 2px solid #f2f2f7;
    border-radius: 20px;
    margin-bottom: 20px;
    text-align: center;
    background: #f2f2f7;
    font-size: 1.2rem;
    font-weight: 600;
    transition: all 0.3s;
}

.password-modal input[type="password"]:focus {
    outline: none;
    border-color: var(--accent-color);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(74, 108, 253, 0.1);
}

.password-modal button {
    width: 100%;
    padding: 18px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 20px;
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 10px 20px rgba(74, 108, 253, 0.2);
}

.password-modal button:hover {
    background: var(--accent-color-dark);
    transform: translateY(-2px);
}

.password-error {
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 15px;
    font-weight: 700;
    animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}