/* greehill — espace greehill (outil interne) : charte greehill, version outil */
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("/assets/fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("/assets/fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("/assets/fonts/inter-latin-700-normal.woff2") format("woff2"); }
:root {
  --bg: #f5f6f3; --surface: #fff; --field: #fff; --ink: #111511; --muted: #5d685f; --line: #e2e6df;
  --green-ink: #4f6354; --tile: rgba(172, 191, 173, .32);
  --btn: #fff; --btn-ink: #111511; --primary: #000; --primary-ink: #fff; --hover: #000;
  --ok: #08795c; --ok-soft: #e3f5ef; --info: #1d5fa8; --info-soft: #e6f0fb; --warn: #9a5800; --warn-soft: #fff1df; --danger: #c23a37;
  --gradient: linear-gradient(110deg, #839788 0%, #e9ddc6 100%); --top-ink: #000; --top-hover: rgba(255,255,255,.6);
  color-scheme: light;
}
/* Mode sombre : réglage du système, ou choix forcé via le bouton de l'en-tête */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1411; --surface: #171e19; --field: #1d2620; --ink: #e4ebe5; --muted: #98a89c; --line: #2a352d;
    --green-ink: #a9c2ae; --tile: rgba(131, 151, 136, .18);
    --btn: #1d2620; --btn-ink: #e4ebe5; --primary: #e4ebe5; --primary-ink: #0f1411; --hover: #a9c2ae;
    --ok: #6fd3a8; --ok-soft: #173126; --info: #8fbcf0; --info-soft: #172638; --warn: #f0b265; --warn-soft: #33271a; --danger: #ef8a80;
    --gradient: linear-gradient(110deg, #3b4a40 0%, #5a5447 100%); --top-ink: #eef2ee; --top-hover: rgba(255,255,255,.12);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1411; --surface: #171e19; --field: #1d2620; --ink: #e4ebe5; --muted: #98a89c; --line: #2a352d;
  --green-ink: #a9c2ae; --tile: rgba(131, 151, 136, .18);
  --btn: #1d2620; --btn-ink: #e4ebe5; --primary: #e4ebe5; --primary-ink: #0f1411; --hover: #a9c2ae;
  --ok: #6fd3a8; --ok-soft: #173126; --info: #8fbcf0; --info-soft: #172638; --warn: #f0b265; --warn-soft: #33271a; --danger: #ef8a80;
  --gradient: linear-gradient(110deg, #3b4a40 0%, #5a5447 100%); --top-ink: #eef2ee; --top-hover: rgba(255,255,255,.12);
  color-scheme: dark;
}
[hidden] { display: none !important; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 14px/1.5 "Inter", "Segoe UI", system-ui, sans-serif; padding-inline: 16px; }
a { color: var(--ink); }
h1, h2, h3 { font-weight: 600; letter-spacing: -.015em; margin: 0; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.05rem; margin-bottom: 12px; }
h3 { font-size: .95rem; margin: 14px 0 6px; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; background: var(--field); color: var(--ink); width: 100%; min-width: 0; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--primary); }
textarea { resize: vertical; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.nowrap { white-space: nowrap; }
.eyebrow { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--green-ink); display: flex; gap: 8px; align-items: center; }

.top { background: var(--gradient); margin-inline: -16px; padding: 10px 16px; }
.top-in { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.top { color: var(--top-ink); }
.top a { color: var(--top-ink); }
.top .logo { width: 108px; color: var(--top-ink); display: block; }
.top .logo svg { width: 100%; height: auto; display: block; }
.top .space { font-weight: 600; border-left: 1px solid currentColor; padding-left: 14px; opacity: .85; }
.top nav { display: flex; gap: 4px; flex-wrap: wrap; }
.top nav a { text-decoration: none; padding: 6px 12px; border-radius: 999px; font-weight: 600; }
.top nav a[aria-current="page"], .top nav a:hover { background: var(--top-hover); }
.top .who { margin-left: auto; font-size: .82rem; }

.wrap { max-width: 1200px; margin: 0 auto; padding-block: 24px 60px; display: grid; gap: 18px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 15px; padding: 18px 20px; }
.btn { border: 1px solid var(--line); background: var(--btn); color: var(--btn-ink); border-radius: 999px; padding: 8px 16px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block; white-space: nowrap; }
.btn:hover { border-color: var(--hover); }
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.icon-btn { border: 0; background: transparent; font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--muted); padding: 2px 6px; }
.icon-btn:hover { color: var(--danger); }
.link-danger { border: 0; background: none; color: var(--danger); cursor: pointer; text-decoration: underline; padding: 0; }
.danger-zone { text-align: right; }
.alert { background: var(--warn-soft); border: 1px solid var(--danger); border-radius: 10px; padding: 10px 14px; margin: 0; }
.notice { background: var(--ok-soft); border-radius: 10px; padding: 10px 14px; margin: 0; }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: 15px; padding: 30px; text-align: center; color: var(--muted); }
blockquote { margin: 8px 0; padding: 8px 14px; border-left: 3px solid var(--green-ink); background: var(--bg); border-radius: 0 8px 8px 0; }

.st { display: inline-block; font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.st.muted { background: var(--bg); color: var(--muted); }
.st.info { background: var(--info-soft); color: var(--info); }
.st.ok { background: var(--ok-soft); color: var(--ok); }
.st.warn { background: var(--warn-soft); color: var(--warn); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.list thead th { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--green-ink); background: var(--bg); font-weight: 700; }
table.list tbody tr:last-child td { border-bottom: 0; }
table.list.num td, table.list.num th { text-align: right; font-variant-numeric: tabular-nums; }
table.list.num td:first-child, table.list.num th:first-child, table.list.num td:nth-child(2), table.list.num th:nth-child(2) { text-align: left; }
tr.total td { font-weight: 700; }
tr.sub td { color: var(--muted); font-size: .84rem; }
td.c { text-align: center; }
table.cat input { padding: 5px 7px; }
table.cat details textarea { margin-top: 6px; font-size: .82rem; }
.w-label { min-width: 220px; }
.w-s { width: 80px; }
.w-n { width: 78px; text-align: right; }
.w-q { width: 130px; text-align: right; }

.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid .wide { grid-column: 1 / -1; }
.f { display: grid; gap: 5px; align-content: start; min-width: 0; }
.f label, .f legend { font-size: .8rem; font-weight: 600; }
fieldset.f { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
fieldset.f legend { width: 100%; margin-bottom: 4px; }
.choice { display: inline-flex; gap: 7px; align-items: center; font-weight: 400 !important; font-size: .86rem; cursor: pointer; }
.row { display: flex; gap: 8px; }
.login { max-width: 380px; margin: 40px auto; background: var(--surface); border-radius: 15px; padding: 26px; border: 1px solid var(--line); display: grid; gap: 10px; }
.stack { display: grid; gap: 8px; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { font-family: ui-monospace, Menlo, monospace; font-size: .84rem; }
form.inline { display: flex; gap: 8px; align-items: center; }
form.inline input { width: 220px; }

/* Éditeur de lignes */
.lines { display: grid; gap: 10px; margin-bottom: 14px; }
.line-ed { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 6px; background: var(--surface); }
.line-ed.off { background: var(--bg); }
.line-ed .l1 { display: grid; grid-template-columns: minmax(220px, 2fr) 150px 170px 170px minmax(140px, 1fr) 32px; gap: 8px; align-items: center; }
.line-ed .l1 select { width: 100%; }
.line-ed .l1 select[data-k="key"] { width: 100%; font-weight: 600; }
.line-ed .l2 { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: .84rem; }
.line-ed .lbl { color: var(--muted); font-size: .78rem; }
.line-ed .sep { width: 1px; height: 18px; background: var(--line); margin-inline: 4px; }
.line-ed .w-n { width: 64px; padding: 4px 6px; }
.line-ed .yr { display: inline-flex; gap: 4px; align-items: center; }
.line-ed .amt { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; align-self: center; }
.mini-f { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--muted); white-space: nowrap; }
.mini-f.grow { flex: 1; min-width: 240px; }
.mini-f.grow input { flex: 1; }
.line-ed .l1 .mini-f input { width: 100%; }
.mini-f input { font-size: .86rem; color: var(--ink); }
#add-key { width: auto; max-width: 340px; }

@media (max-width: 860px) {
  .form-grid { grid-template-columns: 1fr; }
  .line-ed .l1 { grid-template-columns: 1fr 1fr; }
  .line-ed .l1 > :first-child { grid-column: 1 / -1; }
  .top .who { margin-left: 0; }
}
tr.total td:last-child { text-align: right !important; }

.theme-btn { border: 1px solid currentColor; background: transparent; color: var(--top-ink); border-radius: 999px; padding: 4px 10px; font-size: .78rem; font-weight: 600; cursor: pointer; opacity: .85; }
.theme-btn:hover { opacity: 1; }

/* ---------- plateforme : sous-navigation, accueil, réglages ---------- */
.top .who a[aria-current="page"] { text-decoration: underline; text-underline-offset: 3px; }
.subnav { margin-inline: -16px; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.subnav-in { max-width: 1200px; margin: 0 auto; display: flex; gap: 2px; flex-wrap: wrap; }
.subnav a { text-decoration: none; padding: 10px 12px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subnav a:hover { color: var(--ink); }
.subnav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
body.wide .wrap, body.wide .top-in, body.wide .subnav-in { max-width: 1440px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.tile { display: block; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; padding: 18px 20px; position: relative; overflow: hidden; }
.tile::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--gradient); }
.tile:hover { border-color: var(--hover); }
.tile h2 { font-size: 1.2rem; margin: 4px 0 4px; }
.tile p { margin: 0; color: var(--muted); }
.tile .kpis { display: flex; gap: 18px; margin-top: 14px; flex-wrap: wrap; }
.tile .kpi b { display: block; font-size: 1.35rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.tile .kpi span { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.links { display: flex; gap: 8px; flex-wrap: wrap; }
.links a { font-size: .85rem; }

.flash { background: var(--ok-soft); color: var(--ok); border-radius: 10px; padding: 10px 14px; font-weight: 600; }
.alert.danger { background: rgba(194, 58, 55, .1); color: var(--danger); }
.stack { display: grid; gap: 10px; }
.stack label { font-weight: 600; font-size: .85rem; }
.narrow { max-width: 560px; }
.qr { background: #fff; padding: 12px; border-radius: 12px; display: inline-block; line-height: 0; }
.qr svg { width: 196px; height: 196px; display: block; }
.secret { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .95rem; letter-spacing: .08em; background: var(--field); border: 1px dashed var(--line); padding: 6px 10px; border-radius: 8px; display: inline-block; word-break: break-all; }
.code-input { font-size: 1.6rem; letter-spacing: .4em; text-align: center; max-width: 220px; font-variant-numeric: tabular-nums; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; align-items: start; }
.checks { display: flex; gap: 14px; flex-wrap: wrap; }
.checks label { display: inline-flex; gap: 6px; align-items: center; font-weight: 400; }
.src-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); margin-right: 6px; vertical-align: middle; }
.src-dot.ok { background: var(--ok); } .src-dot.err { background: var(--danger); } .src-dot.off { background: transparent; border: 1px dashed var(--muted); }
table.list td.secret-cell { font-family: ui-monospace, Menlo, monospace; }
details.help { font-size: .85rem; color: var(--muted); }
details.help summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.row2 { display: grid; grid-template-columns: 110px 1fr; gap: 6px; }
.form-grid.inner { padding: 0; border: 0; background: none; grid-template-columns: 140px 1fr 1fr 1fr; }
@media (max-width: 860px) { .form-grid.inner { grid-template-columns: 1fr; } }
.mail-grid { display: grid; grid-template-columns: 80px 1fr; gap: 8px 12px; align-items: start; margin-bottom: 12px; }
.mail-grid > label { font-weight: 600; padding-top: 8px; }
.mail-grid textarea { width: 100%; font: inherit; line-height: 1.5; }
@media (max-width: 700px) { .mail-grid { grid-template-columns: 1fr; } .mail-grid > label { padding-top: 0; } }
.ms-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.ms-btn svg { width: 18px; height: 18px; }
.login details.help form { margin-top: 10px; }
/* Connexion rapide : clé d'accès (Touch ID…) et appareil de confiance */
.pk-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.pk-btn svg { width: 20px; height: 20px; }
.pk-btn[hidden] { display: none; }
.alert-soft { color: var(--danger); margin: 0; min-height: 0; }
.alert-soft:empty { display: none; }
.login .check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; line-height: 1.35; }
.login .check input { margin-top: 3px; width: auto; }
.devices { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.devices li { display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.devices li form { margin: 0; }
.devices .tag { font-size: .75rem; background: var(--ok-soft, #e3f5ef); color: var(--ok, #08795c); border-radius: 6px; padding: 1px 6px; margin-left: 6px; }
.login .or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .82rem; margin: 4px 0 0; }
.login .or::before, .login .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.login .or[hidden] { display: none; }
.login .pk-aide { margin: -2px 0 0; }
#pk-login[hidden] + .pk-aide { display: none; }
.import-card { display: grid; gap: 10px; margin-bottom: 16px; }
.import-card .actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
table.list td.num, table.list th.num { text-align: right; font-variant-numeric: tabular-nums; }
