/* ============================================================
   style.css — Feuille de style globale
   Application : Évaluation de Formation
   ============================================================ */

/* ----- Variables ----- */
:root {
    --primary-color:   #004a99;
    --primary-hover:   #003a7a;
    --secondary-color: #64748b;
    --danger:          #e11d48;
    --success:         #16a34a;
    --bg:              #f4f7f9;
    --card:            #ffffff;
    --border-color:    #e2e8f0;
    --text:            #1e293b;
    --text-muted:      #94a3b8;
}

/* ----- Reset & Base ----- */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 20px;
    line-height: 1.5;
}

body.center-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* ----- Barre de déconnexion (auth.php) ----- */
#logout-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 9999;
    background: #1e293b;
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 10px;
    height: 38px;
    font-family: 'Segoe UI', sans-serif;
    font-size: 13px;
    color: #94a3b8;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

body { padding-top: 38px; }

/* Fil d'ariane */
.bc-nav { display: flex; align-items: center; gap: 4px; flex: 1; overflow: hidden; }
.bc-link {
    color: #93c5fd; text-decoration: none;
    font-size: 12px; font-weight: 600;
    white-space: nowrap;
    transition: color 0.15s;
}
.bc-link:hover { color: #fff; text-decoration: underline; }
.bc-sep { color: #475569; font-size: 13px; line-height: 1; }
.bc-current {
    color: #e2e8f0; font-size: 12px; font-weight: 700;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-divider { width: 1px; height: 18px; background: #334155; flex-shrink: 0; }
.bar-session { color: #64748b; font-size: 12px; white-space: nowrap; flex-shrink: 0; }

#logout-bar a.btn-logout {
    background: #ef4444;
    color: white;
    text-decoration: none;
    padding: 4px 12px;
    border-radius: 5px;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.4px;
    transition: background 0.2s;
    flex-shrink: 0;
}

#logout-bar a.btn-logout:hover { background: #b91c1c; }

/* ----- Layout ----- */
.container {
    max-width: 1100px;
    margin: 0 auto;
}

/* ----- Typographie ----- */
h2 { color: var(--text); font-weight: 800; margin: 0; }
.label {
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    color: #666;
    display: block;
    margin-bottom: 8px;
}

/* ----- Inputs ----- */
input[type="text"],
input[type="password"],
input[type="date"],
select,
textarea,
.input-header {
    width: 100%;
    border: 1px solid #ccc;
    padding: 8px;
    border-radius: 4px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 14px;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 74, 153, 0.1);
}

/* ----- Boutons ----- */
.btn-ok,
button[type="submit"],
.submit-btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    text-align: center;
    text-decoration: none;
}

.btn-ok:hover,
button[type="submit"]:hover,
.submit-btn:hover { background: var(--primary-hover); }

.btn-ok:active { transform: scale(0.98); }

.submit-btn {
    display: block;
    width: 300px;
    margin: 30px auto;
    padding: 15px;
    background-color: #334155;
    font-size: 16px;
}

.submit-btn:hover { background: #1e293b; }

.btn-zip {
    background: var(--primary-color);
    color: white;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background 0.2s;
    border: none;
    cursor: pointer;
}

.btn-zip:hover { background: var(--primary-hover); }

.btn-view {
    background: #f1f5f9;
    color: var(--secondary-color);
    padding: 6px 14px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    border: 1px solid var(--border-color);
    transition: background 0.15s, color 0.15s;
}

.btn-view:hover { background: #e2e8f0; color: var(--text); }

/* ----- Cards / Sections ----- */
.session-header-card {
    background: var(--card);
    border-radius: 4px;
    padding: 30px;
    margin-bottom: 20px;
    border-left: 6px solid var(--primary-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 40px;
}

.header-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    margin-bottom: 25px;
    border-top: 5px solid var(--primary-color);
}

.section-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary-color);
    text-transform: uppercase;
    padding: 10px 0;
    margin: 20px 0 12px;
    border-bottom: 2px solid var(--border-color);
}

.category-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--primary-color);
    background: #f8fafc;
    padding: 10px 15px;
    border-radius: 6px;
    margin: 20px 0 10px 0;
    text-transform: uppercase;
    border-left: 5px solid var(--primary-color);
    grid-column: 1 / -1;
}

/* ----- Stagiaire grid ----- */
.stagiaire-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.input-group { display: flex; flex-direction: column; gap: 6px; }

/* ----- Formulaire session ----- */
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.header-top h2 {
    color: var(--primary-color);
    text-transform: uppercase;
    font-size: 24px;
}

.grid-full { grid-column: 1 / -1; display: flex; justify-content: space-around; }
.date-col { text-align: center; }

.duration-display {
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-color);
    margin-top: 10px;
}

.suggestions-list {
    position: absolute;
    background: white;
    border: 1px solid #ccc;
    width: 100%;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 4px;
}

.suggestion-item { padding: 12px; cursor: pointer; border-bottom: 1px solid #eee; }
.suggestion-item:hover { background: #eef6ff; }

/* ----- Index — Tableau sessions ----- */
.filter-section {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 25px;
    background: #f8fafc;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    align-items: flex-end;
}

.filter-group { display: flex; flex-direction: column; gap: 5px; }
.filter-group label { font-size: 0.7rem; color: var(--text-muted); font-weight: bold; text-transform: uppercase; }

#sessionTable {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 5px;
}

#sessionTable thead tr {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
}

#sessionTable thead th { padding: 0 10px; text-align: left; }
#sessionTable thead th:last-child { text-align: right; padding-right: 15px; }

.session-row { background: white; }

/* ----- Action menu (trois points) ----- */
.action-menu { position: relative; display: inline-block; }

.dots-btn {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    font-size: 24px;
    cursor: pointer;
    padding: 0 12px;
    border-radius: 6px;
    color: var(--secondary-color);
    transition: 0.2s;
    line-height: 1;
    font-weight: bold;
}

.dots-btn:hover { background: #f1f5f9; color: var(--text); border-color: #cbd5e1; }

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: white;
    min-width: 220px;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    z-index: 100;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-top: 5px;
}

.dropdown-content a,
.dropdown-content button {
    color: #475569;
    padding: 10px 15px;
    text-decoration: none;
    display: block;
    font-size: 13px;
    text-align: left;
    width: 100%;
    border: none;
    background: none;
    cursor: pointer;
    transition: 0.2s;
    font-family: inherit;
    border-bottom: 1px solid #f1f5f9;
}

.dropdown-content a:hover,
.dropdown-content button:hover { background-color: #f8fafc; color: var(--primary-color); }

.dropdown-content .delete-action { color: var(--danger); font-weight: 600; }

/* ----- Sous-menu Communication client ----- */
.submenu-group {
    border-bottom: 1px solid #f1f5f9;
}
.submenu-toggle {
    color: #475569;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    text-align: left;
    width: 100%;
    border: none;
    background: none;
    cursor: pointer;
    transition: 0.2s;
    font-family: inherit;
}
.submenu-toggle:hover { background-color: #f8fafc; color: var(--primary-color); }

.submenu-arrow {
    font-size: 16px;
    font-weight: 700;
    color: #94a3b8;
    transition: transform 0.2s;
    display: inline-block;
}
.submenu-arrow.rotated { transform: rotate(90deg); color: var(--primary-color); }

.submenu-content {
    display: none;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
}
.submenu-content.open { display: block; animation: fadeIn 0.15s ease-out; }

.submenu-item {
    color: #475569 !important;
    padding: 9px 15px 9px 28px !important;
    font-size: 12px !important;
    display: block;
    width: 100%;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: 0.2s;
    border-bottom: 1px solid #f1f5f9;
}
.submenu-item:last-child { border-bottom: none; }
.submenu-item:hover { background-color: #e8f0fb !important; color: var(--primary-color) !important; }

.show { display: block; animation: fadeIn 0.2s ease-out; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ----- Badge évals ----- */
.badge-eval {
    background: #e0f2fe;
    color: #0369a1;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.75rem;
}

.badge-presence {
    background: #dcfce7;
    color: #16a34a;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.75rem;
}

/* ----- Badge N° session ----- */
.session-num-badge {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--secondary-color);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px dashed #cbd5e1;
    background: #f8fafc;
    cursor: pointer;
    position: relative;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.session-num-badge:hover { background: #eff6ff; color: var(--primary-color); border-color: #93c5fd; }

.session-num-badge::after {
    content: attr(data-num);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--text);
    color: white;
    font-family: monospace;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
}

.session-num-badge::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 1px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--text);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
}

.session-num-badge:hover::after,
.session-num-badge:hover::before { opacity: 1; }

.session-num-badge.copied { background: #f0fdf4; color: var(--success); border-color: #86efac; }

/* ----- Liste stagiaires ----- */
.stats-box {
    background: var(--card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-item {
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.moyenne-badge { font-size: 2.5rem; font-weight: 900; color: var(--primary-color); }

.btn-toggle {
    background: #f1f5f9;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    color: #475569;
}

.btn-toggle:hover { background: #e2e8f0; }

/* Tableau stagiaires */
.table-stagiaires {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.table-stagiaires th {
    background: #f8fafc;
    padding: 15px;
    text-align: left;
    font-size: 0.85rem;
    color: var(--secondary-color);
    text-transform: uppercase;
}

.table-stagiaires td { padding: 15px; border-top: 1px solid #f1f5f9; }

/* ----- Étoiles statiques (liste_stagiaires) ----- */
.star-display {
    display: inline-flex;
    flex-direction: row;
    gap: 2px;
}

.star-display .star { font-size: 1.5rem; line-height: 1; }
.star-display .star.filled { color: var(--primary-color); }

.star-display .star.half {
    position: relative;
    display: inline-block;
    color: #d1d5db;
}

.star-display .star.half::before {
    content: '★';
    position: absolute;
    left: 0; top: 0;
    width: 50%;
    overflow: hidden;
    color: var(--primary-color);
}

.star-display .star.empty { color: #d1d5db; }

.star-label {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 0.9rem;
    margin-left: 8px;
}

/* ----- Étoiles interactives (evaluation.php) ----- */
.eval-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.eval-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s ease;
}

.eval-table tbody tr.row-rated {
    background: #f0f5ff;
    border-left: 4px solid var(--primary-color);
}

.eval-table tbody tr:not(.row-rated):hover { background: #f8fafc; }

.eval-table td { padding: 14px 12px; vertical-align: middle; }

.col-question { font-size: 0.95rem; color: #334155; font-weight: 500; }
.col-stars { text-align: right; white-space: nowrap; }

.star-rating input[type="radio"] { display: none; }

.star-rating {
    display: inline-flex;
    flex-direction: row-reverse;
    gap: 3px;
}

.star-rating label {
    font-size: 2.1rem;
    color: #d1d5db;
    cursor: pointer;
    transition: color 0.12s ease, transform 0.12s ease;
    line-height: 1;
    user-select: none;
}

.star-rating label:hover,
.star-rating label:hover ~ label {
    color: #3b82f6;
    transform: scale(1.2);
}

.star-rating input:checked ~ label { color: var(--primary-color); }
.star-rating input:checked + label { transform: scale(1.25); }

.row-check {
    display: inline-block;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    line-height: 22px;
    text-align: center;
    margin-left: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
    vertical-align: middle;
    flex-shrink: 0;
}

.row-rated .row-check { opacity: 1; }

/* ----- Modales ----- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.45);
    align-items: center;
    justify-content: center;
}

.modal-box {
    background: white;
    border-radius: 16px;
    padding: 36px 32px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    text-align: center;
}

.modal-icon {
    width: 56px; height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.6rem;
}

.modal-icon.danger { background: #fef2f2; }
.modal-icon.info   { background: #eff6ff; }
.modal-icon.warn   { font-size: 2.8rem; margin-bottom: 12px; }

.modal-box h3 { margin: 0 0 8px; color: var(--text); font-size: 1.15rem; }
.modal-box p  { color: #475569; font-size: 0.9rem; margin: 0 0 24px; line-height: 1.6; }

.modal-num-valeur {
    font-family: monospace;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-color);
    background: #f0f7ff;
    border: 2px dashed #93c5fd;
    border-radius: 10px;
    padding: 16px 24px;
    letter-spacing: 2px;
    margin-bottom: 24px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-modal-cancel {
    flex: 1;
    max-width: 160px;
    padding: 11px 0;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: white;
    color: #475569;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-modal-cancel:hover { background: #f8fafc; }

.btn-modal-danger {
    flex: 1;
    max-width: 160px;
    padding: 11px 0;
    border-radius: 8px;
    background: var(--danger);
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    border: none;
    cursor: pointer;
}

.btn-modal-danger:hover { background: #be123c; }

.btn-modal-primary {
    flex: 1;
    max-width: 160px;
    padding: 11px 0;
    border-radius: 8px;
    background: var(--primary-color);
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-modal-primary:hover { background: var(--primary-hover); }

/* ----- Page Accès évaluation ----- */
.card-center {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    padding: 50px 44px;
    max-width: 480px;
    width: 100%;
    text-align: center;
}

.logo-zone { margin: 0 auto 28px; text-align: center; }

.logo-zone img {
    max-height: 80px;
    max-width: 220px;
    object-fit: contain;
}

.card-center h1 { color: var(--text); font-size: 1.45rem; font-weight: 800; margin: 0 0 8px; }

.subtitle { color: var(--secondary-color); font-size: 0.9rem; margin: 0 0 36px; line-height: 1.5; }

.input-code {
    width: 100%;
    padding: 16px 20px;
    font-size: 1.1rem;
    font-family: monospace;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    text-align: center;
    color: var(--text);
}

.input-code:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 74, 153, 0.1);
}

.input-code::placeholder {
    color: #cbd5e1;
    font-weight: 400;
    letter-spacing: 0;
    font-family: 'Segoe UI', sans-serif;
    font-size: 0.9rem;
}

.btn-acceder {
    width: 100%;
    padding: 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    letter-spacing: 0.3px;
    margin-top: 16px;
}

.btn-acceder:hover { background: var(--primary-hover); }
.btn-acceder:active { transform: scale(0.98); }

.erreur-box {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #dc2626;
    padding: 12px 16px;
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
}

/* ----- Page Login ----- */
.login-box {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: 300px;
}

.login-box button[type="submit"] {
    display: block;
    width: 100%;
    margin-top: 16px;
}

.input-wrapper { position: relative; }

.toggle-eye {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 18px;
    user-select: none;
    color: var(--text-muted);
}

.toggle-eye:hover { color: var(--primary-color); }

/* ----- Admin ----- */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.card {
    background: var(--card);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    border: 1px solid var(--border-color);
}

.form-panel {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 2px dashed var(--border-color);
    transition: all 0.3s;
}

.is-editing { background: #fff7ed; border-color: #fb923c; }

.search-box {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
}

.item-list { max-height: 500px; overflow-y: auto; border-top: 1px solid var(--border-color); }

.item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 8px;
    border-bottom: 1px solid var(--border-color);
}

.item:hover { background: #f1f5f9; }

.actions { display: flex; gap: 10px; }

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 5px;
    border-radius: 4px;
}

.btn-icon:hover { background: #e2e8f0; }
.del-link { color: var(--danger); text-decoration: none; }

.badge {
    background: #e2e8f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-weight: bold;
}

.hidden { display: none !important; }

/* ----- Index — classes supplémentaires ----- */
.header-actions { display: flex; gap: 12px; }

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    cursor: pointer;
}
.btn-secondary:hover { background: #e2e8f0; color: var(--text); }

.btn-reset {
    padding: 10px 15px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: white;
    cursor: pointer;
    font-weight: 500;
    height: 41px;
    transition: background 0.15s;
}
.btn-reset:hover { background: #f8fafc; }

.btn-nouvelle-session {
    height: 41px;
    display: flex;
    align-items: center;
    padding: 0 18px;
    margin-left: auto;
    text-decoration: none;
}

/* ----- Filtres rapides — dropdown période ----- */
.dropdown-period {
    position: relative;
}

.btn-period-toggle {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    transition: border-color 0.15s, box-shadow 0.15s;
    white-space: nowrap;
    min-width: 140px;
}

.btn-period-toggle:focus,
.btn-period-toggle:hover {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 74, 153, 0.1);
}

.btn-period-toggle.period-active {
    border-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
}

.period-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 170px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    z-index: 200;
    overflow: hidden;
    padding: 4px 0;
}

.period-menu.open { display: block; }

.period-menu .btn-quick-date {
    display: block;
    width: 100%;
    padding: 8px 14px;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #475569;
    font-size: 0.88rem;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s;
    white-space: nowrap;
}

.period-menu .btn-quick-date:hover {
    background: #f0f5ff;
    color: var(--primary-color);
}

.period-menu .btn-quick-date.active {
    background: #eff6ff;
    color: var(--primary-color);
    font-weight: 700;
}

.period-separator {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

/* Tableau sessions — cellules */
.td-first {
    padding: 8px 12px;
    border-radius: 8px 0 0 8px;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    border-left: 1px solid var(--border-color);
}

.td-middle {
    padding: 8px 10px;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.td-last {
    padding: 8px 10px;
    border-radius: 0 8px 8px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
}

.td-center { text-align: center; }
.td-right  { text-align: right; }
.th-center { text-align: center; }
.th-right  { text-align: right; padding-right: 15px; }

.date-secondary { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.date-duree { color: #cbd5e1; }

/* Nouvelle colonne date */
.date-main {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text);
}
.date-moment {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 3px;
    line-height: 1.4;
}
.date-duree-pill {
    display: inline-block;
    margin-top: 5px;
    background: #e0eaff;
    color: var(--primary-color);
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 20px;
    padding: 1px 8px;
}

.client-name { font-weight: 700; color: var(--text); text-transform: uppercase; }
.client-name a { color: inherit; text-decoration: none; }
.client-name a:hover { color: var(--primary-color); }
.client-formateur { font-size: 0.75rem; color: var(--text-muted); }

.logiciel-label { font-weight: 600; color: #0369a1; }

/* Admin header */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 15px;
}

/* ============================================================
   voir_evaluation.php
   ============================================================ */
.page {
    background: white;
    max-width: 950px;
    margin: auto;
    border-radius: 10px;
    border-top: 6px solid var(--primary-color);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 20px 25px;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.top-bar h1 { margin: 0; font-size: 1.15rem; color: #0f172a; }
.top-bar .meta { font-size: 0.75rem; color: #64748b; margin-top: 3px; }

.btn-print {
    background: #334155;
    color: white;
    border: none;
    padding: 7px 14px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 12px;
}
.btn-print:hover { background: #000; }

.info-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.info-box {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 7px;
    padding: 10px 14px;
}

.lbl {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: #94a3b8;
    font-weight: 800;
    letter-spacing: 0.4px;
    display: block;
    margin-bottom: 3px;
}

.val { font-weight: 700; color: var(--primary-color); font-size: 0.95rem; }

.score-box { display: flex; align-items: center; justify-content: center; gap: 8px; }
.score-num { font-size: 2.8rem; font-weight: 900; line-height: 1; }
.score-sub { font-size: 0.7rem; color: #94a3b8; }

.sections {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

.section-block { border: 1px solid var(--border-color); border-radius: 7px; overflow: hidden; }

.section-title {
    background: var(--primary-color);
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 6px 10px;
    letter-spacing: 0.5px;
}

.critere-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid #f1f5f9;
    gap: 8px;
}
.critere-row:last-child { border-bottom: none; }

.critere-label { font-size: 0.75rem; color: #475569; flex: 1; }

/* Étoiles dans voir_evaluation */
.star-row {
    display: inline-flex;
    flex-direction: row;
    gap: 1px;
    flex-shrink: 0;
}

.star-row .star { font-size: 1rem; line-height: 1; }
.star-row .star.filled { color: var(--primary-color); }
.star-row .star.half {
    position: relative;
    display: inline-block;
    color: #d1d5db;
}
.star-row .star.half::before {
    content: '★';
    position: absolute;
    left: 0; top: 0;
    width: 50%;
    overflow: hidden;
    color: var(--primary-color);
}
.star-row .star.empty { color: #d1d5db; }

.note-val {
    font-weight: 800;
    font-size: 0.75rem;
    color: var(--primary-color);
    min-width: 22px;
    text-align: right;
    flex-shrink: 0;
}

.comment-box {
    border-left: 4px solid #cbd5e1;
    background: #fafafa;
    border-radius: 4px;
    padding: 10px 14px;
}

.comment-text {
    font-style: italic;
    color: #475569;
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 4px 0 0;
}

.back { text-align: center; margin-top: 12px; }
.back a { color: #64748b; text-decoration: none; font-size: 0.8rem; }

@media print {
    body { background: white; padding: 0; }
    .no-print { display: none !important; }
    .page { box-shadow: none; border: none; max-width: 100%; padding: 10px; }
}

/* ============================================================
   evaluation.php
   ============================================================ */
input[readonly] {
    background: #f1f5f9;
    color: #475569;
    cursor: not-allowed;
    border-color: #e2e8f0 !important;
}

.input-editable-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
}

.input-editable-wrap input {
    flex: 1;
}

.btn-edit-field {
    flex-shrink: 0;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 6px 9px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #64748b;
    transition: background 0.15s, border-color 0.15s;
    line-height: 1;
}

.btn-edit-field:hover {
    background: #e0eaff;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.eval-header-card {
    background: #004a99;
    border-radius: 12px;
    margin-bottom: 28px;
    overflow: hidden;
}

.eval-header-top {
    padding: 22px 28px;
}

.eval-header-top h2 {
    margin: 0 0 6px;
    color: #fff;
    font-size: 1.25rem;
    font-weight: 800;
}

.eval-header-meta {
    color: rgba(255,255,255,0.85);
    font-size: 0.85rem;
    line-height: 1.6;
}

/* ============================================================
   liste_stagiaires.php
   ============================================================ */
.presence-section { margin-top: 36px; }
.presence-section h3 { color: #1e293b; font-size: 1.1rem; margin: 0 0 16px; display:flex; align-items:center; gap:8px; }
.presence-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; margin-bottom: 24px; }
.presence-table thead tr { background: #004a99; color: #fff; }
.presence-table thead th { padding: 10px 12px; text-align: left; font-size: 0.78rem; text-transform: uppercase; letter-spacing: .4px; }
.presence-table tbody tr:nth-child(even) { background: #f8fafc; }
.presence-table td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.sig-thumb { max-height: 40px; max-width: 120px; }
.formateur-sign-box { background: #f8fafc; border: 1.5px dashed #cbd5e1; border-radius: 12px; padding: 24px; margin-top: 8px; }
.formateur-sign-box.signed { border-style: solid; border-color: #16a34a; background: #f0fdf4; }
.formateur-sign-box label { display: block; font-size: 0.78rem; font-weight: 700; color: #475569; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 10px; }
#canvasFormateur { width: 100%; height: 360px; border: 2px dashed #cbd5e1; border-radius: 8px; cursor: crosshair; background: #fff; display: block; touch-action: none; }
#canvasFormateur.signed { border-color: #16a34a; border-style: solid; }
.sign-actions { display:flex; gap:10px; align-items:center; margin-top:10px; flex-wrap:wrap; }
.btn-clear-form { background: none; border: 1px solid #e2e8f0; color: #94a3b8; font-size: 0.8rem; cursor: pointer; padding: 6px 12px; border-radius: 6px; }
.btn-clear-form:hover { color: #ef4444; border-color: #fecaca; background: #fef2f2; }
.btn-signer { background: #004a99; color: #fff; border: none; padding: 10px 24px; border-radius: 8px; font-weight: 700; font-size: 0.9rem; cursor: pointer; transition: background .2s; }
.btn-signer:hover { background: #003580; }
.btn-pdf-presence { display: inline-flex; align-items: center; gap: 8px; background: #16a34a; color: #fff; text-decoration: none; padding: 11px 22px; border-radius: 8px; font-weight: 700; font-size: 0.9rem; transition: background .2s; }
.btn-pdf-presence:hover { background: #15803d; }
.btn-pdf-disabled { display: inline-flex; align-items: center; gap: 8px; background: #e2e8f0; color: #94a3b8; padding: 11px 22px; border-radius: 8px; font-weight: 700; font-size: 0.9rem; cursor: not-allowed; }
.signed-badge { display: inline-flex; align-items: center; gap: 6px; background: #dcfce7; color: #16a34a; border: 1px solid #bbf7d0; border-radius: 20px; padding: 4px 12px; font-size: 0.8rem; font-weight: 700; }
.alert-success { background: #dcfce7; border: 1px solid #bbf7d0; border-radius: 8px; padding: 12px 16px; color: #15803d; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.empty-presence { text-align: center; padding: 32px; color: #94a3b8; border: 1.5px dashed #e2e8f0; border-radius: 10px; margin-bottom: 20px; }
.btn-supp-sig { background: none; border: 1px solid #fecaca; color: #ef4444; padding: 5px 12px; border-radius: 6px; font-size: 0.8rem; cursor: pointer; font-weight: 600; transition: background .2s; }
.btn-supp-sig:hover { background: #fef2f2; }

/* ============================================================
   presence.php
   ============================================================ */
.presence-card { max-width: 620px; margin: 0 auto; background: #fff; border-radius: 14px; box-shadow: 0 4px 24px rgba(0,0,0,.10); overflow: hidden; }
.presence-card-header { background: #004a99; color: #fff; padding: 24px 28px; }
.presence-card-header h2 { color: #fff; margin: 0 0 4px; font-size: 1.2rem; }
.presence-card-header .session-meta { color: #fff; font-size: 0.85rem; opacity: .85; border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
.presence-card-body { padding: 28px 36px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.form-row label { display: block; font-size: 0.78rem; font-weight: 700; color: #475569; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 5px; }
.form-row input { width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0; border-radius: 8px; font-size: 0.95rem; box-sizing: border-box; transition: border-color .2s; }
.form-row input:focus { outline: none; border-color: #004a99; }
.sig-zone { margin-top: 20px; }
.sig-zone > label { display: block; font-size: 0.78rem; font-weight: 700; color: #475569; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
#signatureCanvas { width: 100%; height: 380px; border: 2px dashed #cbd5e1; border-radius: 10px; cursor: crosshair; background: #f8fafc; display: block; touch-action: none; }
#signatureCanvas.signed { border-color: #004a99; border-style: solid; background: #fff; }
.sig-actions { display: flex; justify-content: flex-end; margin-top: 6px; }
.btn-clear { background: none; border: none; color: #94a3b8; font-size: 0.8rem; cursor: pointer; padding: 4px 8px; border-radius: 5px; }
.btn-clear:hover { color: #ef4444; background: #fef2f2; }
.btn-submit { width: 100%; margin-top: 24px; padding: 15px; background: #004a99; color: #fff; border: none; border-radius: 10px; font-size: 1.05rem; font-weight: 700; cursor: pointer; }
.btn-submit:hover { background: #003580; }
.erreur-box { background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; padding: 12px 16px; margin-bottom: 20px; display: flex; gap: 10px; align-items: center; color: #dc2626; font-weight: 600; font-size: 0.9rem; }

/* ============================================================
   liste_presence_publique.php
   ============================================================ */
.card { background: var(--card); padding: 25px; border-radius: 12px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); border: 1px solid var(--border-color); }
.card-public { max-width: 1100px; margin: 0 auto; background: #fff; border-radius: 14px; box-shadow: 0 4px 24px rgba(0,0,0,.10); overflow: hidden; }
.card-header { background: #004a99; color: #fff; padding: 24px 28px; }
.card-header h2 { margin: 0 0 4px; font-size: 1.2rem; color: #fff; }
.card-header .meta { font-size: 0.85rem; opacity: .85; margin-top: 4px; }
.card-body { padding: 24px 28px; }
.stats-row { display: flex; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.stat-pill { background: #f1f5f9; border-radius: 10px; padding: 10px 18px; font-size: 0.85rem; color: #475569; }
.stat-pill strong { color: #004a99; font-size: 1.1rem; margin-right: 4px; }
.presence-list { margin-bottom: 24px; }
.presence-item { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid #f1f5f9; }
.presence-item:last-child { border-bottom: none; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: #e0e7ff; color: #3730a3; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.95rem; flex-shrink: 0; }
.participant-info { flex: 1; }
.participant-name { font-weight: 700; color: #1e293b; font-size: 0.95rem; }
.participant-sub { color: #94a3b8; font-size: 0.8rem; margin-top: 2px; }
.sig-mini { max-height: 32px; max-width: 90px; border: 1px solid #e2e8f0; border-radius: 4px; background: #f8fafc; padding: 2px; }
.heure-badge { font-size: 0.75rem; color: #94a3b8; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px; padding: 3px 8px; flex-shrink: 0; }
.empty-state { text-align: center; padding: 32px 16px; color: #94a3b8; }
.empty-state .icon { font-size: 2.5rem; margin-bottom: 10px; }
.btn-signer-public { display: block; width: 100%; background: #004a99; color: #fff; text-align: center; text-decoration: none; padding: 15px; border-radius: 10px; font-weight: 700; font-size: 1rem; transition: background .2s; box-sizing: border-box; }
.btn-signer-public:hover { background: #003580; }
.session-fermee { background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; padding: 14px 18px; color: #dc2626; font-weight: 600; font-size: 0.9rem; display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }

/* ============================================================
   voir_evaluation.php
   ============================================================ */
* { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }

/* ============================================================
   Pages publiques — fond commun
   ============================================================ */
body.public-page { background: #f0f4f8; min-height: 100vh; padding: 24px 12px; }

/* Pages authentifiées avec barre logout : espace supplémentaire en haut */
body:not(.public-page) .container { padding-top: 20px; }

/* ============================================================
   admin.php — onglets mots de passe
   ============================================================ */
.pwd-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}
.pwd-tab {
    background: none;
    border: none;
    padding: 7px 18px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: all .15s;
}
.pwd-tab:hover { background: #f1f5f9; color: var(--text); }
.pwd-tab.active { background: var(--primary-color); color: #fff; }
.pwd-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}
@media(max-width: 900px) { .pwd-grid { grid-template-columns: 1fr 1fr; } }

/* ── Navigation publique (pages stagiaires) ─────────────────── */
.public-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #1e293b;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    height: 40px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.public-nav-back {
    color: #93c5fd;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    font-family: "Segoe UI", sans-serif;
    transition: color 0.15s;
    white-space: nowrap;
}
.public-nav-back:hover { color: #fff; text-decoration: underline; }
.public-nav-title {
    color: #94a3b8;
    font-size: 12px;
    font-family: "Segoe UI", sans-serif;
    font-weight: 600;
    flex: 1;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ════════════════════════════════════════════════════════════════
   MODALES SIGNATURE (presence.php, liste_stagiaires.php, index.php)
   ════════════════════════════════════════════════════════════════ */

/* -- Overlay commun -- */
.modal-sig-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.75);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}
.modal-sig-overlay.open { display: flex; }

/* -- Boîte centrale -- */
.modal-sig-box {
    background: #fff;
    border-radius: 18px;
    width: 90vw;
    max-width: 960px;
    padding: 28px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* -- En-tête modale -- */
.modal-sig-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-sig-header h3 {
    margin: 0;
    color: #1e293b;
    font-size: 1.15rem;
    font-family: "Segoe UI", sans-serif;
}
.modal-sig-close {
    background: none; border: none;
    font-size: 1.6rem; cursor: pointer;
    color: #94a3b8; line-height: 1; padding: 0 4px;
}
.modal-sig-close:hover { color: #1e293b; }

/* -- Onglets dessin / import -- */
.sig-tabs { display: flex; gap: 8px; }
.sig-tab {
    padding: 7px 18px;
    border-radius: 7px;
    border: 1.5px solid #cbd5e1;
    background: #fff;
    color: #475569;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all .15s;
}
.sig-tab.active {
    background: #004a99;
    border-color: #004a99;
    color: #fff;
}

/* -- Canvas -- */
.sig-canvas {
    width: 100%;
    height: 55vh;
    border: 2.5px dashed #cbd5e1;
    border-radius: 12px;
    cursor: crosshair;
    background: #f8fafc;
    touch-action: none;
    display: block;
}
.sig-canvas.signed { border-color: #004a99; border-style: solid; }

/* -- Zone dropzone import -- */
.sig-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color .2s, background .2s;
}
.sig-dropzone:hover { border-color: #004a99; background: #eff6ff; }
.sig-dropzone-icon { font-size: 2.5rem; margin-bottom: 8px; }
.sig-dropzone-text { color: #64748b; font-size: 0.9rem; }

/* -- Aperçu image importée -- */
.sig-preview-container { display: none; margin-top: 12px; text-align: center; }
.sig-preview-img {
    max-height: 120px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

/* -- Aperçu miniature après validation -- */
.sig-result-box { display: none; margin-bottom: 12px; }
.sig-result-img {
    max-height: 80px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    padding: 6px;
    display: block;
}
.sig-result-label {
    margin-top: 5px;
    font-size: 0.82rem;
    color: #16a34a;
    font-weight: 700;
}

/* -- Pied de modale (effacer + valider) -- */
.modal-sig-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.btn-sig-effacer {
    background: none;
    border: 1.5px solid #e2e8f0;
    color: #64748b;
    padding: 10px 22px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: "Segoe UI", sans-serif;
    transition: border-color .15s, color .15s;
}
.btn-sig-effacer:hover { border-color: #fecaca; color: #ef4444; }
.btn-sig-valider {
    background: linear-gradient(135deg, #004a99 0%, #0066cc 100%);
    color: #fff;
    border: none;
    padding: 13px 44px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    font-family: "Segoe UI", sans-serif;
    box-shadow: 0 4px 16px rgba(0,74,153,0.35);
    transition: all .2s;
    display: inline-flex; align-items: center; gap: 8px;
}
.btn-sig-valider:hover { background: linear-gradient(135deg, #003a7a 0%, #004a99 100%); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,74,153,0.4); }

/* btn-ouvrir-sig — défini dans la section modale présence ci-dessous */

/* -- Bouton "Valider ma signature" (formateur) -- */
.btn-valider-sig-formateur {
    display: none;
    background: #16a34a;
    color: #fff;
    border: none;
    padding: 12px 32px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    font-family: "Segoe UI", sans-serif;
    transition: background .2s;
}
.btn-valider-sig-formateur:hover { background: #15803d; }

/* ════════════════════════════════════════════════════════════════
   MODALE FEUILLE DE PRÉSENCE (index.php)
   ════════════════════════════════════════════════════════════════ */
.btn-presence-icon {
    background: none; border: none; cursor: pointer;
    font-size: 1.2rem; padding: 2px 6px; border-radius: 6px;
    transition: transform 0.15s;
}
.btn-presence-icon:hover { transform: scale(1.2); }

.modal-presence-header {
    background: #004a99; color: #fff;
    padding: 20px 24px; border-radius: 12px 12px 0 0;
    margin: -32px -32px 20px;
}
.modal-presence-header h3 { margin: 0 0 4px; font-size: 1.1rem; color: #fff; }
.modal-presence-header .mp-meta { font-size: 0.82rem; opacity: .85; }

.mp-stats { display: flex; gap: 12px; margin-bottom: 20px; }
.mp-stat {
    background: #f1f5f9; border-radius: 8px;
    padding: 8px 14px; font-size: 0.85rem; color: #475569;
}
.mp-stat strong { color: #004a99; font-size: 1rem; margin-right: 3px; }

.mp-sign-box { border: 1.5px dashed #cbd5e1; border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.mp-sign-box.signed { border-style: solid; border-color: #16a34a; background: #f0fdf4; }

#mpCanvas {
    width: 100%; height: 320px; display: block;
    border: 2px dashed #cbd5e1; border-radius: 8px;
    cursor: crosshair; background: #fff; touch-action: none;
}
#mpCanvas.signed { border-color: #004a99; border-style: solid; }

.mp-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.mp-tab {
    padding: 5px 14px; border-radius: 6px;
    border: 1.5px solid #cbd5e1;
    background: #fff; color: #475569;
    font-weight: 700; font-size: 0.82rem; cursor: pointer;
}
.mp-tab.active { background: #004a99; border-color: #004a99; color: #fff; }

.mp-dropzone {
    border: 2px dashed #cbd5e1; border-radius: 8px;
    padding: 20px; text-align: center;
    background: #f8fafc; cursor: pointer;
}
.btn-mp-valider {
    width: 100%; padding: 13px;
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    color: #fff;
    border: none; border-radius: 10px;
    font-weight: 700; font-size: 1rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    box-shadow: 0 4px 14px rgba(22,163,74,0.35);
    transition: all .2s;
    letter-spacing: 0.3px;
}
.btn-mp-valider:hover { background: linear-gradient(135deg, #15803d 0%, #166534 100%); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(22,163,74,0.4); }
.btn-mp-valider:active { transform: translateY(0); }
.btn-mp-clear {
    background: none; border: 1px solid #e2e8f0;
    color: #94a3b8; font-size: 0.8rem;
    cursor: pointer; padding: 4px 10px; border-radius: 6px;
}
.btn-mp-clear:hover { color: #ef4444; border-color: #fecaca; }

/* ---- Bouton "Signer" principal amélioré ---- */
.btn-ouvrir-sig {
    background: linear-gradient(135deg, #004a99 0%, #0066cc 100%);
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    font-family: "Segoe UI", sans-serif;
    display: inline-flex; align-items: center; gap: 7px;
    box-shadow: 0 4px 14px rgba(0,74,153,0.3);
    transition: all .2s;
    letter-spacing: 0.2px;
}
.btn-ouvrir-sig:hover { background: linear-gradient(135deg, #003a7a 0%, #004a99 100%); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,74,153,0.4); }
.btn-ouvrir-sig:active { transform: translateY(0); }
.btn-ouvrir-sig.done { background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%); box-shadow: 0 4px 14px rgba(22,163,74,0.3); }
.btn-ouvrir-sig.done:hover { background: linear-gradient(135deg, #15803d 0%, #16a34a 100%); }

/* ---- Carte signature existante ---- */
.mp-signed-card {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1.5px solid #bbf7d0;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 16px;
    display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.mp-signed-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: #16a34a; color: #fff;
    padding: 7px 16px; border-radius: 999px;
    font-weight: 700; font-size: 0.85rem;
    box-shadow: 0 2px 8px rgba(22,163,74,0.3);
}
.mp-sig-frame {
    background: #fff;
    border: 1.5px solid #d1fae5;
    border-radius: 12px;
    padding: 16px 24px;
    width: 100%; text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    min-height: 100px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
}
.mp-sig-frame-label {
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
    color: #6b7280; letter-spacing: 0.8px; margin-bottom: 4px;
}
.mp-sig-existante-img {
    max-height: 90px; max-width: 260px;
    display: block; margin: 0 auto;
    border-radius: 4px;
}
.mp-sig-placeholder { color: #9ca3af; font-size: 0.85rem; font-style: italic; }

.btn-mp-supprimer-sig {
    display: inline-flex; align-items: center; gap: 7px;
    background: #fff; color: #dc2626;
    border: 1.5px solid #fca5a5;
    padding: 8px 20px; border-radius: 8px;
    font-weight: 700; font-size: 0.85rem; cursor: pointer;
    font-family: "Segoe UI", sans-serif;
    transition: all .18s;
}
.btn-mp-supprimer-sig:hover { background: #fef2f2; border-color: #ef4444; box-shadow: 0 2px 8px rgba(220,38,38,0.15); }

/* ============================================================
   BARRE DE NAVIGATION ADMIN (auth.php)
   ============================================================ */

:root {
    --auth-bar-bg: #1e293b;
    --auth-bar-height: 38px;
    --auth-text-muted: #94a3b8;
    --auth-accent: #93c5fd;
    --auth-danger: #ef4444;
}

body { padding-top: var(--auth-bar-height) !important; margin-top: 0 !important; }

#logout-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 9999;
    height: var(--auth-bar-height);
    background: var(--auth-bar-bg);
    display: flex;
    align-items: center;
    padding: 0 16px;
    font-family: "Segoe UI", system-ui, sans-serif;
    font-size: 13px;
    color: var(--auth-text-muted);
    box-shadow: 0 2px 10px rgba(0,0,0,0.4);
}

/* Wrapper interne aligne sur le conteneur principal (max-width 1100px) */
#logout-bar-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

.bar-spacer { flex: 1; min-width: 0; }

.bc-nav { display: flex; align-items: center; gap: 6px; overflow: hidden; min-width: 0; flex-shrink: 1; }

.bc-link {
    color: var(--auth-accent);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    transition: color 0.2s;
}
.bc-link:hover { color: #fff; text-decoration: underline; }

.bc-sep { color: #475569; font-weight: bold; }

.bc-current {
    color: #e2e8f0;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bar-divider { width: 1px; height: 18px; background: #334155; flex-shrink: 0; }

.bar-session {
    font-size: 11px;
    white-space: nowrap;
    flex-shrink: 0;
    color: #64748b;
}

#logout-bar .btn-logout {
    background: var(--auth-danger);
    color: #fff !important;
    text-decoration: none !important;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transition: all 0.2s;
    flex-shrink: 0;
}
#logout-bar .btn-logout:hover { background: #b91c1c; transform: translateY(-1px); }
#logout-bar .btn-logout:active { transform: translateY(0); }

@media (max-width: 600px) {
    .bar-session, .bar-divider { display: none; }
    #logout-bar { padding: 0 8px; }
    #logout-bar-inner { gap: 8px; }
    .btn-logout { padding: 4px 8px; }
}
