/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Заголовок */
header {
    text-align: center;
    margin-bottom: 40px;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 2.5em;
    color: #2c3e50;
    margin-bottom: 10px;
}

header h2 {
    font-size: 1.5em;
    color: #7f8c8d;
    font-weight: 400;
}

/* Основной контент */
main {
    flex: 1;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

/* Шаги */
.step {
    margin-bottom: 30px;
    opacity: 1;
    transform: translateY(0);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 20px;
    background: #ffffff;
}

.step.hidden {
    display: none;
}

.step-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ecf0f1;
}

.step-number {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2em;
    margin-right: 15px;
}

.step h3 {
    color: #2c3e50;
    font-size: 1.4em;
}

.step-content {
    padding-left: 55px;
}

/* Формы */
.form-input, .form-select {
    width: 100%;
    max-width: 400px;
    padding: 12px 16px;
    border: 2px solid #ecf0f1;
    border-radius: 10px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: white;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-input:disabled, .form-select:disabled {
    background: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

/* Кнопки */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px;
    display: inline-block;
    text-decoration: none;
    text-align: center;
}

.btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(149, 165, 166, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.4);
}

/* Таблица рыб */
.fish-table-container {
    margin: 20px 0;
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.fish-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
}

.fish-table th {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.fish-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #ecf0f1;
}

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

.fish-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.fish-table tbody tr:nth-child(even):hover {
    background: #f0f0f0;
}

.totals-row {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    font-weight: bold;
}

.totals-row td {
    border-bottom: none;
}

/* Поля ввода в таблице */
.fish-table input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.fish-table input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.fish-table input:disabled {
    background: #f8f9fa;
    color: #6c757d;
}

/* Действия формы */
.form-actions {
    margin-top: 30px;
    text-align: center;
}

/* Информация о выбранных данных */
.selected-info {
    background: linear-gradient(135deg, #e8f4fd, #f0f8ff);
    border: 1px solid #b3d9ff;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    font-size: 0.95em;
    line-height: 1.6;
}

.selected-info strong {
    color: #2c3e50;
    font-weight: 600;
}

.selected-info span {
    color: #3498db;
    font-weight: 500;
}

/* Результат */
.result {
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    border-radius: 20px;
    margin: 20px 0;
}

.result-content h3 {
    font-size: 2em;
    margin-bottom: 15px;
}

.result-content p {
    font-size: 1.2em;
    margin-bottom: 25px;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    position: relative;
    animation: slideIn 0.3s ease;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 15px;
}

.close:hover {
    color: #000;
}

/* Подвал */
footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    padding: 20px;
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    header h2 {
        font-size: 1.2em;
    }
    
    main {
        padding: 20px;
    }
    
    .step-content {
        padding-left: 0;
    }
    
    .step-header {
        flex-direction: column;
        text-align: center;
    }
    
    .step-number {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .form-input, .form-select {
        max-width: 100%;
    }
    
    .fish-table {
        font-size: 0.9em;
    }
    
    .fish-table th,
    .fish-table td {
        padding: 8px 10px;
    }
}

/* Загрузка */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

/* Успех и ошибка */
.success {
    color: #27ae60;
}

.error {
    color: #e74c3c;
}

.warning {
    color: #f39c12;
}

/* Навигация по вкладкам */
.tab-navigation {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.tab-button {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    margin: 0 5px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #7f8c8d;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-button:hover {
    background: #ecf0f1;
    color: #2c3e50;
}

.tab-button.active {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    box-shadow: 0 3px 10px rgba(52, 152, 219, 0.3);
}

.tab-icon {
    margin-right: 8px;
    font-size: 1.2em;
}

/* Контент вкладок */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Таблица статистики */
.stats-table-container {
    margin: 20px 0;
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
}

.stats-table th {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.stats-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #ecf0f1;
}

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

.stats-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.stats-table tbody tr:nth-child(even):hover {
    background: #f0f0f0;
}

.stats-totals-row {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    font-weight: bold;
}

.stats-totals-row td {
    border-bottom: none;
}

/* Интерфейс импорта файлов */
.file-format-info {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
}

.file-format-info h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.file-format-info p {
    margin-bottom: 10px;
    color: #495057;
}

.format-example {
    background: #ffffff;
    border: 1px solid #ced4da;
    border-radius: 5px;
    padding: 10px;
    margin: 10px 0;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #495057;
    overflow-x: auto;
}

.format-example code {
    background: none;
    color: inherit;
    padding: 0;
}

.file-upload-section {
    background: linear-gradient(135deg, #e8f4fd, #f0f8ff);
    border: 1px solid #b3d9ff;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
}

.file-input-container {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

.file-name {
    color: #495057;
    font-style: italic;
    flex: 1;
}

.file-icon, .upload-icon {
    margin-right: 8px;
}

.upload-actions {
    text-align: center;
}

.import-result {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border: 1px solid #c3e6cb;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.import-result.error {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    border-color: #f5c6cb;
}

.import-result h4 {
    color: #155724;
    margin-bottom: 15px;
}

.import-result.error h4 {
    color: #721c24;
}

.import-result-content {
    margin-bottom: 20px;
    line-height: 1.6;
}

.import-result-content ul {
    margin: 10px 0;
    padding-left: 20px;
}

.import-result-content li {
    margin-bottom: 5px;
    color: #495057;
}

/* Главная навигация */
.main-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
    padding: 0;
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    justify-content: center;
    align-items: center;
}

.nav-item {
    background: none;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.nav-item:hover {
    background: #e9ecef;
    color: #2c3e50;
    text-decoration: none;
}

.nav-item.active {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    box-shadow: 0 2px 8px rgba(0,123,255,0.3);
}

/* Сворачиваемый блок с информацией о формате */
.format-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    transition: background-color 0.3s ease;
}

.format-header:hover {
    background: #e9ecef;
}

.format-header h4 {
    margin: 0;
    color: #495057;
}

.toggle-icon {
    font-size: 14px;
    color: #6c757d;
    transition: transform 0.3s ease;
}

.format-content {
    padding: 15px;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 8px 8px;
}

/* Радио-кнопки для выбора периода */
.radio-group {
    display: flex;
    gap: 20px;
    margin: 10px 0;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: #ffffff;
}

.radio-option:hover {
    border-color: #3498db;
    background: #f8f9fa;
}

.radio-option input[type="radio"] {
    margin-right: 8px;
    transform: scale(1.2);
}

.radio-option input[type="radio"]:checked + .radio-label {
    color: #3498db;
    font-weight: 600;
}

.radio-option:has(input[type="radio"]:checked) {
    border-color: #3498db;
    background: #e3f2fd;
}

.radio-label {
    font-size: 14px;
    color: #495057;
}

/* Поля для выбора дат */
.date-range-inputs {
    display: flex;
    gap: 20px;
    margin-top: 15px;
}

.date-input-group {
    flex: 1;
}

.date-input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
}

/* Стили для страницы экспорта */
.export-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Стили для страницы Excel отчета */
.report-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.report-period-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    border-left: 4px solid #3498db;
}

.report-period-info h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 16px;
}

.period-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
}

.period-item {
    background: #ffffff;
    padding: 12px 15px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    font-size: 14px;
    color: #495057;
}

.period-item strong {
    color: #2c3e50;
    font-weight: 600;
}

.report-form {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
}

.calculated-period {
    background: #e8f5e8;
    border: 1px solid #28a745;
    border-radius: 6px;
    padding: 15px;
    margin: 15px 0;
}

.calculated-period h4 {
    color: #155724;
    margin-bottom: 8px;
    font-size: 16px;
}

.period-display {
    background: #ffffff;
    padding: 10px 15px;
    border-radius: 4px;
    font-weight: 600;
    color: #28a745;
    font-size: 16px;
}

.form-help {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #6c757d;
}

.report-status {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.report-status.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.report-status.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.report-status.info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.report-info {
    background: #ffffff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.report-info h4 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 18px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.info-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border-left: 3px solid #3498db;
}

.info-item strong {
    color: #2c3e50;
    font-weight: 600;
}

.report-structure {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border-left: 4px solid #17a2b8;
}

.report-structure h5 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 16px;
}

.report-structure ul {
    margin: 0;
    padding-left: 20px;
}

.report-structure li {
    margin-bottom: 8px;
    color: #495057;
    line-height: 1.4;
}

.report-structure li strong {
    color: #2c3e50;
}

.section-header {
    text-align: center;
    margin-bottom: 30px;
}

.section-header h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 24px;
}

.section-header p {
    color: #7f8c8d;
    font-size: 16px;
    line-height: 1.5;
}

.export-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.export-option {
    border: 2px solid #ecf0f1;
    border-radius: 12px;
    padding: 25px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.export-option:hover {
    border-color: #3498db;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.1);
}

.option-header h4 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 18px;
}

.option-header p {
    color: #7f8c8d;
    margin-bottom: 20px;
    font-size: 14px;
}

.option-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.format-info {
    flex: 1;
    font-size: 13px;
    color: #5a6c7d;
    line-height: 1.4;
}

.format-info strong {
    color: #2c3e50;
}

.export-status {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.export-status.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.export-status.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.export-status.info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.export-preview {
    background: #ffffff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.export-preview h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 18px;
}

.export-preview p {
    color: #7f8c8d;
    margin-bottom: 20px;
}

.preview-table-container {
    margin-bottom: 20px;
    overflow-x: auto;
    overflow-y: auto;
    max-height: 400px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.preview-table th,
.preview-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.preview-table th {
    background: #3498db;
    color: #ffffff;
    font-weight: 600;
    font-size: 14px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.preview-table td {
    color: #2c3e50;
    font-size: 14px;
}

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

.preview-table tbody tr:last-child td {
    border-bottom: none;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .main-navigation {
        flex-direction: column;
        align-items: center;
    }

    .nav-item {
        width: 100%;
        justify-content: center;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .date-range-inputs {
        flex-direction: column;
        gap: 15px;
    }
    
    .option-details {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .export-option {
        padding: 20px;
    }
    
    .export-section,
    .export-preview {
        padding: 20px;
    }
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95em;
    font-weight: 500;
    color: #495057;
    text-decoration: none;
}

.nav-item:hover {
    background: linear-gradient(135deg, #e9ecef, #dee2e6);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    text-decoration: none;
    color: #495057;
}

.nav-item.active {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border-color: #0056b3;
    box-shadow: 0 4px 12px rgba(0,123,255,0.3);
}

.nav-item.active:hover {
    color: white;
}

/* ========================================
   АДАПТИВНЫЙ ДИЗАЙН (MEDIA QUERIES)
   ======================================== */

/* Большие планшеты и маленькие ноутбуки (до 1024px) */
@media (max-width: 1024px) {
    .container {
        max-width: 100%;
        padding: 15px;
    }

    header h1 {
        font-size: 2em;
    }

    header h2 {
        font-size: 1.2em;
    }
}

/* Планшеты (до 768px) */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    .container {
        padding: 10px;
    }

    header {
        padding: 20px;
        margin-bottom: 20px;
    }

    header h1 {
        font-size: 1.8em;
    }

    header h2 {
        font-size: 1em;
    }

    /* Навигация - вертикальная на планшетах */
    .main-navigation {
        flex-direction: column;
        gap: 8px;
    }

    .nav-item {
        width: 100%;
        text-align: center;
        padding: 12px 15px;
        font-size: 14px;
    }

    /* Формы */
    .form-group {
        margin-bottom: 15px;
    }

    .form-group label {
        font-size: 13px;
    }

    input[type="text"],
    input[type="number"],
    input[type="date"],
    select {
        font-size: 14px;
        padding: 10px;
    }

    /* Кнопки */
    .button, .btn, button {
        padding: 12px 20px;
        font-size: 14px;
    }

    /* Таблицы - горизонтальный скролл */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 600px;
        font-size: 13px;
    }

    th, td {
        padding: 8px;
    }

    /* Статистика */
    .statistics-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-value {
        font-size: 1.8em;
    }

    /* Шаги (steps) */
    .step {
        padding: 20px;
    }

    .step h3 {
        font-size: 1.3em;
    }

    /* Опции экспорта/импорта */
    .options-container {
        flex-direction: column;
    }

    .option-card {
        width: 100%;
    }
}

/* Мобильные телефоны (до 480px) */
@media (max-width: 480px) {
    body {
        font-size: 13px;
    }

    .container {
        padding: 8px;
    }

    header {
        padding: 15px;
        margin-bottom: 15px;
    }

    header h1 {
        font-size: 1.5em;
    }

    header h2 {
        font-size: 0.9em;
    }

    /* Навигация - компактная на мобильных */
    .main-navigation {
        gap: 6px;
    }

    .nav-item {
        padding: 10px 12px;
        font-size: 13px;
    }

    /* Основной контент */
    main {
        padding: 15px;
    }

    /* Формы - полная ширина */
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-group {
        width: 100% !important;
        margin-bottom: 12px;
    }

    input[type="text"],
    input[type="number"],
    input[type="date"],
    input[type="password"],
    select,
    textarea {
        font-size: 16px; /* Предотвращает зум на iOS */
        padding: 12px;
    }

    /* Кнопки - полная ширина */
    .button, .btn, button {
        width: 100%;
        padding: 14px 20px;
        font-size: 15px;
        margin-bottom: 10px;
    }

    .button-group {
        flex-direction: column;
        gap: 10px;
    }

    /* Таблицы - еще более компактные */
    table {
        font-size: 12px;
        min-width: 500px;
    }

    th, td {
        padding: 6px 4px;
    }

    /* Убираем некоторые колонки на мобильных через data-атрибуты */
    table td:nth-child(n+6),
    table th:nth-child(n+6) {
        display: none;
    }

    /* Статистика - одна колонка */
    .statistics-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .stat-card {
        padding: 12px;
    }

    .stat-label {
        font-size: 12px;
    }

    .stat-value {
        font-size: 1.5em;
    }

    /* Шаги */
    .step {
        padding: 15px;
        margin-bottom: 15px;
    }

    .step h3 {
        font-size: 1.2em;
        margin-bottom: 12px;
    }

    /* Карточки опций */
    .option-card {
        padding: 15px;
    }

    .option-header h3 {
        font-size: 1.1em;
    }

    .option-details {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    /* Модальные окна - на весь экран */
    .modal-content {
        width: 95%;
        max-width: none;
        margin: 10px;
        max-height: 90vh;
        overflow-y: auto;
    }

    /* Логин форма */
    .login-container {
        padding: 30px 20px;
        width: 95%;
    }

    .login-container h1 {
        font-size: 1.8em;
    }

    /* Админ панель */
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .admin-actions {
        width: 100%;
        justify-content: space-between;
    }

    /* Табы */
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tab-button {
        padding: 10px 15px;
        font-size: 13px;
        white-space: nowrap;
    }

    /* Увеличиваем размер touch-элементов */
    input[type="checkbox"],
    input[type="radio"] {
        width: 20px;
        height: 20px;
    }

    /* Скрываем tooltip на мобильных */
    .tooltip {
        display: none;
    }
}

/* Очень маленькие экраны (до 360px) */
@media (max-width: 360px) {
    header h1 {
        font-size: 1.3em;
    }

    header h2 {
        font-size: 0.8em;
    }

    .nav-item {
        padding: 8px 10px;
        font-size: 12px;
    }

    main {
        padding: 10px;
    }

    .button, .btn, button {
        padding: 12px 15px;
        font-size: 14px;
    }
}

/* Ландшафтная ориентация для мобильных */
@media (max-width: 768px) and (orientation: landscape) {
    header {
        padding: 10px;
        margin-bottom: 10px;
    }

    header h1 {
        font-size: 1.3em;
    }

    header h2 {
        font-size: 0.9em;
    }

    .main-navigation {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 5px;
    }

    .nav-item {
        flex: 1 1 auto;
        min-width: 120px;
        padding: 8px 10px;
        font-size: 12px;
    }
}

/* Touch-устройства - увеличиваем интерактивные элементы */
@media (hover: none) and (pointer: coarse) {
    .button, .btn, button, .nav-item, a {
        min-height: 44px; /* Рекомендация Apple для touch */
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    input[type="text"],
    input[type="number"],
    input[type="date"],
    input[type="password"],
    select {
        min-height: 44px;
    }

    /* Убираем hover эффекты на touch-устройствах */
    .button:hover,
    .btn:hover,
    .nav-item:hover {
        transform: none;
    }
}

/* Режим печати */
@media print {
    body {
        background: white;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    header {
        background: white;
        box-shadow: none;
        border-bottom: 2px solid #333;
    }

    .main-navigation,
    .button,
    .btn,
    button,
    .admin-actions {
        display: none !important;
    }

    main {
        background: white;
        box-shadow: none;
    }

    table {
        page-break-inside: avoid;
    }

    .stat-card {
        page-break-inside: avoid;
    }
}

/* Стили для страницы управления разрешениями */
.permissions-section {
    padding: 30px;
}

.permission-form {
    max-width: 800px;
    margin: 0 auto;
}

.permission-form .form-group {
    margin-bottom: 20px;
}

.permission-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.permission-form input[type="text"],
.permission-form input[type="number"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.permission-form input[type="text"]:focus,
.permission-form input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.permission-form input[type="text"]:required,
.permission-form input[type="number"]:required {
    border-left: 3px solid #e74c3c;
}

.status-message {
    margin-top: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
}

.status-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}
