/* ── RESET & BASE ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --gold:        #B8975A;
  --gold-light:  #D4B67A;
  --gold-pale:   #F5EDD8;
  --gold-dark:   #7A5F2A;
  --navy:        #0E1A2B;
  --navy-mid:    #1A2D45;
  --navy-light:  #243D5C;
  --cream:       #FAF7F2;
  --white:       #FFFFFF;
  --gray-100:    #F4F3F0;
  --gray-200:    #E8E6E1;
  --gray-400:    #B0ADA6;
  --gray-600:    #6B6860;
  --gray-800:    #2C2B29;
  --text:        #1A1917;
  --text-mid:    #5C5A56;
  --text-light:  #9A9892;
  --blue:        #4A90B8;
  --green:       #6DB87A;
  --red:         #C94040;
  --amber:       #D4890A;
  --border:      rgba(26,25,23,0.10);
  --border-mid:  rgba(26,25,23,0.18);
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   16px;
  --radius-xl:   22px;
  --shadow-sm:   0 1px 4px rgba(0,0,0,0.06);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.08);
}

html { scroll-behavior: smooth; }

.pb-percorso-container, .pb-percorso-container * {}
.pb-percorso-container body-override {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
}

/* ── TOPBAR ───────────────────────────────────────────────── */
.topbar {
  background: var(--navy);
  padding: 0 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-brand {
  display: flex; align-items: center; gap: 12px;
}
.topbar-logo {
  width: 32px; height: 32px;
  background: var(--gold);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px; font-weight: 600;
  color: var(--navy);
}
.topbar-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px; font-weight: 500;
  color: var(--white);
  letter-spacing: 0.02em;
}
.topbar-name span { color: var(--gold-light); }
.topbar-right {
  display: flex; align-items: center; gap: 1rem;
}
.topbar-user {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: rgba(255,255,255,0.7);
}
.topbar-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--gold-pale);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 500;
  color: var(--gold-dark);
}

/* ── LAYOUT ───────────────────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 60px);
}

/* ── SIDEBAR ──────────────────────────────────────────────── */
.sidebar {
  background: var(--white);
  border-right: 1px solid var(--border);
  padding: 2rem 0;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
}
.sidebar-section-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-light);
  font-weight: 500;
  padding: 0 1.5rem;
  margin: 1.5rem 0 0.5rem;
}
.sidebar-section-label:first-child { margin-top: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 1.5rem;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-size: 14px;
  color: var(--text-mid);
  border-left: 2px solid transparent;
  transition: all 0.15s;
  font-family: 'DM Sans', sans-serif;
}
.nav-item:hover { background: var(--gray-100); color: var(--text); }
.nav-item.active {
  background: var(--gold-pale);
  color: var(--gold-dark);
  border-left-color: var(--gold);
  font-weight: 500;
}
.nav-step {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--gray-100);
  border: 1px solid var(--border-mid);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 500;
  color: var(--text-light);
  flex-shrink: 0;
}
.nav-item.active .nav-step {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--white);
}
.nav-item.done .nav-step {
  background: #EAF5EE;
  border-color: #6DB87A;
  color: #3D7A49;
}
.nav-item.done { color: var(--text-mid); }

.sidebar-progress {
  padding: 1.5rem;
  margin-top: 1rem;
  border-top: 1px solid var(--border);
}
.sidebar-progress-label {
  font-size: 12px; color: var(--text-light);
  margin-bottom: 8px;
  display: flex; justify-content: space-between;
}
.progress-track {
  height: 4px;
  background: var(--gray-200);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* ── MAIN CONTENT ─────────────────────────────────────────── */
.main {
  padding: 2.5rem;
  max-width: 1100px !important;
  width: 100% !important;
  box-sizing: border-box;
}

.section { display: none; }
.section.active { display: block; }

.section-header { margin-bottom: 2rem; }
.section-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
  margin-bottom: 6px;
}
.section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 30px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 8px;
}
.section-desc {
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.7;
  max-width: 620px;
}

/* ── FORMS ────────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
.form-group { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.form-group.full { grid-column: 1 / -1; }

.form-label {
  font-size: 11px;
  color: var(--text-mid);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.form-group input,
.form-group select,
.form-group textarea {
  border: 1px solid var(--border-mid) !important;
  border-radius: var(--radius-md) !important;
  background: var(--white);
  padding: 0 14px !important;
  font-size: 14px;
  color: var(--text);
  outline: none;
  font-family: 'DM Sans', sans-serif;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  box-sizing: border-box;
}
.form-group input,
.form-group select {
  height: 42px;
}
.form-group textarea {
  min-height: 90px;
  padding-top: 10px !important;
  padding-bottom: 10px !important;
  line-height: 1.6;
  resize: vertical;
}
.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239A9892' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(184,151,90,0.12);
}

.subsection-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin: 2rem 0 1rem;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.subsection-title i { color: var(--gold); font-size: 16px; }

/* ── CARDS ────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

/* ── PATRIMONIO ───────────────────────────────────────────── */
.patrimonio-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
.pat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.pat-card:hover { border-color: var(--gold-light); box-shadow: var(--shadow-md); }
.pat-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.pat-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  background: var(--gold-pale);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold);
  font-size: 20px;
  flex-shrink: 0;
}
.pat-card-title { font-size: 15px; font-weight: 500; color: var(--text); }
.pat-card-desc { font-size: 13px; color: var(--text-mid); line-height: 1.6; margin-bottom: 14px; }
.pat-input-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.pat-input-row input {
  flex: 1; height: 38px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-md);
  background: var(--gray-100);
  padding: 0 12px;
  font-size: 13px;
  color: var(--text);
  outline: none;
  font-family: 'DM Sans', sans-serif;
}
.pat-input-row input:focus { border-color: var(--gold); background: var(--white); }
.pat-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500;
  color: var(--gold-dark);
  padding: 7px 14px;
  border: 1px solid var(--gold);
  border-radius: var(--radius-md);
  background: var(--gold-pale);
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
}
.pat-link:hover { background: #ecdfc4; }

/* ── ESIGENZE ─────────────────────────────────────────────── */
.esigenze-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
/* ── ESIGENZA CARD — restyling completo ───────────────────── */
.esigenze-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.esigenza-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem 1.25rem 1.25rem;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s, transform 0.12s;
  text-align: left;
  position: relative;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  user-select: none;
}
.esigenza-card:hover {
  border-color: #EFB052;
  background: #FFFBF2;
  box-shadow: 0 4px 16px rgba(239,176,82,0.14);
  transform: translateY(-2px);
}
.esigenza-card.selected {
  border-color: #EFB052;
  background: #FDF5E0;
  box-shadow: 0 4px 16px rgba(239,176,82,0.18);
}
.esigenza-card:active { transform: translateY(0); box-shadow: none; }
.esigenza-icon {
  font-size: 26px;
  color: #EFB052;
  margin-bottom: 12px;
  display: block;
}
.esigenza-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.3;
}
.esigenza-desc { font-size: 12px; color: var(--text-mid); line-height: 1.55; }
.rank-badge {
  position: absolute;
  top: 10px; right: 10px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #EFB052;
  color: #fff;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(239,176,82,0.45);
  z-index: 2;
  line-height: 1;
}
.esigenze-hint {
  font-size: 12px; color: var(--text-mid);
  background: var(--gray-100);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 1rem;
  display: flex; align-items: center; gap: 8px;
}
.esigenze-hint i { color: var(--gold); font-size: 15px; flex-shrink: 0; }
.esigenze-ranked { margin-top: 1rem; }
.esigenze-ranked-title {
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--text-light); margin-bottom: 8px;
}
.rank-list { display: flex; flex-direction: column; gap: 6px; }
.rank-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 13px;
}
.rank-item-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 500; flex-shrink: 0;
}
.rank-item-icon { font-size: 15px; color: var(--gold); }
.rank-item-name { flex: 1; font-weight: 500; }
.rank-item-remove {
  font-size: 14px; color: var(--text-light);
  cursor: pointer; border: none; background: none;
  padding: 2px 4px; border-radius: 4px;
  transition: color 0.15s;
  line-height: 1;
}
.rank-item-remove:hover { color: var(--red); }

/* ── CASSETTI ─────────────────────────────────────────────── */
.cassetti { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
.cassetto {
  min-width: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.cassetto-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.cassetto-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.cassetto-name { font-size: 15px; font-weight: 500; color: var(--text); }
.cassetto-desc { font-size: 12px; color: var(--text-mid); line-height: 1.6; margin-bottom: 14px; }
.cassetto-input-wrap { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cassetto-pct {
  flex: 1; height: 40px;
  min-width: 0;
  width: 0;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-md);
  background: var(--gray-100);
  padding: 0 12px;
  font-size: 18px; font-weight: 500;
  color: var(--text);
  text-align: right;
  font-family: 'DM Sans', sans-serif;
  outline: none;
}
.cassetto-pct:focus { border-color: var(--gold); background: var(--white); }
.pct-sym { font-size: 18px; font-weight: 500; color: var(--text-mid); }

.sicurezza .cassetto-dot { background: var(--blue); }
.reddito   .cassetto-dot { background: var(--gold); }
.crescita  .cassetto-dot { background: var(--green); }

.totale-bar {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem;
  font-size: 14px;
}
.totale-val { font-weight: 500; font-size: 16px; }
.totale-val.ok  { color: #3D7A49; }
.totale-val.err { color: var(--red); }

.economia-box {
  background: var(--gray-100);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-top: 1rem;
  display: none;
}
.economia-box-title { font-size: 13px; font-weight: 500; margin-bottom: 8px; }
.economia-box p { font-size: 13px; color: var(--text-mid); line-height: 1.7; margin-bottom: 12px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 11px; padding: 4px 10px;
  border-radius: 20px;
  background: var(--white);
  border: 1px solid var(--border-mid);
  color: var(--text-mid);
}
.altro-box {
  border: 1px dashed var(--border-mid);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  background: var(--white);
  margin-top: 1rem;
}
.altro-box .form-label { display: block; margin-bottom: 8px; }
.altro-row { display: flex; align-items: center; gap: 8px; }
.altro-row input {
  border: 1px solid var(--border-mid); border-radius: var(--radius-md);
  background: var(--gray-100); padding: 0 12px;
  font-family: 'DM Sans', sans-serif; font-size: 13px; color: var(--text);
  outline: none; height: 38px;
}
.altro-row input.wide { flex: 1; }
.altro-row input.narrow { width: 70px; text-align: right; }
.altro-row input:focus { border-color: var(--gold); background: var(--white); }

/* ── VOLATILITÀ ───────────────────────────────────────────── */
.vol-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}
.vol-intro { font-size: 14px; color: var(--text-mid); line-height: 1.7; margin-bottom: 1.75rem; }
.range-wrap { margin-bottom: 1rem; }
input[type=range] {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--gray-200);
  outline: none;
  appearance: none;
  cursor: pointer;
  margin-bottom: 8px;
}
input[type=range]::-webkit-slider-thumb {
  appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--gold);
  border: 3px solid var(--white);
  box-shadow: 0 0 0 2px var(--gold);
  cursor: pointer;
}
.range-labels {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--text-light);
}
.vol-result {
  display: flex; align-items: center; gap: 12px;
  margin-top: 1.25rem;
}
.vol-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px; font-weight: 500;
}
.vol-badge.conservativo { background: #EAF5EE; color: #3D7A49; border: 1px solid #A8D8B4; }
.vol-badge.moderato     { background: #FEF6E4; color: #8A5A00; border: 1px solid #F0C97A; }
.vol-badge.dinamico     { background: #FEF6E4; color: #8A5A00; border: 1px solid #F0C97A; }
.vol-badge.aggressivo   { background: #FDECEC; color: #8A1F1F; border: 1px solid #F0A0A0; }
.vol-note { font-size: 13px; color: var(--text-mid); margin-top: 10px; font-style: italic; }

/* ── RISCHI ───────────────────────────────────────────────── */
.rischi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
.rischio-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.rischio-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.rischio-left { display: flex; align-items: center; gap: 10px; }
.rischio-title { font-size: 14px; font-weight: 500; color: var(--text); }
.rischio-rank-label {
  font-size: 11px; font-weight: 500;
  color: var(--gold-dark);
  margin-top: 2px;
  min-height: 14px;
}
.toggle {
  width: 40px; height: 22px;
  border-radius: 11px;
  background: var(--gray-200);
  border: 1px solid var(--border-mid);
  position: relative; cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle.on { background: var(--gold); border-color: var(--gold); }
.toggle::after {
  content: '';
  position: absolute;
  left: 3px; top: 3px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: left 0.2s;
}
.toggle.on::after { left: 21px; }
.rischio-desc { font-size: 12px; color: var(--text-mid); line-height: 1.6; }
.rischio-priority { margin-top: 10px; display: none; }
.rischio-priority.show { display: block; }
.rischio-priority select {
  width: 100%; height: 34px;
  border: 1px solid var(--gold);
  border-radius: var(--radius-md);
  background: var(--gold-pale);
  padding: 0 10px;
  font-size: 12px; font-weight: 500;
  color: var(--gold-dark);
  font-family: 'DM Sans', sans-serif;
  outline: none;
  appearance: none;
  cursor: pointer;
}

/* ── RIEPILOGO ────────────────────────────────────────────── */
.riepilogo-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem;
}
.riepilogo-client { display: flex; align-items: center; gap: 14px; }
.riepilogo-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--gold-pale);
  border: 2px solid var(--gold-light);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px; font-weight: 500;
  color: var(--gold-dark);
}
.riepilogo-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px; font-weight: 500;
}
.riepilogo-sub { font-size: 13px; color: var(--text-mid); margin-top: 2px; }
.completed-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px;
  border-radius: var(--radius-md);
  background: #EAF5EE;
  color: #3D7A49;
  border: 1px solid #A8D8B4;
  font-size: 13px; font-weight: 500;
}

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 1.5rem; }
.metric {
  background: var(--gray-100);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.metric-label { font-size: 11px; color: var(--text-light); margin-bottom: 5px; letter-spacing: 0.03em; text-transform: uppercase; }
.metric-val { font-size: 22px; font-weight: 500; color: var(--text); }
.metric-sub { font-size: 11px; color: var(--text-mid); margin-top: 3px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.card-title {
  font-size: 11px; font-weight: 500;
  color: var(--text-light);
  letter-spacing: 0.10em; text-transform: uppercase;
  margin-bottom: 1rem;
  display: flex; align-items: center; gap: 8px;
}
.card-title i { font-size: 14px; color: var(--gold); }

.row-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.row-item:last-child { border-bottom: none; }
.row-label { color: var(--text-mid); }
.row-val { font-weight: 500; }

.bar-label { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 5px; }
.bar-label-name { color: var(--text-mid); display: flex; align-items: center; gap: 6px; }
.bar-label-name i { font-size: 13px; color: var(--gold); }
.bar-label-pct { font-weight: 500; }
.bar-track { height: 6px; background: var(--gray-200); border-radius: 3px; margin-bottom: 10px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 3px; }
.bar-gold  { background: var(--gold); }
.bar-blue  { background: var(--blue); }
.bar-green { background: var(--green); }

.cass-band { display: flex; height: 10px; border-radius: 5px; overflow: hidden; margin-bottom: 8px; }
.cass-seg { height: 100%; }
.cass-legend { display: flex; gap: 1rem; margin-bottom: 12px; flex-wrap: wrap; }
.cass-leg { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-mid); }
.cass-dot { width: 8px; height: 8px; border-radius: 50%; }

.obiettivi-list { display: flex; flex-direction: column; gap: 6px; }
.obiettivo {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: var(--gray-100);
  border-radius: var(--radius-md);
  font-size: 13px;
}
.obiettivo i { font-size: 15px; color: var(--gold); }
.obiettivo-name { flex: 1; font-weight: 500; }
.priority { font-size: 11px; padding: 2px 8px; border-radius: 20px; font-weight: 500; }
.p1 { background: var(--gold-pale); color: var(--gold-dark); border: 1px solid var(--gold-light); }
.p2 { background: var(--gray-100); color: var(--text-mid); border: 1px solid var(--border-mid); }

.rischi-vis { display: flex; flex-wrap: wrap; gap: 6px; }
.rpill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; padding: 5px 12px;
  border-radius: 20px; font-weight: 500;
}
.rpill.on  { background: var(--gold-pale); color: var(--gold-dark); border: 1px solid var(--gold-light); }
.rpill.off { background: var(--gray-100); color: var(--text-mid); border: 1px solid var(--border); }

.vol-strip { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.vol-track { flex: 1; height: 8px; background: var(--gray-200); border-radius: 4px; overflow: hidden; }
.vol-fill-strip { height: 100%; background: var(--gold); border-radius: 4px; }

.ai-insight {
  background: var(--gold-pale);
  border: 1px solid var(--gold-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.ai-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 500;
  color: var(--gold-dark); letter-spacing: 0.10em;
  text-transform: uppercase; margin-bottom: 10px;
}
.ai-head i { font-size: 14px; color: var(--gold); }
.ai-text { font-size: 13px; color: var(--text-mid); line-height: 1.75; }
.ai-text strong { color: var(--text); font-weight: 500; }

.step-section-label {
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--gold);
  margin: 1.5rem 0 0.75rem;
}

.passi { display: flex; flex-direction: column; gap: 8px; }
.passo {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 18px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.passo:hover { border-color: var(--gold-light); box-shadow: var(--shadow-md); }
.passo-num {
  min-width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--gold-pale);
  border: 1px solid var(--gold-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 500; color: var(--gold-dark);
}
.passo-body { flex: 1; }
.passo-title { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.passo-desc { font-size: 12px; color: var(--text-mid); line-height: 1.6; }
.passo-tag {
  font-size: 11px; padding: 4px 10px;
  border-radius: var(--radius-md);
  font-weight: 500; white-space: nowrap; align-self: flex-start;
}
.tag-urgente { background: #FDECEC; color: #8A1F1F; border: 1px solid #F0A0A0; }
.tag-breve   { background: #FEF6E4; color: #8A5A00; border: 1px solid #F0C97A; }
.tag-medio   { background: #E6F1FB; color: #0D4A8A; border: 1px solid #A0C4EF; }

.action-buttons { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 1.5rem; }

/* ── BUTTONS ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-md);
  font-size: 14px; font-weight: 500;
  cursor: pointer; border: 1px solid var(--border-mid);
  background: var(--white); color: var(--text);
  font-family: 'DM Sans', sans-serif;
  transition: all 0.15s;
}
.btn:hover { background: var(--gray-100); }
.btn-primary {
  background: var(--gold); color: var(--white); border-color: var(--gold);
}
.btn-primary:hover { background: #A0834A; border-color: #A0834A; }
.btn-ghost { color: var(--text-mid); border-color: transparent; }
.btn-ghost:hover { background: var(--gray-100); color: var(--text); }
.btn-outline-gold {
  background: var(--gold-pale); color: var(--gold-dark);
  border-color: var(--gold-light);
}
.btn-outline-gold:hover { background: #ecdfc4; }

/* ── NAV BUTTONS ──────────────────────────────────────────── */
.nav-buttons {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 2.5rem; padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

/* ── ALERTS ───────────────────────────────────────────────── */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 13px; line-height: 1.6;
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 1rem;
}
.alert i { font-size: 16px; margin-top: 1px; flex-shrink: 0; }
.alert-info { background: #E6F1FB; color: #0D4A8A; border: 1px solid #A0C4EF; }
.alert-gold { background: var(--gold-pale); color: var(--gold-dark); border: 1px solid var(--gold-light); }

/* ── DIVIDER ──────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 1rem 0; }

/* ── FOOTER ───────────────────────────────────────────────── */
.footer {
  grid-column: 1 / -1;
  background: var(--navy);
  padding: 1.5rem 2.5rem;
  display: flex; align-items: center; justify-content: space-between;
}
.footer-text { font-size: 12px; color: rgba(255,255,255,0.4); }
.footer-gold { color: var(--gold-light); }

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 1.5rem; }
  .patrimonio-grid, .esigenze-grid, .cassetti, .two-col, .rischi-grid, .metrics {
    grid-template-columns: 1fr;
  }
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .form-group.full { grid-column: 1; }
}

/* ── AUTOSAVE — BADGE STATO ──────────────────────────────── */
.pb-save-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 20px;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}
.pb-save-saving {
  background: #FEF6E4;
  color: #8A5A00;
  border-color: #F0C97A;
}
.pb-save-saved {
  background: #EAF5EE;
  color: #3D7A49;
  border-color: #A8D8B4;
}
.pb-save-error {
  background: #FDECEC;
  color: #8A1F1F;
  border-color: #F0A0A0;
}
.pb-save-idle {
  opacity: 0.45;
}
@keyframes pb-spin {
  from { transform: rotate(0deg);   }
  to   { transform: rotate(360deg); }
}
.pb-spin-icon {
  display: inline-block;
  animation: pb-spin 1s linear infinite;
}

/* ── BARRA STATO SIDEBAR ─────────────────────────────────── */
.pb-sidebar-save-status {
  padding: 10px 1.5rem;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
}
.pb-last-saved {
  font-size: 11px;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 5px;
}
.pb-last-saved i { font-size: 13px; color: var(--gold); }

/* ── BANNER RIPRISTINO ───────────────────────────────────── */
#pb-restore-banner {
  display: none;
  margin: 0 0 1.5rem;
}
.pb-restore-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--navy);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  flex-wrap: wrap;
}
.pb-restore-icon {
  width: 40px; height: 40px;
  background: rgba(184,151,90,0.18);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: var(--gold-light);
  flex-shrink: 0;
}
.pb-restore-text {
  flex: 1;
  font-size: 14px;
  color: rgba(255,255,255,0.80);
  line-height: 1.5;
  min-width: 200px;
}
.pb-restore-text strong { color: var(--white); }
.pb-restore-text em { color: var(--gold-light); font-style: normal; }
.pb-restore-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.pb-restore-btn-yes {
  background: var(--gold);
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  padding: 9px 18px;
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
  white-space: nowrap;
}
.pb-restore-btn-yes:hover { background: #A0834A; }
.pb-restore-btn-no {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.60);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-md);
  padding: 9px 18px;
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  white-space: nowrap;
}
.pb-restore-btn-no:hover {
  background: rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.85);
}

/* ── BUG FIX #1: esigenza card hover feedback ─────────────── */
.pb-esigenza-card {
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s, transform 0.12s;
  text-align: left !important;
  padding: 1.5rem 1.25rem 1.25rem !important;
  border-radius: 14px !important;
  border-width: 1.5px !important;
  position: relative;
  user-select: none;
}
.pb-esigenza-card:hover {
  border-color: #EFB052 !important;
  background: #FFFBF2;
  box-shadow: 0 4px 16px rgba(239,176,82,0.14);
  transform: translateY(-2px);
}
.pb-esigenza-card.selected {
  border-color: #EFB052 !important;
  background: #FDF5E0;
  box-shadow: 0 4px 16px rgba(239,176,82,0.18);
}
.pb-esigenza-card:active { transform: translateY(0); box-shadow: none; }

/* ── BUG FIX #7: brand colors ──────────────────────────────── */
.btn-primary {
  background: #1D4EFF !important;
  border-color: #1D4EFF !important;
  color: #fff !important;
}
.btn-primary:hover { background: #1740D6 !important; border-color: #1740D6 !important; }

.btn-outline-gold {
  background: #FDF5E0 !important;
  color: #7A5F2A !important;
  border-color: #EFB052 !important;
}

.nav-item.active {
  color: #7A5F2A !important;
  border-left-color: #EFB052 !important;
  background: #FDF5E0 !important;
}
.nav-step { border-color: rgba(26,25,23,0.18) !important; }
.nav-item.active .nav-step { background: #EFB052 !important; border-color: #EFB052 !important; }
.nav-item.done .nav-step  { background: #EAF5EE !important; border-color: #A8D8B4 !important; color: #3D7A49 !important; }
.progress-fill { background: #EFB052 !important; }
.pat-link { color: #7A5F2A !important; border-color: #EFB052 !important; background: #FDF5E0 !important; }
.pat-link:hover { background: #F5E8C8 !important; }
.section-label { color: #EFB052 !important; }
.subsection-title i { color: #EFB052 !important; }
.pat-icon { background: #FDF5E0 !important; color: #EFB052 !important; }
.pb-rank-badge {
  position: absolute !important;
  top: 10px !important; right: 10px !important;
  width: 26px !important; height: 26px !important;
  border-radius: 50% !important;
  background: #EFB052 !important;
  color: #fff !important;
  font-size: 12px !important; font-weight: 700 !important;
  display: flex !important; align-items: center !important; justify-content: center !important;
  box-shadow: 0 2px 6px rgba(239,176,82,0.45) !important;
  z-index: 2;
  line-height: 1 !important;
  margin: 0 !important;
}
.pb-rank-item-num { background: #FDF5E0 !important; color: #7A5F2A !important; border: 1px solid #EFB052 !important; }
.toggle.on { background: #EFB052 !important; border-color: #EFB052 !important; }
.pb-restore-btn-yes { background: #EFB052 !important; }
.pb-restore-btn-yes:hover { background: #D4980A !important; }
.completed-badge { background: #EAF5EE !important; color: #3D7A49 !important; border-color: #A8D8B4 !important; }
.esigenze-hint { border-color: rgba(239,176,82,0.3) !important; background: #FDF8EE !important; }
.esigenze-hint i { color: #EFB052 !important; }
.pb-rischio-rank-label { color: #EFB052 !important; }

/* ── Rank badge: absolutely positioned, never bleeds into card text ── */
.pb-rank-badge {
  position: absolute !important;
  top: 10px !important; right: 10px !important;
  width: 26px !important; height: 26px !important;
  border-radius: 50% !important;
  background: #EFB052 !important;
  color: #fff !important;
  font-size: 12px !important; font-weight: 700 !important;
  display: inline-flex !important; align-items: center !important; justify-content: center !important;
  box-shadow: 0 2px 8px rgba(239,176,82,0.45) !important;
  z-index: 2 !important;
  line-height: 1 !important;
  pointer-events: none;
}
/* Ensure the card itself is positioned so absolute child works */
.pb-esigenza-card, .esigenza-card {
  position: relative !important;
}

/* ══════════════════════════════════════════════════════════
   ESPANSIONE v1.4 — componenti per i nuovi step (0,2,4,6,7,8)
   Portati dal riferimento private_banking_platform_percorso_completo
   (stesse variabili --gold/--navy/... già definite in questo file)
   ══════════════════════════════════════════════════════════ */
.emphasis-quote { color: var(--gold-dark); font-weight: 600; }
.subsection-note { font-size: 12px; color: var(--text-light); font-weight: 400; text-transform: none; letter-spacing: 0; margin-left: auto; }

.alert-danger { background: #FBEAEA; color: #8A2222; border: 1px solid #E9AFAF; font-weight: 500; }

/* ── RIGHE RIPETIBILI (figli, redditi, uscite) ───────────── */
.repeat-wrap { display: flex; flex-direction: column; gap: 10px; margin-bottom: 1rem; }
.repeat-row {
  display: grid; grid-template-columns: repeat(4, 1fr) auto;
  gap: 10px; align-items: end;
  background: var(--gray-100);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
}
.repeat-row .form-group input, .repeat-row .form-group select { height: 38px; background: var(--white); font-size: 13px; }
.repeat-row-remove {
  height: 38px; width: 38px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--text-light);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s, border-color 0.15s;
}
.repeat-row-remove:hover { color: var(--red); border-color: var(--red); }
.add-row-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 500;
  color: var(--gold-dark);
  background: none; border: 1px dashed var(--gold);
  border-radius: var(--radius-md);
  padding: 9px 16px;
  cursor: pointer;
  transition: background 0.15s;
  font-family: 'DM Sans', sans-serif;
  align-self: flex-start;
}
.add-row-btn:hover { background: var(--gold-pale); }

/* ── SOGGETTO A / B ───────────────────────────────────────── */
.soggetto-block { border-left: 3px solid var(--gold-light); padding-left: 1.1rem; margin-bottom: 1.5rem; }
.soggetto-name-input {
  height: 32px; width: 220px; margin-left: 10px; margin-bottom: 12px;
  border: 1px dashed var(--border-mid); border-radius: 20px;
  background: var(--white); padding: 0 14px; font-size: 12px;
  font-family: 'DM Sans', sans-serif; color: var(--text-mid); outline: none;
  vertical-align: middle;
}
.soggetto-name-input:focus { border-color: var(--gold); border-style: solid; }
.soggetto-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 500;
  color: var(--gold-dark);
  background: var(--gold-pale);
  border-radius: 20px;
  padding: 4px 12px;
  margin-bottom: 12px;
}

/* ── CHIP MULTI-SELECT ────────────────────────────────────── */
.chip-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 1rem; }
.chip {
  font-size: 12.5px; font-weight: 500;
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--border-mid);
  background: var(--white);
  color: var(--text-mid);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.chip:hover { border-color: var(--gold-light); }
.chip.on { background: var(--gold-pale); color: var(--gold-dark); border-color: var(--gold); font-weight: 500; }

/* ── CHOICE PILLS ─────────────────────────────────────────── */
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-pill {
  font-size: 12.5px; font-weight: 500;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-mid);
  background: var(--white);
  color: var(--text-mid);
  cursor: pointer;
  transition: all 0.15s;
}
.choice-pill:hover { border-color: var(--gold-light); }
.choice-pill.active { background: var(--gold); color: var(--white); border-color: var(--gold); }

/* ── RATING 1-5 ───────────────────────────────────────────── */
.rating-scale { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.rating-dot {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border-mid);
  background: var(--white);
  color: var(--text-mid);
  font-size: 12px; font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}
.rating-dot:hover { border-color: var(--gold-light); }
.rating-dot.active { background: var(--gold); border-color: var(--gold); color: var(--white); }
.rating-label { font-size: 12px; color: var(--text-light); margin-top: 4px; }

/* ── LINK CARDS (approfondimenti) ────────────────────────── */
.link-card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
.link-card {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.link-card:hover { border-color: var(--gold-light); box-shadow: var(--shadow-md); }
.link-card-icon {
  width: 38px; height: 38px; flex-shrink: 0;
  border-radius: var(--radius-md);
  background: var(--gold-pale);
  color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.link-card-title { font-size: 13.5px; font-weight: 500; color: var(--text); margin-bottom: 3px; }
.link-card-desc { font-size: 12px; color: var(--text-mid); line-height: 1.5; }

/* ── FREQUENZA GRID (monitoraggio) ───────────────────────── */
.freq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
.freq-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 10px 14px;
}
.freq-row-name { font-size: 13px; font-weight: 500; color: var(--text); display: flex; align-items: center; gap: 8px; }
.freq-row-name i { color: var(--gold); font-size: 16px; }
.freq-row select {
  height: 34px; border: 1px solid var(--border-mid); border-radius: var(--radius-sm);
  background: var(--gray-100); font-size: 12px; padding: 0 8px; font-family: 'DM Sans', sans-serif;
  outline: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%239A9892' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; padding-right: 26px;
}

/* ── CONDITIONAL REVEAL ───────────────────────────────────── */
.reveal { display: none; margin-top: 10px; }
.reveal.show { display: block; }

/* ── WELCOME / CONSENT (step 1) ──────────────────────────── */
.hero-card {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  border-radius: var(--radius-xl);
  padding: 2.25rem;
  color: var(--white);
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}
.hero-eyebrow { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-light); font-weight: 500; margin-bottom: 10px; }
.hero-title { font-family: 'Cormorant Garamond', serif; font-size: 26px; font-weight: 500; margin-bottom: 12px; line-height: 1.3; }
.hero-text { font-size: 13.5px; color: rgba(255,255,255,0.72); line-height: 1.75; max-width: 640px; }
.path-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.path-card {
  background: var(--white); border: 2px solid var(--border); border-radius: var(--radius-lg);
  padding: 1.5rem; cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s;
}
.path-card:hover { border-color: var(--gold-light); box-shadow: var(--shadow-md); }
.path-card.selected { border-color: var(--gold); background: var(--gold-pale); }
.path-card-icon {
  width: 44px; height: 44px; border-radius: var(--radius-md);
  background: var(--gold-pale); color: var(--gold);
  display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 12px;
}
.path-card.selected .path-card-icon { background: var(--white); }
.path-card-title { font-size: 14.5px; font-weight: 500; color: var(--text); margin-bottom: 6px; }
.path-card-desc { font-size: 12.5px; color: var(--text-mid); line-height: 1.6; }
.consent-box {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 1.5rem; margin-bottom: 1.5rem; box-shadow: var(--shadow-sm);
}
.consent-text { font-size: 12.5px; color: var(--text-mid); line-height: 1.7; margin-bottom: 1rem; }
.consent-check { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--text); padding: 10px 0; border-top: 1px solid var(--border); }
.consent-check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--gold); flex-shrink: 0; }
.origin-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 1rem; }

@media (max-width: 860px) {
  .path-grid, .freq-grid { grid-template-columns: 1fr; }
  .repeat-row { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════
   ESPANSIONE v1.5 — step 0 senza sidebar, box uniformi, campi espandibili
   ══════════════════════════════════════════════════════════ */
.pb-reveal-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

/* Step 0 (Benvenuto e consenso): sidebar "Percorso cliente" nascosta */
.layout.pb-hide-sidebar { grid-template-columns: 1fr !important; }
.layout.pb-hide-sidebar .sidebar { display: none !important; }
.layout.pb-hide-sidebar .main { max-width: 92% !important; width: 92% !important; margin: 0 auto; }

/* Blocchi dinamici (figli, risorse per obiettivo) con lo stesso stile-carta degli altri box */
#pb-figliRows, #pb-risorseObiettiviWrap .card { border-radius: var(--radius-lg) !important; }
#pb-figliWrap {
  background: var(--white) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  padding: 1.25rem 1.25rem 0.5rem !important;
  box-shadow: var(--shadow-sm) !important;
}
[id^="pb-figlioRow-"] {
  padding-bottom: 0.75rem;
}

/* ══════════════════════════════════════════════════════════
   FIX v1.6 — liste "in ordine di priorità" (obiettivi e rischi)
   mancava lo stile di base: prima i numeri erano attaccati al testo
   ══════════════════════════════════════════════════════════ */
.pb-esigenze-ranked, #pb-rischiRanked {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.pb-esigenze-ranked-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1rem;
}
.pb-rank-list { display: flex; flex-direction: column; gap: 8px; }
.pb-rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--gray-100);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}
.pb-rank-item-num {
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; flex-shrink: 0;
  border-radius: 50%;
  background: var(--gold-pale);
  color: var(--gold-dark);
  border: 1px solid var(--gold-light);
  font-size: 12px;
  font-weight: 600;
}
.pb-rank-item-icon { color: var(--gold); font-size: 17px; flex-shrink: 0; }
.pb-rank-item-name { flex: 1; font-size: 13.5px; font-weight: 500; color: var(--text); }
.pb-rank-item-remove {
  width: 26px; height: 26px; flex-shrink: 0;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--text-light);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s, border-color 0.15s;
}
.pb-rank-item-remove:hover { color: var(--red); border-color: var(--red); }

/* Orizzonte temporale per obiettivo (nuovo campo "in quanti anni") */
.pb-orizzonte-box {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-mid);
}
.pb-orizzonte-box label { font-size: 11.5px; color: var(--text-mid); display: block; margin-bottom: 4px; }
.pb-orizzonte-box input {
  width: 90px; height: 32px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  background: var(--white);
  outline: none;
}
.pb-orizzonte-box input:focus { border-color: var(--gold); }

/* Campo con errore di validazione (es. email senza @) */
.pb-field-error { border-color: var(--red) !important; background: #FBEAEA !important; }

/* ── SELETTORE MODALITÀ (light / solo contatto) — ben visibile, in cima ── */
.pb-mode-switch {
  display: flex;
  gap: 8px;
  background: var(--gray-100);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 6px;
  margin-bottom: 1.5rem;
}
.pb-mode-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-mid);
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.pb-mode-tab:hover { color: var(--text); }
.pb-mode-tab.active {
  background: var(--white);
  color: var(--gold-dark);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}
.pb-mode-tab i { font-size: 16px; }
@media (max-width: 600px) {
  .pb-mode-switch { flex-direction: column; }
}

/* ── Riordino drag & drop nelle liste priorità ───────────── */
.pb-rank-item { cursor: grab; }
.pb-rank-item.pb-dragging { opacity: 0.4; cursor: grabbing; }
.pb-rank-item-grip { color: var(--text-light); font-size: 15px; cursor: grab; flex-shrink: 0; }
.pb-rank-item-years { font-size: 12px; color: var(--text-mid); font-weight: 400; }

/* ── Nota libera per ogni obiettivo (come nel riferimento) ── */
.esigenza-note {
  width: 100%;
  min-height: 52px;
  margin-top: 10px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  font-size: 12.5px;
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  background: var(--white);
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
}
.esigenza-note:focus { border-color: var(--gold); }

/* ══════════════════════════════════════════════════════════
   FIX v1.10 — Patrimonio: card ripetibili come nel riferimento
   ══════════════════════════════════════════════════════════ */
.patrimonio-stack { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1rem; }
.pat-subtotal {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12.5px; color: var(--text-mid);
  background: var(--gray-100); border-radius: var(--radius-md);
  padding: 8px 14px; margin: 12px 0;
}
.pat-subtotal strong { color: var(--text); font-weight: 500; }

.matrix-table { width: 100%; border-collapse: collapse; margin-top: 0.75rem; }
.matrix-table th {
  text-align: left; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-light); font-weight: 500; padding: 0 12px 8px;
  border-bottom: 1px solid var(--border-mid);
}
.matrix-table td {
  font-size: 12.5px; color: var(--text-mid); padding: 12px; vertical-align: top;
  border-bottom: 1px solid var(--border); background: var(--white);
}
.matrix-table tr:last-child td { border-bottom: none; }
.matrix-table td:first-child { font-weight: 500; color: var(--text); border-radius: var(--radius-md) 0 0 var(--radius-md); }
.matrix-table td:last-child { border-radius: 0 var(--radius-md) var(--radius-md) 0; white-space: nowrap; }
.matrix-table tfoot td { font-weight: 500; color: var(--text); background: var(--gray-100); border-top: 2px solid var(--border-mid); border-bottom: none; }
.matrix-table tfoot td:first-child { border-radius: var(--radius-md) 0 0 var(--radius-md); }
.matrix-table tfoot td:last-child { border-radius: 0 var(--radius-md) var(--radius-md) 0; color: var(--gold-dark); }

.banca-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; box-shadow: var(--shadow-sm); }
.banca-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.banca-card-head input { flex: 1; height: 40px; border: 1px solid var(--border-mid); border-radius: var(--radius-md); padding: 0 14px; font-size: 14px; font-weight: 500; font-family: 'DM Sans', sans-serif; outline: none; }
.banca-card-head input:focus { border-color: var(--gold); }
