/* IsoNergie CRM — feuille de style */
@font-face { font-family: 'Montserrat'; font-weight: 400; font-display: swap; src: url('fonts/Montserrat-Regular.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 500; font-display: swap; src: url('fonts/Montserrat-Medium.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 600; font-display: swap; src: url('fonts/Montserrat-SemiBold.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 700; font-display: swap; src: url('fonts/Montserrat-Bold.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 800; font-display: swap; src: url('fonts/Montserrat-ExtraBold.woff2') format('woff2'); }

:root {
  --orange: #FF8C43; --orange-d: #E9731F; --orange-x: #A84B0C; /* orange-x = texte orange lisible sur blanc (5:1) ; #FF8C43 seulement en fond */ --orange-l: #FFF1E7; --orange-t: rgba(255,140,67,.16);
  --ink: #1D1E20; --ink-2: #2A2C31; --ink-3: #3A3D44;
  --bg: #F3F4F6; --surface: #FFFFFF; --surface-2: #F8F9FA; --line: #E3E5E9; --line-2: #CDD1D7;
  --text: #1D1E20; --text-2: #4B5058; --muted: #6F7580; --faint: #767C86;
  --blue: #2F6FE4; --blue-l: #E8EFFC; --violet: #7C3AED; --violet-l: #F0E9FD; --teal: #0F766E; --teal-l: #E2F5F2;
  --green: #15803D; --green-l: #E6F6EC; --red: #DC2626; --red-l: #FBE9E9; --amber: #B45309; --amber-l: #FDF1DC; --gray-l: #ECEEF1;
  --r: 12px; --r-s: 8px; --shadow: 0 1px 2px rgba(20,22,26,.06), 0 4px 14px rgba(20,22,26,.06);
  --sidebar: 236px; --topbar: 56px; --tabbar: 62px;
  --font: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14.5px; line-height: 1.45; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
a { color: var(--orange-x); text-decoration: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; } .inp:focus-visible { outline: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 800; } h2 { font-size: 17px; font-weight: 700; } h3 { font-size: 14px; font-weight: 700; } h4 { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
p { margin: 0 0 10px; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12.5px; } .xs { font-size: 11.5px; } .b { font-weight: 700; } .sb { font-weight: 600; } .num { font-variant-numeric: tabular-nums; }
.orange { color: var(--orange-x); } .green { color: var(--green); } .red { color: var(--red); } .amber { color: var(--amber); } .blue { color: var(--blue); }
.hide { display: none !important; } .right { text-align: right; } .center { text-align: center; } .nowrap { white-space: nowrap; } .ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row { display: flex; align-items: center; gap: 10px; } .row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; } .row.top { align-items: flex-start; } .grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.mt { margin-top: 14px; } .mb { margin-bottom: 14px; } .mt-s { margin-top: 8px; } .mb-s { margin-bottom: 8px; }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -4px; }
svg.i.s { width: 15px; height: 15px; } svg.i.l { width: 24px; height: 24px; }

/* ---------- disposition */
#app { min-height: 100vh; min-height: 100dvh; }
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { background: var(--ink); color: #fff; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 14px; }
.sidebar .logo { padding: 4px 8px 18px; } .sidebar .logo svg { width: 150px; height: auto; display: block; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow: auto; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 9px; color: rgba(255,255,255,.76); font-weight: 600; font-size: 14px; transition: background .12s; }
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; } .nav a.on { background: var(--orange); color: var(--ink); }
.nav a .badge { margin-left: auto; }
.nav .sep { margin: 10px 12px 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.38); }
.sidebar .me, .drawer .me { display: flex; align-items: center; gap: 10px; padding: 12px 10px 4px; border-top: 1px solid rgba(255,255,255,.1); margin-top: 8px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--orange); color: var(--ink); font-weight: 800; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; flex: none; }
.avatar.s { width: 26px; height: 26px; font-size: 11px; }
.main { min-width: 0; }
.topbar { display: none; }
.content { padding: 22px 26px 40px; max-width: 1320px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 2px; } .page-head > .btn-row { max-width: 100%; } /* le .seg défile dans sa ligne au lieu d'élargir la page à 390 px */
.tabbar { display: none; }
.offline-banner { background: var(--amber); color: #fff; font-weight: 600; text-align: center; padding: 6px 10px; font-size: 13px; }

@media (max-width: 1023px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--ink); color: #fff; height: var(--topbar); padding: 0 14px; position: sticky; top: 0; z-index: 30; padding-top: env(safe-area-inset-top); height: calc(var(--topbar) + env(safe-area-inset-top)); }
  .topbar .logo svg { width: 112px; height: auto; display: block; }
  .topbar .ib { color: #fff; background: transparent; border: 0; width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; position: relative; }
  .topbar .ib .dot { position: absolute; top: 7px; right: 7px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--orange); color: var(--ink); font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
  .content { padding: 16px 16px calc(var(--tabbar) + 24px + env(safe-area-inset-bottom)); }
  .tabbar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: #fff; border-top: 1px solid var(--line); z-index: 30; }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10.5px; font-weight: 600; color: var(--muted); position: relative; }
  .tabbar a.on { color: var(--orange-x); } .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a .badge { position: absolute; top: 6px; left: calc(50% + 6px); }
  h1 { font-size: 20px; }
  /* téléphone : cibles tactiles d'au moins 44 px (installateurs sur le terrain, avec des gants) */
  .btn, .btn.s { min-height: 44px; } .btn.icon, .btn.icon.s { min-width: 44px; } .topbar .ib, .modal .m-head .x { width: 44px; height: 44px; }
  .chip, .seg button { min-height: 44px; } .check { min-height: 44px; } .photos .ph .del::after { content: ''; position: absolute; inset: -10px; }
}

/* ---------- menu « plus » / tiroir */
.drawer-bg { position: fixed; inset: 0; background: rgba(20,22,26,.45); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(320px, 86vw); background: var(--ink); color: #fff; z-index: 41; padding: 18px 14px; padding-top: calc(18px + env(safe-area-inset-top)); overflow: auto; display: flex; flex-direction: column; }
.drawer .nav a { font-size: 15px; padding: 12px; }

/* ---------- composants */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card.pad { padding: 16px; } .card.pad-s { padding: 12px 14px; }
.card .card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.card .card-body { padding: 14px 16px; }
.grid { display: grid; gap: 12px; } .grid > * { min-width: 0; } /* une table large défile dans sa colonne au lieu de l'élargir (dézoom à 390 px) */ .grid.c2 { grid-template-columns: repeat(2, 1fr); } .grid.c3 { grid-template-columns: repeat(3, 1fr); } .grid.c4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 760px) { .grid.c3, .grid.c4 { grid-template-columns: repeat(2, 1fr); } .grid.c2.stack-m { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .grid.c4 { grid-template-columns: repeat(2, 1fr); } }
.kpi { padding: 14px 16px; } .kpi .lbl { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.kpi .val { font-size: 24px; font-weight: 800; margin-top: 4px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; } .kpi .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi.accent { background: var(--ink); color: #fff; border-color: var(--ink); } .kpi.accent .lbl, .kpi.accent .sub { color: rgba(255,255,255,.6); } .kpi.accent .val { color: var(--orange); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 14px; height: 40px; border-radius: 9px; border: 1px solid transparent; font-weight: 700; font-size: 14px; cursor: pointer; background: var(--orange); color: var(--ink); white-space: nowrap; transition: background .12s, transform .05s; user-select: none; -webkit-tap-highlight-color: transparent; }
.btn:hover { background: var(--orange-d); color: var(--ink); } .btn:active { transform: translateY(1px); }
.btn.sec { background: #fff; color: var(--text); border-color: var(--line-2); } .btn.sec:hover { background: var(--surface-2); color: var(--text); }
.btn.ghost { background: transparent; color: var(--text-2); } .btn.ghost:hover { background: var(--gray-l); color: var(--text); }
.btn.dark { background: var(--ink); color: #fff; } .btn.dark:hover { background: var(--ink-3); }
.btn.danger { background: var(--red-l); color: var(--red); } .btn.danger:hover { background: var(--red); color: #fff; }
.btn.ok { background: var(--green); color: #fff; } .btn.ok:hover { background: #116932; }
.btn.s { height: 32px; padding: 0 10px; font-size: 13px; border-radius: 8px; } .btn.l { height: 50px; font-size: 16px; padding: 0 22px; border-radius: 12px; }
.btn.block { width: 100%; } .btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.icon { width: 40px; padding: 0; } .btn.icon.s { width: 32px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; line-height: 18px; white-space: nowrap; background: var(--gray-l); color: var(--text-2); }
.badge.orange { background: var(--orange-l); color: var(--orange-x); } .badge.blue { background: var(--blue-l); color: var(--blue); } .badge.violet { background: var(--violet-l); color: var(--violet); }
.badge.teal { background: var(--teal-l); color: var(--teal); } .badge.green { background: var(--green-l); color: var(--green); } .badge.red { background: var(--red-l); color: var(--red); } .badge.amber { background: var(--amber-l); color: var(--amber); }
.badge.dark { background: var(--ink); color: #fff; } .badge.dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.count { background: var(--orange); color: var(--ink); padding: 0 6px; min-width: 18px; justify-content: center; }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 12.5px; font-weight: 700; color: var(--text-2); } .field label .req { color: var(--orange-x); }
.field .help { font-size: 12px; color: var(--muted); }
.inp, select.inp, textarea.inp { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 9px; background: #fff; outline: none; transition: border-color .12s, box-shadow .12s; font-size: 15px; }
textarea.inp { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; }
.inp:focus { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-t); }
.inp.err { border-color: var(--red); }
select.inp { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236F7580' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px; }
.inp-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } @media (max-width: 480px) { .inp-row.stack-m { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: 9px; font-weight: 500; cursor: pointer; padding: 6px 0; } .check input { width: 18px; height: 18px; accent-color: var(--orange-d); margin: 0; }
.switch { position: relative; width: 42px; height: 24px; flex: none; } .switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--line-2); border-radius: 24px; transition: .15s; cursor: pointer; } .switch span::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + span { background: var(--orange); } .switch input:checked + span::before { transform: translateX(18px); }
.seg { display: inline-flex; background: var(--gray-l); border-radius: 10px; padding: 3px; gap: 2px; max-width: 100%; overflow: auto; }
.seg button { border: 0; background: transparent; padding: 7px 13px; border-radius: 8px; font-weight: 700; font-size: 13px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg button.on { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; } .chip { border: 1px solid var(--line-2); background: #fff; border-radius: 999px; padding: 5px 11px; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--text-2); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); } .chip .n { opacity: .6; margin-left: 4px; }
.search { position: relative; } .search svg { position: absolute; left: 11px; top: 12px; color: var(--muted); } .search .inp { padding-left: 36px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; } .toolbar .inp { height: 38px; width: auto; min-width: 140px; }
.toolbar .search { flex: 1; min-width: 180px; } .toolbar .search .inp { width: 100%; }

.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; } .tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: #FFF8F3; }
.tbl td.r, .tbl th.r { text-align: right; } .tbl .tot td { font-weight: 800; background: var(--surface-2); }
.tbl-wrap { overflow: auto; -webkit-overflow-scrolling: touch; }
.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; background: #fff; -webkit-tap-highlight-color: transparent; }
.item:last-child { border-bottom: 0; } .item:hover { background: #FFF8F3; } .item .title { font-weight: 700; font-size: 14.5px; } .item .meta { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.item .chev { color: var(--faint); flex: none; } .item.static { cursor: default; } .item.static:hover { background: #fff; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); } .empty svg { width: 40px; height: 40px; color: var(--line-2); margin-bottom: 8px; }
.alert { padding: 11px 14px; border-radius: 10px; font-size: 13.5px; display: flex; gap: 9px; align-items: flex-start; border: 1px solid; }
.alert.warn { background: var(--amber-l); color: #7A4100; border-color: #F3D7A6; } .alert.err { background: var(--red-l); color: #8A1C1C; border-color: #F3C2C2; } .alert.ok { background: var(--green-l); color: #0F5A2A; border-color: #BDE5CB; } .alert.info { background: var(--blue-l); color: #1B3F85; border-color: #C5D6F6; }
.alert svg { flex: none; margin-top: 1px; }
.timeline { position: relative; padding-left: 20px; } .timeline::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl { position: relative; padding: 0 0 14px; } .tl::before { content: ''; position: absolute; left: -18px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--orange); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-2); }
.tl .when { font-size: 11.5px; color: var(--muted); } .tl .what { font-size: 13.5px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 13.5px; } .kv dt { color: var(--muted); font-weight: 600; } .kv dd { margin: 0; font-weight: 500; word-break: break-word; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; } .photos .ph { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--gray-l); border: 1px solid var(--line); }
.photos .ph img { width: 100%; height: 100%; object-fit: cover; display: block; } .photos .ph .del { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,.6); color: #fff; border: 0; border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.photos .ph .tag { position: absolute; left: 4px; bottom: 4px; font-size: 10px; background: rgba(0,0,0,.6); color: #fff; padding: 1px 6px; border-radius: 999px; font-weight: 700; }
.steps { display: flex; gap: 6px; margin-bottom: 14px; } .steps div { flex: 1; height: 5px; border-radius: 3px; background: var(--line); } .steps div.on { background: var(--orange); }
.pill-stat { display: flex; align-items: baseline; gap: 6px; } .pill-stat .v { font-weight: 800; font-size: 18px; }
/* leaderboard graphique (v1.5) */
.lb-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line); min-width: 0; } .lb-row:first-child { border-top: 0; padding-top: 0; }
.lb-row .rk { flex: none; width: 24px; text-align: center; font-weight: 700; font-size: 13px; } .lb-row .nm { flex: 1 1 60px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 13px; }
.lb-bar { flex: 0 0 30%; height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; } .lb-bar div { height: 100%; width: 0; background: var(--ink); border-radius: 4px; transition: width .4s; } .lb-row.top .lb-bar div { background: var(--orange); }
.lb-row .vl { flex: none; min-width: 44px; text-align: right; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.grid.c3.stack-m { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); } /* 1, 2 ou 3 colonnes selon la largeur, jamais de débordement */ @media (max-width: 480px) { .lb-bar { flex-basis: 22%; } }
.inp[readonly] { background: var(--surface-2); color: var(--text-2); }
.progress { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; } .progress div { height: 100%; background: var(--orange); border-radius: 4px; }
.sig { border: 1px dashed var(--line-2); border-radius: 10px; background: #fff; touch-action: none; width: 100%; height: 160px; display: block; }
.big-punch { height: 120px; border-radius: 20px; font-size: 22px; font-weight: 800; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 0; cursor: pointer; color: #fff; }
.big-punch.in { background: linear-gradient(135deg, #1d9a60, #16A34A); } .big-punch.out { background: linear-gradient(135deg, #e04a3f, #DC2626); } .big-punch small { font-size: 13px; font-weight: 600; opacity: .9; }

/* agenda : grille horaire semaine (pas du quadrillage = AG_PX de views-install.js, 44 px) */
.cal { display: grid; grid-template-columns: 40px repeat(7, 1fr); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.cal .dh { font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--muted); text-align: center; padding: 6px 2px; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); cursor: pointer; min-width: 0; } .cal .dh:first-child { border-left: 0; }
.cal .dh > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .cal .dh .cap { font-size: 10.5px; font-weight: 600; text-transform: none; }
.cal .dh.today { color: var(--orange-x); } .cal .dh.sel { background: var(--orange-l); color: var(--ink); }
.cal .hs { font-size: 10px; color: var(--faint); text-align: right; padding-right: 4px; } .cal .hs div { padding-top: 2px; }
.cal .d { position: relative; border-left: 1px solid var(--line); cursor: pointer; background: repeating-linear-gradient(to bottom, transparent 0 43px, var(--line) 43px 44px); }
.cal .d.today { background-color: #FFF8F3; } .cal .d.closed { background-image: repeating-linear-gradient(135deg, #f5f5f5, #f5f5f5 6px, #ececec 6px, #ececec 12px); } .cal .d.sel { box-shadow: inset 0 0 0 2px var(--ink); }
.cal .d .j { position: absolute; box-sizing: border-box; font-size: 11px; font-weight: 600; line-height: 1.25; padding: 2px 4px; border-radius: 5px; background: var(--gray-l); overflow: hidden; border-left: 3px solid var(--line-2); border-top: 1px solid #fff; border-right: 1px solid #fff; }
.cal .d .j.mine { box-shadow: inset 0 0 0 1.5px var(--ink); } .cal .d .j.done { opacity: .55; text-decoration: line-through; } .cal .d .j.occ { background: var(--surface-2); color: var(--muted); } .cal .d .j[draggable] { cursor: grab; }
/* réservation d'installation : journée recommandée (même secteur), journée du secteur, fermée/complète, bloc du même secteur */
.cal .d.reco { background-color: var(--green-l); } .cal .dh.reco { box-shadow: inset 0 -3px 0 var(--green); } .cal .d.reco2 { background-color: var(--orange-l); } .cal .dh.reco2 { box-shadow: inset 0 -3px 0 var(--orange); }
.moving .cal .d, .moving .cal .j { cursor: crosshair; }
.cal .d.no { background-image: repeating-linear-gradient(135deg, #f5f5f5, #f5f5f5 6px, #ececec 6px, #ececec 12px); } .cal .dh.no { color: var(--faint); } .cal .d .j.meme { box-shadow: inset 0 0 0 2px var(--green); }
@media (max-width: 760px) { .cal { grid-template-columns: 28px repeat(7, 1fr); } .cal .dh { font-size: 10px; padding: 4px 0; } .cal .dh .cap { display: none; } .cal .hs { font-size: 9px; padding-right: 2px; } .cal .d .j, .cal .d .j * { font-size: 0; padding: 0; } }
/* réservation : on clique l'heure de début dans la journée ; vert = heure disponible, hachuré = pas disponible (ne se clique pas) */
.cal .d.book { cursor: not-allowed; } .cal .d.book.reco, .cal .d.book.reco2 { background-color: #fff; } .cal .d.book .j { z-index: 1; } /* jobs au-dessus des hachures, sous les heures cliquables */
.cal .lb { position: absolute; left: 0; right: 0; height: 22px; z-index: 2; cursor: pointer; background: rgba(21, 128, 61, .11); border-top: 1px solid rgba(21, 128, 61, .14); }
.cal .lb:hover, .cal .lb:focus-visible { background: rgba(21, 128, 61, .38); outline: 0; } .cal .lb:hover::after, .cal .lb:focus-visible::after { content: attr(data-l); position: absolute; left: 3px; top: 2px; font-size: 10.5px; font-weight: 800; line-height: 16px; padding: 0 4px; border-radius: 4px; background: #fff; color: #0F5A2B; white-space: nowrap; }
.cal .lb.no { z-index: 0; cursor: not-allowed; border-top: 0; background: repeating-linear-gradient(135deg, #f3f4f6, #f3f4f6 5px, #e5e7eb 5px, #e5e7eb 10px); }
.cal .d .j.choix { z-index: 3; pointer-events: none; background: var(--orange); color: var(--ink); border-left-color: var(--orange-x); box-shadow: 0 2px 8px rgba(0, 0, 0, .2); }
@media (max-width: 760px) { #ib-list { overflow-x: auto; -webkit-overflow-scrolling: touch; } #ib-list .cal { min-width: 640px; } #ib-list .cal .dh { font-size: 11px; } #ib-list .cal .d .j, #ib-list .cal .d .j * { font-size: 10px; padding: 1px 2px; } }
.pastille { display: inline-block; width: 10px; height: 10px; border-radius: 3px; } #ib-succ button.on, #cal-succ button.on[style] { background: var(--sc); color: #fff; }
.day-list .job { display: flex; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); align-items: flex-start; cursor: pointer; } .day-list .job:hover { background: #FFF8F3; }
.day-list .time { font-weight: 800; font-size: 13px; min-width: 76px; color: var(--text-2); } .day-list .job .sect { width: 4px; border-radius: 2px; align-self: stretch; }
.sugg { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: #fff; } .sugg:hover, .sugg.on { border-color: var(--orange); background: var(--orange-l); }
.sugg .sc { width: 10px; height: 10px; border-radius: 50%; flex: none; } .sugg.no { opacity: .5; cursor: not-allowed; }
#map { height: 420px; border-radius: var(--r); border: 1px solid var(--line); background: var(--gray-l); z-index: 0; } @media (max-width: 760px) { #map { height: 320px; } }

/* modal / sheet */
.modal-bg { position: fixed; inset: 0; background: rgba(20,22,26,.5); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .12s; }
.modal { background: #fff; border-radius: 16px; width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.3); animation: pop .14s; }
.modal.wide { width: min(860px, 100%); }
.modal .m-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 10px; position: sticky; top: 0; background: #fff; z-index: 1; } .modal .m-body { padding: 4px 18px 18px; } .modal .m-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px 18px; position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--line); }
.modal .x { border: 0; background: var(--gray-l); width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; }
@media (max-width: 640px) { .modal-bg { align-items: flex-end; padding: 0; } .modal { border-radius: 18px 18px 0 0; max-height: 94vh; max-height: 94dvh; width: 100%; animation: up .18s; } .modal .m-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); } .modal .m-foot .btn { flex: 1; } }
@keyframes fade { from { opacity: 0 } } @keyframes pop { from { transform: scale(.97); opacity: 0 } } @keyframes up { from { transform: translateY(40px); opacity: 0 } }
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar) + 16px + env(safe-area-inset-bottom)); z-index: 60; display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100% - 32px)); pointer-events: none; }
@media (min-width: 1024px) { .toasts { bottom: 24px; } }
.toast { background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 10px; font-weight: 600; box-shadow: var(--shadow); font-size: 13.5px; animation: up .18s; display: flex; gap: 8px; align-items: center; }
.toast.err { background: var(--red); } .toast.ok { background: var(--green); }
.loading { display: flex; justify-content: center; padding: 40px; color: var(--muted); } .spinner { width: 26px; height: 26px; border: 3px solid var(--line); border-top-color: var(--orange); border-radius: 50%; animation: spin .8s linear infinite; } @keyframes spin { to { transform: rotate(360deg) } }
.skeleton { background: linear-gradient(90deg, #eee 25%, #f6f6f6 37%, #eee 63%); background-size: 400% 100%; animation: sk 1.2s infinite; border-radius: 6px; } @keyframes sk { 0% { background-position: 100% 0 } 100% { background-position: 0 0 } }

/* auth */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 1fr 1fr; }
.auth .brand { background: var(--ink); color: #fff; display: flex; flex-direction: column; justify-content: center; padding: 48px; position: relative; overflow: hidden; }
.auth .brand svg.logo { width: 280px; height: auto; } .auth .brand h2 { font-size: 26px; font-weight: 800; margin-top: 30px; line-height: 1.25; max-width: 420px; } .auth .brand p { color: rgba(255,255,255,.6); max-width: 420px; margin-top: 10px; }
.auth .brand .glow { position: absolute; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, rgba(255,140,67,.28), transparent 65%); right: -180px; bottom: -200px; }
.auth .form { display: flex; align-items: center; justify-content: center; padding: 32px 20px; } .auth .form > div { width: min(400px, 100%); }
.auth .form h1 { margin-bottom: 4px; } .auth .mobile-logo { display: none; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth .brand { display: none; } .auth .mobile-logo { display: block; background: var(--ink); padding: 28px 24px; margin: -32px -20px 28px; border-radius: 0 0 24px 24px; } .auth .mobile-logo svg { width: 170px; height: auto; } }
.notif-list .item.unread { background: #FFF8F3; } .notif-list .item.unread .title::before { content: ''; display: inline-block; width: 7px; height: 7px; background: var(--orange); border-radius: 50%; margin-right: 6px; vertical-align: 2px; }
.dropzone { border: 2px dashed var(--line-2); border-radius: 12px; padding: 18px; text-align: center; color: var(--muted); cursor: pointer; background: var(--surface-2); } .dropzone:hover { border-color: var(--orange); }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; word-break: break-all; }
.leaflet-container { font-family: var(--font); }
.print-only { display: none; }
@media print { .sidebar, .topbar, .tabbar, .toolbar, .btn, .no-print { display: none !important; } .content { padding: 0; max-width: none; } .card { box-shadow: none; border: 1px solid #ccc; } .print-only { display: block; } body { background: #fff; } }

/* réservation d'installation : détail de la journée */
.plages { display: flex; flex-wrap: wrap; gap: 8px; }
.plage { flex: 1 1 160px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; font: inherit; color: var(--text); text-align: left; }
.plage .xs { color: var(--muted); } .plage.reco { border-color: var(--green); } .plage.reco .xs { color: var(--green); }
.plage.on { border-color: var(--orange); background: var(--orange-l); box-shadow: 0 0 0 2px var(--orange-t); } .plage.no { opacity: .5; cursor: not-allowed; }
.jrow { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 5px 8px; border-radius: 8px; background: #fff; border: 1px solid var(--line); }
.jrow .t { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; } .jrow .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; } .jrow.meme { border-color: var(--green); }
.stack-xs { display: flex; flex-direction: column; gap: 4px; }

/* charte de couleurs des rendez-vous : mauve booké, jaune visité (pas encore closé), vert closé, rouge perdu — et calendrier des closers */
.e-booke { --ec: var(--violet); --eb: var(--violet-l); --et: #4C1D95; } .e-visite { --ec: #EAB308; --eb: #FEF3B5; --et: #713F12; } .e-vendu { --ec: var(--green); --eb: #D5F2DF; --et: #0F5A2B; } .e-perdu { --ec: var(--red); --eb: #FAD9D9; --et: #8A1C1C; }
.rdv-e { display: inline-flex; gap: 6px; align-items: baseline; padding: 3px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; line-height: 1.3; background: var(--eb); color: var(--et); border-left: 4px solid var(--ec); text-decoration: none; }
.rdv-leg { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; } .rdv-bar { background: var(--ec); }
.rdv-cal { table-layout: fixed; min-width: 940px; } .rdv-cal td, .rdv-cal tbody th { vertical-align: top; padding: 6px; border-left: 1px solid var(--line); } .rdv-cal td .rdv-e { display: flex; margin-bottom: 4px; } .rdv-cal td .rdv-e:hover { filter: brightness(.96); } .rdv-cal .rdv-e b { white-space: nowrap; } .rdv-cal .rdv-e span { min-width: 0; overflow-wrap: anywhere; }
.rdv-cal .today { background: #FFF8F3; } .rdv-cal th.today { color: var(--orange-x); } .rdv-cal thead th:first-child { position: sticky; left: 0; z-index: 2; width: 120px; }
.rdv-cal tbody th { position: sticky; left: 0; z-index: 1; padding: 8px 10px; border-left: 0; background: var(--surface); text-transform: none; letter-spacing: 0; font-size: 13.5px; color: var(--ink); white-space: normal; }

/* réservation d'un rendez-vous dans le calendrier des closers : une colonne par closer du secteur, la journée heure par heure ; vert = heure libre (cliquable), hachuré = pas disponible, mauve = déjà booké */
.rdvg-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; } .rdvg { border: 0; border-radius: 0; overflow: visible; } /* au téléphone, les colonnes des closers défilent de côté */
.rdvg .dh { cursor: default; text-transform: none; font-size: 12.5px; color: var(--ink); padding: 8px 4px; } .rdvg .dh .cap { display: block; color: var(--muted); }
.rdvg .d { cursor: not-allowed; background: repeating-linear-gradient(135deg, #f3f4f6, #f3f4f6 5px, #e5e7eb 5px, #e5e7eb 10px); }
.rdvg .d .j { left: 3px; right: 3px; z-index: 1; cursor: default; background: var(--violet-l); border-left-color: var(--violet); color: #4C1D95; font-size: 11.5px; padding: 2px 5px; }
.rdvg .lib { position: absolute; left: 3px; right: 3px; box-sizing: border-box; z-index: 1; border-radius: 6px; padding: 3px 7px; font-size: 12.5px; font-weight: 800; cursor: pointer; background: #DDF3E4; color: #0F5A2B; border: 1px solid rgba(21, 128, 61, .35); }
.rdvg .lib:hover, .rdvg .lib:focus-visible { background: var(--green); color: #fff; outline: 0; }
#cal-jours { align-items: center; } #cal-jours .chip:disabled { opacity: .45; cursor: not-allowed; }
@media (max-width: 760px) { .rdvg .d .j, .rdvg .d .j * { font-size: 10.5px; } .rdvg .d .j { padding: 1px 3px; } }
/* Documents : un dossier repliable par semaine ou par mois */
.doc-g{margin-bottom:14px}.doc-g>summary{cursor:pointer;list-style:none;background:var(--surface-2)}.doc-g>summary::-webkit-details-marker{display:none}
.doc-b{display:inline-flex}.doc-b>a:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.doc-b>a:last-child{border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-1px}
.doc-g>summary h2::before{content:'▸ ';color:var(--orange,#FF8C43)}.doc-g[open]>summary h2::before{content:'▾ '}
.tbl tr.grp td { background: var(--surface-2); font-weight: 800; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); } /* titre de section dans un tableau (paie par rôle) */
