/**
 * Shared styling for the candidate app and the client portal.
 *
 * Pulled out of index.html when the single page was split into tabs: two
 * screens copying the same rules is how they start to look like two products.
 */

:root{
  --ink:#132321; --muted:#4f6260; --faint:#7c8f8d; --line:#d7e0df;
  --surface:#fff; --bg:#f4f8f7;
  --accent:#0f766e; --accent-soft:#e2f1ee;
  --good:#0a7d55; --good-bg:#dcf1e8;
  --warn:#b8620a; --warn-bg:#fbeddb;
  --stop:#a3242b; --stop-bg:#fbe3e4;
  --font:"Segoe UI",system-ui,-apple-system,Roboto,sans-serif;
  --mono:ui-monospace,Consolas,monospace;
  --tabbar:64px;
}
*{box-sizing:border-box}
body{
  margin:0;background:var(--bg);color:var(--ink);font-family:var(--font);
  line-height:1.5;-webkit-font-smoothing:antialiased;
}

/* ── Top bar ─────────────────────────────────────────────────────── */
.topbar{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:calc(env(safe-area-inset-top) + 16px) 16px 12px;
  max-width:520px;margin:0 auto;
}
h1{font-size:1.15rem;margin:0;letter-spacing:-.01em}
.sub{font-size:.78rem;color:var(--muted);margin:2px 0 0}

main{
  max-width:520px;margin:0 auto;
  /* Room for the tab bar, plus the home indicator on iPhone. */
  padding:0 16px calc(var(--tabbar) + env(safe-area-inset-bottom) + 24px);
}

/* ── Panels ──────────────────────────────────────────────────────── */
.panel{display:none;flex-direction:column;gap:14px}
.panel.on{display:flex}
.section-head{margin:6px 2px 0}

/* ── Cards and pieces ────────────────────────────────────────────── */
.card{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:14px}
.lbl{font-size:.7rem;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);font-weight:600}
.val{font-weight:650;font-size:.95rem;margin-top:3px}
.meta{font-size:.83rem;color:var(--muted);margin-top:2px}
.row{display:flex;align-items:center;gap:9px}
.row.sb{justify-content:space-between}
.pile{display:flex;flex-direction:column;gap:9px}
.footnote{font-size:.78rem;color:var(--faint);padding:2px 4px;margin:2px 0 0}

.pill{font-family:var(--mono);font-size:.66rem;font-weight:700;padding:3px 9px;border-radius:20px;white-space:nowrap}
.pill.ok{background:var(--good-bg);color:var(--good)}
.pill.warn{background:var(--warn-bg);color:var(--warn)}
.pill.stop{background:var(--stop-bg);color:var(--stop)}
.pill.muted{background:var(--bg);color:var(--muted)}

.actions{display:flex;gap:9px;margin-top:12px}
button{
  flex:1;font:inherit;font-size:.9rem;font-weight:650;padding:13px 10px;border-radius:11px;
  border:1px solid var(--accent);background:var(--accent);color:#fff;cursor:pointer;min-height:48px;
}
button.ghost{background:transparent;color:var(--accent)}
button:active{transform:translateY(1px)}
button[disabled]{opacity:.5;cursor:not-allowed}

.note{font-size:.8rem;border-radius:10px;padding:9px 12px;border:1px solid var(--line)}
.note.ok{background:var(--good-bg);color:var(--good);border-color:transparent}
.note.warn{background:var(--warn-bg);color:var(--warn);border-color:transparent}
.note.stop{background:var(--stop-bg);color:var(--stop);border-color:transparent}
.note.install{background:var(--accent-soft);color:var(--accent);border-color:transparent}
.note.install strong{font-weight:700}

ul{list-style:none;margin:8px 0 0;padding:0;display:flex;flex-direction:column;gap:7px}
li{display:flex;align-items:center;justify-content:space-between;gap:10px;
  font-size:.86rem;border-top:1px solid var(--line);padding-top:7px}
li:first-child{border-top:none;padding-top:0}

.queue{background:var(--warn-bg);border-color:transparent}
.queue .val{color:var(--warn)}

/* ── Shift and document rows ─────────────────────────────────────── */
.groupe{font-size:.66rem;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);
  font-weight:650;margin:6px 2px 1px}
.mission{border:1px solid var(--line);border-radius:12px;padding:11px 12px;background:var(--surface);
  display:flex;flex-direction:column;gap:5px}
.mission.offre{border-left:3px solid var(--accent)}
.mission.passee{opacity:.72}
.mission .quand{font-weight:650;font-size:.88rem}
.mission .ou{font-size:.83rem;color:var(--muted)}
.mission .actions{margin-top:4px}
.vide{font-size:.83rem;color:var(--muted);padding:10px 2px}
.perime{color:var(--warn);font-weight:650}

.doc{border:1px solid var(--line);border-radius:12px;padding:11px 12px;background:var(--surface);
  display:flex;flex-direction:column;gap:6px}
.doc.attention{border-left:3px solid var(--warn)}
.doc.bloquant{border-left:3px solid var(--stop)}
.doc .nom{font-weight:650;font-size:.88rem}
.doc .quoi{font-size:.82rem;color:var(--muted)}
.doc button{min-height:40px;padding:9px;font-size:.8rem}

/* ── Profile ─────────────────────────────────────────────────────── */
.champs{display:flex;flex-direction:column}
.champ{display:flex;justify-content:space-between;gap:14px;padding:9px 0;
  border-top:1px solid var(--line);font-size:.87rem}
.champ:first-child{border-top:none}
.champ .k{color:var(--muted)}
.champ .v{font-weight:600;text-align:right}
.tags{display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-end}
.tag{font-size:.72rem;background:var(--accent-soft);color:var(--accent);
  border-radius:20px;padding:3px 10px;font-weight:650}

/* ── Tab bar ─────────────────────────────────────────────────────── */
.tabbar{
  position:fixed;left:0;right:0;bottom:0;
  display:flex;background:var(--surface);border-top:1px solid var(--line);
  padding-bottom:env(safe-area-inset-bottom);z-index:20;
}
.tab{
  flex:1;background:none;border:none;color:var(--muted);cursor:pointer;
  display:flex;flex-direction:column;align-items:center;gap:3px;
  padding:9px 4px 8px;min-height:var(--tabbar);font-size:.68rem;font-weight:650;
  position:relative;border-radius:0;
}
.tab svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.7;
  stroke-linecap:round;stroke-linejoin:round}
.tab.on{color:var(--accent)}
.tab:active{transform:none}
.badge{
  position:absolute;top:6px;right:calc(50% - 20px);
  background:var(--warn);color:#fff;font-family:var(--mono);
  font-size:.6rem;font-weight:700;border-radius:20px;padding:1px 6px;
}

/* ── Message strip ───────────────────────────────────────────────── */
#message{margin:0 0 2px}

/* ── Top bar with menu ───────────────────────────────────────────── */
.menu-btn{
  flex:0 0 auto;background:none;border:none;color:var(--ink);cursor:pointer;
  padding:8px;min-height:auto;border-radius:10px;
}
.menu-btn svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round}
.topbar .titre{flex:1;text-align:center}
.topbar .titre h1{font-size:1.05rem}

/* ── Shift and job cards ─────────────────────────────────────────── */
.job{border:1px solid var(--line);border-radius:12px;padding:12px;background:var(--surface);
  display:flex;flex-direction:column;gap:6px}
.job.assignee{border-left:3px solid var(--accent);background:var(--accent-soft)}
.job.prise{opacity:.55}
.job .quand{font-weight:650;font-size:.9rem}
.job .ou{font-size:.84rem;color:var(--muted)}
.job .loin{font-family:var(--mono);font-size:.74rem;color:var(--muted)}

/* ── Timesheet rows ──────────────────────────────────────────────── */
.ts{border:1px solid var(--line);border-radius:12px;padding:12px;background:var(--surface);
  display:flex;flex-direction:column;gap:6px}
.ts.a-signer{border-left:3px solid var(--warn)}
.ts .heures{font-family:var(--mono);font-size:.8rem;color:var(--muted)}

/* ── Bottom sheet (signing, menu) ────────────────────────────────── */
.feuille{position:fixed;inset:0;z-index:40;display:flex;align-items:flex-end}
/* « display:flex » l'emporte sur l'attribut hidden : sans cette ligne, un
   panneau ferme reste etendu sur tout l'ecran et intercepte chaque clic.
   L'application parait alors morte, sans rien afficher d'anormal. */
.feuille[hidden]{display:none}
.feuille-fond{position:absolute;inset:0;background:rgba(10,22,21,.45)}
.feuille-corps,.menu-corps{
  position:relative;width:100%;max-width:520px;margin:0 auto;
  background:var(--surface);border-radius:18px 18px 0 0;
  padding:18px 16px calc(18px + env(safe-area-inset-bottom));
  max-height:92vh;overflow-y:auto;
  display:flex;flex-direction:column;gap:12px;
}
.feuille-corps h2{font-size:1.05rem;margin:0}
.btn.mini,button.mini{flex:0 0 auto;min-height:auto;padding:6px 12px;font-size:.76rem}

.sig-bloc{display:flex;flex-direction:column;gap:6px}
.sig{
  width:100%;height:130px;border:1px dashed var(--wire,#c4d0cf);border-radius:10px;
  background:#fbfdfc;touch-action:none;
}
.saisie{
  font:inherit;font-size:.9rem;padding:11px 12px;border-radius:10px;
  border:1px solid var(--line);background:var(--surface);color:var(--ink);width:100%;
}

/* ── Menu ────────────────────────────────────────────────────────── */
.menu-entete{padding-bottom:6px;border-bottom:1px solid var(--line)}
.menu-item{
  background:none;border:none;color:var(--ink);text-align:left;font-size:.95rem;font-weight:600;
  padding:14px 4px;border-bottom:1px solid var(--line);border-radius:0;min-height:auto;
  display:flex;align-items:center;gap:10px;
}
.menu-item.ghosted{color:var(--muted);font-weight:500;border-bottom:none}
.badge.inline{position:static;margin-left:auto}
