/* ============================================================================
   Elegance Wedding Leads — Dashboard styles
   Design: navy + gold accent, ispirato al brand Elegance Design Eventi
   ============================================================================ */

:root {
  --navy: #1e3a5f;
  --navy-light: #2c4a75;
  /* FASE 3.27 — Palette Luxury Warm (Step 1: sfondi & buttons) */
  --charcoal: #161514;             /* Deep Charcoal / Warm Espresso — navbar */
  --charcoal-light: #1A1817;
  --gold: #C5A059;                 /* Champagne Gold — accent primario */
  --gold-hover: #B38E48;           /* Champagne denso — hover */
  --gold-light: #e0c98a;
  --bg: #FAF9F5;                   /* Off-white avorio caldo (era #f6f7fb grigio freddo) */
  --card: #ffffff;
  --border: #EAE7E1;               /* Bordo warm leggerissimo (era #e5e7eb grigio freddo) */
  --border-strong: #d8d3c8;
  --text: #111827;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --shadow-sm: 0 4px 20px rgba(0,0,0,0.02);   /* Soft warm shadow diffusa */
  --shadow: 0 4px 12px rgba(0,0,0,0.03);
  --shadow-lg: 0 10px 32px rgba(0,0,0,0.05);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

a {
  color: var(--navy);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

code {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  background: #eef2f7;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ─────────── TOPBAR ─────────── */
.topbar {
  background: var(--charcoal);
  color: #FAF9F5;
  padding: 14px 0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  color: white;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: 0.3px;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  font-size: 26px;
}
.brand-accent {
  color: var(--gold-light);
  font-weight: 500;
}
.nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-link {
  color: #FAF9F5;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 6px;
  white-space: nowrap;   /* icona e nome sulla stessa riga */
  transition: color .15s ease, background .15s ease;
}
.nav-link:hover {
  color: var(--gold);
  background: transparent;
  text-decoration: none;
}

/* ─────────── MAIN ─────────── */
.main {
  padding: 32px 24px 48px;
  min-height: calc(100vh - 130px);
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 28px;
}
.page-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 4px;
  letter-spacing: -0.5px;
}
.page-sub {
  color: var(--text-muted);
  margin: 0;
  font-size: 14px;
}
.page-head-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.breadcrumb a { color: var(--text-muted); }

/* ─────────── BUTTONS ─────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--gold);
  color: var(--navy);
  box-shadow: 0 2px 8px rgba(201, 169, 97, 0.25);
}
.btn-primary:hover {
  background: var(--gold-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(201, 169, 97, 0.35);
}
.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
.btn-ghost {
  background: #ffffff;
  color: var(--charcoal);
  border: 1.5px solid var(--gold);
}
.btn-ghost:hover {
  background: var(--gold);
  color: #ffffff;
  border-color: var(--gold-hover);
}
.btn-danger {
  background: white;
  color: var(--danger);
  border: 1.5px solid var(--danger);
}
.btn-danger:hover {
  background: var(--danger);
  color: white;
}
.btn-lg {
  padding: 12px 22px;
  font-size: 15px;
}

/* ─────────── ALERTS / FLASH ─────────── */
.alert, .flash {
  padding: 14px 18px;
  border-radius: 10px;
  margin-bottom: 20px;
  border-left: 4px solid;
}
.alert-danger, .flash-error {
  background: #fef2f2;
  border-color: var(--danger);
  color: #991b1b;
}
.alert-warning {
  background: #fffbeb;
  border-color: var(--warning);
  color: #92400e;
}
.flash-success {
  background: #ecfdf5;
  border-color: var(--success);
  color: #065f46;
}
.flash-info {
  background: #eff6ff;
  border-color: var(--info);
  color: #1e40af;
}

/* ─────────── KPI CARDS ─────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.kpi-grid.kpi-4 {
  grid-template-columns: repeat(4, 1fr);
}
.kpi-grid.kpi-3 {
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 900px) {
  .kpi-grid.kpi-3 { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════
   LEAD DETAIL LAYOUT (FASE 3.20) — sidebar destra sticky + content fluido
   ═══════════════════════════════════════════════════════════════ */
.lead-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
  margin-bottom: 24px;
}
@media (max-width: 1100px) {
  .lead-workspace { grid-template-columns: 1fr; }
}

.lead-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.lead-content > .section {
  margin: 0;  /* gap fa il lavoro */
}

.lead-sidebar {
  position: sticky;
  top: 16px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding-right: 4px;  /* margine per scrollbar */
}
.lead-sidebar::-webkit-scrollbar { width: 6px; }
.lead-sidebar::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

.sidebar-section {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 18px;
  margin: 0;
  box-shadow: none;
}
.sidebar-section .section-title {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin: 0 0 12px;
}

/* Banner stato in sidebar */
.sidebar-status-banner {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
}
.sidebar-status-banner--call {
  background: #eef2ff;
  border-color: #c7d2fe;
}
.sbs-icon { font-size: 22px; flex-shrink: 0; }
.sbs-body { flex: 1; min-width: 0; }
.sbs-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #4338ca;
}
.sbs-meta {
  font-size: 14px;
  color: #1e293b;
  margin-top: 4px;
  font-weight: 600;
}
.sbs-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  color: #4f46e5;
  text-decoration: none;
  font-weight: 600;
}
.sbs-link:hover { text-decoration: underline; }

/* Debug footer (dati tecnici Gemini nascosti dal flusso vendita) */
.lead-debug-footer {
  margin: 40px 0 12px;
  border-top: 1px dashed #e2e8f0;
  padding-top: 16px;
}
.lead-debug {
  color: #94a3b8;
}
.lead-debug > summary {
  cursor: pointer;
  font-size: 12px;
  color: #94a3b8;
  padding: 6px 10px;
  border-radius: 6px;
  display: inline-block;
  transition: background .12s;
  list-style: none;
}
.lead-debug > summary::-webkit-details-marker { display: none; }
.lead-debug > summary:hover { background: #f1f5f9; color: #475569; }
.lead-debug-body {
  display: flex;
  gap: 20px;
  margin-top: 10px;
  padding: 10px 14px;
  background: #f8fafc;
  border-radius: 6px;
  font-size: 12px;
  color: #64748b;
  flex-wrap: wrap;
}
/* FASE 3.29 — KPI card luxury: bordo impercettibile + shadow impalpabile */
.kpi-card {
  background: #ffffff;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0,0,0,0.02);
}
.kpi-card.kpi-hero {
  border: 1px solid var(--border);
  box-shadow: 0 6px 24px rgba(0,0,0,0.04);
}
.kpi-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-bottom: 8px;
}
.kpi-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
  letter-spacing: -0.5px;
}
.kpi-value small {
  font-size: 22px;
  color: var(--text-muted);
  font-weight: 500;
}
.kpi-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}
.archetipi-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.mini-pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}
.mini-pill strong {
  font-weight: 700;
}

/* ─────────── SECTIONS ─────────── */
.section {
  background: var(--card);
  padding: 24px;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.section-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 16px;
  letter-spacing: -0.2px;
}
.section-head .section-title {
  margin: 0;
  padding: 0;
  border: none;
}

/* ─────────── TABLE ─────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: white;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.table thead {
  background: #f9fafb;
}
.table th {
  padding: 12px 14px;
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.table tbody tr:last-child td {
  border-bottom: none;
}
.row-clickable {
  cursor: pointer;
  transition: background 0.1s;
}
.row-clickable:hover {
  background: #f9fafb;
}
.cell-primary {
  font-weight: 600;
  color: var(--navy);
}
.cell-secondary {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* FASE 3.26 — Cella Matrimonio editoriale: venue in risalto + data compatta */
.wedding-venue {
  font-weight: 700;
  color: #1e3a5f;
  font-size: 14px;
  letter-spacing: -0.1px;
  line-height: 1.25;
}
.wedding-date {
  font-size: 12px;
  color: #64748b;
  margin-top: 3px;
  font-variant-numeric: tabular-nums;   /* allineamento visivo dei numeri in tabella */
  letter-spacing: 0.2px;
}
.arrow {
  color: var(--text-light);
  font-size: 20px;
  font-weight: bold;
}

.badge, .pill, .status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge small {
  opacity: 0.75;
  margin-left: 4px;
}

/* ─────────── EMPTY STATE ─────────── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  background: white;
  border-radius: 12px;
  border: 2px dashed var(--border);
}
.empty-icon {
  font-size: 56px;
  margin-bottom: 12px;
}
.empty-state h3 {
  color: var(--navy);
  margin: 0 0 6px;
  font-size: 20px;
}
.empty-state p {
  color: var(--text-muted);
  margin: 0 0 20px;
}
.preset-cta {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ─────────── FORM ─────────── */
.preset-bar {
  background: white;
  padding: 14px 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 20px;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.preset-btn {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  border: 1.5px solid transparent;
}
.preset-glamour { background: #f3e8ff; color: #7e22ce; border-color: #d8b4fe; }
.preset-classico { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }
.preset-ibrido { background: #e5e7eb; color: #374151; border-color: #d1d5db; }
.preset-clear { background: white; color: var(--text-muted); border-color: var(--border-strong); }
.preset-btn:hover { text-decoration: none; opacity: 0.8; }

.lead-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.form-section {
  background: white;
  padding: 24px;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.form-section-story {
  border-left: 4px solid #a855f7;
}
.form-section-quali {
  border-left: 4px solid var(--info);
}
.form-section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 6px;
}
.form-section-desc {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0 0 18px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.field-wide {
  grid-column: 1 / -1;
}
.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
}
.req {
  color: var(--danger);
}
.field input,
.field select,
.field textarea {
  padding: 10px 12px;
  border: 1.5px solid var(--border-strong);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}
.field textarea {
  resize: vertical;
  min-height: 70px;
  font-family: inherit;
}

.form-actions {
  display: flex;
  gap: 12px;
  padding-top: 8px;
}

/* ─────────── LEAD DETAIL ─────────── */
.two-col {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  align-items: start;
  margin-top: 20px;
}
.two-col-inside {
  grid-template-columns: 1fr 1fr;
  margin-top: 0;
}
.col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.status-select {
  padding: 8px 12px;
  border: 1.5px solid var(--border-strong);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  background: white;
  cursor: pointer;
}

.action-list, .check-list {
  padding-left: 20px;
  margin: 0;
}
.action-list li, .check-list li {
  margin-bottom: 8px;
  line-height: 1.5;
}
.check-list {
  list-style: none;
  padding: 0;
}
.check-list li::before {
  content: "✅ ";
  margin-right: 4px;
}
.check-list-x li::before {
  content: "❌ ";
}

.chip-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
}
.chip-artist {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.data-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  margin: 0;
}
.data-list dt {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}
.data-list dd {
  margin: 0;
  color: var(--text);
  font-size: 14px;
}
/* dd-strong: campi principali (sposi, data matrimonio, location) — grassetto scuro */
.data-list dd.dd-strong {
  color: #0f172a;
  font-weight: 700;
}

.qa-block {
  padding: 10px 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: 14px;
  line-height: 1.55;
}
.qa-block:last-child { border-bottom: none; }
.qa-block strong {
  color: var(--navy);
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}
.qa-block em {
  font-style: italic;
  color: #4b5563;
}

.note-block {
  background: #f9fafb;
  padding: 14px;
  border-radius: 8px;
  border-left: 3px solid var(--gold);
  line-height: 1.6;
  margin: 0;
}

.palette-preview {
  padding: 12px;
  background: linear-gradient(90deg, #fef9e7, #f3e8ff, #fef3c7);
  border-radius: 8px;
  font-size: 14px;
}

/* ─────────── UTILITY ─────────── */
.text-muted { color: var(--text-muted); }

/* ─────────── FOOTER ─────────── */
.footer {
  background: white;
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}

/* ─────────── CLIENT-FACING LAYOUT ─────────── */
.client-body {
  background: linear-gradient(180deg, #fdfcfa 0%, #f6f4ef 100%);
  min-height: 100vh;
}
.client-topbar {
  background: white;
  padding: 22px 0;
  border-bottom: 1px solid #e8dfd0;
  box-shadow: 0 2px 8px rgba(30, 58, 95, 0.04);
}
.client-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.client-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.client-brand-mark {
  font-size: 32px;
}
.client-brand-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.3px;
}
.client-brand-accent {
  color: var(--gold);
  font-weight: 500;
}
.client-brand-tagline {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 2px;
}

.client-hero {
  text-align: center;
  padding: 40px 0 24px;
  max-width: 720px;
  margin: 0 auto;
}
.client-hero-title {
  font-size: 34px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 12px;
  letter-spacing: -0.5px;
}
.client-hero-sub {
  font-size: 17px;
  color: #4b5563;
  margin: 0 0 12px;
  line-height: 1.5;
}
.client-hero-note {
  font-size: 13px;
  color: var(--text-muted);
  margin: 12px 0 0;
}

.form-actions-center {
  justify-content: center;
}
.btn-submit-client {
  padding: 14px 40px;
  font-size: 16px;
}

.field-privacy {
  flex-direction: row !important;
  align-items: flex-start;
  gap: 10px !important;
  padding: 14px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.field-privacy input {
  margin-top: 3px;
  transform: scale(1.2);
  cursor: pointer;
}
.field-privacy span {
  font-size: 14px;
  line-height: 1.5;
}
.field-privacy a {
  color: var(--navy);
  text-decoration: underline;
}

.client-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.75);
  padding: 24px 0;
  text-align: center;
  font-size: 13px;
  margin-top: 40px;
}
.client-footer p {
  margin: 4px 0;
}
.client-footer-privacy {
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  max-width: 600px;
  margin: 8px auto 0 !important;
}
/* FASE 3.153 — i link del piè di pagina (informativa privacy, cookie policy) erano blu su sfondo blu: ora bianchi e sottolineati */
.client-footer a {
  color: rgba(255,255,255,0.9);
  text-decoration: underline;
}
.client-footer a:hover { color: #fff; }

/* ─────────── THANK-YOU PAGE ─────────── */
.client-thanks {
  max-width: 640px;
  margin: 60px auto;
  text-align: center;
  padding: 0 24px;
}
.client-thanks-icon {
  font-size: 72px;
  margin-bottom: 16px;
}
.client-thanks-title {
  font-size: 40px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 14px;
  letter-spacing: -0.5px;
}
.client-thanks-lead {
  font-size: 18px;
  color: #4b5563;
  margin: 0 0 32px;
}
.client-thanks-card {
  background: white;
  padding: 28px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  text-align: left;
  margin: 0 auto 24px;
}
.client-thanks-step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid #f3f4f6;
}
.client-thanks-step:last-child { border: none; padding-bottom: 0; }
.client-thanks-step:first-child { padding-top: 0; }
.client-thanks-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gold);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}
.client-thanks-step strong {
  color: var(--navy);
  display: block;
  margin-bottom: 4px;
}
.client-thanks-step-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.4;
}
.client-thanks-footer {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 24px;
}

/* ─────────── ANALYZE CTA (lead pending) ─────────── */
.section-analyze {
  background: linear-gradient(135deg, #eff6ff, #f3e8ff);
  border: 2px dashed #a855f7;
}
.analyze-cta {
  display: flex;
  gap: 24px;
  align-items: center;
  padding: 12px 4px;
}
.analyze-cta-icon {
  font-size: 64px;
  flex-shrink: 0;
}
.analyze-cta-body {
  flex: 1;
}
.analyze-cta-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 8px;
}
.analyze-cta-desc {
  color: #4b5563;
  margin: 0 0 16px;
  line-height: 1.5;
}
.analyze-cta-note {
  margin: 12px 0 0;
  color: var(--text-muted);
}

.reanalyze-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  padding: 8px 0 20px;
}
.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

/* ─────────── EMAIL PREVIEW ─────────── */
.section-email {
  border-left: 4px solid var(--gold);
}
.email-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.email-sent-badge {
  background: #d1fae5;
  color: #065f46;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}
.email-error-badge {
  background: #fee2e2;
  color: #991b1b;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}
.email-pending-badge {
  background: #fef3c7;
  color: #92400e;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}
.email-hint {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0 0 16px;
}

.email-preview-tabs {
  display: flex;
  gap: 4px;
  margin: 12px 0 0;
  border-bottom: 1px solid var(--border);
}
.tab-btn {
  padding: 8px 16px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 13px;
  transition: all 0.15s;
}
.tab-btn:hover {
  color: var(--navy);
}
.tab-btn-active {
  color: var(--navy);
  border-bottom-color: var(--gold);
}
.tab-panel {
  display: none;
}
.tab-panel-active {
  display: block;
}

.email-preview-frame {
  background: #f9fafb;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-top: 12px;
  max-height: 480px;
  overflow-y: auto;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
}
.email-preview-frame h1, .email-preview-frame h2, .email-preview-frame h3 {
  color: var(--navy);
}

.email-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ─────────── EMAIL COMPACT (senza anteprima ripetuta) ─────────── */
.section-email-compact {
  padding: 14px 20px;
}
.email-compact-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.email-compact-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.email-compact-info strong {
  color: var(--navy);
  font-size: 15px;
}
.email-error-inline {
  margin-top: 10px;
  padding: 8px 12px;
  background: #fef2f2;
  border-left: 3px solid var(--danger);
  border-radius: 4px;
  color: #991b1b;
}

/* ─────────── SEZIONI COLLAPSIBLE (details/summary) ─────────── */
.section-collapsible {
  padding: 0;
  overflow: hidden;
}
.section-collapsible-summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 20px;
  user-select: none;
  transition: background .12s ease;
}
.section-collapsible-summary::-webkit-details-marker { display: none; }
.section-collapsible-summary:hover { background: rgba(0,0,0,0.03); }
.section-collapsible-chevron {
  margin-left: auto;
  font-size: 16px;
  color: #64748b;
  transition: transform .18s ease;
  flex-shrink: 0;
}
.section-collapsible[open] > .section-collapsible-summary .section-collapsible-chevron {
  transform: rotate(180deg);
}
.section-collapsible-body {
  padding: 4px 20px 20px;
  border-top: 1px solid rgba(0,0,0,0.06);
}

/* ─────────── CONTATTA CLIENTE (palette pulita FASE 3.20) ─────────── */
.section-contact {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #f59e0b;
}

/* ─────────── Sezione Leva StoryBrand (indigo accent, no giallo saturo) ─── */
.section-leva {
  border-left: 3px solid #4f46e5;
}
.section-leva .section-title { color: #3730a3; }
.leva-text {
  margin: 6px 0 0;
  line-height: 1.6;
  color: #1e293b;
  font-size: 15px;
}

/* ─────────── Chip keyword indigo minimal ─── */
.chip-keyword {
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
}
.contact-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.contact-badge {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.contact-badge-pending {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #f59e0b;
}
.contact-badge-wa {
  background: #dcfce7;
  color: #14532d;
  border: 1px solid #25d366;
}
.contact-badge-email {
  background: #dbeafe;
  color: #1e3a8a;
  border: 1px solid #0ea5e9;
}

.contact-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}
.contact-msg {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}
.contact-msg-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
  cursor: pointer;
}
.contact-msg-head strong {
  color: var(--navy);
  font-size: 14px;
}
.contact-msg-body {
  color: #374151;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-line;
}
details.contact-msg summary {
  list-style: none;
  outline: none;
}
details.contact-msg summary::-webkit-details-marker {
  display: none;
}
details.contact-msg summary::before {
  content: "▸ ";
  color: var(--text-muted);
  font-weight: bold;
}
details.contact-msg[open] summary::before {
  content: "▾ ";
}

.contact-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid rgba(0,0,0,0.06);
}

.btn-wa {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  background: #25d366;
  color: white;
  text-decoration: none;
  transition: all 0.15s;
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
}
.btn-wa:hover {
  background: #1fb554;
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

/* ─────────── CALENDARIO ─────────── */
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.cal-month-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
  text-align: center;
}
.cal-grid-wrap {
  overflow-x: auto;
  background: white;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 4px;
}
.cal-grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 720px;
}
.cal-grid th {
  padding: 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.cal-grid th.cal-weekend {
  color: #9ca3af;
}
.cal-cell {
  height: 112px;
  vertical-align: top;
  padding: 6px;
  border: 1px solid #f1f3f5;
  width: 14.28%;
}
.cal-cell-empty {
  background: #fafbfc;
}
.cal-cell-today {
  background: #fffbeb;
  box-shadow: inset 0 0 0 2px var(--gold);
}
.cal-cell-click {
  cursor: pointer;
  transition: background 0.12s;
}
.cal-cell-click:hover {
  background: #eff6ff;
}
.cal-day-num {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.cal-cell-today .cal-day-num {
  color: var(--gold);
}
/* Solo il numero di call confermate, centrato nella cella */
.cal-call-count {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-top: 10px;
}
.cal-call-num {
  font-size: 30px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
}
.cal-call-lbl {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gold);
  font-weight: 700;
  margin-top: 2px;
}
.cal-event {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #eff6ff;
  border-radius: 4px;
  padding: 3px 6px;
  margin-bottom: 3px;
  font-size: 11px;
  line-height: 1.3;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.cal-event-time {
  font-weight: 700;
  color: var(--navy);
  flex-shrink: 0;
}
.cal-event-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cal-event-name {
  overflow: hidden;
  text-overflow: ellipsis;
  color: #374151;
}

/* Agenda */
.agenda-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.agenda-item {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 12px 14px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.agenda-date {
  text-align: center;
  flex-shrink: 0;
  width: 52px;
}
.agenda-day {
  font-size: 24px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}
.agenda-month {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 0.5px;
}
.agenda-body {
  flex: 1;
  min-width: 0;
}
.agenda-title {
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 4px;
}
.agenda-lead {
  font-size: 14px;
}
.agenda-loc {
  font-size: 12px;
  margin-top: 2px;
}
.agenda-item-click {
  cursor: pointer;
  transition: all 0.12s;
}
.agenda-item-click:hover {
  border-color: var(--gold);
  box-shadow: 0 2px 8px rgba(201, 169, 97, 0.2);
}
.cal-event {
  cursor: pointer;
}
.cal-event:hover {
  background: #dbeafe;
}

/* ─────────── MODALE EVENTO ─────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-box {
  background: white;
  border-radius: 14px;
  max-width: 520px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: white;
  border-radius: 14px 14px 0 0;
}
.modal-header h3 {
  margin: 0;
  font-size: 18px;
}
.modal-close {
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  flex-shrink: 0;
}
.modal-close:hover {
  background: rgba(255,255,255,0.3);
}
.modal-body {
  padding: 20px 24px;
}
.ev-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 15px;
  color: var(--text);
}
.ev-icon {
  font-size: 18px;
  flex-shrink: 0;
}
.ev-lead-box {
  margin-top: 16px;
  padding: 16px;
  background: #f9fafb;
  border-radius: 10px;
  border-left: 3px solid var(--gold);
}
.ev-lead-head {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 8px;
}
.ev-lead-body {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 15px;
}
.ev-desc-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
  margin: 16px 0 6px;
}
.ev-desc {
  background: #f9fafb;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
  color: #374151;
  white-space: pre-line;
  max-height: 220px;
  overflow-y: auto;
}
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

/* ─────────── MODALE GIORNO (lista call) ─────────── */
.day-count {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.day-calls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.day-call {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.day-call-clickable {
  cursor: pointer;
  transition: all 0.12s;
}
.day-call-clickable:hover {
  border-color: var(--gold);
  background: #fffdf7;
  box-shadow: 0 2px 8px rgba(201, 169, 97, 0.18);
}
.day-call-time {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  flex-shrink: 0;
  width: 52px;
  text-align: center;
}
.day-call-body {
  flex: 1;
  min-width: 0;
}
.day-call-title {
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 3px;
}
.day-call-lead {
  font-size: 14px;
}
.day-call-att, .day-call-loc, .day-call-desc {
  font-size: 12px;
  margin-top: 2px;
}
.day-call-nodata {
  font-size: 12px;
  margin-top: 2px;
  color: #b45309;
}
.day-call-cta {
  color: var(--gold);
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  flex-shrink: 0;
}
.day-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: 15px;
}

/* ─────────── RESPONSIVE ─────────── */
@media (max-width: 900px) {
  .grid-2, .kpi-grid.kpi-4 {
    grid-template-columns: 1fr;
  }
  .two-col, .two-col-inside {
    grid-template-columns: 1fr;
  }
  .page-head {
    flex-direction: column;
    align-items: stretch;
  }
  .table th:nth-child(1),
  .table td:nth-child(1),
  .table th:nth-child(5),
  .table td:nth-child(5) {
    display: none;
  }
}

/* ─────────── 4 CARD CLICCABILI DASHBOARD ─────────── */
/* FASE 3.56 — LUXURY HIGH-END DESIGN: grid asimmetrica editoriale + Playfair + oro */
.dash-cards--luxury {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 28px;
  align-items: stretch;
}
/* Dashboard direttore: cinque card della stessa larghezza */
.dash-cards--luxury.dash-cards--cinque { grid-template-columns: repeat(5, minmax(0, 1fr)); }
/* FASE 3.135 — Direttore: 6 card (Lead larga sopra, le altre 5 sotto) */
.dash-cards--luxury.dash-cards--cinque.dash-cards--sei { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.dash-cards--sei .lx-card--big { grid-column: 1 / -1; }
.dash-cards--sei .lx-card--big .lx-big-body { flex-direction: row; align-items: center; gap: 24px; }
.dash-cards--cinque .lx-big-body { flex-direction: column; align-items: flex-start; gap: 12px; }
.dash-cards--cinque .lx-arch-list { width: 100%; }
.dash-cards--cinque .lx-src-row { gap: 8px; }
/* .lx-value.… : più specifico della regola base .lx-value, che sta più sotto */
.lx-value.lx-value--allarme { color: #e11d1d; font-weight: 600; text-shadow: 0 0 14px rgba(225,29,29,0.28); }
.lx-value.lx-value--spento { color: #9ca3af; }
@media (max-width: 1200px) {
  .dash-cards--luxury { grid-template-columns: 1fr 1fr; }
  .dash-cards--luxury.dash-cards--cinque { grid-template-columns: 1fr 1fr; }
  .lx-card--big { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .dash-cards--luxury, .dash-cards--luxury.dash-cards--cinque { grid-template-columns: 1fr; }
  .lx-card--big { grid-column: auto; }
}
@media (max-width: 1200px) {
  .dash-cards--luxury.dash-cards--cinque.dash-cards--sei { grid-template-columns: 1fr 1fr; }
  .dash-cards--sei .lx-card--big .lx-big-body { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 720px) {
  .dash-cards--luxury.dash-cards--cinque.dash-cards--sei { grid-template-columns: 1fr; }
}

/* ── Base card luxury ── */
.lx-card {
  background: #FFFFFF;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 10px;
  padding: 20px 22px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
  display: flex;
  flex-direction: column;
  min-height: 180px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
  text-decoration: none;
  color: #1E1E1E;
}
.lx-card:hover {
  border-color: #B89758;
  box-shadow: 0 6px 24px rgba(184,151,88,0.08);
  transform: translateY(-2px);
}
.lx-card:focus-visible {
  outline: 2px solid #B89758;
  outline-offset: 2px;
}
.lx-card.is-active {
  border-color: #B89758;
  box-shadow: 0 4px 16px rgba(184,151,88,0.12), inset 0 0 0 1px rgba(184,151,88,0.4);
}

/* ── Header interno card ── */
.lx-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}
.lx-eyebrow {
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: #666666;
  line-height: 1.2;
}
.lx-icon {
  color: #999;
  line-height: 0;
}
.lx-icon svg,
.lx-icon [data-lucide] { width: 16px; height: 16px; stroke-width: 1; }

/* ── Numero KPI grande in serif oro (compatta) ── */
.lx-value-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 8px 0;
}
.lx-value {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 52px;
  font-weight: 400;
  line-height: 1;
  color: #B89758;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}

.lx-caption {
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  font-size: 11px;
  color: #888;
  letter-spacing: 0.3px;
  margin-top: 6px;
  min-height: 16px;
}
.lx-caption--money {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 18px;
  font-weight: 500;
  color: #B89758;
  font-variant-numeric: tabular-nums;
  margin-top: 8px;
}
.lx-caption--split {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}
.lx-caption-sep { color: #ccc; }
.lx-mini-badge {
  color: #666;
  text-decoration: none;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
  font-weight: 500;
}
.lx-mini-badge:hover { color: #B89758; background: rgba(184,151,88,0.08); }
.lx-mini-badge.is-active { color: #B89758; background: rgba(184,151,88,0.12); font-weight: 600; }

/* ── CARD 1 grande (2fr) orizzontale ricca ── */
.lx-card--big { min-height: 240px; }
.lx-big-body {
  display: flex;
  align-items: baseline;
  gap: 28px;
  padding: 4px 0 14px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  margin-bottom: 14px;
}
.lx-big-value {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 68px;
  font-weight: 400;
  line-height: 1;
  color: #B89758;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
  flex-shrink: 0;
}
.lx-arch-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.lx-arch-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}
.lx-arch-item:hover { border-bottom-color: #B89758; }
.lx-arch-item.is-active .lx-arch-name { color: #B89758; }
.lx-arch-name {
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: #1E1E1E;
  text-transform: uppercase;
}
.lx-arch-pct {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 15px;
  font-weight: 500;
  color: #B89758;
  font-variant-numeric: tabular-nums;
}

/* Sezione provenienza in card 1 */
.lx-mini-title {
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #999;
  margin-bottom: 8px;
}
.lx-src-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lx-src-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 80px 32px;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  padding: 2px 4px;
  margin: 0 -4px;
  border-radius: 4px;
  transition: background 0.15s ease;
}
.lx-src-row:hover { background: rgba(184,151,88,0.06); }
.lx-src-row.is-active { background: rgba(184,151,88,0.12); }
.lx-src-lbl {
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  font-size: 11px;
  color: #1E1E1E;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.lx-src-bar-wrap {
  height: 3px;
  background: rgba(0,0,0,0.06);
  border-radius: 0;
  overflow: hidden;
}
.lx-src-bar-fill {
  display: block;
  height: 100%;
  background: #B89758;
  transition: width 0.3s ease;
}
.lx-src-pct {
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  font-size: 10.5px;
  color: #666;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

/* ── Card in allarme ("Da contattare", "Presentazioni per videocall"): c'è qualcosa da fare ──
   Bordo rosso con alone che respira, bollino rosso nell'angolo, numero rosso. Con zero la card è normale. */
.lx-card.lx-card--allarme {
  position: relative;
  border: 2px solid #e11d1d;
  animation: lx-alone-allarme 2.4s ease-in-out infinite;
}
.lx-card.lx-card--allarme:hover { border-color: #b91c1c; }
.lx-card--allarme::after {
  content: '';
  position: absolute;
  top: -9px; right: -9px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #e11d1d;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(225,29,29,0.45);
  animation: lx-bollino 2.4s ease-in-out infinite;
}
@keyframes lx-alone-allarme {
  0%, 100% { box-shadow: 0 0 0 0 rgba(225,29,29,0.10), 0 4px 20px rgba(0,0,0,0.03); }
  50% { box-shadow: 0 0 0 7px rgba(225,29,29,0.16), 0 6px 24px rgba(225,29,29,0.18); }
}
@keyframes lx-bollino {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}
@media (prefers-reduced-motion: reduce) {
  .lx-card.lx-card--allarme, .lx-card--allarme::after { animation: none; }
  .lx-card.lx-card--allarme { box-shadow: 0 0 0 4px rgba(225,29,29,0.14); }
}

/* Layout interno card: header (icona+numero) + label + contenuto */
.dash-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.dash-card-head .dash-card-icon { margin-bottom: 0; }
.dash-card-head .dash-card-value { margin-bottom: 0; font-size: 30px; }

/* CARD 1 grande: unificata Lead + Archetipi + Provenienza */
.dash-card--big { min-height: 260px; }
.dash-arch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 10px 0 12px;
}
.dash-arch-row .mini-pill--arch {
  font-size: 10px;
  padding: 3px 9px;
  flex: 1 1 auto;
  text-align: center;
  min-width: 0;
}
.dash-src-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.dash-src-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 60px 32px;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}
.dash-src-lbl {
  color: var(--charcoal);
  font-family: var(--font-sans);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.dash-src-bar-wrap {
  height: 6px;
  background: #F1EFEA;
  border-radius: 999px;
  overflow: hidden;
}
.dash-src-bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}
.dash-src-pct {
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  text-align: right;
  font-weight: 600;
}

/* CARD 3: badge Call/Videocall accorpati */
.dash-appt-badges {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.dash-appt-badge {
  font-size: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.dash-appt-badge--call { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.dash-appt-badge--video { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }

/* CARD 4: valore economico contratti */
.dash-card-money {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  margin-top: 10px;
}

/* FASE 3.55 — Inner clickable hover luxury */
.dash-card[data-href] { cursor: pointer; }
.dash-card[data-href]:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.mini-pill--clickable {
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.mini-pill--clickable:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(197,160,89,0.25);
  border-color: var(--gold) !important;
}
.mini-pill--clickable.is-active {
  box-shadow: 0 0 0 2px var(--gold);
  transform: translateY(-1px);
}

.dash-src-row {
  text-decoration: none;
  cursor: pointer;
  padding: 2px 4px;
  margin: 0 -4px;
  border-radius: 6px;
  transition: background 0.15s ease;
}
.dash-src-row:hover {
  background: rgba(197,160,89,0.08);
}
.dash-src-row.is-active {
  background: rgba(197,160,89,0.15);
  box-shadow: inset 3px 0 0 var(--gold);
}

.dash-appt-badge {
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.dash-appt-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.dash-appt-badge--call.is-active { box-shadow: 0 0 0 2px #1e40af; }
.dash-appt-badge--video.is-active { box-shadow: 0 0 0 2px #047857; }
.dash-card {
  display: block;
  padding: 14px 14px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: all .18s ease;
  cursor: pointer;
  min-height: 140px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.02);
}
.dash-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(197, 160, 89, 0.12);
  border-color: var(--gold);
}
.dash-card--active {
  border-color: #1e3a5f;
  background: linear-gradient(135deg, #f9fafb, #f0f4f9);
  box-shadow: 0 4px 14px rgba(30, 58, 95, 0.15);
}
.dash-card--positive.dash-card--active {
  border-color: #8b5cf6;
  background: linear-gradient(135deg, #f5f3ff, #ede9fe);
}
.dash-card--warning.dash-card--active {
  border-color: #eab308;
  background: linear-gradient(135deg, #fefce8, #fef3c7);
}
.dash-card--urgent.dash-card--active {
  border-color: #ea580c;
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
}
.dash-card--positive:not(.dash-card--active) { border-left-width: 4px; border-left-color: #8b5cf6; }
.dash-card--warning:not(.dash-card--active) { border-left-width: 4px; border-left-color: #eab308; }
.dash-card--urgent:not(.dash-card--active) { border-left-width: 4px; border-left-color: #ea580c; }

.dash-card-icon {
  font-size: 22px;
  line-height: 1;
  margin-bottom: 6px;
}
.dash-card-icon .icon-lg { width: 18px; height: 18px; }
.dash-card-value {
  font-size: 26px;
  font-weight: 700;
  color: #1e3a5f;
  line-height: 1.1;
  margin-bottom: 3px;
}
.dash-card--positive .dash-card-value { color: #7c3aed; }
.dash-card--warning .dash-card-value { color: #b45309; }
.dash-card--urgent .dash-card-value { color: #c2410c; }
.dash-card-label {
  font-size: 12.5px;
  font-weight: 600;
  color: #1e3a5f;
  margin-bottom: 3px;
  line-height: 1.25;
}
.dash-card-sub {
  font-size: 10.5px;
  color: #6b7280;
  line-height: 1.3;
}
.dash-card-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}
.dash-card-pills .mini-pill {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
}

/* Card Archetipi: icona/num/titolo top-left · badge absolute bottom-right */
.dash-card--archetipi { position: relative; }
.dash-card-arch-badges {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
}
.mini-pill--arch {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
  border: none;
}
.mini-pill--arch[data-arch="Ideali"] { background: #E0F2FE; color: #0369A1; }
.mini-pill--arch[data-arch="Status"] { background: #DCFCE7; color: #15803D; }
.mini-pill--arch[data-arch="Azione"] { background: #FEE2E2; color: #B91C1C; }

/* ─────── Palette unificata Archetipi (KPI · tabella · dettaglio · calendario) ─────── */
.archetipo-ideali  { background: #E0F2FE !important; color: #0369A1 !important; border-color: #BAE6FD !important; }
.archetipo-status  { background: #DCFCE7 !important; color: #15803D !important; border-color: #BBF7D0 !important; }
.archetipo-azione  { background: #FEE2E2 !important; color: #B91C1C !important; border-color: #FECACA !important; }
.archetipo-unknown { background: #f1f5f9 !important; color: #334155 !important; border-color: #e2e8f0 !important; }

/* KPI hero dettaglio lead: children ereditano il color della card (bg+color della .archetipo-*) */
.kpi-hero[class*="archetipo-"] .kpi-label,
.kpi-hero[class*="archetipo-"] .kpi-value,
.kpi-hero[class*="archetipo-"] .kpi-sub { color: inherit !important; }
.mini-pill--arch strong { font-weight: 700; margin-left: 4px; }

/* ─────────── CALL FISSATA (viola-lilla) ─────────── */
.section-call-scheduled {
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
  border-left: 4px solid #8b5cf6;
  padding: 16px 20px !important;
}

/* ─────────── SEQUENZA FOLLOW-UP (blu-viola) ─────────── */
.section-followup {
  background: linear-gradient(135deg, #eff6ff, #ede9fe);
  border-left: 4px solid #8b5cf6;
}
.followup-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.followup-item {
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  transition: box-shadow .15s ease;
}
.followup-item:hover {
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.1);
}
.followup-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.followup-oggetto {
  font-size: 14px;
  color: var(--text);
  margin: 6px 0;
  padding: 8px 12px;
  background: #f9fafb;
  border-radius: 6px;
  border-left: 3px solid #c9a961;
}
.followup-oggetto em {
  color: var(--text-muted);
  font-style: normal;
  font-size: 12px;
  margin-right: 4px;
}
.followup-preview {
  margin-top: 8px;
}
.followup-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.followup-badge--sent {
  background: #dcfce7;
  color: #14532d;
  border: 1px solid #10b981;
}
.followup-badge--scheduled {
  background: #ede9fe;
  color: #5b21b6;
  border: 1px solid #8b5cf6;
}
.followup-badge--error {
  background: #fee2e2;
  color: #7f1d1d;
  border: 1px solid #ef4444;
}
.followup-badge--blocked,
.followup-badge--skipped_wedding {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #94a3b8;
}
.followup-item--sent {
  opacity: 0.85;
}
.followup-item--blocked,
.followup-item--skipped_wedding {
  opacity: 0.7;
}
.followup-cold-note {
  margin-top: 14px;
  padding: 10px 14px;
  background: #f1f5f9;
  border-radius: 8px;
  border-left: 3px solid #64748b;
  color: #334155;
  font-size: 13px;
}

/* ═══════════════════════════════════════════════════════════════
   CALENDARIO MODERNO — LAYOUT SPLIT 40/60 (blu/grigio)
   ═══════════════════════════════════════════════════════════════ */

.cal-split {
  display: grid;
  grid-template-columns: 40% 60%;
  gap: 20px;
  margin-top: 20px;
  align-items: start;
}
@media (max-width: 900px) {
  .cal-split { grid-template-columns: 1fr; }
}

.cal-panel {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}

/* ─── Calendario a sinistra ─── */
.cal-nav-modern {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f1f5f9;
}
.cal-nav-arrow {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #f1f5f9;
  color: #475569;
  text-decoration: none;
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
  transition: all .15s ease;
}
.cal-nav-arrow:hover {
  background: #e0e7ff;
  color: #1e3a8a;
  transform: scale(1.05);
}
.cal-nav-title {
  text-align: center;
  flex: 1;
}
.cal-nav-title h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #1e3a5f;
  text-transform: capitalize;
  letter-spacing: -0.3px;
}
.cal-nav-title span {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 500;
  letter-spacing: 1px;
}

.cal-grid-modern {
  width: 100%;
  border-collapse: separate;
  border-spacing: 4px;
  table-layout: fixed;
}
.cal-grid-modern thead th {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 0;
  text-align: center;
}
.cal-grid-modern thead th.cal-weekend { color: #cbd5e1; }

.cal-cell-modern {
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  position: relative;
  vertical-align: middle;
  text-align: center;
  transition: all .15s ease;
  font-size: 14px;
  color: #475569;
  border: 1.5px solid transparent;
}
.cal-cell-modern:hover:not(.cal-cell-empty) {
  background: #f1f5f9;
  color: #1e3a5f;
}
.cal-cell-modern.cal-cell-empty {
  cursor: default;
  background: transparent;
}
.cal-cell-modern.has-calls {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
}
.cal-cell-modern.has-calls:hover {
  background: #dbeafe;
}
.cal-cell-modern.has-videocalls {
  background: #ecfdf5;
  color: #047857;
  font-weight: 600;
}
.cal-cell-modern.has-videocalls:hover {
  background: #d1fae5;
}
.cal-cell-modern.has-mixed {
  background: linear-gradient(135deg, #eff6ff 50%, #ecfdf5 50%);
  color: #1e3a5f;
  font-weight: 600;
}
.cal-cell-modern.has-mixed:hover {
  background: linear-gradient(135deg, #dbeafe 50%, #d1fae5 50%);
}
.cal-cell-modern.is-today {
  border-color: #3b82f6;
  color: #1d4ed8;
  font-weight: 700;
}
.cal-cell-modern.is-selected {
  background: #1e3a5f;
  color: white;
  border-color: #1e3a5f;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(30, 58, 95, 0.25);
}
.cal-cell-modern.is-selected .cal-dot--call {
  background: white;
  color: #1e3a5f;
}
.cal-cell-modern.is-selected .cal-dot--videocall {
  background: white;
  color: #047857;
}

.cal-day-n {
  display: block;
  line-height: 1.1;
}
.cal-dots {
  display: inline-flex;
  gap: 3px;
  margin-top: 2px;
}
.cal-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  color: white;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}
.cal-dot--call { background: #3b82f6; }
.cal-dot--videocall { background: #10b981; }

.cal-legend {
  display: flex;
  gap: 16px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
  font-size: 11px;
  color: #94a3b8;
}
.cal-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cal-dot--sample {
  min-width: 10px;
  height: 10px;
  padding: 0;
  border-radius: 999px;
  display: inline-block;
}
.cal-dot--sample-call { background: #3b82f6; }
.cal-dot--sample-videocall { background: #10b981; }
.cal-today-sample {
  width: 14px;
  height: 14px;
  border: 1.5px solid #3b82f6;
  border-radius: 4px;
  display: inline-block;
}

/* ─── Agenda a destra ─── */
.agenda-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid #f1f5f9;
}
/* FASE 3.42 — gruppo bottoni "🚫 Blocca" + "↩ Domani" nell'header giorno */
.agenda-head-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.agenda-eyebrow {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #3b82f6;
  margin-bottom: 4px;
}
.agenda-h2 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  color: #1e3a5f;
  letter-spacing: -0.3px;
  text-transform: capitalize;
}
.agenda-meta {
  font-size: 13px;
  color: #64748b;
}

.agenda-body-container {
  min-height: 200px;
}

.calls-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.call-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: white;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: all .15s ease;
  cursor: pointer;
  overflow: hidden;
  min-width: 0;
}
.call-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.12);
  transform: translateY(-1px);
}
.call-card--videocall:hover {
  border-color: #10b981;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.14);
}
/* FASE 3.41 — Compact calendar cards: 40-50% altezza in meno */
.call-card-time {
  flex: 0 0 auto;
  min-width: 48px;
  padding: 4px 8px;
  background: linear-gradient(135deg, #1e3a5f, #1e40af);
  border-radius: 6px;
  color: white;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1;
}
.call-card--videocall .call-card-time {
  background: linear-gradient(135deg, #047857, #10b981);
}
.call-card-time-h {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1;
}
.call-card-time-label {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  opacity: 0.75;
  margin-top: 2px;
}
.call-card-body {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.call-card-row1 {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.call-card-row2 {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #64748b;
  min-width: 0;
}
.call-card-name {
  font-size: 14px;
  font-weight: 700;
  color: #1e3a5f;
  line-height: 1.2;
  text-transform: capitalize;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.call-card-badge {
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.5;
  white-space: nowrap;
}
.call-card-badge--call { background: #dbeafe; color: #1d4ed8; }
.call-card-badge--videocall { background: #d1fae5; color: #047857; }
.call-card-arch {
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  line-height: 1.5;
  white-space: nowrap;
}
.call-card-contact {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.call-card-contact:hover { text-decoration: underline; }
.call-card-arrow {
  align-self: center;
  font-size: 18px;
  color: #cbd5e1;
  font-weight: 300;
  transition: all .15s ease;
  flex-shrink: 0;
}
.call-card:hover .call-card-arrow {
  color: #3b82f6;
  transform: translateX(2px);
}

.agenda-empty {
  text-align: center;
  padding: 60px 20px;
  color: #64748b;
}
.agenda-empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.6;
}
.agenda-empty h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
  color: #475569;
}
.agenda-empty p {
  margin: 0;
  font-size: 13px;
  color: #94a3b8;
}

@media (max-width: 560px) {
  .call-card { padding: 14px; gap: 12px; }
  .call-card-time { min-width: 60px; padding: 6px 8px; }
  .call-card-time-h { font-size: 16px; }
  .call-card-name { font-size: 15px; }
}

/* ═══════════════════════════════════════════════════════════════
   FASE 3.13 — GESTIONE DISPONIBILITÀ (blocchi calendario)
   ═══════════════════════════════════════════════════════════════ */

/* Cella griglia calendario: giorni con blocchi */
.cal-cell-modern.has-blocks {
  position: relative;
}
.cal-block-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 9px;
  line-height: 1;
}
.cal-cell-modern.is-full-blocked {
  background: repeating-linear-gradient(
    45deg,
    #fef2f2,
    #fef2f2 4px,
    #fee2e2 4px,
    #fee2e2 8px
  );
  color: #dc2626;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  opacity: 0.85;
}
.cal-cell-modern.is-full-blocked:hover {
  background: repeating-linear-gradient(
    45deg,
    #fee2e2,
    #fee2e2 4px,
    #fecaca 4px,
    #fecaca 8px
  );
}
.cal-block-sample {
  width: 12px;
  height: 12px;
  display: inline-block;
  background: repeating-linear-gradient(
    45deg,
    #fef2f2,
    #fef2f2 2px,
    #fecaca 2px,
    #fecaca 4px
  );
  border-radius: 3px;
}

/* Sezione blocchi nella colonna destra — FASE 3.43 compact pill layout */
.agenda-blocks {
  margin-bottom: 14px;
  padding: 8px 10px;
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
  border-radius: 10px;
  border-left: 3px solid #ea580c;
}
/* Pill orizzontali compatti (flex-wrap per giorni con più blocchi) */
.agenda-blocks-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.agenda-block-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px 3px 8px;
  background: white;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  font-size: 12px;
  color: #9a3412;
  line-height: 1.4;
  white-space: nowrap;
}
.agenda-block-pill-time { font-weight: 600; }
.agenda-block-pill-reason { opacity: 0.75; font-style: italic; margin-left: 2px; }
.agenda-block-pill-remove {
  background: transparent;
  border: none;
  color: #c2410c;
  font-size: 13px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .12s;
}
.agenda-block-pill-remove:hover { background: #fecaca; color: #991b1b; }
/* Collapsible per >4 blocchi */
.agenda-blocks-collapsible summary.agenda-blocks-summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: #9a3412;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 4px 6px;
  list-style: none;
  user-select: none;
}
.agenda-blocks-collapsible summary::-webkit-details-marker { display: none; }
.agenda-blocks-collapsible .chevron { transition: transform .15s; display: inline-block; }
.agenda-blocks-collapsible[open] .chevron { transform: rotate(180deg); }
.agenda-blocks-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.agenda-blocks-h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #9a3412;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.agenda-blocks-empty {
  font-size: 12px;
  color: #9a3412;
  opacity: 0.7;
  font-style: italic;
}
.agenda-blocks-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.agenda-block-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: white;
  border-radius: 8px;
  border: 1px solid #fed7aa;
  font-size: 13px;
}
.agenda-block-time {
  font-weight: 600;
  color: #ea580c;
  min-width: 130px;
}
.agenda-block-reason {
  flex: 1;
  color: #64748b;
  font-style: italic;
}
.agenda-block-remove {
  background: transparent;
  border: none;
  color: #9a3412;
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
}
.agenda-block-remove:hover {
  background: #fee2e2;
  color: #dc2626;
}

/* ─── Modale Blocca disponibilità ─── */
.block-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.block-modal.is-open {
  display: flex;
}
.block-modal-box {
  background: white;
  border-radius: 16px;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}
.block-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
  border-bottom: 1px solid #fed7aa;
}
.block-modal-head h3 {
  margin: 0;
  font-size: 18px;
  color: #9a3412;
}
.block-modal-close {
  background: transparent;
  border: none;
  font-size: 20px;
  color: #64748b;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.block-modal-close:hover { background: #f1f5f9; color: #1e293b; }

.block-modal-body {
  padding: 20px 22px;
}
.block-day-label {
  font-size: 15px;
  color: #1e3a5f;
  font-weight: 600;
  margin-bottom: 14px;
  text-transform: capitalize;
}
.block-mode-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.block-mode-opt {
  flex: 1;
  padding: 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: all .15s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #475569;
  font-weight: 500;
}
.block-mode-opt:hover {
  border-color: #ea580c;
  background: #fff7ed;
}
.block-mode-opt:has(input:checked) {
  border-color: #ea580c;
  background: #fff7ed;
  color: #9a3412;
  font-weight: 600;
}
.block-mode-opt input { margin: 0; }

.block-time-row {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}
.block-time-row label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
}
.block-time-row input[type="time"] {
  padding: 8px 10px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 15px;
  color: #1e293b;
}
.block-time-row input[type="time"]:focus {
  outline: none;
  border-color: #ea580c;
}

.block-reason-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
  margin-bottom: 14px;
}
.block-reason-label input {
  padding: 9px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
}
.block-reason-label input:focus {
  outline: none;
  border-color: #ea580c;
}

.block-info {
  padding: 10px 12px;
  background: #eff6ff;
  border-radius: 8px;
  color: #1e40af;
  line-height: 1.4;
}
.block-info small { font-size: 12px; }

.block-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

/* ═══════════════════════════════════════════════════════════════
   FASE 3.18 — Mini-calendario + timeline slot (video call picker)
   ═══════════════════════════════════════════════════════════════ */

.videocall-picker {
  padding: 16px;
  background: white;
  border: 1px solid #e9d5ff;
  border-radius: 12px;
  margin-bottom: 14px;
}

.vp-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f3f4f6;
}
.vp-nav-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #f3e8ff;
  color: #7c3aed;
  border: none;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1;
  transition: all .15s;
}
.vp-nav-btn:hover {
  background: #e9d5ff;
  transform: scale(1.05);
}
.vp-cal-title {
  font-size: 15px;
  font-weight: 700;
  color: #4c1d95;
  text-transform: capitalize;
  letter-spacing: -0.2px;
}

.vp-cal-loading,
.vp-cal-error {
  text-align: center;
  padding: 30px 12px;
  color: #6b7280;
  font-size: 13px;
}
.vp-cal-error { color: #b91c1c; }

.vp-cal-head {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 6px;
}
.vp-cal-th {
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 0;
}
.vp-cal-th.vp-weekend { color: #cbd5e1; }

.vp-cal-body {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.vp-cell {
  aspect-ratio: 1 / 1;
  min-height: 38px;
  border-radius: 8px;
  background: #f9fafb;
  border: 1.5px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all .12s;
  cursor: default;
  padding: 2px;
}
.vp-cell-empty { background: transparent; }
.vp-cell-past {
  background: #f3f4f6;
  color: #d1d5db;
  cursor: not-allowed;
}
.vp-cell-blocked {
  background: repeating-linear-gradient(45deg, #fee2e2, #fee2e2 4px, #fecaca 4px, #fecaca 8px);
  color: #b91c1c;
  cursor: not-allowed;
  text-decoration: line-through;
}
.vp-cell-clickable {
  cursor: pointer;
  background: white;
  border-color: #e5e7eb;
}
.vp-cell-clickable:hover {
  background: #f5f3ff;
  border-color: #a78bfa;
  transform: scale(1.03);
}
.vp-cell-has-call { background: #eff6ff; border-color: #bfdbfe; }
.vp-cell-has-call.vp-cell-clickable:hover { background: #dbeafe; }
.vp-cell-has-meet { background: #f5f3ff; border-color: #c4b5fd; }
.vp-cell-has-meet.vp-cell-clickable:hover { background: #ede9fe; }
.vp-cell-today {
  border-color: #7c3aed !important;
  border-width: 2px;
  font-weight: 700;
  color: #4c1d95;
}
.vp-cell-selected {
  background: #7c3aed !important;
  color: white !important;
  border-color: #6d28d9 !important;
  box-shadow: 0 3px 10px rgba(124, 58, 237, 0.35);
}
.vp-cell-selected .vp-dot { background: white !important; }

.vp-cell-n {
  font-size: 13px;
  line-height: 1;
}
.vp-cell-badges {
  display: flex;
  gap: 2px;
  margin-top: 3px;
  height: 5px;
}

.vp-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 999px;
}
.vp-dot--call { background: #3b82f6; }
.vp-dot--meet { background: #7c3aed; }
.vp-dot--block { background: #ef4444; }
.vp-dot--today { background: transparent; border: 1.5px solid #7c3aed; width: 8px; height: 8px; }

.vp-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px solid #f3f4f6;
  font-size: 11px;
  color: #6b7280;
}
.vp-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* ─── Timeline slot orari (sotto il calendario, appare al click su un giorno) ─── */
.vp-slots-panel {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 2px solid #f3e8ff;
}

.vp-slots-head {
  margin-bottom: 10px;
  font-size: 13px;
  color: #4c1d95;
  text-transform: capitalize;
}
.vp-slots-head strong { color: #4c1d95; }

.vp-slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px;
}

.vp-slot {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.2;
  transition: all .12s;
}

.vp-slot-time {
  font-weight: 700;
  font-size: 13px;
}
.vp-slot-lbl {
  font-size: 10px;
  color: inherit;
  opacity: 0.85;
}

.vp-slot-free {
  background: #ecfdf5;
  border: 1.5px solid #a7f3d0;
  color: #047857;
  cursor: pointer;
}
.vp-slot-free:hover {
  background: #d1fae5;
  transform: scale(1.03);
  box-shadow: 0 3px 8px rgba(16, 185, 129, 0.2);
}

.vp-slot-busy {
  background: #f3f4f6;
  border: 1.5px solid #e5e7eb;
  color: #6b7280;
  cursor: not-allowed;
}
.vp-slot-busy-call { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.vp-slot-busy-meet { background: #f5f3ff; border-color: #c4b5fd; color: #6b21a8; }
.vp-slot-busy-block { background: #fee2e2; border-color: #fecaca; color: #b91c1c; }

.vp-slot-selected {
  background: #7c3aed !important;
  color: white !important;
  border-color: #6d28d9 !important;
  box-shadow: 0 3px 10px rgba(124, 58, 237, 0.35);
}
.vp-slot-selected .vp-slot-lbl { color: white; opacity: 0.9; }

.videocall-form-summary {
  padding: 12px 14px;
  background: #f5f3ff;
  border: 1px dashed #a78bfa;
  border-radius: 8px;
  font-size: 14px;
  color: #4c1d95;
  margin-bottom: 8px;
}

button[data-submit]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════════════
   FASE 3.17 — Pannello Video call di follow-up (viola/lilla)
   ═══════════════════════════════════════════════════════════════ */

.section-videocall {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #10b981;   /* verde emerald coerente con videocall in calendar */
  padding: 16px 20px;               /* FASE 3.24 — allinea a .section-collapsible-summary */
}

.videocall-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: white;
  border: 1px solid #e9d5ff;
  border-radius: 12px;
}

.videocall-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.videocall-row label {
  font-size: 12px;
  color: #6b21a8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.videocall-row input[type="date"],
.videocall-row input[type="time"],
.videocall-row textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  color: #1e3a5f;
  background: white;
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}

.videocall-row input:focus,
.videocall-row textarea:focus {
  outline: none;
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.videocall-row-times {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.videocall-row-times > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* FASE 3.24 — Layout compatto videocall attiva (banner single-row).
   Uniforma altezza/padding a .section-contact e .section-transcription:
   nessun box interno gonfio, bottone Meet come normale btn-sm inline. */
.videocall-active--compact {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.vc-active-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.vc-active-info { flex: 1; min-width: 200px; }
.vc-active-date {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  text-transform: capitalize;
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.vc-active-date .vc-icon {
  font-size: 15px;
  line-height: 1;
  opacity: 0.85;
  flex-shrink: 0;
}
.vc-active-date .vc-icon-clock {
  margin-left: 8px;   /* separatore visivo tra data e orario */
}
.vc-active-meta {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}
.vc-active-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.vc-active-notes {
  font-size: 12px;
  color: #475569;
  padding: 6px 10px;
  background: #f8fafc;
  border-radius: 6px;
  line-height: 1.4;
}
.vc-active-notes-lbl {
  color: #0f172a;
  font-weight: 600;
  margin-right: 4px;
}

/* Legacy classi (retro-compat con eventuali altri usi — non più renderizzate) */
.videocall-active {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (max-width: 480px) {
  .videocall-row-times {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════════════
   FASE 3.16 — Modifica inline dati cliente (form)
   ═══════════════════════════════════════════════════════════════ */

.data-edit-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0;
}

.data-edit-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  align-items: center;
}

.data-edit-row label {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}

.data-edit-row input,
.data-edit-row select {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  color: #1e3a5f;
  background: white;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.data-edit-row input:focus,
.data-edit-row select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.data-edit-actions {
  display: flex;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px dashed #e2e8f0;
  margin-top: 6px;
}

@media (max-width: 480px) {
  .data-edit-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .data-edit-row label { font-size: 12px; }
}

/* ═══════════════════════════════════════════════════════════════
   FASE 3.15 — Pannello Trascrizione call (giallo/oro)
   ═══════════════════════════════════════════════════════════════ */

.section-transcription {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #6366f1;   /* indigo per "input file / AI" */
}

.transcription-upload {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding: 14px;
  background: white;
  border: 1.5px dashed #ca8a04;
  border-radius: 10px;
}

.transcription-file-input {
  flex: 1;
  min-width: 200px;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f9fafb;
  font-size: 14px;
  cursor: pointer;
}
.transcription-file-input::-webkit-file-upload-button {
  padding: 6px 12px;
  margin-right: 10px;
  background: #ca8a04;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}
.transcription-file-input::file-selector-button {
  padding: 6px 12px;
  margin-right: 10px;
  background: #ca8a04;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}
.transcription-file-input--sm {
  padding: 4px 8px;
  font-size: 12px;
  min-width: 150px;
}

.transcription-loaded {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.transcription-meta {
  padding: 10px 14px;
  background: white;
  border-radius: 8px;
  border: 1px solid #fef3c7;
}

.transcription-summary,
.transcription-changes {
  padding: 14px 16px;
  background: white;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.transcription-summary-head,
.transcription-changes-head {
  font-size: 13px;
  font-weight: 700;
  color: #713f12;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.transcription-summary-body {
  color: #422006;
  font-size: 14px;
  line-height: 1.5;
}

.transcription-changes-list {
  margin: 0;
  padding-left: 22px;
  color: #422006;
  font-size: 14px;
  line-height: 1.6;
}
.transcription-changes-list li {
  margin-bottom: 4px;
}

.transcription-fulltext {
  background: white;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 12px 16px;
}
.transcription-fulltext summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #713f12;
  user-select: none;
}
.transcription-fulltext summary:hover {
  color: #422006;
}
.transcription-pre {
  margin: 12px 0 0;
  padding: 12px;
  background: #fefce8;
  border-radius: 6px;
  border: 1px solid #fef3c7;
  color: #422006;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 400px;
  overflow-y: auto;
  font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

.transcription-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px dashed #fef3c7;
}

/* ═══════════════════════════════════════════════════════════════
   FASE 3.21 — MODALE OVERLAY prenotazione videocall
   ═══════════════════════════════════════════════════════════════ */
.vc-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;                    /* JS aggiunge .is-open per attivare */
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: vc-fade-in .18s ease-out;
}
.vc-modal.is-open {
  display: flex;
}
@keyframes vc-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.vc-modal-panel {
  width: 100%;
  max-width: 960px;                 /* FASE 3.22 — largo per accogliere split 2 colonne */
  height: min(85vh, 720px);         /* altezza esplicita: propaga a body/split via flex chain */
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 25px 60px -12px rgba(15, 23, 42, 0.35), 0 8px 24px rgba(15, 23, 42, 0.12);
  overflow: hidden;                 /* container non scrolla; scrollano i child mirati */
  display: flex;
  flex-direction: column;           /* head fisso + body flex-1 */
  animation: vc-slide-up .22s ease-out;
  margin: auto 0;
}
@keyframes vc-slide-up {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.vc-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 26px 16px;
  border-bottom: 1px solid #e2e8f0;
}
.vc-modal-eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #4f46e5;
  margin-bottom: 4px;
}
.vc-modal-title {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
}
.vc-modal-sub {
  margin: 0;
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
  max-width: 520px;
}
.vc-modal-sub em {
  color: #475569;
  font-style: italic;
}
.vc-modal-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .12s ease;
}
.vc-modal-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.vc-modal-body {
  padding: 18px 22px 20px;
  flex: 1;
  min-height: 0;                    /* consente al flex child di rispettare max-height del parent */
  overflow: hidden;                 /* niente scroll globale, solo aree specifiche scrollano */
  display: flex;                    /* CRITICO: rende il body un flex container per lo split */
  flex-direction: column;
}

/* ─── FASE 3.22 — Split 2 colonne dentro modale (flex per rispettare max-height) ─── */
.vc-modal-split {
  display: flex;
  flex-direction: row;
  gap: 20px;
  flex: 1;                          /* riempie il body flex-column, non usa height:% */
  min-height: 0;                    /* consente ai child SX/DX di avere overflow effettivo */
  overflow: hidden;                 /* impedisce ai child di espandere il container */
}
.vc-split-left {
  flex: 1.25 1 0;
  min-height: 0;
  min-width: 0;
  max-height: 100%;                 /* vincola all'altezza del flex parent */
  display: flex;
  flex-direction: column;
  overflow-y: auto;                 /* scroll interno se calendario+slot eccedono */
  padding-right: 4px;
}
.vc-split-right {
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.vc-split-left::-webkit-scrollbar,
.vc-split-right::-webkit-scrollbar { width: 5px; }
.vc-split-left::-webkit-scrollbar-thumb,
.vc-split-right::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
@media (max-width: 780px) {
  .vc-modal-panel { max-height: 92vh; }
  .vc-modal-split { grid-template-columns: 1fr; gap: 14px; overflow-y: auto; }
}

/* ─── Compattamento calendario dentro modale ─── */
.vc-split-left .videocall-picker {
  margin-bottom: 0;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  /* height:auto — non forzare 100% qui: altrimenti compete col flex parent e cresce */
}
.vc-split-left .vp-cal-nav {
  margin-bottom: 8px;
  padding-bottom: 6px;
}
.vc-split-left .vp-cal-title { font-size: 14px; }
.vc-split-left .vp-cal-th { font-size: 9px; padding: 3px 0; }
.vc-split-left .vp-cell {
  min-height: 30px;
  border-radius: 6px;
  padding: 1px;
  border-width: 1px;
}
.vc-split-left .vp-cell-n { font-size: 11px; }
.vc-split-left .vp-cell-badges { height: 4px; margin-top: 2px; }
.vc-split-left .vp-dot { width: 4px; height: 4px; }
.vc-split-left .vp-legend {
  padding-top: 6px;
  margin-top: 6px;
  gap: 8px;
  font-size: 10px;
}

/* ─── Slot area scrollabile (solo i chips scrollano) ─── */
.vc-split-left .vp-slots-panel {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #f3e8ff;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex-shrink: 0;
}
.vc-split-left .vp-slots-head {
  margin-bottom: 6px;
  font-size: 12px;
}
.vp-slots-grid--compact {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  max-height: 140px;                /* FASE 3.22 — vincolo scroll interno */
  overflow-y: auto;
  padding-right: 4px;               /* margine per scrollbar */
}
.vp-slots-grid--compact::-webkit-scrollbar { width: 5px; }
.vp-slots-grid--compact::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.vp-slots-grid--compact .vp-slot {
  padding: 5px 7px;
  font-size: 11px;
  border-radius: 6px;
  border-width: 1px;
}
.vp-slots-grid--compact .vp-slot-time { font-size: 11px; }
.vp-slots-grid--compact .vp-slot-lbl { font-size: 9px; }

/* ─── Form destra compatta ─── */
.videocall-form--modal {
  gap: 10px;
  padding: 14px 16px;
  height: 100%;
  overflow-y: auto;                 /* fallback se il contenuto crescesse */
}
.videocall-row--compact { gap: 4px; }
.videocall-row--compact label {
  font-size: 11px;
  letter-spacing: 0.3px;
}
.videocall-row--compact input,
.videocall-row--compact select,
.videocall-row--compact textarea {
  font-size: 13px;
  padding: 7px 9px;
}
.videocall-row--compact textarea {
  min-height: 52px;
  resize: vertical;
}
.videocall-row-hint {
  font-size: 10px;
  color: #6b7280;
  margin-top: 3px;
}
.videocall-form--modal .videocall-form-summary {
  padding: 9px 12px;
  font-size: 12px;
  line-height: 1.35;
  margin-bottom: 4px;
}
.vc-modal-footer--split {
  margin-top: auto;                 /* footer ancorato in fondo alla colonna */
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
}
.vc-modal-hint {
  font-size: 10px;
  margin: 6px 0 0;
  text-align: right;
  color: #94a3b8;
}

.vc-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
}

@media (max-width: 640px) {
  .vc-modal { padding: 20px 12px; }
  .vc-modal-head { padding: 18px 20px 14px; }
  .vc-modal-body { padding: 16px 20px 20px; }
  .vc-modal-title { font-size: 18px; }
}

/* Blocca scroll body quando modale aperta */
body.vc-modal-open {
  overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════════
   FASE 3.29 — Sistema badge/pill unificato: capsule traslucide micro-caps
   Applicato in fondo per override dei modifier .badge/.mini-pill/.contact-badge/.chip
   ═══════════════════════════════════════════════════════════════ */
.badge,
.mini-pill,
.contact-badge,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  line-height: 1.4;
  border: 1px solid transparent;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════
   FASE 3.32 — 5a card: Provenienza Lead (donut SVG native) — layout verticale compatto
   Uniforma altezza/padding/bordo alle 4 card KPI adiacenti nella riga a 5 colonne
   ═══════════════════════════════════════════════════════════════ */
.dash-card--chart {
  cursor: default;
  padding: 22px 20px;      /* stesso padding delle altre .dash-card */
  min-height: 160px;       /* stessa altezza minima delle altre */
  display: flex;
  flex-direction: column;
}
.dash-card--chart:hover {
  transform: none;
  border-color: var(--border);
  box-shadow: 0 4px 20px rgba(0,0,0,0.02);
}
.dash-card--chart .dash-card-label { margin-bottom: 8px; }

/* Layout donut + legenda VERTICALE (compatto per larghezza card ridotta 1/5) */
.chart-donut-compact {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-height: 0;
}
.chart-donut {
  width: 70px;
  height: 70px;
  flex-shrink: 0;
  transform: rotate(-90deg);
}
.donut-center-n {
  font-family: var(--font-serif);
  font-size: 8px;
  font-weight: 700;
  fill: var(--charcoal);
  transform: rotate(90deg);
  transform-origin: 21px 21px;
}
.donut-center-lbl {
  font-family: var(--font-sans);
  font-size: 3px;
  fill: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transform: rotate(90deg);
  transform-origin: 21px 21px;
}
.chart-legend {
  list-style: none;
  padding: 0;
  margin: 0;
}
.chart-legend--compact {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  font-size: 9px;
  max-height: 48px;
  overflow: hidden;
}
.chart-legend--compact li {
  display: grid;
  grid-template-columns: 6px minmax(0,1fr) auto;
  gap: 4px;
  align-items: center;
  font-family: var(--font-sans);
  color: var(--text);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chart-legend--compact li > span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
}
.chart-legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 2px;
}
.chart-legend-lbl {
  color: var(--charcoal);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chart-legend-val {
  color: var(--text-muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════════════════════════════
   FASE 3.34 — Table controls: barra ricerca + filtri + sort + paginazione
   ═══════════════════════════════════════════════════════════════ */
.table-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px 14px;
  margin: 0 0 12px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.02);
}
.table-controls-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 240px;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color .12s;
}
.table-controls-search:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(197, 160, 89, 0.15);
}
.table-controls-search input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--charcoal);
}
.table-controls-search input::placeholder { color: var(--text-light); }

.table-controls-select {
  padding: 8px 12px;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--charcoal);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  min-width: 180px;
  transition: border-color .12s;
}
.table-controls-select:hover { border-color: var(--gold); }
.table-controls-select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(197, 160, 89, 0.15);
}

.table-controls-clear {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-muted);
  background: transparent;
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  cursor: pointer;
  transition: all .12s;
}
.table-controls-clear:hover {
  color: var(--charcoal);
  border-color: var(--charcoal);
  background: rgba(22, 21, 20, 0.03);
}

/* Sort indicators nei <th> cliccabili */
.table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color .12s, background .12s;
  padding-right: 20px;
  position: relative;
}
.table th.sortable:hover { color: var(--gold); background: rgba(197, 160, 89, 0.04); }
.table th.sortable .sort-arrow {
  display: inline-block;
  margin-left: 4px;
  font-size: 9px;
  opacity: 0.3;
}
.table th.sortable .sort-arrow::before { content: '↕'; }
.table th.sortable.sort-asc  .sort-arrow { opacity: 1; color: var(--gold); }
.table th.sortable.sort-asc  .sort-arrow::before { content: '↑'; }
.table th.sortable.sort-desc .sort-arrow { opacity: 1; color: var(--gold); }
.table th.sortable.sort-desc .sort-arrow::before { content: '↓'; }

/* Paginazione footer */
.table-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 4px 4px;
  gap: 12px;
  flex-wrap: wrap;
}
.pagination-info {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.pagination-controls {
  display: flex;
  gap: 8px;
}
.pagination-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 14px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--charcoal);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all .12s;
}
.pagination-btn:not(:disabled):hover {
  border-color: var(--gold);
  color: var(--gold);
}
.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════════════
   FASE 3.33 — Tooltip Rischio (luxury: charcoal bg + bordo champagne)
   ═══════════════════════════════════════════════════════════════ */
.has-risk-tooltip {
  cursor: help;
  outline: none;
  transition: transform .12s ease;
}
.has-risk-tooltip:hover,
.has-risk-tooltip:focus-visible {
  transform: scale(1.05);
  box-shadow: 0 0 0 2px var(--gold);
}

.risk-tooltip {
  position: absolute;
  z-index: 1200;
  display: none;
  max-width: 320px;
  min-width: 260px;
  padding: 14px 16px;
  background: var(--charcoal);
  color: #FAF9F5;
  border: 1px solid var(--gold);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.35), 0 4px 10px rgba(0,0,0,0.15);
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.45;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .14s ease, transform .14s ease;
}
.risk-tooltip.is-open {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* FASE 3.36 — Modifier per tooltip KPI card dettaglio lead: sempre apre in basso
   (top-full mt-2 pattern) con altezza vincolata + scroll interno per contenuti lunghi.
   Evita che leve StoryBrand / motivi rischio lunghi facciano superare la card. */
.risk-tooltip--kpi {
  max-height: 320px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--gold) transparent;
  /* FASE 3.37 — Abilita interazione mouse: consente scroll interno + hover senza chiusura */
  pointer-events: auto;
}
.risk-tooltip--kpi::-webkit-scrollbar { width: 5px; }
.risk-tooltip--kpi::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 3px; }

.risk-tooltip-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(197, 160, 89, 0.25);
}
.risk-tooltip-icon {
  color: var(--gold);
  flex-shrink: 0;
  padding-top: 2px;
}
.risk-tooltip-icon .icon-inline { stroke: var(--gold); width: 18px; height: 18px; }
.risk-tooltip-title {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.2;
}
.risk-tooltip-sub {
  font-size: 10px;
  color: rgba(250, 249, 245, 0.55);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-top: 2px;
}

.risk-tooltip-section { margin-top: 8px; }
.risk-tooltip-section:first-of-type { margin-top: 0; }
.risk-tooltip-lbl {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 600;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
}
.risk-tooltip-lbl .icon-inline {
  width: 12px; height: 12px;
  stroke: var(--gold);
}
.risk-tooltip-txt {
  font-size: 12px;
  color: #FAF9F5;
  line-height: 1.5;
}
.risk-tooltip-suggest {
  background: rgba(197, 160, 89, 0.08);
  border-left: 2px solid var(--gold);
  padding: 8px 10px;
  border-radius: 4px;
  margin-top: 10px;
}

/* ═══════════════════════════════════════════════════════════════
   FASE 3.30 — Lucide icons: dimensioni + tinta
   ═══════════════════════════════════════════════════════════════ */
.icon-inline { width: 16px; height: 16px; vertical-align: -3px; stroke-width: 1.75; }
.icon-lg     { width: 22px; height: 22px; stroke-width: 1.5; }
.icon-gold     { color: var(--gold);     stroke: var(--gold); }
.icon-charcoal { color: var(--charcoal); stroke: var(--charcoal); }
/* Placeholder <i data-lucide> prima del rendering: evita salti layout */
i[data-lucide] { display: inline-block; width: 1em; height: 1em; }

/* Converte i background inline (Jinja `style="background:#xxx;color:#yyy"`)
   in versioni traslucide + bordo semi-current — nessun cambio ai template Jinja */
.badge[style*="background"],
.mini-pill[style*="background"],
.chip[style*="background"] {
  background-color: color-mix(in srgb, currentColor 12%, transparent) !important;
  border-color: color-mix(in srgb, currentColor 25%, transparent);
}

/* ═══════════════════════════════════════════════════════════════════
   FASE 3.63 — RESPONSIVE UNIVERSALE (Desktop / Tablet / Smartphone)
   ═══════════════════════════════════════════════════════════════════
   Aggiunge SOLO regole media query — zero override sulle regole desktop
   esistenti. Layout ≥ 1200px invariato (comportamento attuale).
   Q1:B (bottom nav globale + 4 pagine ottimizzate) · Q2:B (hamburger 5° tab
   con menu overflow Logout) · Q3:A (tabelle→card via data-label CSS-only) ·
   Q4:A (modali fullscreen mobile). */

/* ── TABLET (max-width: 1199px) ── */
@media (max-width: 1199px) {
  .btn { min-height: 44px; padding: 10px 16px; }
  .btn-sm { min-height: 38px; padding: 8px 12px; }
  .lead-table th, .lead-table td,
  .ctr-table th, .ctr-table td { padding: 12px 10px; }
}

/* Bottom nav SEMPRE nascosto su desktop */
.bottom-nav, .bottom-nav-menu-overlay { display: none; }

/* ══ SMARTPHONE (max-width: 768px) ══ */
@media (max-width: 768px) {
  body { padding-bottom: 68px; }
  .topbar .nav { display: none !important; }
  .topbar { padding: 10px 14px; }
  .brand-name { font-size: 15px; }
  .brand-name .brand-accent { display: none; }
  .container { padding: 12px 14px; }

  /* Bottom Navigation */
  .bottom-nav {
    display: flex;
    position: fixed; bottom: 0; left: 0; right: 0;
    height: 60px;
    background: #FFFFFF;
    border-top: 1px solid #EAE7E1;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
    justify-content: space-around; align-items: stretch;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .bottom-nav-item {
    flex: 1;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 3px; padding: 6px 4px;
    text-decoration: none; color: #64748b;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 10px; font-weight: 600; letter-spacing: 0.3px;
    position: relative; min-height: 48px;
    transition: color 0.15s ease;
    background: none; border: 0; cursor: pointer;
  }
  .bottom-nav-item:active, .bottom-nav-item.is-active { color: #B89758; }
  .bottom-nav-item.is-active::before {
    content: ''; position: absolute;
    top: 0; left: 25%; right: 25%; height: 2px;
    background: #B89758; border-radius: 0 0 2px 2px;
  }
  .bottom-nav-item svg { width: 22px; height: 22px; stroke-width: 1.5; }
  .bottom-nav-item .bn-badge {
    position: absolute; top: 4px; right: calc(50% - 20px);
    min-width: 18px; height: 18px; padding: 0 5px;
    background: #B89758; color: #FFFFFF;
    border-radius: 999px;
    font-size: 10px; font-weight: 700; line-height: 18px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(184,151,88,0.4);
  }

  /* Hamburger overlay */
  .bottom-nav-menu-overlay {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(15,23,42,0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    justify-content: center; align-items: flex-end;
  }
  .bottom-nav-menu-overlay.is-open { display: flex; }
  .bottom-nav-menu-panel {
    width: 100%;
    background: #FFFFFF;
    border-top-left-radius: 20px; border-top-right-radius: 20px;
    padding: 24px 20px calc(20px + env(safe-area-inset-bottom, 0));
    animation: bn-menu-slide-up 0.25s ease-out;
  }
  @keyframes bn-menu-slide-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
  .bottom-nav-menu-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px;
    color: #666; font-weight: 600; margin-bottom: 12px;
  }
  .bottom-nav-menu-item {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 12px;
    text-decoration: none; color: #1E1E1E;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px; font-weight: 500;
    border-bottom: 1px solid #F1EFEA;
    min-height: 48px;
  }
  .bottom-nav-menu-item:last-child { border-bottom: none; }
  .bottom-nav-menu-item svg { width: 20px; height: 20px; color: #666; }

  /* Dashboard: KPI 1 colonna */
  .dash-cards, .dash-cards--v2, .dash-cards--luxury {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }
  .lx-card--big { grid-column: auto; min-height: auto; }
  .lx-big-body { flex-direction: column; gap: 12px; align-items: flex-start; }
  .lx-big-value { font-size: 52px; }

  .table-controls, .ctr-filters, .cl-view-toggle {
    flex-direction: column; align-items: stretch;
  }
  .table-controls > *, .cl-view-toggle { width: 100%; }

  /* Tabelle → Card (Q3:A) */
  .lead-table thead, .ctr-table thead { display: none; }
  .lead-table, .lead-table tbody, .lead-table tr, .lead-table td,
  .ctr-table, .ctr-table tbody, .ctr-table tr, .ctr-table td {
    display: block; width: 100%; box-sizing: border-box;
  }
  .lead-table tr, .ctr-table tr {
    background: #FFFFFF; border: 1px solid #EAE7E1; border-radius: 10px;
    padding: 12px 14px; margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
  }
  .lead-table td, .ctr-table td {
    padding: 6px 0; border: none; text-align: left;
    display: flex; justify-content: space-between; align-items: baseline;
    gap: 12px; min-height: 32px;
  }
  .lead-table td[data-label]::before,
  .ctr-table td[data-label]::before {
    content: attr(data-label);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 10px; text-transform: uppercase; letter-spacing: 0.8px;
    color: #666; font-weight: 600; flex-shrink: 0;
  }
  .ctr-table-wrap { overflow-x: visible; }

  /* Blocchi Danilo */
  .cl-card { padding: 14px; }
  .cl-card-actions { flex-direction: column; align-items: stretch; }
  .cl-card-actions .btn { width: 100%; }
  .cl-card-actions form { width: 100%; }

  /* Modali fullscreen (Q4:A) */
  .modal-mobile-fullscreen,
  .vc-modal-panel, .vc-modal.is-open .vc-modal-panel {
    width: 100vw !important; max-width: 100vw !important;
    height: 100vh !important; max-height: 100vh !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }
  .vc-modal { padding: 0 !important; }
  .vc-modal-body { padding: 16px !important; }
  .vc-modal-split { flex-direction: column !important; height: auto !important; }
  .vc-modal-split > * { width: 100% !important; max-height: none !important; }

  /* Touch targets 48px min (Q4:A) */
  .btn, button.btn, a.btn { min-height: 48px; padding: 12px 18px; }
  .btn-sm { min-height: 42px; padding: 10px 14px; }
  .btn-primary { font-size: 15px; }

  input[type="text"], input[type="email"], input[type="tel"],
  input[type="date"], input[type="time"], input[type="number"],
  select, textarea { min-height: 48px; font-size: 16px; }

  .kpi-value { font-size: 28px !important; }
  .lx-value { font-size: 44px !important; }
  .alert-capienza-box, .alert-analysis-failed { padding: 12px 14px; }
  .section { padding: 14px; }

  .cal-split { grid-template-columns: 1fr !important; }
  .cal-split-left, .cal-split-right { width: 100% !important; }
  .cal-cell-modern { font-size: 11px; }

  .page-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .page-head-actions { width: 100%; flex-wrap: wrap; }
}

@media (max-width: 768px) { .lead-table td.td-arrow { display: none; } }

/* ═══════════════════════════════════════════════════════════════════════════════
   FASE 3.70 — Fix mobile mirato (Android portrait 9:16, no scroll orizzontale)
   Desktop invariato. Aggiungo safety net contro overflow orizzontale + wrap
   wide-content che potrebbero sforare in mobile.
   ═══════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  /* Safety net: nessun scroll orizzontale sul body/html */
  html, body {
    overflow-x: hidden !important;
    max-width: 100%;
    width: 100%;
  }

  /* Il main wrapper non deve mai sforare */
  main.container, main.main, .container {
    max-width: 100vw;
    overflow-x: hidden;
    padding-left: 12px;
    padding-right: 12px;
    box-sizing: border-box;
  }

  /* Elementi media/wide-content: max 100% del parent */
  img, video, iframe, svg, picture, canvas {
    max-width: 100%;
    height: auto;
  }

  /* Code/pre lunghi: scroll interno (no push del layout) */
  pre, code {
    max-width: 100%;
    overflow-x: auto;
    word-wrap: break-word;
    white-space: pre-wrap;
  }

  /* Tabelle wide: scroll interno se non già trattate come card */
  .table-wrap, .ctr-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Titolo/subtitolo pagina: non sfora orizzontalmente */
  .page-title, .page-sub {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: anywhere;
  }

  /* Input/textarea: mai più larghi del container */
  input, textarea, select, button {
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Card generiche */
  .section, .card, .dash-card, .lead-workspace,
  .lead-content, .lead-sidebar {
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Grid asimmetrici → single column (evita elementi che sforano) */
  .lead-workspace {
    grid-template-columns: 1fr !important;
  }

  /* Fix specifico chip lunghe (parole chiave, artisti) */
  .chip, .chip-artist, .chip-keyword, .mini-pill {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: anywhere;
  }

  /* Section-collapsible summary: non deve sforare quando riassume dati lunghi */
  .section-collapsible-summary {
    flex-wrap: wrap;
  }
}

