/* Variables globales de theme (couleurs, rayons, ombres). */
:root {
    --bg-top: #f8f4ea;
    --bg-bottom: #d9e7e3;
    --ink: #18242a;
    --muted: #4d626b;
    --card: rgba(255, 255, 255, 0.9);
    --line: #c4d8d1;
    --accent: #0f766e;
    --accent-soft: #e7f6f3;
    --danger: #9f1239;
    --success: #166534;
    --radius: 18px;
    --shadow: 0 18px 42px rgba(24, 36, 42, 0.12);
}

* {
    box-sizing: border-box;
}

/* Fond global et typographie de base. */
body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Manrope', sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 15% 20%, #fff6d8 0%, transparent 40%),
        radial-gradient(circle at 80% 10%, #d6f5ec 0%, transparent 34%),
        linear-gradient(160deg, var(--bg-top), var(--bg-bottom));
}

/* Barre de navigation horizontale sticky. */
.site-menu {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 12px 16px;
    backdrop-filter: blur(10px);
    background: rgba(248, 244, 234, 0.8);
    border-bottom: 1px solid #cfe0da;
}

/* Conteneur principal du menu. */
.menu-inner {
    width: min(1100px, 100%);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Marque du site dans le menu. */
.menu-brand {
    font-family: 'Merriweather', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ink);
    text-decoration: none;
}

/* Groupe des boutons de navigation. */
.menu-links {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* Style commun des boutons/lien du menu. */
.menu-btn {
    border: 1px solid #bed3cc;
    border-radius: 999px;
    padding: 8px 14px;
    text-decoration: none;
    color: #1d3a40;
    background: #ffffff;
    font-size: 0.9rem;
    font-weight: 700;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.menu-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.menu-btn.is-active {
    color: #ffffff;
    border-color: #0f766e;
    background: linear-gradient(130deg, #115e59, #0f766e);
}

.menu-btn.btn-nav-dashboard {
    border-color: #8aa5ae;
    color: #234148;
    background: #f7fbfc;
}

.menu-btn.btn-nav-dashboard:hover {
    border-color: #5f7f8a;
    color: #1d3440;
    background: #edf5f8;
}

.menu-btn.btn-nav-report {
    border-color: #7aa7ff;
    color: #0b3f8a;
    background: #eaf2ff;
}

.menu-btn.btn-nav-report:hover {
    border-color: #4b84f5;
    color: #082f67;
    background: #dbeafe;
}

.menu-btn.btn-nav-plan {
    border-color: #f0b253;
    color: #8a5a0a;
    background: #fff3dc;
}

.menu-btn.btn-nav-plan:hover {
    border-color: #d9962f;
    color: #754800;
    background: #ffe9c2;
}

.menu-btn.btn-nav-affinities {
    border-color: #c084fc;
    color: #6b21a8;
    background: #f6ecff;
}

.menu-btn.btn-nav-affinities:hover {
    border-color: #a855f7;
    color: #581c87;
    background: #f0ddff;
}

.menu-btn.btn-cancel {
    border-color: #d1d9de;
    color: #4a6572;
    background: #f8fafb;
}

.menu-btn.btn-cancel:hover {
    border-color: #a9b9c1;
    color: #344b56;
    background: #eef3f6;
}

/* Grille principale des pages (auth et ecrans applicatifs). */
.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 20px;
}

/* Carte de contenu principale. */
.auth-card {
    width: min(100%, 960px);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(6px);
}

/* Bloc visuel de titre (colonne gauche). */
.brand-block {
    position: relative;
    border-radius: 14px;
    background: linear-gradient(160deg, #fef7e2, #d4efe8);
    border: 1px solid #cbe4dd;
    padding: 24px;
    overflow: hidden;
}

.brand-block::after {
    content: '';
    position: absolute;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    right: -70px;
    bottom: -90px;
    background: rgba(15, 118, 110, 0.12);
}

/* Badge du produit. */
.badge {
    display: inline-block;
    margin: 0 0 12px;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 999px;
    padding: 6px 10px;
}

.brand-block h1 {
    margin: 0 0 10px;
    font-family: 'Merriweather', serif;
    font-size: clamp(1.8rem, 2.6vw, 2.4rem);
    line-height: 1.2;
}

.brand-block p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

/* Formulaires standards. */
.auth-form {
    display: grid;
    gap: 10px;
    align-content: start;
}

.auth-form label {
    margin-top: 5px;
    font-size: 0.93rem;
    font-weight: 600;
}

.auth-form input {
    width: 100%;
    border: 1px solid #bed3cc;
    border-radius: 10px;
    padding: 12px;
    font-size: 0.96rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-form textarea {
    width: 100%;
    border: 1px solid #bed3cc;
    border-radius: 10px;
    padding: 12px;
    font-size: 0.96rem;
    font-family: 'Manrope', sans-serif;
    outline: none;
    resize: vertical;
    min-height: 120px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Champs select partages avec le menu/app. */
.auth-form select,
.menu-select {
    border: 1px solid #bed3cc;
    border-radius: 10px;
    padding: 12px;
    font-size: 0.96rem;
    background: #ffffff;
    color: var(--ink);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Focus accessible des champs de formulaire. */
.auth-form input:focus,
.auth-form textarea:focus,
.auth-form select:focus,
.menu-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.15);
}

/* Bouton principal des formulaires. */
button {
    margin-top: 12px;
    border: 0;
    border-radius: 12px;
    padding: 12px;
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(130deg, #115e59, #0f766e);
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.15s ease;
}

/* Variantes de boutons pour actions ligne par ligne. */
.btn-small {
    display: inline-block;
    margin-top: 0;
    padding: 8px 10px;
    border: 0;
    border-radius: 9px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    line-height: 1.2;
    transition: transform 0.15s ease, filter 0.15s ease;
}

.btn-secondary {
    background: linear-gradient(130deg, #4a6572, #3f5965);
}

.btn-danger {
    background: linear-gradient(130deg, #b42349, #9f1239);
}

.btn-edit {
    background: linear-gradient(130deg, #4a6572, #3f5965);
}

.btn-notes {
    background: linear-gradient(130deg, #0f766e, #0b5f59);
}

.btn-profile {
    background: linear-gradient(130deg, #0b7285, #0a5f6f);
}

.btn-voice {
    background: linear-gradient(130deg, #6d28d9, #5b21b6);
}

.btn-voice.is-listening {
    background: linear-gradient(130deg, #b42349, #9f1239);
}

.btn-voice.is-disabled,
.btn-voice:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    filter: none;
}

.student-profile-link {
    color: #0b5f59;
    text-decoration: none;
    font-weight: 700;
}

.student-profile-link:hover {
    text-decoration: underline;
}

button:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
}

.btn-small:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
}

.switch-link {
    margin: 12px 0 0;
    font-size: 0.93rem;
    color: var(--muted);
}

.switch-link a,
.logout-link {
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
}

.switch-link a:hover,
.logout-link:hover {
    text-decoration: underline;
}

/* Messages de retour utilisateur (erreur/succes). */
.alert {
    border-radius: 10px;
    padding: 11px 12px;
    font-size: 0.9rem;
}

.alert ul {
    margin: 0;
    padding-left: 18px;
}

.alert-error {
    border: 1px solid #f3bccf;
    background: #fff1f6;
    color: var(--danger);
}

.alert-success {
    border: 1px solid #bce7c8;
    background: #effcf2;
    color: var(--success);
}

/* Encart profil du tableau de bord. */
.profile-box {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px;
    background: #f9fcfb;
}

.profile-box p {
    margin: 0 0 10px;
    color: var(--muted);
}

.evaluation-insights {
    display: grid;
    gap: 18px;
    margin-top: 20px;
}

.section-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.section-head .field-help {
    margin-bottom: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
}

.stat-card {
    border: 1px solid #d8e7e2;
    border-radius: 16px;
    padding: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f4fbf8 100%);
    box-shadow: 0 10px 30px rgba(15, 118, 110, 0.05);
}

.stat-card-label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-card-value {
    display: block;
    color: #21424a;
    font-family: 'Merriweather', serif;
    font-size: 1.7rem;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 18px;
}

.chart-card {
    border: 1px solid #d8e7e2;
    border-radius: 18px;
    padding: 18px;
    background: #ffffff;
    box-shadow: 0 14px 36px rgba(36, 65, 72, 0.06);
}

.chart-card-head {
    margin-bottom: 12px;
}

.chart-card-head h3 {
    margin: 0 0 4px;
    color: #1d3a40;
    font-size: 1.02rem;
}

.chart-card canvas {
    width: 100% !important;
    height: 260px !important;
}

.dashboard-layout .auth-card {
    grid-template-columns: 1.2fr 0.8fr;
}

/* Ajustements de mise en page pour pages metier. */
.app-page {
    padding-top: 20px;
}

.app-card-single {
    grid-template-columns: 1fr;
}

.section-title {
    margin: 12px 0 4px;
    font-family: 'Merriweather', serif;
    font-size: 1.2rem;
}

/* Fonctionnalite repliable pour les formulaires secondaires. */
.feature-panel {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #ffffff;
    overflow: hidden;
}

.feature-summary {
    cursor: pointer;
    list-style: none;
    padding: 12px 14px;
    font-weight: 700;
    color: #1d3a40;
    background: #f3faf8;
}

.feature-summary::-webkit-details-marker {
    display: none;
}

.feature-summary::before {
    content: '+';
    display: inline-block;
    margin-right: 8px;
    font-weight: 700;
}

.feature-panel[open] .feature-summary::before {
    content: '-';
}

.feature-body {
    padding: 12px 14px 14px;
}

.field-help {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 0.92rem;
}

.exercise-builder {
    display: grid;
    gap: 12px;
}

.exercise-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
}

.exercise-card {
    border: 1px solid #d8e7e2;
    border-radius: 12px;
    padding: 10px;
    background: #f9fcfb;
}

.exercise-card label {
    margin-top: 0;
}

.empty-state {
    margin: 8px 0;
    color: var(--muted);
}

/* Tableau de listing (classes et eleves). */
.table-wrap {
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow-x: auto;
    background: #ffffff;
}

@media (max-width: 720px) {
    .chart-grid {
        grid-template-columns: 1fr;
    }

    .chart-card {
        padding: 14px;
    }

    .stat-card-value {
        font-size: 1.45rem;
    }
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid #e4efeb;
    font-size: 0.93rem;
}

th {
    background: #f3faf8;
    color: #234148;
}

tbody tr:hover {
    background: #f8fcfb;
}

/* Groupe des actions modifier/supprimer dans un tableau. */
.row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.row-actions form {
    margin: 0;
}

/* Grille de bulles pour les classes au tableau de bord. */
.classes-bubbles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 18px;
    margin: 24px 0;
}

.class-bubble {
    --bubble-color: #0f766e;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    text-decoration: none;
    color: var(--ink);
    background: linear-gradient(135deg, color-mix(in srgb, var(--bubble-color) 15%, white) 0%, color-mix(in srgb, var(--bubble-color) 10%, white) 100%);
    border: 2px solid var(--bubble-color);
    border-radius: 50%;
    aspect-ratio: 1 / 1;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(15, 118, 110, 0.08);
    cursor: pointer;
    min-height: 160px;
}

.class-bubble:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 28px rgba(15, 118, 110, 0.16);
    background: linear-gradient(135deg, color-mix(in srgb, var(--bubble-color) 25%, white) 0%, color-mix(in srgb, var(--bubble-color) 15%, white) 100%);
    border-color: var(--bubble-color);
}

.bubble-name {
    font-weight: 700;
    font-size: 1.1rem;
    text-align: center;
    word-break: break-word;
    line-height: 1.3;
}

.bubble-level {
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Wrapper pour bubble + settings button */
.bubble-wrapper {
    position: relative;
}

/* Bouton paramètres discret */
.bubble-settings {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    padding: 0;
    text-decoration: none;
}

.bubble-settings::before {
    content: '⚙';
    color: var(--muted);
    font-size: 14px;
}

.bubble-wrapper:hover .bubble-settings {
    opacity: 1;
}

.bubble-settings:hover {
    background: rgba(255, 255, 255, 1);
    transform: rotate(20deg);
}

/* Styles pour la palette de couleurs dans le formulaire */
.color-picker {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#class_color {
    width: 100%;
    height: 44px;
    border: 2px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
}

.color-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.color-swatch {
    width: 40px;
    height: 40px;
    border: 2px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    margin: 0;
    display: inline-block;
    vertical-align: top;
    appearance: none;
    -webkit-appearance: none;
    background-clip: border-box;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.color-swatch:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.color-swatch:active {
    border-color: var(--ink);
}

/* Badge de couleur dans le tableau */
.class-color-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--line);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Bouton absence (gris par defaut, rouge si absent). */
.abs-toggle-btn {
    background: #9ca3af;
    color: #ffffff;
}

.abs-toggle-btn.is-absent {
    background: #dc2626;
    color: #ffffff;
}

/* Mise en forme specifique du bilan de classe. */
.report-controls {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 12px;
}

.report-general-card {
    border: 1px solid #f2c46c;
    background: linear-gradient(140deg, #fff8dc, #ffefbf);
    border-radius: 12px;
    padding: 10px 14px;
    text-align: right;
}

.report-general-label {
    margin: 0;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #7a5a1f;
    font-weight: 700;
}

.report-general-value {
    margin: 2px 0 0;
    font-size: 1.4rem;
    font-weight: 800;
    color: #7a4e00;
}

.report-table-wrap {
    border-color: #bfd6cf;
    overflow-x: hidden;
}

.report-card-wide {
    width: min(100%, 1500px);
    max-width: 1500px;
}

.report-table {
    width: 100%;
    table-layout: fixed;
}

.report-table th,
.report-table td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 8px 6px;
    font-size: 0.84rem;
}

.report-col-student {
    width: 17%;
}

.report-col-average {
    width: 9%;
}

.report-col-eval {
    width: auto;
}

.report-col-eval-label {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-chip {
    display: inline-block;
    border-radius: 999px;
    padding: 3px 7px;
    font-weight: 700;
    font-size: 0.76rem;
    line-height: 1.1;
}

.report-chip-score {
    border: 1px solid transparent;
}

.report-chip-score.is-low {
    color: #ffffff;
    background: #dc2626;
    border-color: #b91c1c;
}

.report-chip-score.is-neutral {
    color: #0b5f3a;
    background: #e8f7ee;
    border-color: #c6ecd5;
}

.report-chip-score.is-high {
    color: #0b3f8a;
    background: #dbeafe;
    border-color: #93c5fd;
}

.report-chip-empty {
    color: #6b7280;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
}

.report-chip-abs {
    color: #ffffff;
    background: #b91c1c;
    border: 1px solid #991b1b;
}

.report-chip-student-avg {
    border: 1px solid transparent;
}

.report-chip-student-avg.is-low {
    color: #ffffff;
    background: linear-gradient(130deg, #b42349, #9f1239);
    border-color: #8a1134;
}

.report-chip-student-avg.is-neutral {
    color: #ffffff;
    background: linear-gradient(130deg, #115e59, #0f766e);
    border-color: #0e5f58;
}

.report-chip-student-avg.is-high {
    color: #0b3f8a;
    background: linear-gradient(130deg, #e0ecff, #dbeafe);
    border-color: #93c5fd;
}

.report-chip-class-avg {
    border: 1px solid transparent;
}

.report-chip-class-avg.is-low {
    color: #ffffff;
    background: #dc2626;
    border-color: #b91c1c;
}

.report-chip-class-avg.is-neutral {
    color: #0c4a6e;
    background: #e0f2fe;
    border-color: #bae6fd;
}

.report-chip-class-avg.is-high {
    color: #0b3f8a;
    background: #dbeafe;
    border-color: #93c5fd;
}

.report-chip-general-avg {
    color: #7a4e00;
    background: #ffe8a3;
    border: 1px solid #f4c65a;
    font-size: 0.9rem;
}

.report-foot th {
    background: #f8fbfa;
}

.report-general-cell {
    background: #fff4cf;
}

@media (max-width: 1200px) {
    .report-card-wide {
        width: 100%;
        max-width: none;
    }

    .report-table th,
    .report-table td {
        font-size: 0.78rem;
        padding: 7px 5px;
    }

    .report-chip {
        font-size: 0.72rem;
        padding: 2px 6px;
    }
}

/* Editeur de plan de classe. */
.class-plan-grid {
    --plan-cols: 6;
    --plan-rows: 6;
    display: grid;
    grid-template-columns: repeat(var(--plan-cols), minmax(90px, 1fr));
    gap: 8px;
}

.plan-cell {
    margin-top: 0;
    min-height: 64px;
    border: 1px solid #cdded8;
    border-radius: 10px;
    padding: 6px;
    background: #ffffff;
    color: var(--ink);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    overflow-wrap: anywhere;
}

.plan-cell.is-empty {
    background: #f8fcfb;
    color: #5f7a72;
}

.plan-cell.is-desk {
    background: #eef4ff;
    border-color: #9ebcff;
    color: #214483;
}

.plan-cell.is-student {
    background: #e5f8f2;
    border-color: #89d9be;
    color: #105b45;
}

.plan-cell.is-teacher {
    background: #ffe9c7;
    border-color: #f2bf68;
    color: #7b4f00;
}

[data-plan-mode].is-active {
    outline: 2px solid #0f766e;
}

.class-plan-grid.class-plan-grid-view {
    width: 100%;
    height: 100%;
    min-height: 0;
    grid-template-columns: repeat(var(--plan-cols), minmax(0, 1fr));
    grid-template-rows: repeat(var(--plan-rows), minmax(0, 1fr));
}

.plan-view-mode {
    overflow: hidden;
}

.plan-view-mode .auth-page {
    height: 100dvh;
    min-height: 100dvh;
    padding: 6px;
}

.plan-view-mode .auth-card {
    width: 100%;
    height: 100%;
    max-width: none;
    padding: 8px;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
}

.plan-view-mode .brand-block {
    padding: 10px 12px;
}

.plan-view-mode .brand-block h1 {
    font-size: 1.2rem;
    margin-bottom: 2px;
}

.plan-view-mode .brand-block p {
    line-height: 1.2;
    font-size: 0.88rem;
}

.plan-view-mode .auth-form {
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.plan-view-mode .row-actions {
    gap: 6px;
}

.plan-view-mode .plan-cell.is-empty {
    color: transparent;
}

.plan-view-mode .plan-cell {
    min-height: 0;
    height: 100%;
    padding: 4px;
    font-size: clamp(0.52rem, 1.1vw, 1rem);
    line-height: 1.15;
    border-radius: 8px;
}

.class-plan-submit-bar {
    justify-content: flex-start;
    flex-wrap: wrap;
}

.btn-auto-plan {
    background: linear-gradient(130deg, #1d4ed8, #1e40af);
}

.btn-ai-generate {
    background: linear-gradient(130deg, #0b7285, #0a5f6f);
}

.profile-entries-list {
    display: grid;
    gap: 10px;
}

.admin-search-box {
    display: grid;
    gap: 8px;
    margin: 0 0 18px;
}

.admin-search-box label {
    font-weight: 700;
    color: #1f4b54;
}

.admin-search-input {
    width: 100%;
    border: 1px solid #b7ddd3;
    border-radius: 12px;
    padding: 12px 14px;
    background: #ffffff;
    color: var(--ink);
    font: inherit;
}

.admin-search-input:focus {
    outline: none;
    border-color: #0f766e;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.admin-search-help {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.admin-search-empty {
    margin-top: 10px;
}

.profile-entry-card {
    border: 1px solid #cde3dc;
    border-radius: 12px;
    padding: 12px;
    background: #f8fcfb;
}

.profile-entry-date {
    margin: 0 0 8px;
    color: #1f4b54;
    font-weight: 700;
}

.profile-entry-type {
    display: inline-block;
    margin: 0 0 10px;
    padding: 4px 9px;
    border-radius: 999px;
    background: #e1f3ef;
    border: 1px solid #b7ddd3;
    color: #0f5c51;
    font-size: 0.84rem;
    font-weight: 700;
}

.profile-entry-text {
    margin: 0;
    color: var(--ink);
    line-height: 1.5;
}

.profile-entry-actions {
    margin-top: 12px;
}

.voice-input-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.voice-input-status {
    font-size: 0.9rem;
    color: var(--muted);
}

.affinity-table-wrap {
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow-x: auto;
    background: #ffffff;
}

.affinity-table select {
    min-width: 190px;
    width: 100%;
}

.affinity-toolbar {
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

/* Adaptation mobile. */
@media (max-width: 820px) {
    .menu-links {
        width: 100%;
    }

    .menu-btn {
        flex: 1 1 auto;
        text-align: center;
    }

    .auth-card,
    .dashboard-layout .auth-card {
        grid-template-columns: 1fr;
    }

    .auth-card {
        padding: 18px;
    }

    .report-controls {
        grid-template-columns: 1fr;
    }

    .report-general-card {
        text-align: left;
    }

    .class-plan-grid {
        grid-template-columns: repeat(var(--plan-cols), minmax(72px, 1fr));
    }
}

/* Page communication et editeur riche admin. */
.communication-form {
    display: grid;
    gap: 10px;
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    border: 1px solid #cde3dc;
    border-radius: 10px;
    background: #f8fcfb;
}

.editor-toolbar button {
    margin: 0;
    min-width: 40px;
    padding: 8px 10px;
    border-radius: 9px;
    border: 1px solid #b7ddd3;
    background: #ffffff;
    color: #1d3a40;
    font-weight: 700;
    cursor: pointer;
}

.toolbar-select-wrap,
.toolbar-color-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border: 1px solid #cde3dc;
    border-radius: 9px;
    background: #ffffff;
    font-size: 0.84rem;
    color: #34535c;
}

.toolbar-select-wrap select {
    border: 1px solid #b7ddd3;
    border-radius: 7px;
    padding: 4px 6px;
    background: #ffffff;
    color: #1d3a40;
}

.toolbar-color-wrap input[type='color'] {
    width: 24px;
    height: 24px;
    border: none;
    padding: 0;
    background: transparent;
}

.rich-editor {
    min-height: 220px;
    border: 1px solid #bed3cc;
    border-radius: 10px;
    background: #ffffff;
    padding: 14px;
    line-height: 1.6;
    outline: none;
}

.rich-editor:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.15);
}

.rich-editor:empty::before {
    content: attr(data-placeholder);
    color: #7b9199;
}

.switch-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    color: #34535c;
}

.switch-inline input[type='checkbox'] {
    width: 18px;
    height: 18px;
    margin: 0;
}

.communication-posts-list {
    display: grid;
    gap: 12px;
}

.communication-post-card {
    border: 1px solid #cde3dc;
    border-radius: 12px;
    padding: 14px;
    background: #f8fcfb;
}

.communication-post-header h3 {
    margin: 0;
    font-family: 'Merriweather', serif;
    font-size: 1.14rem;
}

.communication-post-header p {
    margin: 8px 0 0;
    color: #50717a;
    font-size: 0.86rem;
}

.post-status-draft {
    display: inline-block;
    margin: 10px 0 0;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid #f1cc84;
    background: #fff5dc;
    color: #7b5a1d;
    font-size: 0.82rem;
    font-weight: 700;
}

.communication-post-content {
    margin-top: 12px;
    color: #1f2f35;
    line-height: 1.7;
}

.communication-post-content h1,
.communication-post-content h2,
.communication-post-content h3 {
    margin: 0 0 10px;
}

.communication-post-content p {
    margin: 0 0 10px;
}
