/* Charte Nazzareno Systems : Spectral pour le texte, IBM Plex Mono pour les repères, vert
   pour l'accent. Les polices sont servies par l'instance, qui tourne sans accès extérieur. */
@font-face { font-family: "Spectral"; font-weight: 400; font-display: swap; src: url("fonts/spectral-400.woff2") format("woff2"); }
@font-face { font-family: "Spectral"; font-weight: 400; font-style: italic; font-display: swap; src: url("fonts/spectral-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Spectral"; font-weight: 500; font-display: swap; src: url("fonts/spectral-500.woff2") format("woff2"); }
@font-face { font-family: "Spectral"; font-weight: 600; font-display: swap; src: url("fonts/spectral-600.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url("fonts/ibmplexmono-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url("fonts/ibmplexmono-500.woff2") format("woff2"); }
:root {
  --bg: #f9f7f2; --surface: #fff; --ink: #201d18; --muted: #6b6457; --line: #ddd6c8;
  --accent: #2c5c42; --good: #2c5c42; --bad: #a33a2c; --warn-bg: #fbeae6;
  --warn: #b7791f; --warn-ink: #8a5a12;
  --side: #1f3f2d; --side-ink: #f1ede2; --side-muted: #a9bbae; --side-line: #35573f;
  --side-current: #2c5c42;
  --serif: "Spectral", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.5 var(--serif); }
a { color: var(--accent); }
main { max-width: 1040px; margin: 0 auto; padding: 24px 16px 64px; }
h1 { font-size: 1.9rem; font-weight: 500; line-height: 1.15; margin: 0 0 16px; }
h2 { font-size: 1.25rem; font-weight: 600; margin: 28px 0 12px; }
strong, b { font-weight: 600; }
.eyebrow, .label { font-family: var(--mono); font-size: .7rem; font-weight: 500; letter-spacing: .12em;
  text-transform: uppercase; }
.eyebrow { margin: 0 0 6px; color: var(--accent); }
.welcome, .shell main > .welcome { max-width: 46em; font-size: 1.05rem; }
.instance { background: #7a5b12; color: #fff; text-align: center; padding: 4px 16px; font-size: .9rem; }
.instance.demo { background: var(--ink); }

/* Cadre : colonne de gauche fixe, contenu à droite ; chacun défile de son côté. */
body.app { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.shell { flex: 1; min-height: 0; display: grid; grid-template-columns: 260px minmax(0, 1fr); }
.shell main { max-width: none; margin: 0; padding: 36px 44px 72px; overflow-y: auto; }
.shell main > * { max-width: 1120px; }
.top { overflow-y: auto; display: flex; flex-direction: column;
  gap: 20px; padding: 22px 0 16px; background: var(--side); color: var(--side-ink); }
.top > * { padding: 0 20px; }
.top .label { display: block; color: var(--side-muted); }
.brand { font-size: 1.3rem; font-weight: 600; line-height: 1.15; color: var(--side-ink); text-decoration: none; }
.top .metier { margin: 0; font-size: 1rem; }
.top .metier .label { margin-bottom: 4px; }
.top details.metier { position: relative; }
.top details.metier summary { list-style: none; cursor: pointer; padding: 9px 30px 10px 12px; border: 1px solid var(--side-line);
  border-radius: 6px; color: var(--side-ink); font-size: 1rem; line-height: 1.25; position: relative; }
.top details.metier summary::-webkit-details-marker { display: none; }
.top details.metier summary::after { content: ""; position: absolute; right: 13px; top: 50%; width: 7px; height: 7px;
  border-right: 1.5px solid var(--side-muted); border-bottom: 1.5px solid var(--side-muted);
  transform: translateY(-70%) rotate(45deg); }
.top details.metier[open] summary { border-color: var(--side-muted); }
.top details.metier summary:hover { border-color: var(--side-muted); }
.top details.metier form { position: absolute; z-index: 5; left: 20px; right: 20px; margin-top: 6px; padding: 6px;
  display: grid; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
  box-shadow: 0 10px 28px rgba(32, 29, 24, .22); }
.top details.metier button { text-align: left; padding: 7px 10px; border: 0; border-radius: 4px; background: none;
  color: var(--ink); font-size: .96rem; line-height: 1.25; }
.top details.metier button:hover { background: var(--bg); }
.top details.metier button[aria-current] { background: var(--accent); color: #fff; }
.top nav { display: grid; gap: 1px; padding: 0 10px; }
.top nav.main { flex: 0 0 auto; }
.top nav.system { margin-top: auto; }
.top nav .label { padding: 12px 10px 5px; }
.top nav.system .label { padding-top: 0; }
.top nav a { display: block; padding: 7px 10px; border-radius: 6px; border-left: 3px solid transparent;
  color: var(--side-ink); text-decoration: none; line-height: 1.3; }
.top nav a:hover { background: rgba(255, 255, 255, .07); }
.top nav a[aria-current] { background: var(--side-current); border-left-color: var(--side-ink); font-weight: 600; }
.top nav.system a { color: var(--side-muted); font-size: .95rem; padding-top: 5px; padding-bottom: 5px; }
.top nav.system a[aria-current] { color: var(--side-ink); }
.top .search input { width: 100%; padding: 7px 10px; font-size: .95rem; background: rgba(255, 255, 255, .08);
  border-color: var(--side-line); color: var(--side-ink); }
.top .search input::placeholder { color: var(--side-muted); }
.who { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px;
  padding-top: 14px; border-top: 1px solid var(--side-line); font-size: .95rem; }
.top .who { margin: 0 20px; padding-left: 0; padding-right: 0; }
.who a { color: var(--side-ink); text-decoration: none; font-weight: 600; }
.who button.link { color: var(--side-muted); font-size: .9rem; }
.who a:hover, .who button.link:hover { text-decoration: underline; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 20px; }
.card h2:first-child, .card h1:first-child { margin-top: 0; }
.card.narrow { max-width: 440px; margin: 24px auto; }
.card.narrow.center { margin: 12vh auto 24px; }
.card.good { border-left: 6px solid var(--good); }
.card.bad { border-left: 6px solid var(--bad); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.tool { color: inherit; text-decoration: none; }
.tool:hover { border-color: var(--accent); }
.tool { display: flex; flex-direction: column; gap: 8px; border-top: 3px solid var(--accent); }
.tool h2 { margin: 0; font-size: 1.3rem; font-weight: 500; color: var(--ink); }
.tool .open { margin-top: auto; padding-top: 8px; font-family: var(--mono); font-size: .7rem; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.tool .open::after { content: " →"; }
.tool p { margin: 0; color: var(--muted); }
.muted { color: var(--muted); font-size: .92rem; }
.alert { background: var(--warn-bg); border: 1px solid var(--bad); color: var(--bad);
  border-radius: 6px; padding: 10px 12px; }
.stack { display: grid; gap: 14px; }
label { display: grid; gap: 4px; font-size: .92rem; color: var(--muted); }
input, select { font: inherit; color: var(--ink); padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 6px; background: #fff; min-width: 0; }
button { font: inherit; cursor: pointer; padding: 9px 16px; border: 1px solid var(--accent);
  border-radius: 6px; background: var(--accent); color: #fff; }
button.secondary { background: #fff; color: var(--accent); }
button.small { padding: 5px 10px; font-size: .9rem; }
button.link { background: none; border: 0; padding: 0; color: var(--accent); }
.inline { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-bottom: 16px; }
table { width: 100%; border-collapse: collapse; background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; display: block; overflow-x: auto; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--mono); font-size: .68rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions form { display: flex; gap: 6px; }
.state { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .85rem;
  border: 1px solid var(--line); margin-right: 6px; }
.state.done { color: var(--good); border-color: var(--good); }
.state.failed { color: var(--bad); border-color: var(--bad); }
.state.running { color: var(--accent); border-color: var(--accent); }
.checks { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; }
.checks li::before { content: "●"; margin-right: 8px; }
.checks .good::before { color: var(--good); }
.checks .bad::before { color: var(--bad); }
label.check { display: flex; align-items: center; gap: 8px; }
textarea { font: inherit; color: var(--ink); padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 6px; background: #fff; min-width: 0; }
.alert.notice { background: #eef3ee; border-color: var(--accent); color: var(--ink); }
.tabs { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0 0 20px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 6px 0; text-decoration: none; border-bottom: 3px solid transparent; }
.tabs a.current { border-bottom-color: var(--accent); font-weight: 600; }
ul.plain { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 8px 32px; }
.agenda li, .task { background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 14px; }
.task { display: flex; gap: 12px; align-items: flex-start; }
.task > div { flex: 1; min-width: 0; }
.done strong { text-decoration: line-through; color: var(--muted); }
.note { margin: 4px 0 0; white-space: pre-line; }
details { margin-top: 8px; }
details summary { cursor: pointer; color: var(--accent); font-size: .92rem; }
details form { margin-top: 10px; }
.state.brouillon { color: var(--muted); border-style: dashed; }
.state.en_cours { color: var(--accent); border-color: var(--accent); }
.state.suivi { color: var(--good); border-color: var(--good); }
.state.annulee { color: var(--bad); border-color: var(--bad); }
.summary { margin-top: 12px; }
.exchange { background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 14px; }
.exchange.reserve { border-left: 6px solid var(--bad); }
.exchange.reserve.traitee { border-left-color: #b7791f; }
.exchange.reserve.levee { border-left-color: var(--good); }
.exchange p { margin: 0 0 6px; }
.exchange .answer { margin-top: 8px; padding-left: 12px; border-left: 3px solid var(--line); }
.state.reserve-ouverte { color: var(--bad); border-color: var(--bad); }
.state.reserve-traitee { color: #8a5a12; border-color: #b7791f; }
.state.reserve-levee { color: var(--good); border-color: var(--good); }
.qr { width: fit-content; margin: 16px auto; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.qr svg { display: block; }
.key { font-size: 1rem; color: var(--ink); white-space: nowrap; }
.codes { list-style: none; padding: 0; margin: 16px 0; columns: 2; font-family: var(--mono); font-size: 1.05rem; line-height: 1.9; }
.day { margin: -10px 0 20px; }
.day::first-letter { text-transform: uppercase; }
.alerts { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.alerts li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; background: var(--surface);
  border: 1px solid var(--line); border-left: 6px solid #b7791f; border-radius: 8px; padding: 10px 14px; }
.alerts .level { flex: 0 0 7.5em; font-size: .78rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: #8a5a12; }
.alerts .level + * { flex: 1 1 16em; min-width: 0; overflow-wrap: anywhere; }
.alerts .alerte { border-left-color: var(--bad); }
.alerts .alerte .level { color: var(--bad); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px;
  min-width: 0; }
.tile.attention { border-left: 6px solid #b7791f; }
.tile.alerte { border-left: 6px solid var(--bad); }
.tile h3 { margin: 0; font-size: .92rem; font-weight: 600; }
.tile a, .alerts a { text-decoration: none; }
.tile a:hover, .alerts a:hover { text-decoration: underline; }
.tile .value { margin: 2px 0 0; font-size: 1.9rem; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.tile ul { list-style: none; padding: 10px 0 0; margin: 10px 0 0; border-top: 1px solid var(--line);
  display: grid; gap: 4px; font-size: .92rem; overflow-wrap: anywhere; }
.tile .origin { margin: 0 0 2px; font-size: .78rem; color: var(--muted); }
.quiet-tiles { list-style: none; padding: 0; margin: 12px 0 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; }
.tiles + .quiet-tiles { margin-top: 16px; }
.quiet-tile { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; padding: 9px 14px;
  border-bottom: 1px solid var(--line); font-size: .92rem; }
.quiet-tile:last-child { border-bottom: 0; }
.quiet-tile a, .quiet-tile strong { flex: 0 0 13em; font-weight: 600; text-decoration: none; }
.quiet-tile a:hover { text-decoration: underline; }
.quiet-tile .value { font-weight: 700; }
.shortcuts, .activity, .hits { list-style: none; padding: 0; margin: 0 0 12px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; }
.shortcuts li, .activity li, .hits li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px;
  padding: 9px 14px; border-bottom: 1px solid var(--line); }
.shortcuts li:last-child, .activity li:last-child, .hits li:last-child { border-bottom: 0; }
.shortcuts a, .hits a { font-weight: 600; text-decoration: none; }
.activity .what { flex: 1 1 12em; }
.invitation { margin-bottom: 20px; }
.invitation input { width: 100%; font-family: var(--mono); font-size: .92rem; }
.hits .kind { flex: 0 0 6em; font-size: .78rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted); }
.hits .kind + * { min-width: 0; overflow-wrap: anywhere; }
.count { display: inline-block; min-width: 1.6em; padding: 0 7px; border-radius: 999px; background: var(--line);
  font-size: .82rem; font-weight: 600; text-align: center; vertical-align: 2px; }
.late-count { font-size: .92rem; font-weight: 400; color: var(--bad); }
#a-faire h3, #chiffres h3 { font-size: 1rem; margin: 20px 0 8px; }
.todo { gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.todo li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 16px; padding: 10px 16px;
  border-bottom: 1px solid var(--line); border-left: 6px solid var(--line); }
.todo li:first-child { border-top-left-radius: 7px; }
.todo li:last-child { border-bottom: 0; border-bottom-left-radius: 7px; }
.todo li.due, .todo li.today { border-left-color: var(--warn); }
.todo li.soon { border-left-color: var(--accent); }
.todo li.late, .todo li.urgent { border-left-color: var(--bad); }
.todo .when { flex: 0 0 9.5em; font-variant-numeric: tabular-nums; color: var(--muted); }
.todo li.today .when { color: var(--warn-ink); font-weight: 600; }
.todo li.late .when, .todo li.urgent .when { color: var(--bad); font-weight: 600; }
.todo .what { flex: 1 1 240px; min-width: 0; overflow-wrap: anywhere; }
.todo .origin, .watch .origin, .alerts .origin { flex: 0 0 auto; font-size: .82rem; }
.todo a { text-decoration: none; font-weight: 600; }
.todo a:hover, .watch a:hover { text-decoration: underline; }
.todo form { flex: 0 0 auto; margin: 0; }
.alerts .what { flex: 1 1 16em; min-width: 0; overflow-wrap: anywhere; }
.watch { gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; font-size: .92rem; }
.watch li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 16px; padding: 8px 16px;
  border-bottom: 1px solid var(--line); }
.watch li:last-child { border-bottom: 0; }
.watch .what { flex: 1 1 240px; min-width: 0; overflow-wrap: anywhere; }
.watch a { text-decoration: none; }
.tile h4 { margin: 0; font-size: .92rem; font-weight: 600; }
@media (max-width: 860px) {
  body.app { height: auto; display: block; overflow: visible; }
  .shell { display: block; }
  .shell main { padding: 24px 16px 64px; overflow: visible; }
  .top { overflow: visible; gap: 12px; padding: 14px 0 12px; }
  .top > * { padding: 0 16px; }
  .top nav { display: flex; flex-wrap: nowrap; gap: 4px; overflow-x: auto; white-space: nowrap; padding: 0 8px; }
  .top nav .label { display: none; }
  .top nav.system { margin-top: 0; }
  .top details.metier form { left: 16px; right: 16px; }
  .top .who { margin: 0 16px; padding-top: 10px; }
  .todo .when { flex-basis: 100%; }
}
