/* Back-office GAB Finder — feuille unique, l'outil compte six pages. */

:root {
    --ink: #0e1b16;
    --muted: #6b7b76;
    --rule: #e3e8e6;
    --ground: #f5f7f8;
    --surface: #ffffff;
    --primary: #0f7b5f;
    --primary-soft: #e3f4ee;
    --warn: #f4a118;
    --danger: #d9453c;
    --radius: 14px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--ground);
    color: var(--ink);
    font: 15px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ---------- barre haute ---------- */
.topbar {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 14px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--rule);
}

.brand { font-weight: 700; color: var(--primary); text-decoration: none; }
.topbar nav { display: flex; gap: 18px; flex: 1; }
.topbar nav a { color: var(--muted); text-decoration: none; font-weight: 500; }
.topbar nav a:hover { color: var(--ink); }
.topbar nav a.on { color: var(--primary); }
.logout button {
    background: none; border: 0; color: var(--muted);
    cursor: pointer; font: inherit; padding: 0;
}

main { max-width: 860px; margin: 0 auto; padding: 28px 24px 80px; }

h1 { font-size: 26px; margin: 0 0 18px; }
h2 { font-size: 19px; margin: 0 0 6px; }
h3 { font-size: 15px; margin: 26px 0 10px; }
.muted { color: var(--muted); }
.landmark { color: var(--muted); margin: 0; }

/* ---------- file de validation ---------- */
.queue-head { display: flex; align-items: center; justify-content: space-between; }
.badge {
    background: var(--primary-soft); color: var(--primary);
    padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
}

.card {
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 22px;
    margin-top: 18px;
}

.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }

.kind {
    padding: 5px 11px; border-radius: 999px;
    font-size: 12px; font-weight: 600; white-space: nowrap;
}
.kind-atm { background: var(--primary-soft); color: var(--primary); }
.kind-mm { background: #f8ebdc; color: #b45309; }

.facts {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 6px 16px;
    margin: 20px 0 0;
    font-size: 14px;
}
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

.map-links { display: flex; gap: 16px; margin-top: 18px; font-size: 14px; }
.map-links a { color: var(--primary); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
    text-align: left; font-size: 12px; text-transform: uppercase;
    letter-spacing: .06em; color: var(--muted); font-weight: 600;
    padding: 8px 10px; border-bottom: 1px solid var(--rule);
}
td { padding: 8px 10px; border-bottom: 1px solid var(--rule); }

/* ---------- actions ---------- */
.actions { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.actions button {
    border: 1px solid var(--rule); border-radius: 12px;
    padding: 12px 20px; font: inherit; font-weight: 600; cursor: pointer;
    background: var(--surface); color: var(--ink);
}
.actions button.ok { background: var(--primary); border-color: var(--primary); color: #fff; }
.actions button.ko { background: #fdecea; border-color: #f5c6c2; color: var(--danger); }
.actions button.neutral { color: var(--muted); }
.actions button:hover { filter: brightness(.96); }
.actions button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty h2 { color: var(--ink); }

/* ---------- tableau de bord ---------- */
.stats { display: flex; gap: 14px; flex-wrap: wrap; }
.stat {
    flex: 1 1 180px; background: var(--surface);
    border: 1px solid var(--rule); border-radius: var(--radius);
    padding: 20px; text-decoration: none; color: inherit;
    display: flex; flex-direction: column; gap: 4px;
}
.stat-value { font-size: 30px; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 13px; color: var(--muted); }
.stat-pending .stat-value { color: var(--warn); }

/* ---------- connexion ---------- */
body.centered { display: grid; place-items: center; min-height: 100vh; }
.login {
    background: var(--surface); border: 1px solid var(--rule);
    border-radius: 18px; padding: 32px; width: min(380px, 92vw);
}
.login h1 { color: var(--primary); margin-bottom: 2px; }
.login form { display: flex; flex-direction: column; gap: 6px; margin-top: 22px; }
.login label { font-size: 13px; font-weight: 600; color: var(--muted); margin-top: 8px; }
.login input {
    padding: 12px 14px; border: 1px solid var(--rule);
    border-radius: 12px; font: inherit;
}
.login input:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.login button {
    margin-top: 20px; padding: 13px; border: 0; border-radius: 12px;
    background: var(--primary); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
}
.error {
    background: #fdecea; color: var(--danger);
    padding: 10px 14px; border-radius: 10px; font-size: 14px;
}

.flash {
    padding: 12px 16px; border-radius: 10px; font-size: 14px; margin: 0 0 18px;
}
.ok-flash { background: var(--primary-soft); color: var(--primary); }

/* ---------- file de validation en tableau ---------- */
main.wide { max-width: 1240px; }

.tabs { display: flex; gap: 4px; margin: 18px 0 14px; border-bottom: 1px solid var(--rule); }
.tabs a {
    padding: 10px 16px; text-decoration: none; color: var(--muted);
    font-size: 14px; font-weight: 500; border-bottom: 2px solid transparent;
}
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.bulkbar {
    display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
    background: var(--surface); border: 1px solid var(--rule);
    border-radius: var(--radius); padding: 12px 16px; margin-bottom: 12px;
}
.selectall { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.selcount { font-size: 13px; color: var(--muted); flex: 1; }
.bulkactions { display: flex; gap: 8px; }
.bulkactions button {
    border: 1px solid var(--rule); border-radius: 10px; padding: 9px 16px;
    font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
    background: var(--surface); color: var(--ink);
}
.bulkactions button.ok { background: var(--primary); border-color: var(--primary); color: #fff; }
.bulkactions button.ko { background: #fdecea; border-color: #f5c6c2; color: var(--danger); }
.bulkactions button.neutral { color: var(--muted); }
.bulkactions button:hover { filter: brightness(.96); }

.tablewrap {
    overflow-x: auto; background: var(--surface);
    border: 1px solid var(--rule); border-radius: var(--radius);
}
table.grid { min-width: 900px; }
table.grid td { vertical-align: top; font-size: 13.5px; }
table.grid tbody tr:hover { background: var(--ground); }
table.grid .tick { width: 34px; }
table.grid .num { text-align: right; font-variant-numeric: tabular-nums; width: 60px; }
table.grid .sub { color: var(--muted); font-size: 12px; }
table.grid .landmark { max-width: 320px; }
table.grid .rowactions { white-space: nowrap; text-align: right; }

.mini {
    border: 1px solid var(--rule); border-radius: 8px; padding: 6px 11px;
    font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
    background: var(--surface); color: var(--ink); margin-left: 4px;
}
.mini.ok { color: var(--primary); border-color: #bfe0d4; }
.mini.ko { color: var(--danger); border-color: #f5c6c2; }
.mini:hover { filter: brightness(.96); }

.maplink { color: var(--primary); font-size: 12px; margin-right: 8px; }

.pager {
    display: flex; align-items: center; gap: 16px; justify-content: center;
    margin-top: 18px; font-size: 14px;
}
.pager a { color: var(--primary); text-decoration: none; font-weight: 600; }
.pager .disabled { color: var(--rule-strong, #c6cdc3); }
.pager .pageinfo { color: var(--muted); }
.warn-flash { background: #fef3e0; color: #8a5b08; }

/* ---------- enseignes et logos ---------- */
.logocell { width: 108px; }
.logocell img {
    max-width: 92px; max-height: 34px; object-fit: contain; display: block;
}
.noLogo {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 12px;
    background: var(--ground); color: var(--muted);
    font-size: 12px; font-weight: 700;
}
.uploadform { display: inline-flex; align-items: center; gap: 6px; }
.uploadform input[type=file] { width: 168px; font-size: 12px; }

/* ---------------------------------------------------------------------------
   Supervision : signalements, statistiques, extraction.
   --------------------------------------------------------------------------- */

/* Ce qui appelle une action se distingue du reste par sa bordure, pas par un
   fond criard : la page en compte deja assez. */
.alert-card {
    border-left: 4px solid #d9453c;
}

.badge-danger {
    background: #fdecea;
    color: #a52a23;
}

.pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.pill-ok     { background: #e6f6ec; color: #0d7a3d; }
.pill-warn   { background: #fdf0dc; color: #96600b; }
.pill-danger { background: #fdecea; color: #a52a23; }

/* Barre de proportion. Le texte est pose par-dessus le remplissage plutot qu'a
   cote : la colonne reste lisible meme etroite. */
.meter {
    position: relative;
    min-width: 92px;
    height: 20px;
    border-radius: 999px;
    background: #eef1f0;
    overflow: hidden;
}
.meter-fill {
    height: 100%;
    border-radius: 999px;
}
.meter-ok     { background: #b7e4c7; }
.meter-warn   { background: #f6d9a8; }
.meter-danger { background: #f5b7b2; }
.meter-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: #24352f;
}

/* Graphe d'activite, en CSS pur : deux series sur quinze points ne justifient
   pas d'embarquer une bibliotheque dans une page d'administration. */
.chart {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 10px 0 0;
    overflow-x: auto;
}
.chart-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 34px;
}
.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 92px;
}
.bar {
    display: block;
    width: 9px;
    border-radius: 3px 3px 0 0;
}
.bar-contrib { background: #0f7b5f; }
.bar-report  { background: #f4a118; }
.chart-label {
    font-size: 10px;
    color: #6b7b76;
    white-space: nowrap;
}

.legend {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    font-size: 12px;
    color: #6b7b76;
}
.dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-left: 10px;
}
.dot:first-child { margin-left: 0; }
.dot-contrib { background: #0f7b5f; }
.dot-report  { background: #f4a118; }

/* Filtres en ligne, alignes sur leur bouton. */
.filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 18px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #e3e8e6;
    border-radius: 14px;
}
.filters label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: #6b7b76;
}
.filters select {
    padding: 8px 10px;
    border: 1px solid #e3e8e6;
    border-radius: 10px;
    background: #fff;
    font-size: 14px;
    min-width: 160px;
}

/* Un lien qui declenche un telechargement doit se lire comme un bouton. */
.button-link {
    display: inline-block;
    padding: 9px 14px;
    border-radius: 10px;
    border: 1px solid #0f7b5f;
    color: #0f7b5f;
    background: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}
.button-link:hover {
    background: #e3f4ee;
}

/* L'identifiant d'appareil est tronque : il sert a reconnaitre un signaleur
   recurrent, pas a l'identifier. */
.device {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11px;
}

.pager .disabled {
    color: #b3bdb9;
}
.pageinfo {
    color: #6b7b76;
    font-size: 13px;
}
