/*
 * Finitions visuelles communes à Tilivo.
 * Cette feuille reste volontairement sobre pour conserver un aspect métier.
 */

/* Les anciennes cartes à bande colorée deviennent des blocs métier sobres. */
.tab-card,
.stat {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: none;
}

.tab-card {
  padding: 16px;
  border-left: 1px solid var(--border);
}

/* Synthèses chiffrées : une seule barre, sans accumulation de cartes. */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0;
  margin: 14px 0 20px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.stats .stat {
  min-width: 0;
  padding: 16px 18px;
  background: transparent;
  border: 0;
  border-left: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
}

/* Le chiffre d'affaires du jour suit le même langage visuel. */
.sales-main-card {
  padding: 18px 20px;
  background: #fff;
  color: var(--dark);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: none;
}

.sales-main-card span,
.sales-main-card small {
  color: #64748b;
}

.sales-main-card strong {
  color: var(--blue);
}

.stats .stat:first-child {
  border-left: 0;
}

.stats .stat span {
  display: block;
  margin-bottom: 7px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.stats .stat strong {
  display: block;
  margin: 0;
  color: var(--dark);
  font-size: clamp(22px, 2.2vw, 30px);
  font-weight: 750;
  line-height: 1.1;
}

/* En-tête compact sur mobile. */
.mobile-menu-toggle {
  display: none;
}

/* Le bloc identité doit pouvoir se réduire sans pousser la navigation hors écran. */
#app > header .brand {
  min-width: 0;
  flex: 1 1 auto;
}

#app > header .brand > div {
  min-width: 0;
}

#app > header .brand strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#app > header nav {
  flex: 0 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

@media (max-width: 800px) {
  #app > header {
    height: auto;
    align-items: stretch;
    flex-direction: column;
    gap: 6px;
    padding: max(8px, env(safe-area-inset-top)) 10px 6px;
    z-index: 30;
  }

  .brand {
    width: 100%;
  }

  .brand > div {
    min-width: 0;
  }

  .mobile-menu-toggle {
    display: grid;
    place-items: center;
    flex: 0 0 44px;
    width: 44px;
    min-height: 44px;
    margin-left: auto;
    padding: 0;
    background: var(--blue);
    color: #fff;
    font-size: 25px;
    line-height: 1;
  }

  #app > header nav {
    display: none !important;
    position: static !important;
    inset: auto !important;
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start !important;
    padding: 4px 0 2px !important;
    border-top: 1px solid var(--border);
    background: #fff;
  }

  #app > header.menu-open nav {
    display: flex !important;
  }

  #app > header nav button {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 0 10px;
    font-size: 12px;
  }

  main {
    padding: 10px !important;
  }

  .cart {
    bottom: env(safe-area-inset-bottom, 0) !important;
  }

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

  .stats .stat {
    border-bottom: 1px solid var(--border);
  }
}

@media (max-width: 430px) {
  .stats {
    grid-template-columns: 1fr;
  }

  .stats .stat {
    border-left: 0;
  }
}
