/* Espace bureau : tableau de travail — résumé cliquable en tête, liste, fiche latérale */
.bureau .wrap.wide { max-width: 1180px; }
.who { color: var(--muted); font-size: 13.5px; }
.login { max-width: 420px; margin: 40px auto; }
.cfg { margin: 18px 0 0; border-radius: var(--r); background: var(--tint-orange); padding: 12px 16px; font-size: 14px; }
.cfg strong { display: block; margin-bottom: 4px; }
.cfg ul { margin: 0; padding-left: 18px; }

.tabs { display: flex; gap: 4px; margin: 18px 0 14px; border-bottom: 1px solid var(--line); }
.tab { appearance: none; background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 12px; font: inherit; font-weight: 700; color: var(--muted); cursor: pointer; margin-bottom: -1px; }
.tab[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--orange); }

.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 900px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { appearance: none; text-align: left; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; border-top: 3px solid var(--line-strong); min-width: 0; }
.kpi .v { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi .l { font-size: 13px; color: var(--muted); }
.kpi .s { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.kpi.warn { border-top-color: var(--orange); } .kpi.bad { border-top-color: var(--red); } .kpi.good { border-top-color: var(--green); } .kpi.info { border-top-color: var(--sky); }
.kpi[aria-pressed="true"] { outline: 2px solid var(--orange); outline-offset: -1px; }
.kpi.zero .v { color: var(--muted); }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 10px; align-items: center; }
.toolbar input[type=search] { flex: 1 1 260px; }
.toolbar select { width: auto; flex: 0 0 auto; }
.filtre { margin: 0 0 8px; font-size: 14px; color: var(--muted); }

.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.lrow { display: grid; grid-template-columns: 130px minmax(0, 1.4fr) minmax(0, 1.2fr) 92px minmax(0, 1fr) 104px 104px; gap: 12px; align-items: center; padding: 11px 14px; border-top: 1px solid var(--line); font-size: 14px; cursor: pointer; width: 100%; text-align: left; background: none; border-left: 0; border-right: 0; border-bottom: 0; font-family: inherit; color: inherit; }
.lrow:first-child { border-top: 0; }
.lrow:hover { background: var(--bg); }
.lrow.head { cursor: default; background: var(--bg); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.lrow .num { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--head); }
.lrow .who2 b { display: block; } .lrow .who2 span, .lrow .muted { color: var(--muted); font-size: 13px; }
.lrow .eur, .lrow .d { font-variant-numeric: tabular-nums; }
.lrow .eur { text-align: right; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }
@media (max-width: 900px) {
  .lrow.head { display: none; }
  .lrow { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who eur" "num pay" "form form" "dates dates"; gap: 4px 10px; padding: 12px 14px; }
  .lrow .who2 { grid-area: who; } .lrow .eur { grid-area: eur; } .lrow .num { grid-area: num; font-size: 13px; } .lrow .pay { grid-area: pay; justify-self: end; }
  .lrow .form { grid-area: form; } .lrow .dv, .lrow .de { display: none; } .lrow .dates { display: block !important; grid-area: dates; }
}
.lrow .dates { display: none; color: var(--muted); font-size: 13px; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; background: var(--line); color: var(--ink); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .8; }
.pill.ok { background: var(--tint-green); } .pill.ok::before { background: var(--green); }
.pill.warn { background: var(--tint-orange); } .pill.warn::before { background: var(--orange); }
.pill.bad { background: var(--tint-red); } .pill.bad::before { background: var(--red); }
.pill.info { background: var(--tint-blue); } .pill.info::before { background: var(--sky); }
.pill.ex { background: transparent; border: 1px dashed var(--line-strong); color: var(--muted); } .pill.ex::before { display: none; }

/* fiche */
.drawer-bg { position: fixed; inset: 0; background: rgba(10, 20, 35, .35); z-index: 30; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--bg); z-index: 31; display: flex; flex-direction: column; border-left: 1px solid var(--line); box-shadow: -10px 0 40px rgba(0,0,0,.15); }
.d-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: calc(16px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 12px 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.d-head h2 { color: var(--head); font-size: 20px; }
.d-sub { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.d-body { overflow-y: auto; padding: 16px max(16px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) 20px; display: grid; gap: 14px; align-content: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: grid; gap: 10px; }
.card h3 { font-size: 15px; color: var(--head); display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: minmax(110px, 40%) minmax(0, 1fr); gap: 6px 12px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.inline .field { flex: 1 1 140px; }
.inline input, .inline select { padding: 8px 10px; }
.msg { width: 100%; font-size: 13.5px; min-height: 120px; }
.journal { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13.5px; }
.journal li { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px; }
.journal time { color: var(--muted); font-variant-numeric: tabular-nums; }
.l215 { border: 2px solid var(--orange); border-radius: 8px; padding: 8px 10px; font-weight: 700; }

/* formules */
.fcard { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-bottom: 12px; display: grid; gap: 10px; }
.fcard .grid { gap: 10px; }
.fcard .row { justify-content: space-between; }
