/* FLERP Agro — agro.flerp.me. Accent VERT #4CAF50 (charte suite).
   Police système (les apps de la suite restent en police système). */
:root {
  --reco: #4CAF50; --reco-d: #2E7D32; --reco-soft: #E8F5E9;
  --bg: #F5F6FA; --panel: #FFFFFF; --ink: #16202E; --muted: #6B7688;
  --line: #E6E9F0; --line-2: #EEF1F6;
  --good: #1E9E5A; --ink-2: #0F172A;
  --shadow: 0 1px 2px rgba(16,32,46,.04), 0 12px 30px -18px rgba(16,32,46,.25);
  --radius: 16px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; min-height: 100vh;
  overscroll-behavior-y: contain;  /* coupe le rebond natif iOS → notre pull-to-refresh gère le geste */
}
a { color: inherit; text-decoration: none; }
h1 { font-size: 1.55rem; letter-spacing: -.02em; }
h2 { font-size: 1.15rem; letter-spacing: -.01em; }
.ic { width: 24px; height: 24px; display: block; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---- Topbar ---- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 22px;
  padding: 0 clamp(16px, 4vw, 34px); height: 62px;
  background: rgba(255,255,255,.86); backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-ic { width: 30px; height: 30px; }
.brand-txt { font-weight: 600; font-size: 1.05rem; letter-spacing: -.01em; }
.brand-txt b { color: var(--reco-d); font-weight: 700; }
.topnav { display: flex; gap: 4px; margin-left: 8px; }
.topnav a {
  padding: 8px 14px; border-radius: 10px; color: var(--muted); font-weight: 500;
  transition: background .15s, color .15s;
}
.topnav a:hover { background: var(--line-2); color: var(--ink); }
.topnav a.on { background: var(--reco-soft); color: var(--reco-d); }
.topright { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.whoami { text-align: right; line-height: 1.2; }
.who-name { display: block; font-weight: 600; font-size: .9rem; }
.who-meta { display: block; font-size: .76rem; color: var(--muted); }
.btn-portal {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px;
  border: 1px solid var(--line); color: var(--muted); font-size: 1rem;
}
.btn-portal:hover { border-color: var(--reco); color: var(--reco-d); }
.btn-logout {
  padding: 8px 14px; border-radius: 10px; font-weight: 600; font-size: .85rem;
  color: var(--reco-d); background: var(--reco-soft);
}
.btn-logout:hover { background: #D7EDD9; }

/* ---- Layout ---- */
.wrap { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto;
  padding: clamp(20px, 4vw, 38px) clamp(16px, 4vw, 34px); }
.wrap.centered { display: grid; place-items: center; }
.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 22px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.eyebrow { color: var(--reco-d); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.lead { color: var(--muted); margin-top: 4px; }
.section-h { margin: 30px 0 14px; }

/* ---- KPIs ---- */
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.kpi {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 16px; box-shadow: var(--shadow);
}
.kpi-n { display: block; font-size: 2rem; font-weight: 700; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums; line-height: 1; }
.kpi-n.acc { color: var(--reco-d); }
.kpi-l { display: block; color: var(--muted); font-size: .82rem; margin-top: 6px; }

/* ---- Modules ---- */
.modules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.mod {
  position: relative; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
  transition: transform .18s, border-color .18s, box-shadow .25s; display: block;
}
a.mod:hover { transform: translateY(-3px); border-color: rgba(76,175,80,.5);
  box-shadow: 0 18px 40px -20px rgba(76,175,80,.5); }
.mod.soon { opacity: .72; }
.mod-ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: var(--reco-soft); color: var(--reco-d); margin-bottom: 14px; }
.mod.soon .mod-ic { background: var(--line-2); color: var(--muted); }
.mod h3 { font-size: 1.05rem; margin-bottom: 6px; }
.mod p { color: var(--muted); font-size: .88rem; }
.tag { position: absolute; top: 18px; right: 18px; font-size: .68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; padding: 4px 9px; border-radius: 999px;
  background: var(--line-2); color: var(--muted); }
.tag.ok { background: #E4F6EC; color: var(--good); }

/* ---- Tables ---- */
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th { text-align: left; padding: 13px 16px; color: var(--muted); font-weight: 600;
  font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line); }
table.data td { padding: 13px 16px; border-bottom: 1px solid var(--line-2); }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: #FAFBFD; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .84rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.pill { display: inline-block; font-size: .74rem; font-weight: 600; padding: 3px 10px;
  border-radius: 999px; background: var(--line-2); color: var(--muted); }
.pill.on { background: #E4F6EC; color: var(--good); }

/* ---- Catálogos ---- */
.cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: auto; }  /* auto : les tableaux défilent au lieu de déborder (mobile) */
.card-h { padding: 16px 18px; border-bottom: 1px solid var(--line); font-size: 1rem; }
.card .data th, .card .data td { padding-left: 18px; padding-right: 18px; }

/* ---- Empty state ---- */
.empty { background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 48px 24px; text-align: center; }
.empty-ic { width: 58px; height: 58px; border-radius: 16px; margin: 0 auto 16px;
  display: grid; place-items: center; background: var(--reco-soft); color: var(--reco-d); }
.empty-ic .ic { width: 30px; height: 30px; }
.empty h2 { margin-bottom: 8px; }
.empty p { color: var(--muted); max-width: 46ch; margin: 0 auto; }
.empty-cols { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 22px; }
.empty-cols span { font-size: .78rem; color: var(--muted); background: var(--bg);
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; }

/* ---- Login ---- */
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 22px;
  box-shadow: var(--shadow); padding: 44px 40px; max-width: 400px; text-align: center; }
.login-ic { width: 66px; height: 66px; margin: 0 auto 18px; display: block; }
.login-card h1 { font-size: 1.7rem; } .login-card h1 b { color: var(--reco-d); }
.login-sub { color: var(--muted); margin: 8px 0 26px; }
.btn-flerp { display: inline-flex; align-items: center; justify-content: center; width: 100%;
  height: 50px; border-radius: 13px; font-weight: 700; font-size: 1rem; color: #fff;
  background: linear-gradient(135deg, #66BB6A, var(--reco-d)); box-shadow: 0 10px 24px -8px rgba(76,175,80,.6);
  transition: transform .15s, box-shadow .2s; }
.btn-flerp:hover { transform: translateY(-2px); box-shadow: 0 16px 32px -10px rgba(76,175,80,.7); }
.btn-flerp.ghost { background: none; color: var(--reco-d); border: 1.5px solid var(--reco); box-shadow: none; }
.login-note { color: var(--muted); font-size: .84rem; margin-top: 16px; }
.banner-error { background: #FDECEC; color: #B42318; border-radius: 10px; padding: 10px 14px;
  font-size: .88rem; margin-bottom: 18px; }

/* ---- Formulaires (fiche employé / terminal / import) ---- */
.head-actions { display: flex; gap: 10px; align-items: center; }
.btn-flerp.slim { width: auto; height: 42px; padding: 0 20px; font-size: .92rem; border-radius: 11px; }
.btn-sec { display: inline-flex; align-items: center; height: 42px; padding: 0 18px; border-radius: 11px;
  font-weight: 600; font-size: .92rem; color: var(--reco-d); border: 1.5px solid var(--reco);
  background: #fff; transition: background .15s; }
.btn-sec:hover { background: var(--reco-soft); }
.btn-cancel { display: inline-flex; align-items: center; height: 42px; padding: 0 16px;
  color: var(--muted); font-weight: 600; font-size: .92rem; }
.btn-cancel:hover { color: var(--ink); }
.form-card { padding: 26px; }
.form-card.bare { border: none; box-shadow: none; padding: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 22px; }
.form-grid.one { grid-template-columns: 1fr; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: .84rem;
  font-weight: 600; color: var(--muted); }
.form-grid input:not([type=checkbox]), .form-grid select, .map-grid select {
  height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; color: var(--ink); background: #fff; }
.form-grid input:focus, .form-grid select:focus, .map-grid select:focus {
  outline: 2px solid rgba(76,175,80,.45); outline-offset: 1px; border-color: var(--reco); }
label.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 500;
  color: var(--ink); padding-top: 20px; }
label.check input { width: 17px; height: 17px; accent-color: var(--reco-d); }
.form-actions { display: flex; gap: 14px; align-items: center; margin-top: 24px; }
.form-actions.center { justify-content: center; }
.cell-link { color: var(--reco-d); font-weight: 600; }
.cell-link.plain { color: var(--ink); font-weight: 500; }
.cell-link:hover { text-decoration: underline; }
.small { font-size: .8rem; }
.pad { padding: 18px; }

/* import */
.file-drop { display: grid; place-items: center; border: 2px dashed var(--line); border-radius: 14px;
  padding: 40px 20px; cursor: pointer; color: var(--muted); transition: border-color .15s, background .15s; }
.file-drop:hover { border-color: var(--reco); background: var(--reco-soft); color: var(--reco-d); }
.file-drop input { max-width: 100%; }
.imp-count { font-weight: 700; color: var(--reco-d); margin-bottom: 14px; }
.card-h.bare { border: none; padding: 14px 0 10px; }
.map-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 18px; }
.map-grid label { display: flex; flex-direction: column; gap: 5px; font-size: .8rem;
  font-weight: 600; color: var(--muted); }
.table-wrap.slim { max-height: 320px; }
table.data.compact th, table.data.compact td { padding: 8px 10px; font-size: .8rem; white-space: nowrap; }
.center-card { text-align: center; }
.ok-ic { background: #E4F6EC; color: var(--good); }
.imp-result { color: var(--muted); margin-top: 6px; }
.imp-result b { color: var(--ink); }

/* ---- Pase de lista (mobile-first, gros doigts, plein soleil) ---- */
.pase-wrap { max-width: 640px; margin: 0 auto; }
.pase-pick { display: flex; gap: 8px; }
.pase-pick select { height: 42px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; font: inherit; }
.btn-sec.slim-h { height: 42px; }
.pase-bar { padding: 16px 18px; margin-bottom: 14px; }
.pase-horas { display: flex; gap: 18px; }
.pase-horas label { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; font-weight: 600; color: var(--muted); }
.pase-horas input { height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 1.05rem; }
.pase-hint { color: var(--reco-d); font-weight: 600; font-size: .9rem; margin-top: 12px; }
.pase-counts { color: var(--muted); margin-top: 6px; font-size: .95rem; }
.pase-counts b { color: var(--ink); font-variant-numeric: tabular-nums; }
.pase-lista { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.pase-emp {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "nom badge" "dni badge";
  gap: 0 12px; align-items: center; cursor: pointer; user-select: none;
  background: var(--panel); border: 2px solid var(--line); border-radius: 14px;
  padding: 12px 16px; min-height: 62px; transition: background .12s, border-color .12s;
}
.pase-nom { grid-area: nom; font-weight: 600; }
.pase-dni { grid-area: dni; color: var(--muted); font-size: .78rem; }
.pase-badge { grid-area: badge; font-size: .74rem; font-weight: 700; text-transform: uppercase;
  padding: 5px 12px; border-radius: 999px; }
.presente-b { background: #E4F6EC; color: var(--good); display: inline-block; }
.ausente-b { background: #FDECEC; color: #B42318; display: none; }
.pase-emp.ausente { background: #FFF6F5; border-color: #F3C1BB; opacity: .85; }
.pase-emp.ausente .pase-nom { text-decoration: line-through; color: var(--muted); }
.pase-emp.ausente .presente-b { display: none; }
.pase-emp.ausente .ausente-b { display: inline-block; }
.pase-vacio { color: var(--muted); padding: 18px; text-align: center; }
.pase-actions { position: sticky; bottom: 12px; margin-top: 16px; }
.pase-actions .btn-flerp { width: 100%; height: 54px; font-size: 1.05rem; }
.pase-status { text-align: center; margin-top: 10px; font-weight: 600; font-size: .9rem; }
.pase-status.ok { color: var(--good); } .pase-status.ko { color: #B42318; }
.banner-ok { background: #E4F6EC; color: var(--good); border-radius: 12px; padding: 12px 16px; font-weight: 600; margin-bottom: 14px; }
.banner-info { background: #E8F1FD; color: #1B5FBF; border-radius: 12px; padding: 12px 16px; font-weight: 600; margin-bottom: 14px; }
.banner-warn { background: #E8F5E9; color: var(--reco-d); border-radius: 12px; padding: 12px 16px; font-weight: 600; margin-bottom: 14px; }

/* ---- App launcher (PWA installée, plein pouce) ---- */
.app-wrap { max-width: 560px; margin: 0 auto; }
.app-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.app-hello { color: var(--muted); font-size: .95rem; }
.app-name { font-size: 1.8rem; letter-spacing: -.02em; }
.app-cua { color: var(--muted); margin-top: 4px; font-weight: 600; }
.app-modo { display: inline-block; margin-left: 8px; font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; padding: 3px 10px; border-radius: 999px;
  background: var(--reco-soft); color: var(--reco-d); }
.app-gear { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 13px;
  border: 1px solid var(--line); background: var(--panel); color: var(--muted); }
.app-gear svg { width: 24px; height: 24px; }
.app-gear:active { background: var(--reco-soft); color: var(--reco-d); }
.app-pick { margin-bottom: 16px; }
.app-tiles { display: flex; flex-direction: column; gap: 14px; }
.app-tile { position: relative; display: block; background: var(--panel); border: 2px solid var(--line);
  border-radius: 18px; padding: 22px; box-shadow: var(--shadow); min-height: 110px; }
a.app-tile:active { border-color: var(--reco); background: var(--reco-soft); }
.app-tile.soon { opacity: .6; }
.app-tile-ic { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  background: var(--reco-soft); color: var(--reco-d); margin-bottom: 12px; }
.app-tile-ic .ic { width: 28px; height: 28px; }
.app-tile-t { display: block; font-weight: 700; font-size: 1.2rem; }
.app-tile-d { display: block; color: var(--muted); font-size: .9rem; margin-top: 4px; }
.pin-input { height: 56px; width: 200px; margin: 14px auto 0; display: block; text-align: center;
  font-size: 1.6rem; letter-spacing: .3em; border: 1px solid var(--line); border-radius: 12px; }
.aj-metodos { list-style: none; display: flex; flex-direction: column; gap: 8px; margin: 8px 0 4px; }

/* ---- Validation ---- */
.pill.warn { background: var(--reco-soft); color: var(--reco-d); margin-left: 8px; }
.val-table input[type=time] { height: 38px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.val-table input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--good); }
.val-table tr.val-off td { opacity: .55; }
.jefe-edit { display: flex; gap: 6px; }
.jefe-edit input[type=text] { height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: .82rem; min-width: 210px; }
.btn-mini-ok { border: none; background: #E4F6EC; color: var(--good); border-radius: 8px; width: 34px; height: 34px; cursor: pointer; font-weight: 700; }
.btn-mini-ok:hover { background: #CDEEDD; }

/* ---- Responsive ---- */
@media (max-width: 1000px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .modules { grid-template-columns: 1fr 1fr; }
  .cat-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .topnav { display: none; }
  .whoami { display: none; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .modules { grid-template-columns: 1fr; }
  .form-grid, .map-grid { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; align-items: flex-start; }
  /* tableaux : compacts + défilement horizontal fluide (plus de colonnes coupées) */
  table.data { font-size: .82rem; min-width: 430px; }
  table.data th, table.data td { padding: 10px 10px; white-space: nowrap; }
  .card, .table-wrap { -webkit-overflow-scrolling: touch; }
  .jefe-edit input[type=text] { min-width: 150px; }
  .wrap { padding-left: 12px; padding-right: 12px; }
}

/* ---- Mode d'emploi + batterie de tests (R1.5) ---- */
.app-guia-link { text-align: center; margin: 22px 0 4px; }
.app-guia-link a { color: var(--muted); font-weight: 600; font-size: .92rem;
  border-bottom: 1px dashed var(--line); padding-bottom: 2px; }
.app-guia-link a:hover { color: var(--reco-d); border-color: var(--reco); }

.guia { margin-bottom: 16px; padding: 18px 20px; }
.guia .card-h { margin-bottom: 8px; }
.guia p { margin: 6px 0; }
.guia-steps { margin: 6px 0 2px; padding-left: 1.25em; }
.guia-steps li { margin: 7px 0; }
.guia-steps ul { margin: 5px 0 5px; padding-left: 1.1em; }
.guia-steps ul li { margin: 3px 0; color: var(--muted); }
.guia b { color: var(--ink-2); }

.pruebas { margin-top: 16px; padding: 16px 20px; }
.pruebas > summary { cursor: pointer; list-style: none; }
.pruebas > summary::-webkit-details-marker { display: none; }
.pruebas > summary::before { content: "▸"; color: var(--reco); margin-right: 8px; }
.pruebas[open] > summary::before { content: "▾"; }
.pruebas-list { list-style: none; margin: 12px 0 6px; padding: 0; }
.pruebas-list li { margin: 2px 0; }
.pruebas-list label { display: flex; gap: 10px; align-items: flex-start;
  padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.pruebas-list label:hover { background: var(--reco-soft); }
.pruebas-list input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--reco); flex: none; }

/* ---- R1.6 : sections numérotées de l'engrenage + bascule bureau/app + identifiants chef ---- */
.aj-sec { padding-top: 20px; margin-top: 20px; border-top: 1px solid var(--line-2); }
.aj-sec.first { padding-top: 0; margin-top: 0; border-top: 0; }
.aj-num { display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; margin-right: 10px; border-radius: 50%;
  background: var(--reco); color: #fff; font-size: .85rem; font-weight: 800; flex: none; }
.pruebas > summary .aj-num { margin-right: 8px; }

.btn-verapp { display: inline-flex; align-items: center; gap: 6px; height: 34px;
  padding: 0 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--reco-soft); color: var(--reco-d); font-weight: 700; font-size: .85rem; }
.btn-verapp:hover { border-color: var(--reco); }
@media (max-width: 900px) { .verapp-txt { display: none; } .btn-verapp { padding: 0 10px; } }

.jefe-box { margin-top: 18px; padding: 14px 16px; border: 1px dashed var(--reco);
  border-radius: 12px; background: var(--reco-soft); }
.jefe-box .check { margin-bottom: 4px; }
.pill.slim { font-size: .78rem; padding: 2px 8px; }

.cred-banner { margin-bottom: 18px; padding: 18px 20px; border-radius: var(--radius);
  border: 2px solid var(--good); background: #F0FBF4; }
.cred-banner.exist { border-color: var(--line); background: var(--panel); }
.cred-banner h2 { margin-bottom: 4px; }
.cred-grid { display: flex; flex-wrap: wrap; gap: 12px 28px; margin: 12px 0 8px; }
.cred-grid > div { display: flex; flex-direction: column; }
.cred-l { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.cred-grid b { font-size: 1.25rem; user-select: all; }

/* ---- R2 : picaje palox (chef, gros doigts) ---- */
.pk { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 18px 20px; margin-bottom: 16px; }
.pk-field { display: block; margin-bottom: 14px; font-weight: 600; color: var(--muted); font-size: .9rem; }
.pk-sel { display: block; width: 100%; margin-top: 6px; height: 54px; font-size: 1.1rem;
  padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.pk-palox { display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin: 6px 0 18px; }
.pk-palox-l { font-weight: 700; font-size: 1.05rem; }
.pk-stepper { display: flex; align-items: center; gap: 8px; }
.pk-step { width: 56px; height: 56px; border-radius: 14px; border: 1px solid var(--reco);
  background: var(--reco-soft); color: var(--reco-d); font-size: 1.8rem; font-weight: 700;
  line-height: 1; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.pk-step:active { background: var(--reco); color: #fff; }
.pk-nb { width: 76px; height: 56px; text-align: center; font-size: 1.7rem; font-weight: 800;
  border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); }
.pk-registrar { width: 100%; height: 60px; font-size: 1.2rem; }
.pk-registrar:disabled { opacity: .45; }
.pk-status { text-align: center; margin-top: 10px; font-weight: 600; min-height: 1.2em; }
.pk-status.ok { color: var(--good); }
.pk-status.ko { color: #C0392B; }

.pk-hoy { padding: 14px 18px 8px; }
.card-h-row { display: flex; align-items: baseline; justify-content: space-between; }
.pk-total b { font-size: 1.5rem; color: var(--reco-d); }
.pk-list { list-style: none; margin: 8px 0; padding: 0; }
.pk-list li { display: flex; align-items: center; gap: 10px; padding: 11px 4px;
  border-top: 1px solid var(--line-2); }
.pk-li-main { flex: 1; }
.pk-li-main b { color: var(--reco-d); font-size: 1.1rem; }
.pk-li-h { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.pk-del { width: 34px; height: 34px; flex: none; border-radius: 9px; border: 1px solid var(--line);
  background: #fff; color: #C0392B; font-size: 1rem; cursor: pointer; }
.pk-del:active { background: #FDECEA; }
.pk-empty { padding: 8px 0 6px; }

/* visor admin : ligne annulée */
table.data tr.anulado { opacity: .5; text-decoration: line-through; }
table.data .num { text-align: right; }
/* picaje : ligne en attente d'envoi (offline) / en erreur (échec définitif, à ressaisir) */
.pk-list li.pk-pending { opacity: .7; }
.pk-list li.pk-pending .pk-li-h::after { content: " ⏳"; }
.pk-list li.pk-err { background: #FDECEA; }
.pk-list li.pk-err .pk-li-main b { color: #C0392B; }

/* ---- R2 detail : bascule bureau/app, stats visor, nouvelle cuadrilla ---- */
.btn-toggle, .app-toggle { display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--panel); color: var(--reco-d); flex: none; }
.btn-toggle svg, .app-toggle svg { width: 22px; height: 22px; }
.btn-toggle:hover, .app-toggle:hover { border-color: var(--reco); background: var(--reco-soft); }
.app-top-btns { display: flex; gap: 10px; align-items: center; }

.pk-kpis { margin-bottom: 6px; }
.stats-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.stats-2col .card { padding: 14px 16px; }
@media (max-width: 760px) { .stats-2col { grid-template-columns: 1fr; } }

.nueva-cua { margin-bottom: 16px; padding: 14px 18px; }
.nueva-cua > summary { cursor: pointer; }
.form-inline-cua { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 0 6px; }
.form-inline-cua input[type=text], .form-inline-cua select { height: 42px; padding: 0 12px;
  border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.form-inline-cua input[type=text] { flex: 1; min-width: 180px; }
.check.inline { display: inline-flex; align-items: center; gap: 6px; }

/* ---- Pull-to-refresh (tirer vers le bas pour actualiser — PWA iPhone/Android) ---- */
#ptr-ind {
  position: fixed; top: 0; left: 50%; margin-left: -19px;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--panel); box-shadow: 0 2px 12px rgba(16,32,46,.18);
  display: flex; align-items: center; justify-content: center;
  z-index: 999; opacity: 0; pointer-events: none;
  transform: translateY(-46px); transition: transform .12s ease-out, opacity .12s ease-out;
}
#ptr-ind.visible { opacity: 1; }
#ptr-ind .ptr-spin {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid var(--line-2); border-top-color: var(--reco);
}
#ptr-ind.ready .ptr-spin { border-top-color: var(--good); }
#ptr-ind.spin .ptr-spin { animation: ptr-rot .7s linear infinite; }
@keyframes ptr-rot { to { transform: rotate(360deg); } }

/* ---- R3 : Apuntar tarea (écran chef) + engrenage con_tareas + tarifs catalogue ---- */
.tr-horas { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tr-time { width: 100%; }
input[type=time].pk-sel { -webkit-appearance: none; appearance: none; }
.tr-li-det { display: block; font-size: .8rem; color: var(--muted); margin-top: 2px; }
.aj-cua { display: flex; flex-direction: column; gap: 6px; }
.aj-contareas { font-size: .85rem; color: var(--muted); }
.tarifa-in { width: 90px; text-align: right; padding: 6px 8px; border: 1px solid var(--line);
  border-radius: 8px; font: inherit; }
.tarifa-save { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 18px; border-top: 1px solid var(--line-2); }

/* ---- Batterie de tests groupée (recette R1→R3.1 avec Christo) ---- */
.pruebas-grp h3 { font-size: .82rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--reco-d); margin: 16px 0 6px; }
.pruebas-foot { display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 14px; flex-wrap: wrap; }

/* ---- Confort bureau (2026-07-06) : filtre par table, recherche de menus, 2 colonnes réglages,
        drag des cases du tableau de bord ---- */
.filter-row { display: flex; gap: 8px; align-items: center; padding: 10px 14px;
  border-bottom: 1px solid var(--line-2); background: #FAFBFD; position: sticky; left: 0; }
.filter-sel { height: 36px; padding: 0 8px; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; font: inherit; font-size: .85rem; color: var(--muted); max-width: 45%; }
.filter-q { flex: 1; min-width: 120px; height: 36px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: 9px; font: inherit; font-size: .9rem; }
.filter-q:focus { outline: none; border-color: var(--reco); }
.filter-count { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums;
  white-space: nowrap; }

.menu-search { position: relative; margin-left: 6px; }
.menu-search input { height: 36px; width: 170px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: 10px; font: inherit; font-size: .85rem; background: #fff; transition: width .15s; }
.menu-search input:focus { outline: none; border-color: var(--reco); width: 230px; }
.menu-sug { position: absolute; top: 42px; left: 0; min-width: 230px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px;
  display: flex; flex-direction: column; gap: 2px; z-index: 40; }
.menu-sug-it { text-align: left; padding: 9px 12px; border: 0; background: none; border-radius: 8px;
  font: inherit; font-size: .9rem; cursor: pointer; color: var(--ink); }
.menu-sug-it:hover, .menu-sug-it.on { background: var(--reco-soft); color: var(--reco-d); }
@media (max-width: 900px) { .menu-search { display: none; } }

.aj-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 860px) { .aj-cols { grid-template-columns: 1fr; } }
.aj-col-t { font-size: .95rem; margin: 0 0 10px; color: var(--muted); }

.section-h-row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.dash-hint { display: none; }
@media (min-width: 900px) { .dash-hint { display: inline; } }
.mod[draggable=true] { cursor: grab; }
.mod.dragging { opacity: .45; border-style: dashed; cursor: grabbing; }

/* =====================================================================
   DÉCISION DESIGN FLORIAN 2026-07-06 : peau « iOS plat » (charte FLERP
   validée 01-07) + bureau SIDEBAR HYBRIDE (option par compte : barra).
   ===================================================================== */
:root { --bg: #F2F2F7; --radius: 12px; --shadow: none;
  --line: #E2E2E7; --line-2: #ECECF1; }
.kpi, .mod, .table-wrap, .card, .login-card, .app-tile { border-color: transparent; }
a.app-tile:active { border-color: var(--reco); }   /* le feedback tactile garde l'accent */

/* --- corrections visuelles (captures Florian 06-07) --- */
.menu-sug[hidden] { display: none; }               /* display:flex écrasait l'attribut hidden */
.topnav a { white-space: nowrap; }                 /* « Pase de lista » ne se plie plus sur 3 lignes */
.topnav { overflow-x: auto; scrollbar-width: none; }
.topnav::-webkit-scrollbar { display: none; }
.aj-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }  /* colonnes VRAIMENT égales */
@media (max-width: 860px) { .aj-cols { grid-template-columns: minmax(0, 1fr); } }
.app-wrap:has(.aj-cols) { max-width: 1080px; }     /* la page réglages 2 colonnes respire */
.aj-disp-form { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.aj-disp-form select { flex: 1; min-width: 0; height: 42px; padding: 0 12px;
  border-radius: 10px; border: 1px solid var(--line); background: #fff; font: inherit; }

/* --- sidebar hybride (bureau, ≥ 900 px) --- */
.sidebar { display: none; }
body.with-side { display: grid; grid-template-columns: 232px minmax(0, 1fr);
  grid-template-rows: auto 1fr auto; }
body.with-side > .sidebar { display: flex; flex-direction: column; gap: 2px;
  grid-column: 1; grid-row: 1 / span 3;
  padding: 16px 12px; background: var(--panel); border-right: 1px solid var(--line-2);
  position: sticky; top: 0; height: 100vh; overflow-y: auto; }
body.with-side > .topbar { grid-column: 2; grid-row: 1; }
body.with-side > .wrap { grid-column: 2; grid-row: 2; }
body.with-side > .foot { grid-column: 2; grid-row: 3; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 16px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px;
  border-radius: 10px; font-size: .92rem; font-weight: 500; color: var(--muted);
  white-space: nowrap; }
.side-nav a .ic { width: 18px; height: 18px; stroke-width: 1.9; flex: none; }
.side-nav a:hover { background: var(--line-2); color: var(--ink); }
.side-nav a.on { background: var(--reco-soft); color: var(--reco-d); font-weight: 600; }
@media (min-width: 900px) {
  body.with-side .topbar .topnav { display: none; }   /* la sidebar EST la nav */
  body.with-side .topbar > .brand { display: none; }  /* la marque vit dans la sidebar */
  body.with-side .menu-search { margin-left: 0; }
}
@media (max-width: 899px) {
  body.with-side { display: flex; flex-direction: column; }  /* petit écran : gabarit classique */
  body.with-side > .sidebar { display: none; }
}

/* --- écrans larges (retour Florian 06-07) : le bureau UTILISE l'écran, fini les zones mortes.
       En sidebar, le contenu prend toute la largeur ; les grilles se densifient toutes seules. --- */
body.with-side > .wrap { max-width: none; }
.modules { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

/* --- correctifs GROSSE VÉRIF (2026-07-06) --- */
.svg-defs { position: absolute; width: 0; height: 0; }   /* le style inline violait la CSP */
/* topbar sticky morte en grid : le body devient la hauteur de l'écran, le CONTENU scrolle
   dans .wrap → topbar et sidebar toujours visibles (comme en mode barra) */
body.with-side { height: 100vh; grid-template-rows: auto minmax(0, 1fr) auto; }
body.with-side > .sidebar { position: static; height: auto; }
body.with-side > .wrap { overflow-y: auto; }

/* ---- R2.3 : estimation fin de journée (paramètres de journée) ---- */
.est-params { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; padding: 14px 18px;
  margin-bottom: 16px; }
.est-params label { display: flex; flex-direction: column; gap: 4px; font-size: .78rem; color: var(--muted); }
.est-params input { height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; font: inherit; }
.est-params input[type=number] { width: 96px; }
.est-params button { align-self: flex-end; }

/* ---- R4 : listados dynamiques ---- */
.lst-panel[hidden] { display: none; }  /* sinon .lst-tcd-sel{display:flex} écrase hidden */
.lst-saved { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.lst-saved-chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 6px 5px 12px; background: #fff; font-size: .85rem; }
.lst-saved-chip.on { border-color: var(--reco); box-shadow: 0 0 0 2px rgba(76,175,80,.15); }
.lst-saved-chip a { text-decoration: none; color: inherit; font-weight: 600; }
.lst-del-form { display: inline; }
.lst-del { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: .8rem;
  padding: 2px 6px; border-radius: 50%; }
.lst-del:hover { color: #c0392b; background: rgba(192,57,43,.1); }
.lst-builder { padding: 16px 18px; margin-bottom: 12px; }
.lst-modes { display: flex; gap: 18px; margin-bottom: 12px; }
.lst-mode { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; cursor: pointer; }
.lst-filtros { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; margin-bottom: 12px; }
.lst-filtros label { display: flex; flex-direction: column; gap: 4px; font-size: .78rem; color: var(--muted); }
.lst-filtros input, .lst-filtros select { height: 40px; padding: 0 10px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; font: inherit; min-width: 130px; }
.lst-lab { font-size: .8rem; font-weight: 700; color: var(--muted); margin: 10px 0 6px; }
.lst-chips { display: flex; flex-wrap: wrap; gap: 8px; min-height: 34px; }
#lst-groups { border: 1px dashed var(--line); border-radius: 12px; padding: 8px; background: rgba(76,175,80,.03); }
.lst-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 12px; background: #fff; font: inherit; font-size: .85rem;
  cursor: pointer; user-select: none; }
.lst-chip.on { border-color: var(--reco); background: rgba(76,175,80,.08); font-weight: 600; cursor: grab; }
.lst-chip.drag { opacity: .5; }
.lst-x { border: 0; background: none; padding: 0 2px; font: inherit; cursor: pointer;
  color: var(--muted); font-weight: 400; }
.lst-x:hover { color: #c0392b; }
.lst-meds { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.lst-meds .chk { display: inline-flex; align-items: center; gap: 7px; }
.lst-tcd-sel { display: flex; flex-wrap: wrap; gap: 14px; }
.lst-tcd-sel label { display: flex; flex-direction: column; gap: 4px; font-size: .78rem; color: var(--muted); }
.lst-tcd-sel select { height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; font: inherit; min-width: 150px; }
.lst-actions { display: flex; gap: 10px; margin-top: 14px; }
.lst-guardar { display: flex; gap: 8px; margin: 0 0 14px; }
.lst-guardar input[type=text] { flex: 0 1 320px; height: 40px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px; font: inherit; }
.lst-scroll { overflow-x: auto; }
.lst-sub td { background: rgba(76,175,80,.07); font-weight: 700; border-top: 2px solid var(--line); }
.lst-total td { background: rgba(76,175,80,.14); font-weight: 800; border-top: 2px solid var(--reco); }
.lst-tcd th, .lst-tcd td { white-space: nowrap; }

/* ---- barres d'onglets de page (nav 3 niveaux, 07-07) — souligné, accent orange ---- */
.rtabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line);
  margin: 4px 0 18px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  touch-action: pan-x; scrollbar-width: none; }
.rtabs::-webkit-scrollbar { display: none; }
.rtabs a { display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
  padding: 9px 2px 11px; color: var(--muted); font-weight: 650; text-decoration: none;
  border-bottom: 2.5px solid transparent; white-space: nowrap; }
.rtabs a:hover { color: var(--ink); }
.rtabs a.on { color: var(--reco); border-bottom-color: var(--reco); }
.rtabs a .ic { width: 17px; height: 17px; }

/* ---- inicio composable (personnalisation des tuiles par compte, 07-07) ---- */
.dash-tools { display: flex; align-items: center; gap: 14px; }
.mod { position: relative; }
.mod-x { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; display: none;
  align-items: center; justify-content: center; border: 0; border-radius: 50%;
  background: #fff; color: #c0392b; box-shadow: 0 1px 4px rgba(0,0,0,.18); cursor: pointer;
  font-size: 13px; line-height: 1; z-index: 2; }
.mod-x:hover { background: #c0392b; color: #fff; }
body.dash-editing .mod-x { display: flex; }
body.dash-editing .mod { cursor: grab; }
body.dash-editing .modules { outline: 2px dashed rgba(76,175,80,.35); outline-offset: 8px; border-radius: 16px; }
.dash-add { margin: 14px 0 4px; padding: 14px 16px; border: 1px solid var(--line);
  border-radius: 14px; background: var(--reco-soft); }
.dash-add-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.dash-add-it { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 14px; background: #fff; font: inherit; font-size: .88rem;
  cursor: pointer; }
.dash-add-it:hover { border-color: var(--reco); box-shadow: 0 0 0 2px rgba(76,175,80,.14); }
.dash-add-it .add-plus { color: var(--reco); font-weight: 800; font-size: 1rem; }
.dash-add-it .add-txt b { color: var(--muted); font-weight: 700; }
.dash-add-vacio { width: 100%; margin: 4px 0 0; }

/* ---- logo de la société connectée (07-08) : sidebar + topbar + après le « Hola » ---- */
.soc-logo { background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 4px 8px; object-fit: contain; }
.side-soc { display: block; height: 38px; width: auto; max-width: calc(100% - 20px);
  margin: 2px 10px 12px; }
.top-soc { height: 26px; margin-left: 10px; flex-shrink: 0; }
.dash-hello { display: inline-flex; align-items: center; gap: 10px; }
.hello-soc { height: 26px; }
@media (max-width: 899px) { .top-soc { display: none; } }  /* topbar mobile déjà dense */

body.with-side .topbar > .top-soc { display: none; }  /* la sidebar porte déjà le logo société */

/* ====================================================================
   Réglages inicio (retours Florian 07-08)
   ==================================================================== */
/* 1) « Personalizar » compact, remonté en haut à droite du contenu (sous « Cerrar sesión »),
      + la recherche de menus descendue à côté du « Hola / Vista general ». */
.dash-head { align-items: stretch; position: relative; }
/* logo société centré dans l'espace vide de la bande d'en-tête (identifie produit ↔ société) */
.dash-head-mid { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  pointer-events: none; display: flex; }
.dash-head-mid .mid-soc { height: 76px; background: none; border: 0; padding: 0; border-radius: 0; }
@media (max-width: 899px) { .dash-head-mid { display: none; } }
.dash-head-right { display: flex; flex-direction: column; align-items: flex-end;
  justify-content: space-between; gap: 10px; flex: none; }
.btn-edit { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  border-radius: 9px; border: 1px solid var(--line); background: var(--panel);
  color: var(--reco-d); font-weight: 600; font-size: .82rem; cursor: pointer; white-space: nowrap; }
.btn-edit:hover { border-color: var(--reco); background: var(--reco-soft); }
/* 2) recherche de menus : sous « Panel de control », à GAUCHE (retour 07-08) */
.dash-search { margin: 14px 0 0; }
.dash-search .menu-sug { left: 0; right: auto; }
@media (max-width: 899px) { .dash-head-right { display: none; } }

/* 1) « Hola, user » + logo société remontés DANS le header, à gauche (retour 07-08) */
.topbar-hello { display: inline-flex; align-items: center; gap: 10px; margin-right: 6px; }
.topbar-hello .th-txt { font-weight: 600; font-size: .95rem; letter-spacing: -.01em; }
.topbar-hello .th-soc { height: 26px; }
@media (max-width: 899px) { .topbar-hello { display: none; } }
/* mobile : greeting du header caché → on le montre dans le contenu (Com = dashboard mobile-reachable) */
.dash-hello-m { display: none; margin-bottom: 6px; }
@media (max-width: 899px) { .dash-hello-m { display: inline-flex; } }
/* logo société centré dans l'en-tête, MAINTENU sur toutes les pages (hors inicio qui a le sien) ;
   .topbar est sticky (= bloc conteneur) → centrage absolu OK, sans cadre, non cliquable */
.topbar-soc { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  height: 40px; background: none; border: 0; padding: 0; pointer-events: none; }
@media (max-width: 899px) { .topbar-soc { display: none; } }  /* perso/recherche = bureau */

/* 4) le vrai logo FLERP (molécule) dans le bouton portail, à la place du losange */
.btn-portal img.flerp-mol { width: 22px; height: 22px; display: block; }

/* 3) KPIs réordonnables (drag) — même grammaire que les tuiles */
.kpi[draggable=true] { cursor: grab; }
.kpi.dragging { opacity: .45; }
body.dash-editing .kpis { outline: 2px dashed rgba(76,175,80,.3); outline-offset: 8px; border-radius: 16px; }

/* 5) densité bureau : l'app à 90 % sur desktop (« trop zoomé »). Uniforme comme un zoom
      navigateur 90 %, jamais sur mobile (terrain, gros doigts). On compense les hauteurs
      d'écran (100vh) pour que la coque plein-écran garde exactement la taille du viewport. */
@media (min-width: 900px) {
  html { zoom: 0.9; }
  body { min-height: calc(100vh / 0.9); }
  body.with-side { height: calc(100vh / 0.9); }
}
