/* === ФОРМА ЗАЯВКИ === */

.olga-fin-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 25px;
  font-family: 'Inter', 'Segoe UI', sans-serif;
  color: #333;
  margin: 0 auto;
  box-sizing: border-box;
  width: 100%;
}

.olga-fin-form .form-group {
  display: flex;
  flex-direction: column;
}

.olga-fin-form .form-group.full-width {
  grid-column: 1 / 3;
}

.olga-fin-form label {
  font-weight: 600;
  margin-bottom: 6px;
  color: #000;
  font-size: 15px;
}
.form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
	flex-wrap: wrap;
}
.form-group.half-width {
     flex: 0 0 100%; 
    width: 100%;
}
.olga-fin-form input,
.olga-fin-form select,
.olga-fin-form textarea {
  border: 1px solid #b0c6cc;
  font-size: 15px;
  font-family: inherit;
  width: 100%;
  background: #fff;
  transition: all 0.2s ease;
  height: 42px;
  box-sizing: border-box;
}

.olga-fin-form select {
  appearance: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  padding: 12px 12px;
  line-height: 1.2;
}

.olga-fin-form textarea {
  height: auto;
  min-height: 100px;
  resize: vertical;
}

.olga-fin-form input:focus,
.olga-fin-form select:focus,
.olga-fin-form textarea:focus {
  outline: none;
  border-color: #165470;
  box-shadow: 0 0 0 2px rgba(22, 84, 112, 0.15);
}

.olga-fin-form .required {
  color: #c53030;
}

.olga-fin-form .file-wrapper {
  display: flex;
  align-items: stretch;
  height: 44px;
  width: 100%;
  border: 1px solid #b0c6cc;
  background: #fff;
  position: relative;
}

.olga-fin-form input[type="file"] {
  opacity: 0;
  position: absolute;
  width: 50%;
  height: 100%;
  cursor: pointer;
  z-index: 2;
  left: 0;
  top: 0;
}

.olga-fin-form .file-label {
  background: #165470;
  color: #fff;
  padding: 10px 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background 0.2s;
  text-align: center;
  width: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  z-index: 1;
}

.olga-fin-form .file-name {
  color: #666;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 10px 12px;
  width: 50%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
}

.olga-fin-form button {
  grid-column: 1 / 3;
  background: #165470;
  color: #fff;
  border: none;
  font-weight: 600;
  padding: 14px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
}

.olga-fin-form button:hover {
  background: #0e3e58;
}

.olga-fin-form .consent-group {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}

.olga-fin-form .consent-group label {
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
}

.olga-fin-form input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #165470;
}

/* === АДАПТИВНОСТЬ ФОРМ === */

@media (max-width: 768px) {
    .clients-table-filter,
    .applications-table-filter {
        padding: 15px;
    }
    
    .filter-form {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-group {
        min-width: 100%;
    }
    
    .form-actions {
        width: 100%;
        justify-content: center;
        height: auto;
    }
    
    .filter-btn,
    .reset-btn {
        min-width: 140px;
        height: 44px;
        flex: 1;
    }

    .olga-fin-form {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .olga-fin-form .form-group.full-width {
        grid-column: 1;
    }
    
    .olga-fin-form button {
        grid-column: 1;
    }
}

/* Стили для datepicker */
.daterangepicker {
    font-family: inherit;
}

.daterangepicker .calendar-table {
    background: white;
}

/* Стили для модального окна */
#invoice-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}

#invoice-modal .modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header .close {
    font-size: 24px;
    cursor: pointer;
}

.client-fields {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.modal-footer {
    margin-top: 20px;
    text-align: right;
}

.btn-primary, .btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-primary {
    background: #007cba;
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    margin-right: 10px;
}

/* === СТИЛИ СТРАНИЦЫ ВХОДА OLGA FIN === */
/* Все селекторы начинаются с .olga-fin- для уникальности */

.olga-fin-login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
    font-family: 'Inter', 'Segoe UI', sans-serif;
    display: flex;
    justify-content: flex-start; /* Выравнивание слева */
    align-items: center;
    padding: 40px;
}

.olga-fin-login-wrapper {
    width: 100%;
    max-width: 500px; /* Уменьшили ширину для левого выравнивания */
}

.olga-fin-login-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(13, 0, 63, 0.1);
    overflow: hidden;
    animation: olga-fin-fadeIn 0.3s ease;
}

@keyframes olga-fin-fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Шапка без логотипа */
.olga-fin-login-header {
    background: linear-gradient(135deg, #165470 0%, #2c3e50 100%);
    color: white;
    padding: 40px 40px 30px;
    text-align: left; /* Выравнивание слева */
}

.olga-fin-login-title {
    font-size: 28px; /* Увеличили размер */
    font-weight: 700;
    margin: 0 0 8px 0;
    color: white;
    line-height: 1.2;
}

.olga-fin-login-subtitle {
    font-size: 15px; /* Увеличили размер */
    opacity: 0.9;
    margin: 0;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 400;
}

/* Ошибки */
.olga-fin-login-error {
    background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
    border: 1px solid #feb2b2;
    color: #c53030;
    padding: 14px 20px;
    margin: 20px 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    animation: olga-fin-shake 0.5s ease;
}

@keyframes olga-fin-shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.olga-fin-login-error svg {
    flex-shrink: 0;
}

/* Формы */
.olga-fin-login-form,
.olga-fin-2fa-form {
    padding: 40px; /* Увеличили padding */
}

.olga-fin-form-group {
    margin-bottom: 28px; /* Увеличили отступ */
}

.olga-fin-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
    font-size: 15px; /* Увеличили размер */
}

.olga-fin-form-group input[type="text"],
.olga-fin-form-group input[type="password"],
.olga-fin-form-group input[type="email"] {
    width: 100%;
    padding: 14px 16px; /* Увеличили padding */
    border: 2px solid #d1e0e8; /* Усилили границу */
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.2s ease;
    background: #fff;
    color: #0d003f;
    box-sizing: border-box;
}

.olga-fin-form-group input:focus {
    outline: none;
    border-color: #165470;
    box-shadow: 0 0 0 3px rgba(22, 84, 112, 0.2);
}

.olga-fin-password-wrapper {
    position: relative;
}

.olga-fin-toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    padding: 6px;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.olga-fin-toggle-password:hover {
    color: #165470;
    background: rgba(22, 84, 112, 0.1);
}

/* Опции формы */
.olga-fin-form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px; /* Увеличили отступ */
    font-size: 14px;
}

.olga-fin-remember-me {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: #0d003f;
}

.olga-fin-remember-me input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #165470;
    cursor: pointer;
}

.olga-fin-forgot-password {
    color: #165470;
    text-decoration: none;
    font-weight: 600; /* Увеличили жирность */
    transition: all 0.2s;
    padding: 5px 10px;
    border-radius: 4px;
}

.olga-fin-forgot-password:hover {
    color: #0e3e58;
    background: rgba(22, 84, 112, 0.05);
    text-decoration: none;
}

/* Кнопки */
.olga-fin-login-button,
.olga-fin-verify-button {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #165470 0%, #2c3e50 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.olga-fin-login-button:hover,
.olga-fin-verify-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(22, 84, 112, 0.3);
}

.olga-fin-button-text {
    margin-right: 5px;
}

.olga-fin-button-icon {
    transition: transform 0.3s ease;
}

.olga-fin-login-button:hover .olga-fin-button-icon {
    transform: translateX(5px);
}

/* 2FA специфичные стили */
.olga-fin-2fa-info {
    background: linear-gradient(135deg, #f0f8ff 0%, #e1f2ff 100%);
    border: 2px solid #d1edff;
    border-radius: 10px;
    padding: 24px;
    margin: 24px 40px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    color: #165470;
}

.olga-fin-code-inputs {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 24px 0;
}

.olga-fin-code-input {
    width: 56px !important; /* Увеличили размер */
    height: 68px; /* Увеличили высоту */
    text-align: center;
    font-size: 28px !important; /* Увеличили размер шрифта */
    font-weight: 600;
    padding: 0;
    border: 2px solid #d1e0e8;
    border-radius: 10px;
    background: #fff;
    color: #165470;
    transition: all 0.2s;
}

.olga-fin-code-input:focus {
    border-color: #165470;
    box-shadow: 0 0 0 3px rgba(22, 84, 112, 0.2);
    transform: translateY(-2px);
}

.olga-fin-timer-section {
    text-align: center;
    margin: 28px 0;
    font-size: 14px;
}

.olga-fin-timer {
    color: #666;
    margin-bottom: 16px;
    font-size: 15px;
}

.olga-fin-timer-count {
    font-weight: 700;
    color: #165470;
    font-size: 16px;
}

.olga-fin-resend-button {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #165470;
    color: #165470;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.olga-fin-resend-button:not(:disabled):hover {
    background: linear-gradient(135deg, #165470 0%, #2c3e50 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(22, 84, 112, 0.2);
}

.olga-fin-resend-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #ccc;
}

.olga-fin-button-group {
    display: flex;
    gap: 16px;
    margin-top: 32px;
}

.olga-fin-back-button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px;
    border: 2px solid #d1e0e8;
    border-radius: 8px;
    color: #666;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    background: #fff;
}

.olga-fin-back-button:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-color: #165470;
    color: #165470;
    transform: translateY(-2px);
}

/* Футер */
.olga-fin-login-footer {
    padding: 24px 40px 32px;
    text-align: left; /* Выравнивание слева */
    border-top: 2px solid #f0f4f8;
    background: #f9fafc;
}

.olga-fin-support-text {
    font-size: 14px;
    color: #666;
    margin: 0 0 12px 0;
    line-height: 1.6;
}

.olga-fin-support-text a {
    color: #165470;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.olga-fin-support-text a:hover {
    color: #0e3e58;
    text-decoration: underline;
}

/* Стили для формы сброса пароля */
.olga-fin-reset-form {
    padding: 40px;
}

.olga-fin-reset-instructions {
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cd 100%);
    border: 2px solid #ffd166;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 24px;
    color: #856404;
    font-size: 14px;
    line-height: 1.5;
}

.olga-fin-reset-instructions p {
    margin: 0 0 10px 0;
}

.olga-fin-reset-instructions p:last-child {
    margin-bottom: 0;
}

.olga-fin-reset-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 2px solid #b1dfbb;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 24px;
    color: #155724;
    font-size: 14px;
    line-height: 1.5;
}

.olga-fin-cancel-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #f8f9fa;
    border: 2px solid #d1e0e8;
    border-radius: 8px;
    color: #666;
    text-decoration: none;
    font-weight: 600;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.olga-fin-cancel-button:hover {
    background: #e9ecef;
    border-color: #165470;
    color: #165470;
}

/* Анимация загрузки */
@keyframes olga-fin-spin {
    to { transform: rotate(360deg); }
}

.olga-fin-loading .olga-fin-button-icon {
    animation: olga-fin-spin 1s linear infinite;
}

/* Адаптивность */
@media (max-width: 768px) {
    .olga-fin-login-page {
        padding: 20px;
        justify-content: center; /* На мобильных центрируем */
    }
    
    .olga-fin-login-wrapper {
        max-width: 100%;
    }
    
    .olga-fin-login-header,
    .olga-fin-login-form,
    .olga-fin-2fa-form,
    .olga-fin-reset-form {
        padding: 30px 20px;
    }
    
    .olga-fin-login-error,
    .olga-fin-2fa-info {
        margin: 15px 20px;
    }
    
    .olga-fin-form-options {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .olga-fin-code-inputs {
        gap: 8px;
    }
    
    .olga-fin-code-input {
        width: 48px !important;
        height: 58px;
        font-size: 24px !important;
    }
    
    .olga-fin-button-group {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .olga-fin-code-input {
        width: 42px !important;
        height: 52px;
        font-size: 22px !important;
    }
    
    .olga-fin-login-title {
        font-size: 24px;
    }
    
    .olga-fin-login-subtitle {
        font-size: 14px;
    }
}

#language_pair {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: 
        linear-gradient(45deg, transparent 50%, #666 50%),
        linear-gradient(135deg, #666 50%, transparent 50%);
    background-position: 
        calc(100% - 15px) 50%,
        calc(100% - 10px) 50%;
    background-size: 5px 5px;
    background-repeat: no-repeat;
    padding-right: 25px;
}

/* Для IE */
#language_pair::-ms-expand {
    display: none;
}

.olga-fin-form .consent-group label {
	display:inline-block!important;
}

@media (max-width: 768px) {
  .olga-fin-form {
    grid-template-columns: 1fr;
    gap: 15px;
    /* ДОБАВИТЬ ОТСТУПЫ ПО БОКАМ: */
    padding: 0 15px;
  }
}
/* === ИСПРАВЛЕННЫЕ СТИЛИ ТОЛЬКО ДЛЯ МОБИЛЬНОЙ ВЕРСИИ === */

@media (max-width: 768px) {
  .olga-fin-form .file-wrapper {
    flex-direction: column;
    height: auto;

    position: relative;
    overflow: hidden; /* Чтобы input не выходил за границы */


    cursor: pointer;
    background: #f8f9fa; /* Светлый фон всей области */
  }
  
  /* Увеличиваем кликабельную зону */
  .olga-fin-form input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%; /* Занимает всю высоту wrapper */
    left: 0;
    top: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 10; /* Поверх всех элементов */
  }
  
  .olga-fin-form .file-label {
    width: 100%;
    padding: 16px 12px; /* Увеличиваем отступы */
    text-align: center;

    font-weight: 600;
    background: #165470;
    color: white;
    border-radius: 6px 6px 0 0; /* Закругляем только верхние углы */
    margin: 0;
    min-height: 50px; /* Минимальная высота для удобного нажатия */
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none; /* Чтобы не мешать клику на input */
  }
  
  .olga-fin-form .file-name {
    width: 100%;
    padding: 14px 12px;
    text-align: center;

    color: #333;
    background: white;
    border-top: 1px solid #e0e0e0;
    min-height: 40px; /* Минимальная высота */
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: normal; /* Разрешаем перенос текста */
    word-break: break-word;
    pointer-events: none; /* Чтобы не мешать клику на input */
  }
  
  /* Эффект при нажатии */
  .olga-fin-form .file-wrapper:active {
    border-color: #0e3e58;
    background: #f0f8ff;
  }
  
  /* Подсветка при фокусе для доступности */
  .olga-fin-form .file-wrapper:focus-within {
    box-shadow: 0 0 0 3px rgba(22, 84, 112, 0.3);
  }
}

/* Дополнительно: улучшаем отображение на очень маленьких экранах */
@media (max-width: 480px) {
  .olga-fin-form .file-label {
    padding: 20px 12px; /* Еще больше отступы для удобства */
  }
  
  .olga-fin-form .file-name {
    padding: 18px 12px;

  }
  
  .olga-fin-form .file-wrapper {
    min-height: 100px; /* Еще больше минимальная высота */
  }
}