/* L'Atelier 724 — interface */
:root {
  --accent: #f08a1c;
  --accent-600: #d9740a;
  --accent-50: #fff4e8;
  --ink: #17171a;
  --ink-2: #2a2a30;
  --text: #1d1d22;
  --muted: #6b6b76;
  --line: #e4e4ea;
  --bg: #f5f5f7;
  --card: #ffffff;
  --ok: #1f9d55;
  --ok-50: #e8f6ee;
  --warn: #c98200;
  --warn-50: #fff6df;
  --danger: #d93a3a;
  --danger-50: #fdecec;
  --info: #2f6fdb;
  --info-50: #eaf1fd;
  --violet: #7a4fd6;
  --violet-50: #f1ecfc;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 20, 30, .06), 0 2px 8px rgba(20, 20, 30, .04);
  --sidebar: 248px;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14.5px;
  color: var(--text);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
body { min-height: 100vh; -webkit-font-smoothing: antialiased; }
a { color: var(--accent-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
small, .muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.mono { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }

.boot { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; gap: 24px; }
.boot img { width: 220px; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Layout */
.layout { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { background: var(--ink); color: #d7d7de; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.sidebar .brand { padding: 18px 18px 14px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #2a2a31; }
.sidebar .brand img { width: 100%; max-width: 190px; background: #fff; border-radius: 8px; padding: 6px 10px; }
.nav { padding: 10px 10px 20px; flex: 1; }
.nav .group { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #85858f; padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px; color: #d7d7de; font-weight: 500; margin: 1px 0; }
.nav a:hover { background: #24242b; text-decoration: none; color: #fff; }
.nav a.active { background: var(--accent); color: #fff; }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.nav .count { margin-left: auto; background: var(--danger); color: #fff; font-size: 11px; border-radius: 10px; padding: 1px 7px; font-weight: 700; }
.sidebar .me { border-top: 1px solid #2a2a31; padding: 12px 14px; font-size: 13px; display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.sidebar .me .who { flex: 1; min-width: 0; }
.sidebar .me .who b { display: block; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar .me .who span { color: #9a9aa4; font-size: 12px; }
.sidebar .me button { background: none; border: 1px solid #3a3a42; color: #d7d7de; border-radius: 7px; padding: 5px 8px; cursor: pointer; }
.sidebar .me button svg { width: 16px; height: 16px; display: block; }
.sidebar .me button:hover { background: #2a2a31; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(245, 245, 247, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding: 10px 24px; display: flex; align-items: center; gap: 12px; }
.topbar .burger { display: none; background: none; border: 0; padding: 6px; cursor: pointer; }
.search-box { position: relative; flex: 1; max-width: 560px; }
.search-box input { width: 100%; padding: 9px 12px 9px 36px; border-radius: 9px; border: 1px solid var(--line); background: #fff; font: inherit; }
.search-box svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.12); max-height: 70vh; overflow: auto; z-index: 50; }
.search-results a { display: block; padding: 9px 14px; color: var(--text); border-bottom: 1px solid #f0f0f3; }
.search-results a:hover, .search-results a.sel { background: var(--accent-50); text-decoration: none; }
.search-results .t { font-size: 11px; text-transform: uppercase; color: var(--accent-600); font-weight: 700; letter-spacing: .05em; }
.search-results .s { font-size: 12.5px; color: var(--muted); }
.content { padding: 22px 24px 60px; max-width: 1500px; width: 100%; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 6px; }

/* ---------- Cards / grid */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.card-b { padding: 16px; }
.card + .card, .card + .grid, .grid + .card, .grid + .grid { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }

.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); position: relative; overflow: hidden; display: block; color: inherit; }
a.kpi:hover { text-decoration: none; border-color: var(--accent); }
.kpi .l { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.kpi .v { font-size: 26px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi .v.sm { font-size: 20px; }
.kpi .h { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--line); }
.kpi.orange::before { background: var(--accent); }
.kpi.red::before { background: var(--danger); }
.kpi.green::before { background: var(--ok); }
.kpi.blue::before { background: var(--info); }
.kpi.violet::before { background: var(--violet); }
.kpi.yellow::before { background: var(--warn); }
.kpi.red .v { color: var(--danger); }

/* ---------- Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fafafb; white-space: nowrap; }
table.t td { padding: 10px 12px; border-bottom: 1px solid #efeff3; vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr.click { cursor: pointer; }
table.t tbody tr.click:hover { background: #fcf8f3; }
table.t tr.late td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
table.t tfoot td { font-weight: 700; background: #fafafb; border-top: 1px solid var(--line); }
table.t td.num, table.t th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); }
.empty svg { width: 34px; height: 34px; opacity: .4; display: block; margin: 0 auto 8px; }

/* ---------- Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: #eeeef2; color: #4a4a55; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }
.b-grey { background: #eeeef2; color: #55555f; }
.b-blue { background: var(--info-50); color: var(--info); }
.b-violet { background: var(--violet-50); color: var(--violet); }
.b-orange { background: var(--accent-50); color: var(--accent-600); }
.b-yellow { background: var(--warn-50); color: var(--warn); }
.b-teal { background: #e6f6f6; color: #13827f; }
.b-green { background: var(--ok-50); color: var(--ok); }
.b-dark { background: #2a2a30; color: #fff; }
.b-red { background: var(--danger-50); color: var(--danger); }
.late-tag { color: var(--danger); font-weight: 700; font-size: 12px; white-space: nowrap; }
.urgent-tag { background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 800; letter-spacing: .05em; border-radius: 4px; padding: 1px 6px; text-transform: uppercase; }

/* ---------- Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; line-height: 1.2; }
.btn:hover { background: #f4f4f7; text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-600); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.dark:hover { background: var(--ink-2); }
.btn.danger { color: var(--danger); border-color: #f1c4c4; }
.btn.danger:hover { background: var(--danger-50); }
.btn.success { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.xs { padding: 3px 8px; font-size: 12px; border-radius: 6px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: #ececf0; }
.icon-btn { background: none; border: 0; cursor: pointer; padding: 4px; color: var(--muted); border-radius: 6px; }
.icon-btn:hover { background: #ececf0; color: var(--text); }

/* ---------- Forms */
.form { display: grid; gap: 14px; }
.form .row { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form .row.r3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form .row.r4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
label.f { display: block; font-size: 13px; font-weight: 600; color: #3a3a44; }
label.f > input, label.f > select, label.f > textarea, label.f > div, label.f > .hint { display: block; margin-top: 5px; }
label.f > div[style*="flex"] { display: flex; }
label.f .req { color: var(--danger); }
input, select, textarea { font: inherit; color: var(--text); }
.inp, label.f input:not([type=checkbox]):not([type=radio]), label.f select, label.f textarea, .filters input, .filters select, table input, table select, table textarea {
  padding: 8px 10px; border: 1px solid #d6d6de; border-radius: 8px; background: #fff; width: 100%; font-weight: 400; min-width: 0;
}
textarea { resize: vertical; min-height: 64px; }
.inp:focus, input:focus, select:focus, textarea:focus { outline: 2px solid rgba(240, 138, 28, .35); outline-offset: 0; border-color: var(--accent); }
.hint { font-size: 12px; color: var(--muted); font-weight: 400; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 13.5px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); align-items: center; }
.filters > * { width: auto; }
.filters input[type=search] { min-width: 220px; flex: 1; }
.filters select, .filters input[type=date] { max-width: 210px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 13px; font-weight: 600; cursor: pointer; color: #45454f; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip .n { opacity: .7; margin-left: 4px; }

/* ---------- Detail lists */
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; font-size: 13.5px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; font-weight: 550; word-break: break-word; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 8px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 12px 14px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.tabs button .n { background: #eeeef2; border-radius: 9px; padding: 0 7px; font-size: 12px; margin-left: 5px; }
.progress { height: 8px; background: #ececf0; border-radius: 6px; overflow: hidden; min-width: 80px; }
.progress > i { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.progress.green > i { background: var(--ok); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; font-size: 13.5px; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.timeline li::after { content: ""; position: absolute; left: 8.5px; top: 16px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline .when { font-size: 12px; color: var(--muted); }
.timeline .det { white-space: pre-line; color: #3c3c46; margin-top: 2px; }
.totals { margin-left: auto; width: 100%; max-width: 340px; }
.totals div { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid #efeff3; }
.totals div.big { font-size: 17px; font-weight: 750; border-bottom: 0; color: var(--accent-600); }
.alert { padding: 11px 14px; border-radius: 9px; font-size: 13.5px; display: flex; gap: 10px; align-items: flex-start; }
.alert.warn { background: var(--warn-50); color: #7a5300; }
.alert.danger { background: var(--danger-50); color: #8f1f1f; }
.alert.info { background: var(--info-50); color: #1d4a99; }
.alert.ok { background: var(--ok-50); color: #12643a; }
.people { display: flex; flex-wrap: wrap; gap: 4px; }
.person { display: inline-flex; align-items: center; gap: 5px; background: #f1f1f4; border-radius: 999px; padding: 2px 8px 2px 2px; font-size: 12px; font-weight: 600; }
.person i { width: 20px; height: 20px; border-radius: 50%; background: var(--ink-2); color: #fff; font-style: normal; display: grid; place-items: center; font-size: 10px; }

/* ---------- Production board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x proximity; }
.col { background: #ececf0; border-radius: 12px; padding: 10px; min-height: 200px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 8px; }
.col-h { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 4px; font-weight: 700; font-size: 13px; }
.col-h .n { background: #fff; border-radius: 10px; padding: 0 8px; font-size: 12px; }
.ocard { background: #fff; border-radius: 10px; padding: 10px 11px; box-shadow: var(--shadow); border: 1px solid transparent; font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.ocard.late { border-color: #f3b5b5; background: #fffafa; }
.ocard.urgent { box-shadow: inset 3px 0 0 var(--danger), var(--shadow); }
.ocard .top { display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.ocard .num { font-weight: 750; }
.ocard .cli { color: var(--muted); font-size: 12.5px; }
.ocard .items { font-size: 12.5px; color: #3a3a44; }
.ocard .move { display: flex; gap: 4px; justify-content: space-between; border-top: 1px solid #f0f0f3; padding-top: 6px; }
.ocard .move select { padding: 3px 6px; font-size: 12px; border-radius: 6px; border: 1px solid #d6d6de; flex: 1; min-width: 0; }

/* ---------- Modal / toast */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 15, 20, .45); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 14px; overflow-y: auto; animation: fade .12s; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 640px; box-shadow: 0 24px 60px rgba(0, 0, 0, .25); display: flex; flex-direction: column; max-height: none; }
.modal.lg { max-width: 980px; }
.modal.sm { max-width: 440px; }
.modal-h { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-b { padding: 18px 20px; }
.modal-f { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; background: #fafafb; border-radius: 0 0 14px 14px; }
@keyframes fade { from { opacity: 0; } }
#toasts { position: fixed; bottom: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 36px); }
.toast { background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.2); font-size: 13.5px; max-width: 420px; animation: fade .15s; }
.toast.error { background: var(--danger); }
.toast.ok { background: var(--ok); }
.pdf-frame { width: 100%; height: 75vh; border: 1px solid var(--line); border-radius: 8px; background: #525659; }

/* ---------- Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(160deg, #17171a 0%, #2a2a30 55%, #3a2510 100%); }
.login .box { background: #fff; border-radius: 16px; padding: 30px 28px; width: 100%; max-width: 400px; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.login .box img { width: 230px; display: block; margin: 0 auto 18px; }
.login .box h1 { text-align: center; font-size: 18px; margin-bottom: 4px; }
.login .box p { text-align: center; color: var(--muted); margin: 0 0 18px; font-size: 13.5px; }
.login .err { color: var(--danger); font-size: 13px; min-height: 18px; }

/* ---------- Charts */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding-top: 10px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; min-width: 0; }
.bars .b .stack { width: 100%; display: flex; gap: 2px; align-items: flex-end; height: 100%; }
.bars .b .stack i { flex: 1; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; }
.bars .b .stack i.e { background: var(--ink-2); }
.bars .b small { font-size: 10.5px; white-space: nowrap; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--accent); margin-right: 5px; vertical-align: -1px; }
.legend i.e { background: var(--ink-2); }
.statusbar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: #ececf0; }
.statusbar i { display: block; height: 100%; }

.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 18px; }
.perm-grid h4 { grid-column: 1 / -1; margin: 10px 0 2px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--accent-600); }
.lines-table td { padding: 6px 6px; }
.lines-table input, .lines-table textarea { padding: 6px 8px; }

/* ---------- Responsive */
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; z-index: 90; transform: translateX(-100%); transition: transform .2s; }
  .layout.nav-open .sidebar { transform: none; box-shadow: 0 0 60px rgba(0,0,0,.4); }
  .layout.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 80; }
  .topbar { padding: 8px 12px; }
  .topbar .burger { display: block; }
  .content { padding: 16px 12px 60px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .form .row, .form .row.r3, .form .row.r4 { grid-template-columns: 1fr; }
  h1 { font-size: 19px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .v { font-size: 21px; }
  .modal-bg { padding: 0; }
  .modal { border-radius: 0; min-height: 100vh; }
  .modal-f { border-radius: 0; position: sticky; bottom: 0; }
  .filters input[type=search] { min-width: 100%; }
  .filters select, .filters input[type=date] { max-width: none; flex: 1 1 45%; }
  .pdf-frame { height: 70vh; }
  .board { grid-auto-columns: 85vw; }
  .hide-m { display: none !important; }
}

/* ---------- Impression de l'écran (listes) */
@media print {
  .sidebar, .topbar, .actions, .filters, .btn { display: none !important; }
  .layout { display: block; }
  .content { padding: 0; }
  .card { box-shadow: none; }
}

/* icônes dans les titres */
h1 > svg, h2 > svg, h3 > svg { width: 1em; height: 1em; vertical-align: -0.12em; margin-right: 4px; color: var(--danger); }

.form > *, .grid > *, .card { min-width: 0; }
@media (max-width: 860px) {
  table.stack-m thead { display: none; }
  table.stack-m, table.stack-m tbody, table.stack-m tfoot { display: block; }
  table.stack-m tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; padding: 12px; border-bottom: 1px solid var(--line); }
  table.stack-m td { display: block; padding: 0; border: 0; }
  table.stack-m td[data-l]::before { content: attr(data-l); display: block; font-size: 11.5px; font-weight: 650; color: var(--muted); margin-bottom: 3px; }
  table.stack-m td:first-child { grid-column: 1 / -1; }
  table.stack-m td:last-child:not([data-l]) { grid-column: 1 / -1; text-align: right; }
  table.stack-m tfoot tr { display: flex; justify-content: space-between; }
  table.stack-m tfoot td { padding: 0; }
}

/* ---------- Fichiers client / production */
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.fblock { border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; background: #fff; min-width: 0; }
.fblock-client { border-left: 3px solid var(--info); }
.fblock-production { border-left: 3px solid var(--accent); }
.fblock-h { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; }
.fblock-h .btn { margin-left: auto; }
.flist { list-style: none; margin: 6px 0 0; padding: 0; }
.flist li { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-top: 1px solid #f0f0f3; }
.flist .fname { flex: 1; min-width: 0; font-size: 13px; }
.flist .fname a { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); font-weight: 600; }
.factions { display: flex; gap: 2px; }
.factions .icon-btn svg { width: 16px; height: 16px; display: block; }
.fempty { padding: 6px 0 2px; }
.fext { flex: none; width: 34px; height: 22px; border-radius: 4px; display: grid; place-items: center; font-size: 9.5px; font-weight: 800; color: #fff; background: #8a8a96; }
.fext-pdf { background: #d93a3a; } .fext-jpg, .fext-jpeg, .fext-png { background: #2f6fdb; } .fext-svg { background: #13827f; }
.fext-ai { background: #e07a00; } .fext-psd { background: #1f5fa8; } .fext-eps { background: #7a4fd6; } .fext-zip { background: #55555f; }
.fprogress { margin-top: 6px; }
.fpending { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.fpending span { font-size: 11.5px; background: #f1f1f4; border-radius: 6px; padding: 2px 6px; }
.fpending span.c { background: var(--info-50); color: var(--info); } .fpending span.p { background: var(--accent-50); color: var(--accent-600); }
.fpending button { border: 0; background: none; cursor: pointer; color: inherit; padding: 0 0 0 3px; }
.ocard .ofiles { display: flex; flex-wrap: wrap; gap: 4px; font-size: 11.5px; }
.ocard .ofiles a { background: var(--accent-50); color: var(--accent-600); border-radius: 5px; padding: 1px 6px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ocard .ofiles a.c { background: var(--info-50); color: var(--info); }
@media (max-width: 860px) { .fgrid { grid-template-columns: 1fr; } }

/* ---------- Circuit de validation / Mes tâches */
.wf-steps { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wf-step { padding: 7px 12px; border-radius: 8px; background: #f1f1f4; color: var(--muted); font-weight: 600; font-size: 13px; }
.wf-step.done { background: var(--ok-50); color: var(--ok); }
.wf-step.on { background: var(--accent); color: #fff; }
.wf-step.done.on { background: var(--ok); color: #fff; }
.wf-arrow { color: var(--muted); }
.card.task { transition: opacity .3s, transform .3s; }
.card.task + .card.task { margin-top: 14px; }
.card.task.urgent { box-shadow: inset 4px 0 0 var(--danger), var(--shadow); }
.card.task.late { border-color: #f3b5b5; }
.card.task.leaving { opacity: 0; transform: translateX(40px); }
.task-actions { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; padding: 14px 16px; border-top: 1px solid var(--line); background: #fafafb; border-radius: 0 0 var(--radius) var(--radius); }
.task-btn { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.task-btn .btn { padding: 10px 18px; }
.count-pill { background: var(--accent); color: #fff; border-radius: 10px; padding: 0 8px; font-size: 13px; margin-left: 4px; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: #b9b9c3; display: inline-block; }
body.live-on .live-dot { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-50); }
.chip:disabled { opacity: .6; cursor: default; }
.wf-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.wf-user { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; cursor: pointer; }
.wf-user:hover { border-color: var(--accent); }
.wf-user b { display: block; }
@media (max-width: 860px) { .task-btn { width: 100%; align-items: stretch; } .task-actions .f { min-width: 100% !important; } }
.alert > svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert .badge { flex: none; }
.group-title { font-size: 15px; margin: 18px 0 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.bl-list { display: flex; flex-direction: column; gap: 6px; }
.bl-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fafafb; }
.bl-row .actions { margin-left: auto; }
