/* Контейнер лабораторий */
.labs-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
    background: #fff;
    min-height: calc(100vh - 160px);
}

/* Заголовок */
.labs-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.labs-title-section h1 {
    color: #2c3e50;
    font-size: 2.2rem;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.labs-title-section h1 i {
    color: #3498db;
}

.labs-subtitle {
    color: #7f8c8d;
    font-size: 1.1rem;
    margin: 0;
}

/* Статистика */
.labs-stats {
    display: flex;
    gap: 20px;
}

.stat-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    min-width: 150px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #3498db, #5dade2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.stat-icon i {
    color: white;
    font-size: 1.5rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1;
}

.stat-label {
    color: #6c757d;
    font-size: 0.9rem;
    margin-top: 5px;
}

/* Таблица лабораторий */
.labs-table-container {
    background: white;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    margin-bottom: 30px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.labs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.labs-table thead {
    background: linear-gradient(135deg, #2c3e50, #34495e);
}

.labs-table th {
    color: white;
    font-weight: 600;
    padding: 15px 12px;
    text-align: left;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.labs-table tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

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

.labs-table td {
    padding: 15px 12px;
    color: #495057;
    vertical-align: top;
}

/* Ячейка статуса */
.cell-status {
    width: 120px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
}

.status-active {
    background: #27ae60;
    color: white;
    border: none;
}

.status-excluded {
    background: #e74c3c;
    color: white;
    border: none;
}

.status-warning {
    background: #f39c12;
    color: white;
    border: none;
}

.status-unknown {
    background: #95a5a6;
    color: white;
    border: none;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Номер в реестре */
.cell-regnum {
    width: 130px;
}

.regnum-code {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-weight: 600;
    display: inline-block;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    font-size: 0.8rem;
    border: none;
    min-width: 90px;
}

.regnum-code:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.regnum-code::after {
    content: 'Копировать';
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    background: #2c3e50;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    opacity: 0;
    transition: all 0.2s ease;
    pointer-events: none;
    white-space: nowrap;
}

.regnum-code:hover::after {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

.regnum-code.copied {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
}

/* Ячейка организации */
.cell-org {
    min-width: 300px;
    max-width: 400px;
}

.org-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
    line-height: 1.4;
}

.org-department {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #6c757d;
    font-size: 0.85rem;
    margin-top: 5px;
}

.org-department i {
    color: #3498db;
    font-size: 0.8rem;
}

/* Даты */
.cell-dates {
    min-width: 160px;
}

.date-item {
    margin-bottom: 5px;
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.date-label {
    color: #6c757d;
    font-size: 0.8rem;
    min-width: 25px;
}

.date-value {
    color: #2c3e50;
    font-weight: 500;
    font-size: 0.9rem;
}

/* Область */
.cell-area {
    width: 80px;
}

.area-code {
    background: #e9ecef;
    color: #495057;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-block;
    border: 1px solid #dee2e6;
}

/* Действия */
.cell-actions {
    width: 100px;
}

.btn-view {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-view:hover {
    background: linear-gradient(135deg, #2980b9, #1c5a7a);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(52, 152, 219, 0.3);
    color: white;
}

/* Детальная страница */
.detail-navigation {
    margin-bottom: 30px;
}

.nav-back {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
    padding: 10px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-back:hover {
    background: #e9ecef;
    transform: translateX(-3px);
    color: #2980b9;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.detail-title-section h1 {
    color: #2c3e50;
    font-size: 2rem;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.detail-title-section h1 i {
    color: #3498db;
}

.detail-subtitle {
    color: #6c757d;
    font-size: 1.1rem;
    margin: 0;
}

.detail-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    padding: 10px 20px;
    border: 2px solid #e9ecef;
    background: white;
    border-radius: 8px;
    color: #495057;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.print-btn:hover {
    border-color: #3498db;
    color: #3498db;
}

.detail-section {
    background: white;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    margin-bottom: 25px;
    overflow: hidden;
}

.section-header {
    background: #f8f9fa;
    padding: 20px 25px;
    border-bottom: 1px solid #e9ecef;
}

.section-header h2 {
    color: #2c3e50;
    font-size: 1.3rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header h2 i {
    color: #3498db;
}

.section-content {
    padding: 25px;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.detail-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.detail-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    border-color: #3498db;
}

.detail-card-icon {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #3498db, #5dade2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.detail-card-icon i {
    color: white;
    font-size: 1.2rem;
}

.detail-card-content {
    flex: 1;
}

.detail-card-label {
    color: #6c757d;
    font-size: 0.85rem;
    margin-bottom: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-card-value {
    color: #2c3e50;
    font-size: 1rem;
    line-height: 1.5;
    word-break: break-word;
}

.source-link {
    color: #3498db;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.source-link:hover {
    text-decoration: underline;
    color: #2980b9;
}

.tech-info {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 25px;
}

.tech-item {
    margin-bottom: 20px;
}

.tech-label {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 5px;
    font-weight: 500;
}

.tech-value {
    color: #2c3e50;
    font-size: 1rem;
    word-break: break-all;
}

.tech-value code {
    background: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #e74c3c;
    border: 1px solid #dee2e6;
}

.tech-note {
    background: white;
    border-left: 4px solid #3498db;
    padding: 15px;
    border-radius: 0 6px 6px 0;
    margin-top: 25px;
    display: flex;
    gap: 12px;
}

.tech-note i {
    color: #3498db;
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.tech-note p {
    color: #495057;
    margin: 0;
    line-height: 1.6;
}

/* Панель фильтров */
.filters-panel {
    background: white;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    margin-bottom: 30px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.filter-group {
    margin-bottom: 15px;
}

.filter-label {
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.filter-label i {
    color: #3498db;
}

.status-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.status-filter {
    padding: 8px 15px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    color: #495057;
    text-decoration: none;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.status-filter:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.status-filter.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
    box-shadow: 0 3px 8px rgba(52, 152, 219, 0.3);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.status-all {
    background: #6c757d;
}

.status-active {
    background: #27ae60;
}

.status-excluded {
    background: #e74c3c;
}

/* Поиск */
.search-box {
    margin-bottom: 30px;
}

.search-input-group {
    display: flex;
    background: white;
    border-radius: 12px;
    border: 2px solid #e9ecef;
    overflow: hidden;
    transition: all 0.3s ease;
}

.search-input-group:focus-within {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.search-icon {
    padding: 0 20px;
    display: flex;
    align-items: center;
    color: #6c757d;
    font-size: 1.2rem;
}

.search-field {
    flex: 1;
    border: none;
    padding: 18px 10px;
    font-size: 1rem;
    outline: none;
    min-width: 0;
}

.search-field::placeholder {
    color: #adb5bd;
}

.search-button {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 0 30px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-button:hover {
    background: linear-gradient(135deg, #2980b9, #1c5a7a);
}

.search-tools {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding: 0 5px;
}

.clear-search {
    color: #e74c3c;
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.3s ease;
}

.clear-search:hover {
    color: #c0392b;
}

.search-results-info {
    color: #495057;
    font-size: 0.9rem;
}

/* Пагинация */
.pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 20px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

.pagination-info {
    color: #6c757d;
    font-size: 0.9rem;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-prev,
.page-next {
    padding: 10px 20px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    color: #495057;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.page-prev:hover,
.page-next:hover {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.page-numbers {
    display: flex;
    gap: 5px;
}

.page-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    color: #495057;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.page-number:hover {
    background: #e9ecef;
}

.page-number.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

/* Пустое состояние */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    width: 80px;
    height: 80px;
    background: #f8f9fa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
}

.empty-icon i {
    font-size: 2.5rem;
    color: #adb5bd;
}

.empty-state h3 {
    color: #495057;
    margin: 0 0 15px 0;
    font-size: 1.5rem;
}

.empty-state p {
    color: #6c757d;
    max-width: 500px;
    margin: 0 auto 25px;
    line-height: 1.6;
}

.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2980b9, #1c5a7a);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
    color: white;
}

/* Инфо панель */
.info-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.info-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.info-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.info-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #3498db, #5dade2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.info-icon i {
    color: white;
    font-size: 1.3rem;
}

.info-content {
    flex: 1;
}

.info-label {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 5px;
    font-weight: 500;
}

.info-value {
    color: #2c3e50;
    font-weight: 500;
    word-break: break-all;
}

.info-value code {
    background: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #e74c3c;
    border: 1px solid #dee2e6;
}

/* Стили для отзывов */
.reviews-list {
    margin-top: 20px;
}

.review-card {
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    background: white;
    transition: all 0.3s ease;
}

.review-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

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

.reviewer-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    background: #f1f3f4;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reviewer-avatar i {
    font-size: 2.5rem;
    color: #3498db;
}

.reviewer-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.reviewer-name {
    font-weight: 600;
    color: #2c3e50;
}

.review-date {
    color: #6c757d;
    font-size: 0.85rem;
}

.review-rating i {
    color: #f1c40f;
    margin-right: 2px;
}

.review-advantages {
    margin-bottom: 15px;
    padding-left: 15px;
    border-left: 3px solid #27ae60;
}

.review-disadvantages {
    margin-bottom: 15px;
    padding-left: 15px;
    border-left: 3px solid #e74c3c;
}

.review-advantages strong,
.review-disadvantages strong {
    display: block;
    margin-bottom: 5px;
}

.review-text {
    color: #495057;
    line-height: 1.6;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
}

.review-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.review-btn {
    padding: 8px 15px;
    border: 1px solid #e9ecef;
    background: white;
    border-radius: 6px;
    color: #495057;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 0.9rem;
}

.review-btn.edit:hover {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.review-btn.delete:hover {
    background: #e74c3c;
    color: white;
    border-color: #e74c3c;
}

.rating-input {
    display: flex;
    gap: 10px;
    flex-direction: row-reverse;
    justify-content: flex-end;
}

.rating-star-label {
    cursor: pointer;
    font-size: 1.5rem;
}

.rating-star-label input {
    display: none;
}

.rating-star-label i {
    color: #ddd;
    transition: color 0.2s;
}

.rating-star-label:hover i,
.rating-star-label:hover ~ .rating-star-label i,
.rating-star-label input:checked ~ i {
    color: #f1c40f;
}

.lab-rating-large {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.rating-stars {
    display: flex;
    gap: 5px;
}

.rating-stars i {
    color: #f1c40f;
    font-size: 1.3rem;
}

.rating-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
}

.rating-count {
    color: #6c757d;
    font-size: 0.9rem;
}

.alert {
    padding: 15px 20px;
    border-radius: 8px;
    border-left: 4px solid;
    margin-bottom: 20px;
}

.alert-info {
    background: rgba(52, 152, 219, 0.1);
    border-left-color: #3498db;
    color: #2c3e50;
}

.alert-warning {
    background: rgba(241, 196, 15, 0.1);
    border-left-color: #f1c40f;
    color: #2c3e50;
}

.alert-warning a {
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
}

.alert-warning a:hover {
    text-decoration: underline;
}

/* Копи тултип */
.copy-tooltip {
    position: fixed;
    background: #2c3e50;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.copy-tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

/* Адаптивность */
@media (max-width: 1200px) {
    .labs-table {
        font-size: 0.85rem;
    }
    
    .cell-org {
        min-width: 250px;
    }
}

@media (max-width: 992px) {
    .labs-header {
        flex-direction: column;
    }
    
    .labs-stats {
        width: 100%;
        justify-content: center;
    }
    
    .info-panel {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .labs-container {
        padding: 20px 15px;
    }
    
    .labs-title-section h1 {
        font-size: 1.8rem;
    }
    
    .search-input-group {
        flex-direction: column;
    }
    
    .search-button {
        padding: 15px;
        justify-content: center;
    }
    
    .search-tools {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .pagination-wrapper {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }
    
    .table-responsive {
        overflow-x: auto;
    }
    
    .labs-table {
        min-width: 1000px;
    }
    
    .status-filters {
        flex-direction: column;
    }
    
    .status-filter {
        justify-content: center;
    }
    
    .details-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .stat-item {
        min-width: 120px;
        padding: 15px;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
    }
    
    .detail-header {
        flex-direction: column;
    }
    
    .detail-actions {
        width: 100%;
    }
    
    .action-btn {
        flex: 1;
        justify-content: center;
    }
}