/* ===== Tokens DSFR (Systeme de Design de l'Etat) ===== */
/* Police Marianne : deposez les fichiers .woff2 a cote du HTML pour le rendu officiel.
   A defaut, fallback Arial conforme aux recommandations DSFR. */
@font-face {
    font-family: 'Marianne';
    src: url('../../fonts/Marianne-Regular.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'Marianne';
    src: url('../../fonts/Marianne-Medium.woff2') format('woff2');
    font-weight: 500;
    font-display: swap;
}
@font-face {
    font-family: 'Marianne';
    src: url('../../fonts/Marianne-Bold.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
}

:root {
    --blue-france: #000091;
    --blue-france-hover: #1212ff;
    --blue-france-active: #2323ff;
    --blue-france-925: #e3e3fd;   /* fond clair bleute */
    --blue-france-950: #ececfe;
    --red-marianne: #e1000f;
    --green-success: #18753c;
    --green-success-950: #b8fec9;
    --grey-text: #161616;          /* texte principal */
    --grey-text-mention: #666666;  /* texte attenue */
    --grey-border: #dddddd;
    --grey-border-strong: #929292;
    --grey-bg: #f6f6f6;            /* fond de page */
    --grey-bg-alt: #eeeeee;
    --grey-contrast: #e5e5e5;
    --warning: #b34000;
    --warning-bg: #ffe9e6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Marianne', Arial, sans-serif;
    background: var(--grey-bg);
    line-height: 1.5;
    color: var(--grey-text);
}

.header {
    background: #ffffff;
    color: var(--grey-text);
    padding: 16px 24px;
    border-bottom: 1px solid var(--grey-border);
    box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Bloc-marque : Marianne tricolore + intitule (style DSFR / Academie) */
.brand-marque {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
    padding-right: 20px;
    border-right: 1px solid var(--grey-border);
}

.brand-flag {
    width: 48px;
    height: 32px;
    display: flex;
    border: 1px solid var(--grey-border);
}
.brand-flag span { flex: 1; }
.brand-flag .bleu   { background: #000091; }
.brand-flag .blanc  { background: #ffffff; }
.brand-flag .rouge  { background: #e1000f; }

.brand-label {
    font-weight: 700;
    line-height: 1.1;
    font-size: 0.82rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--grey-text);
}
.brand-label .devise {
    display: block;
    font-style: italic;
    font-weight: 400;
    font-size: 0.62rem;
    text-transform: none;
    letter-spacing: 0;
    color: var(--grey-text-mention);
    margin-top: 3px;
}

.header-title h1 {
    font-size: 1.5rem;
    color: var(--blue-france);
    margin: 0;
}
.header-title p {
    font-size: 0.9rem;
    color: var(--grey-text-mention);
    margin: 4px 0 0 0;
}

.header h1 {
    font-size: 1.5rem;
}

.header p {
    font-size: 0.9rem;
}

.navigation {
    background: white;
    border-bottom: 2px solid var(--grey-contrast);
    padding: 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.nav-tabs {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-tab {
    flex: 1;
    padding: 15px 20px;
    background: var(--grey-bg);
    border: none;
    border-right: 1px solid var(--grey-border);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--grey-text-mention);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.nav-tab:last-child {
    border-right: none;
}

.nav-tab:hover {
    background: var(--grey-contrast);
    color: var(--grey-text);
}

.nav-tab.active {
    background: white;
    color: var(--blue-france);
    border-bottom: 3px solid var(--blue-france);
    box-shadow: 0 -2px 5px rgba(0, 0, 145, 0.12);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    min-height: 80vh;
}

.tab-content {
    display: none;
    padding: 25px;
}

.tab-content.active {
    display: block;
}
.chart-card {
    grid-column: span 2;
    min-height: 120px;
}

.mini-chart {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 70px;
    gap: 5px;
    padding: 10px 0;
}

.chart-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.chart-bar-fill {
    width: 20px;
    background: var(--blue-france);
    border-radius: 2px 2px 0 0;
    min-height: 5px;
    transition: height 0.3s ease;
}

.chart-label {
    font-size: 0.75rem;
    color: var(--grey-text-mention);
    font-weight: 600;
}

.chart-value {
    font-size: 0.7rem;
    color: var(--grey-text);
    font-weight: 500;
}

@media (max-width: 768px) {
    .chart-card {
grid-column: span 1;
    }
}
/* === STYLES ACCUEIL === */
.accueil-container {
    padding: 25px;
    max-width: 1200px;
    margin: 0 auto;
}

.welcome-section {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: var(--blue-france);
    color: white;
    border-radius: 4px;
}

.welcome-section h2 {
    margin: 0 0 10px 0;
    font-size: 2rem;
}

.welcome-section p {
    margin: 0;
    font-size: 1.1rem;
    opacity: 0.9;
}

.stats-section {
    margin-bottom: 40px;
}

.stats-section h3 {
    color: var(--grey-text);
    margin-bottom: 20px;
    font-size: 1.3rem;
    text-align: center;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card-accueil {
    background: white;
    padding: 20px;
    border-radius: 4px;
    border: 1px solid var(--grey-contrast);
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.2s ease;
}

.stat-card-accueil:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.stat-number-accueil {
    font-size: 2.2rem;
    font-weight: bold;
    color: var(--blue-france);
    display: block;
    margin-bottom: 5px;
}

.stat-label-accueil {
    font-size: 0.9rem;
    color: var(--grey-text-mention);
    font-weight: 500;
}

.stat-detail {
    font-size: 0.8rem;
    color: #95a5a6;
    margin-top: 5px;
}

.instructions-section {
    margin-bottom: 40px;
}

.instructions-section h3 {
    color: var(--grey-text);
    margin-bottom: 25px;
    font-size: 1.3rem;
    text-align: center;
}

.instructions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.instruction-card {
    background: white;
    border: 1px solid var(--grey-contrast);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.instruction-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.instruction-card.important {
    border: 2px solid var(--green-success);
    background: #f8fff9;
}

.instruction-header {
    background: var(--grey-bg);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--grey-contrast);
}

.instruction-card.important .instruction-header {
    background: #d4edda;
}

.instruction-icon {
    font-size: 1.5rem;
}

.instruction-header h4 {
    margin: 0;
    color: var(--grey-text);
    font-size: 1.1rem;
}

.instruction-content {
    padding: 20px;
}

.instruction-content p {
    margin: 0 0 15px 0;
    color: var(--grey-text);
    line-height: 1.5;
}

.instruction-content ul {
    margin: 0 0 20px 0;
    padding-left: 20px;
}

.instruction-content li {
    margin-bottom: 8px;
    color: var(--grey-text-mention);
    line-height: 1.4;
}

.instruction-btn {
    width: 100%;
    margin-top: 10px;
}

.save-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.save-buttons .btn {
    flex: 1;
    min-width: 140px;
}

.quick-start-section {
    text-align: center;
}

.quick-start-section h3 {
    color: var(--grey-text);
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.quick-actions-grid {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-large {
    padding: 15px 25px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--blue-france);
    color: white;
    min-width: 180px;
}

.btn-large.secondary {
    background: var(--grey-text-mention);
}

.btn-large.success {
    background: var(--green-success);
}

.btn-large:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

@media (max-width: 768px) {
    .instructions-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-cards {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
    
    .quick-actions-grid {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-large {
        width: 100%;
        max-width: 250px;
    }
    
    .save-buttons {
        flex-direction: column;
    }
}
/* === VUE CLASSE COLLECTIVE === */
.classe-controls {
    background: var(--grey-bg);
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 25px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    align-items: end;
}

.control-group {
    display: flex;
    flex-direction: column;
}

.control-group label {
    font-weight: 600;
    color: var(--grey-text);
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.control-group select, .control-group input {
    padding: 10px;
    border: 1px solid var(--grey-border);
    border-radius: 4px;
    font-size: 0.95rem;
    background: white;
}

.control-group select:focus, .control-group input:focus {
    outline: none;
    border-color: var(--blue-france);
    box-shadow: 0 0 0 2px rgba(0, 0, 145, 0.12);
}

.btn {
    background: var(--blue-france);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease;
    font-size: 0.9rem;
}

.btn:hover {
    background: var(--blue-france-hover);
}

.btn:active {
    background: var(--blue-france-active);
}

.btn:focus-visible {
    outline: 2px solid var(--blue-france);
    outline-offset: 2px;
}

.btn.secondary {
    background: #ffffff;
    color: var(--blue-france);
    box-shadow: inset 0 0 0 1px var(--blue-france);
}
.btn.secondary:hover {
    background: var(--blue-france-950);
}

.btn.success {
    background: var(--green-success);
}
.btn.success:hover {
    background: #27a658;
}

.evaluation-table {
    background: white;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid var(--grey-contrast);
}

.table-header {
    background: var(--blue-france);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-header h3 {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-stats {
    font-size: 0.9rem;
    opacity: 0.9;
}

.table-container {
    overflow-x: auto;
    max-height: 70vh;
    border: 1px solid var(--grey-contrast);
}

.competences-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.competences-table th {
    background: var(--grey-bg);
    padding: 12px 8px;
    text-align: center;
    border: 1px solid var(--grey-border);
    font-weight: 600;
    color: var(--grey-text);
    position: sticky;
    top: 0;
    z-index: 10;
}

.competences-table th.competence-header {
    background: #fff;
    text-align: left;
    padding: 12px 15px;
    min-width: 300px;
    max-width: 400px;
    position: sticky;
    left: 0;
    z-index: 11;
    border-right: 2px solid var(--blue-france);
}

.competences-table td {
    padding: 10px 8px;
    text-align: center;
    border: 1px solid var(--grey-border);
    background: white;
}

.competences-table td.competence-cell {
    text-align: left;
    padding: 12px 15px;
    background: #fff;
    position: sticky;
    left: 0;
    border-right: 2px solid var(--blue-france);
    font-weight: 500;
    color: var(--grey-text);
}

.competences-table tr:nth-child(even) td:not(.competence-cell) {
    background: var(--grey-bg);
}

.competences-table tr:hover td:not(.competence-cell) {
    background: #e3f2fd;
}
/* Styles pour la ligne de compétence sélectionnée */
tr.selected-row {
    background: var(--blue-france-950) !important;
    border-left: 4px solid var(--blue-france) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 145, 0.12);
}

tr.selected-row td {
    background-color: transparent !important;
    font-weight: 600;
    color: var(--grey-text);
}

/* Animation au survol de la ligne sélectionnée */
tr.selected-row:hover {
    background: var(--blue-france-925) !important;
}

/* Indicateur visuel sur la première cellule */
tr.selected-row td:first-child {
    position: relative;
}

tr.selected-row td:first-child::before {
    content: '▶';
    position: absolute;
    left: 5px;
    color: var(--blue-france);
    font-size: 0.8em;
}
.student-checkbox {
    width: 20px;
    height: 20px;
    accent-color: var(--green-success);
    cursor: pointer;
}

.student-name {
    font-weight: 600;
    color: var(--blue-france);
    font-size: 0.85rem;
    margin-bottom: 2px;
}

.student-progress {
    font-size: 0.75rem;
    color: var(--grey-text-mention);
}

.eleves-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: var(--grey-text-mention);
}

.eleves-placeholder h3 {
    margin-bottom: 15px;
    color: var(--grey-text);
}

.quick-actions {
    background: var(--grey-bg);
    padding: 15px 20px;
    border-top: 1px solid var(--grey-contrast);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.quick-actions-left {
    display: flex;
    gap: 10px;
    align-items: center;
}

.quick-actions-right {
    display: flex;
    gap: 10px;
}

.periode-badge {
    background: var(--green-success);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

@media (max-width: 768px) {
    .classe-controls {
        grid-template-columns: 1fr;
    }
    
    .nav-tabs {
        flex-wrap: wrap;
    }
    
    .nav-tab {
        flex: 1 1 50%;
        font-size: 0.85rem;
        padding: 12px 15px;
    }

    .quick-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .quick-actions-left, .quick-actions-right {
        justify-content: center;
    }
}

/* === STYLES CONFIGURATION === */
.config-section {
    background: white;
    border-radius: 4px;
    border: 1px solid var(--grey-contrast);
    margin-bottom: 25px;
    overflow: hidden;
}

.config-title {
    background: var(--blue-france);
    color: white;
    padding: 15px 20px;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
}

.config-field {
    display: flex;
    flex-direction: column;
}

.config-field label {
    font-weight: 600;
    color: var(--grey-text);
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.config-field input {
    padding: 10px;
    border: 1px solid var(--grey-border);
    border-radius: 4px;
    font-size: 1rem;
    background: white;
}

.config-field input:focus {
    outline: none;
    border-color: var(--blue-france);
    box-shadow: 0 0 0 2px rgba(0, 0, 145, 0.12);
}

.config-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px;
}

.action-group {
    background: var(--grey-bg);
    padding: 20px;
    border-radius: 4px;
    border: 1px solid var(--grey-contrast);
}

.action-group h4 {
    color: var(--grey-text);
    margin-bottom: 8px;
    font-size: 1rem;
}

.action-description {
    color: var(--grey-text-mention);
    font-size: 0.9rem;
    margin-bottom: 15px;
    line-height: 1.4;
}

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.csv-format {
    margin-top: 10px;
    padding: 8px 12px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    color: #856404;
}

.eleves-management {
    padding: 20px;
}

.eleves-management h4 {
    color: var(--grey-text);
    margin-bottom: 15px;
}

.eleves-count {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--grey-bg);
    border-radius: 4px;
    border: 1px solid var(--grey-contrast);
}

.eleves-count span {
    font-weight: 600;
    color: var(--grey-text);
    font-size: 1.1rem;
}

.eleves-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.eleve-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: white;
    border: 1px solid var(--grey-contrast);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.eleve-item:hover {
    border-color: var(--blue-france);
    box-shadow: 0 2px 5px rgba(0, 0, 145, 0.12);
}

.eleve-info {
    font-weight: 500;
    color: var(--grey-text);
}

.eleve-actions {
    display: flex;
    gap: 5px;
}

.btn-small {
    padding: 4px 8px;
    font-size: 0.8rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

.btn-edit {
    background: #17a2b8;
    color: white;
}

.btn-delete {
    background: var(--red-marianne);
    color: white;
}

.btn-small:hover {
    opacity: 0.8;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    padding: 20px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 4px;
    border: 1px solid var(--grey-contrast);
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--blue-france);
    display: block;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--grey-text-mention);
    margin-top: 5px;
}

@media (max-width: 768px) {
    .config-actions {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        justify-content: center;
    }
    
    .eleves-count {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}
/* === STYLES VUE INDIVIDUELLE === */
.individual-header {
    background: var(--blue-france);
    color: white;
    padding: 20px;
    border-radius: 4px 8px 0 0;
    text-align: center;
    margin-bottom: 0;
}

.individual-header h2 {
    margin: 0;
    font-size: 1.4rem;
}

.individual-header p {
    margin: 5px 0 0 0;
    opacity: 0.9;
    font-size: 0.95rem;
}

.domains-container {
    background: white;
    border: 1px solid var(--grey-contrast);
    border-radius: 0 0 8px 8px;
    overflow: hidden;
}

.domain-section {
    border-bottom: 1px solid var(--grey-contrast);
}

.domain-section:last-child {
    border-bottom: none;
}

.domain-header {
    background: var(--grey-bg);
    padding: 15px 20px;
    border-bottom: 1px solid var(--grey-contrast);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.domain-header:hover {
    background: var(--grey-contrast);
}

.domain-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--grey-text);
    font-size: 1.1rem;
}

.domain-stats {
    display: flex;
    gap: 15px;
    align-items: center;
    font-size: 0.9rem;
    color: var(--grey-text-mention);
}

.progress-bar {
    width: 100px;
    height: 8px;
    background: var(--grey-contrast);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--green-success);
    transition: width 0.3s ease;
}

.domain-content {
    display: none;
    padding: 0;
}

.domain-content.expanded {
    display: block;
}

.competences-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

.competence-row {
    padding: 15px 20px;
    border-bottom: 1px solid var(--grey-bg-alt);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
}

.competence-row:last-child {
    border-bottom: none;
}

.competence-row:hover {
    background: var(--grey-bg);
}

.competence-row.acquired {
    background: #d4edda;
    border-left: 4px solid var(--green-success);
}

.competence-text {
    flex: 1;
    color: var(--grey-text);
    line-height: 1.4;
}

.competence-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 15px;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
}

.status-acquired {
    background: var(--green-success);
}

.status-not-acquired {
    background: var(--grey-text-mention);
}

.appreciation-section {
    margin-top: 25px;
    background: white;
    border: 1px solid var(--grey-contrast);
    border-radius: 4px;
    overflow: hidden;
}

.appreciation-header {
    background: var(--grey-bg);
    padding: 15px 20px;
    border-bottom: 1px solid var(--grey-contrast);
    font-weight: 600;
    color: var(--grey-text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.appreciation-content {
    padding: 20px;
}

.appreciation-textarea {
    width: 100%;
    min-height: 120px;
    padding: 15px;
    border: 1px solid var(--grey-border);
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    resize: vertical;
}

.appreciation-textarea:focus {
    outline: none;
    border-color: var(--blue-france);
    box-shadow: 0 0 0 2px rgba(0, 0, 145, 0.12);
}

.appreciation-actions {
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.appreciation-info {
    font-size: 0.85rem;
    color: var(--grey-text-mention);
}

.toggle-icon {
    transition: transform 0.2s ease;
}

.toggle-icon.rotated {
    transform: rotate(90deg);
}
/* === STYLES POUR SOUS-DOMAINES ET NIVEAUX === */

/* Colorisation par niveau */
.competence-ps {
    background-color: #FFE5F0 !important; /* Rose pastel PS */
    border-left: 4px solid #FF69B4;
}

.competence-ms {
    background-color: #E5F2FF !important; /* Bleu pastel MS */
    border-left: 4px solid #4A90E2;
}

.competence-gs {
    background-color: #E5FFEF !important; /* Vert pastel GS */
    border-left: 4px solid #50C878;
}

/* Badge niveau */
.niveau-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 8px;
    color: white;
}

.niveau-badge-ps {
    background: #FF69B4;
}

.niveau-badge-ms {
    background: #4A90E2;
}

.niveau-badge-gs {
    background: #50C878;
}

/* En-tête de sous-domaine */
.sous-domaine-header {
    background: var(--grey-bg-alt);
    padding: 10px 15px;
    font-weight: 600;
    color: var(--grey-text);
    border-left: 4px solid var(--blue-france);
    margin-top: 5px;
    font-size: 0.95rem;
    position: sticky;
    left: 0;
    z-index: 9;
}

.sous-domaine-header-cell {
    background: var(--grey-bg-alt) !important;
    font-weight: 600;
    color: var(--grey-text);
    border-left: 4px solid var(--blue-france) !important;
    text-align: left !important;
    padding: 10px 15px !important;
}
/* === STYLES POUR SOUS-DOMAINES CLIQUABLES === */
.sous-domaine-row {
    background: var(--grey-bg);
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 4px solid var(--blue-france);
}

.sous-domaine-row:hover {
    background: var(--grey-contrast);
}

.sous-domaine-row.expanded {
    background: #e7e9fc;
    border-left-color: var(--blue-france);
}

.sous-domaine-cell {
    font-weight: 600 !important;
    font-size: 1.05rem !important;
    color: var(--grey-text) !important;
    padding: 15px 20px !important;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sous-domaine-arrow {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    display: inline-block;
}

.sous-domaine-row.expanded .sous-domaine-arrow {
    transform: rotate(90deg);
}

.sous-domaine-count {
    font-size: 0.85rem;
    color: var(--grey-text-mention);
    font-weight: normal;
    background: white;
    padding: 3px 10px;
    border-radius: 4px;
    margin-left: auto;
}

.competence-row-hidden {
    display: none;
}

.competence-row-visible {
    display: table-row;
}
/* Filtres de niveau */
.niveau-filters {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.niveau-filter-btn {
    padding: 6px 12px;
    border: 2px solid var(--grey-border);
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.niveau-filter-btn:hover {
    transform: translateY(-1px);
}

.niveau-filter-btn.active-ps {
    background: #FFE5F0;
    border-color: #FF69B4;
    color: #C71585;
}

.niveau-filter-btn.active-ms {
    background: #E5F2FF;
    border-color: #4A90E2;
    color: #1E3A8A;
}

.niveau-filter-btn.active-gs {
    background: #E5FFEF;
    border-color: #50C878;
    color: #166534;
}

.niveau-filter-btn.active-all {
    background: var(--blue-france);
    border-color: var(--blue-france);
    color: white;
}

/* Styles pour l'export PDF */
.pdf-page {
    font-family: 'Marianne', Arial, sans-serif;
    max-width: 800px;
    margin: 0 auto;
    padding: 30px;
    background: white;
    color: #333;
    line-height: 1.4;
}

.pdf-header {
    text-align: center;
    border-bottom: 2px solid var(--blue-france);
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.pdf-title {
    font-size: 1.6rem;
    color: var(--blue-france);
    margin-bottom: 10px;
}

.pdf-subtitle {
    font-size: 1.1rem;
    color: var(--grey-text-mention);
    margin-bottom: 5px;
}

.pdf-info {
    font-size: 0.95rem;
    color: var(--grey-text-mention);
}

.pdf-domain {
    margin-bottom: 25px;
    break-inside: avoid;
}

.pdf-domain-title {
    background: var(--grey-bg);
    padding: 10px 15px;
    border-left: 4px solid var(--blue-france);
    font-weight: 600;
    color: var(--grey-text);
    margin-bottom: 10px;
}

.pdf-competence {
    padding: 8px 15px;
    margin-bottom: 3px;
    background: #d4edda;
    border-radius: 4px;
    position: relative;
}

.pdf-competence::before {
    content: "✅";
    margin-right: 8px;
}

.pdf-periode {
    float: right;
    background: var(--green-success);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.pdf-appreciation {
    margin-top: 30px;
    padding: 20px;
    border: 1px solid var(--grey-contrast);
    border-radius: 4px;
    background: var(--grey-bg);
}

.pdf-appreciation-title {
    font-weight: 600;
    color: var(--grey-text);
    margin-bottom: 10px;
}

.pdf-appreciation-text {
    color: #333;
    line-height: 1.6;
}

.pdf-footer {
    margin-top: 40px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--grey-text-mention);
    border-top: 1px solid var(--grey-contrast);
    padding-top: 15px;
}
.pdf-header-enhanced {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 3px solid var(--blue-france);
    padding: 20px;
    margin-bottom: 30px;
    background: var(--grey-bg);
}

.pdf-logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.pdf-logo {
    width: 120px !important;
    height: 120px !important;
    object-fit: contain;
}

.pdf-school-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.pdf-school-name {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--grey-text);
}

.pdf-teacher-name {
    font-size: 0.95rem;
    color: var(--grey-text-mention);
}

.pdf-year {
    font-size: 0.9rem;
    color: var(--grey-text-mention);
}

.pdf-title-section {
    text-align: center;
    flex: 1;
    margin: 0 20px;
}

.pdf-title-enhanced {
    font-size: 1.4rem;
    color: var(--blue-france);
    margin-bottom: 5px;
    font-weight: bold;
}

.pdf-subtitle-enhanced {
    font-size: 1rem;
    color: var(--grey-text-mention);
}

.pdf-footer-enhanced {
    margin-top: 50px;
    border-top: 2px solid var(--grey-contrast);
    padding-top: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    font-size: 0.9rem;
}

.pdf-comments-section {
    border: 1px solid var(--grey-border);
    border-radius: 4px;
    padding: 15px;
    min-height: 80px;
    background: var(--grey-bg);
}

.pdf-comments-title {
    font-weight: bold;
    color: var(--grey-text);
    margin-bottom: 8px;
}

.pdf-signature-section {
    border: 1px solid var(--grey-border);
    border-radius: 4px;
    padding: 15px;
    min-height: 80px;
    background: var(--grey-bg);
}

.pdf-signature-title {
    font-weight: bold;
    color: var(--grey-text);
    margin-bottom: 8px;
}

.pdf-signature-line {
    border-bottom: 1px solid var(--grey-text-mention);
    margin-top: 40px;
    padding-bottom: 2px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--grey-text-mention);
}

.pdf-export-info {
    text-align: center;
    font-size: 0.8rem;
    color: var(--grey-text-mention);
    margin-top: 20px;
    border-top: 1px solid var(--grey-contrast);
    padding-top: 10px;
}
/* ======= STYLES COMPACTS POUR L'IMPRESSION PDF ======= */
@media print {
    .pdf-page {
padding: 15px !important;
max-width: 100% !important;
    }
    
    .pdf-header-enhanced {
padding: 8px !important;
margin-bottom: 10px !important;
border-bottom: 2px solid var(--blue-france) !important;
    }
    
    .pdf-logo-section {
gap: 8px !important;
    }
    
    .pdf-school-name {
font-size: 0.85rem !important;
    }
    
    .pdf-teacher-name, .pdf-year, .pdf-Classe {
font-size: 0.75rem !important;
    }
    
    .pdf-title-enhanced {
font-size: 1.1rem !important;
margin-bottom: 3px !important;
    }
    
    .pdf-subtitle-enhanced {
font-size: 0.85rem !important;
    }
    
    /* Zone de compétences en 2 colonnes */
    .pdf-competences-container {
column-count: 2 !important;
column-gap: 15px !important;
column-rule: 1px solid var(--grey-contrast) !important;
    }
    
    .pdf-domain {
break-inside: avoid !important;
margin-bottom: 8px !important;
page-break-inside: avoid !important;
    }
    
    .pdf-domain-title {
padding: 4px 8px !important;
font-size: 0.8rem !important;
margin-bottom: 4px !important;
border-left: 3px solid var(--blue-france) !important;
    }
    
    .pdf-competence {
padding: 3px 8px !important;
margin-bottom: 2px !important;
font-size: 0.7rem !important;
line-height: 1.2 !important;
    }
    
    .pdf-competence::before {
font-size: 0.7rem !important;
margin-right: 4px !important;
    }
    
    .pdf-periode {
padding: 1px 4px !important;
font-size: 0.65rem !important;
border-radius: 4px !important;
    }
    
    /* Sous-domaines compacts */
    .pdf-domain div[style*="margin-top"] {
margin-top: 5px !important;
margin-bottom: 3px !important;
padding: 3px 6px !important;
font-size: 0.75rem !important;
    }
    
    /* Footer plus compact */
    .pdf-footer-enhanced {
margin-top: 15px !important;
padding-top: 10px !important;
gap: 15px !important;
font-size: 0.75rem !important;
    }
    
    .pdf-comments-section, .pdf-signature-section {
padding: 8px !important;
min-height: 40px !important;
    }
    
    .pdf-comments-title, .pdf-signature-title {
font-size: 0.75rem !important;
margin-bottom: 4px !important;
    }
    
    .pdf-comments-section div[style*="min-height"] {
min-height: 30px !important;
padding: 4px !important;
font-size: 0.7rem !important;
line-height: 1.2 !important;
    }
    
    .pdf-signature-line {
margin-top: 20px !important;
font-size: 0.7rem !important;
    }
    
    /* Titre de période compact */
    .pdf-page > div[style*="text-align: center"] {
margin-bottom: 8px !important;
font-size: 0.85rem !important;
    }
}
/* ======= FIN STYLES COMPACTS ======= */


.competence-edit-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--grey-contrast);
    border-radius: 4px;
    margin-bottom: 8px;
    background: white;
}

.competence-edit-text {
    flex: 1;
    padding: 8px;
    border: 1px solid var(--grey-border);
    border-radius: 4px;
    font-size: 0.9rem;
}

.competence-edit-actions {
    display: flex;
    gap: 5px;
}

.btn-competence {
    padding: 6px 10px;
    font-size: 0.8rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

.btn-save-comp {
    background: var(--green-success);
    color: white;
}

.btn-delete-comp {
    background: var(--red-marianne);
    color: white;
}

.btn-move {
    background: var(--grey-text-mention);
    color: white;
}
.competence-row .sous-domaine-header {
    background: var(--grey-bg-alt);
    padding: 10px 15px;
    font-weight: 600;
    color: var(--grey-text);
    border-left: 4px solid var(--blue-france);
    margin-top: 15px;
    font-size: 0.95rem;
}
.competence-edit-item.editing {
    border-color: var(--blue-france);
    background: #f8f9ff;
}
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

.flash-message.nouveau:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 145, 0.12);
}

/* =====================================================================
   AJOUTS VERSION 2 — barre fichier, vue mobile, messages, impression
   ===================================================================== */

/* --- Barre fichier (toujours visible) --- */
.barre-fichier {
    position: sticky; top: 0; z-index: 50;
    background: var(--blue-france); color: #fff;
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 8px 16px;
}
.barre-fichier .fichier-nom { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 45vw; }
.barre-fichier .fichier-etat { font-size: 0.85rem; padding: 2px 8px; border-radius: 4px; background: rgba(255,255,255,.15); }
.barre-fichier .fichier-etat.modifie { background: #ffca00; color: #161616; font-weight: 700; }
.barre-fichier .espace { flex: 1; }
.barre-fichier button {
    background: #fff; color: var(--blue-france); border: none; border-radius: 4px;
    padding: 8px 14px; font-weight: 600; cursor: pointer; font-size: 0.9rem; min-height: 40px;
}
.barre-fichier button.principal { background: #18753c; color: #fff; }
.barre-fichier button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* --- Bandeau de mise à jour / installation --- */
.bandeau {
    display: none; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 10px 16px; background: var(--blue-france-950); border-bottom: 1px solid var(--blue-france-925);
}
.bandeau.visible { display: flex; }
.bandeau .texte { flex: 1; min-width: 200px; }

/* --- Toast (message bref) --- */
#toast {
    position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%) translateY(150%);
    background: #161616; color: #fff; padding: 12px 18px; border-radius: 4px;
    max-width: min(560px, calc(100vw - 32px)); z-index: 2000; white-space: pre-line;
    transition: transform .25s ease; box-shadow: 0 4px 16px rgba(0,0,0,.3);
}
#toast.visible { transform: translateX(-50%) translateY(0); }

/* --- Bascule de mode de saisie --- */
.bascule-mode { display: inline-flex; border: 1px solid var(--blue-france); border-radius: 4px; overflow: hidden; }
.bascule-mode button { background: #fff; color: var(--blue-france); border: none; padding: 10px 14px; cursor: pointer; font-weight: 600; }
.bascule-mode button.actif { background: var(--blue-france); color: #fff; }

/* --- Vue « par compétence » (tablette / téléphone) --- */
.vue-competence { padding: 12px 0; }
.vc-navigation { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 12px; }
.vc-navigation select { padding: 12px; font-size: 1rem; border: 1px solid var(--grey-border); border-radius: 4px; width: 100%; background: #fff; }
.vc-carte {
    border: 1px solid var(--grey-contrast); border-left: 6px solid var(--blue-france);
    border-radius: 4px; padding: 14px 16px; background: #fff; margin-bottom: 12px;
}
.vc-carte.competence-ps { border-left-color: #FF69B4; }
.vc-carte.competence-ms { border-left-color: #4A90E2; }
.vc-carte.competence-gs { border-left-color: #50C878; }
.vc-texte { font-size: 1.1rem; font-weight: 600; line-height: 1.4; margin: 6px 0 10px; }
.vc-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--grey-text-mention); font-size: 0.85rem; }
.vc-fleches { display: flex; gap: 8px; }
.vc-fleches button, .vc-actions button { min-height: 48px; min-width: 48px; font-size: 1rem; }
.vc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.vc-actions button { flex: 1; }
.vc-eleves { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.vc-eleve {
    min-height: 64px; padding: 10px; border-radius: 6px; cursor: pointer;
    border: 2px solid var(--grey-border); background: #fff; color: var(--grey-text);
    font-size: 1rem; font-weight: 600; text-align: center;
    display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.vc-eleve .etat { font-size: 0.78rem; font-weight: 500; color: var(--grey-text-mention); }
.vc-eleve.acquis { background: #d4edda; border-color: var(--green-success); }
.vc-eleve.acquis .etat { color: var(--green-success); font-weight: 700; }
.vc-eleve.autre-periode { background: #eef7f0; border-style: dashed; }
.vc-eleve:active { transform: scale(.97); }

/* Bouton « tous » dans chaque ligne du tableau */
.btn-tous-ligne { margin-top: 6px; padding: 4px 8px; font-size: 0.75rem; border-radius: 4px; border: 1px solid var(--blue-france); background: #fff; color: var(--blue-france); cursor: pointer; }

/* Lien d'aide */
.aide { font-size: 0.85rem; color: var(--grey-text-mention); }
.alerte-info { background: var(--blue-france-950); border-left: 4px solid var(--blue-france); padding: 12px 16px; margin: 0 0 20px; border-radius: 0 4px 4px 0; }
.alerte-attention { background: var(--warning-bg); border-left: 4px solid var(--warning); padding: 12px 16px; margin: 0 0 20px; border-radius: 0 4px 4px 0; }

/* Appréciations des périodes affichées en lecture seule dans le bilan annuel */
.appr-periodes { margin-bottom: 12px; font-size: 0.9rem; }
.appr-periodes div { padding: 6px 0; border-bottom: 1px dashed var(--grey-border); }

/* --- Responsive général --- */
@media (max-width: 768px) {
    .header { padding: 10px 12px; }
    .header-inner { gap: 10px; }
    .header-inner img { height: 40px !important; }
    .brand-marque { padding-right: 10px; }
    .header-title h1 { font-size: 1.05rem; }
    .header-title p { display: none; }
    .nav-tab { flex: 1 1 25%; font-size: 0.8rem; padding: 10px 6px; flex-direction: column; gap: 2px; }
    .tab-content { padding: 12px; }
    .accueil-container { padding: 12px; }
    .welcome-section { padding: 16px; }
    .competences-table th.competence-header, .competences-table td.competence-cell { min-width: 200px; max-width: 240px; }
    .domain-header { flex-direction: column; align-items: flex-start; gap: 8px; }
    .competence-row { flex-direction: column; align-items: flex-start; gap: 8px; }
    .competence-status { margin-left: 0; }
    .barre-fichier .fichier-nom { max-width: 100%; flex-basis: 100%; }
    .competence-edit-item { flex-wrap: wrap; }
    .competence-edit-text { flex-basis: 100%; }
    .instruction-content ul { padding-left: 16px; }
}
@media (max-width: 480px) {
    .vc-eleves { grid-template-columns: repeat(2, 1fr); }
    .nav-tab .libelle-long { display: none; }
}
@media (min-width: 481px) { .nav-tab .libelle-court { display: none; } }

/* --- Impression dans la page (remplace la fenêtre surgissante) --- */
#zoneImpression { display: none; }
@media print {
    body.impression > *:not(#zoneImpression) { display: none !important; }
    body.impression #zoneImpression { display: block !important; }
    body.impression { background: #fff; }
    .pdf-page { page-break-after: always; break-after: page; }
    .pdf-page:last-child { page-break-after: auto; break-after: auto; }
    #zoneImpression.une-colonne .pdf-competences-container { column-count: 1 !important; column-rule: none !important; }
    .pdf-competence { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Ajustements téléphone : barre fichier sur deux lignes compactes, bascule pleine largeur */
.bascule-mode { display: flex; }
.bascule-mode button { flex: 1; }
@media (max-width: 768px) {
    .barre-fichier { padding: 6px 10px; gap: 6px; }
    .barre-fichier .fichier-nom { font-size: 0.85rem; }
    .barre-fichier .fichier-etat { font-size: 0.75rem; }
    .barre-fichier button { padding: 6px 10px; font-size: 0.85rem; min-height: 36px; }
}

/* Ligne de sous-domaine : la cellule couvre toute la largeur du tableau
   (avant, display:flex sur la cellule cassait le colspan). */
.competences-table td.sous-domaine-cell { display: table-cell; }
.sous-domaine-titre { position: sticky; left: 15px; display: flex; align-items: center; gap: 10px; max-width: min(700px, 85vw); }

/* Message bref : invisible tant qu'il n'est pas affiché */
#toast { visibility: hidden; }
#toast.visible { visibility: visible; }

/* Impression : un domaine long peut se poursuivre sur la colonne / page suivante
   (avant, il était repoussé en bloc, laissant une première page vide). */
@media print {
    #zoneImpression .pdf-domain { break-inside: auto !important; page-break-inside: auto !important; }
    #zoneImpression .pdf-domain-title, #zoneImpression .pdf-domain > div[style] { break-after: avoid; page-break-after: avoid; }
    #zoneImpression .pdf-competence { break-inside: avoid; page-break-inside: avoid; }
}
