/* Plateforme achat : charte reprise du portail Klak (thème sombre, vert citron). */
@font-face { font-family: "Inter"; src: url(fonts/inter.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url(fonts/grotesk.woff2) format("woff2"); font-weight: 500 700; font-display: swap; }

:root {
  color-scheme: dark;
  --page: #0f1113; --card: #1c1e21; --tile: #23262a; --tile-hover: #2c3035; --hover: #383e46;
  --ring: rgba(255, 255, 255, 0.05); --ring2: rgba(255, 255, 255, 0.1);
  --text: #f7f7f8; --text2: rgba(255, 255, 255, 0.6); --muted: #898a8b;
  --lime: #d1fe17; --lime-10: rgba(209, 254, 23, 0.1); --lime-24: rgba(209, 254, 23, 0.24); --on-lime: #1a1a1a;
  --amber: #ffb01f; --amber-10: rgba(255, 176, 31, 0.12); --red: #ff4d4d; --red-10: rgba(255, 77, 77, 0.12);
  --r16: 16px; --r12: 12px; --r10: 10px; --r8: 8px;
  --sans: "Inter", ui-sans-serif, system-ui, sans-serif; --display: "Space Grotesk", var(--sans); --mono: "Space Grotesk", var(--sans);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--page); color: var(--text); }
body { font: 14px/20px var(--sans); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
::selection { background: var(--lime); color: var(--on-lime); }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
.muted { color: var(--muted); } .mono { white-space: nowrap; } .small { font-size: 13px; } .tiny { font-size: 11px; } .mono { font-family: var(--mono); }
.row { display: flex; align-items: center; gap: 10px; } .col { display: flex; flex-direction: column; gap: 10px; }
.between { justify-content: space-between; } .wrap { flex-wrap: wrap; } .grow { flex: 1 1 auto; min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.hide { display: none !important; }

/* Surfaces */
.card { background: var(--card); border: 1px solid var(--ring); border-radius: var(--r16); padding: 16px; }
.tile { background: var(--tile); border-radius: var(--r12); padding: 12px 14px; }
.card-link { display: flex; flex-direction: column; gap: 12px; transition: background 0.15s, border-color 0.15s; cursor: pointer; }
.card-link:hover { background: var(--tile); border-color: var(--ring2); }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: var(--r12); border: 0;
  background: var(--lime); color: var(--on-lime); font: 600 14px/1 var(--sans); cursor: pointer; white-space: nowrap; transition: filter 0.15s, background 0.15s; }
.btn:hover { filter: brightness(1.06); }
.btn:disabled { opacity: 0.4; cursor: default; filter: none; }
.btn-outline { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.btn-outline:hover { background: rgba(255, 255, 255, 0.1); filter: none; }
.btn-soft { background: var(--lime-10); color: var(--lime); }
.btn-soft:hover { background: var(--lime-24); filter: none; }
.btn-acc { background: var(--amber); color: var(--on-lime); }
.btn-sm { height: 36px; padding: 0 12px; border-radius: var(--r10); font-size: 13px; }
.link { font-weight: 600; color: var(--lime); background: none; border: 0; padding: 0; cursor: pointer; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.link-muted { color: var(--muted); font-weight: 500; }
.icon-btn { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; border-radius: var(--r8); cursor: pointer; color: var(--muted); }
.icon-btn:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }

/* Puces */
.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font: 600 11px/1 var(--sans); white-space: nowrap; background: rgba(255, 255, 255, 0.08); color: #c9c9ca; }
.chip-lime { background: var(--lime-10); color: var(--lime); }
.chip-acc { background: var(--amber-10); color: var(--amber); }
.chip-ink { background: var(--lime); color: var(--on-lime); }
.chip-red { background: var(--red-10); color: var(--red); }
.pill-group { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { height: 32px; padding: 0 12px; border-radius: var(--r8); border: 1px solid var(--ring2); background: transparent; color: var(--muted); font: 500 13px/1 var(--sans); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.pill:hover { color: var(--text); }
.pill.on { background: var(--lime-10); border-color: var(--lime-24); color: var(--lime); }
.pill:disabled { cursor: default; }
.pill .n { font: 11px/1 var(--mono); opacity: 0.8; }
.seg { display: inline-flex; padding: 4px; gap: 4px; background: var(--tile); border-radius: var(--r12); }
.seg button { min-width: 64px; height: 36px; padding: 0 12px; border: 0; border-radius: var(--r8); background: transparent; color: var(--muted); font: 600 13px/1 var(--sans); cursor: pointer; }
.seg button.on { background: var(--hover); color: var(--text); }
.seg button:disabled { cursor: default; }
.tile .seg { background: var(--page); }

/* Formulaires */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font: 500 12px/16px var(--sans); color: var(--muted); }
.field > span.bad { color: var(--red); }
.input, .field input, .field textarea { width: 100%; height: 44px; padding: 0 14px; border: 1px solid transparent; border-radius: var(--r12);
  background: var(--tile); color: var(--text); font: 15px/1.3 var(--sans); outline: none; transition: border-color 0.15s, background 0.15s; }
.field textarea, textarea.input { padding: 12px 14px; height: auto; min-height: 88px; resize: vertical; }
.input:hover, .field input:hover, .field textarea:hover { background: var(--tile-hover); }
.input:focus, .field input:focus, .field textarea:focus { border-color: var(--lime-24); background: var(--tile-hover); }
.input::placeholder, .field input::placeholder, .field textarea::placeholder { color: #5f6164; }
.input:disabled, .field input:disabled, .field textarea:disabled { opacity: 0.75; }
.tile .input, .tile .field input, .tile .field textarea { background: var(--page); }
.tile .input:hover, .tile .field input:hover { background: #15181b; }
.dropzone { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 12px; border: 1px dashed rgba(255, 255, 255, 0.18); border-radius: var(--r12);
  background: rgba(255, 255, 255, 0.02); color: var(--text2); font-weight: 500; font-size: 13px; cursor: pointer; text-align: center; transition: border-color 0.15s, color 0.15s; }
.dropzone:hover, .dropzone.over { border-color: var(--lime-24); color: var(--lime); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.notice { padding: 10px 12px; border-radius: var(--r10); font-size: 13px; font-weight: 500; }
.notice-ok { background: var(--lime-10); color: var(--lime); }
.notice-warn { background: var(--amber-10); color: var(--amber); }
.notice-err { background: var(--red-10); color: var(--red); }

/* Progression */
.steps { display: flex; gap: 3px; }
.steps span { flex: 1; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.1); }
.steps span.done { background: rgba(255, 255, 255, 0.55); }
.steps span.now { background: var(--lime); }
.steps span.late { background: var(--red); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--tile); display: inline-flex; align-items: center; justify-content: center; font: 600 12px/1 var(--sans); flex-shrink: 0; }

/* Coque */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { background: var(--page); border-right: 1px solid var(--ring); padding: 18px 12px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100dvh; }
.brand { padding: 4px 10px; display: flex; align-items: center; gap: 10px; font: 700 17px/1 var(--display); letter-spacing: 0.02em; text-transform: uppercase; }
.brand .tag { font: 700 10px/1 var(--display); letter-spacing: 0.08em; padding: 4px 6px; border-radius: 6px; background: var(--lime-10); color: var(--lime); }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.side-link { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border-radius: var(--r10); color: #a8a8a8; font-weight: 500; font-size: 14px; cursor: pointer; }
.side-link:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.side-link.on { background: rgba(255, 255, 255, 0.06); color: var(--lime); }
.side-link svg { width: 18px; height: 18px; flex: none; }
.side-link .badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 6px; background: var(--amber); color: var(--on-lime); font: 700 11px/20px var(--sans); text-align: center; }
.side-foot { margin-top: auto; padding: 10px; border-radius: var(--r12); background: var(--card); display: flex; align-items: center; gap: 10px; }
.main { padding: 22px 28px 56px; display: flex; flex-direction: column; gap: 16px; min-width: 0; max-width: 1400px; width: 100%; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.title { font: 700 30px/1.05 var(--display); text-transform: uppercase; letter-spacing: -0.01em; }
.sec { font: 700 12px/16px var(--display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.big { font: 600 44px/48px var(--display); letter-spacing: -0.02em; }

/* Listes de styles */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.scard .nom { font: 700 17px/22px var(--sans); }
.scard .foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.thumb { width: 44px; height: 44px; border-radius: var(--r10); background: var(--tile); object-fit: cover; flex: none; }
.kanban { display: grid; grid-template-columns: repeat(7, minmax(190px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.kcol { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 10px; background: var(--card); border: 1px solid var(--ring); border-radius: var(--r16); }
.kcol-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 6px; font: 700 12px/16px var(--display); letter-spacing: 0.08em; text-transform: uppercase; }
.kcard { display: flex; flex-direction: column; gap: 6px; padding: 12px; background: var(--tile); border-radius: var(--r12); transition: background 0.15s; cursor: pointer; }
.kcard:hover { background: var(--hover); }
.kcard .nom { font-weight: 600; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border: 1px solid var(--ring); border-radius: var(--r16); overflow: hidden; }
.table th, .table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--ring); font-size: 14px; vertical-align: middle; }
.table th { font: 11px/14px var(--mono); text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 400; }
.table tbody tr:hover td { background: rgba(255, 255, 255, 0.02); }
.table tr:last-child td { border-bottom: 0; }
.table tr.clic { cursor: pointer; }
.tscroll { overflow-x: auto; }
.num { width: 100%; min-width: 58px; height: 36px; padding: 0 8px; border: 1px solid transparent; border-radius: var(--r8); background: var(--page); text-align: right; font: 500 14px/1 var(--mono); outline: none; }
.step-body > .seg, .todo-card > .seg, .col > .seg, .field > .seg, .field > .pill-group { align-self: flex-start; }
.num:focus { border-color: var(--lime-24); }
.num:disabled { background: transparent; }
.table.mat th, .table.mat td { padding: 6px 8px; }
.table.mat td:first-child, .table.mat th:first-child { padding-left: 14px; white-space: nowrap; }

/* Fiche */
.todo-card { display: flex; flex-direction: column; gap: 14px; padding: 16px; border-radius: var(--r16); border: 1px solid var(--lime-24); background: var(--card); }
.todo-card.wait { border-color: var(--ring2); }
.todo-card.late { border-color: var(--red); }
.todo-card .sq { width: 42px; height: 42px; flex-shrink: 0; border-radius: var(--r12); background: var(--lime); color: var(--on-lime); display: flex; align-items: center; justify-content: center; font: 700 16px/1 var(--display); }
.todo-card.wait .sq { background: var(--tile); color: var(--muted); }
.stepper { display: flex; flex-direction: column; gap: 8px; }
.step { background: var(--card); border: 1px solid var(--ring); border-radius: var(--r16); }
.step > summary { list-style: none; cursor: pointer; }
.step > summary::-webkit-details-marker { display: none; }
.step-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.step-num { width: 30px; height: 30px; flex-shrink: 0; border-radius: 10px; display: flex; align-items: center; justify-content: center; font: 12px/1 var(--mono); background: var(--tile); color: var(--muted); }
.step-title { font: 700 13px/16px var(--display); letter-spacing: 0.08em; text-transform: uppercase; }
.step.done .step-num { background: rgba(255, 255, 255, 0.1); color: var(--text); }
.step.todo { opacity: 0.5; }
.step.todo[open] { opacity: 1; }
.step.now { border-color: var(--lime-24); box-shadow: 0 0 0 1px var(--lime-10) inset; }
.step.now .step-num { background: var(--lime); color: var(--on-lime); }
.step-body { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 14px; }
.kv { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--ring); gap: 12px; }
.kv:last-child { border-bottom: 0; }
.kv > span:first-child { font-size: 13px; color: var(--muted); }
.files { display: flex; flex-direction: column; gap: 6px; }
.file { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r10); background: var(--tile); font-size: 13px; }
.file a { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file a:hover { color: var(--lime); }
.file.old { opacity: 0.5; }
.fkind { display: flex; flex-direction: column; gap: 6px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.msg { padding: 10px 12px; border-radius: var(--r12); background: var(--tile); }
.ev { display: flex; gap: 8px; font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--ring); }
.ev:last-child { border-bottom: 0; }
.ev time { color: var(--muted); white-space: nowrap; font: 12px/20px var(--mono); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; padding: 12px 16px; border-radius: var(--r12); background: #25282c; border: 1px solid var(--ring2); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5); font-weight: 500; }
.toast.err { border-color: var(--red); color: var(--red); }
.lien { font: 12px/16px var(--mono); color: var(--text2); word-break: break-all; }
.center { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; }

@media (max-width: 1100px) { .two-col { grid-template-columns: minmax(0, 1fr); } .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; align-content: start; }
  .sidebar { position: sticky; top: 0; z-index: 30; height: auto; padding: 8px 10px; flex-direction: row; align-items: center; gap: 8px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--ring); }
  .brand .tag { display: none; }
  .sidebar nav { flex-direction: row; }
  .side-link { height: 36px; font-size: 13px; white-space: nowrap; }
  .side-link svg { display: none; }
  .side-foot { margin: 0 0 0 auto; padding: 0; background: none; }
  .side-foot .grow { display: none; }
  .main { padding: 16px 14px 40px; }
  .grid2, .grid3, .grid4 { grid-template-columns: minmax(0, 1fr); }
  .title { font-size: 24px; }
}
