* {
    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;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
}

header h1 {
    margin-bottom: 20px;
    font-size: 28px;
}

.controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.controls input[type="date"] {
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    flex: 1;
    min-width: 200px;
}

.controls button {
    padding: 12px 24px;
    background: white;
    color: #667eea;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.controls button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.loading {
    text-align: center;
    padding: 60px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 30px;
    background: #f8f9fa;
}

.summary-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #667eea;
}

.summary-card.good {
    border-left-color: #4caf50;
}

.summary-card.warning {
    border-left-color: #ff9800;
}

.summary-card.bad {
    border-left-color: #f44336;
}

.summary-card h3 {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.stat-number {
    font-size: 32px;
    font-weight: bold;
    color: #333;
}

.error {
    background: #ffebee;
    color: #c62828;
    padding: 20px;
    margin: 20px;
    border-radius: 8px;
    border-left: 4px solid #f44336;
}

.report-container {
    padding: 30px;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

thead {
    background: #f8f9fa;
}

th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
}

tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background 0.2s;
}

tbody tr:hover {
    background: #f8f9fa;
}

td {
    padding: 16px;
}

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.status-good {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-warning {
    background: #fff3e0;
    color: #e65100;
}

.status-bad {
    background: #ffebee;
    color: #c62828;
}

.compliance-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bar-container {
    flex: 1;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s;
}

.bar-fill.good {
    background: #4caf50;
}

.bar-fill.warning {
    background: #ff9800;
}

.bar-fill.bad {
    background: #f44336;
}

.btn-details {
    padding: 8px 16px;
    background: transparent;
    color: #2196F3;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    text-decoration: underline;
    font-weight: bold;
}

.btn-details:hover {
    color: #1976D2;
    transform: translateY(-1px);
    text-decoration: underline;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 16px;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    transition: color 0.2s;
}

.close:hover {
    color: #333;
}

.detail-item {
    padding: 15px;
    margin: 10px 0;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.detail-item.negative {
    border-left-color: #f44336;
    background: #ffebee;
}

.detail-item.positive {
    border-left-color: #4caf50;
    background: #e8f5e9;
}

.detail-item h4 {
    margin-bottom: 8px;
    color: #333;
}

.detail-stats {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: #666;
}

.detail-stats span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.deviation-negative {
    color: #c62828;
    font-weight: bold;
}

.deviation-positive {
    color: #2e7d32;
    font-weight: bold;
}
