/* HARD DECO — Lot 11A-7.9 : accueil opérationnel compact. */

.home-root {
  --home-gap: 14px;
  padding-top: 12px;
}

.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(330px, .85fr);
  gap: var(--home-gap);
  grid-template-areas: none;
}

.home-command,
.home-action-kpis,
.home-pilotage,
.home-columns {
  grid-column: 1 / -1;
}

/* Neutralise les anciennes zones nommées de accueil.css sans remettre les
   colonnes à auto : grid-area:auto annulait aussi les spans pleine largeur. */
.home-layout > .home-command,
.home-layout > .home-action-kpis,
.home-layout > .home-pilotage,
.home-layout > .home-upcoming,
.home-layout > .home-columns {
  grid-row: auto !important;
  grid-column: 1 / -1 !important;
}

.home-command {
  display: grid;
  grid-template-columns: auto minmax(300px, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin: 0;
  padding: 0px 2px 12px;
  text-align: left;
}

.home-command-copy { min-width: 220px; }
.home-command > .home-command-copy { grid-column: 1; grid-row: 1; }
.home-command .hero-title { margin: 0; font-size: clamp(22px, 2.2vw, 29px); line-height: 1.15; }
.home-command .hero-sub { margin: 5px 0 0; font-size: 13px; text-transform: capitalize; }
.home-command > .home-search {
  grid-area: auto !important;
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  min-width: 0;
}
.home-command .searchbar { position: relative; padding: 0; }
.home-command .searchbar > .lucide {
  position: absolute;
  left: 13px;
  z-index: 2;
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
}
.home-command .searchbar input { min-height: 44px; padding-left: 42px; }
.home-command #searchResults { left: 0; right: 0; top: calc(100% + 6px); border: 1px solid var(--border); }
.home-command > .home-new-button {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  width: max-content !important;
  min-height: 42px;
  padding-inline: 17px;
  white-space: nowrap;
}

.home-action-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
}

.home-action-kpi {
  appearance: none;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 15px;
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 76px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow-card, 0 3px 12px rgba(15, 23, 42, .04));
  cursor: pointer;
  text-align: left;
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.home-action-kpi:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); transform: translateY(-1px); }
.home-action-kpi:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 28%, transparent); outline-offset: 2px; }
.home-action-kpi-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--bg); color: var(--muted); }
.home-action-kpi-icon .lucide { width: 17px; height: 17px; }
.home-action-kpi-copy { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.home-action-kpi small { overflow: hidden; color: var(--muted); font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.home-action-kpi strong { overflow: hidden; font-size: 16px; line-height: 1.2; white-space: nowrap; text-overflow: ellipsis; }
.home-action-kpi em {
  overflow: hidden;
  color: color-mix(in srgb, var(--muted) 88%, var(--text));
  font-size: 9.5px;
  font-style: normal;
  line-height: 1.25;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.home-action-kpi-open { width: 15px; color: var(--muted); }
.home-action-kpi.is-warning .home-action-kpi-icon { background: color-mix(in srgb, #f59e0b 12%, var(--panel)); color: #b45309; }
.home-action-kpi.is-danger .home-action-kpi-icon { background: color-mix(in srgb, #dc2626 10%, var(--panel)); color: #dc2626; }
.home-action-kpi.is-accent .home-action-kpi-icon { background: color-mix(in srgb, var(--accent) 12%, var(--panel)); color: var(--accent); }

.home-pilotage { overflow: hidden; }
.home-pilotage .home-section-header { padding-block: 13px; }
.home-pilotage-list { padding-top: 12px; }
.home-pilotage-summary { display: none; }
.home-pilotage-item { grid-template-columns: 8px minmax(0, 1fr) auto; padding: 11px 12px; }
.home-pilotage-title strong { font-size: 13px; }
.home-pilotage-detail { line-height: 1.45; }
.home-pilotage-open { min-width: 122px; }

.home-upcoming { grid-column: 1 / -1; overflow: hidden; }
.home-upcoming .home-section-header,
.home-finance .home-section-header,
.home-requests .home-section-header,
.home-tasks .home-section-header,
.home-charges .home-section-header,
.home-activity .home-section-header { border-bottom: 1px solid var(--border); }
.home-upcoming-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 12px; padding: 12px 14px 14px; }
.home-upcoming-list > h3 { grid-column: 1 / -1; margin: 4px 0 1px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.home-upcoming-item {
  display: grid;
  grid-template-columns: 50px 30px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.home-upcoming-item:hover { background: var(--bg); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.home-upcoming-item:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 26%, transparent); outline-offset: 1px; }
.home-upcoming-date { color: var(--muted); font-size: 11px; font-weight: 700; }
.home-upcoming-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 10%, var(--panel)); color: var(--accent); }
.home-upcoming-icon .lucide { width: 15px; height: 15px; }
.home-upcoming-copy { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.home-upcoming-copy strong, .home-upcoming-copy small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.home-upcoming-copy strong { font-size: 12px; }
.home-upcoming-copy small { color: var(--muted); font-size: 10px; }

.home-columns,
.home-col-left,
.home-col-right { display: contents; }
.home-col-left > * + *,
.home-col-right > * + * { margin-top: 0; }
.home-col-left > * + *, .home-col-right > * + * { margin-top: 0; }
.home-projects-legacy { display: none !important; }
.home-requests { grid-column: 1; align-self: start; }
.home-tasks { grid-column: 2; grid-row: span 2; align-self: start; }
.home-finance { grid-column: 1; align-self: start; overflow: hidden; }
.home-charges { grid-column: 2; align-self: start; overflow: hidden; }
.home-activity { grid-column: 1 / -1; align-self: start; }

.home-count-badge { min-width: 25px; padding: 3px 7px; border-radius: 999px; background: var(--bg); color: var(--muted); font-size: 11px; font-weight: 700; text-align: center; }
.home-requests #rqList { max-height: none; padding: 10px 12px 12px; }
.home-requests .request-list-item { margin: 0; }
.home-requests .request-row { padding: 10px; }
.home-requests .request-row + .request-row { border-top: 1px solid var(--border); }
.home-requests .request-status { padding: 2px 7px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 10%, var(--panel)); color: var(--accent); font-size: 10px; font-weight: 700; }

.home-tasks .task-subtitle { display: none; }
.home-tasks .wrap { padding: 11px 12px 13px; }
.home-tasks .task-toolbar { margin-top: 8px; }
.home-tasks .task-list { max-height: 430px; overflow: auto; scrollbar-gutter: stable; }
.home-tasks .task { padding: 9px 8px; }

.home-finance-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; padding: 8px 13px 13px; }
.home-finance-item { display: flex; min-width: 0; flex-direction: column; gap: 4px; padding: 9px 10px; border-right: 1px solid var(--border); }
.home-finance-item:last-child { border-right: 0; }
.home-finance-item small { color: var(--muted); font-size: 10px; }
.home-finance-item strong { overflow: hidden; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; }
.home-finance-item.is-overdue strong { color: #dc2626; }

.home-charges #chargesRecap.home-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 10px 12px 12px !important; }
.home-charges .cc-home-kpi { min-width: 0; padding: 9px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg); }
.home-charges .cc-home-kpi .label { font-size: 10px; }
.home-charges .cc-home-kpi .val { font-size: 14px; }
.home-charges .cc-home-balance { grid-column: auto; }

.home-activity-toolbar { display: none; }
.home-activity-content { padding-top: 3px; }
.home-activity-list { grid-template-columns: 1fr; }

@media (max-width: 1180px) {
  .home-action-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-layout { grid-template-columns: minmax(0, 1.35fr) minmax(310px, .9fr); }
  .home-finance-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-finance-item:nth-child(3) { border-right: 0; }
}

@media (max-width: 900px) {
  .home-layout { grid-template-columns: 1fr; }
  .home-command, .home-action-kpis, .home-pilotage, .home-upcoming,
  .home-requests, .home-tasks, .home-finance, .home-charges, .home-activity { grid-column: 1; }
  .home-command { grid-template-columns: 1fr auto; }
  .home-command > .home-search { grid-column: 1 / -1; grid-row: 2; }
  .home-command > .home-new-button { grid-column: 2; grid-row: 1; }
  .home-action-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-upcoming-list { grid-template-columns: 1fr; }
  .home-upcoming-list > h3 { grid-column: 1; }
  .home-tasks { grid-row: auto; }
}

@media (max-width: 620px) {
  .home-root { padding-inline: 10px; }
  .home-command { gap: 10px; }
  .home-command-copy { min-width: 0; }
  .home-command .hero-title { font-size: 21px; }
  .home-command .hero-sub { font-size: 11px; }
  .home-command > .home-new-button { width: 42px !important; padding: 0; justify-content: center; }
  .home-new-button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .home-action-kpis { grid-template-columns: 1fr 1fr; gap: 7px; }
  .home-action-kpi { grid-template-columns: 30px minmax(0, 1fr); min-height: 68px; padding: 9px; }
  .home-action-kpi-open { display: none; }
  .home-action-kpi-icon { width: 30px; height: 30px; }
  .home-action-kpi strong { font-size: 13px; }
  .home-action-kpi em { font-size: 9px; }
  .home-action-kpi:last-child { grid-column: 1 / -1; }
  .home-section-header { align-items: flex-start; flex-wrap: wrap; }
  .home-section-actions { width: 100%; justify-content: space-between; }
  .home-pilotage-item { grid-template-columns: 7px minmax(0, 1fr); }
  .home-pilotage-open { grid-column: 2; width: max-content; min-width: 0; }
  .home-finance-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-finance-item, .home-finance-item:nth-child(3) { border-right: 0; border-bottom: 1px solid var(--border); }
  .home-finance-item:last-child { grid-column: 1 / -1; border-bottom: 0; }
  .home-charges #chargesRecap.home-kpis { grid-template-columns: 1fr; }
}

/* ============================================
   Lot 11A-6.3 — priorités explicables
   Rang, niveau métier et justification courte.
   ============================================ */
#home-operational-cockpit .home-pilotage-rank {
  display: inline-grid;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border));
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 7%, var(--panel));
  color: var(--accent);
  font-size: .62rem;
  font-weight: 800;
  line-height: 1;
}

#home-operational-cockpit .home-pilotage-title .home-pilotage-severity {
  border: 1px solid transparent;
  color: var(--muted);
  background: var(--hd-color-surface-muted, var(--bg));
}

#home-operational-cockpit .home-pilotage-item.is-critical .home-pilotage-severity {
  border-color: color-mix(in srgb, #dc2626 18%, var(--border));
  color: #b91c1c;
  background: color-mix(in srgb, #dc2626 7%, var(--panel));
}

#home-operational-cockpit .home-pilotage-item.is-warning .home-pilotage-severity {
  border-color: color-mix(in srgb, #d97706 18%, var(--border));
  color: #b45309;
  background: color-mix(in srgb, #d97706 7%, var(--panel));
}

#home-operational-cockpit .home-pilotage-why {
  display: flex;
  align-items: center;
  gap: .3rem;
  margin-top: .3rem;
  color: var(--muted);
  font-size: .64rem;
  line-height: 1.35;
}

#home-operational-cockpit .home-pilotage-why .lucide {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  color: var(--accent);
}

#home-operational-cockpit .home-pilotage-why strong {
  color: var(--text);
  font-weight: 700;
}

@media (max-width: 620px) {
  #home-operational-cockpit .home-pilotage-title .home-pilotage-severity {
    display: none;
  }
}

/* HARD DECO — Lot 11A-5.5 : recherche globale d'accueil. */
.home-command .home-search {
  position: relative;
  z-index: 30;
}

.home-command .searchbar input {
  padding-right: 42px;
  border-radius: 11px;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.home-command .searchbar input:hover {
  border-color: color-mix(in srgb, var(--accent) 25%, var(--border));
}

.home-command .searchbar input:focus {
  border-color: var(--accent);
  background: var(--panel);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}

.home-command .searchbar:focus-within > .lucide {
  color: var(--accent);
}

/* V2-RC1.5.25 — une seule géométrie pour la recherche globale.
   Les sélecteurs précis neutralisent les anciens paddings d'accueil. */
#main-content .home-command .home-search .searchbar {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
}

#main-content .home-command .home-search .searchbar > .lucide {
  position: absolute;
  top: 50%;
  left: 16px;
  z-index: 2;
  width: 18px;
  height: 18px;
  margin: 0;
  transform: translateY(-50%);
  pointer-events: none;
}

#main-content .home-command .home-search .searchbar > #searchBar {
  width: 100%;
  min-height: 46px;
  padding: 11px 44px 11px 48px;
}

.home-command #searchResults {
  top: calc(100% + 8px);
  max-height: min(440px, calc(100vh - 190px));
  padding: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 18px 45px rgba(15, 23, 42, .14), 0 3px 10px rgba(15, 23, 42, .07);
}

.search-results-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 72%, var(--panel));
  color: var(--muted);
  font-size: 11px;
}

.search-results-heading strong {
  color: var(--text);
  font-size: 12px;
}

.search-results-list {
  max-height: min(398px, calc(100vh - 226px));
  padding: 5px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}

.home-command .result-item {
  appearance: none;
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.home-command .result-item + .result-item {
  border-top: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.home-command .result-item:hover,
.home-command .result-item.is-active,
.home-command .result-item:focus-visible {
  outline: none;
  background: color-mix(in srgb, var(--accent) 8%, var(--panel));
}

.home-command .res-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--accent) 10%, var(--panel));
  color: var(--accent);
}

.home-command .res-icon .lucide {
  width: 16px;
  height: 16px;
  color: currentColor;
}

.home-command .res-body {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.home-command .res-title,
.home-command .res-body small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-command .res-title {
  font-size: 12.5px;
  font-weight: 650;
}

.home-command .res-body small {
  color: var(--muted);
  font-size: 11px;
}

.home-command .res-type {
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}

.search-empty {
  display: flex;
  min-height: 92px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px;
  color: var(--muted);
  font-size: 12px;
}

.search-empty .lucide {
  width: 18px;
  height: 18px;
}

@media (max-width: 620px) {
  .home-command #searchResults {
    position: fixed;
    top: 118px;
    right: 10px;
    left: 10px;
    max-height: min(430px, calc(100vh - 190px));
    border-radius: 12px;
  }

  .search-results-heading span {
    display: none;
  }

  .search-results-list {
    max-height: min(394px, calc(100vh - 226px));
  }

  .home-command .result-item {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 50px;
    padding: 7px;
  }

  .home-command .res-icon {
    width: 30px;
    height: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-action-kpi { transition: none; }
  .home-action-kpi:hover { transform: none; }
}

/* ============================================
   Finition visuelle — Lot 11A-5.4
   Priorités de l'accueil : hiérarchie, densité
   et filtres alignés sur les pages métier.
   ============================================ */

.home-pilotage .home-section-header {
  align-items: center;
  min-height: 62px;
  padding: .75rem 1rem;
}

.home-pilotage .home-section-header h2 {
  gap: .5rem;
}

.home-pilotage .home-section-header > .btn-secondary {
  min-height: 34px;
  padding: .45rem .7rem;
  border-radius: 8px;
  font-size: .74rem;
}

#home-operational-cockpit {
  min-width: 0;
}

#home-operational-cockpit .home-pilotage-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  min-width: 0;
  padding: .62rem .85rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel) 97%, var(--bg));
}

#home-operational-cockpit :is(.home-pilotage-horizons, .home-pilotage-filters) {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: .3rem;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

#home-operational-cockpit :is(.home-pilotage-horizons, .home-pilotage-filters)::-webkit-scrollbar {
  display: none;
}

#home-operational-cockpit .home-pilotage-filters {
  flex: 0 0 auto;
  padding-left: .7rem;
  border-left: 1px solid var(--border);
}

#home-operational-cockpit :is(.home-pilotage-horizons, .home-pilotage-filters) button {
  min-height: 32px;
  flex: 0 0 auto;
  gap: .35rem;
  padding: .38rem .62rem;
  border-color: transparent;
  border-radius: 8px;
  background: transparent;
  font-size: .72rem;
  font-weight: 650;
  white-space: nowrap;
  transition: color 150ms ease, border-color 150ms ease, background-color 150ms ease;
}

#home-operational-cockpit :is(.home-pilotage-horizons, .home-pilotage-filters) button:hover {
  border-color: color-mix(in srgb, var(--accent) 18%, var(--border));
  background: color-mix(in srgb, var(--accent) 5%, var(--panel));
  color: var(--text);
}

#home-operational-cockpit .home-pilotage-horizons button.is-active,
#home-operational-cockpit .home-pilotage-filters button[data-filter="all"].is-active {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
  background: color-mix(in srgb, var(--accent) 10%, var(--panel));
  color: var(--accent);
}

#home-operational-cockpit .home-pilotage-filters button[data-filter="critical"].is-active {
  border-color: color-mix(in srgb, #dc2626 28%, var(--border));
  background: color-mix(in srgb, #dc2626 8%, var(--panel));
  color: #b91c1c;
}

#home-operational-cockpit .home-pilotage-filters button[data-filter="warning"].is-active {
  border-color: color-mix(in srgb, #d97706 30%, var(--border));
  background: color-mix(in srgb, #d97706 8%, var(--panel));
  color: #b45309;
}

#home-operational-cockpit .home-pilotage-filters button[data-filter="info"].is-active {
  border-color: color-mix(in srgb, #2563eb 25%, var(--border));
  background: color-mix(in srgb, #2563eb 7%, var(--panel));
  color: #1d4ed8;
}

#home-operational-cockpit :is(.home-pilotage-horizons, .home-pilotage-filters) button span {
  min-width: 18px;
  padding: .08rem .3rem;
  background: color-mix(in srgb, currentColor 7%, var(--panel));
  color: inherit;
  font-size: .65rem;
  font-variant-numeric: tabular-nums;
}

#home-operational-cockpit .home-pilotage-list {
  gap: .35rem;
  padding: .7rem .85rem .55rem;
  background: var(--panel);
}

#home-operational-cockpit .home-pilotage-item {
  position: relative;
  min-height: 48px;
  grid-template-columns: 7px minmax(0, 1fr) auto;
  gap: .6rem;
  padding: .45rem .55rem;
  overflow: hidden;
  border-color: transparent;
  border-left: 3px solid #64748b;
  border-radius: 8px;
  background: var(--hd-color-surface-muted, var(--bg));
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

#home-operational-cockpit .home-pilotage-item.is-critical {
  border-left-color: #dc2626;
}

#home-operational-cockpit .home-pilotage-item.is-warning {
  border-left-color: #d97706;
}

#home-operational-cockpit .home-pilotage-item.is-info {
  border-left-color: #2563eb;
}

#home-operational-cockpit .home-pilotage-item:hover {
  border-top-color: color-mix(in srgb, var(--accent) 16%, var(--border));
  border-right-color: color-mix(in srgb, var(--accent) 16%, var(--border));
  border-bottom-color: color-mix(in srgb, var(--accent) 16%, var(--border));
  background: color-mix(in srgb, var(--accent) 4%, var(--panel));
  box-shadow: 0 1px 3px rgba(15, 23, 42, .045);
}

#home-operational-cockpit .home-pilotage-dot {
  width: 6px;
  height: 6px;
  box-shadow: none;
}

#home-operational-cockpit .home-pilotage-title {
  gap: .35rem;
  flex-wrap: nowrap;
}

#home-operational-cockpit .home-pilotage-title strong {
  min-width: 0;
  flex: 0 1 auto;
  font-size: .76rem;
}

#home-operational-cockpit .home-pilotage-title span:not(.home-pilotage-rank) {
  flex: 0 0 auto;
  padding: .12rem .4rem;
  font-size: .61rem;
}

#home-operational-cockpit .home-pilotage-detail {
  margin-top: .12rem;
  overflow: hidden;
  color: var(--muted);
  font-size: .69rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#home-operational-cockpit .home-pilotage-open {
  min-width: 0;
  min-height: 31px;
  padding: .36rem .58rem;
  border-color: color-mix(in srgb, var(--border) 88%, transparent);
  border-radius: 7px;
  background: var(--panel);
  font-size: .68rem;
  font-weight: 650;
  white-space: nowrap;
}

#home-operational-cockpit .home-pilotage-open::after {
  margin-left: .35rem;
  content: "→";
  color: var(--accent);
}

#home-operational-cockpit .home-pilotage-open:hover {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
  color: var(--accent);
}

#home-operational-cockpit .home-pilotage-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  width: calc(100% - 1.7rem);
  margin: 0 .85rem .7rem;
  padding: .45rem .65rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--hd-color-surface-muted, var(--bg));
  color: var(--text-muted);
  cursor: pointer;
  font-size: .68rem;
  text-align: center;
  transition: border-color .16s ease, color .16s ease, background .16s ease;
}

#home-operational-cockpit .home-pilotage-more:hover,
#home-operational-cockpit .home-pilotage-more:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
  background: color-mix(in srgb, var(--accent) 5%, var(--hd-color-surface-muted, var(--bg)));
  color: var(--accent);
}

#home-operational-cockpit .home-pilotage-more .lucide {
  width: 14px;
  height: 14px;
}

@media (max-width: 900px) {
  #home-operational-cockpit .home-pilotage-toolbar {
    display: grid;
    gap: .38rem;
  }

  #home-operational-cockpit .home-pilotage-filters {
    padding: 0;
    border-left: 0;
  }
}

@media (max-width: 620px) {
  .home-pilotage .home-section-header {
    gap: .65rem;
    padding: .7rem .8rem;
  }

  .home-pilotage .home-section-header > .btn-secondary {
    width: auto;
  }

  #home-operational-cockpit .home-pilotage-toolbar {
    padding: .5rem .6rem;
  }

  #home-operational-cockpit :is(.home-pilotage-horizons, .home-pilotage-filters) {
    width: 100%;
  }

  #home-operational-cockpit :is(.home-pilotage-horizons, .home-pilotage-filters) button {
    min-height: 30px;
    padding: .34rem .52rem;
    font-size: .69rem;
  }

  #home-operational-cockpit .home-pilotage-list {
    gap: .42rem;
    padding: .55rem .6rem .45rem;
  }

  #home-operational-cockpit .home-pilotage-item {
    grid-template-columns: 6px minmax(0, 1fr);
    gap: .35rem .48rem;
    padding: .48rem .5rem;
  }

  #home-operational-cockpit .home-pilotage-title {
    flex-wrap: wrap;
  }

  #home-operational-cockpit .home-pilotage-detail {
    white-space: normal;
  }

  #home-operational-cockpit .home-pilotage-open {
    grid-column: 2;
    justify-self: start;
    min-height: 29px;
    margin-top: .08rem;
  }

  #home-operational-cockpit .home-pilotage-more {
    margin: 0 .6rem .55rem;
  }
}

/* HARD DECO — Lot 11A-5.7 : synthèses financières harmonisées. */
.home-finance,
.home-charges {
  align-self: stretch;
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.home-finance .home-section-header,
.home-charges .home-section-header {
  min-height: 67px;
  flex: 0 0 auto;
  align-items: center;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 12px;
  padding: .75rem .9rem;
  text-align: left;
}

.home-finance .home-section-header > div,
.home-charges .home-section-header > div {
  min-width: 0;
}

.home-finance .home-section-header h2,
.home-charges .home-section-header h2 {
  gap: .45rem;
}

.home-summary-link {
  display: inline-flex;
  min-height: 34px;
  flex: 0 0 auto;
  align-items: center;
  gap: .4rem;
  margin-left: auto;
  padding: .42rem .65rem;
  border-radius: 8px;
  font-size: .7rem;
  white-space: nowrap;
}

.home-summary-link .lucide {
  width: 13px;
  height: 13px;
  color: var(--accent);
}

.home-finance-summary,
.home-charges #chargesRecap.home-kpis {
  align-content: stretch;
  flex: 1 1 auto;
  gap: .45rem;
  padding: .65rem .75rem .75rem;
  margin: 0 !important;
}

.home-finance-summary {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.home-charges #chargesRecap.home-kpis {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.home-finance-item,
.home-charges .cc-home-kpi {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 66px;
  flex-direction: column;
  justify-content: center;
  gap: .3rem;
  padding: .65rem .7rem;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--hd-color-surface-muted, var(--bg));
}

.home-finance-item {
  border-right: 1px solid var(--border);
}

.home-finance-item small,
.home-charges .cc-home-kpi .label {
  overflow: hidden;
  color: var(--muted);
  font-size: .58rem;
  font-weight: 650;
  letter-spacing: .025em;
  line-height: 1.25;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.home-finance-item strong,
.home-charges .cc-home-kpi .val {
  overflow: hidden;
  color: var(--text);
  font-size: .83rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-finance-item.is-month,
.home-finance-item.is-collect {
  border-color: color-mix(in srgb, var(--accent) 20%, var(--border));
}

.home-finance-item.is-month::before,
.home-finance-item.is-collect::before,
.home-charges .cc-home-balance::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  border-radius: 9px 0 0 9px;
  background: var(--accent);
  content: "";
}

.home-finance-item.is-overdue {
  border-color: color-mix(in srgb, #dc2626 22%, var(--border));
  background: color-mix(in srgb, #dc2626 3%, var(--panel));
}

.home-finance-item.is-overdue strong {
  color: #dc2626;
}

.home-charges .cc-home-balance.is-positive::before { background: #059669; }
.home-charges .cc-home-balance.is-negative::before { background: #d97706; }

@media (max-width: 1180px) and (min-width: 901px) {
  .home-finance-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .home-finance-item:nth-child(3) {
    border-right: 1px solid var(--border);
  }
}

@media (max-width: 620px) {
  .home-finance .home-section-header,
  .home-charges .home-section-header {
    align-items: center;
    flex-direction: row;
    flex-wrap: nowrap;
    padding: .7rem .75rem;
  }

  .home-summary-link span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .home-summary-link {
    width: 34px;
    min-height: 34px;
    justify-content: center;
    padding: 0;
  }

  .home-summary-link .lucide {
    width: 15px;
    height: 15px;
  }

  .home-finance-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-finance-item,
  .home-finance-item:nth-child(3) {
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }

  .home-finance-item:last-child {
    grid-column: 1 / -1;
    border-bottom: 1px solid var(--border);
  }

  .home-charges #chargesRecap.home-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .35rem;
  }

  .home-finance-item,
  .home-charges .cc-home-kpi {
    min-height: 61px;
    padding: .55rem .58rem;
  }

  .home-charges .cc-home-kpi .label {
    font-size: .52rem;
  }

  .home-charges .cc-home-kpi .val {
    font-size: .74rem;
  }
}

/* HARD DECO — Lot 11A-5.6 : en-tête et filtre unique des priorités. */
.home-pilotage .home-section-header {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  text-align: left;
}

.home-pilotage .home-section-header > div {
  min-width: 0;
}

.home-pilotage .home-section-header > .btn-secondary {
  flex: 0 0 auto;
  margin-left: auto;
}

#home-operational-cockpit .home-pilotage-toolbar {
  justify-content: flex-start;
}

#home-operational-cockpit .home-pilotage-filters {
  width: 100%;
  flex: 1 1 auto;
  padding-left: 0;
  border-left: 0;
}

@media (max-width: 620px) {
  .home-pilotage .home-section-header {
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    text-align: left;
  }
}

/* HARD DECO — Lot 11A-5.9 : actions et planning de l'accueil. */
.home-layout :is(
  .home-pilotage,
  .home-upcoming,
  .home-finance,
  .home-charges,
  .home-activity
) .home-section-header {
  min-height: 67px;
  align-items: center;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: space-between;
  gap: 12px;
  padding: .75rem .9rem;
  text-align: left;
}

.home-layout .home-section-header > div {
  min-width: 0;
}

.home-layout .home-section-header > .home-summary-link {
  display: inline-flex;
  width: auto;
  min-width: 0;
  min-height: 34px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  margin-left: auto;
  padding: .42rem .65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-size: .7rem;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .025);
  transition: border-color 150ms ease, color 150ms ease, background-color 150ms ease;
}

.home-layout .home-section-header > .home-summary-link:hover {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
  background: color-mix(in srgb, var(--accent) 4%, var(--panel));
  color: var(--accent);
}

.home-layout .home-section-header > .home-summary-link .lucide {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  color: var(--accent);
}

.home-upcoming {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.home-upcoming-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  align-content: start;
  gap: .45rem;
  padding: .65rem .75rem .75rem;
  background: var(--panel);
}

.home-upcoming-list > h3 {
  grid-column: 1 / -1;
  margin: .18rem .15rem 0;
  font-size: .6rem;
  letter-spacing: .055em;
}

.home-upcoming-item {
  position: relative;
  min-height: 52px;
  grid-template-columns: 54px 30px minmax(0, 1fr) 15px;
  gap: .55rem;
  padding: .48rem .58rem;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--border) 88%, transparent);
  border-left: 2px solid var(--accent);
  border-radius: 8px;
  background: var(--hd-color-surface-muted, var(--bg));
  box-shadow: none;
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.home-upcoming-item:hover {
  border-color: color-mix(in srgb, var(--accent) 25%, var(--border));
  border-left-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 4%, var(--panel));
  box-shadow: 0 1px 3px rgba(15, 23, 42, .045);
}

.home-upcoming-date {
  font-size: .67rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.home-upcoming-icon {
  width: 28px;
  height: 28px;
}

.home-upcoming-copy strong {
  font-size: .74rem;
}

.home-upcoming-copy small {
  font-size: .64rem;
}

.home-upcoming-item > .lucide:last-child {
  width: 15px;
  height: 15px;
  color: var(--muted);
}

@media (max-width: 620px) {
  .home-layout :is(
    .home-pilotage,
    .home-upcoming,
    .home-finance,
    .home-charges,
    .home-activity
  ) .home-section-header {
    min-height: 62px;
    padding: .7rem .75rem;
  }

  .home-layout .home-section-header > .home-summary-link {
    width: 34px;
    min-height: 34px;
    padding: 0;
  }

  .home-layout .home-section-header > .home-summary-link span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .home-layout .home-section-header > .home-summary-link .lucide {
    width: 15px;
    height: 15px;
  }

  .home-upcoming-list {
    grid-template-columns: 1fr;
    gap: .4rem;
    padding: .55rem .6rem .65rem;
  }

  .home-upcoming-item {
    min-height: 50px;
    grid-template-columns: 48px 28px minmax(0, 1fr) 14px;
    gap: .42rem;
    padding: .45rem .5rem;
  }
}

/* ============================================
   Lot 11A-6.1 — priorités quotidiennes utiles
   Regroupement par dossier et filtres temporels.
   ============================================ */
#home-operational-cockpit .home-pilotage-toolbar {
  justify-content: space-between;
}

#home-operational-cockpit .home-pilotage-filters {
  width: auto;
  flex: 1 1 auto;
}

#home-operational-cockpit .home-pilotage-selection {
  margin: 0;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: .68rem;
  white-space: nowrap;
}

#home-operational-cockpit .home-pilotage-selection strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

#home-operational-cockpit .home-pilotage-filters button[data-filter="today"].is-active {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
  background: color-mix(in srgb, var(--accent) 10%, var(--panel));
  color: var(--accent);
}

#home-operational-cockpit .home-pilotage-filters button[data-filter="overdue"].is-active {
  border-color: color-mix(in srgb, #dc2626 30%, var(--border));
  background: color-mix(in srgb, #dc2626 8%, var(--panel));
  color: #b91c1c;
}

#home-operational-cockpit .home-pilotage-filters button[data-filter="week"].is-active {
  border-color: color-mix(in srgb, #d97706 30%, var(--border));
  background: color-mix(in srgb, #d97706 8%, var(--panel));
  color: #b45309;
}

#home-operational-cockpit .home-pilotage-filters button[data-filter="watch"].is-active {
  border-color: color-mix(in srgb, #2563eb 25%, var(--border));
  background: color-mix(in srgb, #2563eb 7%, var(--panel));
  color: #1d4ed8;
}

#home-operational-cockpit .home-pilotage-item {
  align-items: start;
}

#home-operational-cockpit .home-pilotage-copy {
  min-width: 0;
}

#home-operational-cockpit .home-pilotage-title .home-pilotage-horizon {
  color: var(--muted);
  background: var(--panel);
}

#home-operational-cockpit .home-pilotage-item.is-horizon-overdue .home-pilotage-horizon {
  color: #b91c1c;
  background: color-mix(in srgb, #dc2626 8%, var(--panel));
}

#home-operational-cockpit .home-pilotage-points {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: .25rem .9rem;
  margin: .35rem 0 0;
  padding: 0;
  color: var(--muted);
  font-size: .64rem;
  line-height: 1.35;
  list-style: none;
}

#home-operational-cockpit .home-pilotage-points li {
  position: relative;
  padding-left: .6rem;
}

#home-operational-cockpit .home-pilotage-points li::before {
  position: absolute;
  left: 0;
  color: var(--accent);
  content: "•";
}

#home-operational-cockpit .home-pilotage-more strong {
  color: var(--text);
}

@media (max-width: 900px) {
  #home-operational-cockpit .home-pilotage-selection {
    padding-inline: .15rem;
  }
}

@media (max-width: 620px) {
  #home-operational-cockpit .home-pilotage-selection {
    display: none;
  }

  #home-operational-cockpit .home-pilotage-points {
    display: grid;
    gap: .2rem;
  }
}

/* ============================================
   Lot 11A-6.2 — décisions persistantes
   Traité, report, attribution et réactivation.
   ============================================ */
#home-operational-cockpit .home-pilotage-filters button[data-filter="mine"].is-active,
#home-operational-cockpit .home-pilotage-filters button[data-filter="hidden"].is-active {
  border-color: color-mix(in srgb, #64748b 28%, var(--border));
  background: color-mix(in srgb, #64748b 9%, var(--panel));
  color: #475569;
}

#home-operational-cockpit .home-pilotage-owner {
  display: inline-flex;
  align-items: center;
  gap: .22rem;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--panel));
}

#home-operational-cockpit .home-pilotage-owner .lucide {
  width: 11px;
  height: 11px;
}

#home-operational-cockpit .home-pilotage-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .28rem;
}

#home-operational-cockpit .home-priority-icon {
  display: inline-flex;
  min-width: 31px;
  min-height: 31px;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  padding: .35rem .42rem;
  border: 1px solid color-mix(in srgb, var(--border) 88%, transparent);
  border-radius: 7px;
  background: var(--panel);
  color: var(--muted);
  font-size: .64rem;
  font-weight: 650;
  cursor: pointer;
}

#home-operational-cockpit .home-priority-icon .lucide {
  width: 14px;
  height: 14px;
}

#home-operational-cockpit .home-priority-icon span {
  display: none;
}

#home-operational-cockpit .home-priority-icon:hover {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
  color: var(--accent);
}

#home-operational-cockpit .home-priority-icon.is-done:hover {
  border-color: color-mix(in srgb, #16a34a 30%, var(--border));
  color: #15803d;
}

#home-operational-cockpit .home-pilotage-item.is-saving {
  opacity: .55;
  pointer-events: none;
}

#home-operational-cockpit .home-pilotage-item.is-suppressed {
  border-left-color: #94a3b8;
  background: color-mix(in srgb, #94a3b8 6%, var(--panel));
  opacity: .82;
}

#home-operational-cockpit .home-priority-menu {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin-top: .5rem;
  padding: .5rem;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 6px 18px rgba(15, 23, 42, .07);
}

#home-operational-cockpit .home-priority-menu > strong {
  flex: 0 0 auto;
  font-size: .67rem;
}

#home-operational-cockpit .home-priority-menu label {
  display: flex;
  align-items: center;
  gap: .35rem;
  color: var(--muted);
  font-size: .63rem;
}

#home-operational-cockpit .home-priority-menu :is(input, select) {
  min-height: 31px;
  padding: .3rem .45rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  font-size: .67rem;
}

#home-operational-cockpit .home-priority-menu select {
  min-width: 170px;
}

#home-operational-cockpit .home-priority-menu .btn-primary {
  min-height: 31px;
  padding: .35rem .6rem;
  border-radius: 7px;
  font-size: .66rem;
}

#home-operational-cockpit .home-priority-quickdates {
  display: flex;
  gap: .25rem;
}

#home-operational-cockpit .home-priority-quickdates button {
  min-height: 29px;
  padding: .3rem .45rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--hd-color-surface-muted, var(--bg));
  color: var(--text);
  font-size: .64rem;
  cursor: pointer;
}

#home-operational-cockpit .home-priority-quickdates button:hover {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
  color: var(--accent);
}

#home-operational-cockpit .home-pilotage-notice {
  margin: .6rem .85rem 0;
  padding: .5rem .65rem;
  border: 1px solid color-mix(in srgb, #d97706 24%, var(--border));
  border-radius: 8px;
  background: color-mix(in srgb, #d97706 6%, var(--panel));
  color: #92400e;
  font-size: .68rem;
}

@media (max-width: 1000px) {
  #home-operational-cockpit .home-pilotage-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 620px) {
  #home-operational-cockpit .home-pilotage-actions {
    grid-column: 2;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  #home-operational-cockpit .home-pilotage-open {
    grid-column: auto;
    margin-top: 0;
  }

  #home-operational-cockpit .home-priority-icon span {
    display: inline;
  }

  #home-operational-cockpit .home-priority-menu {
    align-items: stretch;
    flex-direction: column;
  }

  #home-operational-cockpit .home-priority-menu :is(label, input, select, .btn-primary) {
    width: 100%;
  }

  #home-operational-cockpit .home-priority-quickdates {
    overflow-x: auto;
  }

  #home-operational-cockpit .home-pilotage-notice {
    margin-inline: .6rem;
  }
}

/* Lot 11A-7.28.1 — Priorités plus lisibles et moins massives sur mobile. */
#home-operational-cockpit .home-pilotage-notice {
  display: none;
}

@media (max-width: 620px) {
  #home-operational-cockpit .home-pilotage-list {
    gap: .42rem;
    padding: .55rem .6rem .45rem;
  }

  #home-operational-cockpit .home-pilotage-item {
    gap: .3rem .45rem;
    padding: .55rem .5rem;
  }

  /* Le résumé et « Pourquoi maintenant » répétaient la même échéance. */
  #home-operational-cockpit .home-pilotage-detail,
  #home-operational-cockpit .home-pilotage-points {
    display: none;
  }

  #home-operational-cockpit .home-pilotage-why {
    margin-top: .1rem;
    font-size: .66rem;
    line-height: 1.32;
  }

  #home-operational-cockpit .home-pilotage-actions {
    gap: .35rem;
    margin-top: .05rem;
  }

  #home-operational-cockpit .home-pilotage-open,
  #home-operational-cockpit .home-priority-icon {
    min-height: 32px;
  }

  #home-operational-cockpit .home-pilotage-open {
    padding: .38rem .65rem;
    font-size: .7rem;
  }

  #home-operational-cockpit .home-priority-icon span {
    display: inline;
    font-size: .62rem;
  }
}
