/* Espace client TeamClic — charte : noir, chartreuse #b4c83c, Poppins. Mobile d'abord. */
:root {
  --noir: #111111; --noir-2: #1c1c1c; --vert: #b4c83c; --vert-fonce: #8fa12b; --vert-pale: #f2f6dd;
  --fond: #f4f5f0; --carte: #ffffff; --texte: #1a1a1a; --gris: #6b6b6b; --gris-clair: #e7e8e2;
  --rouge: #d64545; --hausse: #2f8f46;
  --r: 16px; --ombre: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.06);
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fond); color: var(--texte); font-family: Poppins, system-ui, sans-serif;
  font-size: 15px; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, select { font: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

/* ---------- barre du haut ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: calc(10px + var(--safe-t)) 14px 10px; background: var(--noir); color: #fff; }
.topbar .logo { height: 26px; }
.site-switch { flex: 1; min-width: 0; display: flex; justify-content: center; }
.site-btn { max-width: 100%; display: inline-flex; align-items: center; gap: 6px; background: var(--noir-2); color: #fff;
  border: 1px solid #333; border-radius: 30px; padding: 6px 12px; font-weight: 600; font-size: 13px; cursor: pointer; }
.site-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { background: none; border: 0; color: #fff; padding: 6px; cursor: pointer; border-radius: 50%; }
.icon-btn:active { background: #222; }

/* ---------- contenu ---------- */
.app { max-width: 760px; margin: 0 auto; padding: 16px 14px calc(96px + var(--safe-b)); }
h1 { font-size: 22px; margin: 4px 0 2px; }
h2 { font-size: 16px; margin: 0 0 12px; }
.sub { color: var(--gris); font-size: 13px; margin: 0 0 14px; }
.card { background: var(--carte); border-radius: var(--r); box-shadow: var(--ombre); padding: 16px; margin-bottom: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--gris); }
.small { font-size: 12px; }

/* ---------- périodes / onglets ---------- */
.chips { display: flex; gap: 8px; margin: 10px 0 14px; overflow-x: auto; scrollbar-width: none; }
.chip { flex: none; border: 1px solid var(--gris-clair); background: #fff; border-radius: 30px; padding: 7px 14px;
  font-size: 13px; font-weight: 500; cursor: pointer; color: var(--texte); }
.chip.on { background: var(--noir); color: var(--vert); border-color: var(--noir); }
.tabs { display: flex; background: var(--gris-clair); border-radius: 12px; padding: 4px; margin-bottom: 12px; }
.tab { flex: 1; border: 0; background: none; padding: 8px; border-radius: 9px; font-weight: 600; font-size: 13px; cursor: pointer; color: var(--gris); }
.tab.on { background: #fff; color: var(--texte); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* ---------- indicateurs ---------- */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--carte); border-radius: var(--r); box-shadow: var(--ombre); padding: 14px; }
.kpi .lbl { font-size: 12px; color: var(--gris); }
.kpi .val { font-size: 24px; font-weight: 700; margin: 2px 0; letter-spacing: -.5px; }
.kpi .delta { font-size: 12px; font-weight: 600; }
.up { color: var(--hausse); } .down { color: var(--rouge); } .flat { color: var(--gris); }
.kpi.accent { background: var(--noir); color: #fff; }
.kpi.accent .lbl { color: #aaa; } .kpi.accent .val { color: var(--vert); }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--vert); box-shadow: 0 0 0 4px rgba(180,200,60,.25); }

/* ---------- graphique ---------- */
.chart { width: 100%; height: 150px; display: block; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--gris); margin-top: 6px; }
.legend b { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------- listes ---------- */
.list { margin: 0; padding: 0; list-style: none; }
.li { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid var(--gris-clair); }
.li:first-child { border-top: 0; }
.li .name { flex: 1; min-width: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .num { font-weight: 600; font-size: 14px; text-align: right; }
.li .bar { height: 4px; background: var(--vert-pale); border-radius: 4px; margin-top: 5px; overflow: hidden; }
.li .bar i { display: block; height: 100%; background: var(--vert); border-radius: 4px; }
.li.link { cursor: pointer; } .li.link:active { background: var(--fond); }
.cols { display: grid; grid-template-columns: 1fr repeat(3, auto); gap: 0 12px; align-items: center; }
.cols .h { font-size: 11px; color: var(--gris); text-transform: uppercase; letter-spacing: .4px; padding-bottom: 6px; text-align: right; }
.cols .h:first-child { text-align: left; }
.cols .c { padding: 10px 0; border-top: 1px solid var(--gris-clair); font-size: 13px; text-align: right; }
.cols .c.q { text-align: left; font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.pos-good { color: var(--hausse); font-weight: 600; }
.more { width: 100%; margin-top: 10px; }

/* ---------- boutons / champs ---------- */
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 8px; border: 0; border-radius: 30px;
  padding: 13px 22px; font-weight: 600; cursor: pointer; background: var(--vert); color: var(--noir); text-decoration: none; }
.btn:disabled { opacity: .5; }
.btn.dark { background: var(--noir); color: #fff; }
.btn.ghost { background: transparent; color: var(--texte); border: 1px solid var(--gris-clair); }
.btn.danger { background: transparent; color: var(--rouge); border: 1px solid #f0caca; }
.btn.block { width: 100%; }
.btn.sm { padding: 8px 14px; font-size: 13px; }
label.f { display: block; font-size: 13px; font-weight: 500; margin: 12px 0 6px; }
input.in, select.in { width: 100%; border: 1px solid var(--gris-clair); border-radius: 12px; padding: 12px 14px; background: #fff;
  font-size: 16px; color: var(--texte); }
input.in:focus, select.in:focus { outline: 2px solid var(--vert); border-color: transparent; }
.code-in { text-align: center; font-size: 28px !important; letter-spacing: 10px; font-weight: 700; }
.check { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--noir); }
.err { color: var(--rouge); font-size: 13px; margin-top: 8px; }
.notice { background: var(--vert-pale); border-radius: 12px; padding: 12px 14px; font-size: 13px; }
.empty { text-align: center; color: var(--gris); padding: 30px 10px; }

/* ---------- connexion ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center;
  background: var(--noir); color: #fff; margin: -16px -14px; padding: 30px 22px calc(30px + var(--safe-b)); }
.login .logo { width: 190px; margin: 0 auto 26px; display: block; }
.login .box { background: #fff; color: var(--texte); border-radius: 22px; padding: 24px 20px; max-width: 420px; width: 100%; margin: 0 auto; }
.login h1 { font-size: 20px; }

/* ---------- barre d'onglets ---------- */
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; display: flex; justify-content: center;
  background: rgba(17,17,17,.97); padding: 6px 6px calc(6px + var(--safe-b)); backdrop-filter: blur(8px); }
.tabbar a { flex: 1; max-width: 140px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0;
  color: #9a9a9a; text-decoration: none; font-size: 11px; font-weight: 500; border-radius: 12px; }
.tabbar a.on { color: var(--vert); }
.tabbar svg { width: 23px; height: 23px; }

/* ---------- panneau du bas ---------- */
.sheet { position: fixed; inset: 0; z-index: 40; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow: auto; background: #fff;
  border-radius: 22px 22px 0 0; padding: 18px 18px calc(22px + var(--safe-b)); max-width: 760px; margin: 0 auto; }
.sheet-panel .grab { width: 40px; height: 5px; background: var(--gris-clair); border-radius: 4px; margin: 0 auto 14px; }
.opt { display: block; width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--gris-clair);
  padding: 14px 4px; font-size: 15px; cursor: pointer; }
.opt:first-of-type { border-top: 0; } .opt.on { font-weight: 700; } .opt.on::after { content: " ✓"; color: var(--vert-fonce); }

.toast { position: fixed; left: 50%; bottom: calc(84px + var(--safe-b)); transform: translateX(-50%); z-index: 50;
  background: var(--noir); color: #fff; padding: 11px 18px; border-radius: 30px; font-size: 14px; box-shadow: var(--ombre); max-width: 90vw; }

.loader { width: 34px; height: 34px; margin: 60px auto; border: 3px solid var(--gris-clair); border-top-color: var(--vert);
  border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, #eee 25%, #f6f6f6 50%, #eee 75%); background-size: 200% 100%;
  animation: shimmer 1.2s infinite; border-radius: var(--r); }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (min-width: 640px) {
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .chart { height: 200px; }
}

/* ---------- installation ---------- */
.install { display: flex; align-items: center; gap: 12px; position: relative; padding-right: 34px; border: 1px solid var(--vert); }
.install-ic { width: 44px; height: 44px; border-radius: 11px; flex: none; }
.install-x { position: absolute; top: 2px; right: 4px; border: 0; background: none; font-size: 22px; color: var(--gris); cursor: pointer; padding: 4px 8px; }
.steps { list-style: none; counter-reset: s; margin: 6px 0 16px; padding: 0; }
.steps li { counter-increment: s; display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--gris-clair); font-size: 15px; }
.steps li:first-child { border-top: 0; }
.steps li::before { content: counter(s); flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--noir); color: var(--vert);
  font-weight: 700; font-size: 13px; display: grid; place-items: center; margin-top: 7px; }
.step-ic { flex: none; width: 40px; height: 40px; border-radius: 10px; background: var(--fond); display: grid; place-items: center; color: #0a84ff; }
.arrow-hint { text-align: center; color: var(--vert-fonce); font-weight: 700; font-size: 13px; margin-top: 14px; animation: bob 1.2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(5px); } }
