/* Incident Overview Styles */

/* Filter Bar */
.incidents-filter-bar {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 120px;
}

.filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group select,
.filter-group input[type="date"],
.filter-group input[type="text"] {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    transition: all 0.2s ease;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-group input[type="text"] {
    min-width: 200px;
}

/* Summary Cards */
.incidents-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.summary-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s ease;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.summary-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.summary-icon.accident {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.summary-icon.near-miss {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.summary-icon.pending {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
}

.summary-icon.this-month {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.summary-content h3 {
    margin: 0 0 4px 0;
    font-size: 32px;
    font-weight: 700;
    color: #1e293b;
}

.summary-content span {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}

/* Incidents Container */
.incidents-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    min-height: 400px;
    position: relative;
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px;
    font-size: 16px;
    color: #64748b;
}

.loading-spinner i {
    margin-right: 12px;
    font-size: 20px;
    color: #3b82f6;
}

/* No Data Message */
.no-data-message {
    text-align: center;
    padding: 60px 40px;
    color: #64748b;
}

.no-data-message i {
    font-size: 48px;
    color: #cbd5e1;
    margin-bottom: 16px;
}

.no-data-message h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    color: #334155;
}

.no-data-message p {
    margin: 0 0 24px 0;
    font-size: 14px;
    line-height: 1.6;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Incidents List */
.incidents-list {
    padding: 0;
}

.incident-card {
    border-bottom: 1px solid #f1f5f9;
    padding: 20px 24px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.incident-card:hover {
    background: #f8fafc;
}

.incident-card:last-child {
    border-bottom: none;
}

.incident-header {
    display: flex;
    justify-content: between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.incident-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.incident-type-badge.accident {
    background: #fee2e2;
    color: #dc2626;
}

.incident-type-badge.near_miss {
    background: #fef3c7;
    color: #d97706;
}

.incident-id {
    font-size: 12px;
    color: #64748b;
    font-family: 'Monaco', 'Menlo', monospace;
}

.incident-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.incident-badges {
    display: flex;
    gap: 8px;
    align-items: center;
}

.incident-date {
    font-size: 14px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.incident-severity {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.incident-severity.niedrig {
    background: #dcfce7;
    color: #166534;
}

.incident-severity.mittel {
    background: #fef3c7;
    color: #92400e;
}

.incident-severity.hoch {
    background: #fed7d7;
    color: #c53030;
}

.incident-severity.kritisch {
    background: #e2e8f0;
    color: #2d3748;
    animation: criticalPulse 2s infinite;
}

@keyframes criticalPulse {
    0%, 100% { background: #fed7d7; }
    50% { background: #fca5a5; }
}

.incident-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.incident-location {
    font-size: 14px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}

.incident-description {
    font-size: 14px;
    color: #475569;
    line-height: 1.5;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.incident-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

.incident-reporter {
    font-size: 12px;
    color: #64748b;
}

.incident-actions {
    display: flex;
    gap: 8px;
}

.incident-action-btn {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.incident-action-btn.view {
    background: #e0f2fe;
    color: #0369a1;
}

.incident-action-btn.view:hover {
    background: #bae6fd;
}

.incident-action-btn.edit {
    background: #f0f9ff;
    color: #0284c7;
}

.incident-action-btn.edit:hover {
    background: #e0f7fa;
}

.incident-action-btn.dguv {
    background: #ecfdf5;
    color: #059669;
}

.incident-action-btn.dguv:hover {
    background: #d1fae5;
}

.incident-action-btn.delete {
    background: #fef2f2;
    color: #dc2626;
}

.incident-action-btn.delete:hover {
    background: #fee2e2;
}

/* Status Badge */
.incident-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.incident-status.offen {
    background: #fef3c7;
    color: #92400e;
}

.incident-status.in_bearbeitung {
    background: #dbeafe;
    color: #1d4ed8;
}

.incident-status.abgeschlossen {
    background: #dcfce7;
    color: #166534;
}

/* Pagination */
.incidents-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: white;
    border-radius: 0 0 12px 12px;
}

.incidents-pagination button {
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    color: #64748b;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.incidents-pagination button:hover:not(:disabled) {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.incidents-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#pageInfo {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .incidents-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        min-width: auto;
    }
    
    .incidents-summary {
        grid-template-columns: 1fr;
    }
    
    .incident-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .incident-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .incident-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .incident-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Expandable Incident Details */
.incident-card.expanded {
    background: #f8fafc;
}

.incident-details {
    margin-top: 16px;
    padding: 16px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    display: none;
}

.incident-card.expanded .incident-details {
    display: block;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

.incident-details h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.incident-details p {
    margin: 0 0 12px 0;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
}

.incident-details:last-child p {
    margin-bottom: 0;
}

/* Files List in Details */
.incident-files {
    margin-top: 12px;
}

.incident-files h5 {
    margin: 0 0 8px 0;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.incident-file {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: #f9fafb;
    border-radius: 4px;
    margin-bottom: 4px;
    font-size: 12px;
    color: #6b7280;
}

.incident-file i {
    color: #9ca3af;
}

.incident-file:last-child {
    margin-bottom: 0;
}