/* ==========================================================================
   Beauty Tracker — Layout principale
   ========================================================================== */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  height: calc(var(--header-height) + var(--safe-top));
  padding: var(--safe-top) var(--space-lg) 0;
  background: var(--color-surface);
  border-bottom: var(--border-width) solid var(--color-border);
}

.app-header h1 {
  font-size: var(--font-size-md);
}

.app-header .header-actions {
  display: flex;
  gap: var(--space-sm);
}

.connection-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--font-size-xs);
  padding: 2px var(--space-sm);
  border-radius: var(--radius-full);
  background: var(--color-surface-alt);
  color: var(--color-text-muted);
}
.connection-badge[data-status="online"] { color: var(--color-success); }
.connection-badge[data-status="offline"] { color: var(--color-error); }
.connection-badge[data-status="syncing"] { color: var(--color-info); }
.connection-badge .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor;
}

main.view {
  flex: 1;
  width: 100%;
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: var(--space-lg) var(--space-lg) calc(var(--nav-height) + var(--safe-bottom) + var(--space-2xl));
}

/* --- Navigazione inferiore --- */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--color-surface);
  border-top: var(--border-width) solid var(--color-border);
}

.bottom-nav button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: none;
  border: none;
  color: var(--color-text-muted);
  min-height: var(--touch-target-min);
  padding: var(--space-xs);
  font-size: 11px;
}

.bottom-nav button.active {
  color: var(--color-primary-dark);
  font-weight: var(--font-weight-medium);
}

.bottom-nav button .icon {
  width: 22px;
  height: 22px;
}

/* --- Contenitori --- */
.section {
  margin-bottom: var(--space-xl);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}
