/* style.css - Общие стили для системы контроля качества */

/* Базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* Заголовки */
h1 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 2em;
}

h2 {
    color: #34495e;
    margin-bottom: 20px;
    font-size: 1.5em;
}

h3 {
    color: #34495e;
    margin-bottom: 15px;
    font-size: 1.2em;
}

/* Шапка */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #ecf0f1;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    background: #3498db;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
}

/* Навигация */
.nav {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.nav a {
    padding: 12px 20px;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    transition: all 0.3s ease;
    font-size: 14px;
    text-align: center;
}

.nav a:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

/* Кнопки */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-success {
    background: #27ae60;
    color: white;
}

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

.btn-danger {
    background: #e74c3c;
    color: white;
}

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

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover {
    background: #e67e22;
}

.logout {
    background: #e74c3c;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 25px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.logout:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #3498db;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: #2980b9;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #34495e;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

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

/* Уведомления */
.success {
    color: #27ae60;
    padding: 15px;
    background: #d4edda;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #27ae60;
    font-size: 14px;
}

.error {
    color: #e74c3c;
    padding: 15px;
    background: #f8d7da;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #e74c3c;
    font-size: 14px;
}

/* Таблицы */
.table-container {
    overflow-x: auto;
    margin-top: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
    font-size: 14px;
}

th {
    background: #34495e;
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
}

tr:hover {
    background: #f8f9fa;
    transition: background 0.3s ease;
}

/* Фильтры */
.filters {
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.filters form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.filters input {
    padding: 10px;
    border: 2px solid #dee2e6;
    border-radius: 5px;
    font-size: 14px;
}

.filters input:focus {
    outline: none;
    border-color: #3498db;
}

.filters button {
    padding: 10px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.filters button:hover {
    background: #2980b9;
}

/* Статистика */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    color: white;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.stat-card h3 {
    margin: 0;
    color: rgba(255,255,255,0.9);
    font-size: 16px;
    margin-bottom: 10px;
}

.stat-card .value {
    font-size: 2.5em;
    font-weight: bold;
    color: white;
    margin: 10px 0;
}

/* Удостоверение качества */
.certificate {
    border: 2px solid #34495e;
    padding: 40px;
    margin-top: 20px;
    background: #fff;
    position: relative;
}

.certificate::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 1px solid #bdc3c7;
    pointer-events: none;
}

.certificate h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
    font-size: 1.8em;
    text-transform: uppercase;
}

.certificate table {
    width: 100%;
    margin: 20px 0;
}

.certificate table td {
    padding: 8px;
    border: none;
}

.certificate table tr td:first-child {
    font-weight: 600;
    width: 30%;
}

.print-btn {
    margin-top: 20px;
    padding: 12px 25px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.print-btn:hover {
    background: #229954;
}

/* Специальные отметки */
.loi-high {
    background-color: #f8d7da !important;
}

.loi-normal {
    background-color: #d4edda !important;
}

.badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
}

.badge-admin {
    background: #e74c3c;
    color: white;
}

.badge-laborant {
    background: #3498db;
    color: white;
}

.badge-operator {
    background: #f39c12;
    color: white;
}

/* Адаптивный дизайн */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 15px;
    }
    
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .nav {
        flex-direction: column;
    }
    
    .nav a {
        width: 100%;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
    
    .filters form {
        flex-direction: column;
    }
    
    .filters input {
        width: 100%;
    }
    
    table {
        font-size: 12px;
    }
    
    th, td {
        padding: 8px 10px;
    }
    
    .certificate {
        padding: 20px;
    }
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

/* Загрузка */
.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.loading.active {
    display: block;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

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

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 20px;
    border-radius: 10px;
    width: 80%;
    max-width: 500px;
    animation: fadeIn 0.3s ease;
}

/* Пагинация */
.pagination {
    display: flex;
    gap: 5px;
    margin-top: 20px;
    justify-content: center;
}

.pagination a {
    padding: 8px 12px;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.pagination a:hover {
    background: #2980b9;
}

.pagination a.active {
    background: #2c3e50;
    font-weight: bold;
}

/* Дополнительные стили для модулей */
.module-container {
    margin-top: 20px;
}

.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* Стили для печати */
@media print {
    body {
        background: white;
        padding: 0;
        color: black;
    }
    
    .container {
        box-shadow: none;
        padding: 0;
        max-width: 100%;
    }
    
    .no-print {
        display: none !important;
    }
    
    .certificate {
        border: 2px solid #000;
        padding: 20px;
    }
    
    .header,
    .nav,
    .filters,
    .print-btn,
    .back-link {
        display: none !important;
    }
}