/* PHOENIX — thème braise */
:root {
  --bg: #120d0b; --bg2: #18110e; --card: #1e1613; --card2: #271c17; --line: #36271f; --line2: #4a352a;
  --text: #f7ede5; --muted: #bba797; --dim: #8b786b;
  --ember: #ff7a1a; --ember2: #ff3d54; --gold: #ffc25c;
  --green: #5fd38d; --yellow: #ffcf4d; --red: #ff5d5d;
  --grad: linear-gradient(120deg, #ffc25c 0%, #ff7a1a 45%, #ff3d54 100%);
  --r: 18px; --rs: 12px;
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Bricolage Grotesque', 'Manrope', system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15.5px/1.55 var(--font); min-height: 100vh;
  background-image: radial-gradient(900px 420px at 85% -120px, rgba(255, 122, 26, .16), transparent 70%), radial-gradient(700px 380px at -10% 110%, rgba(255, 61, 84, .08), transparent 70%); background-attachment: fixed; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0; letter-spacing: -.01em; }
h1 { font-size: clamp(28px, 6vw, 40px); font-weight: 800; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 16.5px; font-weight: 700; }
code { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: .86em; background: var(--card2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; color: #ffd9b3; word-break: break-word; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- structure ---------- */
.shell { display: flex; min-height: 100vh; }
.main { flex: 1; min-width: 0; }
#view { max-width: 1060px; margin: 0 auto; padding: 18px 16px calc(96px + var(--safe-b)); outline: none; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  background: rgba(18, 13, 11, .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.top-brand, .rail-brand { display: flex; align-items: center; gap: 9px; color: var(--text); font: 800 17px var(--display); letter-spacing: .12em; }
.top-brand img, .rail-brand img { border-radius: 9px; }
.top-brand:hover, .rail-brand:hover { text-decoration: none; }
.top-journal { color: var(--muted); padding: 6px; display: flex; }
.top-journal svg { width: 24px; height: 24px; }

/* navigation : barre du bas sur mobile */
.rail { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around; padding: 6px 4px calc(6px + var(--safe-b));
  background: rgba(24, 17, 14, .94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
.rail a[data-tab] { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; color: var(--dim); font-size: 11px; font-weight: 600; border-radius: 12px; }
.rail a[data-tab] svg { width: 23px; height: 23px; }
.rail a[data-tab]:hover { text-decoration: none; color: var(--text); }
.rail a.on { color: var(--ember); }
.rail-brand, .rail-only, .rail-logout { display: none !important; }

@media (min-width: 900px) {
  .topbar { display: none; }
  .rail { position: sticky; top: 0; height: 100vh; width: 232px; flex-direction: column; justify-content: flex-start; gap: 4px; padding: 22px 14px; border-top: 0; border-right: 1px solid var(--line); background: rgba(24, 17, 14, .7); }
  .rail-brand { display: flex !important; margin: 0 8px 22px; }
  .rail-only { display: flex !important; }
  .rail a[data-tab] { flex: 0; flex-direction: row; gap: 12px; padding: 11px 12px; font-size: 14.5px; color: var(--muted); }
  .rail a[data-tab] svg { width: 21px; height: 21px; }
  .rail a.on { background: rgba(255, 122, 26, .12); color: var(--text); }
  .rail a.on svg { color: var(--ember); }
  .rail-logout { display: block !important; margin-top: auto; }
  .rail-logout button { background: none; border: 0; color: var(--dim); font: 500 13px var(--font); cursor: pointer; padding: 10px 12px; }
  .rail-logout button:hover { color: var(--text); }
  #view { padding: 34px 32px 60px; }
}

/* ---------- éléments ---------- */
.card { background: linear-gradient(180deg, var(--card), var(--bg2)); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin-bottom: 14px; }
.card-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.more { font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line2); background: var(--card2); color: var(--text); font: 700 14px var(--font); cursor: pointer; transition: transform .1s, background .2s, opacity .2s; }
.btn:hover { text-decoration: none; background: #33251e; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: default; }
.btn-primary { background: var(--grad); border: 0; color: #1b0d06; }
.btn-primary:hover { background: var(--grad); filter: brightness(1.06); }
.btn-ghost { background: transparent; }
.btn-ghost.on { background: rgba(255, 207, 77, .14); border-color: var(--yellow); color: var(--yellow); }
.btn.wide { width: 100%; margin-top: 4px; }
.bar { height: 8px; border-radius: 99px; background: #2c201a; overflow: hidden; margin: 8px 0; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--grad); transition: width .5s ease; min-width: 0; }
.bar.thin { height: 5px; margin: 0; }
.stat-row { display: flex; align-items: baseline; gap: 9px; margin-top: 10px; }
.stat-row b { font: 800 30px var(--display); }
.stat-row b small { font-size: 17px; color: var(--dim); font-weight: 700; }
.stat-row span { color: var(--muted); font-size: 14px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line2); background: var(--card); color: var(--muted); border-radius: 99px; padding: 8px 14px; font: 600 13.5px var(--font); cursor: pointer; }
.chip.on { background: var(--text); color: #1b0d06; border-color: var(--text); }
.tag { font-size: .85em; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--card2); color: var(--dim); }
.b-ok { background: rgba(95, 211, 141, .14); color: var(--green); }
.b-nsp { background: rgba(255, 207, 77, .14); color: var(--yellow); }
.ok { color: var(--green); font-weight: 600; }
.empty { text-align: center; color: var(--muted); }
.page-h { margin: 4px 0 16px; }
.page-h p { margin: 6px 0 0; }
.back { display: inline-block; margin-bottom: 12px; font-weight: 600; font-size: 14px; }
.num { flex: none; display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 8px; background: var(--card2); border: 1px solid var(--line2); font: 800 13px var(--display); color: var(--gold); margin-right: 8px; }
.loading { display: flex; justify-content: center; gap: 7px; padding: 80px 0; }
.loading span { width: 9px; height: 9px; border-radius: 50%; background: var(--ember); animation: pulse 1s infinite ease-in-out; }
.loading span:nth-child(2) { animation-delay: .15s; } .loading span:nth-child(3) { animation-delay: .3s; }
@keyframes pulse { 0%, 100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1); } }
#toast { position: fixed; left: 50%; bottom: calc(86px + var(--safe-b)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 50; background: var(--text); color: #1b0d06; font-weight: 700; font-size: 14px; padding: 11px 18px; border-radius: 99px; transition: .25s; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); max-width: calc(100% - 32px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: var(--red); color: #fff; }
@media (min-width: 900px) { #toast { bottom: 28px; } }

/* ---------- accueil ---------- */
.hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 6px 0 20px; }
.eyebrow { margin: 0 0 4px; color: var(--dim); font-size: 13px; font-weight: 600; text-transform: capitalize; }
.pill { display: inline-block; margin-top: 10px; padding: 6px 12px; border-radius: 99px; border: 1px solid rgba(255, 122, 26, .45); background: rgba(255, 122, 26, .1); color: var(--gold); font-size: 13px; font-weight: 700; }
.hero-sub { margin: 10px 0 0; color: var(--muted); font-size: 13.5px; }
.hero-ring { text-align: center; flex: none; }
.hero-ring small { display: block; color: var(--dim); font-size: 12px; margin-top: 2px; }
.ring { display: block; }
.ring-bg { fill: none; stroke: #2c201a; stroke-width: 9; }
.ring-fg { fill: none; stroke: url(#g); stroke-width: 9; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset .8s ease; }
.ring text { fill: var(--text); stroke: none; font: 800 24px var(--display); }
.grid { display: grid; gap: 0 14px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid { grid-template-columns: 1fr 1fr; } .span2 { grid-column: span 2; } }
.qlist { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.qlist a { display: flex; align-items: flex-start; color: var(--text); font-size: 14px; padding: 10px; border-radius: var(--rs); background: var(--card2); border: 1px solid var(--line); }
.qlist a:hover { text-decoration: none; border-color: var(--line2); }
.mini-chantiers { display: grid; gap: 4px 22px; }
@media (min-width: 760px) { .mini-chantiers { grid-template-columns: 1fr 1fr; } }
.mc { display: grid; grid-template-columns: 1fr 90px 44px; align-items: center; gap: 10px; color: var(--text); font-size: 14px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.mc:hover { text-decoration: none; color: var(--gold); }
.mc .bar { margin: 0; }
.mc-n { color: var(--dim); font-size: 12.5px; text-align: right; font-variant-numeric: tabular-nums; }
.jlist { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.jlist li { display: grid; grid-template-columns: 84px 1fr; gap: 10px; font-size: 14px; }
.jlist time { color: var(--dim); font-size: 12.5px; padding-top: 1px; }

/* ---------- tâches ---------- */
.tasks { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.tasks li label, li.task > label { display: flex; align-items: flex-start; gap: 11px; padding: 9px 4px; cursor: pointer; border-radius: 10px; }
.tasks li label:hover { background: rgba(255, 255, 255, .025); }
.tasks small { display: block; color: var(--dim); font-size: 12px; margin-top: 2px; }
.tasks li.done > label > span, li.task.done > label > span { color: var(--dim); text-decoration: line-through; text-decoration-color: rgba(187, 167, 151, .4); }
input[type=checkbox] { flex: none; appearance: none; -webkit-appearance: none; width: 22px; height: 22px; margin: 0; border-radius: 7px; border: 2px solid var(--line2); background: var(--bg2); cursor: pointer; display: inline-grid; place-content: center; transition: .15s; vertical-align: middle; }
input[type=checkbox]::after { content: ''; width: 10px; height: 6px; border: 2.5px solid #1b0d06; border-top: 0; border-right: 0; transform: rotate(-45deg) scale(0); margin-top: -3px; transition: transform .15s; }
input[type=checkbox]:checked { background: var(--grad); border-color: transparent; }
input[type=checkbox]:checked::after { transform: rotate(-45deg) scale(1); }
.tsec h2 { font-size: 15.5px; margin-bottom: 6px; color: var(--gold); }
.donebox { margin-top: 10px; color: var(--muted); }
.donebox summary { cursor: pointer; font-size: 14px; font-weight: 600; padding: 6px 0; }
.cgrid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.ccard { display: block; color: var(--text); margin: 0; transition: border-color .2s, transform .15s; }
.ccard:hover { text-decoration: none; border-color: rgba(255, 122, 26, .5); transform: translateY(-1px); }
.cmeta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 4px 0 0; color: var(--muted); font-size: 13px; }

/* ---------- questions ---------- */
.qsec > h2 { margin: 22px 0 10px; font-size: 16px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.qcard { padding: 16px; transition: border-color .3s; }
.qcard.answered { border-color: rgba(95, 211, 141, .28); }
.qcard.red:not(.answered) { border-left: 3px solid var(--red); }
.qcard.flash { animation: flash 1.6s ease; }
@keyframes flash { 0%, 40% { border-color: var(--ember); box-shadow: 0 0 0 3px rgba(255, 122, 26, .25); } }
.qhead { display: flex; align-items: flex-start; }
.qhead p { margin: 2px 0 0; font-weight: 600; }
textarea, input:not([type=checkbox]) { width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line2); border-radius: var(--rs); padding: 11px 13px; font: 15px/1.5 var(--font); resize: vertical; outline: none; transition: border-color .2s; }
textarea:focus, input:not([type=checkbox]):focus { border-color: var(--ember); }
.qcard textarea { margin-top: 12px; min-height: 48px; }
.qfoot { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.qfoot .qstate { margin-right: auto; }

/* ---------- veille ---------- */
.empty-veille { text-align: center; padding: 28px 20px; }
.empty-veille p { color: var(--muted); max-width: 480px; margin: 10px auto 18px; }
.offer-h { display: flex; gap: 14px; align-items: flex-start; }
.offer-h p { margin: 3px 0 0; font-size: 13.5px; }
.score { flex: none; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font: 800 20px var(--display); background: var(--card2); border: 1px solid var(--line2); }
.score.hot { background: var(--grad); color: #1b0d06; border: 0; }
.salary { margin: 12px 0 0; font-weight: 700; }
.subs { display: grid; gap: 6px; margin: 12px 0 0; }
.subs > div { display: grid; grid-template-columns: 62px 1fr 44px; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.subs b { text-align: right; font-variant-numeric: tabular-nums; }
.notes { margin: 12px 0 0; color: var(--muted); font-size: 14px; }
.offer-f { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.avis { display: flex; gap: 6px; margin-left: auto; }
.av { width: 44px; height: 42px; border-radius: 12px; border: 1px solid var(--line2); background: var(--card2); font-size: 19px; cursor: pointer; filter: grayscale(.8); opacity: .65; transition: .15s; }
.av.on { filter: none; opacity: 1; border-color: var(--ember); background: rgba(255, 122, 26, .14); transform: scale(1.06); }

/* ---------- dossiers & documents ---------- */
.search { margin-bottom: 14px; }
.fgroup h2 { font-size: 15.5px; margin-bottom: 6px; }
.files { list-style: none; padding: 0; margin: 0; }
.files li a { display: flex; justify-content: space-between; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); color: var(--text); font-size: 14.5px; }
.files li:last-child a { border-bottom: 0; }
.files li a:hover { text-decoration: none; color: var(--gold); }
.files small { color: var(--dim); white-space: nowrap; }
.doc-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.crumb { margin: 0; color: var(--dim); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.doc { padding: 20px 20px 10px; overflow-wrap: anywhere; }
@media (min-width: 900px) { .doc { padding: 30px 38px 18px; } }
.doc h1 { font-size: clamp(24px, 5vw, 32px); margin: 0 0 16px; }
.doc h2 { font-size: 20px; margin: 28px 0 10px; color: var(--gold); }
.doc h3 { margin: 22px 0 8px; }
.doc p, .doc li { color: #eadccf; }
.doc ul, .doc ol { padding-left: 22px; }
.doc li { margin: 4px 0; }
.doc li.task { list-style: none; margin-left: -22px; }
.doc li.task > label { padding: 4px 2px; }
.doc blockquote { margin: 12px 0; padding: 2px 14px; border-left: 3px solid var(--ember); background: rgba(255, 122, 26, .06); border-radius: 0 10px 10px 0; color: var(--muted); }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.doc pre { background: #0d0907; border: 1px solid var(--line); border-radius: var(--rs); padding: 14px; overflow-x: auto; font-size: 12.5px; line-height: 1.45; }
.doc pre code { background: none; border: 0; padding: 0; color: #f0c9a4; }
.doclink code { color: var(--gold); border-color: rgba(255, 194, 92, .35); }
.table-wrap { overflow-x: auto; margin: 12px 0; border: 1px solid var(--line); border-radius: var(--rs); }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { text-align: left; padding: 9px 11px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--card2); font-weight: 700; color: var(--gold); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td input[type=checkbox] { width: 20px; height: 20px; }
.editor { min-height: 65vh; font: 13.5px/1.55 ui-monospace, 'Cascadia Code', Consolas, monospace; }
.edit-f { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; }

/* ---------- journal ---------- */
.phases { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.phase { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 3px; border-radius: 12px; border: 1px solid var(--line2); background: var(--card2); color: var(--muted); cursor: pointer; font: 600 11.5px/1.2 var(--font); text-align: center; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: anywhere; }
@media (max-width: 480px) { .phase { font-size: 9.5px; } }
.phase b { font: 800 19px var(--display); color: var(--text); }
.phase.on { background: var(--grad); color: #1b0d06; border-color: transparent; }
.phase.on b { color: #1b0d06; }
.jform { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.jform label { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.jform .full { grid-column: 1 / -1; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: grid; grid-template-columns: 90px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline time { color: var(--gold); font-weight: 700; font-size: 13px; }
.timeline p { margin: 0; }
.timeline small { color: var(--dim); }
.timeline .next { color: var(--muted); font-size: 14px; margin-top: 4px; }

/* ---------- connexion ---------- */
.login-page { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.login { width: 100%; max-width: 360px; text-align: center; }
.login-logo { border-radius: 24px; box-shadow: 0 18px 50px rgba(255, 90, 30, .25); }
.wordmark { font: 800 34px var(--display); letter-spacing: .18em; margin: 18px 0 4px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-sub { color: var(--dim); font-size: 13.5px; margin: 0 0 22px; }
.login form { display: grid; gap: 14px; text-align: left; }
.login label { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.login .btn { margin-top: 6px; min-height: 48px; font-size: 15px; }
.err { background: rgba(255, 93, 93, .12); color: #ffb0b0; border: 1px solid rgba(255, 93, 93, .35); padding: 10px; border-radius: 12px; font-size: 14px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
