/* RivourProjectBoard · charte RivourTech */
@font-face { font-family: "Poppins"; src: url("fonts/Poppins-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("fonts/Poppins-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("fonts/Poppins-Bold.ttf") format("truetype"); font-weight: 600 700; font-display: swap; }

:root {
  --navy: #07132A; --navy-2: #0C1D3D; --navy-3: #142B57;
  --blue: #0D52D6; --sky: #02A6F8; --sky-2: #0A96F2;
  --ink: #263040; --muted: #6B7689; --line: #DCE3EE; --tint: #F3F6FB; --bg: #EEF2F8; --card: #FFFFFF;
  --ok: #1E9E5A; --ok-bg: #E6F6EC; --wait: #0D52D6; --wait-bg: #E6EEFB; --late: #D9534F; --late-bg: #FDECEC; --todo: #9AA6BA; --gold: #F2A20A;
  --r: 14px; --shadow: 0 10px 30px -18px rgba(7, 19, 42, .35);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: "Poppins", system-ui, sans-serif; color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue); }
[hidden] { display: none !important; }

/* ---------- connexion */
.login { min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 18px; padding: 24px;
  background: radial-gradient(1200px 600px at 20% -10%, #1a3b78 0%, transparent 60%), linear-gradient(160deg, var(--navy) 0%, var(--navy-3) 100%); }
.lcard { width: min(400px, 100%); background: #fff; border-radius: 18px; padding: 30px 30px 26px; box-shadow: 0 30px 70px -30px rgba(0,0,0,.6); }
.llogo { height: 34px; display: block; margin-bottom: 22px; }
.kicker { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--sky-2); font-weight: 600; }
.lcard h1 { margin: 2px 0 18px; font-size: 24px; color: var(--navy); }
.lcard label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.lcard input { display: block; width: 100%; margin-top: 5px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--tint); }
.lcard input:focus { outline: 2px solid var(--sky); border-color: transparent; background: #fff; }
.lcard .btn { width: 100%; margin-top: 6px; padding: 12px; }
.lerr { color: var(--late); min-height: 1.2em; margin: 10px 0 0; font-size: 13px; }
.lfoot { color: #9fb3d6; font-size: 12px; margin: 0; }

/* ---------- structure */
.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; background: linear-gradient(90deg, var(--navy-2) 250px, transparent 250px); }
.side { background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%); color: #cfe0ff; padding: 22px 16px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; }
.brand img { height: 28px; margin: 2px 6px 10px; }
.proj { margin: 0 6px 16px; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.06); font-size: 12px; color: #9fb3d6; }
.proj b { display: block; color: #fff; font-size: 13.5px; }
nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow: auto; }
nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: #cfe0ff; text-decoration: none; font-weight: 500; font-size: 13.5px; }
nav a svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; flex: none; }
nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
nav a.on { background: var(--blue); color: #fff; box-shadow: 0 8px 20px -10px var(--blue); }
nav a .pc { margin-left: auto; font-size: 11px; opacity: .8; }
nav .sep { height: 1px; background: rgba(255,255,255,.08); margin: 8px 6px; }
.me { border-top: 1px solid rgba(255,255,255,.08); padding: 12px 8px 0; font-size: 12.5px; }
.me #meName { color: #fff; font-weight: 600; }
.link { all: unset; cursor: pointer; color: #9fb3d6; font-size: 12px; }
.link:hover { color: #fff; text-decoration: underline; }
.topbar { display: none; }
.main { padding: 28px 34px 20px; min-width: 0; }
.foot { margin-top: 30px; color: var(--muted); font-size: 11.5px; text-align: center; }
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.ph h1 { margin: 2px 0 0; font-size: 25px; color: var(--navy); line-height: 1.2; }
.ph .sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px 22px; border: 1px solid #e6ebf3; }
.card h2 { margin: 0 0 12px; font-size: 15px; color: var(--navy); }
.btn { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 14px; cursor: pointer; font-weight: 500; font-size: 13px; }
.btn:hover { border-color: var(--blue); color: var(--blue); }
.btn.primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn.primary:hover { filter: brightness(1.08); color: #fff; }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.ghost { background: transparent; }
.btn.danger:hover { border-color: var(--late); color: var(--late); }
.btn:disabled { opacity: .5; cursor: default; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 5px; border-radius: 20px; padding: 2px 9px; font-size: 11.5px; font-weight: 500; background: var(--tint); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.chip.rt { background: #E6EEFB; color: var(--blue); border-color: #cfdcf7; }
.chip.nd { background: #E3F5FE; color: #0679b5; border-color: #c4e8fb; }
.chip.both { background: #EEE9FB; color: #5b3fc4; border-color: #ddd3f7; }
.chip.ok { background: var(--ok-bg); color: var(--ok); border-color: #c6ead4; }
.chip.wait { background: var(--wait-bg); color: var(--wait); border-color: #cfdcf7; }
.chip.late { background: var(--late-bg); color: var(--late); border-color: #f6caca; }
.chip.add { background: #FFF4DE; color: #A86400; border-color: #f6e0b4; }
.chip.kind { background: #fff; }

/* ---------- accueil */
.home { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; align-items: start; }
.hero { display: flex; flex-direction: column; align-items: center; padding: 30px 20px 26px; }
.ring { position: relative; width: min(380px, 78vw); aspect-ratio: 1; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .trk { stroke: #E6ECF5; }
.ring .val { stroke: url(#gr); stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
.ring .in { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; text-align: center; pointer-events: none; }
.ring .pct { font-size: clamp(46px, 9vw, 76px); font-weight: 700; color: var(--navy); line-height: 1; letter-spacing: -.02em; }
.ring .pct small { font-size: .42em; font-weight: 600; margin-left: 2px; }
.ring .lbl { margin-top: 8px; color: var(--muted); font-size: 13px; }
.ring .lbl b { color: var(--navy); }
.ring .hit { cursor: pointer; pointer-events: stroke; }
.hero .hint { margin-top: 14px; color: var(--muted); font-size: 12.5px; text-align: center; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 22px; }
.kpi { background: var(--card); border: 1px solid #e6ebf3; border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); }
.kpi b { display: block; font-size: 20px; color: var(--navy); }
.kpi span { font-size: 11.5px; color: var(--muted); }
.kpi.late b { color: var(--late); }
.phs { display: flex; flex-direction: column; gap: 12px; }
.phc { display: grid; grid-template-columns: 74px 1fr; gap: 14px; align-items: center; padding: 14px 16px; cursor: pointer; text-decoration: none; color: inherit; transition: transform .12s, border-color .12s; }
.phc:hover { transform: translateY(-2px); border-color: var(--sky); }
.mini { position: relative; width: 74px; height: 74px; }
.mini svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.mini .t { stroke: #E6ECF5; } .mini .v { stroke: var(--blue); stroke-linecap: round; }
.mini.full .v { stroke: var(--ok); }
.mini .n { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; color: var(--navy); font-size: 15px; }
.phc .k { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--sky-2); font-weight: 600; }
.phc .tt { font-weight: 600; color: var(--navy); font-size: 13.5px; line-height: 1.3; }
.phc .s { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.next { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 22px; }
.nl { list-style: none; margin: 0; padding: 0; }
.nl li { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-top: 1px dashed var(--line); }
.nl li:first-child { border-top: 0; }
.nl .ref { font-weight: 600; color: var(--blue); font-size: 12px; min-width: 52px; }
.nl a { color: inherit; text-decoration: none; }
.nl a:hover { color: var(--blue); }
.nl .d { margin-left: auto; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.nl .d.late { color: var(--late); font-weight: 600; }
.tip { position: fixed; z-index: 60; background: var(--navy); color: #fff; border-radius: 10px; padding: 10px 13px; font-size: 12.5px; box-shadow: 0 14px 30px -10px rgba(0,0,0,.5); pointer-events: none; min-width: 210px; }
.tip .r { display: flex; justify-content: space-between; gap: 18px; }
.tip i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; }

/* ---------- phases */
.phead { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; }
.bar { height: 10px; background: #E6ECF5; border-radius: 10px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--sky)); border-radius: 10px; transition: width .6s; }
.bar.full > span { background: var(--ok); }
.list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.item { background: var(--card); border: 1px solid #e6ebf3; border-left: 4px solid var(--todo); border-radius: 12px; padding: 13px 16px; box-shadow: var(--shadow); }
.item.done { border-left-color: var(--wait); }
.item.valid { border-left-color: var(--ok); }
.item.late { border-left-color: var(--late); }
.item.flash { animation: flash 1.6s ease 2; }
@keyframes flash { 50% { box-shadow: 0 0 0 4px rgba(2,166,248,.35); } }
.item.arch { opacity: .6; border-left-style: dashed; }
.ih { display: flex; gap: 10px; align-items: flex-start; }
.ih .ref { font-weight: 700; color: var(--blue); font-size: 12px; padding-top: 2px; min-width: 52px; }
.ih .ti { font-weight: 600; color: var(--navy); flex: 1; }
.ih .ti .det { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; margin-top: 2px; white-space: pre-wrap; }
.meta { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 0 62px; }
.checks { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0 0 62px; }
.ck { display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 10px; padding: 7px 12px; background: var(--tint); cursor: pointer; user-select: none; }
.ck input { width: 18px; height: 18px; accent-color: var(--blue); cursor: pointer; }
.ck.v input { accent-color: var(--ok); }
.ck.on { background: #fff; border-color: #cfdcf7; }
.ck.v.on { border-color: #c6ead4; }
.ck.dis { cursor: not-allowed; opacity: .75; }
.ck.dis input { cursor: not-allowed; }
.ck b { font-size: 13px; }
.ck span { display: block; font-size: 11px; color: var(--muted); }
.tools { display: flex; gap: 4px; }
.ibtn { all: unset; cursor: pointer; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: var(--muted); }
.ibtn:hover { background: var(--tint); color: var(--blue); }
.ibtn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.more { margin: 10px 0 0 62px; }
.more summary { cursor: pointer; color: var(--blue); font-size: 12.5px; font-weight: 500; list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.more summary::before { content: "▸ "; }
.more[open] summary::before { content: "▾ "; }
.cmts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.cm { border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: #fff; }
.cm .h { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 5px; display: flex; gap: 6px; }
.cm .h .at { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 400; }
.cm.rt .h { color: var(--blue); } .cm.nd .h { color: #0679b5; }
.cm textarea { width: 100%; min-height: 58px; resize: vertical; border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; background: var(--tint); }
.cm .txt { white-space: pre-wrap; font-size: 13px; min-height: 20px; }
.cm .txt.empty { color: var(--todo); font-style: italic; }
.cm .row { margin-top: 6px; }
.shots { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.shot { position: relative; width: 84px; height: 64px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--tint); display: grid; place-items: center; font-size: 11px; color: var(--muted); text-decoration: none; }
.shot img { width: 100%; height: 100%; object-fit: cover; }
.shot .x { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%; background: rgba(7,19,42,.75); color: #fff; border: 0; cursor: pointer; font-size: 12px; line-height: 18px; padding: 0; }
.addshot { width: 84px; height: 64px; border: 1px dashed var(--todo); border-radius: 8px; display: grid; place-items: center; cursor: pointer; color: var(--muted); font-size: 11.5px; text-align: center; }
.addshot:hover { border-color: var(--blue); color: var(--blue); }

/* ---------- Gantt */
.gwrap { overflow-x: auto; }
.gantt { min-width: 900px; }
.grow { display: grid; grid-template-columns: 300px 1fr; align-items: center; min-height: 30px; }
.grow.phase { background: var(--tint); border-radius: 8px; margin-top: 10px; font-weight: 600; color: var(--navy); }
.grow.phase .gl { padding: 6px 10px; }
.gl { padding: 4px 10px 4px 4px; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gl a { color: inherit; text-decoration: none; } .gl a:hover { color: var(--blue); }
.gl .r { color: var(--blue); font-weight: 600; margin-right: 6px; font-size: 11.5px; }
.gt { position: relative; height: 30px; }
.gdays { display: grid; position: sticky; top: 0; background: #fff; z-index: 2; }
.gday { font-size: 10.5px; text-align: center; color: var(--muted); padding: 4px 0; border-left: 1px solid #eef1f6; }
.gday.we { background: #f6f8fb; }
.gday.today { color: var(--blue); font-weight: 700; }
.gb { text-decoration: none; position: absolute; top: 6px; height: 18px; border-radius: 6px; cursor: pointer; display: flex; align-items: center; padding: 0 6px; font-size: 10.5px; color: #fff; font-weight: 600; overflow: hidden; white-space: nowrap; }
.gb.todo { background: repeating-linear-gradient(135deg, #c8d1df 0 6px, #d7dee9 6px 12px); color: var(--navy); }
.gb.done { background: var(--wait); }
.gb.valid { background: var(--ok); }
.gb.late { background: var(--late); }
.gb.phasebar { top: 9px; height: 12px; cursor: default; background: #c9d6ee; }
.gb.phasebar > span { display: block; height: 100%; background: var(--blue); border-radius: 6px; }
.gline { position: absolute; top: 0; bottom: 0; width: 2px; z-index: 1; pointer-events: none; }
.gline.today { background: var(--blue); }
.gline.target { background: var(--ok); }
.gline.deadline { background: var(--late); }
.gcols { position: absolute; inset: 0; display: grid; pointer-events: none; }
.gcols div { border-left: 1px solid #f1f4f8; }
.gcols div.we { background: rgba(240,243,248,.6); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 18px; height: 10px; border-radius: 4px; margin-right: 6px; vertical-align: -1px; }
.legend i.todo { background: repeating-linear-gradient(135deg, #c8d1df 0 4px, #d7dee9 4px 8px); }
.legend i.done { background: var(--wait); } .legend i.valid { background: var(--ok); } .legend i.late { background: var(--late); }
.legend i.l { width: 3px; height: 14px; border-radius: 1px; vertical-align: -3px; }

/* ---------- tableaux, formulaires */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 600; font-size: 11.5px; color: #fff; background: var(--blue); padding: 9px 10px; }
.tbl th:first-child { border-radius: 8px 0 0 0; } .tbl th:last-child { border-radius: 0 8px 0 0; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl .num { text-align: right; white-space: nowrap; }
.tbl tr.tot td { font-weight: 700; color: var(--navy); background: var(--tint); }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form label { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.form label.full { grid-column: 1 / -1; }
.form input, .form select, .form textarea { padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--tint); }
.form textarea { min-height: 70px; resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus, .cm textarea:focus { outline: 2px solid var(--sky); border-color: transparent; background: #fff; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.alert { border-radius: 10px; padding: 10px 13px; font-size: 13px; background: var(--wait-bg); color: var(--navy); border: 1px solid #cfdcf7; }
.alert.warn { background: #FFF4DE; border-color: #f6e0b4; }
.search { padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; min-width: 240px; }
.jl td:nth-child(1) { white-space: nowrap; color: var(--muted); font-size: 12px; }

/* ---------- fenêtres */
.modal { position: fixed; inset: 0; background: rgba(7,19,42,.55); display: grid; place-items: center; z-index: 50; padding: 18px; }
.mbox { background: #fff; border-radius: 16px; width: min(600px, 100%); max-height: 90vh; overflow: auto; padding: 22px 24px; box-shadow: 0 30px 80px -30px rgba(0,0,0,.6); }
.mbox h2 { margin: 0 0 14px; color: var(--navy); font-size: 18px; }
.mbox .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 10px; z-index: 70; font-size: 13px; box-shadow: 0 10px 30px -10px rgba(0,0,0,.5); }
.toast.bad { background: var(--late); }
.viewer img { max-width: 100%; border-radius: 10px; display: block; margin: 0 auto; }

/* ---------- mobile */
@media (max-width: 1100px) { .home { grid-template-columns: 1fr; } .homel { display: contents; } .home > .homel > .hero { order: 1; } .home > .phs { order: 2; } .homel > .kpis { order: 3; margin-top: 0; } .homel > .next { order: 4; margin-top: 0; } .phs { display: grid; grid-template-columns: 1fr 1fr; } .kpis { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; background: none; }
  .side { position: fixed; z-index: 40; left: 0; top: 0; width: 270px; transform: translateX(-100%); transition: transform .2s; }
  body.menu .side { transform: none; box-shadow: 20px 0 40px -20px rgba(0,0,0,.5); }
  .topbar { display: flex; align-items: center; gap: 14px; background: var(--navy); padding: 10px 14px; position: sticky; top: 0; z-index: 30; }
  .topbar img { height: 22px; }
  .burger { all: unset; cursor: pointer; width: 26px; display: flex; flex-direction: column; gap: 5px; }
  .burger span { height: 2px; background: #fff; border-radius: 2px; }
  .main { padding: 18px 14px; }
  .next, .grid2, .cmts, .form { grid-template-columns: 1fr; }
  .phs { grid-template-columns: 1fr; }
  .meta, .checks, .more { margin-left: 0; }
  .ph h1 { font-size: 21px; }
}
