:root {
    --bg: #0f172a;
    --card-bg: #ffffff;
    --text: #1e293b;
    --muted: #64748b;
    --primary: #1d4ed8;
    --primary-dark: #1e40af;
    --border: #e2e8f0;
    --danger: #b91c1c;
    --danger-bg: #fee2e2;
    --success: #15803d;
    --success-bg: #dcfce7;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    background: #f1f5f9;
    color: var(--text);
}

.topbar {
    background: var(--bg);
    color: #fff;
}
.topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.brand { font-weight: 700; font-size: 1.1rem; }
.topbar nav a {
    color: #cbd5e1;
    text-decoration: none;
    margin-left: 16px;
    font-size: 0.95rem;
}
.topbar nav a:hover { color: #fff; }
.nav-user { color: #94a3b8; margin-left: 16px; font-size: 0.9rem; }

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

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

h1, h2 { margin-top: 0; }

.hint { color: var(--muted); font-size: 0.92rem; }

form label {
    display: block;
    margin: 14px 0 6px;
    font-weight: 600;
    font-size: 0.9rem;
}
form input[type="text"],
form input[type="password"] {
    width: 100%;
    max-width: 420px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
}
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-weight: 400;
    font-size: 0.92rem;
    max-width: 600px;
}
.checkbox-label input { margin-top: 3px; }

button, .button {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    margin-top: 16px;
}
button:hover, .button:hover { background: var(--primary-dark); }
button:disabled { background: #94a3b8; cursor: not-allowed; }

.link-button {
    background: none;
    border: none;
    color: var(--danger);
    padding: 0;
    margin: 0;
    text-decoration: underline;
    font-size: 0.9rem;
    cursor: pointer;
}
.inline-form { display: inline; }

.alert {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.92rem;
}
.alert-error { background: var(--danger-bg); color: var(--danger); }
.alert-success { background: var(--success-bg); color: var(--success); }

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.data-table th, .data-table td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.data-table th { color: var(--muted); font-weight: 600; }
.actions a { color: var(--primary); text-decoration: none; }

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    margin-right: 4px;
    white-space: nowrap;
}
.badge-critique { background: #c00000; }
.badge-eleve { background: #ed7d31; }
.badge-moyen { background: #b8860b; }
.badge-faible { background: #4472c4; }
.badge-info { background: #6b7280; }

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
}
.auth-card {
    background: #fff;
    padding: 32px;
    border-radius: 10px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}
.auth-logo {
    text-align: center;
    margin: 0 0 16px;
}
.auth-logo img {
    max-height: 70px;
    max-width: 100%;
}
