/* APIA Gestion — charte APIA : marron #512A1B, crème #FFFAF8, orange #E66D3E, verts #A6C868 / #4F665A, taupe #66554F ; Montserrat + Poppins */
:root {
  /* Charte APIA */
  --navy: #512A1B;        /* marron APIA : menu latéral */
  --navy-2: #66382A;
  --primary: #512A1B;
  --primary-h: #3E1F13;
  --gold: #E66D3E;        /* orange APIA : accent */
  --bg: #F8F1EC;
  --surface: #FFFFFF;
  --line: #EADFD9;
  --line-2: #F3ECE8;
  --text: #2B1A12;
  --muted: #66554F;       /* taupe APIA */
  --radius: 12px;
  --shadow: 0 1px 2px rgba(81, 42, 27, .05);

  --blue-bg: #F2E6E0;   --blue-fg: #512A1B;
  --amber-bg: #FBEBD3;  --amber-fg: #85540A;
  --orange-bg: #FCE5DA; --orange-fg: #B04821;
  --green-bg: #E9F2DA;  --green-fg: #3F5A2A;
  --red-bg: #FCE5E3;    --red-fg: #A3271F;
  --grey-bg: #F1EBE8;   --grey-fg: #66554F;
  --violet-bg: #E3ECE7; --violet-fg: #4F665A;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-family: 'Montserrat', 'Poppins', sans-serif; font-weight: 700; letter-spacing: -.01em; color: var(--primary); }
h2 { font-weight: 600; }
code { font-size: 12.5px; background: var(--line-2); padding: 1px 5px; border-radius: 4px; }
.ic { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.mt { margin-top: 16px; }

/* ---------- Structure ---------- */
.app { display: flex; min-height: 100vh; }
@media (min-width: 761px) { .app { background: linear-gradient(to right, var(--navy) 232px, var(--bg) 232px); } }
.side {
  width: 232px; flex: none;
  background: var(--navy); color: #EADBD3;
  display: flex; flex-direction: column;
  padding: 20px 12px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; color: #fff; text-decoration: none !important; }
.brand { flex-direction: column; align-items: flex-start; gap: 4px; padding: 6px 12px 24px; }
.brand img { display: block; width: 132px; height: auto; }
.brand small { font-size: 10.5px; font-weight: 500; letter-spacing: .22em; color: #D2B5A7; text-transform: uppercase; padding-left: 2px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 8px;
  color: #EADBD3; font-weight: 500; text-decoration: none !important;
}
.nav-link:hover { background: var(--navy-2); color: #fff; }
.nav-link.active { background: var(--navy-2); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.side-foot { margin-top: auto; border-top: 1px solid #6E4231; padding-top: 12px; display: flex; flex-direction: column; gap: 2px; }
.side-foot .nav-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 22px 32px 6px;
}
.topbar .titles { flex: 1; min-width: 200px; }
.topbar h1 { font-size: 22px; }
.subtitle { margin: 2px 0 0; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.content { padding: 16px 32px 48px; display: flex; flex-direction: column; gap: 18px; }
.menu-btn { display: none; background: none; border: 0; padding: 6px; margin-left: -6px; color: var(--text); cursor: pointer; }
.nav-overlay { display: none; }

/* ---------- Composants ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-pad { padding: 18px 20px; }
.card-h {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 20px; border-bottom: 1px solid var(--line-2);
}
.card-h h2 { font-size: 15px; }
.card-h .count { color: var(--muted); font-weight: 500; margin-left: 6px; }
.card-b { padding: 16px 20px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: inherit; font-weight: 500; font-size: 13.5px;
  padding: 8px 14px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  cursor: pointer; text-decoration: none !important; white-space: nowrap;
}
.btn:hover { border-color: #D9C7BE; background: #FFFAF8; }
.btn .ic { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-h); border-color: var(--primary-h); }
.btn-green { background: #4F665A; border-color: #4F665A; color: #fff; }
.btn-green:hover { background: #3F5249; border-color: #3F5249; }
.btn-danger { color: var(--red-fg); }
.btn-danger:hover { background: var(--red-bg); border-color: #F2C4C1; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; font-size: 12px; }
.link-btn:hover { color: var(--red-fg); text-decoration: underline; }

.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 500; white-space: nowrap; line-height: 1.6;
}
.badge-blue { background: var(--blue-bg); color: var(--blue-fg); }
.badge-amber { background: var(--amber-bg); color: var(--amber-fg); }
.badge-orange { background: var(--orange-bg); color: var(--orange-fg); }
.badge-green { background: var(--green-bg); color: var(--green-fg); }
.badge-red { background: var(--red-bg); color: var(--red-fg); }
.badge-grey { background: var(--grey-bg); color: var(--grey-fg); }
.badge-violet { background: var(--violet-bg); color: var(--violet-fg); }

.flash { padding: 10px 14px; border-radius: 8px; font-weight: 500; }
.flash-ok { background: var(--green-bg); color: var(--green-fg); }
.flash-err { background: var(--red-bg); color: var(--red-fg); }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.kpi {
  display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; color: var(--text); text-decoration: none !important; box-shadow: var(--shadow);
}
a.kpi:hover { border-color: #D9C7BE; }
.kpi .k-label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.kpi .k-val { font-family: 'Montserrat', 'Poppins', sans-serif; font-size: 23px; font-weight: 700; margin-top: 4px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .k-sub { font-size: 12px; color: var(--muted); }
.kpi.alert .k-val { color: var(--red-fg); }
.kpi.warn .k-val { color: var(--amber-fg); }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-size: 12px; font-weight: 500; color: var(--muted);
  padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #FFFAF8;
}
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr[data-href] { cursor: pointer; }
.tbl tr[data-href]:hover td { background: #FFF6F2; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .strong { font-weight: 500; }
.tbl tfoot td { font-weight: 600; background: #FFFAF8; border-top: 1px solid var(--line); }
.cell-sub { display: block; font-size: 12px; color: var(--muted); }
.late { color: var(--red-fg); font-weight: 500; }

.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--line-2); }
.mini-list li:last-child { border-bottom: 0; }
.mini-list .ml-main { min-width: 0; }
.mini-list .ml-main a { font-weight: 500; }
.mini-list .ml-side { text-align: right; flex: none; }
.empty { padding: 18px 20px; color: var(--muted); }
.empty-state { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty-state p { margin: 0 0 14px; }

/* ---------- Filtres / onglets ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tab {
  padding: 6px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; font-size: 13px;
  text-decoration: none !important; border: 1px solid transparent;
}
.tab:hover { background: var(--surface); border-color: var(--line); color: var(--text); }
.tab.active { background: var(--surface); border-color: var(--line); color: var(--text); box-shadow: var(--shadow); }
.tab .n { color: var(--muted); font-weight: 400; margin-left: 4px; }
.search { position: relative; margin-left: auto; }
.search .ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; }
.search input { padding-left: 32px; width: 240px; }

/* ---------- Formulaires ---------- */
input, select, textarea {
  font: inherit; font-size: 14px; color: var(--text);
  width: 100%; padding: 8px 11px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(81, 42, 27, .14); }
textarea { resize: vertical; min-height: 80px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.field .req { color: var(--red-fg); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.form-section { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); grid-column: 1 / -1; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.form-section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; padding-top: 6px; }
.form-actions .spacer { flex: 1; }
.errors { background: var(--red-bg); color: var(--red-fg); border-radius: 8px; padding: 10px 14px; }
.errors ul { margin: 0; padding-left: 18px; }
.ttc-preview { font-weight: 600; font-size: 16px; padding: 8px 0; }

/* ---------- Fiches ---------- */
.info-list { display: grid; grid-template-columns: 130px 1fr; gap: 9px 14px; margin: 0; }
.info-list dt { color: var(--muted); font-size: 13px; }
.info-list dd { margin: 0; overflow-wrap: anywhere; }
.head-card { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.head-card .hc-main { flex: 1; min-width: 220px; }
.head-card h2 { font-size: 18px; }
.head-card .hc-meta { color: var(--muted); margin-top: 3px; display: flex; gap: 14px; flex-wrap: wrap; }
.hc-meta span { display: inline-flex; align-items: center; gap: 5px; }
.hc-meta .ic { width: 15px; height: 15px; }
.amounts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line-2); border-radius: 8px; overflow: hidden; }
.amounts div { background: #FFFAF8; padding: 12px 14px; }
.amounts .a-l { font-size: 12px; color: var(--muted); }
.amounts .a-v { font-family: 'Montserrat', 'Poppins', sans-serif; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 4px 20px 8px; }
.tl-item { position: relative; padding: 10px 0 12px 22px; border-left: 2px solid var(--line-2); margin-left: 5px; }
.tl-item:last-child { border-left-color: transparent; }
.tl-item::before {
  content: ''; position: absolute; left: -7px; top: 14px;
  width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid #CDB8AE;
}
.tl-item.tl-statut::before { border-color: var(--primary); }
.tl-item.tl-green::before { border-color: var(--green-fg); background: var(--green-fg); }
.tl-item.tl-red::before { border-color: var(--red-fg); background: var(--red-fg); }
.tl-item.tl-orange::before { border-color: var(--orange-fg); }
.tl-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.tl-head .who { color: var(--muted); }
.tl-body { margin-top: 4px; white-space: normal; overflow-wrap: anywhere; }
.tl-del { margin-left: auto; }

/* ---------- Circuit dossier ---------- */
.stepper { display: flex; align-items: center; gap: 0; padding: 18px 20px; flex-wrap: wrap; row-gap: 12px; }
.step { display: flex; align-items: center; gap: 10px; }
.step .dot {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--line); color: var(--muted); font-weight: 600; font-size: 13px; background: #fff; flex: none;
}
.step .dot .ic { width: 16px; height: 16px; }
.step .s-l { font-weight: 500; line-height: 1.25; }
.step .s-d { font-size: 12px; color: var(--muted); }
.step.done .dot { background: var(--primary); border-color: var(--primary); color: #fff; }
.step.current .dot { border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 4px rgba(81, 42, 27, .1); }
.step.ok .dot { background: var(--green-fg); border-color: var(--green-fg); color: #fff; }
.step.ko .dot { background: var(--red-fg); border-color: var(--red-fg); color: #fff; }
.step.warn .dot { border-color: var(--orange-fg); color: var(--orange-fg); box-shadow: 0 0 0 4px rgba(162, 70, 15, .1); }
.step-line { flex: 1; min-width: 28px; height: 2px; background: var(--line); margin: 0 12px; }
.step-line.done { background: var(--primary); }
.next-hint { margin: 0 20px 16px; padding: 10px 14px; border-radius: 8px; background: #FFF6F2; color: var(--muted); display: flex; gap: 8px; align-items: flex-start; }
.next-hint .ic { margin-top: 2px; color: var(--primary); }

details.act { border: 1px solid var(--line); border-radius: 8px; background: #fff; }
details.act + details.act { margin-top: 8px; }
details.act > summary {
  list-style: none; cursor: pointer; padding: 9px 12px; font-weight: 500;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
details.act > summary::-webkit-details-marker { display: none; }
details.act > summary::after { content: '+'; color: var(--muted); font-weight: 400; font-size: 18px; line-height: 1; }
details.act[open] > summary::after { content: '–'; }
details.act > form { padding: 4px 12px 12px; display: flex; flex-direction: column; gap: 10px; }
details.act.a-green > summary { color: var(--green-fg); }
details.act.a-red > summary { color: var(--red-fg); }
details.act.a-orange > summary { color: var(--orange-fg); }
details.act.a-primary > summary { color: var(--primary); }
details.subtle { margin-top: 12px; }
details.subtle > summary { cursor: pointer; color: var(--muted); font-size: 12.5px; }
details.subtle > form { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }

.pipeline { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.pipe {
  display: block; padding: 10px 12px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line);
  color: var(--text); text-decoration: none !important;
}
.pipe:hover { border-color: #D9C7BE; }
.pipe.active { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.pipe .p-n { font-family: 'Montserrat', 'Poppins', sans-serif; font-size: 20px; font-weight: 700; color: var(--primary); }
.pipe .badge { font-size: 11.5px; }

/* ---------- Connexion ---------- */
body.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--navy); }
.auth-card { width: 100%; max-width: 400px; background: #fff; border-radius: 14px; padding: 32px; display: flex; flex-direction: column; gap: 12px; }
.auth-card h1 { font-size: 20px; }
.auth-card p { margin: 0; }
.auth-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-bottom: 12px; }
.auth-brand img { display: block; width: 150px; height: auto; }
.auth-brand small { font-size: 10.5px; font-weight: 500; letter-spacing: .22em; color: var(--muted); text-transform: uppercase; padding-left: 2px; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pipeline { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .grid-main { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .side { position: fixed; z-index: 30; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s ease; }
  body.nav-open .side { transform: none; }
  body.nav-open .nav-overlay { display: block; position: fixed; inset: 0; background: rgba(43, 26, 18, .45); z-index: 20; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 14px 16px 4px; }
  .topbar h1 { font-size: 19px; }
  .content { padding: 12px 16px 40px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: 1fr; }
  .search { margin-left: 0; width: 100%; }
  .search input { width: 100%; }
  .info-list { grid-template-columns: 1fr; gap: 2px; }
  .info-list dd { margin-bottom: 8px; }
  .amounts { grid-template-columns: 1fr; }
  .stepper { flex-direction: column; align-items: flex-start; row-gap: 0; }
  .step-line { flex: none; width: 2px; min-width: 0; height: 16px; margin: 4px 0 4px 14px; }
  .tbl .hide-sm { display: none; }
}

/* ---------- v2 : suggestions (adresse, entreprise) ---------- */
.ac-wrap, .lookup { position: relative; }
.lookup { display: flex; gap: 8px; }
.lookup input { flex: 1; min-width: 0; }
.ac-list {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 40; margin-top: 4px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 10px 28px rgba(43, 26, 18, .14); max-height: 300px; overflow: auto; padding: 4px;
}
.ac-item { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: 7px; background: none; font: inherit; color: var(--text); cursor: pointer; }
.ac-item span { font-weight: 500; }
.ac-item small { display: block; color: var(--muted); font-size: 12px; }
.ac-item:hover, .ac-item.on { background: var(--line-2); }
.hint { font-size: 12px; color: var(--muted); font-weight: 400; }
.hint.late { color: var(--red-fg); }
.show-if-empty { display: none; }
.field.is-empty .show-if-empty { display: block; }
.money-row { display: flex; gap: 12px; align-items: center; }
.money-row input { flex: 1; min-width: 0; }
.ttc-inline { white-space: nowrap; font-weight: 600; color: var(--primary); min-width: 110px; }
.flash-info { background: #FFF6F2; color: var(--text); border: 1px solid var(--line); font-weight: 400; }
.steps-ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }

/* Contacts */
.contact-list { list-style: none; margin: 0; padding: 0; }
.contact-list > li { padding: 12px 20px; border-bottom: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 3px; }
.contact-list > li:last-child { border-bottom: 0; }
.ct-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ct-lines { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.ct-lines span { display: inline-flex; gap: 6px; align-items: center; overflow-wrap: anywhere; }
.ct-lines .ic { width: 14px; height: 14px; color: var(--muted); }
.contact-list details.subtle { margin-top: 4px; }

/* Dossier : échéances, documents */
.deadlines { display: flex; gap: 10px; flex-wrap: wrap; }
.dl { border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; display: flex; flex-direction: column; min-width: 170px; background: #FFFAF8; }
.dl span { font-size: 12px; color: var(--muted); }
.dl strong { font-family: 'Montserrat', 'Poppins', sans-serif; font-size: 17px; color: var(--primary); }
.dl small { font-size: 12px; color: var(--muted); }
.dl.dl-late { border-color: #F0C4BF; background: var(--red-bg); }
.dl.dl-late strong, .dl.dl-late small { color: var(--red-fg); }
.tl-item.tl-amber::before { border-color: var(--amber-fg); background: var(--amber-bg); }
details.act.a-amber { border-color: #EED9B3; background: #FFFBF3; }
details.act.a-amber > summary { color: var(--amber-fg); }
.doc-list { list-style: none; margin: 0; padding: 0; }
.doc-list li { display: flex; align-items: center; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--line-2); }
.doc-ic { width: 34px; height: 34px; border-radius: 8px; background: var(--line-2); display: grid; place-items: center; color: var(--primary); flex: none; }
.doc-main { flex: 1; min-width: 0; }
.doc-main a { font-weight: 500; overflow-wrap: anywhere; }
.doc-add { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line-2); }
.doc-add .row { gap: 8px; }
.file-in { flex: 1; min-width: 200px; padding: 6px; background: #FFFAF8; }

/* Planning */
.week-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.week-nav strong { font-family: 'Montserrat', 'Poppins', sans-serif; font-size: 16px; color: var(--primary); min-width: 190px; text-align: center; }
.week-nav .legend { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.week { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; align-items: start; }
.day-card .card-h { padding: 11px 16px; }
.day-card h2 { font-size: 14.5px; display: flex; align-items: center; gap: 8px; }
.day-num { color: var(--muted); font-weight: 500; font-family: 'Poppins', sans-serif; }
.day-card.is-today { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.day-card.is-past { opacity: .78; }
.day-card .empty { padding: 12px 16px; font-size: 13px; }
.day-late { border-color: #F0C4BF; }
.day-late .card-h { background: var(--red-bg); border-radius: 12px 12px 0 0; }
.day-late h2 { color: var(--red-fg); }
.pl-list { list-style: none; margin: 0; padding: 0; }
.pl-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 16px; border-bottom: 1px solid var(--line-2); }
.pl-item:last-child { border-bottom: 0; }
.pl-time { width: 48px; flex: none; font-weight: 600; font-size: 13px; color: var(--primary); line-height: 1.3; padding-top: 2px; }
.pl-time small { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; }
.pl-date { display: block; color: var(--red-fg); }
.pl-main { flex: 1; min-width: 0; }
.pl-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 2px; }
.pl-top .badge { font-size: 11px; padding: 1px 8px; }
.pl-title { font-weight: 500; overflow-wrap: anywhere; }
.pl-item.is-done .pl-title { text-decoration: line-through; color: var(--muted); }
.check-btn { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); background: #fff; color: transparent; display: grid; place-items: center; cursor: pointer; padding: 0; }
.check-btn .ic { width: 15px; height: 15px; }
.check-btn:hover { border-color: var(--green-fg); color: var(--green-fg); }
.check-btn.on { background: #4F665A; border-color: #4F665A; color: #fff; }
details.add-event > summary { list-style: none; cursor: pointer; }
details.add-event > summary::-webkit-details-marker { display: none; }
details.add-event:not([open]) > summary { border-bottom: 0; }

/* Chiffre d'affaires mensuel */
.ca-chart { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 2px; height: 210px; align-items: end; padding-top: 22px; }
.ca-col { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; text-decoration: none !important; color: var(--text); border-radius: 6px; padding: 0 3px; }
.ca-col:hover { background: var(--line-2); }
.ca-bar { width: min(34px, 70%); background: var(--primary); border-radius: 4px 4px 0 0; min-height: 0; }
.ca-col.future .ca-bar { background: #CDB8AE; }
.ca-col.on .ca-bar { background: var(--gold); }
.ca-val { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; margin-bottom: 3px; white-space: nowrap; }
.ca-m { font-size: 12px; color: var(--muted); padding: 6px 0 2px; border-top: 1px solid var(--line); width: 100%; text-align: center; }
.ca-tip {
  position: absolute; bottom: calc(100% - 14px); left: 50%; transform: translateX(-50%); z-index: 10;
  background: var(--text); color: #fff; font-size: 12px; line-height: 1.45; padding: 7px 10px; border-radius: 8px;
  white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s;
}
.ca-tip strong { display: block; }
.ca-col:hover .ca-tip, .ca-col:focus-visible .ca-tip { opacity: 1; }
.ca-col:first-child .ca-tip { left: 0; transform: none; }
.ca-col:last-child .ca-tip { left: auto; right: 0; transform: none; }

@media (max-width: 760px) {
  .week { grid-template-columns: 1fr; }
  .week-nav .legend { margin-left: 0; }
  .ca-chart { height: 170px; }
  .ca-val { display: none; }
  .deadlines { width: 100%; }
  .dl { flex: 1; min-width: 140px; }
  .lookup { flex-wrap: wrap; }
  .lookup .btn { width: 100%; }
}

/* Devis : lignes de prestations */
.lines { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.line { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #FFFCFA; }
.line-top { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.line-top select { flex: 1; font-weight: 500; }
.line-grid { display: grid; grid-template-columns: 3fr .7fr .8fr 1.1fr 1fr; gap: 8px 10px; }
.line-grid .field { margin: 0; }
.line-grid .field.full { grid-column: 1 / -1; }
.line-grid textarea { min-height: 38px; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--red-bg); color: var(--red-fg); }
.lines-total { display: flex; gap: 22px; justify-content: flex-end; flex-wrap: wrap; padding: 10px 2px 0; color: var(--muted); }
.lines-total strong { color: var(--text); font-family: 'Montserrat', 'Poppins', sans-serif; margin-left: 4px; }
@media (max-width: 760px) {
  .line-grid { grid-template-columns: 1fr 1fr; }
  .line-grid .l-titre-f { grid-column: 1 / -1; }
}

/* Aperçu de devis */
.doc-preview { padding: 28px 30px; font-size: 14px; }
.dp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.dp-logo { height: 46px; width: auto; }
.dp-title { text-align: right; }
.dp-kind { font-family: 'Montserrat', 'Poppins', sans-serif; font-size: 24px; font-weight: 700; color: var(--primary); }
.dp-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 18px; }
.dp-parties > div { background: #FFFAF8; border: 1px solid var(--line-2); border-radius: 10px; padding: 12px 14px; }
.dp-l { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 4px; }
.dp-entete { border-left: 3px solid var(--gold); padding: 6px 12px; margin-bottom: 16px; background: #FFF6F1; }
.dp-lines th { background: #FFFAF8; }
.dp-totals { margin: 14px 0 0 auto; max-width: 300px; display: flex; flex-direction: column; gap: 6px; }
.dp-totals > div { display: flex; justify-content: space-between; gap: 12px; }
.dp-ttc { border-top: 2px solid var(--primary); padding-top: 8px; font-size: 16px; }
.dp-cond { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line-2); font-size: 13px; }
@media (max-width: 640px) { .doc-preview { padding: 18px 16px; } .dp-parties { grid-template-columns: 1fr; } }

/* Envoi par e-mail */
.send-form textarea { min-height: 150px; }
.sent-info { display: flex; align-items: center; gap: 8px; color: var(--green-fg); background: var(--green-bg); border-radius: 8px; padding: 8px 12px; font-size: 13px; }
label.check { display: flex; gap: 8px; align-items: center; font-size: 14px; cursor: pointer; }
label.check input { width: auto; margin: 0; }

/* Assistant IA */
.ai-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.ai-chat { display: flex; flex-direction: column; height: calc(100vh - 170px); min-height: 480px; overflow: hidden; }
.ai-scroll { flex: 1; overflow-y: auto; padding: 20px 20px 8px; display: flex; flex-direction: column; gap: 10px; }
.ai-msg { display: flex; }
.ai-user { justify-content: flex-end; }
.ai-bubble { max-width: 82%; padding: 10px 14px; border-radius: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.ai-user .ai-bubble { background: var(--primary); color: #FFFAF8; border-bottom-right-radius: 4px; }
.ai-bot .ai-bubble { background: #FFFAF8; border: 1px solid var(--line-2); border-bottom-left-radius: 4px; }
.ai-bot .ai-bubble ul { margin: 4px 0; padding-left: 20px; }
.ai-bot .ai-bubble a { color: var(--gold); font-weight: 500; }
.ai-tool { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); padding-left: 4px; }
.ai-tool svg { width: 13px; height: 13px; }
.ai-done { font-size: 13px; color: var(--green-fg); background: var(--green-bg); border-radius: 8px; padding: 6px 10px; align-self: flex-start; }
.ai-err { font-size: 13px; color: var(--red-fg); background: var(--red-bg); border-radius: 8px; padding: 8px 12px; align-self: flex-start; max-width: 90%; }
.ai-confirm { border: 1px solid var(--gold); background: #FFF6F1; border-radius: 12px; padding: 12px 14px; max-width: 92%; align-self: flex-start; }
.ai-confirm-h { display: flex; align-items: center; gap: 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--orange-fg); margin-bottom: 8px; }
.ai-confirm-h svg { width: 14px; height: 14px; }
.ai-action + .ai-action { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.ai-action dl { display: grid; grid-template-columns: 110px 1fr; gap: 3px 10px; margin: 6px 0 0; font-size: 13px; }
.ai-action dt { color: var(--muted); }
.ai-action dd { margin: 0; }
.ai-confirm-b { display: flex; gap: 8px; margin-top: 12px; }
.ai-confirm.done .ai-confirm-b { display: none; }
.ai-composer { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line-2); background: #fff; }
.ai-composer textarea { flex: 1; resize: none; min-height: 42px; max-height: 160px; }
.ai-composer .btn { align-self: flex-end; height: 42px; }
.ai-mic { width: 42px; padding: 0; justify-content: center; }
.ai-mic.on { background: #C0392B; border-color: #C0392B; color: #fff; animation: micPulse 1.2s ease-in-out infinite; }
@keyframes micPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(192, 57, 43, .45); } 50% { box-shadow: 0 0 0 7px rgba(192, 57, 43, 0); } }
.ai-mic-msg { padding: 0 12px 8px; font-size: 12px; color: var(--muted); }
input.ac-bad { border-color: #C0392B; background: #FFF5F4; }
.mct-row { padding-bottom: 10px; border-bottom: 1px dashed var(--line-2); }
.dem-list .dem-n { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; background: var(--line-2); align-items: center; justify-content: center; font-size: 12px; font-weight: 600; margin-right: 8px; }
.dem-list li.dem-cur { background: #FFF6F1; }
.dem-list li.dem-cur .dem-n { background: var(--gold); color: #fff; }
.dem-line + .dem-line { margin-top: 4px; }
.check-list { list-style: none; margin: 6px 0 0; padding: 0; }
.check-list li { position: relative; padding: 3px 0 3px 22px; font-size: 14px; }
.check-list li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 11px; height: 11px; border: 1.5px solid var(--gold); border-radius: 3px; }
.ai-empty { margin: auto; text-align: center; max-width: 560px; color: var(--muted); }
.ai-star { width: 38px; height: 38px; color: var(--gold); }
.ai-examples { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; color: var(--text); cursor: pointer; text-align: left; }
.chip:hover { border-color: var(--gold); background: #FFF6F1; }
.ai-typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.ai-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); opacity: .4; animation: aiDot 1.2s infinite; }
.ai-typing i:nth-child(2) { animation-delay: .2s; } .ai-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes aiDot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.ai-convs { list-style: none; margin: 0; padding: 0 8px 8px; }
.ai-convs li { display: flex; justify-content: space-between; gap: 8px; padding: 7px 8px; border-radius: 8px; }
.ai-convs li a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.ai-convs li.active { background: var(--line-2); }
@media (max-width: 960px) {
  .ai-layout { grid-template-columns: 1fr; }
  .ai-chat { height: calc(100vh - 150px); }
  .ai-bubble { max-width: 92%; }
}
.mail-list .mail-snip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 560px; }
.mail-list .ml-main a { font-weight: 500; }
/* Menu : groupe Réglages */
.nav-group { margin-top: 6px; }
.nav-group > summary { list-style: none; cursor: pointer; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary.in { color: #fff; }
.nav-chev { margin-left: auto; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); opacity: .7; transition: transform .15s; }
.nav-group[open] .nav-chev { transform: rotate(-135deg); }
.nav-sub { padding-left: 34px; font-size: 14px; }
.nav-sub svg { width: 16px; height: 16px; }
.ai-archives { border-top: 1px solid var(--line-2); padding: 8px 16px 6px; }
.ai-archives > summary { cursor: pointer; font-size: 13px; color: var(--muted); padding: 4px 0; }
.ai-arch-q { margin: 6px 0; font-size: 13px; padding: 6px 10px; }
.ai-convs-arch { max-height: 320px; overflow-y: auto; padding: 0; }

/* ---------- Mobile : lisibilité ---------- */
.show-sm { display: none; }
.grid-main > *, .stack > *, .ai-layout > * { min-width: 0; }
.mail-list .ml-main { flex: 1; min-width: 0; }
.mail-list .mail-snip { max-width: 100%; }
.kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ca-m .sh { display: none; }
.more-btn { display: none; width: 100%; border: 0; border-top: 1px solid var(--line-2); background: none; padding: 12px; font: inherit; font-weight: 500; color: var(--gold); cursor: pointer; }
@media (max-width: 760px) {
  input, select, textarea { font-size: 16px; } /* évite le zoom automatique de l'iPhone */
  .show-sm { display: initial; }
  .btn.show-sm { display: inline-flex; }
  span.cell-sub.show-sm { display: block; }
  .more-btn.show-sm { display: block; }
  .tbl th, .tbl td { padding-left: 10px; padding-right: 10px; }
  .subtitle { font-size: 13px; }
  .actions { flex-wrap: wrap; }
  .kpis, .kpis-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { padding: 12px; }
  .kpi .k-val { font-size: 17px; overflow-wrap: anywhere; }
  .mini-list li { flex-wrap: wrap; padding: 10px 14px; }
  .mini-list .ml-side { text-align: left; }
  .mini-list.collapsible:not(.show-all) li.extra { display: none; }
  .ca-m .lg { display: none; }
  .ca-m .sh { display: inline; }
  .ca-tip { display: none; }
  .ca-chart { padding-top: 6px; height: 140px; }
  /* Assistant : la conversation occupe l'écran, l'historique s'ouvre à la demande */
  .p-assistant .subtitle { display: none; }
  .p-assistant .content { padding-bottom: 12px; }
  .p-assistant .ai-chat { height: calc(100vh - 150px); height: calc(100dvh - 150px); min-height: 360px; }
  .p-assistant .ai-side { display: none; }
  .p-assistant.ai-side-open .ai-side { display: flex; }
  .p-assistant.ai-side-open .ai-chat { display: none; }
  .ai-scroll { padding: 14px 12px 8px; }
  .ai-composer { padding: 8px; }
  .ai-examples .chip { font-size: 13px; }
  .ai-action dl { grid-template-columns: 1fr; }
  .ai-action dt { margin-top: 4px; }
}
@media (max-width: 760px) {
  .tbl { font-size: 13px; }
  .tbl th, .tbl td { padding: 9px 8px; }
  .tbl th:first-child, .tbl td:first-child { padding-left: 14px; }
  .tbl th:last-child, .tbl td:last-child { padding-right: 14px; }
  .tbl td.nowrap:not(.num) { white-space: normal; }
  .tbl .badge { font-size: 11px; }
}
@media (max-width: 760px) { .tbl select { max-width: 130px; } }
details.mobile-fold > summary { display: none; }
@media (max-width: 760px) {
  details.mobile-fold > summary { display: inline-flex; list-style: none; cursor: pointer; }
  details.mobile-fold > summary::-webkit-details-marker { display: none; }
  details.mobile-fold[open] > summary { margin-bottom: 12px; }
  .aside-first-sm > aside { order: -1; }
  .tbl td.nowrap.strong { white-space: nowrap; }
}
[hidden] { display: none !important; }

/* Trésorerie : facturé / encaissé / dépensé */
:root { --s-fact: #3B6FD0; --s-enc: #1F9E89; --s-dep: #E66D3E; }
form.inline { display: inline; margin: 0; }
.linklike { background: none; border: 0; padding: 4px; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; }
.center { text-align: center; }
.tr-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.tr-legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.sw-fact, .b-fact { background: var(--s-fact); }
.sw-enc, .b-enc { background: var(--s-enc); }
.sw-dep, .b-dep { background: var(--s-dep); }
.tr-chart { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 2px; height: 220px; align-items: end; padding-top: 18px; margin-bottom: 14px; }
.tr-col { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; text-decoration: none !important; color: var(--text); border-radius: 6px; padding: 0 2px; }
.tr-col:hover, .tr-col.on { background: var(--line-2); }
.tr-col:hover .ca-tip, .tr-col:focus-visible .ca-tip { opacity: 1; }
.tr-col:first-child .ca-tip { left: 0; transform: none; }
.tr-col:last-child .ca-tip { left: auto; right: 0; transform: none; }
.tr-col.future .tr-bar { opacity: .45; }
.tr-bars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.tr-bar { width: min(11px, 30%); border-radius: 4px 4px 0 0; }
.row-on td { background: #FFF6F1; }
.cat-list { list-style: none; margin: 0; padding: 6px 16px 12px; }
.cat-list li { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 5px 0; font-size: 13.5px; }
.cat-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-n small { color: var(--muted); margin-left: 6px; }
.cat-bar { height: 8px; background: var(--line-2); border-radius: 4px; overflow: hidden; }
.cat-bar i { display: block; height: 100%; background: var(--s-dep); border-radius: 4px; }
.dep-off .ml-main strong, .dep-off .ml-side strong { color: var(--muted); text-decoration: line-through; }
.tres-mini { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 14px 16px; }
.tres-mini .k-label { font-size: 12.5px; color: var(--muted); }
.tres-mini .k-label .sw { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; }
.tres-mini .k-val { font-family: 'Montserrat', 'Poppins', sans-serif; font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tres-mini .k-sub { font-size: 12px; color: var(--muted); }
@media (max-width: 700px) {
  .tr-chart { height: 160px; padding-top: 6px; }
  .tr-col .ca-tip { display: none; }
  .tr-bar { width: 30%; border-radius: 2px 2px 0 0; }
  .tres-mini { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .tr-table th, .tr-table td { padding-left: 6px; padding-right: 6px; font-size: 13px; }
}

/* Demandes du site */
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--gold); color: #fff; font-size: 12px; font-weight: 600; display: inline-grid; place-items: center; font-style: normal; }
.menu-btn { position: relative; }
.menu-dot { position: absolute; top: 6px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); border: 2px solid #fff; }
.dem-new td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.dem-champs { display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; margin: 0; }
.dem-champs dt { color: var(--muted); }
.dem-champs dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 760px) { .dem-champs { grid-template-columns: 1fr; gap: 2px; } .dem-champs dd { margin-bottom: 8px; } }

/* Planning : validation des RDV et tâches passés */
.day-valider { border-color: #EBCB94; }
.day-valider .card-h { background: var(--amber-bg); border-radius: 12px 12px 0 0; }
.day-valider h2 { color: var(--amber-fg); }
.pl-valider { margin-top: 6px; }
.pl-valider > summary { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; list-style: none; font-size: 12.5px; font-weight: 600; color: var(--primary); padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.pl-valider > summary::-webkit-details-marker { display: none; }
.pl-valider > summary .ic { width: 13px; height: 13px; }
.pl-valider[open] > summary { margin-bottom: 8px; }
.pl-valider textarea { width: 100%; box-sizing: border-box; font: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
.pl-val-btns { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.pl-rep { display: inline-flex; gap: 6px; align-items: center; }
.pl-rep input { font: inherit; font-size: 13px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 8px; }
.pl-statut { display: block; margin-top: 4px; }
.pl-statut .badge { font-size: 11px; padding: 1px 8px; }
.pl-item.is-annule .pl-title { text-decoration: line-through; color: var(--muted); }

/* Démarches : couleur par type (planning) et occupations de voirie */
.pl-item.fam-dp { box-shadow: inset 3px 0 0 #3B6FB6; }
.pl-item.fam-voirie { box-shadow: inset 3px 0 0 #C46A1B; }
.pl-item.fam-signalisation { box-shadow: inset 3px 0 0 #7A5AA6; }
.pl-item.fam-ventousage { box-shadow: inset 3px 0 0 #2F8A6B; }
.fam-dot { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); margin-right: 10px; }
.fam-dot::before { content: ''; width: 10px; height: 10px; border-radius: 3px; background: #999; }
.fam-dot.fam-dp::before { background: #3B6FB6; }
.fam-dot.fam-voirie::before { background: #C46A1B; }
.fam-dot.fam-signalisation::before { background: #7A5AA6; }
.fam-dot.fam-ventousage::before { background: #2F8A6B; }
.occ-list .occ-item.is-late { background: var(--red-bg); }
.occ-act { margin-top: 6px; }
.occ-act > summary { font-size: 12.5px; }
label.check { display: flex; gap: 8px; align-items: center; font-size: 13.5px; margin: 4px 0; }
.ml-side .badge + .badge { margin-left: 4px; }

/* Planning : bandeau de la semaine (une colonne par jour) et glisser-déposer */
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.ws-day { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: inherit; text-decoration: none; min-width: 0; }
.ws-day.is-today { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.ws-day.is-empty { opacity: .55; }
.ws-j { font-size: 11px; text-transform: uppercase; color: var(--muted); letter-spacing: .03em; }
.ws-n { font-weight: 700; font-size: 16px; color: var(--primary); }
.ws-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; min-height: 8px; }
.ws-dots i { width: 7px; height: 7px; border-radius: 50%; background: #B9B2A8; }
.ws-dots b { font-size: 9.5px; color: var(--muted); }
.ws-dots .fd-dp { background: #3B6FB6; } .ws-dots .fd-voirie { background: #C46A1B; } .ws-dots .fd-signalisation { background: #7A5AA6; }
.ws-dots .fd-ventousage { background: #2F8A6B; } .ws-dots .fd-rdv { background: #4F665A; }
.day-card.is-empty-hidden { display: none; }
body.pl-dragging .day-card.is-empty-hidden { display: block; opacity: .7; }
.pl-item[draggable="true"] { cursor: grab; }
.pl-item.is-dragged { opacity: .45; }
.day-card.drop-over, .ws-day.drop-over { outline: 2px dashed var(--gold); outline-offset: 2px; }
body.pl-saving { cursor: progress; }
.day-card { scroll-margin-top: 70px; }
@media (max-width: 640px) { .ws-day { padding: 6px 0; } .ws-n { font-size: 14px; } }

/* Tableau de bord : tâches en 3 colonnes et prévision de trésorerie */
.dash-kpis { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.dash-taches { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.dt-urgent { border-color: #F0C4BF; }
.dt-urgent .card-h { background: var(--red-bg); border-radius: 12px 12px 0 0; }
.dt-urgent h2 { color: var(--red-fg); }
.dt-urgent.is-calm { border-color: var(--line); }
.dt-urgent.is-calm .card-h { background: transparent; }
.dt-urgent.is-calm h2 { color: inherit; }
.prev-bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; align-items: end; margin-bottom: 14px; }
.pb-col { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.pb-val { font-weight: 700; font-size: 14px; color: var(--primary); white-space: nowrap; }
.pb-track { width: 100%; max-width: 90px; height: 120px; display: flex; align-items: flex-end; background: var(--line-2); border-radius: 8px; overflow: hidden; }
.pb-bar { width: 100%; background: #4F665A; border-radius: 8px 8px 0 0; }
.pb-bar.neg { background: var(--red-fg); }
.pb-col:first-child .pb-bar { background: var(--primary); }
.pb-lab { font-size: 12px; color: var(--muted); }
.prev-tbl td, .prev-tbl th { font-size: 13px; }
.dash-more { margin-top: 4px; }
.dash-more > summary { cursor: pointer; font-weight: 600; color: var(--primary); padding: 10px 2px; }
.dash-more[open] > summary { margin-bottom: 10px; }
@media (max-width: 900px) { .dash-taches { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .pb-val { font-size: 12px; } .pb-track { height: 90px; } }

#charges-fixes li.is-off { opacity: .6; }
#charges-fixes li.is-off strong { text-decoration: none; }

.dos-adr { display: flex; align-items: center; gap: 4px; color: var(--text); }
.dos-adr .ic { width: 13px; height: 13px; flex: none; opacity: .7; }
