/* ========================================
   АДАПТИВНЫЕ СТИЛИ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ
   ======================================== */

/* ========================================
   ОСНОВНЫЕ БРЕЙКПОИНТЫ
   ======================================== */
/* 
   - 1200px+ : Desktop (большие экраны)
   - 992px-1199px : Laptop (ноутбуки)
   - 768px-991px : Tablet (планшеты)
   - 576px-767px : Mobile Large (большие телефоны)
   - до 575px : Mobile (телефоны)
*/

/* ========================================
   ПЛАНШЕТЫ (768px - 991px)
   ======================================== */
@media (max-width: 991px) {
    .container {
        max-width: 100%;
        padding: 0 15px;
    }
    
    .main-content {
        padding: 20px 0;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .ris-container {
        grid-template-columns: 1fr;
        gap: 20px;
        height: auto;
        min-height: auto;
    }
    
    .equipment-section {
        order: 1;
        padding: 15px;
        margin-bottom: 10px;
    }
    
    .details-section {
        order: 2;
        padding: 15px;
        min-height: 400px;
    }
    
    .equipment-table {
        font-size: 0.85rem;
    }
    
    .equipment-table th,
    .equipment-table td {
        padding: 8px 6px;
    }
}

/* ========================================
   ТОЧНО 560px - САМЫЙ ПРОБЛЕМНЫЙ РАЗМЕР
   ======================================== */
@media (max-width: 560px) and (min-width: 559px) {
    .container {
        padding: 0 2px;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .equipment-section {
        padding: 4px;
        margin-bottom: 8px;
    }
    
    .details-section {
        padding: 4px;
        min-height: 240px;
    }
    
    .equipment-passport {
        padding: 6px;
        max-height: 55vh;
        overflow-y: auto;
    }
    
    .passport-content {
        gap: 6px;
    }
    
    .equipment-table {
        font-size: 0.65rem;
        min-width: 400px;
        table-layout: fixed;
    }
    
    .equipment-table th,
    .equipment-table td {
        padding: 2px 1px;
    }
    
    .table-container {
        max-height: 180px;
        overflow: auto;
    }
}

/* ========================================
   СРЕДНИЕ ТЕЛЕФОНЫ (560px - 600px) - КРИТИЧЕСКИЙ ДИАПАЗОН
   ======================================== */
@media (max-width: 600px) and (min-width: 560px) {
    .container {
        padding: 0 5px;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .ris-container {
        grid-template-columns: 1fr;
        gap: 12px;
        height: auto;
        min-height: auto;
        width: 100%;
        max-width: 100%;
    }
    
    .equipment-section {
        padding: 8px;
        margin-bottom: 10px;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .details-section {
        padding: 8px;
        min-height: 260px;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .equipment-passport {
        padding: 10px;
        max-height: 60vh;
        overflow-y: auto;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .passport-content {
        gap: 10px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
        gap: 6px;
        width: 100%;
        max-width: 100%;
    }
    
    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
        padding: 4px 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .info-item label {
        font-size: 0.75rem;
        font-weight: 600;
        color: #1976d2;
        word-break: break-word;
        line-height: 1.2;
    }
    
    .info-item span {
        font-size: 0.8rem;
        word-break: break-word;
        line-height: 1.3;
        max-width: 100%;
    }
    
    .passport-actions {
        flex-direction: column;
        gap: 6px;
        margin-top: 12px;
        width: 100%;
        max-width: 100%;
        display: flex !important;
        visibility: visible !important;
    }
    
    .action-btn {
        width: 100%;
        padding: 10px 14px;
        font-size: 0.8rem;
        min-height: 42px;
        justify-content: center;
        box-sizing: border-box;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .btn-icon {
        font-size: 1rem;
        margin-right: 6px;
    }
    
    .equipment-table {
        font-size: 0.7rem;
        min-width: 450px;
        width: 100%;
        max-width: 100%;
        table-layout: fixed;
    }
    
    .equipment-table th,
    .equipment-table td {
        padding: 4px 2px;
        word-break: break-word;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .equipment-table th:nth-child(1),
    .equipment-table td:nth-child(1) {
        width: 15%;
    }
    
    .equipment-table th:nth-child(2),
    .equipment-table td:nth-child(2) {
        width: 20%;
    }
    
    .equipment-table th:nth-child(3),
    .equipment-table td:nth-child(3) {
        width: 25%;
    }
    
    .equipment-table th:nth-child(4),
    .equipment-table td:nth-child(4) {
        width: 20%;
    }
    
    .equipment-table th:nth-child(5),
    .equipment-table td:nth-child(5) {
        width: 20%;
    }
    
    .table-container {
        max-height: 200px;
        overflow: auto;
        width: 100%;
        max-width: 100%;
        -webkit-overflow-scrolling: touch;
    }
    
    .section-title {
        font-size: 1rem;
    }
    
    .passport-header h3 {
        font-size: 1.1rem;
    }
    
    .passport-section h4 {
        font-size: 0.9rem;
    }
}

/* ========================================
   БОЛЬШИЕ ТЕЛЕФОНЫ (576px - 767px)
   ======================================== */
@media (max-width: 767px) {
    .container {
        padding: 0 10px;
    }
    
    .header {
        padding: 15px 0;
    }
    
    .header h1 {
        font-size: 1.5rem;
        text-align: center;
    }
    
    .tabs {
        flex-direction: column;
        gap: 10px;
    }
    
    .tab-button {
        width: 100%;
        padding: 12px 20px;
        font-size: 1rem;
    }
    
    .section-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .filter-container {
        width: 100%;
    }
    
    .filter-input {
        width: 100%;
        min-width: auto;
    }
    
    .equipment-table {
        font-size: 0.8rem;
    }
    
    .equipment-table th,
    .equipment-table td {
        padding: 6px 4px;
    }
    
    .equipment-table th:nth-child(2),
    .equipment-table td:nth-child(2) {
        min-width: 80px;
    }
    
    .equipment-table th:nth-child(3),
    .equipment-table td:nth-child(3) {
        min-width: 100px;
    }
    
    .equipment-table th:nth-child(4),
    .equipment-table td:nth-child(4) {
        min-width: 90px;
    }
    
    .equipment-table th:nth-child(5),
    .equipment-table td:nth-child(5) {
        min-width: 120px;
    }
    
    .equipment-section {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .details-section {
        padding: 12px;
        min-height: 350px;
    }
    
    .table-container {
        max-height: 300px;
        overflow-y: auto;
    }
    
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .equipment-passport {
        padding: 15px;
    }
    
    .passport-content {
        gap: 15px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .info-item label {
        font-weight: 600;
        color: #1976d2;
    }
    
    .passport-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .action-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   КРИТИЧЕСКИЙ ДИАПАЗОН (480px - 520px) - САМЫЕ ПРОБЛЕМНЫЕ ЭКРАНЫ
   ======================================== */
@media (max-width: 520px) and (min-width: 480px) {
    .container {
        padding: 0 3px;
    }
    
    .equipment-section {
        padding: 5px;
        margin-bottom: 8px;
    }
    
    .details-section {
        padding: 5px;
        min-height: 220px;
    }
    
    .equipment-passport {
        padding: 6px;
        max-height: 50vh;
        overflow-y: auto;
    }
    
    .passport-content {
        gap: 6px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    
    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        padding: 2px 0;
    }
    
    .info-item label {
        font-size: 0.65rem;
        font-weight: 600;
        color: #1976d2;
        line-height: 1.2;
    }
    
    .info-item span {
        font-size: 0.7rem;
        word-break: break-word;
        line-height: 1.3;
    }
    
    .passport-actions {
        flex-direction: column;
        gap: 4px;
        margin-top: 8px;
    }
    
    .action-btn {
        width: 100%;
        padding: 6px 10px;
        font-size: 0.7rem;
        min-height: 36px;
        justify-content: center;
        line-height: 1.2;
    }
    
    .btn-icon {
        font-size: 0.8rem;
        margin-right: 4px;
    }
    
    .equipment-table {
        font-size: 0.6rem;
        min-width: 420px;
    }
    
    .equipment-table th,
    .equipment-table td {
        padding: 2px 1px;
    }
    
    .table-container {
        max-height: 160px;
        overflow-y: auto;
    }
    
    .section-title {
        font-size: 0.9rem;
    }
    
    .passport-header h3 {
        font-size: 1rem;
    }
    
    .passport-section h4 {
        font-size: 0.8rem;
    }
}

/* ========================================
   МАЛЕНЬКИЕ ТЕЛЕФОНЫ (500px - 560px)
   ======================================== */
@media (max-width: 560px) and (min-width: 500px) {
    .container {
        padding: 0 6px;
    }
    
    .equipment-section {
        padding: 8px;
        margin-bottom: 10px;
    }
    
    .details-section {
        padding: 8px;
        min-height: 260px;
    }
    
    .equipment-passport {
        padding: 10px;
        max-height: 60vh;
        overflow-y: auto;
    }
    
    .passport-content {
        gap: 10px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
        padding: 4px 0;
    }
    
    .info-item label {
        font-size: 0.75rem;
        font-weight: 600;
        color: #1976d2;
    }
    
    .info-item span {
        font-size: 0.8rem;
        word-break: break-word;
    }
    
    .passport-actions {
        flex-direction: column;
        gap: 6px;
        margin-top: 12px;
    }
    
    .action-btn {
        width: 100%;
        padding: 10px 14px;
        font-size: 0.8rem;
        min-height: 42px;
        justify-content: center;
    }
    
    .btn-icon {
        font-size: 1rem;
        margin-right: 6px;
    }
    
    .equipment-table {
        font-size: 0.7rem;
        min-width: 460px;
    }
    
    .equipment-table th,
    .equipment-table td {
        padding: 4px 2px;
    }
    
    .table-container {
        max-height: 200px;
        overflow-y: auto;
    }
    
    .section-title {
        font-size: 1rem;
    }
    
    .passport-header h3 {
        font-size: 1.1rem;
    }
    
    .passport-section h4 {
        font-size: 0.9rem;
    }
}

/* ========================================
   ЭКСТРЕМАЛЬНО КОМПАКТНАЯ ТАБЛИЦА (540px - 550px)
   ======================================== */
@media (max-width: 550px) and (min-width: 540px) {
    .equipment-table {
        font-size: 0.5rem;
        min-width: 340px;
        table-layout: fixed;
        width: 100%;
    }
    
    .equipment-table th,
    .equipment-table td {
        padding: 1px 0px;
        word-break: break-all;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1.0;
    }
    
    .equipment-table th:nth-child(1),
    .equipment-table td:nth-child(1) {
        width: 8%;
        min-width: 25px;
    }
    
    .equipment-table th:nth-child(2),
    .equipment-table td:nth-child(2) {
        width: 22%;
        min-width: 40px;
    }
    
    .equipment-table th:nth-child(3),
    .equipment-table td:nth-child(3) {
        width: 28%;
        min-width: 50px;
    }
    
    .equipment-table th:nth-child(4),
    .equipment-table td:nth-child(4) {
        width: 22%;
        min-width: 40px;
    }
    
    .equipment-table th:nth-child(5),
    .equipment-table td:nth-child(5) {
        width: 20%;
        min-width: 60px;
    }
    
    .table-container {
        max-height: 140px;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .equipment-section {
        padding: 3px;
    }
    
    .details-section {
        padding: 3px;
        min-height: 200px;
    }
}

/* ========================================
   СУПЕР КОМПАКТНАЯ ТАБЛИЦА (550px - 570px)
   ======================================== */
@media (max-width: 570px) and (min-width: 550px) {
    .equipment-table {
        font-size: 0.55rem;
        min-width: 360px;
        table-layout: fixed;
        width: 100%;
    }
    
    .equipment-table th,
    .equipment-table td {
        padding: 1px 0.5px;
        word-break: break-word;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1.1;
    }
    
    .equipment-table th:nth-child(1),
    .equipment-table td:nth-child(1) {
        width: 10%;
        min-width: 30px;
    }
    
    .equipment-table th:nth-child(2),
    .equipment-table td:nth-child(2) {
        width: 20%;
        min-width: 45px;
    }
    
    .equipment-table th:nth-child(3),
    .equipment-table td:nth-child(3) {
        width: 25%;
        min-width: 55px;
    }
    
    .equipment-table th:nth-child(4),
    .equipment-table td:nth-child(4) {
        width: 20%;
        min-width: 45px;
    }
    
    .equipment-table th:nth-child(5),
    .equipment-table td:nth-child(5) {
        width: 25%;
        min-width: 70px;
    }
    
    .table-container {
        max-height: 160px;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .equipment-section {
        padding: 4px;
    }
    
    .details-section {
        padding: 4px;
        min-height: 220px;
    }
}

/* ========================================
   КРИТИЧЕСКИЙ ДИАПАЗОН 570px - ОПТИМИЗАЦИЯ ТАБЛИЦЫ
   ======================================== */
@media (max-width: 570px) and (min-width: 560px) {
    .equipment-table {
        font-size: 0.6rem;
        min-width: 380px;
        table-layout: fixed;
        width: 100%;
    }
    
    .equipment-table th,
    .equipment-table td {
        padding: 2px 1px;
        word-break: break-word;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .equipment-table th:nth-child(1),
    .equipment-table td:nth-child(1) {
        width: 12%;
        min-width: 35px;
    }
    
    .equipment-table th:nth-child(2),
    .equipment-table td:nth-child(2) {
        width: 18%;
        min-width: 50px;
    }
    
    .equipment-table th:nth-child(3),
    .equipment-table td:nth-child(3) {
        width: 22%;
        min-width: 60px;
    }
    
    .equipment-table th:nth-child(4),
    .equipment-table td:nth-child(4) {
        width: 18%;
        min-width: 50px;
    }
    
    .equipment-table th:nth-child(5),
    .equipment-table td:nth-child(5) {
        width: 30%;
        min-width: 80px;
    }
    
    .table-container {
        max-height: 180px;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .equipment-section {
        padding: 6px;
    }
    
    .details-section {
        padding: 6px;
        min-height: 240px;
    }
}

/* ========================================
   ТЕЛЕФОНЫ (до 575px)
   ======================================== */
@media (max-width: 575px) {
    .container {
        padding: 0 5px;
    }
    
    .header h1 {
        font-size: 1.3rem;
        line-height: 1.2;
    }
    
    .main-content {
        padding: 15px 0;
    }
    
    .tab-button {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .section-title {
        font-size: 1.1rem;
    }
    
    .equipment-table {
        font-size: 0.75rem;
        min-width: 500px;
    }
    
    .equipment-table th,
    .equipment-table td {
        padding: 5px 3px;
    }
    
    .equipment-section {
        padding: 8px;
        margin-bottom: 10px;
    }
    
    .details-section {
        padding: 8px;
        min-height: 300px;
    }
    
    .table-container {
        max-height: 250px;
        overflow-y: auto;
    }
    
    .equipment-passport {
        padding: 10px;
        max-height: 70vh;
        overflow-y: auto;
    }
    
    .passport-header h3 {
        font-size: 1.2rem;
    }
    
    .passport-section h4 {
        font-size: 1rem;
    }
    
    .info-item label {
        font-size: 0.85rem;
    }
    
    .info-item span {
        font-size: 0.9rem;
    }
    
    .action-btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .btn-icon {
        font-size: 1rem;
    }
}

/* ========================================
   АДАПТАЦИЯ МОДАЛЬНЫХ ОКОН
   ======================================== */

/* Планшеты */
@media (max-width: 991px) {
    .modal-content {
        width: 95%;
        margin: 3% auto;
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-title {
        font-size: 1.3rem;
    }
    
    .modal-tab-content {
        padding: 20px;
    }
    
    .modal-tabs {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .modal-tab {
        min-width: 120px;
        padding: 12px 15px;
        font-size: 0.85rem;
    }
}

/* Большие телефоны */
@media (max-width: 767px) {
    .modal-content {
        width: 98%;
        margin: 2% auto;
        max-height: 98vh;
    }
    
    .modal-header {
        padding: 12px 15px;
    }
    
    .modal-title {
        font-size: 1.2rem;
    }
    
    .close {
        font-size: 24px;
        width: 25px;
        height: 25px;
    }
    
    .modal-tab-content {
        padding: 15px;
    }
    
    .modal-tabs {
        flex-direction: column;
        gap: 0;
    }
    
    .modal-tab {
        width: 100%;
        min-width: auto;
        padding: 10px 15px;
        font-size: 0.8rem;
        border-radius: 0;
        border-bottom: 1px solid #e3f2fd;
    }
    
    .modal-tab:last-child {
        border-bottom: none;
    }
    
    .data-table {
        font-size: 0.75rem;
        min-width: 400px;
    }
    
    .data-table th,
    .data-table td {
        padding: 6px 4px;
    }
    
    .filter-section {
        flex-direction: column;
        gap: 10px;
    }
    
    .filter-select {
        width: 100%;
        min-width: auto;
    }
    
    .reports-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .suppliers-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .document-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .notification-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* Телефоны */
@media (max-width: 575px) {
    .modal-content {
        width: 100%;
        height: 100vh;
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
    }
    
    .modal-header {
        padding: 10px 15px;
        border-radius: 0;
    }
    
    .modal-title {
        font-size: 1.1rem;
    }
    
    .close {
        font-size: 20px;
        width: 22px;
        height: 22px;
    }
    
    .modal-tab-content {
        padding: 10px;
        height: calc(100vh - 120px);
    }
    
    .modal-tab {
        padding: 8px 12px;
        font-size: 0.75rem;
    }
    
    .tab-panel h3 {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }
    
    .data-table {
        font-size: 0.7rem;
        min-width: 350px;
    }
    
    .data-table th,
    .data-table td {
        padding: 4px 3px;
    }
    
    .btn-small {
        padding: 4px 8px;
        font-size: 0.7rem;
    }
    
    .status {
        padding: 2px 6px;
        font-size: 0.65rem;
    }
    
    .report-card {
        padding: 15px;
    }
    
    .report-card h4 {
        font-size: 1rem;
    }
    
    .supplier-card {
        padding: 15px;
    }
    
    .supplier-card h4 {
        font-size: 1rem;
    }
}

/* ========================================
   ОЧЕНЬ МАЛЕНЬКИЕ ЭКРАНЫ (400px - 500px)
   ======================================== */
@media (max-width: 500px) and (min-width: 400px) {
    .container {
        padding: 0 4px;
    }
    
    .equipment-section {
        padding: 6px;
        margin-bottom: 8px;
    }
    
    .details-section {
        padding: 6px;
        min-height: 240px;
    }
    
    .equipment-passport {
        padding: 8px;
        max-height: 55vh;
        overflow-y: auto;
    }
    
    .passport-content {
        gap: 8px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
        gap: 5px;
    }
    
    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        padding: 3px 0;
    }
    
    .info-item label {
        font-size: 0.7rem;
        font-weight: 600;
        color: #1976d2;
    }
    
    .info-item span {
        font-size: 0.75rem;
        word-break: break-word;
    }
    
    .passport-actions {
        flex-direction: column;
        gap: 5px;
        margin-top: 10px;
    }
    
    .action-btn {
        width: 100%;
        padding: 8px 12px;
        font-size: 0.75rem;
        min-height: 40px;
        justify-content: center;
    }
    
    .btn-icon {
        font-size: 0.9rem;
        margin-right: 5px;
    }
    
    .equipment-table {
        font-size: 0.65rem;
        min-width: 440px;
    }
    
    .equipment-table th,
    .equipment-table td {
        padding: 3px 1px;
    }
    
    .table-container {
        max-height: 180px;
        overflow-y: auto;
    }
    
    .section-title {
        font-size: 0.95rem;
    }
    
    .passport-header h3 {
        font-size: 1.05rem;
    }
    
    .passport-section h4 {
        font-size: 0.85rem;
    }
}

/* ========================================
   ОЧЕНЬ МАЛЕНЬКИЕ ЭКРАНЫ (до 400px)
   ======================================== */
@media (max-width: 400px) {
    .container {
        padding: 0 2px;
    }
    
    .equipment-section {
        padding: 5px;
        margin-bottom: 8px;
    }
    
    .details-section {
        padding: 5px;
        min-height: 250px;
    }
    
    .table-container {
        max-height: 200px;
    }
    
    .equipment-passport {
        padding: 8px;
        max-height: 60vh;
    }
    
    .section-title {
        font-size: 1rem;
    }
    
    .equipment-table {
        font-size: 0.7rem;
        min-width: 450px;
    }
    
    .equipment-table th,
    .equipment-table td {
        padding: 4px 2px;
    }
}

/* ========================================
   ОБЩИЕ СТИЛИ ДЛЯ ПРЕДОТВРАЩЕНИЯ ВЫХОДА ЗА ЭКРАН
   ======================================== */
@media (max-width: 767px) {
    * {
        box-sizing: border-box;
    }
    
    .container,
    .ris-container,
    .equipment-section,
    .details-section,
    .equipment-passport,
    .passport-content,
    .info-grid,
    .info-item,
    .table-container,
    .equipment-table {
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .equipment-table {
        table-layout: fixed;
        width: 100%;
        font-size: 0.7rem;
    }
    
    .equipment-table th,
    .equipment-table td {
        word-break: break-word;
        overflow: hidden;
        text-overflow: ellipsis;
        padding: 3px 2px;
    }
    
    /* Оптимизация колонок для мобильных */
    .equipment-table th:nth-child(1),
    .equipment-table td:nth-child(1) {
        width: 12%;
    }
    
    .equipment-table th:nth-child(2),
    .equipment-table td:nth-child(2) {
        width: 20%;
    }
    
    .equipment-table th:nth-child(3),
    .equipment-table td:nth-child(3) {
        width: 25%;
    }
    
    .equipment-table th:nth-child(4),
    .equipment-table td:nth-child(4) {
        width: 20%;
    }
    
    .equipment-table th:nth-child(5),
    .equipment-table td:nth-child(5) {
        width: 23%;
    }
    
    /* Принудительное отображение кнопок */
    .passport-actions {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .action-btn {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* ========================================
   СПЕЦИАЛЬНЫЕ УЛУЧШЕНИЯ ДЛЯ МОБИЛЬНЫХ
   ======================================== */

/* Улучшение прокрутки таблиц */
@media (max-width: 767px) {
    .table-container {
        position: relative;
    }
    
    .table-container::after {
        content: '← Прокрутите для просмотра →';
        position: absolute;
        bottom: -25px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 0.7rem;
        color: #666;
        white-space: nowrap;
    }
}

/* Улучшение кнопок на мобильных */
@media (max-width: 575px) {
    .action-btn {
        min-height: 44px; /* Минимальный размер для удобного нажатия */
        touch-action: manipulation;
    }
    
    .btn-small {
        min-height: 32px;
        touch-action: manipulation;
    }
    
    .modal-tab {
        min-height: 44px;
        touch-action: manipulation;
    }
}

/* Улучшение футера на мобильных */
@media (max-width: 767px) {
    .footer {
        padding: 15px 0;
        margin-top: 30px;
    }
    
    .footer-content p {
        font-size: 0.8rem;
        text-align: center;
        padding: 0 10px;
    }
}

/* ========================================
   ЛАНДШАФТНАЯ ОРИЕНТАЦИЯ НА МОБИЛЬНЫХ
   ======================================== */
@media (max-width: 767px) and (orientation: landscape) {
    .modal-content {
        height: 100vh;
        margin: 0;
        border-radius: 0;
    }
    
    .modal-tab-content {
        height: calc(100vh - 100px);
    }
    
    .equipment-passport {
        max-height: 60vh;
        overflow-y: auto;
    }
    
    .ris-container {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    
    .equipment-section {
        padding: 10px;
    }
    
    .details-section {
        padding: 10px;
        min-height: 200px;
    }
    
    .table-container {
        max-height: 150px;
    }
}

/* ========================================
   ВЫСОКОЧАСТОТНЫЕ ЭКРАНЫ (Retina)
   ======================================== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .equipment-table,
    .data-table {
        border-width: 0.5px;
    }
    
    .modal-content {
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    }
}

/* ========================================
   ТЕМНАЯ ТЕМА (если понадобится в будущем)
   ======================================== */
@media (prefers-color-scheme: dark) {
    /* Здесь можно добавить стили для темной темы */
}

/* ========================================
   УЛУЧШЕНИЕ ДОСТУПНОСТИ
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    .modal-content {
        animation: none;
    }
    
    .action-btn,
    .btn-small,
    .modal-tab {
        transition: none;
    }
}

/* ========================================
   ПЕЧАТЬ
   ======================================== */
@media print {
    .modal {
        display: none !important;
    }
    
    .tabs {
        display: none;
    }
    
    .tab-content {
        display: block !important;
    }
    
    .equipment-passport {
        display: flex !important;
    }
    
    .action-btn {
        display: none;
    }
}

/* ========================================
   ИСПРАВЛЕНИЕ ПРОБЛЕМЫ С КНОПКАМИ НА 600px
   ======================================== */
@media (max-width: 600px) {
    .passport-actions {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .action-btn {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}
