/* 11A-8.13.86 — Fiches Projet, Devis et Facture : navigation compacte. */

/* Le retour reste disponible dans l'identité de la fiche après retrait de la barre dédiée. */
:is(.project-page, .quote-page, .invoice-page) .entity-hero-back {
  display: inline-grid; place-items: center; flex: 0 0 auto;
  width: 29px; height: 29px; min-width: 29px; min-height: 29px;
  padding: 0; border: 1px solid var(--border); border-radius: 8px;
  background: var(--panel); color: var(--muted);
  cursor: pointer; font: inherit; letter-spacing: normal;
}
:is(.project-page, .quote-page, .invoice-page) .entity-hero-back:hover {
  border-color: var(--accent); color: var(--accent);
  background: color-mix(in srgb, var(--accent) 5%, var(--panel));
}
:is(.project-page, .quote-page, .invoice-page) .entity-hero-back:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.entity-hero-back .lucide { width: 14px; height: 14px; }
.entity-hero-back span {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.entity-hero-actions:empty,
.entity-hero-actions:has(> [hidden]) { display: none !important; }
.quote-page .entity-hero-actions .quote-page-view-actions { flex-wrap: wrap; }
:is(.project-page:not(.has-project-sidebar) .project-page-hero,
    .quote-page:not(.is-sidebar-preview) .quote-page-hero,
    .invoice-page:not(.is-sidebar-preview) .invoice-page-hero):has(.entity-hero-actions > :not([hidden])) {
  overflow: visible;
}
:is(.project-page:not(.has-project-sidebar) .project-page-hero:has(.project-page-more[open]),
    .quote-page:not(.is-sidebar-preview) .quote-page-hero:has(.quote-page-more[open]),
    .invoice-page:not(.is-sidebar-preview) .invoice-page-hero:has(.invoice-page-more[open])) {
  position: relative; z-index: 12;
}

/* Une barre d'onglets compacte se lit comme une commande, sans trait sur toute la page. */
.project-page.has-project-sidebar #projectPageTabs {
  align-self: flex-start; width: max-content; max-width: 100%;
  box-sizing: border-box; gap: 4px; padding: 4px;
  border: 0; border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 5%, var(--panel));
  box-shadow: 0 2px 12px rgba(15, 23, 42, .065);
  overflow-x: auto; scrollbar-width: thin;
}
.project-page.has-project-sidebar #projectPageTabs button {
  min-height: 38px; border-radius: 7px; padding: 8px 11px; font-weight: 650;
}
.project-page.has-project-sidebar #projectPageTabs button[aria-selected="true"] {
  background: color-mix(in srgb, var(--accent) 14%, var(--panel));
  color: var(--accent); font-weight: 760;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 17%, transparent);
}

/* Le bloc commercial garde sa carte grise, sans double ligne au-dessus. */
.project-page.has-project-sidebar .project-commercial-card.entity-tab-intro > header {
  border-bottom: 0 !important;
}

/* Les actions parlent d'elles-mêmes ; la chronologie adopte la taille des devis et factures. */
.document-sidebar-preview .document-sidebar-section:has(> .document-sidebar-actions) > h3 { display: none; }
.project-page.has-project-sidebar .project-sidebar-history .project-overview-timeline-card > header {
  min-height: 0 !important; padding: 15px 16px 10px !important;
  border-bottom: 0 !important;
}
.project-page.has-project-sidebar .project-sidebar-history .entity-tab-heading > :is(svg, .lucide) { display: none !important; }
.project-page.has-project-sidebar .project-sidebar-history .entity-tab-heading-copy small { display: none !important; }
.project-page.has-project-sidebar .project-sidebar-history .project-overview-timeline-card h2 {
  font-size: 11px !important; font-weight: 750 !important; line-height: 1.35 !important;
}

@media (max-width: 760px) {
  .project-page.has-project-sidebar #projectPageTabs { max-width: 100%; }
  .project-page.has-project-sidebar #projectPageTabs button { min-height: 36px; font-size: 10px; }
}
