/* GoDispo — feuille de style minimale (pas de dépendance externe, compatible CSP).
   L'interface complète sera conçue aux jours 6-7 du pilote. */

:root {
    --bg: #f4f6f8;
    --surface: #ffffff;
    --text: #1d2733;
    --muted: #5b6878;
    --border: #d5dbe2;
    --accent: #0b5cad;
    --accent-text: #ffffff;
    --danger-bg: #fdecec;
    --danger-text: #8a1c1c;
    --ok-bg: #e8f5ec;
    --ok-text: #1f5f33;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #12171d;
        --surface: #1b222b;
        --text: #e6ebf0;
        --muted: #9aa7b5;
        --border: #2f3a47;
        --accent: #4c9be8;
        --accent-text: #0d1117;
        --danger-bg: #3a1d1d;
        --danger-text: #f3b4b4;
        --ok-bg: #1b3324;
        --ok-text: #a9e2bb;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    background: var(--bg);
    color: var(--text);
}

.topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.brand { font-weight: 700; font-size: 1.15rem; color: var(--accent); }
.tenant-name { color: var(--muted); }
.nav { display: flex; gap: 1rem; }
.nav a { color: var(--text); text-decoration: none; }
.nav a:hover { color: var(--accent); }
.logout { margin-left: auto; display: flex; gap: 0.75rem; align-items: center; color: var(--muted); }

.page { max-width: 64rem; margin: 0 auto; padding: 1.5rem 1rem; }
.auth { display: flex; justify-content: center; padding: 3rem 1rem; }

.card {
    width: 100%;
    max-width: 26rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
}
.form-card { max-width: 32rem; margin-top: 2rem; }

h1 { font-size: 1.5rem; margin: 0 0 0.5rem; }
h2 { font-size: 1.2rem; margin: 0 0 0.75rem; }
.muted { color: var(--muted); }
small.muted { display: block; margin-top: 0.25rem; }

label { display: block; margin-top: 1rem; font-weight: 600; }
input, select {
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.6rem 0.7rem;
    font: inherit;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

button, .button {
    display: inline-block;
    margin-top: 1.25rem;
    padding: 0.6rem 1.2rem;
    font: inherit;
    font-weight: 600;
    color: var(--accent-text);
    background: var(--accent);
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
}
button.link {
    margin: 0;
    padding: 0;
    color: var(--accent);
    background: none;
    font-weight: 400;
    text-decoration: underline;
}

.alt-link { margin-top: 1.25rem; font-size: 0.9rem; }
.alt-link a { color: var(--accent); }

.errors { background: var(--danger-bg); color: var(--danger-text); border-radius: 6px; padding: 0.5rem 1rem; margin: 1rem 0; }
.errors ul { margin: 0; padding-left: 1.1rem; }
.notice { background: var(--ok-bg); color: var(--ok-text); border-radius: 6px; padding: 0.75rem 1rem; }

.qr { display: block; margin: 1rem auto; background: #ffffff; padding: 8px; border-radius: 6px; }
.secret { font-size: 1rem; word-break: break-all; }
.codes { columns: 2; list-style: none; padding: 0; font-size: 1.05rem; }

table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td { text-align: left; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; }

/* Connexion Microsoft Entra ID */
.sso .button { width: 100%; text-align: center; box-sizing: border-box; }
.sso-or { text-align: center; margin: 0.75rem 0 0; }
.sso-lookup { margin-top: 1.75rem; padding-top: 1rem; border-top: 1px solid var(--border, #ddd); }
button.secondary { background: none; color: var(--accent); border: 1px solid var(--accent); margin-top: 0.75rem; }

/* Travailleurs, listes et imports (pilote J2-3) */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.page-head .button { margin-top: 0; }
.section-title { margin-top: 2rem; }
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 1rem 0; }
.filters input { flex: 1 1 14rem; width: auto; margin: 0; }
.filters select { flex: 0 1 10rem; width: auto; margin: 0; }
.filters button { margin: 0; }
.table-wrap { overflow-x: auto; }
tr.inactive td { color: var(--muted); }
.tag { display: inline-block; padding: 0 0.4rem; margin-right: 0.2rem; font-size: 0.8rem; border: 1px solid var(--border); border-radius: 4px; }
.tag.warn { background: var(--danger-bg); color: var(--danger-text); border-color: transparent; }
td.actions { white-space: nowrap; }
td.actions form { display: inline; }
td.actions button.link { margin-right: 0.5rem; }
button.link:disabled { color: var(--muted); text-decoration: none; cursor: default; }
label.check { display: flex; gap: 0.5rem; align-items: center; font-weight: 400; }
label.check input { width: auto; margin: 0; }
.row { display: flex; gap: 1rem; }
.row > div { flex: 1; }
fieldset.shift-fields { margin-top: 1.25rem; padding: 0.5rem 1rem 1rem; border: 1px solid var(--border); border-radius: 6px; }
.cancel { margin-left: 1rem; color: var(--accent); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 1rem; margin: 1rem 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 0.75rem; margin: 1rem 0; }
.stats > div { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 0.6rem 0.8rem; }
.stats dt { color: var(--muted); font-size: 0.85rem; }
.stats dd { margin: 0; font-size: 1.4rem; font-weight: 700; }
ul.compact { columns: 2; font-size: 0.9rem; }
.legend { font-size: 0.85rem; }
.pagination { display: flex; gap: 1rem; justify-content: center; margin: 1rem 0; }
.pagination a { color: var(--accent); text-decoration: none; }
