/* Pyxeli HQ — brand tokens from the landing pages (pyxelisale src/styles/landing.css). */
:root {
  --bg: #f5f3ee; --panel: #ffffff; --soft: #ebe8e0; --line: #d9d5ca;
  --ink: #0b0b10; --muted: #5b5d66; --brand: #0123ff; --brand-2: #4200ff; --tint: #e6e9ff;
  --ok: #0f8a4f; --ok-bg: #e3f4ea; --bad: #c4231b; --bad-bg: #fbe6e4; --warn: #9a6200; --warn-bg: #fdf1d8;
  --side: #0b0b10; --side-ink: #f5f3ee; --side-muted: #a3a5b0;
  --r: 10px; --shadow: 0 1px 2px rgba(11,11,16,.06), 0 1px 1px rgba(11,11,16,.04);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.5 "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--ink); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 15px; margin: 0 0 12px; }
small, .muted { color: var(--muted); }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12px; }

/* ---------- shell */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); padding: 18px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; }
.side .logo { display: flex; align-items: center; gap: 8px; padding: 4px 10px 18px; font-weight: 700; letter-spacing: .04em; }
.side .logo img { height: 22px; }
.side .logo span { font-size: 11px; color: var(--side-muted); border: 1px solid #2a2a36; border-radius: 4px; padding: 1px 6px; }
.side a { color: var(--side-muted); padding: 8px 10px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; }
.side a:hover { color: var(--side-ink); background: #1a1a22; text-decoration: none; }
.side a.on { color: #fff; background: var(--brand); }
.side .badge { background: #fff; color: var(--brand); border-radius: 999px; font-size: 11px; font-weight: 700; padding: 0 7px; }
.side a.on .badge { background: #fff; }
.side .sep { height: 1px; background: #2a2a36; margin: 10px 4px; }
.side .me { margin-top: auto; padding: 10px; font-size: 12px; color: var(--side-muted); }
.side .me form { display: inline; }
.side .me button { background: none; border: 0; color: var(--side-muted); text-decoration: underline; cursor: pointer; padding: 0; font: inherit; }
main { padding: 24px 28px 60px; min-width: 0; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.top .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.menu-btn { display: none; margin-bottom: 6px; }

/* ---------- banners */
.banner { border-radius: var(--r); padding: 10px 14px; margin-bottom: 16px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.banner.demo { background: var(--warn-bg); color: #5c3b00; border: 1px solid #f0d9a8; }
.banner.flash { background: var(--tint); color: #0a1a8c; border: 1px solid #c8cfff; }
.banner.preview { display: block; background: var(--soft); color: var(--muted); border: 1px solid var(--line); }

/* ---------- surfaces */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.kpi .l { font-size: 12px; color: var(--muted); }
.kpi .v { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .d { font-size: 12px; color: var(--muted); }
.kpi .d.up { color: var(--ok); } .kpi .d.down { color: var(--bad); }

/* ---------- tables */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td { padding: 9px 10px; border-bottom: 1px solid var(--soft); vertical-align: top; }
.t tr:last-child td { border-bottom: 0; }
.t tr.click { cursor: pointer; }
.t tr.click:hover td { background: #faf9f6; }
.t .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { color: var(--muted); padding: 22px; text-align: center; }

/* ---------- chips */
.chip { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--soft); color: var(--ink); white-space: nowrap; }
.chip.s-nouveau { background: var(--tint); color: var(--brand); }
.chip.s-contacte { background: #efe6ff; color: var(--brand-2); }
.chip.s-qualifie { background: #e0f2f1; color: #0b6b63; }
.chip.s-devis { background: var(--warn-bg); color: var(--warn); }
.chip.s-gagne { background: var(--ok-bg); color: var(--ok); }
.chip.s-perdu { background: var(--bad-bg); color: var(--bad); }
.chip.demo { background: var(--warn-bg); color: #8a5a00; }

/* ---------- forms */
label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 0 0 4px; }
input[type=text], input[type=email], input[type=number], input[type=date], input[type=url], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--tint); border-color: var(--brand); }
.field { margin-bottom: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.row > .field { flex: 1 1 160px; }
.btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 600; border-radius: 8px; padding: 8px 14px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; white-space: nowrap; }
.btn:hover { text-decoration: none; border-color: var(--ink); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: #0019d6; }
.btn.danger { color: var(--bad); }
.btn.small { padding: 4px 10px; font-size: 12px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.checks label { display: flex; gap: 6px; align-items: center; font-weight: 400; color: var(--ink); margin: 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters input, .filters select { width: auto; min-width: 150px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.seg { max-width: 100%; overflow-x: auto; }
.seg a { white-space: nowrap; padding: 6px 12px; color: var(--ink); border-right: 1px solid var(--line); }
.seg a:last-child { border-right: 0; }
.seg a.on { background: var(--ink); color: #fff; }
.seg a:hover { text-decoration: none; }

/* ---------- pipeline board */
.board { display: grid; grid-template-columns: repeat(6, minmax(178px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.col { background: var(--soft); border-radius: var(--r); padding: 10px; min-height: 140px; transition: background .15s; }
.col.over { background: var(--tint); outline: 2px dashed var(--brand); }
.col-h { display: flex; justify-content: space-between; align-items: baseline; padding: 2px 4px 10px; }
.col-h b { font-size: 13px; }
.col-h small { font-variant-numeric: tabular-nums; }
.lc { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px 11px; margin-bottom: 8px; cursor: grab; box-shadow: var(--shadow); }
.lc:active { cursor: grabbing; }
.lc.dragging { opacity: .4; }
.lc .co { font-weight: 700; display: block; color: var(--ink); }
.lc .who { font-size: 12px; color: var(--muted); }
.lc .meta { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; gap: 6px; font-size: 12px; }
.lc .val { white-space: nowrap; font-weight: 600; font-variant-numeric: tabular-nums; }
.lc .due { color: var(--bad); font-size: 11px; font-weight: 600; }
.lc select { display: none; margin-top: 8px; font-size: 12px; padding: 4px 6px; }

/* ---------- charts */
.chart svg { width: 100%; height: 220px; display: block; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.bar { height: 8px; background: var(--soft); border-radius: 4px; overflow: hidden; min-width: 60px; }
.bar i { display: block; height: 100%; background: var(--brand); border-radius: 4px; }
.funnel { display: grid; gap: 8px; }
.funnel .f { display: grid; grid-template-columns: 130px 1fr 70px; gap: 10px; align-items: center; font-size: 13px; }
.funnel .f .bar { height: 22px; border-radius: 6px; }
.funnel .f .bar i { border-radius: 6px; }

/* ---------- lead page */
.lead-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; white-space: pre-wrap; word-break: break-word; }
.status-bar { display: flex; flex-wrap: wrap; gap: 6px; }
.status-bar button { font: inherit; font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.status-bar button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { padding: 10px 0 10px 18px; border-left: 2px solid var(--soft); position: relative; margin-left: 6px; }
.tl li::before { content: ""; position: absolute; left: -6px; top: 15px; width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.tl li.k-note::before { background: var(--brand); }
.tl li.k-status::before { background: var(--ink); }
.tl li.k-lead_in::before { background: var(--ok); }
.tl li.k-email::before { background: var(--brand-2); }
.tl .when { font-size: 12px; color: var(--muted); }
.tl .msg { white-space: pre-wrap; }

/* ---------- campaign editor */
.camp-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.mail-frame { width: 100%; height: 640px; border: 1px solid var(--line); border-radius: var(--r); background: #f5f3ee; }
.subject-line { font-size: 13px; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.confirm { border: 2px solid var(--brand); }

/* ---------- login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--side); }
.login .card { width: 100%; max-width: 380px; padding: 28px; }
.login img { height: 26px; margin-bottom: 18px; }

/* ---------- responsive */
@media (max-width: 1100px) {
  .lead-grid, .camp-grid, .g2, .g3 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 30% 0 0; z-index: 20; transform: translateX(-102%); transition: transform .2s; height: 100%; max-width: 280px; }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
  main { padding: 14px 16px 60px; }
  .btn.menu-btn { display: inline-flex; }
  .top { margin-bottom: 12px; }
  .kpi .v { font-size: 20px; }
  .board { grid-template-columns: 1fr; overflow: visible; }
  .lc { cursor: default; }
  .lc select { display: block; width: 100%; }
  .kv { grid-template-columns: 1fr; gap: 0 0; }
  .kv dt { margin-top: 8px; }
  .mail-frame { height: 520px; }
  .funnel .f { grid-template-columns: 100px 1fr 54px; }
  .filters input, .filters select { min-width: 0; flex: 1 1 140px; }
}

/* phone fixes found in browser testing 2026-10-05: segmented filters in the header scroll inside
   themselves instead of widening the page; team action buttons wrap. */
.grid > *, .lead-grid > *, .camp-grid > * { min-width: 0; }
.top > div { min-width: 0; max-width: 100%; }
.top .actions { min-width: 0; max-width: 100%; }
@media (max-width: 820px) {
  .t td.num { white-space: normal; }
  .t td.num form { display: inline-block; margin: 2px 0; }
}
