:root {
  --bg: #12100e;
  --card: #1e1a16;
  --card2: #262019;
  --line: #342d24;
  --text: #f3ece3;
  --dim: #a89b8b;
  --accent: #e0873b;
  --green: #5fbf7d;
  --red: #d9694f;
  --amber: #e0b03b;
  --radius: 14px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding-bottom: 84px;
  padding-top: env(safe-area-inset-top);
}

/* top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; position: sticky; top: 0; z-index: 10;
  background: rgba(18,16,14,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { color: var(--text); font-weight: 700; text-decoration: none; font-size: 18px; }
.logout { color: var(--dim); text-decoration: none; font-size: 14px; }

main { padding: 16px; max-width: 640px; margin: 0 auto; }
h1 { font-size: 20px; margin: 4px 0 14px; }
h2 { font-size: 15px; letter-spacing: .04em; text-transform: uppercase; color: var(--dim); margin: 22px 0 10px; }

/* progress cards */
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.stat .lbl { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.stat .lbl b { font-size: 16px; }
.stat .lbl span { color: var(--dim); font-size: 14px; }
.bar { height: 10px; background: #2c241c; border-radius: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #f0a862); border-radius: 6px; }

/* cards / rows */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; }
.card .head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card .name { font-weight: 600; }
.card .role { color: var(--dim); font-size: 13px; }
.card .note { color: var(--dim); font-size: 13px; margin-top: 6px; }

.pill { font-size: 12px; padding: 3px 9px; border-radius: 20px; white-space: nowrap; font-weight: 600; }
.pill.rupture { background: rgba(217,105,79,.16); color: var(--red); }
.pill.reflexion { background: rgba(224,176,59,.16); color: var(--amber); }
.pill.flexible { background: rgba(224,135,59,.16); color: var(--accent); }
.pill.garde { background: rgba(95,191,125,.16); color: var(--green); }
.pill.parti { background: #2c241c; color: var(--dim); }

/* checklist */
.steps { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.step { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.step label { display: flex; align-items: center; gap: 12px; flex: 1; cursor: pointer; }
.step .box {
  width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--line);
  flex: 0 0 auto; display: grid; place-items: center; font-size: 15px; color: transparent;
  transition: .12s;
}
.step.done .box { background: var(--green); border-color: var(--green); color: #12100e; }
.step.done .txt { color: var(--dim); text-decoration: line-through; }
.step .date { color: var(--dim); font-size: 12px; }

/* tâches + pièces jointes */
.task { border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: none; }
.clip { font-size: 12px; color: var(--accent); margin-left: 8px; }
.attach-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 0 10px 36px; }
.att { display: inline-flex; align-items: center; gap: 4px; background: var(--card2); border: 1px solid var(--line); border-radius: 8px; padding: 3px 4px 3px 9px; font-size: 12px; }
.att a { color: var(--text); text-decoration: none; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-x { background: none; border: none; color: var(--dim); font-size: 12px; padding: 2px 5px; cursor: pointer; }
.att-add { font-size: 12px; color: var(--accent); background: rgba(224,135,59,.1); border: 1px dashed var(--accent); border-radius: 8px; padding: 4px 10px; cursor: pointer; }

/* travaux phase */
.phase { margin-bottom: 18px; }
.phase .ph-head { display: flex; justify-content: space-between; align-items: baseline; }
.phase .ph-head .cnt { color: var(--dim); font-size: 13px; }
.phase .sub { color: var(--dim); font-size: 13px; margin: 2px 0 8px; }
.assignee { font-size: 12px; color: var(--accent); background: rgba(224,135,59,.12); padding: 1px 7px; border-radius: 12px; margin-left: 6px; }

/* log box */
.logbox { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 16px; }
.logbox textarea {
  width: 100%; background: var(--card2); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 12px; font: inherit; resize: vertical; min-height: 56px;
}
.row { display: flex; gap: 8px; margin-top: 10px; }
button, .btn {
  background: var(--accent); color: #1a130b; border: none; border-radius: 10px;
  padding: 12px 16px; font: inherit; font-weight: 700; cursor: pointer;
}
button.ghost { background: var(--card2); color: var(--text); border: 1px solid var(--line); font-weight: 600; }
button.mic { background: var(--card2); border: 1px solid var(--line); font-size: 18px; padding: 12px 14px; flex: 0 0 auto; }
button.mic.rec { background: var(--red); border-color: var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }
.micstatus { color: var(--dim); font-size: 13px; margin-top: 8px; min-height: 1em; }
select, input[type=text], input[type=date], input[type=password] {
  background: var(--card2); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 11px 12px; font: inherit;
}
input[type=date]::-webkit-calendar-picker-indicator { filter: invert(.7); }

/* journal */
.jr { border-left: 3px solid var(--line); padding: 4px 0 12px 14px; margin-left: 4px; }
.jr .t { color: var(--dim); font-size: 12px; }
.jr .badge { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); }

/* tab bar */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; display: flex;
  background: rgba(18,16,14,.96); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  flex: 1; text-align: center; color: var(--dim); text-decoration: none;
  font-size: 11px; padding: 9px 0 8px; display: flex; flex-direction: column; gap: 3px;
}
.tabbar a span { font-size: 21px; }
.tabbar a.active { color: var(--accent); }

/* next jalon card on dashboard */
.nextj.late { border-color: rgba(217,105,79,.5); }
.nextj.late .lbl span { color: var(--red); }

/* timeline / rétro-planning */
.timeline { position: relative; margin-left: 6px; }
.tl-row { position: relative; display: flex; gap: 14px; padding-bottom: 22px; }
.tl-row::before {  /* ligne verticale */
  content: ""; position: absolute; left: 11px; top: 24px; bottom: -2px;
  width: 2px; background: var(--line);
}
.tl-row:last-child::before { display: none; }
.tl-dot-wrap { flex: 0 0 24px; z-index: 1; }
.tl-dot {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--card2); border: 2px solid var(--line); color: #12100e;
  font-size: 14px; font-weight: 800; cursor: pointer;
}
.jtoggle { margin: 0; }
.tl-dot.rh { border-color: var(--amber); }
.tl-dot.travaux { border-color: var(--accent); }
.tl-dot.cible { border-color: var(--green); }
.tl-dot.admin { border-color: #5b9bd5; }
.tl-dot.equipement { border-color: #a879d9; }
.tl-dot.concept { border-color: #e07ba8; }
.tl-dot.comm { border-color: #4fc3c7; }

/* légende types */
.tl-legend { display: flex; flex-wrap: wrap; gap: 10px 14px; margin-bottom: 16px; font-size: 12px; color: var(--dim); }
.tl-legend span { display: inline-flex; align-items: center; gap: 5px; }
.tl-legend i { width: 11px; height: 11px; border-radius: 50%; border: 2px solid; display: inline-block; }
.lg-rh { border-color: var(--amber); } .lg-travaux { border-color: var(--accent); }
.lg-admin { border-color: #5b9bd5; } .lg-equipement { border-color: #a879d9; }
.lg-concept { border-color: #e07ba8; } .lg-comm { border-color: #4fc3c7; }
.lg-cible { border-color: var(--green); }
.tl-row.done .tl-dot { background: var(--green); border-color: var(--green); }
.tl-row.late .tl-dot { border-color: var(--red); box-shadow: 0 0 0 3px rgba(217,105,79,.18); }
.tl-dot.now {
  background: #fff; border-color: #fff; width: 16px; height: 16px; margin: 4px;
  box-shadow: 0 0 0 4px rgba(255,255,255,.15);
}
.tl-row.today .tl-body { color: #fff; padding-top: 2px; }
.tl-body { flex: 1; padding-top: 1px; }
.tl-head { display: flex; align-items: center; gap: 8px; }
.tl-label { font-weight: 600; }
.tl-label.done { color: var(--dim); text-decoration: line-through; }
.tl-meta { display: flex; align-items: center; gap: 10px; margin-top: 5px; }
.tl-dateform { margin: 0; }
.tl-dateform input[type=date] {
  background: var(--card2); border: 1px solid var(--line); color: var(--dim);
  border-radius: 8px; padding: 4px 8px; font-size: 13px;
}
.jbadge { font-size: 12px; font-weight: 700; color: var(--accent); background: rgba(224,135,59,.12); padding: 2px 9px; border-radius: 12px; }
.jbadge.late { color: var(--red); background: rgba(217,105,79,.16); }
.jbadge.soon { color: var(--amber); background: rgba(224,176,59,.16); }

/* login */
.login-wrap { max-width: 340px; margin: 18vh auto; text-align: center; }
.login-wrap h1 { font-size: 26px; }
.login-wrap form { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.login-wrap .err { color: var(--red); font-size: 14px; }
.empty { color: var(--dim); text-align: center; padding: 30px 0; }
