* { margin: 0; padding: 0; box-sizing: border-box; }

body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    background: #f0f2f5; 
    color: #333; 
}

.header { 
    background: #1a365d; 
    color: white; 
    padding: 15px 30px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.2); 
}

.header h1 { font-size: 1.4rem; }
.header .subtitle { font-size: 0.85rem; opacity: 0.8; }

.nav-tabs { 
    display: flex; 
    background: #2c5282; 
    padding: 0 20px; 
    flex-wrap: wrap; 
}

.nav-tab { 
    padding: 14px 20px; 
    color: #cbd5e0; 
    cursor: pointer; 
    border: none; 
    background: none; 
    font-size: 0.9rem; 
    transition: all 0.3s; 
    border-bottom: 3px solid transparent; 
}

.nav-tab:hover { color: white; background: rgba(255,255,255,0.1); }
.nav-tab.active { color: white; border-bottom: 3px solid #48bb78; background: rgba(255,255,255,0.1); }

.container { max-width: 1400px; margin: 0 auto; padding: 20px; }

.card { 
    background: white; 
    border-radius: 10px; 
    padding: 25px; 
    margin-bottom: 20px; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.08); 
}

.card-title { 
    font-size: 1.2rem; 
    color: #1a365d; 
    margin-bottom: 20px; 
    padding-bottom: 10px; 
    border-bottom: 2px solid #e2e8f0; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

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

.form-group { display: flex; flex-direction: column; }

.form-group label { 
    font-size: 0.85rem; 
    font-weight: 600; 
    color: #4a5568; 
    margin-bottom: 5px; 
}

.form-group input, .form-group select { 
    padding: 10px 12px; 
    border: 1px solid #cbd5e0; 
    border-radius: 6px; 
    font-size: 0.95rem; 
}

.form-group input:focus, .form-group select:focus { 
    outline: none; 
    border-color: #4299e1; 
    box-shadow: 0 0 0 3px rgba(66,153,225,0.15); 
}

.btn { 
    padding: 10px 24px; 
    border: none; 
    border-radius: 6px; 
    font-size: 0.95rem; 
    font-weight: 600; 
    cursor: pointer; 
    transition: all 0.3s; 
    display: inline-flex; 
    align-items: center; 
    gap: 8px; 
}

.btn-primary { background: #3182ce; color: white; }
.btn-primary:hover { background: #2b6cb0; }
.btn-success { background: #48bb78; color: white; }
.btn-success:hover { background: #38a169; }
.btn-danger { background: #e53e3e; color: white; }
.btn-danger:hover { background: #c53030; }
.btn-warning { background: #d69e2e; color: white; }
.btn-warning:hover { background: #b7791f; }

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

.stat-card { 
    background: white; 
    border-radius: 10px; 
    padding: 20px; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.08); 
    text-align: center; 
    border-left: 4px solid; 
}

.stat-card.blue { border-left-color: #3182ce; }
.stat-card.green { border-left-color: #48bb78; }
.stat-card.orange { border-left-color: #ed8936; }
.stat-card.red { border-left-color: #e53e3e; }
.stat-card.purple { border-left-color: #805ad5; }
.stat-card.teal { border-left-color: #38b2ac; }

.stat-value { font-size: 2rem; font-weight: 700; color: #1a365d; }
.stat-label { font-size: 0.85rem; color: #718096; margin-top: 5px; }

table { 
    width: 100%; 
    border-collapse: collapse; 
    margin-top: 15px; 
    font-size: 0.88rem; 
}

th { 
    background: #2c5282; 
    color: white; 
    padding: 12px 10px; 
    text-align: left; 
    font-weight: 600; 
    position: sticky; 
    top: 0; 
}

td { padding: 10px; border-bottom: 1px solid #e2e8f0; }
tr:hover { background: #f7fafc; }

.table-container { 
    overflow-x: auto; 
    max-height: 600px; 
    overflow-y: auto; 
}

.badge { 
    padding: 3px 10px; 
    border-radius: 12px; 
    font-size: 0.75rem; 
    font-weight: 600; 
}

.badge-green { background: #c6f6d5; color: #22543d; }
.badge-yellow { background: #fefcbf; color: #744210; }
.badge-orange { background: #feebc8; color: #7c2d12; }
.badge-red { background: #fed7d7; color: #742a2a; }
.badge-purple { background: #e9d8fd; color: #44337a; }
.badge-gray { background: #e2e8f0; color: #2d3748; }

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

.search-bar { 
    display: flex; 
    gap: 10px; 
    margin-bottom: 15px; 
    flex-wrap: wrap; 
}

.search-bar input { 
    flex: 1; 
    min-width: 200px; 
    padding: 10px 15px; 
    border: 1px solid #cbd5e0; 
    border-radius: 6px; 
}

.filter-row { 
    display: flex; 
    gap: 10px; 
    margin-bottom: 15px; 
    flex-wrap: wrap; 
    align-items: center; 
}

.age-bar { 
    height: 8px; 
    border-radius: 4px; 
    background: #e2e8f0; 
    overflow: hidden; 
    margin-top: 5px; 
}

.age-fill { 
    height: 100%; 
    border-radius: 4px; 
    transition: width 0.5s; 
}

.hidden { display: none !important; }

.toast { 
    position: fixed; 
    top: 20px; 
    right: 20px; 
    padding: 15px 25px; 
    border-radius: 8px; 
    color: white; 
    font-weight: 600; 
    z-index: 1000; 
    animation: slideIn 0.3s ease; 
}

.toast.success { background: #48bb78; }
.toast.error { background: #e53e3e; }

@keyframes slideIn { 
    from { transform: translateX(100%); opacity: 0; } 
    to { transform: translateX(0); opacity: 1; } 
}

.file-upload { 
    border: 2px dashed #cbd5e0; 
    border-radius: 10px; 
    padding: 30px; 
    text-align: center; 
    cursor: pointer; 
    transition: all 0.3s; 
    margin-bottom: 20px; 
}

.file-upload:hover { border-color: #4299e1; background: #ebf8ff; }

.mpr-table th { font-size: 0.78rem; white-space: nowrap; }
.mpr-table td { font-size: 0.85rem; text-align: center; }
.mpr-table td:first-child, .mpr-table th:first-child { 
    text-align: left; 
    position: sticky; 
    left: 0; 
    background: #2c5282; 
    z-index: 2; 
}
.mpr-table td:first-child { background: white; font-weight: 600; }

.age-group-header { background: #edf2f7; font-weight: 700; text-align: center; }

.export-btn { float: right; margin-bottom: 10px; }

.empty-state { text-align: center; padding: 60px 20px; color: #a0aec0; }

.modal-overlay { 
    position: fixed; 
    top: 0; left: 0; right: 0; bottom: 0; 
    background: rgba(0,0,0,0.5); 
    display: none; 
    justify-content: center; 
    align-items: center; 
    z-index: 999; 
}

.modal-overlay.active { display: flex; }

.modal { 
    background: white; 
    border-radius: 12px; 
    padding: 30px; 
    max-width: 500px; 
    width: 90%; 
    max-height: 90vh; 
    overflow-y: auto; 
}

.modal h3 { margin-bottom: 20px; color: #1a365d; }

.modal-actions { 
    display: flex; 
    gap: 10px; 
    justify-content: flex-end; 
    margin-top: 20px; 
}

.stream-tag { 
    display: inline-block; 
    padding: 2px 8px; 
    border-radius: 4px; 
    font-size: 0.8rem; 
    font-weight: 600; 
}

.data-loaded { 
    background: #c6f6d5; 
    color: #22543d; 
    padding: 10px 15px; 
    border-radius: 6px; 
    margin-bottom: 15px; 
    font-weight: 600; 
}

@media print { 
    .header, .nav-tabs, .no-print { display: none !important; } 
    .card { box-shadow: none; border: 1px solid #ddd; } 
    body { background: white; } 
}

@media (max-width: 768px) {
    .header { flex-direction: column; text-align: center; }
    .header h1 { font-size: 1.1rem; }
    .nav-tab { padding: 10px 12px; font-size: 0.8rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .form-grid { grid-template-columns: 1fr; }
    .card-title { flex-direction: column; gap: 10px; }
    .export-btn { float: none; width: 100%; }
}
