/* ===================================================================
   REDESIGN OVERLAY — caricato dopo app.css per upgrade visivo
   senza ricompilare Tailwind. Tutte le regole sono additive: rispettano
   lo stato esistente e aggiungono presence/depth/feedback.
   =================================================================== */

/* -------------------------------------------------------------------
   1. Tipografia: balance + numeri tabulari ovunque + tracking fine
   ------------------------------------------------------------------- */
h1, h2, h3 {
  text-wrap: balance;          /* niente parole orfane */
}
p, li, dd {
  text-wrap: pretty;           /* line-break ottimizzato */
}
.font-h1, .font-h2 {
  letter-spacing: -0.025em;    /* tracking più stretto sui display */
}
.tabular-nums, .font-h1, .font-h2, [class*="tabular"] {
  font-feature-settings: "tnum", "ss01";
}

/* -------------------------------------------------------------------
   2. Body: subtle warm background gradient + grain overlay
   ------------------------------------------------------------------- */
body {
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(172, 248, 71, 0.04), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(28, 27, 27, 0.025), transparent 70%),
    #fcf9f8;
}

/* Grain ultra-soft, fissato sopra al body, non interagibile */
/* Grain dietro tutto: isolation crea uno stacking context al body */
body { isolation: isolate; }
body::before { z-index: -1; }
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.018 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
/* -------------------------------------------------------------------
   3. Shadow tinted: niente più pure-black, prendono tono dal contesto
   ------------------------------------------------------------------- */
.card-surface {
  box-shadow:
    0 1px 0 rgba(28, 27, 27, 0.02),
    0 4px 14px -4px rgba(28, 27, 27, 0.06),
    0 2px 4px -2px rgba(28, 27, 27, 0.04);
  transition:
    transform 240ms cubic-bezier(0.34, 1.4, 0.64, 1),
    box-shadow 240ms cubic-bezier(0.34, 1.4, 0.64, 1),
    border-color 240ms ease;
}

/* Card cliccabili (anchor o data-row) → lift su hover */
a > .card-surface:hover,
.card-surface[data-row]:hover,
.list-row-mobile:hover,
article.card-surface:hover {
  transform: translateY(-2px);
  box-shadow:
    0 1px 0 rgba(28, 27, 27, 0.03),
    0 12px 28px -8px rgba(28, 27, 27, 0.10),
    0 4px 10px -4px rgba(28, 27, 27, 0.06);
  border-color: rgba(196, 199, 199, 0.6);
}

/* Card-hero-dark: glow lime sottile sotto invece di shadow nera */
.card-hero-dark {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 18px 40px -16px rgba(172, 248, 71, 0.18),
    0 8px 20px -8px rgba(28, 27, 27, 0.35);
}
.card-hero-dark::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.4' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.06 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: 0.5;
  mix-blend-mode: overlay;
}

/* -------------------------------------------------------------------
   4. Bottoni: spring + active feedback + focus tinted
   ------------------------------------------------------------------- */
.btn,
.btn-primary,
.btn-secondary,
.btn-ghost {
  transition:
    transform 200ms cubic-bezier(0.34, 1.5, 0.64, 1),
    background-color 200ms ease,
    box-shadow 200ms ease,
    color 200ms ease;
}
.btn-primary { box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, 0 6px 14px -6px rgba(28,27,27,0.35); }
.btn-primary:hover { box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, 0 10px 24px -8px rgba(28,27,27,0.40); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary { box-shadow: 0 1px 0 rgba(255,255,255,0.20) inset, 0 6px 14px -6px rgba(172,248,71,0.45); }
.btn-secondary:hover { box-shadow: 0 1px 0 rgba(255,255,255,0.20) inset, 0 10px 24px -8px rgba(172,248,71,0.55); transform: translateY(-1px); }
.btn-secondary:active { transform: translateY(0); }

.btn-ghost:hover { transform: translateY(-1px); }

/* Focus ring tinted lime per accessibility */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid rgba(172, 248, 71, 0.55);
  outline-offset: 2px;
  border-radius: 6px;
}

/* -------------------------------------------------------------------
   5. List-row: hover sottile, transition fluida
   ------------------------------------------------------------------- */
.list-row {
  transition: background-color 180ms ease, padding-left 220ms cubic-bezier(0.34, 1.5, 0.64, 1);
}
.list-row:hover {
  padding-left: calc(var(--tw-space-x-reverse, 16px) + 4px);
  background-color: rgba(240, 237, 237, 0.7);
}

/* Active sidebar/tab: indicatore animato */
.nav-item-active {
  background-image: linear-gradient(90deg, rgba(172,248,71,0.10), transparent 60%);
}

/* -------------------------------------------------------------------
   6. Tabs (cliente, impostazioni, ecc): underline animata
   ------------------------------------------------------------------- */
.tab {
  position: relative;
  transition: color 180ms ease;
}
.tab::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 260ms cubic-bezier(0.34, 1.4, 0.64, 1);
}
.tab.tab-active::after { transform: scaleX(1); }

/* -------------------------------------------------------------------
   7. Bottom-nav: indicatore cerchio dietro icona attiva
   ------------------------------------------------------------------- */
.tab-item {
  position: relative;
  transition: color 180ms ease;
}
.tab-item .material-symbols-outlined {
  position: relative;
  transition: transform 220ms cubic-bezier(0.34, 1.5, 0.64, 1);
}
.tab-item.tab-item-active .material-symbols-outlined {
  transform: translateY(-2px);
}
.tab-item.tab-item-active::before {
  content: "";
  position: absolute;
  top: 8px;
  width: 36px; height: 36px;
  border-radius: 999px;
  background: rgba(172, 248, 71, 0.18);
  z-index: -1;
}

/* -------------------------------------------------------------------
   8. Skeleton loader (sostituisce lo spinner di app.js)
   ------------------------------------------------------------------- */
@keyframes skeleton-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton-card {
  background:
    linear-gradient(90deg, rgba(244, 240, 240, 0.6) 0%, rgba(255, 255, 255, 0.9) 50%, rgba(244, 240, 240, 0.6) 100%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s linear infinite;
  border-radius: 1rem;
  border: 1px solid #e4e2e1;
}
.skeleton-line {
  background:
    linear-gradient(90deg, #eae7e7 0%, #f6f3f2 50%, #eae7e7 100%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s linear infinite;
  border-radius: 6px;
  height: 12px;
}

/* -------------------------------------------------------------------
   9. Stagger entry: contenuti che entrano a cascata
   Si attiva applicando .stagger-in al container, e i figli diretti
   ricevono fade+translateY con delay incrementale.
   ------------------------------------------------------------------- */
@keyframes pt-fadeup {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.stagger-in > * {
  opacity: 0;
  animation: pt-fadeup 480ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.stagger-in > *:nth-child(1) { animation-delay:  20ms; }
.stagger-in > *:nth-child(2) { animation-delay:  80ms; }
.stagger-in > *:nth-child(3) { animation-delay: 140ms; }
.stagger-in > *:nth-child(4) { animation-delay: 200ms; }
.stagger-in > *:nth-child(5) { animation-delay: 260ms; }
.stagger-in > *:nth-child(6) { animation-delay: 320ms; }
.stagger-in > *:nth-child(n+7) { animation-delay: 380ms; }

/* Riduzione movimento per chi preferisce */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .stagger-in > * { opacity: 1 !important; transform: none !important; }
}

/* -------------------------------------------------------------------
   10. Sidebar logo: gradient lime sottile sull'icona quando hover
   ------------------------------------------------------------------- */
aside .ms-fill {
  filter: drop-shadow(0 0 8px rgba(172, 248, 71, 0.35));
}

/* -------------------------------------------------------------------
   11. Empty state: più ricco, illustrazione monocromatica
   ------------------------------------------------------------------- */
.empty-state {
  position: relative;
  overflow: hidden; /* il glow ::before sborda di -20%: senza clip allarga la pagina (overflow orizzontale) */
}
.empty-state::before {
  content: "";
  position: absolute;
  inset: -10% -20%;
  background: radial-gradient(circle at center, rgba(172, 248, 71, 0.06), transparent 60%);
  pointer-events: none;
  z-index: -1;
}

/* -------------------------------------------------------------------
   11b. Utility assenti da app.css (build Tailwind congelata al 2026-05-05;
   non c'è build step: le classi nuove vanno aggiunte qui a mano)
   ------------------------------------------------------------------- */
.opacity-80 { opacity: .8; }
.max-w-sm { max-width: 24rem; }
.max-w-2xl { max-width: 42rem; }
/* Griglia giorni/orari (setup wizard step 2 + impostazioni) e checkbox dei giorni */
.grid-cols-\[110px_50px_1fr_1fr\] { grid-template-columns: 110px 50px 1fr 1fr; }
.grid-cols-\[100px_60px_1fr_1fr\] { grid-template-columns: 100px 60px 1fr 1fr; }
@media (max-width: 480px) {
  .grid-cols-\[110px_50px_1fr_1fr\],
  .grid-cols-\[100px_60px_1fr_1fr\] { grid-template-columns: 84px 36px 1fr 1fr; }
}
.w-5 { width: 1.25rem; }
.h-5 { height: 1.25rem; }
.accent-secondary-fixed { accent-color: rgb(172 248 71); }

/* -------------------------------------------------------------------
   11c. Overlay di transizione a fine setup wizard ("Termina e accedi")
   ------------------------------------------------------------------- */
.setup-done-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; text-align: center; padding: 24px;
  background: rgba(252, 249, 248, 0.96);
  backdrop-filter: blur(6px);
  animation: pt-fadeup 240ms ease-out;
  transition: opacity 400ms ease;
}
.setup-done-overlay.is-hidden { opacity: 0; pointer-events: none; }

/* Toast di conferma/errore (impostazioni & co.) — centrato in basso,
   sopra la bottom-nav su mobile */
.pt-toast {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%);
  z-index: 80; display: inline-flex; align-items: center; gap: 8px;
  white-space: nowrap;
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.35);
  animation: pt-fadeup 220ms ease-out;
}
@media (min-width: 1024px) { .pt-toast { bottom: 32px; } }
.setup-done-overlay .setup-spinner {
  width: 44px; height: 44px; border-radius: 999px;
  border: 3px solid rgb(172 248 71);
  border-top-color: transparent;
  animation: pt-spin 800ms linear infinite;
}
@keyframes pt-spin { to { transform: rotate(360deg); } }

/* -------------------------------------------------------------------
   12. Avatar: subtle inner ring per dare profondità
   ------------------------------------------------------------------- */
.avatar {
  box-shadow: 0 0 0 1px rgba(28, 27, 27, 0.04) inset, 0 1px 2px rgba(28, 27, 27, 0.04);
}

/* -------------------------------------------------------------------
   13. Modali: backdrop con blur più pronunciato e fade
   ------------------------------------------------------------------- */
.modal-backdrop {
  animation: pt-fadeup 200ms ease-out;
  backdrop-filter: blur(8px) saturate(0.9);
}
.modal-card {
  animation: pt-modal-pop 320ms cubic-bezier(0.34, 1.4, 0.64, 1);
}
@keyframes pt-modal-pop {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* -------------------------------------------------------------------
   14. Inputs: focus glow lime
   ------------------------------------------------------------------- */
.input-text:focus {
  box-shadow: 0 0 0 3px rgba(172, 248, 71, 0.25);
  border-color: #1b1c1c;
}

/* -------------------------------------------------------------------
   15. Scrollbar discreta (Webkit)
   ------------------------------------------------------------------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(28, 27, 27, 0.12);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(28, 27, 27, 0.20); background-clip: padding-box; }

/* -------------------------------------------------------------------
   16. Selection accent
   ------------------------------------------------------------------- */
::selection { background: rgba(172, 248, 71, 0.55); color: #1b1c1c; }

/* ===================================================================
   AMPLIFICATIONS — effetti più pronunciati per essere subito visibili
   =================================================================== */

/* Lift card più marcato */
a > .card-surface:hover,
.card-surface[data-row]:hover,
.list-row-mobile:hover,
article.card-surface:hover {
  transform: translateY(-4px) !important;
  box-shadow:
    0 1px 0 rgba(28, 27, 27, 0.04),
    0 20px 40px -10px rgba(28, 27, 27, 0.16),
    0 6px 14px -6px rgba(28, 27, 27, 0.10) !important;
}

/* Bottoni: lift + scale leggero, shadow tinted PIÙ visibile */
.btn-primary:hover  { transform: translateY(-2px) scale(1.01) !important; box-shadow: 0 14px 28px -10px rgba(28,27,27,0.45) !important; }
.btn-secondary:hover{ transform: translateY(-2px) scale(1.01) !important; box-shadow: 0 14px 28px -10px rgba(172,248,71,0.65) !important; }

/* Card hero scura: glow lime PIÙ acceso */
.card-hero-dark {
  box-shadow:
    0 1px 0 rgba(255,255,255,0.06) inset,
    0 28px 60px -20px rgba(172, 248, 71, 0.30),
    0 12px 24px -10px rgba(28, 27, 27, 0.40) !important;
}

/* Tab underline più spessa */
.tab::after { height: 3px !important; }

/* Bottom-nav active: cerchio dietro più grande/visibile */
.tab-item.tab-item-active::before {
  width: 44px !important; height: 44px !important;
  background: rgba(172, 248, 71, 0.28) !important;
  box-shadow: 0 0 0 3px rgba(172, 248, 71, 0.10);
}

/* Body grain leggermente più visibile */
body::before { opacity: 0.55 !important; }


/* ===================================================================
   Restyle B1 — sidebar collapse smooth + dashboard tweaks
   =================================================================== */

/* Sidebar transition smooth (var-driven) */
aside#sidebar {
  transition: width 220ms cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}
aside#sidebar [data-only-expanded] {
  transition: opacity 180ms ease-out, transform 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Nav-item più solido: padding consistente e gap fisso */
aside#sidebar .nav-item {
  min-height: 44px;
  padding: 10px 12px;
  font-size: 14px;
  border-radius: 8px;
  position: relative;
}
aside#sidebar .nav-item.nav-item-active {
  background: linear-gradient(90deg, rgba(172,248,71,0.18), rgba(172,248,71,0.04) 90%);
  color: #1b1c1c;
  font-weight: 700;
  border-right: 0;
}
aside#sidebar .nav-item.nav-item-active::before {
  content: "";
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px;
  background: #91db2a;
  border-radius: 0 3px 3px 0;
}

/* Stat-card dashboard: hover più espressivo */
[data-stats] a {
  text-decoration: none;
  border: 1px solid #e4e2e1;
  position: relative;
}
[data-stats] a:hover {
  transform: translateY(-2px);
  box-shadow:
    0 1px 0 rgba(28,27,27,0.04),
    0 14px 30px -12px rgba(28,27,27,0.14),
    0 4px 10px -4px rgba(28,27,27,0.08);
  border-color: rgba(28,27,27,0.16);
}

/* ===================================================================
   Bottom-nav smart hide
   =================================================================== */
nav#bottom-nav {
  transition: transform 240ms cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
nav#bottom-nav.nav-hidden {
  transform: translateY(110%);
}

/* ============================================================
   PWA iOS — safe-area insets per status bar trasparente.
   Su iOS standalone (apple-mobile-web-app-status-bar-style=
   black-translucent) il contenuto va sotto la status bar.
   Aggiungiamo padding al top bar mobile + main, e al bottom nav
   per home indicator iPhone (env(safe-area-inset-bottom)).
   ============================================================ */
.topbar-mobile {
  padding-top: env(safe-area-inset-top);
  height: calc(3.5rem + env(safe-area-inset-top)) !important;
}
@media (max-width: 1023.98px) {
  main#view {
    padding-top: calc(68px + env(safe-area-inset-top)) !important;
  }
}
/* Bottom nav: aggiungi safe-area anche a sinistra/destra (notch landscape) */
#bottom-nav {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  padding-bottom: max(env(safe-area-inset-bottom), 4px);
}

/* -------------------------------------------------------------------
   Lista clienti: griglia adattiva sullo spazio reale (non sul viewport).
   Con sidebar aperta su iPad landscape i breakpoint Tailwind contavano
   il viewport intero -> 3 colonne schiacciate. auto-fill conta il
   contenitore: ogni card ha minimo 340px o va a capo.
   ------------------------------------------------------------------- */
.clienti-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
  gap: 16px;
}

/* -------------------------------------------------------------------
   18. Dashboard: hero "centro di comando" + timeline giornaliera
   ------------------------------------------------------------------- */

/* Glow lime radiale: l'unico punto di colore forte della pagina */
.hero-glow {
  position: absolute;
  top: -140px; right: -100px;
  width: 440px; height: 440px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(172, 248, 71, 0.20), transparent 65%);
  pointer-events: none;
}

/* Orario fantasma gigante: profondità senza aggiungere elementi */
.hero-watermark {
  position: absolute;
  right: -16px; bottom: -64px;
  font-family: Lexend, sans-serif;
  font-weight: 900;
  font-size: 220px;
  line-height: 1;
  letter-spacing: -0.06em;
  color: rgba(255, 255, 255, 0.05);
  pointer-events: none;
  user-select: none;
  font-feature-settings: "tnum";
}

/* L'orario È il hero: Lexend Black con alone lime */
.hero-time {
  font-family: Lexend, sans-serif;
  font-weight: 900;
  font-size: clamp(44px, 4.5vw, 68px);
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: #acf847;
  text-shadow: 0 0 36px rgba(172, 248, 71, 0.35);
  font-feature-settings: "tnum";
}

.hero-countdown {
  background: rgba(172, 248, 71, 0.12);
  color: #acf847;
  border: 1px solid rgba(172, 248, 71, 0.30);
}

/* Avatar sovrapposti nel hero: il bordo nero li stacca dal fondo scuro */
.hero-avatars { display: flex; }
.hero-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: Lexend, sans-serif;
  font-weight: 700; font-size: 13px;
  color: #1b1c1c;
  border: 2px solid #000;
  margin-left: -10px;
  position: relative;
}
.hero-avatar:first-child { margin-left: 0; }

/* --- Timeline giornaliera --- */
.timeline { position: relative; padding: 6px 0; }
/* Linea verticale continua; i nodi (position:relative) le passano sopra */
.timeline::before {
  content: "";
  position: absolute;
  left: 88px; top: 18px; bottom: 18px;
  width: 2px;
  background: rgba(28, 27, 27, 0.07);
}
.timeline-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px;
  position: relative;
  border-radius: 14px;
  transition: background-color 180ms ease;
}
a.timeline-row:hover { background: rgba(28, 27, 27, 0.035); }
.timeline-ora { width: 52px; text-align: right; flex-shrink: 0; }
.timeline-node {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fcf9f8;
  border: 2px solid rgba(28, 27, 27, 0.25);
  flex-shrink: 0;
  position: relative;
}
/* Passato: nodo lime con spunta, riga attenuata */
.timeline-row.is-past { opacity: 0.55; }
.timeline-row.is-past .timeline-node { background: #acf847; border-color: #acf847; }
.timeline-row.is-past .timeline-node::after {
  content: "\2713";
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 800; color: #1b1c1c;
}
/* In corso: nodo pulsante */
.timeline-row.is-now .timeline-node {
  background: #acf847; border-color: #acf847;
  box-shadow: 0 0 0 4px rgba(172, 248, 71, 0.25);
  animation: timeline-pulse 1.8s ease-in-out infinite;
}
@keyframes timeline-pulse {
  50% { box-shadow: 0 0 0 7px rgba(172, 248, 71, 0.12); }
}
/* Prossimo: evidenza lime soft su tutta la riga */
.timeline-row.is-next { background: rgba(172, 248, 71, 0.08); }
.timeline-row.is-next .timeline-node {
  background: #1b1c1c; border-color: #acf847;
  box-shadow: 0 0 0 4px rgba(172, 248, 71, 0.18);
}
a.timeline-row.is-next:hover { background: rgba(172, 248, 71, 0.14); }
/* Indicatore "adesso": rosso calendario, taglia la giornata in due */
.timeline-now {
  display: flex; align-items: center; gap: 10px;
  padding: 2px 16px;
  position: relative;
}
.timeline-now-label {
  font-family: Manrope, sans-serif;
  font-size: 11px; font-weight: 700;
  color: rgb(186 26 26);
  white-space: nowrap;
  width: 66px; text-align: right; flex-shrink: 0;
}
.timeline-now-line {
  flex: 1; height: 2px;
  background: rgba(186, 26, 26, 0.65);
  border-radius: 2px;
  position: relative;
}
.timeline-now-line::before {
  content: "";
  position: absolute;
  left: -3px; top: -2px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgb(186 26 26);
}

/* Numeri stat: Lexend Black, il dato domina la label */
.stat-num {
  font-family: Lexend, sans-serif;
  font-weight: 900;
  font-size: 36px;
  line-height: 1;
  letter-spacing: -0.03em;
  font-feature-settings: "tnum";
}
.stat-num-sm {
  font-family: Lexend, sans-serif;
  font-weight: 900;
  font-size: 26px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-feature-settings: "tnum";
}

/* -------------------------------------------------------------------
   19. Chat trainer↔cliente: stile WhatsApp
   Thread su fondo beige, bolle compatte con coda, orario e spunte dentro
   la bolla, chip giorno bianche, bande grigie per header e composer.
   Markup generato da js/views/_chat.js.
   ------------------------------------------------------------------- */

/* Thread: beige caldo con micro-pattern, come lo sfondo doodle di WhatsApp */
[data-msg-thread] {
  background-color: #efe9e1;
  background-image: radial-gradient(rgba(28, 27, 27, 0.045) 1px, transparent 1px);
  background-size: 16px 16px;
}

.chat-row {
  display: flex;
  flex-direction: column;
  max-width: 85%;
}
@media (min-width: 768px) {
  .chat-row { max-width: 65%; }
}
.chat-row-me    { align-self: flex-end;   align-items: flex-end; }
.chat-row-other { align-self: flex-start; align-items: flex-start; }
/* Dentro un gruppo i messaggi quasi si toccano (gap-xs del thread - 6px) */
.chat-row.is-grouped { margin-top: -6px; }

.chat-bubble {
  position: relative;
  padding: 6px 9px 8px 9px;
  font-family: Manrope, sans-serif;
  font-size: 14.5px;
  line-height: 1.4;
  border-radius: 8px;
  width: fit-content;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
  box-shadow: 0 1px 1px rgba(28, 27, 27, 0.10);
}
/* Anima solo l'ultima bolla: il re-render non fa saltare il thread */
[data-msg-thread] > .chat-row:last-child .chat-bubble {
  animation: chat-pop 200ms ease-out both;
}
@keyframes chat-pop {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

/* Verde-lime chiaro per i miei (palette PT al posto del verde WhatsApp) */
.chat-bubble-me    { background: #e4fbc4; color: #1b1c1c; }
.chat-bubble-other { background: #ffffff; color: #1b1c1c; }

/* Coda in alto, solo sul primo messaggio del gruppo */
.chat-bubble-me:not(.is-cont) { border-top-right-radius: 0; }
.chat-bubble-me:not(.is-cont)::after {
  content: "";
  position: absolute;
  top: 0; right: -7px;
  border-top: 9px solid #e4fbc4;
  border-right: 7px solid transparent;
}
.chat-bubble-other:not(.is-cont) { border-top-left-radius: 0; }
.chat-bubble-other:not(.is-cont)::before {
  content: "";
  position: absolute;
  top: 0; left: -7px;
  border-top: 9px solid #ffffff;
  border-left: 7px solid transparent;
}

/* Orario + spunte dentro la bolla, in basso a destra: il testo scorre attorno */
.chat-time {
  float: right;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin: 9px -2px -4px 10px;
  font-size: 10.5px;
  line-height: 1;
  color: rgba(28, 27, 27, 0.45);
  user-select: none;
}
.chat-tick { font-size: 14px !important; color: rgba(28, 27, 27, 0.35); }
.chat-tick.is-read { color: #53bdeb; }   /* azzurro "letto" alla WhatsApp */

/* Chip giorno: bianche con ombra leggera */
.chat-day { align-self: center; margin: 10px 0 6px; }
.chat-day span {
  font-family: Manrope, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(28, 27, 27, 0.50);
  background: #ffffff;
  box-shadow: 0 1px 1px rgba(28, 27, 27, 0.08);
  padding: 5px 12px;
  border-radius: 8px;
}

/* Header e composer: bande grigio caldo piatte, come WhatsApp */
.chat-header {
  background: #f4f1ec;
  border-bottom: none !important;
  /* respiro attorno ad avatar + nome (il pt-md/pb-sm del markup era stretto) */
  padding: 16px 20px !important;
}
.chat-footer {
  background: #f4f1ec;
  border-top: none !important;
}
.chat-footer [data-msg-input] {
  border-radius: 22px;
  background: #ffffff;
  border-color: transparent;
  box-shadow: 0 1px 1px rgba(28, 27, 27, 0.06);
}
/* Invio: cerchio lime con icona scura (il "verde WhatsApp" della palette PT) */
.chat-footer [data-msg-send] {
  border-radius: 50%;
  width: 46px;
  height: 46px;
  min-height: 46px !important;
  padding: 0 !important;
  flex-shrink: 0;
  background: #acf847 !important;
  color: #1b1c1c !important;
}
.chat-footer [data-msg-send]:hover { background: #bdfa66 !important; }
