/* Стили в стиле страницы установки */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 0;
}

/* Контейнер для основного контента */
main {
    padding: 20px;
    min-height: calc(100vh - 70px);
}

.container-fluid {
    max-width: 1400px;
    margin: 0 auto;
}

/* Навигация в стиле установки */
.umc_nav {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    padding: 15px 0;
}

.umc_nav .navbar-brand {
    font-size: 24px;
    font-weight: 700;
    color: white !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.umc_nav .navbar-brand:hover {
    transform: scale(1.05);
}

.umc_nav .navbar-brand img {
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.umc_nav .navbar-brand:hover img {
    transform: scale(1.1) rotate(2deg);
}

.umc_nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    padding: 8px 16px !important;
    border-radius: 6px;
    transition: all 0.3s;
    margin: 0 4px;
}

.umc_nav .nav-link:hover,
.umc_nav .nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: white !important;
    transform: translateY(-2px);
}

.umc_nav .dropdown-menu {
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    border: none;
    margin-top: 8px;
}

.umc_nav .dropdown-item {
    padding: 10px 20px;
    transition: all 0.2s;
}

.umc_nav .dropdown-item:hover {
    background: #f0f0f0;
    padding-left: 25px;
}

/* Карточки контента */
.card, .page-content, .container {
    background: white;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.12);
    padding: 30px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 15px 50px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.card {
    border: none;
    overflow: hidden;
}

.card-body {
    padding: 40px;
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 30px 40px;
    border-radius: 24px 24px 0 0;
    position: relative;
    overflow: hidden;
}

.card-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: shimmer 3s infinite;
}

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

/* Вложенные карточки (для фильтров) */
.card .card {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

/* Кнопки в стиле установки */
.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 14px 35px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    color: white;
}

.btn-primary {
    background: #667eea;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-warning {
    background: #ffc107;
    color: #000;
}

.btn-warning:hover {
    background: #e0a800;
    color: #000;
}

.btn-outline-secondary {
    background: #f8f9fa;
    color: #495057;
    border: 2px solid #dee2e6;
    font-weight: 500;
}

.btn-outline-secondary:hover {
    background: #e9ecef;
    color: #212529;
    border-color: #adb5bd;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

/* Улучшенные стили для кнопок фильтрации (Все, Монтаж, Сервис, Регламент) */
.btn-outline-secondary.btn-sm {
    background: #ffffff;
    color: #495057;
    border: 2px solid #ced4da;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-outline-secondary.btn-sm:hover {
    background: #e9ecef;
    color: #212529;
    border-color: #adb5bd;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* Активная кнопка фильтрации */
.btn-primary.btn-sm {
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* Формы */
.form-control, .form-select {
    padding: 14px 18px;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #fafafa;
}

.form-control:focus, .form-select:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.form-control:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.7;
}

.form-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.col-form-label {
    font-weight: 600;
    color: #333;
}

.form-check-input {
    width: 20px;
    height: 20px;
    border: 2px solid #667eea;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-check-input:checked {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.form-check-label {
    margin-left: 8px;
    cursor: pointer;
    color: #333;
}

.invalid-feedback {
    color: #dc3545;
    font-size: 14px;
    margin-top: 5px;
}

.is-invalid {
    border-color: #dc3545 !important;
}

/* Таблицы */
.table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.table thead th {
    border: none;
    padding: 15px;
    font-weight: 600;
}

.table tbody td {
    padding: 12px 15px;
    border-color: #f0f0f0;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

/* Алерты */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    border: none;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

.alert-info {
    background: #e7f3ff;
    color: #0c5460;
    border-left: 4px solid #2196F3;
}

/* Заголовки */
h1, h2, h3, h4, h5, h6 {
    color: #333;
    font-weight: 700;
    margin-bottom: 20px;
}

h1 {
    font-size: 32px;
}

h2 {
    font-size: 28px;
}

h3 {
    font-size: 24px;
}

/* Пагинация */
.pagination {
    margin-top: 30px;
}

.pagination .page-link {
    color: #667eea;
    border-color: #e0e0e0;
    padding: 10px 15px;
    border-radius: 6px;
    margin: 0 4px;
}

.pagination .page-link:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination .page-item.active .page-link {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

/* Модальные окна */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    border: none;
    padding: 20px 30px;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    border-top: 1px solid #e0e0e0;
    padding: 20px 30px;
}

/* Бейджи */
.badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 600;
}

.badge-primary {
    background: #667eea;
    color: white;
}

.badge-success {
    background: #28a745;
    color: white;
}

.badge-danger {
    background: #dc3545;
    color: white;
}

.badge-warning {
    background: #ffc107;
    color: #000;
}

/* Иконки пользователя */
.fa.user_nav {
    color: white;
    font-size: 26px;
}

/* Кнопка переключения навигации (hamburger) */
.navbar-toggler {
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    padding: 8px 12px;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Дополнительные улучшения для форм */
hr {
    border: none;
    border-top: 2px solid #e8e8e8;
    border-radius: 2px;
    margin: 25px 0;
}

.text-muted {
    color: #6c757d !important;
}

/* Адаптивность только для мобильных устройств (touch-устройства) */
/* Используем комбинацию проверок: маленький экран И touch-интерфейс */
@media (max-width: 768px) and (pointer: coarse), (max-width: 768px) and (hover: none) {
    /* Основные отступы */
    main {
        padding: 10px 5px;
    }
    
    body {
        font-size: 14px;
    }
    
    /* Карточки */
    .card, .page-content, .container {
        padding: 15px;
        border-radius: 16px;
        margin-bottom: 15px;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .card-header {
        padding: 20px 15px;
        border-radius: 16px 16px 0 0;
    }
    
    .card-header h2, .card-header h3, .card-header h4 {
        font-size: 20px !important;
    }
    
    /* Навигация */
    .umc_nav {
        padding: 10px 0;
    }
    
    .umc_nav .navbar-brand {
        font-size: 16px;
        gap: 8px;
    }
    
    .umc_nav .navbar-brand img {
        height: 35px !important;
    }
    
    .umc_nav .navbar-brand span {
        font-size: 16px !important;
    }
    
    .umc_nav .nav-link {
        padding: 10px 12px !important;
        margin: 4px 2px;
        font-size: 14px;
        display: block;
        text-align: center;
    }
    
    .umc_nav .navbar-collapse {
        margin-top: 15px;
        padding-top: 15px;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .navbar-nav {
        width: 100%;
    }
    
    .navbar-nav .nav-item {
        width: 100%;
    }
    
    /* Формы */
    .form-control, .form-select {
        padding: 12px 14px;
        border-radius: 10px;
        font-size: 16px; /* Предотвращает зум на iOS */
    }
    
    .form-label {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    /* Кнопки */
    .btn {
        padding: 12px 20px;
        border-radius: 10px;
        font-size: 15px;
        width: 100%;
        margin-bottom: 8px;
    }
    
    .btn-sm {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .d-grid .btn {
        width: 100%;
    }
    
    /* Таблицы - горизонтальная прокрутка */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -5px;
        padding: 0 5px;
    }
    
    .table {
        font-size: 12px;
        min-width: 800px;
    }
    
    .table thead th {
        padding: 10px 8px;
        font-size: 11px;
        white-space: nowrap;
    }
    
    .table tbody td {
        padding: 8px 6px;
        font-size: 11px;
    }
    
    /* Заголовки */
    h1 {
        font-size: 24px;
    }
    
    h2 {
        font-size: 22px;
    }
    
    h3 {
        font-size: 20px;
    }
    
    h4 {
        font-size: 18px;
    }
    
    /* Заголовки страниц */
    .page_header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 15px !important;
    }
    
    .page_title {
        font-size: 20px;
        margin-bottom: 10px;
    }
    
    /* Пагинация */
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .pagination .page-link {
        padding: 8px 12px;
        font-size: 14px;
        margin: 2px;
    }
    
    /* Модальные окна */
    .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .modal-content {
        border-radius: 16px;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-body {
        padding: 20px 15px;
    }
    
    .modal-footer {
        padding: 15px;
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
        margin: 5px 0;
    }
    
    /* Контейнеры */
    .container-fluid {
        padding: 0 10px;
    }
    
    /* Строки и колонки */
    .row {
        margin-left: -5px;
        margin-right: -5px;
    }
    
    .row > * {
        padding-left: 5px;
        padding-right: 5px;
    }
    
    /* Алерты */
    .alert {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    /* Дропдауны */
    .dropdown-menu {
        width: 100%;
        max-width: calc(100vw - 20px);
    }
    
    /* Утилиты для мобильных */
    .d-flex.gap-2, .d-flex.gap-3 {
        flex-wrap: wrap;
        gap: 8px !important;
    }
    
    /* Скрытие элементов на мобильных */
    .d-none-mobile {
        display: none !important;
    }
}

/* Дополнительные стили для очень маленьких экранов (только мобильные) */
@media (max-width: 480px) and (pointer: coarse), (max-width: 480px) and (hover: none) {
    main {
        padding: 5px;
    }
    
    .card, .page-content, .container {
        padding: 12px;
        border-radius: 12px;
    }
    
    .card-body {
        padding: 12px;
    }
    
    .umc_nav .navbar-brand span {
        font-size: 14px !important;
    }
    
    .umc_nav .navbar-brand img {
        height: 30px !important;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .table {
        font-size: 11px;
    }
    
    .table thead th {
        padding: 8px 6px;
        font-size: 10px;
    }
    
    .table tbody td {
        padding: 6px 4px;
        font-size: 10px;
    }
}

/* Ландшафтная ориентация на мобильных */
@media (max-width: 768px) and (orientation: landscape) and (pointer: coarse) {
    .umc_nav .navbar-collapse {
        max-height: 70vh;
        overflow-y: auto;
    }
}

/* Улучшенные тени для карточек */
.shadow-sm {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
}

.shadow {
    box-shadow: 0 4px 16px rgba(0,0,0,0.15) !important;
}

.shadow-lg {
    box-shadow: 0 8px 24px rgba(0,0,0,0.2) !important;
}

/* Оптимизация для touch-устройств */
@media (hover: none) and (pointer: coarse) {
    /* Увеличиваем области нажатия для мобильных */
    .btn, .nav-link, .dropdown-item {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Убираем hover эффекты на touch-устройствах */
    .btn:hover {
        transform: none;
    }
    
    .card:hover {
        transform: none;
    }
}

/* Улучшение читаемости на мобильных (только touch-устройства) */
@media (max-width: 768px) and (pointer: coarse), (max-width: 768px) and (hover: none) {
    /* Увеличиваем размер шрифта для лучшей читаемости */
    body {
        -webkit-text-size-adjust: 100%;
        -moz-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
    
    /* Улучшаем контрастность */
    .text-muted {
        color: #6c757d !important;
    }
    
    /* Оптимизация для прокрутки */
    * {
        -webkit-tap-highlight-color: rgba(102, 126, 234, 0.2);
    }
}
