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

:root {
    --green-dark: #0a3d2f;
    --green-medium: #1a6b4a;
    --green-light: #2d8f62;
    --green-pale: #c8e6d9;
    --white: #ffffff;
    --gray-light: #f1f5f9;
    --gray: #64748b;
    --red: #dc2626;
    --orange: #f59e0b;
    --blue: #3b82f6;
}

body {
    background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-medium) 50%, var(--green-light) 100%);
    font-family: 'Segoe UI', 'Roboto', sans-serif;
    min-height: 100vh;
}

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

.navbar {
    background: var(--green-dark);
    padding: 1rem 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.logo {
    color: white;
    font-size: 1.4rem;
    font-weight: 600;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 12px;
    align-items: center;
}

.nav-btn {
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    color: white;
    padding: 8px 20px;
    border-radius: 40px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.nav-btn:hover {
    background: white;
    color: var(--green-dark);
}

.user-greeting {
    color: white;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 40px;
}

.card {
    background: var(--white);
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.card-header h2 {
    color: var(--green-dark);
    font-size: 1.4rem;
}

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

.subject-card {
    background: var(--white);
    border-radius: 12px;
    padding: 22px;
    cursor: pointer;
    transition: all 0.25s;
    border: 1px solid #e2e8f0;
}

.subject-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.subject-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--green-dark);
}

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

.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
}

.badge-success {
    background: var(--green-pale);
    color: var(--green-dark);
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

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

.stat-card {
    background: #e8f5e9;
    padding: 18px;
    text-align: center;
    border-radius: 12px;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--green-dark);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--gray);
    margin-top: 6px;
}

.table-wrapper {
    overflow-x: auto;
    margin: 16px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

th {
    background: var(--green-dark);
    color: white;
    padding: 12px;
}

td {
    padding: 10px;
    border-bottom: 1px solid #e2e8f0;
    text-align: center;
}

tr:hover {
    background: #f7faf5;
}

.progress-bar {
    background: #e2e8e0;
    border-radius: 20px;
    overflow: hidden;
    width: 80px;
    display: inline-block;
}

.progress-fill {
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    font-weight: bold;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.chart-card {
    background: var(--gray-light);
    border-radius: 12px;
    padding: 20px;
}

.btn-success, .btn-outline, .btn-danger {
    padding: 10px 24px;
    border-radius: 40px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-success {
    background: var(--green-light);
    color: white;
}

.btn-success:hover {
    background: var(--green-medium);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--green-medium);
    color: var(--green-medium);
}

.btn-outline:hover {
    background: var(--green-medium);
    color: white;
}

.btn-danger {
    background: var(--red);
    color: white;
}

.upload-area {
    border: 2px dashed #cbd5e0;
    border-radius: 16px;
    padding: 48px;
    text-align: center;
    background: var(--gray-light);
    cursor: pointer;
    margin-bottom: 24px;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.file-list {
    background: var(--gray-light);
    border-radius: 12px;
    padding: 20px;
    margin: 16px 0;
}

.file-item {
    background: white;
    padding: 12px 16px;
    margin: 10px 0;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.subject-selector {
    background: var(--gray-light);
    padding: 20px;
    border-radius: 12px;
    margin: 16px 0;
    display: flex;
    gap: 20px;
    align-items: center;
}

.year-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.year-selector select, .subject-selector select {
    padding: 8px 16px;
    border-radius: 40px;
    border: 1px solid #cbd5e0;
    background: white;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background: white;
    margin: 100px auto;
    padding: 30px;
    width: 90%;
    max-width: 400px;
    border-radius: 20px;
    position: relative;
}

.modal-close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 24px;
    cursor: pointer;
}

.modal-content input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 8px;
    margin: 10px 0;
    text-align: center;
}

.alert-success, .alert-error, .alert-info {
    padding: 14px 20px;
    border-radius: 12px;
    margin: 16px 0;
}

.alert-success {
    background: #d4edda;
    color: #155724;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
}

.footer {
    text-align: center;
    padding: 24px;
    color: rgba(255, 255, 255, 0.7);
}

.page {
    display: none;
}

.page.active {
    display: block;
}

@media (max-width: 768px) {
    .container { padding: 0 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .charts-grid { grid-template-columns: 1fr; }
    .subjects-grid { grid-template-columns: 1fr; }
}