:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --bg: #f5f6fb;
    --card: #ffffff;
    --border: #e5e7eb;
    --text: #1f2937;
    --muted: #6b7280;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}
.navbar {
    background: var(--primary);
    color: white;
}
.navbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
}
.brand { color: white; font-weight: 700; text-decoration: none; font-size: 1.1rem; }
.nav-links { display: flex; align-items: center; gap: 16px; }
.nav-links a { color: white; text-decoration: none; font-size: 0.95rem; }
.nav-links a:hover { text-decoration: underline; }
.nav-user { font-size: 0.9rem; opacity: 0.9; }
.btn-logout { background: rgba(255,255,255,0.15); padding: 6px 12px; border-radius: 6px; }

.container { max-width: 1100px; margin: 0 auto; padding: 24px 20px 60px; }

.footer { text-align: center; padding: 20px; color: var(--muted); font-size: 0.85rem; }

.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 0.95rem; }
.flash.success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.flash.error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.flash.info { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 18px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.card h2, .card h3 { margin-top: 0; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.page-header h1 { margin: 0; }

.btn {
    display: inline-block;
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.95rem;
    transition: background 0.15s;
}
.btn:hover { background: var(--primary-dark); }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.btn-outline { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn-danger { background: var(--danger); }
.btn-success { background: var(--success); }
.btn-secondary { background: #6b7280; }

form .form-group { margin-bottom: 16px; }
label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.9rem; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=datetime-local], input[type=file], textarea, select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
}
textarea { resize: vertical; min-height: 100px; }
small.hint { color: var(--muted); display: block; margin-top: 4px; }

.auth-box { max-width: 420px; margin: 40px auto; }

table { width: 100%; border-collapse: collapse; background: white; border-radius: 10px; overflow: hidden; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
th { background: #f3f4f6; font-weight: 700; }
tr:last-child td { border-bottom: none; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-muted { background: #f3f4f6; color: #4b5563; }

.course-card { border-left: 4px solid var(--primary); }
.course-code { color: var(--muted); font-size: 0.85rem; }

.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }

.tabs { display: flex; gap: 8px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.tabs a { padding: 10px 16px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs a.active { color: var(--primary); border-color: var(--primary); font-weight: 600; }

.progress-bar { background: #e5e7eb; border-radius: 999px; height: 8px; overflow: hidden; }
.progress-bar-fill { background: var(--primary); height: 100%; }

.ai-flag { color: var(--danger); font-weight: 700; }
.score-box { font-size: 1.6rem; font-weight: 700; color: var(--primary); }
