/**
 * Pont entre le shell visuel V1 (bento-clone) et la navigation V2 :
 * la maquette V1 masque .topbar-title au profit du hero dashboard uniquement.
 */

/* Même emplacement qu’aux autres vues : display:none retirait le titre du flux et décalait la recherche */
body[data-current-view="dashboard"] .topbar-title {
  visibility: hidden !important;
  pointer-events: none !important;
  display: block !important;
}

/* Page Aujourd’hui : topbar sortie du flux. Les actions restent à leur emplacement visuel actuel mais la barre ne réserve plus de hauteur. */
body[data-current-view="dashboard"] .main-wrap {
  position: relative;
}

body[data-current-view="dashboard"] .topbar {
  position: absolute;
  top: 0;
  left: 32px;
  right: 32px;
  margin: 0;
  height: var(--header-h);
  z-index: 10;
  pointer-events: none;
}

body[data-current-view="dashboard"] .topbar > * {
  pointer-events: auto;
}

/* Compense la hauteur de la topbar sortie du flux pour conserver la même marge verticale haute que les autres pages. */
body[data-current-view="dashboard"] .content {
  padding-top: calc(var(--header-h) + 8px);
}

body[data-current-view="dashboard"] .page-hero {
  margin-top: -18px;
}

body[data-current-view="dashboard"] .page-hero-date {
  display: block;
  margin: 0 0 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted, var(--text-soft));
}

body[data-current-view="dashboard"] .page-hero-text h1 {
  font-size: 2.65rem;
  line-height: 1.1;
  color: #bfc5cf;
  background: linear-gradient(120deg, #cfd5de 0%, #b8c0cb 52%, #505763 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.topbar-title {
  display: block !important;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-strong, var(--text));
  flex-shrink: 0;
  margin: 0;
  /* Largeur mini ≈ libellés les plus longs (« Détail solution », « Fiche contact ») pour ne pas bouger la barre entre pages */
  min-width: 13.5ch;
  white-space: nowrap;
}

/* Hors dashboard : même dégradé métallique que le titre hero « Aujourd’hui » */
body:not([data-current-view="dashboard"]) .topbar-title {
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: #bfc5cf;
  background: linear-gradient(120deg, #cfd5de 0%, #b8c0cb 52%, #505763 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.topbar {
  flex-wrap: wrap;
  row-gap: 8px;
}

.topbar-refresh-btn {
  white-space: nowrap;
}

/* Pastille d’état : garde une taille raisonnable à côté des boutons ronds du shell */
.topbar-actions > .sync-pill {
  font-size: 0.8125rem;
  padding: 6px 12px 6px 8px;
}

.topbar-actions > .sync-pill::before {
  width: 18px;
  height: 18px;
}

.topbar-actions .btn.btn-secondary[href="index.html"] {
  border-radius: var(--radius-pill, 999px);
}

/* Cartes à structure interne serrée (surcharge du padding imposé par bento-clone sur .card) */
.tasks-card.card,
.tasks-previous-card.card,
.cockpit-snake-card.card,
.cockpit-flow-card.card,
.cockpit-table-card.card {
  padding: 0 !important;
}

.cockpit-insights-card.card {
  padding: 1rem 1.1rem 1.15rem !important;
}

/*
 * Filtres Contacts : `.table-wrap` a `overflow-x: auto`, qui force `overflow-y: auto`
 * (spec CSS), donc le panneau du filtre (position:absolute) serait clippé.
 * Override ciblé : overflow visible pour laisser dépasser les dropdowns ;
 * pas de min-height — le wrap suit la hauteur des lignes affichées.
 */
#view-contacts .table-wrap {
  overflow: visible !important;
}
