:root {
  --ink: #16181d; --ink-2: #3a3f47; --muted: #5b616b; --line: #e2e3de; --line-2: #eeefea;
  --ground: #f6f6f3; --card: #fff; --accent: #0b5f6b; --accent-soft: #eaf2f3; --hover: #ecede8;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif; color: var(--ink); background: var(--ground);
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.45; }
a { color: var(--accent); }
a:hover { color: #084852; }
h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.01em; }
h2 { margin: 0 0 8px; font-size: 16px; font-weight: 600; }
.mono { font-family: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace; font-size: 12.5px; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Shell and navigation */
.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.nav { flex: 1 1 240px; max-width: 100%; background: var(--card); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 22px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; text-decoration: none; color: var(--ink); }
.brand small, .me small { display: block; font-size: 12px; color: var(--muted); }
.logo { width: 32px; height: 32px; border-radius: 8px; background: var(--accent); display: flex; align-items: center; justify-content: center; }
.sections { display: flex; flex-direction: column; gap: 2px; }
.section-link, .page-link { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 8px; text-decoration: none; color: var(--ink-2); font-size: 14px; font-weight: 600; }
.section-link:hover, .page-link:hover { background: var(--hover); color: var(--ink); }
.section-link.on { background: var(--ink); color: #fff; }
.pages { display: flex; flex-direction: column; gap: 2px; margin: 4px 0 10px 18px; padding-left: 10px; border-left: 1px solid var(--line); }
.page-link { font-weight: 500; font-size: 13.5px; padding: 0 10px; }
.page-link.on { background: var(--hover); color: var(--ink); font-weight: 600; }
.page-link.soon::after { content: "bientôt"; margin-left: auto; font-size: 11px; color: var(--muted); }
.me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid var(--line-2); }
.me-text { flex: 1; min-width: 0; font-size: 14px; }
.avatar { width: 32px; height: 32px; border-radius: 999px; background: #e2eef7; color: #164e78; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none; }
.icon-btn { width: 44px; height: 44px; border: 0; background: none; border-radius: 8px; color: var(--ink-2); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: var(--hover); }

.main { flex: 999 1 560px; min-width: 0; padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 20px; }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.head p { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.flash { padding: 12px 16px; border-radius: 10px; background: var(--accent-soft); border: 1px solid #c9dee1; font-size: 14px; }
.note { padding: 12px 16px; border-radius: 10px; background: #fbf3e6; border: 1px solid #edd3ae; font-size: 14px; }

/* Cards, grids, tables */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; min-width: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.row > .card { flex: 1 1 420px; }
.kpi { text-decoration: none; color: var(--ink); display: block; }
.kpi .label { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi .value { font-size: 30px; font-weight: 700; margin-top: 6px; }
.kpi .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { font-size: 14px; padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.empty { padding: 28px; border: 1px dashed #d5d7d0; border-radius: 10px; text-align: center; color: var(--muted); font-size: 14px; }
dl.kv { margin: 0; display: grid; grid-template-columns: minmax(130px, auto) 1fr; gap: 9px 16px; font-size: 14px; }
dl.kv dt { color: var(--muted); font-size: 13px; }
dl.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* Badges, bars, steps */
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.ok { background: #e3f2ea; color: #17603a; } .run { background: #e2eef7; color: #164e78; } .wait { background: #f0eee7; color: #55503f; }
.warn { background: #fbebd9; color: #8a4a0c; } .err { background: #fbe3e1; color: #9a2a20; }
.bar { height: 6px; border-radius: 3px; background: var(--line-2); flex: 1; }
.bar > span { display: block; height: 6px; border-radius: 3px; background: #164e78; }
.segs { display: flex; gap: 3px; }
.seg { width: 18px; height: 6px; border-radius: 2px; background: var(--line); }
.seg.f { background: var(--accent); }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; gap: 14px; padding-bottom: 16px; }
.dot { flex: none; width: 14px; height: 14px; border-radius: 999px; margin-top: 4px; background: var(--line); }
.dot.ok { background: #17603a; } .dot.err { background: #9a2a20; } .dot.run { background: #164e78; }

/* Forms and buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 8px; font: inherit; font-size: 14px; font-weight: 600; text-decoration: none; background: var(--card); color: var(--ink); border: 1px solid #d5d7d0; cursor: pointer; }
.btn:hover { border-color: var(--accent); color: var(--ink); }
.btn.pri { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 13px; }
.inline { display: inline; }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label, .field .label { font-size: 12px; font-weight: 600; color: var(--muted); }
.field input, .field select, .field textarea, .filters input, .filters select { min-height: 44px; padding: 0 12px; border: 1px solid #d5d7d0; border-radius: 8px; font: inherit; font-size: 14px; background: var(--card); color: var(--ink); }
.field textarea { padding: 10px 12px; min-height: 90px; }
.field .error, .validation { color: #9a2a20; font-size: 13px; }
.validation ul { margin: 0; padding-left: 18px; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 14px; }
.filters .field { flex: 1 1 160px; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 140px; padding: 20px; border: 2px dashed #c9ccc4; border-radius: 12px; background: #fafaf8; text-align: center; }

/* Sign-in page */
.bare { display: flex; min-height: 100vh; align-items: center; justify-content: center; }
.bare-main { width: min(420px, 100% - 32px); }
.login { display: flex; flex-direction: column; gap: 16px; }
.login .brand { padding: 0; margin-bottom: 8px; }

@media (max-width: 720px) {
  .nav { border-right: 0; border-bottom: 1px solid var(--line); }
  .main { padding: 20px 16px 40px; }
}
