/* Outil de suivi d'activité E&F Consulting : feuille de style à la charte graphique 2026 (mini-charte Antoine Amargier).
   Palette : crème F8F5EF, teal 0A6D6B / 024B46, jaune FCDC2B, gris 40474F, beiges C5BCAA / F0EADF, rouge B85450, orange D9822B, bleu 5B9BD5.
   Polices : Poppins (titres, chiffres), Montserrat (texte). */
:root {
  --bg: #F8F5EF; --surface: #FFFFFF; --line: #EAE3D6; --line-2: #D9D2C4; --hover: #FBF9F5;
  --ink: #40474F; --muted: #6F6A5F; --muted-2: #8A8273;
  --teal: #0A6D6B; --teal-dark: #024B46; --teal-pale: #E2EEED; --teal-faint: #F1F6F6;
  --yellow: #FCDC2B; --yellow-pale: #FEF6CC; --yellow-ink: #5C4A00;
  --beige: #C5BCAA; --beige-pale: #F0EADF;
  --red: #B85450; --red-pale: #F7E3E2; --red-ink: #7A2E2B; --red-line: #E0A9A6;
  --orange: #D9822B; --orange-pale: #FBEBDD; --orange-ink: #7A4512; --orange-line: #F0C9A8;
  --blue: #5B9BD5; --blue-pale: #E4EEF8;
  --good: #0A6D6B; --warn: #7A4512; --bad: #B85450; --info: #5B9BD5;
  --font: Montserrat, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: Poppins, Montserrat, system-ui, sans-serif;
  --radius: 10px; --radius-card: 14px;
  --nav-w: 248px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--font); font-size: 13.5px; color: var(--ink); background: var(--bg); line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--teal); }
a:hover { color: var(--teal-dark); }
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--ink); font-weight: 600; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: 28px; line-height: 1.15; } h2 { font-size: 17px; } h3 { font-size: 15px; } h4 { font-size: 13px; }
.pop { font-family: var(--font-head); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }
.center { text-align: center; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.good { color: var(--good); } .bad { color: var(--bad); } .warn { color: var(--warn); }
.error { color: var(--bad); min-height: 1.2em; margin: .3rem 0; font-size: 12.5px; }
.lbl { font-family: var(--font-head); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.pointe { width: 150px; height: auto; display: block; margin: 2px 0 6px -4px; }
.pointe.sm { width: 110px; }
.leaf { width: 14px; height: 14px; object-fit: contain; flex: 0 0 14px; margin-top: 2px; }

/* ----- connexion ----- */
.login { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 16px; overflow: hidden; }
.login::before { content: ""; position: absolute; right: -120px; top: -80px; width: 520px; height: 760px; background: url(/ef-courbe.png) no-repeat center / contain; opacity: .06; pointer-events: none; }
.login-box { position: relative; background: var(--surface); padding: 28px 30px 26px; border: 1px solid var(--line); border-radius: 14px 14px 36px 36px; width: 380px; max-width: 100%; box-shadow: 0 16px 50px rgba(2,75,70,.10); }
.login-logo { width: 100%; height: auto; display: block; margin-bottom: 14px; }
.login-box h1 { font-size: 22px; margin: 0; }
.login-box .pointe { margin-bottom: 10px; }
.login-box p { margin: 0 0 6px; }
.login-box label { display: block; margin-top: 12px; font-size: 12px; color: var(--muted); font-weight: 500; }
.login-box input { width: 100%; margin-top: 5px; min-height: 44px; }
.login-box .btn { width: 100%; margin-top: 18px; min-height: 46px; font-size: 14px; }

/* ----- structure ----- */
.shell { display: flex; min-height: 100vh; }
.nav { width: var(--nav-w); flex: 0 0 var(--nav-w); background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 22px 14px 14px; gap: 4px; z-index: 30; }
.brand { padding: 0 4px 18px; display: block; text-decoration: none; }
.brand img { width: 100%; height: auto; display: block; }
.brand .lbl { margin-top: 10px; padding-left: 6px; color: var(--teal); }
#nav-items { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.nav-section { padding: 14px 14px 6px; font-family: var(--font-head); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.nav-section:first-child { padding-top: 0; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 9px 14px; border-radius: var(--radius); color: var(--ink); text-decoration: none; font-size: 13.5px; font-weight: 500; min-height: 42px; position: relative; }
.nav-link svg { width: 18px; height: 18px; flex: 0 0 18px; color: var(--teal); }
.nav-link:hover { background: var(--bg); color: var(--teal-dark); }
.nav-link.active { background: var(--teal-pale); color: var(--teal-dark); font-weight: 600; }
.nav-link.active::before { content: ""; position: absolute; left: -14px; top: 11px; width: 4px; height: 20px; border-radius: 0 4px 4px 0; background: var(--yellow); }
.nav-footer { padding: 14px 4px 0; border-top: 1px solid var(--beige-pale); display: flex; flex-direction: column; gap: 8px; }
.nav-user { display: flex; align-items: center; gap: 10px; padding: 0 4px; }
.nav-user .who { flex: 1; min-width: 0; }
.nav-user .who b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-user .who span { font-size: 11px; color: var(--muted); }
.nav-footer .links { display: flex; gap: 12px; padding: 0 4px; font-size: 12px; }
.nav-footer .links a { color: var(--muted); text-decoration: none; }
.nav-footer .links a:hover { color: var(--teal-dark); }
.main { flex: 1; padding: 30px 34px 44px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.main > * { margin: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head .subtitle { font-size: 13px; color: var(--muted); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.topbar, .bottom-nav, .nav-backdrop { display: none; }
.crumbs { font-size: 12.5px; color: var(--muted); }
.crumbs a { text-decoration: none; }

/* ----- avatars, puces, chips ----- */
.av { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-head); font-size: 10px; font-weight: 600; color: #fff; background: var(--beige); flex: 0 0 auto; }
.av.md { width: 30px; height: 30px; font-size: 11px; } .av.lg { width: 38px; height: 38px; font-size: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--beige-pale); color: var(--ink); line-height: 1.4; }
.chip.teal { background: var(--teal); color: #fff; } .chip.teal-pale { background: var(--teal-pale); color: var(--teal-dark); }
.chip.yellow { background: var(--yellow); color: var(--ink); } .chip.yellow-pale { background: var(--yellow-pale); color: var(--yellow-ink); }
.chip.red { background: var(--red-pale); color: var(--red-ink); } .chip.orange { background: var(--orange-pale); color: var(--orange-ink); }
.chip.dark { background: var(--ink); color: #fff; } .chip.blue { background: var(--blue-pale); color: #2F5F8F; }
.chip.ghost { background: transparent; border: 1px solid var(--line-2); }
.chip.click { cursor: pointer; }
.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--beige-pale); color: var(--ink); white-space: nowrap; }
.badge.identification { background: var(--beige-pale); } .badge.qualifie { background: var(--blue-pale); color: #2F5F8F; }
.badge.devis_envoye { background: var(--yellow-pale); color: var(--yellow-ink); } .badge.accepte_oral { background: var(--teal-pale); color: var(--teal-dark); }
.badge.commande { background: var(--teal-pale); color: var(--teal-dark); } .badge.en_cours { background: var(--yellow); color: var(--ink); }
.badge.terminee { background: var(--teal); color: #fff; } .badge.perdue, .badge.annulee { background: var(--red-pale); color: var(--red-ink); }
.badge.prevue { background: var(--beige-pale); } .badge.emise { background: var(--yellow-pale); color: var(--yellow-ink); } .badge.payee { background: var(--teal-pale); color: var(--teal-dark); }
.badge.interne { background: var(--beige-pale); color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 10px; background: var(--beige); display: inline-block; }
.dot.red { background: var(--red); } .dot.orange { background: var(--orange); } .dot.teal { background: var(--teal); } .dot.yellow { background: var(--yellow); } .dot.blue { background: var(--blue); }

/* ----- cartes, grilles, indicateurs ----- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card.tight { padding: 8px 10px 10px; gap: 0; }
.card > h2, .card > h3 { margin: 0; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.card-head .toolbar { align-self: center; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 10px 10px 28px 28px; padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kpi .label { font-family: var(--font-head); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.kpi .value { font-family: var(--font-head); font-size: 28px; font-weight: 600; color: var(--teal); line-height: 1.1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi .value.good { color: var(--teal); } .kpi .value.bad { color: var(--red); } .kpi .value.warn { color: var(--orange-ink); }
.kpi .value small { font-size: 14px; color: var(--muted); font-weight: 500; }
.kpi .sub { font-size: 12.5px; color: var(--muted); }
.kpi .sub strong { color: var(--ink); }
.kpi.alert { border-color: var(--orange-line); background: #FFF9F4; }
.kpi.alert .label, .kpi.alert .value, .kpi.alert .sub { color: var(--orange-ink); }
.kpi.alert .value { font-size: 14px; line-height: 1.35; margin-top: 4px; }
.kpi.alert.red { border-color: var(--red-line); background: #FFF6F5; }
.kpi.alert.red .label, .kpi.alert.red .value, .kpi.alert.red .sub { color: var(--red-ink); }
.kpi.ok { border-color: var(--line); }
.kpi-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.note { padding: 12px 14px; border-radius: 10px; background: var(--bg); font-size: 12.5px; color: var(--muted); display: flex; gap: 10px; align-items: flex-start; }
.note strong { color: var(--ink); }
.note.teal { background: var(--teal-pale); color: var(--teal-dark); } .note.teal strong { color: var(--teal-dark); }
.note.yellow { background: var(--yellow-pale); color: var(--yellow-ink); } .note.yellow strong { color: var(--yellow-ink); }
.note.orange { background: var(--orange-pale); color: var(--orange-ink); } .note.orange strong { color: var(--orange-ink); }
.note.red { background: var(--red-pale); color: var(--red-ink); } .note.red strong { color: var(--red-ink); }
.meter { flex: 1; height: 6px; border-radius: 3px; background: var(--beige-pale); overflow: hidden; min-width: 40px; }
.meter > i { display: block; height: 100%; border-radius: 3px; background: var(--teal); }
.meter.lg { height: 10px; border-radius: 5px; } .meter.md { height: 8px; border-radius: 4px; }
.meter > i.yellow { background: var(--yellow); } .meter > i.beige { background: var(--beige); } .meter > i.red { background: var(--red); } .meter > i.blue { background: var(--blue); }
.meter-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.meter-row .num { min-width: 34px; }

/* ----- boutons, formulaires ----- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2; white-space: nowrap; }
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: var(--bg); color: var(--ink); }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.primary:hover { background: var(--teal-dark); border-color: var(--teal-dark); color: #fff; }
.btn.danger { border-color: var(--red-line); color: var(--red); }
.btn.danger:hover { background: var(--red-pale); color: var(--red-ink); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 12px; }
.btn.xs { min-height: 28px; padding: 0 9px; font-size: 11.5px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn:disabled { opacity: .5; cursor: default; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.seg .btn { border: 0; border-radius: 0; min-height: 38px; }
.seg .btn + .btn { border-left: 1px solid var(--line); }
.seg .btn.on { background: var(--teal); color: #fff; }
input, select, textarea { font-family: var(--font); font-size: 13px; color: var(--ink); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 8px 10px; background: var(--surface); min-height: 38px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--teal-pale); border-color: var(--teal); }
input[type=number] { text-align: right; }
input[type=color] { padding: 2px; width: 60px; }
input[type=checkbox] { min-height: 0; width: 16px; height: 16px; accent-color: var(--teal); }
textarea { width: 100%; min-height: 72px; resize: vertical; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.field > span { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.field input, .field select { width: 100%; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid h3 { grid-column: 1 / -1; margin: 10px 0 6px; padding-bottom: 6px; border-bottom: 1px solid var(--beige-pale); }
.form-grid-3 { grid-template-columns: repeat(3, 1fr); }
.checkbox { display: flex; align-items: center; gap: 8px; flex-direction: row; }
.checkbox input { width: auto; }
.search { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); color: var(--muted); }
.search svg { width: 16px; height: 16px; flex: 0 0 16px; }
.search input { border: 0; outline: 0; font: inherit; width: 220px; background: transparent; min-height: 0; padding: 0; }
.search input:focus { outline: 0; }

/* ----- tableaux ----- */
table.tbl { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 13px; }
.tbl th, .tbl td { padding: 10px 12px; border-bottom: 1px solid var(--beige-pale); text-align: left; vertical-align: middle; }
.tbl th { font-family: var(--font-head); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; white-space: nowrap; position: sticky; top: 0; z-index: 1; background: var(--surface); border-bottom: 2px solid var(--beige-pale); }
.tbl th.sortable { cursor: pointer; }
.tbl th.sortable:hover { color: var(--teal-dark); }
.tbl tbody tr:hover td { background: var(--hover); }
.tbl tr.clickable { cursor: pointer; }
.tbl tfoot td { font-weight: 600; background: var(--bg); border-top: 2px solid var(--beige-pale); }
.tbl-wrap { overflow: auto; max-height: 72vh; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.card > .tbl-wrap { border: 0; border-radius: 0; }
.tbl .sub { color: var(--muted); font-size: 11.5px; display: block; font-weight: 400; }
.tbl td.actions { white-space: nowrap; text-align: right; }
.tbl td.actions .btn { margin-left: 4px; }
.tbl a { text-decoration: none; font-weight: 600; }
.tbl .mini { font-size: 12px; color: var(--muted); }

/* ----- modales, toasts, onglets ----- */
.modal-bg { position: fixed; inset: 0; background: rgba(64,71,79,.45); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 50; overflow: auto; }
.modal { background: var(--surface); border-radius: 14px; width: 720px; max-width: 100%; box-shadow: 0 20px 70px rgba(2,75,70,.25); }
.modal.wide { width: 980px; }
.modal-head { padding: 16px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.modal-head h2 { margin: 0; }
.modal-body { padding: 18px 22px; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--muted); line-height: 1; padding: 4px 8px; }
#toast-root { position: fixed; bottom: 20px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: 380px; font-size: 13px; }
.toast.error { background: var(--red); } .toast.success { background: var(--teal); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tab { font-family: var(--font-head); font-size: 13px; font-weight: 500; color: var(--muted); background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 14px; min-height: 44px; cursor: pointer; margin-bottom: -1px; display: inline-flex; align-items: center; }
.tab.active { color: var(--teal-dark); border-bottom-color: var(--yellow); font-weight: 600; }

/* ----- tableau de bord ----- */
.todo { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--beige-pale); font-size: 13px; }
.todo:last-child { border-bottom: 0; }
.todo .t { flex: 1; min-width: 0; }
.todo .t div { font-size: 12px; color: var(--muted); }
.bars { position: relative; height: 240px; display: flex; align-items: flex-end; gap: 10px; border-bottom: 1px solid var(--line); }
.bars .avg { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--beige); pointer-events: none; }
.bars .avg span { position: absolute; right: 0; top: -18px; font-size: 11px; color: var(--muted-2); }
.bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; min-width: 0; height: 100%; }
.bar i { display: block; width: 100%; max-width: 38px; border-radius: 6px 6px 2px 2px; background: var(--teal); min-height: 2px; }
.bar i.cur { background: var(--yellow); } .bar i.pale { background: var(--line-2); }
.bar span { font-size: 11px; color: var(--muted); white-space: nowrap; }
.bar .v { font-family: var(--font-head); font-size: 11.5px; color: var(--ink); font-weight: 600; }
.bar:hover i { opacity: .85; }
.bars.sm { height: 110px; gap: 14px; }
.bars.sm .bar i { max-width: 44px; border-radius: 4px 4px 0 0; }
.chart-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--teal); display: inline-block; }
.chart-legend i.yellow { background: var(--yellow); } .chart-legend i.beige { background: var(--beige); } .chart-legend i.red { background: var(--red); } .chart-legend i.blue { background: var(--blue); }
.chart-legend i.dash { width: 14px; height: 0; border-top: 2px dashed var(--beige); background: none; border-radius: 0; }
.donut-wrap { display: flex; align-items: center; gap: 18px; }
.donut { position: relative; width: 120px; height: 120px; border-radius: 50%; flex: 0 0 120px; }
.donut > div { position: absolute; inset: 14px; border-radius: 50%; background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut .pct { font-family: var(--font-head); font-size: 26px; font-weight: 600; color: var(--teal); line-height: 1; }
.donut .lab { font-size: 10px; color: var(--muted); margin-top: 3px; }
.donut-txt { font-size: 12.5px; color: var(--muted); display: flex; flex-direction: column; gap: 8px; }
.donut-txt strong { color: var(--ink); }
.mark { color: var(--yellow-ink); font-weight: 600; background: var(--yellow-pale); padding: 1px 6px; border-radius: 4px; }
.team { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.team .n { width: 80px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team .num { width: 56px; }
.spark { width: 80px; height: 28px; flex: 0 0 80px; }
.link-more { font-size: 13px; font-weight: 600; text-decoration: none; }

/* ----- pipeline (kanban) ----- */
.kanban { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.kcol { flex: 1 1 196px; min-width: 0; display: flex; flex-direction: column; gap: 10px; border-radius: 12px; padding: 0 0 6px; }
.kcol.over { background: var(--teal-pale); outline: 2px dashed var(--teal); outline-offset: 4px; }
.kcol-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px 8px; border-bottom: 2px solid var(--line-2); }
.kcol-head b { font-family: var(--font-head); font-weight: 600; font-size: 13px; }
.kcol-head .cnt, .kcol-head .sum { color: var(--muted); font-size: 12px; font-weight: 400; }
.kcol.devis_envoye .kcol-head { border-bottom-color: var(--yellow); }
.kcol.accepte_oral .kcol-head { border-bottom-color: var(--teal); }
.kcol.commande .kcol-head { border-bottom-color: var(--teal-dark); } .kcol.commande .kcol-head b { color: var(--teal-dark); }
.kcol.commande .kc { background: var(--bg); }
.kc { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 14px 12px; display: flex; flex-direction: column; gap: 8px; cursor: grab; }
.kc:hover { border-color: var(--teal); box-shadow: 0 6px 16px rgba(2,75,70,.08); }
.kc.dragging { opacity: .5; }
.kc.top { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-pale); }
.kc.late { border-left: 4px solid var(--yellow); }
.kc h3 { margin: 0; font-family: var(--font); font-size: 13px; font-weight: 600; line-height: 1.4; }
.kc .cl { font-size: 12px; color: var(--muted); font-weight: 500; }
.kc .ft { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.kc .m { font-family: var(--font-head); font-size: 15px; font-weight: 600; color: var(--teal); }
.kc .m.na { color: var(--muted); font-size: 13px; font-family: var(--font); }
.kc .due { font-size: 11.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.kc .due svg { width: 13px; height: 13px; flex: 0 0 13px; }
.kc .due.warn { color: var(--orange-ink); } .kc .due.bad { color: var(--red); }
.kc.add { border-style: dashed; background: transparent; color: var(--muted); align-items: center; cursor: pointer; font-size: 13px; font-weight: 600; }
.kc.add:hover { color: var(--teal-dark); box-shadow: none; }
.lost { padding: 12px 14px; border-radius: 10px; background: var(--red-pale); color: var(--red-ink); font-size: 12.5px; }
.lost a { color: var(--red-ink); }

/* ----- fiche affaire ----- */
.aff-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; }
.aff-head .id { display: flex; flex-direction: column; gap: 10px; min-width: 0; flex: 1 1 420px; }
.aff-head .chips { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.aff-head .who { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.aff-head .who strong { color: var(--ink); }
.stepper { position: relative; display: flex; gap: 8px; }
.stepper .rail, .stepper .rail-done { position: absolute; top: 6px; height: 2px; background: var(--line); }
.stepper .rail-done { background: var(--teal); }
.step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); text-align: center; position: relative; min-width: 0; }
.step i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-2); background: var(--surface); display: block; }
.step.done i { background: var(--teal); border-color: var(--teal); }
.step.cur i { background: var(--yellow); border-color: var(--yellow); box-shadow: 0 0 0 4px var(--yellow-pale); }
.step.lost i { background: var(--red); border-color: var(--red); }
.step.done, .step.cur { color: var(--ink); font-weight: 500; }
.step small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; white-space: normal; text-align: center; line-height: 1.3; margin-top: 2px; }
dl.kv, .dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 12px; margin: 0; font-size: 12.5px; }
dl.kv dt, .dl dt { color: var(--muted); } dl.kv dd, .dl dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.jl { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--beige-pale); font-size: 12.5px; align-items: flex-start; }
.jl:last-child { border-bottom: 0; }
.jl time { color: var(--muted); flex: 0 0 96px; font-size: 12px; }
.jl span { min-width: 0; overflow-wrap: anywhere; }

/* ----- plan de charge par semaine ----- */
.pl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; min-width: 900px; }
.pl th { font-family: var(--font-head); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 10px; border-bottom: 2px solid var(--beige-pale); text-align: left; background: var(--surface); position: sticky; top: 0; z-index: 2; }
.pl th.w { text-align: center; }
.pl th.w small { display: block; font-family: var(--font); font-size: 10.5px; letter-spacing: 0; text-transform: none; color: var(--muted-2); font-weight: 500; }
.pl th.cur { color: var(--teal-dark); } .pl th.cur small { color: var(--teal); }
.pl td { padding: 8px 6px; border-bottom: 1px solid var(--beige-pale); vertical-align: top; }
.pl td.p { padding: 10px; white-space: nowrap; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.pl tr:last-child td { border-bottom: 0; }
.pl .who { display: flex; align-items: center; gap: 10px; }
.pl .who b { font-weight: 600; font-size: 13px; display: block; }
.pl .who span { font-size: 11px; color: var(--muted); }
.cell { display: flex; flex-direction: column; gap: 4px; min-height: 58px; padding: 6px; border-radius: 10px; background: var(--bg); cursor: pointer; min-width: 120px; }
.cell:hover { outline: 2px solid var(--teal-pale); }
.cell.full { background: var(--teal-pale); }
.cell.over { background: var(--red-pale); box-shadow: inset 0 0 0 1px var(--red-line); }
.cell.off { background: repeating-linear-gradient(135deg, var(--bg) 0 6px, var(--line) 6px 8px); }
.cell.drop { outline: 2px dashed var(--teal); }
.a { display: flex; justify-content: space-between; gap: 6px; padding: 4px 8px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line); font-weight: 500; line-height: 1.3; cursor: grab; border-left: 3px solid var(--teal); }
.a span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a b { font-family: var(--font-head); font-weight: 600; white-space: nowrap; }
.a.g { border-left-color: var(--yellow); } .a.t { border-left-color: var(--blue); }
.a.i { border-left-color: var(--beige); color: var(--muted); }
.a.q { border-style: dashed; border-left-style: solid; color: var(--muted); }
.a.abs { border-left-color: var(--line-2); background: transparent; color: var(--muted); }
.tot { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); padding: 2px 2px 0; margin-top: auto; }
.tot b { color: var(--ink); }
.tot.bad, .tot.bad b { color: var(--red-ink); }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; color: var(--muted); align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend span::before { content: ""; display: inline-block; width: 14px; height: 10px; border-radius: 2px; background: var(--c, var(--teal)); border: var(--b, 0); box-shadow: var(--s, none); }
.week-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.week-nav strong { font-family: var(--font-head); font-weight: 600; }

/* ----- grilles de saisie (feuille d'heures, plan de charge par jour) ----- */
.grid-saisie { border-collapse: separate; border-spacing: 0; font-size: 12.5px; background: var(--surface); }
.grid-saisie th, .grid-saisie td { border-right: 1px solid var(--beige-pale); border-bottom: 1px solid var(--beige-pale); padding: 3px 4px; text-align: center; }
.grid-saisie th { background: var(--surface); color: var(--muted); font-family: var(--font-head); font-weight: 600; font-size: 11px; border-bottom: 2px solid var(--beige-pale); }
.grid-saisie th.we, .grid-saisie td.we { background: var(--bg); }
.grid-saisie th.ferie, .grid-saisie td.ferie { background: var(--red-pale); }
.grid-saisie th.today, .grid-saisie td.today { box-shadow: inset 0 0 0 2px var(--yellow); }
.grid-saisie td.lib { text-align: left; white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; padding: 6px 10px; }
.grid-saisie td.lib .sub { color: var(--muted); font-size: 11px; display: block; }
.grid-saisie input { width: 48px; min-height: 32px; padding: 2px 4px; text-align: center; border-color: transparent; background: transparent; font-size: 12.5px; border-radius: 6px; }
.grid-saisie input:focus { border-color: var(--teal); background: var(--surface); outline: 0; }
.grid-saisie input.dirty { background: var(--yellow-pale); }
.grid-saisie td.tot, .grid-saisie tr.tot td { font-weight: 600; background: var(--bg); font-family: var(--font-head); }
.grid-saisie td.over { background: var(--red-pale); }
.sticky-col { position: sticky; left: 0; background: var(--surface); z-index: 2; }
.grid-wrap { overflow: auto; max-height: 72vh; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); }
.grid-wrap table thead th { position: sticky; top: 0; z-index: 3; }
.grid-wrap table thead th.sticky-col { z-index: 4; }
.charge-cell { min-width: 34px; height: 28px; cursor: pointer; font-size: 11px; border-radius: 5px; display: flex; align-items: center; justify-content: center; }
.charge-cell.full { background: var(--teal); color: #fff; } .charge-cell.half { background: #5E9C9A; color: #fff; } .charge-cell.quart { background: var(--teal-pale); }
.charge-cell.abs { background: var(--beige-pale); color: var(--muted); }

/* ----- pointage mobile ----- */
.pt { max-width: 520px; width: 100%; display: flex; flex-direction: column; gap: 14px; }
.pt-head { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden; }
.pt-head::before { content: ""; position: absolute; right: -70px; top: -40px; width: 190px; height: 280px; background: url(/ef-courbe.png) no-repeat center / contain; opacity: .08; pointer-events: none; }
.pt-head .top { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: relative; }
.pt-head .top .l { display: flex; align-items: center; gap: 12px; }
.pt-head .top img { width: 44px; height: 44px; object-fit: contain; }
.pt-head .date { font-size: 12px; color: var(--muted); }
.pt-head h1 { font-size: 22px; margin: 0; }
.pt-head .pointe { width: 120px; margin: -6px 0 -2px -3px; }
.days { display: flex; gap: 4px; background: var(--bg); border-radius: 14px; padding: 4px; }
.day { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 0; border-radius: 12px; font-size: 11px; color: var(--muted); border: 0; background: none; font-family: inherit; min-height: 60px; cursor: pointer; }
.day b { font-family: var(--font-head); font-size: 15px; font-weight: 600; color: var(--ink); }
.day i { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); display: block; }
.day i.no { background: var(--line-2); } .day i.abs { background: var(--beige); }
.day.on { background: var(--teal); color: #C9E3E1; }
.day.on b { color: #fff; } .day.on i { background: var(--yellow); }
.day.we { opacity: .6; }
.pt-sum { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.pt-sum strong { color: var(--teal); }
.pt-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); }
.pt-row .t { flex: 1; min-width: 0; }
.pt-row .t b { display: block; font-size: 13.5px; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; }
.pt-row .t span { font-size: 12px; color: var(--muted); display: block; }
.pt-row.add { border-style: dashed; background: transparent; cursor: pointer; }
.pt-row.add b { color: var(--teal); }
.pt-row.dirty { border-color: var(--yellow); }
.frac { display: inline-flex; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: var(--surface); }
.frac button { font-family: var(--font-head); font-size: 13px; font-weight: 600; min-width: 42px; min-height: 42px; border: 0; background: var(--surface); color: var(--muted); cursor: pointer; }
.frac button + button { border-left: 1px solid var(--line); }
.frac button.on { background: var(--teal); color: #fff; }
.frac button.other { font-size: 11px; min-width: 48px; }
.pt-save { width: 100%; min-height: 50px; border-radius: 14px; font-family: var(--font-head); font-size: 15px; }
.pt-foot { position: sticky; bottom: 0; padding: 10px 0 0; background: linear-gradient(to bottom, rgba(248,245,239,0), var(--bg) 40%); }

/* ----- graphiques SVG ----- */
.chart { width: 100%; height: auto; font-family: var(--font); }
.chart .axis { stroke: var(--line-2); stroke-width: 1; }
.chart .grid { stroke: var(--beige-pale); stroke-width: 1; }
.chart text { fill: var(--muted); font-size: 11px; }
.chart .bar { rx: 3; }
.chart .bar:hover { opacity: .8; }
.chart-tip { position: fixed; background: var(--ink); color: #fff; padding: 6px 10px; border-radius: 6px; font-size: 12px; pointer-events: none; z-index: 60; white-space: nowrap; }
.bar-h { display: grid; grid-template-columns: minmax(120px, 200px) 1fr 90px; gap: 6px 10px; align-items: center; font-size: 12.5px; }
.bar-h .track { background: var(--beige-pale); height: 12px; border-radius: 6px; overflow: hidden; }
.bar-h .fill { background: var(--teal); height: 100%; border-radius: 6px; }
.bar-h .fill.neg { background: var(--red); }
.progress { height: 10px; background: var(--beige-pale); border-radius: 5px; overflow: hidden; }
.progress > div { height: 100%; background: var(--teal); border-radius: 5px; }
.alert-list { margin: 0; padding-left: 18px; }
.alert-list li { margin-bottom: 4px; }
.filters { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.filters .field { margin-bottom: 0; }
.help { font-size: 12.5px; color: var(--muted); margin: 0; }

/* ----- écrans étroits ----- */
@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 .span-2 { grid-column: 1 / -1; }
  .main { padding: 24px 22px 40px; }
  :root { --nav-w: 220px; }
}
@media (max-width: 900px) {
  body { font-size: 14px; }
  .shell { flex-direction: column; }
  .topbar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 25; }
  .topbar img { width: 36px; height: 36px; object-fit: contain; }
  .topbar .t { flex: 1; min-width: 0; }
  .topbar .t b { display: block; font-family: var(--font-head); font-size: 15px; font-weight: 600; }
  .topbar .t span { font-size: 11px; color: var(--teal); font-family: var(--font-head); letter-spacing: .08em; text-transform: uppercase; font-weight: 600; }
  .topbar .burger { width: 44px; height: 44px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
  .topbar .burger svg { width: 20px; height: 20px; color: var(--ink); }
  .nav { position: fixed; top: 0; left: 0; bottom: 0; height: 100vh; width: min(300px, 86vw); flex: none; transform: translateX(-105%); transition: transform .2s ease; box-shadow: 0 0 0 rgba(0,0,0,0); z-index: 40; overflow: auto; }
  .nav.open { transform: none; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
  .nav-backdrop { position: fixed; inset: 0; background: rgba(64,71,79,.4); z-index: 35; }
  .nav-backdrop.open { display: block; }
  .main { padding: 16px 16px 96px; gap: 16px; }
  h1 { font-size: 24px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .card { padding: 16px; }
  .kpi { padding: 14px 18px 18px; }
  .kpi .value { font-size: 24px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .toolbar { width: 100%; }
  .toolbar .btn { flex: 1 1 auto; }
  .search input { width: 100%; }
  .search { width: 100%; }
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .modal-bg { padding: 12px; }
  .modal-body { padding: 14px 16px; }
  .bottom-nav { display: flex; position: fixed; left: 12px; right: 12px; bottom: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 4px 6px 8px; z-index: 30; box-shadow: 0 8px 24px rgba(2,75,70,.12); }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10.5px; color: var(--muted); text-decoration: none; padding: 8px 0 4px; min-height: 48px; }
  .bottom-nav a.active { color: var(--teal-dark); font-weight: 600; }
  .bottom-nav a svg { width: 22px; height: 22px; }
  .bottom-nav a.active svg { color: var(--teal); }
  .stepper { flex-wrap: wrap; gap: 10px 8px; }
  .stepper .rail, .stepper .rail-done { display: none; }
  .step { flex: 1 1 28%; }
  .kanban { flex-direction: column; }
  .kcol { flex: none; width: 100%; }
  .donut-wrap { flex-direction: column; align-items: flex-start; }
  .pt-foot { position: fixed; left: 16px; right: 16px; bottom: 74px; padding: 0; background: none; }
  .pt { padding-bottom: 140px; }
  .pt-head select { max-width: 110px; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; }
  .tab { white-space: nowrap; }
}
@media print { .nav, .toolbar, .btn, .topbar, .bottom-nav { display: none !important; } .main { padding: 0; } }
