/* ============================================================
   Fake Excel — a believable, messy spreadsheet (visual prop)
   ============================================================ */
.xl {
  --fs: 14px;
  --rh: 27px;
  font-family: "Segoe UI", Tahoma, Calibri, Arial, sans-serif;
  background: #fff;
  color: #1f2937;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}
.xl-strip   { --fs: 13px; --rh: 23px; }
.xl-compact { --fs: 11px; --rh: 19px; }

/* ---- title bar ---- */
.xl-titlebar {
  display: flex; align-items: center; gap: 9px;
  height: 34px; padding: 0 10px;
  background: #f6f7f8; border-bottom: 1px solid #e6e8ea;
  font-size: 12.5px; color: #4b5563;
}
.xl-xicon {
  width: 19px; height: 19px; border-radius: 4px;
  background: #207245; color: #fff; font-weight: 800;
  display: grid; place-items: center; font-size: 12px;
}
.xl-fname { font-weight: 500; }
.xl-winbtns { margin-left: auto; display: flex; gap: 14px; color: #9aa3ad; }
.xl-winbtns i { width: 11px; height: 11px; border: 1.4px solid currentColor; border-radius: 2px; display: block; }
.xl-winbtns i.x { border: 0; position: relative; }
.xl-winbtns i.x::before, .xl-winbtns i.x::after {
  content: ""; position: absolute; inset: 0 4px; top: 5px; height: 1.6px; background: currentColor;
}
.xl-winbtns i.x::after { transform: rotate(90deg); }

/* ---- menu bar ---- */
.xl-menubar {
  display: flex; gap: 18px; padding: 6px 14px;
  background: #fff; border-bottom: 1px solid #eef0f2;
  font-size: 12.5px; color: #4b5563;
}
.xl-menubar span.is-on {
  color: #207245; font-weight: 600;
  box-shadow: inset 0 -2px 0 #207245;
}

/* ---- faux toolbar ---- */
.xl-toolbar {
  display: flex; gap: 6px; align-items: center;
  padding: 7px 14px; background: #f3f4f6; border-bottom: 1px solid #e6e8ea;
}
.xl-toolbar i {
  width: 17px; height: 17px; border-radius: 3px;
  background: linear-gradient(#fff, #e9ebed); border: 1px solid #dfe2e5; display: block;
}
.xl-toolbar i:nth-child(4n) { width: 26px; }
.xl-toolbar i:nth-child(7n) { background: #e2efe8; }

/* ---- formula bar ---- */
.xl-formula {
  display: flex; align-items: center; gap: 0;
  height: 26px; border-bottom: 1px solid #e6e8ea; background: #fff; font-size: 12px;
}
.xl-namebox { width: 86px; padding: 0 8px; line-height: 26px; border-right: 1px solid #e6e8ea; color: #374151; }
.xl-fx { width: 34px; text-align: center; font-style: italic; color: #6b7280; border-right: 1px solid #e6e8ea; line-height: 26px; }
.xl-fbar { flex: 1; }

/* ---- grid ---- */
.xl-gridwrap { flex: 1; overflow: hidden; background: #fff; }
.xl-grid {
  border-collapse: collapse;
  table-layout: fixed;
  width: 100%;
  font-size: var(--fs);
}
.xl-grid th, .xl-grid td {
  border: 1px solid var(--xl-grid);
  height: var(--rh);
  padding: 0 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  font-weight: 400;
}
/* column-letter row + row-number gutter */
.xl-letters th, .xl-rn {
  background: #f1f3f5; color: #6b7280;
  text-align: center; font-weight: 500;
  border-color: #d3d8dd;
}
.xl-letters th { height: 21px; }
.xl-corner { background: #e9ecef !important; }
.xl-rn { width: 38px; }
/* header labels (sheet row 1) */
.xl-hdr {
  background: #eef2f4; font-weight: 700; color: #2b3440;
  border-color: #cfd6dd;
}
/* zebra-ish, very subtle */
.xl-grid tbody tr:nth-child(even) td:not([class*="t-"]) { background: #fafbfc; }

/* numeric-ish columns right align: Budget/Dépensé/Reste (cols G,H,I = child 8,9,10) and Avanc(7) */
.xl-grid td:nth-child(7),
.xl-grid td:nth-child(8),
.xl-grid td:nth-child(9),
.xl-grid td:nth-child(10) { text-align: right; }

/* column widths (set on the letters row; table-layout:fixed) */
.xl-letters th:nth-child(1)  { width: 38px; }  /* corner */
.xl-letters th:nth-child(2)  { width: 4.5%; }  /* A ID */
.xl-letters th:nth-child(4)  { width: 12%; }   /* C Projet */
.xl-letters th:nth-child(5)  { width: 4.5%; }  /* D Resp */
.xl-letters th:nth-child(6)  { width: 8%; }    /* E Statut */
.xl-letters th:nth-child(13) { width: 13%; }   /* L Commentaires */
.xl-letters th:nth-child(15) { width: 4.5%; }  /* N QA */

/* conditional formats */
.t-prog   { background: #dbeafe; color: #1e40af; font-weight: 600; text-align: center; }
.t-good   { background: var(--xl-good-bg); color: var(--xl-good-tx); font-weight: 600; text-align: center; }
.t-bad    { background: var(--xl-bad-bg);  color: var(--xl-bad-tx);  font-weight: 600; text-align: center; }
.t-wait   { background: #e5e7eb; color: #4b5563; font-weight: 600; text-align: center; }
.t-orange { background: var(--xl-orange-bg); color: var(--xl-orange-tx); font-weight: 600; text-align: center; }
.t-warn   { background: var(--xl-warn-bg); color: var(--xl-warn-tx); font-weight: 700; }
.t-note   { background: var(--xl-note-bg); color: #7c5e00; box-shadow: inset 0 0 0 1px #f0d678; }
.t-red    { color: var(--xl-red-tx); font-weight: 700; }
.t-err    { color: #b91c1c; font-weight: 700; background: #fff1f0; }

/* ---- recap blocks (full only) ---- */
.xl-recap { display: flex; gap: 14px; padding: 14px 8px 4px; align-items: flex-start; }
.xl-box {
  border: 1px solid var(--line-strong); border-radius: 4px; overflow: hidden;
  font-size: 12.5px; min-width: 0; flex: 1; background: #fff;
}
.xl-box-h { background: #eef2f4; font-weight: 700; padding: 4px 9px; color: #2b3440; font-size: 11px; letter-spacing: .03em; }
.xl-box table { width: 100%; border-collapse: collapse; }
.xl-box td { padding: 3px 9px; border-top: 1px solid #eef1f3; }
.xl-box td.num { text-align: right; font-variant-numeric: tabular-nums; }
.xl-box.notes ul { margin: 0; padding: 6px 9px 6px 24px; }
.xl-box.notes li { margin: 2px 0; color: #b45309; }

/* ---- sheet tabs ---- */
.xl-tabsbar {
  display: flex; align-items: center; gap: 1px;
  background: #f3f4f6; border-top: 1px solid #d8dce0;
  padding: 0 8px; height: 28px; font-size: 11.5px; color: #5b6470;
  overflow: hidden;
}
.xl-tabctrl { color: #9aa3ad; margin-right: 8px; letter-spacing: 2px; }
.xl-tab { padding: 5px 11px; white-space: nowrap; border-right: 1px solid #e0e3e6; }
.xl-tab.is-on {
  background: #fff; color: #207245; font-weight: 700;
  box-shadow: inset 0 2px 0 #207245; border-radius: 0 0 3px 3px;
}
.xl-tabadd { margin-left: 8px; color: #9aa3ad; font-size: 14px; }

/* compact/strip: drop heavy chrome to save height */
.xl-strip .xl-toolbar, .xl-strip .xl-formula,
.xl-compact .xl-toolbar, .xl-compact .xl-formula { display: none; }
.xl-compact .xl-titlebar { height: 28px; }
