/* ── Résultats des questionnaires de satisfaction (/admin/satisfaction) ── */

#sat-results {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
}

.sat-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.sat-toolbar label[for="sat-survey"] {
    font-weight: 600;
    color: #37474f;
}

/* Cases à cocher (terminées / tests) sur leur propre ligne */
.sat-toolbar .sat-toggles {
    flex-basis: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.sat-toolbar select {
    width: auto;
    max-width: 100%;
    padding: 6px 10px;
    border: 1px solid #b0bec5;
    border-radius: 8px;
    background: white;
}

.sat-empty {
    padding: 40px 0;
    text-align: center;
    color: #607d8b;
}

.sat-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.sat-kpi,
.sat-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px -4px rgba(0, 0, 0, .25);
}

.sat-kpi {
    padding: 14px 16px;
}

.sat-kpi-value {
    font-size: 1.9rem;
    font-weight: 700;
    color: #2b5c73;
    line-height: 1.2;
}

.sat-kpi-label {
    font-weight: 600;
    color: #37474f;
}

.sat-kpi-sub,
.sat-muted,
.sat-note {
    font-size: .85rem;
    color: #78909c;
}

.sat-note {
    margin-top: 8px;
}

.sat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

@media only screen and (max-width: 600px) {
    .sat-grid {
        grid-template-columns: 1fr;
    }
}

.sat-card {
    padding: 14px 16px;
    min-width: 0;
}

.sat-card h2 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 12px;
    color: #37474f;
}

/* Barres horizontales */
.sat-bar-row {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: .9rem;
}

.sat-bar-track {
    height: 10px;
    background: #eceff1;
    border-radius: 5px;
    overflow: hidden;
}

.sat-bar-fill {
    height: 100%;
    background: #3d7e9d;
    border-radius: 5px;
}

.sat-bar-count {
    font-size: .85rem;
    color: #546e7a;
    white-space: nowrap;
}

.sat-callback {
    padding: 8px 6px;
    border-bottom: 1px solid #eceff1;
    border-radius: 6px;
    cursor: pointer;
}

.sat-callback:last-child {
    border-bottom: none;
}

.sat-callback:hover,
.sat-callback:focus-visible {
    background: #f5f7f8;
}

.sat-callback-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

/* Statut du suivi : en attente / rappelé / terminé */
.sat-callback-status {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: .8rem;
    white-space: nowrap;
    background: #fff3e0;
    color: #e65100;
}

.sat-callback-status[status="rappelé"] {
    background: #e3f2fd;
    color: #1565c0;
}

.sat-callback-status[status="terminé"] {
    background: #e8f5e9;
    color: #2e7d32;
}

.sat-callback-notes-preview {
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Modal de suivi */
.sat-callback-modal {
    max-width: 560px;
}

.sat-callback-modal h5 {
    margin-top: 0;
}

.sat-callback-statuses {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 16px 0;
}

.sat-callback-notes {
    width: 100%;
    min-height: 220px;
    margin-top: 4px;
    padding: 8px 10px;
    border: 1px solid #b0bec5;
    border-radius: 8px;
    font-family: inherit;
    resize: vertical;
}

.sat-callback-notes:focus {
    outline: none;
    border-color: #3d7e9d;
}

/* Tableau des réponses */
.sat-table-wrapper {
    overflow-x: auto;
}

#sat-table td {
    vertical-align: top;
    padding: 8px 10px;
}

#sat-table .sat-details {
    font-size: .9rem;
    min-width: 260px;
}

.sat-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: .8rem;
    background: #eceff1;
    color: #546e7a;
    white-space: nowrap;
}

.sat-status.completed {
    background: #e8f5e9;
    color: #2e7d32;
}

.sat-status-test {
    margin-left: 4px;
    background: #fff3e0;
    color: #e65100;
}

/* ── Test des questionnaires (/admin/questionnaires) ── */
.sat-survey {
    margin-bottom: 12px;
}

.sat-survey-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.sat-survey-header h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.sat-survey-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sat-survey-questions {
    margin-top: 12px;
}

.sat-survey-questions summary {
    cursor: pointer;
    color: #3d7e9d;
    font-weight: 600;
}

.sat-survey-steps {
    margin-top: 10px;
}

.sat-survey-steps ol {
    margin: 4px 0 0;
    padding-left: 22px;
}

.sat-survey-steps li {
    margin-bottom: 6px;
}

#sat-settings .sat-card {
    margin-bottom: 12px;
}

.sat-current-value {
    padding: 8px 12px;
    font-size: 1rem;
    font-weight: 600;
    color: #2e7d32;
    background-color: #e8f5e9;
    border: 2px solid #43a047;
    border-radius: 8px;
}

/* Aucun questionnaire en cours */
.sat-current-value.sat-current-none {
    color: #546e7a;
    background-color: #eceff1;
    border-color: #90a4ae;
}

/* Questionnaires en cours (cases à cocher, comptes God) */
.sat-current-list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.sat-current-option {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border: 2px solid #cfd8dc;
    border-radius: 8px;
    color: #37474f;
    font-size: 1rem;
    cursor: pointer;
}

.sat-current-option.active {
    border-color: #43a047;
    background-color: #e8f5e9;
    color: #2e7d32;
    font-weight: 600;
}

.sat-current-option [type="checkbox"].filled-in + span {
    color: inherit;
}

.sat-conditions {
    margin: 4px 0 0;
    padding-left: 22px;
}

.sat-conditions li {
    list-style: disc;
    margin-bottom: 4px;
}

/* 👎 en rouge : chiffre clé, barres "Ce qui gêne", lignes du tableau */
.sat-kpi-dislike .sat-kpi-value,
.sat-kpi-dislike .sat-kpi-label {
    color: #c62828;
}

#sat-dislike-reasons .sat-bar-fill {
    background: #e57373;
}

#sat-table tr.sat-row-dislike {
    background: #ffebee;
    box-shadow: inset 4px 0 0 #e53935;
}

/* Réponse à la première question (/admin/questionnaires) */
.sat-answer-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 600;
}

.sat-answer-like {
    background: #e8f5e9;
    color: #2e7d32;
}

.sat-answer-dislike {
    background: #ffebee;
    color: #c62828;
}

/* Réponses libres (pleine largeur) */
.sat-card-wide {
    grid-column: 1 / -1;
}

.sat-texts {
    max-height: 420px;
    overflow-y: auto;
}

.sat-text {
    padding: 8px 0;
    border-bottom: 1px solid #eceff1;
}

.sat-text:last-child {
    border-bottom: none;
}

.sat-text-value {
    white-space: pre-wrap;
    margin-bottom: 2px;
}

.sat-text .sat-answer-tag {
    margin-left: 6px;
    padding: 0 8px;
    font-size: .8rem;
    background: #e3f2fd;
    color: #1565c0;
}

/* Notes de 1 à 5 */
.sat-rating-stars {
    color: #ffb300;
    letter-spacing: 1px;
}

.sat-rating-empty {
    color: #cfd8dc;
}

/* Taux de réponse estimé (/admin/questionnaires) */
.sat-estimate {
    margin-top: 6px;
    font-size: .9rem;
}
