/* ==========================================================================
   Quick Answer - styles propres au projet.
   Construits sur les jetons de la charte BSI UI : PT Serif, accent
   bordeaux, rayon 4px, contrôles 42px, remplissages gris pâles,
   bordures fines. style.css n'est jamais modifié.
   ========================================================================== */

.main-content > .card + .card,
.main-content > .card + .section-title,
.main-content > .data-table + .section-title,
.main-content > form.card + .section-title {
    margin-top: 30px;
}

.main-content > .card {
    margin-bottom: 20px;
}

.section-title {
    font-size: 16px;
    color: var(--text-muted);
    margin: 30px 0 12px;
}

.muted {
    color: var(--text-muted);
}

.empty-row {
    text-align: center;
    color: var(--text-muted);
}

/* ─── Écran de rédaction ─────────────────────────────────────── */

.source-input {
    min-height: 220px;
    line-height: 1.7;
}

.draft-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.draft-tools {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Le brouillon est du texte d'e-mail : on garde les retours à la
   ligne tels quels, dans le remplissage gris pâle des champs. */
.draft-output {
    background: var(--bg);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 20px 22px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text);
    min-height: 60px;
}

.draft-output:empty::after {
    content: "";
}

/* Marqueur [TO CHECK: ...] laissé par le modèle : il doit sauter
   aux yeux avant l'envoi. */
.draft-output .to-check {
    background: var(--red-light);
    color: var(--red);
    border: 1px solid var(--red-border);
    border-radius: var(--radius);
    padding: 1px 8px;
}

.draft-meta {
    margin-top: 12px;
    font-size: 12.5px;
    color: var(--text-muted);
}

.draft-cursor {
    display: inline-block;
    width: 7px;
    height: 15px;
    background: var(--red);
    vertical-align: -2px;
    animation: qa-blink 1s steps(2, start) infinite;
}

@keyframes qa-blink {
    to { visibility: hidden; }
}

/* ─── Propositions d'enrichissement ──────────────────────────── */

.suggestion + .suggestion {
    margin-top: 20px;
}

.suggestion-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 14px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--divider);
}

.suggestion-origin {
    font-size: 15px;
    color: var(--text);
}

.suggestion-note {
    background: var(--bg);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 22px;
    font-size: 13.5px;
    color: var(--text-muted);
}

.suggestion-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ─── Base de connaissance ───────────────────────────────────── */

.kb-editor {
    min-height: 60vh;
    line-height: 1.7;
    font-size: 13.5px;
}

/* ─── Historique ─────────────────────────────────────────────── */

.thread-meta {
    font-size: 13px;
    color: var(--text);
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--divider);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.block-title {
    font-size: 15px;
    color: var(--text-muted);
    margin: 22px 0 8px;
}

.block-title:first-of-type {
    margin-top: 0;
}

.modal-footer form {
    display: inline-flex;
}

/* Le bouton d'action d'un tableau peut être un lien : il doit
   garder l'apparence du bouton icône. */
a.btn-icon:hover {
    text-decoration: none;
}

/* La barre latérale repliée ne doit pas rogner le bouton de
   déconnexion, qui vit dans un formulaire. */
.sidebar-footer form {
    display: flex;
}

@media (max-width: 900px) {
    .kb-editor { min-height: 40vh; }
}

/* ─── Membres ────────────────────────────────────────────────── */

.inline-form {
    display: inline-flex;
}

/* Sélecteur de rôle posé dans une cellule de tableau : même famille
   que les champs, mais compact et sans remplissage plein. */
.select-inline {
    height: 32px;
    padding: 0 34px 0 10px;
    font-size: 13px;
    background-color: transparent;
    background-position: right 8px center;
    border-color: var(--border-soft);
    width: auto;
    min-width: 120px;
}

.select-inline:focus {
    border-color: var(--red);
    background-color: var(--surface);
}

/* ─── Écrans d'installation et de connexion ──────────────────── */

.gate-note {
    margin-top: 18px;
    font-size: 12.5px;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.6;
}

.login-card .form-group:last-of-type {
    margin-bottom: 30px;
}

/* ─── Comparaison de versions ────────────────────────────────── */

.diff {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    overflow: hidden;
}

.diff-line {
    display: flex;
    align-items: flex-start;
    font-size: 13px;
    line-height: 1.6;
    border-bottom: 1px solid var(--divider);
}

.diff-line:last-child {
    border-bottom: none;
}

.diff-num {
    flex: 0 0 52px;
    padding: 4px 10px;
    text-align: right;
    color: var(--text-light);
    background: var(--bg);
    border-right: 1px solid var(--border-soft);
    font-variant-numeric: tabular-nums;
    user-select: none;
}

.diff-sign {
    flex: 0 0 20px;
    padding: 4px 0 4px 8px;
    color: var(--text-light);
    user-select: none;
}

.diff-text {
    flex: 1;
    padding: 4px 12px 4px 0;
    white-space: pre-wrap;
    word-break: break-word;
    min-width: 0;
}

.diff-add             { background: var(--success-bg); }
.diff-add .diff-sign,
.diff-add .diff-text  { color: var(--success-text); }

.diff-del             { background: var(--red-light); }
.diff-del .diff-sign,
.diff-del .diff-text  { color: var(--red); }

/* Rupture entre deux blocs modifiés distants. */
.diff-gap {
    height: 12px;
    background: var(--bg);
}

.diff-gap .diff-num {
    height: 12px;
    padding: 0 10px;
}

.diff-count {
    border-radius: var(--radius);
    padding: 1px 8px;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.diff-count-add { background: var(--success-bg); color: var(--success-text); }
.diff-count-del { background: var(--red-light);  color: var(--red); }

/* Ligne d'état sous un champ : d'où vient la valeur en vigueur. */
.field-note {
    margin-top: 8px;
    font-size: 12.5px;
    color: var(--text-muted);
}
