/* Feuille de style du site d'administration, reprise de celui d'Amis Golfeurs, aux couleurs de
   CoproClaire (le bleu de l'application, client/lib/ui.dart). CSS maison, sans framework. */
:root {
    --bleu: #1F4E79;
    --bleu-fonce: #163a5b;
    --texte: #14202E;
    --discret: #5A6B7D;
    --fond: #F5F7FA;
    --bord: #D5DDE6;
    --danger: #B42318;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--texte);
    background: var(--fond);
}

h1 { font-size: 1.6rem; margin: 0 0 24px; }
h1:focus { outline: none; }
h2 { font-size: 1.15rem; margin: 32px 0 12px; }

a { color: var(--bleu); }

.discret { color: var(--discret); font-size: 0.9rem; }

.carte {
    background: #fff;
    border: 1px solid var(--bord);
    border-radius: 12px;
    padding: 20px 24px;
}

.tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.tuile { text-decoration: none; color: inherit; }
.tuile .valeur { font-size: 2rem; font-weight: 700; color: var(--bleu); }

.tableau { overflow-x: auto; background: #fff; border: 1px solid var(--bord); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--bord); white-space: nowrap; }
th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--discret); }
tr:last-child td { border-bottom: none; }
tr.total td { font-weight: 700; }
/* Cellule à plusieurs lignes (les copropriétés d'un compte) : elle peut passer à la ligne. */
td.multiligne { white-space: normal; min-width: 240px; }

.pastille { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.8rem; background: #e6edf4; }
.pastille.alerte { background: #fbe9e7; color: var(--danger); }

button, .bouton {
    font: inherit;
    border: none;
    border-radius: 10px;
    padding: 10px 18px;
    cursor: pointer;
    background: var(--bleu);
    color: #fff;
    text-decoration: none;
    display: inline-block;
}
button.secondaire, .bouton.secondaire { background: #fff; color: var(--texte); border: 1px solid var(--bord); }
button.link { background: none; padding: 0; border-radius: 0; }

.erreur { background: #fbe9e7; color: var(--danger); border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; }

.centre { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }

label { display: block; font-weight: 600; margin: 16px 0 6px; }
input[type=email], input[type=password], input[type=text], input[type=search], select {
    width: 100%;
    font: inherit;
    padding: 10px 12px;
    border: 1px solid var(--bord);
    border-radius: 10px;
    background: #fff;
    color: var(--texte);
}
.validation-message { color: var(--danger); font-size: 0.85rem; margin-top: 4px; }

.actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }

.recherche { margin-bottom: 16px; max-width: 480px; }

/* Filtres de l'utilisation de l'IA : une grille de champs, la recherche sur toute la largeur. */
.filtres { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; margin-bottom: 8px; }
.filtres label { margin-top: 12px; }
.filtres .large, .filtres .actions { grid-column: 1 / -1; }
.filtres .actions { margin-top: 16px; }

/* Fiche d'une requête : des couples libellé / valeur. */
.fiche { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 24px; }
.fiche .discret { display: block; margin-bottom: 2px; }

/* JSON de la requête et de la réponse : lisible, défilant, sans faire déborder la page. */
pre.json, pre.brut {
    margin: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.82rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}
pre.json {
    background: #fff;
    border: 1px solid var(--bord);
    border-radius: 12px;
    padding: 16px 18px;
    max-height: 70vh;
    overflow: auto;
}

/* Tri par colonne (recherche.js) : l'en-tête se clique, la flèche dit le sens. */
table.triable th { cursor: pointer; user-select: none; }
table.triable th:hover { color: var(--bleu-fonce); }
table.triable th[data-ordre="asc"]::after { content: " ▲"; font-size: 0.7em; }
table.triable th[data-ordre="desc"]::after { content: " ▼"; font-size: 0.7em; }
