/* ============================================================
   EasyBudget — Sistema di design condiviso (nuovo look)
   Estratto da dashboard.html per riuso su tutte le pagine.
   ============================================================ */

:root {
    --brand-orange:         #ff7a00;
    --brand-orange-light:   #ff9f40;
    --brand-orange-lighter: #fff0e0;
    --brand-purple:         #0d0d0d;
    --brand-purple-light:   #1f1f1f;
    --brand-purple-lighter: #f3f4f6;
    --accent-green:         #10b981;
    --accent-green-light:   #d1fae5;
    --accent-amber:         #f59e0b;
    --accent-amber-light:   #fef3c7;
    --color-danger:         #ef4444;
    --color-danger-light:   #fee2e2;

    --bg-page:    #f0f2f6;
    --bg-card:    #ffffff;
    --bg-subtle:  #f8f9fb;
    --text-1:     #111827;
    --text-2:     #4b5563;
    --text-3:     #9ca3af;
    --border:     #e5e7eb;

    --grad-orange: linear-gradient(135deg,#ff7a00,#ff9f40);
    --grad-purple: linear-gradient(135deg,#0d0d0d,#1f1f1f);
    --grad-green:  linear-gradient(135deg,#10b981,#34d399);
    --grad-amber:  linear-gradient(135deg,#f59e0b,#fbbf24);

    --sh-xs: 0 1px 3px rgba(0,0,0,.06);
    --sh-sm: 0 2px 8px rgba(0,0,0,.07);
    --sh-md: 0 4px 16px rgba(0,0,0,.09);
    --sh-lg: 0 8px 24px rgba(0,0,0,.11);
    --sh-orange: 0 4px 14px rgba(255,122,0,.2);

    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-xl: 20px;

    --font: 'Poppins',-apple-system,BlinkMacSystemFont,sans-serif;

    /* header height for padding-top on main */
    --hdr-h: 64px;
}


:root{ --eb-side-w:288px; }
@media (min-width:1025px){
  body{ background:var(--bg-page); }

  /* --- SIDEBAR SINISTRA --- */
  .eb-sidebar{ position:fixed; top:0; left:0; width:var(--eb-side-w); height:100vh; background:#fff;
    border-right:1px solid var(--border); overflow-y:auto; z-index:200; display:flex; flex-direction:column;
    padding:24px 18px 18px; font-family:var(--font); }
  .eb-sb-logo{ display:flex; align-items:center; gap:8px; font-size:1.2rem; font-weight:800;
    color:var(--brand-orange); text-decoration:none; padding:0 8px 18px; }
  .eb-nav{ display:flex; flex-direction:column; gap:2px; }
  .eb-nav a{ display:flex; align-items:center; gap:11px; padding:9px 13px; border-radius:11px;
    color:var(--text-2); text-decoration:none; font-weight:600; font-size:.85rem; line-height:1.25;
    transition:background .15s,color .15s; }
  .eb-nav a i{ width:18px; text-align:center; font-size:.92rem; color:var(--text-3); flex-shrink:0; }
  .eb-nav a:hover{ background:var(--bg-subtle); color:var(--text-1); }
  .eb-nav a:hover i{ color:var(--text-2); }
  .eb-nav a.active{ background:var(--brand-orange); color:#fff; box-shadow:var(--sh-orange); }
  .eb-nav a.active i{ color:#fff; }
  .eb-sb-group{ font-size:.66rem; font-weight:700; letter-spacing:.08em; color:var(--text-3);
    padding:20px 13px 7px; }
  /* --- Preferiti (scorciatoie ai grafici) --- */
  .eb-sb-group.eb-fav-group{ display:flex; align-items:center; justify-content:space-between; padding-right:8px; }
  .eb-fav-add{ width:22px; height:22px; border-radius:7px; border:1px solid var(--border); background:#fff;
    color:var(--text-2); cursor:pointer; display:inline-flex; align-items:center; justify-content:center;
    font-size:.7rem; transition:background .15s,color .15s,border-color .15s; padding:0; }
  .eb-fav-add:hover{ background:var(--brand-orange); color:#fff; border-color:var(--brand-orange); }
  #eb-fav-list a{ position:relative; padding-right:30px; }
  #eb-fav-list a > span.t{ flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .eb-fav-rm{ position:absolute; right:7px; top:50%; transform:translateY(-50%); width:19px; height:19px;
    border:none; background:transparent; color:var(--text-3); cursor:pointer; border-radius:50%; font-size:.68rem;
    display:none; align-items:center; justify-content:center; padding:0; }
  #eb-fav-list a:hover .eb-fav-rm{ display:inline-flex; }
  .eb-fav-rm:hover{ background:#fee2e2; color:#dc2626; }
  .eb-fav-empty{ font-size:.75rem; color:var(--text-3); padding:4px 13px 2px; line-height:1.45; }
  /* Finestra di scelta grafico */
  .eb-fav-picker-ov{ position:fixed; inset:0; background:rgba(0,0,0,.45); z-index:11000;
    display:flex; align-items:center; justify-content:center; padding:16px; }
  .eb-fav-picker{ background:#fff; border-radius:16px; width:100%; max-width:420px; max-height:80vh;
    overflow-y:auto; box-shadow:var(--sh-lg); }
  .eb-fav-picker-head{ display:flex; align-items:center; justify-content:space-between; padding:16px 18px 12px;
    border-bottom:1px solid var(--border); font-weight:700; color:var(--text-1); font-size:.95rem;
    position:sticky; top:0; background:#fff; }
  .eb-fav-picker-head button{ background:none; border:none; font-size:1.35rem; color:var(--text-3); cursor:pointer; line-height:1; padding:0 4px; }
  .eb-fav-row{ display:flex; align-items:center; gap:12px; padding:12px 18px; cursor:pointer; transition:background .12s; }
  .eb-fav-row:hover{ background:var(--bg-subtle); }
  .eb-fav-row .ic{ width:34px; height:34px; border-radius:9px; display:flex; align-items:center; justify-content:center; font-size:.9rem; flex-shrink:0; }
  .eb-fav-row .tx{ flex:1; font-size:.88rem; font-weight:600; color:var(--text-1); }
  .eb-fav-row .st{ font-size:.85rem; color:var(--text-3); flex-shrink:0; }
  .eb-fav-row.added .st{ color:var(--accent-green); }
  .eb-sb-help{ margin:18px 6px 8px; background:var(--bg-subtle); border:1px solid var(--border);
    border-radius:14px; padding:16px 14px; text-align:center; }
  .eb-sb-help .h-ic{ width:34px; height:34px; border-radius:50%; background:var(--brand-orange-lighter);
    color:var(--brand-orange); display:flex; align-items:center; justify-content:center; margin:0 auto 8px; }
  .eb-sb-help p{ margin:0 0 8px; font-size:.78rem; color:var(--text-2); line-height:1.4; }
  .eb-sb-help a{ font-size:.82rem; font-weight:700; color:var(--brand-orange); text-decoration:none; }
  .eb-sb-foot{ margin-top:auto; padding-top:14px; border-top:1px solid var(--border); }
  .eb-sb-foot a{ display:flex; align-items:center; gap:11px; padding:9px 13px; border-radius:11px;
    color:var(--text-2); text-decoration:none; font-weight:600; font-size:.85rem; }
  .eb-sb-foot a i{ color:var(--text-3); width:20px; text-align:center; }
  .eb-sb-foot a:hover{ background:var(--bg-subtle); color:var(--text-1); }

  /* --- Vecchia barra in alto: nascosta su desktop (sostituita dalla eb-topbar nel contenuto) --- */
  header.v2-header{ display:none !important; }
  header.v2-header + .v2-bottom-nav, .v2-bottom-nav{ display:none !important; }

  /* --- Contenuto principale spostato a destra della sidebar --- */
  main{ margin-left:var(--eb-side-w); }
  main .v2-container{ max-width:1240px; margin:0 auto; padding:8px 36px 48px; }

  /* La sidebar è solo desktop: nascondi il drawer mobile qui */
  .eb-sidebar{ display:flex; }
}
/* Sotto i 1025px torna tutto come prima (mobile intatto) */
@media (max-width:1024px){ .eb-sidebar{ display:none; } }

/* ==========================================================
   NUOVO LOOK — Intestazione + Pannello di controllo (globale)
   ========================================================== */
/* Barra utente in alto a destra */
.eb-topbar{ display:flex; justify-content:flex-end; align-items:center; gap:14px; padding:12px 0 2px; }
.eb-bell-wrap{ position:relative; }
.eb-bell{ position:relative; background:none; border:none; cursor:pointer; color:var(--text-2); font-size:1rem; padding:4px; line-height:1; }
.eb-bell:hover{ color:var(--text-1); }
.eb-bell-badge{ position:absolute; top:-4px; right:-5px; min-width:16px; height:16px; padding:0 4px; box-sizing:border-box;
  background:#ef4444; color:#fff; border-radius:9px; font-size:.58rem; font-weight:800; display:inline-flex;
  align-items:center; justify-content:center; border:2px solid var(--bg-page); line-height:1; }
/* Pannello notifiche */
.eb-notif-panel{ position:absolute; top:calc(100% + 10px); right:0; width:340px; max-height:62vh; overflow-y:auto;
  background:#fff; border:1px solid var(--border); border-radius:14px; box-shadow:var(--sh-lg); display:none; z-index:1100; }
.eb-notif-panel.open{ display:block; }
.eb-notif-head{ font-weight:800; font-size:.85rem; color:var(--text-1); padding:12px 16px; border-bottom:1px solid var(--border); position:sticky; top:0; background:#fff; }
.eb-notif-empty{ text-align:center; color:var(--text-3); font-size:.82rem; padding:26px 12px; }
.eb-notif-item{ display:flex; gap:10px; align-items:flex-start; padding:12px 16px; border-bottom:1px solid var(--border); cursor:pointer; }
.eb-notif-item:last-child{ border-bottom:none; }
.eb-notif-item:hover{ background:var(--bg-subtle); }
.eb-notif-item.unread{ background:#fff7ed; }
.eb-notif-ic{ width:32px; height:32px; border-radius:9px; background:var(--brand-orange-lighter); color:var(--brand-orange);
  display:flex; align-items:center; justify-content:center; font-size:.8rem; flex-shrink:0; }
.eb-notif-b{ min-width:0; flex:1; }
.eb-notif-t{ font-size:.8rem; font-weight:700; color:var(--text-1); }
.eb-notif-m{ font-size:.76rem; color:var(--text-2); line-height:1.35; margin:2px 0; }
.eb-notif-d{ font-size:.68rem; color:var(--text-3); }
.eb-notif-dot{ width:8px; height:8px; border-radius:50%; background:var(--brand-orange); flex-shrink:0; margin-top:5px; }
/* Avatar + pulsante piano */
.eb-user{ display:flex; align-items:center; gap:8px; }
.eb-ava-link{ display:inline-flex; text-decoration:none; }
.eb-ava{ width:32px; height:32px; border-radius:50%; background:var(--brand-orange); color:#fff; display:flex;
  align-items:center; justify-content:center; font-weight:700; font-size:.78rem; overflow:hidden; flex-shrink:0; }
.eb-ava .user-image{ width:100%; height:100%; object-fit:cover; border-radius:50%; }
.eb-plan-btn{ display:inline-flex; align-items:center; gap:6px; background:none; border:none; cursor:pointer;
  font-family:inherit; padding:5px 8px; border-radius:9px; transition:background .15s; }
.eb-plan-btn:hover{ background:var(--bg-subtle); }
.eb-plan-name{ font-weight:700; color:var(--text-1); font-size:.85rem; }
.eb-user-chev{ color:var(--text-3); font-size:.68rem; }
@media (max-width:1024px){ .eb-topbar{ display:none; } }

.eb-pagehead{ display:flex; justify-content:space-between; align-items:flex-start; gap:24px;
  flex-wrap:wrap; margin:6px 0 22px; }
.eb-hello{ font-size:1.35rem; font-weight:800; color:var(--text-1); margin:0 0 3px; line-height:1.2; }
.eb-hello-sub{ margin:0; color:var(--text-2); font-size:.84rem; }
.eb-stip-card{ background:#fff; border:1px solid var(--border); border-radius:14px; box-shadow:var(--sh-sm);
  padding:13px 16px; min-width:290px; }
.eb-stip-top{ display:flex; align-items:center; gap:14px; }
.eb-stip-lbl{ font-size:.72rem; color:var(--text-2); margin-bottom:1px; }
.eb-stip-date{ font-size:.92rem; font-weight:700; color:var(--text-1); }
.eb-stip-amt{ margin-left:auto; font-size:1.35rem; font-weight:800; color:var(--text-1); white-space:nowrap; }
.eb-stip-ic{ color:var(--text-3); font-size:.95rem; }
.eb-stip-foot{ display:flex; align-items:center; justify-content:space-between; gap:10px;
  margin-top:10px; padding-top:10px; border-top:1px solid var(--border); font-size:.7rem; color:var(--text-3); }

.eb-panel{ background:linear-gradient(180deg,#eef1f6,#f6f8fb); border:1px solid var(--border);
  border-radius:16px; padding:16px; margin-bottom:22px; }
.eb-panel-label{ font-size:.7rem; font-weight:700; letter-spacing:.06em; color:var(--text-2);
  display:flex; align-items:center; gap:7px; margin:2px 4px 12px; }
.eb-kpi-grid{ display:grid; grid-template-columns:repeat(5,1fr); gap:12px; }
@media (max-width:1150px){ .eb-kpi-grid{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:560px){ .eb-kpi-grid{ grid-template-columns:1fr; } }

.eb-kpi{ background:#fff; border:1px solid var(--border); border-radius:14px; box-shadow:var(--sh-xs);
  padding:14px; display:flex; flex-direction:column; min-height:172px; }
.eb-kpi-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:8px; margin-bottom:10px; }
.eb-kpi-title{ font-size:.68rem; font-weight:700; letter-spacing:.03em; color:var(--text-2); line-height:1.25; }
.eb-kpi-title.green{ color:#059669; }
.eb-kpi-title.orange{ color:var(--brand-orange); }
.eb-kpi-i{ color:var(--text-3); font-size:.72rem; cursor:pointer; margin-left:2px; }
.eb-kpi-badge{ width:27px; height:27px; border-radius:8px; display:flex; align-items:center; justify-content:center;
  font-size:.75rem; flex-shrink:0; background:var(--bg-subtle); color:var(--text-2); }
.eb-kpi-badge.green{ background:var(--accent-green-light); color:#059669; }
.eb-kpi-badge.orange{ background:var(--brand-orange-lighter); color:var(--brand-orange); }
.eb-kpi-badge.slate{ background:#eef2f7; color:#64748b; }
.eb-kpi-value{ font-size:1.5rem; font-weight:800; color:var(--text-1); line-height:1; margin-bottom:5px; }
.eb-kpi-value.green{ color:#059669; }
.eb-kpi-value.orange{ color:var(--brand-orange); }
#dashboard-disponibilita-base{ display:none; }
/* Anti-flash: i valori dinamici restano invisibili finché il dato reale non è pronto */
.eb-kpi-value, #eb-sub-disp, #eb-sub-imp, .eb-ring-inner, #cruscotto-saluto-nome{ opacity:0; transition:opacity .2s ease; }
.eb-kpi-sub{ font-size:.75rem; font-weight:600; color:var(--text-1); margin:0; }
.eb-kpi-sub.muted{ font-weight:500; color:var(--text-2); }
.eb-kpi-sub.center{ text-align:center; }
.eb-kpi-bar{ height:5px; border-radius:6px; background:#eef1f5; overflow:hidden; margin:0 0 10px; }
.eb-kpi-bar span{ display:block; height:100%; border-radius:6px; }
.eb-kpi-bar span.green{ background:var(--accent-green); }
.eb-kpi-bar span.orange{ background:var(--brand-orange); }
.eb-kpi-link{ display:block; width:100%; background:#fff; border:1px solid var(--border); border-radius:9px;
  margin-top:auto; padding:8px 0; font-family:inherit; font-weight:700; font-size:.78rem; color:var(--text-2);
  cursor:pointer; text-align:center; transition:background .15s,border-color .15s; }
.eb-kpi-link.green{ color:#059669; border-color:#bbf0d4; }
.eb-kpi-link.orange{ color:var(--brand-orange); border-color:#ffd8b0; }
.eb-kpi-link.blue{ color:#2563eb; border-color:#c7dbfe; }
.eb-kpi-link:hover{ background:var(--bg-subtle); }
.eb-ring{ width:90px; height:90px; border-radius:50%; margin:-6px auto 6px;
  background:conic-gradient(#10b981 0% 0%, #e5e7eb 0% 100%); display:flex; align-items:center; justify-content:center; }
.eb-ring-inner{ width:72px; height:72px; border-radius:50%; background:#fff; display:flex; flex-direction:column;
  align-items:center; justify-content:center; }
.eb-ring-num{ font-size:1rem; font-weight:800; color:var(--text-1); line-height:1.1; }
.eb-ring-den{ font-size:.55rem; font-weight:700; color:var(--text-3); }
.eb-ring-lbl{ font-size:.58rem; font-weight:700; color:var(--text-2); margin-top:1px; }

/* ===== Sezione SPESE (due colonne) ===== */
.eb-sec-label{ font-size:.7rem; font-weight:700; letter-spacing:.06em; color:var(--text-2);
  display:flex; align-items:center; gap:7px; margin:2px 4px 12px; }
.eb-strip-hidden{ display:none !important; }
.eb-spese{ margin-bottom:22px; }
.eb-spese-cols{ display:grid; grid-template-columns:1fr 1fr; gap:16px; align-items:start; }
@media (max-width:900px){ .eb-spese-cols{ grid-template-columns:1fr; } }
.eb-spese-col{ background:#fff; border:1px solid var(--border); border-radius:14px; box-shadow:var(--sh-xs); padding:14px 16px; }
.eb-spese-head{ display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding-bottom:10px; margin-bottom:8px; border-bottom:1px solid var(--border); }
.eb-spese-head h3{ font-size:.82rem; font-weight:700; color:var(--text-1); margin:0;
  display:flex; align-items:center; gap:8px; }
.eb-spese-head a{ font-size:.76rem; font-weight:700; color:#2563eb; text-decoration:none; white-space:nowrap; }
.eb-spese-head a:hover{ text-decoration:underline; }
.eb-dot{ width:8px; height:8px; border-radius:50%; display:inline-block; flex-shrink:0; }
.eb-dot.pending{ background:var(--brand-orange); }
.eb-dot.paid{ background:var(--text-3); }
/* Blocco data a sinistra delle righe spesa (giorno grande + mese) */
.mv-datebox{ display:flex; flex-direction:column; align-items:center; justify-content:center;
  min-width:34px; margin-right:4px; flex-shrink:0; }
.mv-datebox .d{ font-size:1.05rem; font-weight:800; color:var(--text-1); line-height:1; }
.mv-datebox .m{ font-size:.6rem; font-weight:700; color:var(--text-3); text-transform:uppercase; letter-spacing:.03em; }

/* ===== Frase sul denaro (passatempo sfogliabile) ===== */
.eb-quote{ position:relative; background:linear-gradient(180deg,#fffdfa,#fff); border:1px solid var(--border);
  border-left:4px solid var(--brand-orange); border-radius:14px; padding:15px 20px 13px;
  margin-bottom:22px; box-shadow:var(--sh-xs); }
.eb-quote-info{ position:absolute; top:11px; right:13px; width:24px; height:24px; border-radius:50%;
  border:none; background:transparent; color:var(--text-3); cursor:pointer; font-size:.92rem; padding:0;
  display:inline-flex; align-items:center; justify-content:center; transition:color .15s; }
.eb-quote-info:hover{ color:var(--brand-orange); }
.eb-quote-tip{ position:absolute; top:40px; right:12px; max-width:250px; background:#111827; color:#fff;
  font-size:.72rem; line-height:1.45; padding:9px 12px; border-radius:10px; box-shadow:0 6px 20px rgba(0,0,0,.22);
  z-index:5; display:none; }
.eb-quote-tip::after{ content:''; position:absolute; top:-5px; right:14px; width:10px; height:10px;
  background:#111827; transform:rotate(45deg); }
.eb-quote-head{ display:flex; align-items:center; gap:8px; font-size:.66rem; font-weight:700;
  letter-spacing:.09em; text-transform:uppercase; color:var(--brand-orange); margin-bottom:9px; }
.eb-quote-title{ font-size:.9rem; font-weight:800; line-height:1.3; margin:0 0 5px; transition:opacity .18s ease; }
.eb-quote-text{ font-size:1.02rem; line-height:1.55; color:var(--text-1);
  margin:0; min-height:2.4em; transition:opacity .18s ease; }
#eb-quote-text{ font-style:italic; }
.eb-quote-author{ font-size:.8rem; font-weight:600; font-style:normal; color:var(--text-2); transition:opacity .18s ease; }
.eb-quote-author:not(:empty)::before{ content:' — '; white-space:pre; }
.eb-quote-foot{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:12px; }
.eb-quote-count{ font-size:.72rem; color:var(--text-3); font-variant-numeric:tabular-nums; }
.eb-quote-btn{ width:44px; height:44px; border-radius:50%; border:none; background:var(--brand-orange);
  color:#fff; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; font-size:.95rem;
  box-shadow:0 4px 12px rgba(255,122,0,.28); transition:transform .12s ease, opacity .15s; }
.eb-quote-btn:hover{ opacity:.92; }
.eb-quote-btn:active{ transform:scale(.94); }

/* ===== Sezione ANALISI (6 pulsanti + finestra) ===== */
.eb-analisi{ margin-bottom:22px; }
.eb-analisi-head{ display:flex; align-items:center; justify-content:space-between; margin:2px 4px 12px; }
.eb-analisi-all{ font-size:.76rem; font-weight:700; color:#2563eb; text-decoration:none; }
.eb-analisi-all:hover{ text-decoration:underline; }
.eb-analisi-grid{ display:grid; grid-template-columns:repeat(6,1fr); gap:12px; }
@media (max-width:1150px){ .eb-analisi-grid{ grid-template-columns:repeat(3,1fr); } }
@media (max-width:700px){ .eb-analisi-grid{ grid-template-columns:repeat(2,1fr); } }
.eb-analisi-btn{ position:relative; background:#fff; border:1px solid var(--border); border-radius:16px; box-shadow:var(--sh-xs);
  padding:18px 13px 15px; display:flex; flex-direction:column; align-items:center; text-align:center; gap:10px;
  cursor:pointer; font-family:inherit; overflow:hidden;
  transition:border-color .18s, box-shadow .18s, transform .12s; }
.eb-analisi-btn::before{ content:''; position:absolute; top:0; left:0; right:0; height:3px; background:var(--c); opacity:0; transition:opacity .18s; }
.eb-analisi-btn:hover{ border-color:var(--c); box-shadow:0 13px 26px -12px var(--c); transform:translateY(-3px); }
.eb-analisi-btn:hover::before{ opacity:1; }
.eb-an-ic{ width:46px; height:46px; border-radius:13px; background:var(--cl); color:var(--c);
  display:flex; align-items:center; justify-content:center; font-size:1.15rem;
  transition:background .18s,color .18s,transform .18s; }
.eb-analisi-btn:hover .eb-an-ic{ background:var(--c); color:#fff; transform:scale(1.06); }
.eb-an-t{ font-size:.78rem; font-weight:700; color:var(--text-1); line-height:1.3; }
.eb-an-link{ font-size:.72rem; font-weight:800; color:var(--c); margin-top:auto;
  display:inline-flex; align-items:center; gap:5px; }
.eb-an-link i{ font-size:.66rem; transition:transform .18s; }
.eb-analisi-btn:hover .eb-an-link i{ transform:translateX(3px); }
.eb-analisi-stage{ position:absolute; left:-99999px; top:0; width:1040px; }

.eb-modal-ov{ position:fixed; inset:0; background:rgba(15,23,42,.5); display:none; align-items:center;
  justify-content:center; z-index:1000; padding:2.5vh 2vw; }
.eb-modal-ov.open{ display:flex; }
.eb-modal{ background:#fff; border-radius:16px; width:min(1280px,96vw); max-height:95vh; display:flex;
  flex-direction:column; box-shadow:var(--sh-lg); overflow:hidden; }
.eb-modal-head{ display:flex; align-items:center; justify-content:space-between; padding:14px 22px;
  border-bottom:1px solid var(--border); flex-shrink:0; }
.eb-modal-head h3{ margin:0; font-size:1rem; font-weight:800; color:var(--text-1); }
.eb-modal-head button{ background:none; border:none; font-size:1.7rem; line-height:1; color:var(--text-3);
  cursor:pointer; padding:0 4px; }
.eb-modal-head button:hover{ color:var(--text-1); }
.eb-modal-body{ padding:16px 22px; overflow-y:auto; flex:1; }
.eb-modal-body .chart-container{ box-shadow:none !important; border:none !important; padding:0 !important; margin:0 !important; }
.eb-modal-body .chart-container h3{ font-size:.9rem; }
/* GRAFICI A LINEE riorganizzati: intestazione in alto, poi [grafico | comandi+riquadri] allineati */
.eb-modal-body #storico-impatto-container.eb-2c-done,
.eb-modal-body #crescita-risparmi-container.eb-2c-done{ display:grid;
  grid-template-columns:minmax(0,1fr) 420px; column-gap:26px; row-gap:8px; align-items:start; align-content:start; }
.eb-modal-body .eb-2c-done > h3,
.eb-modal-body .eb-2c-done > .chart-description{ grid-column:1 / -1; margin:0 0 4px; }
.eb-modal-body .eb-2c-done > #storico-impatto-chart-area,
.eb-modal-body .eb-2c-done > #crescita-risparmi-chart-area{ display:none !important; }
.eb-modal-body .eb-2c-left{ grid-column:1; min-width:0; display:flex; flex-direction:column; gap:10px; }
.eb-modal-body .eb-2c-right{ grid-column:2; display:flex; flex-direction:column; gap:12px; }
.eb-modal-body .eb-2c-canvas{ position:relative; min-height:48vh; margin:0; }
.eb-modal-body .eb-2c-right .chart-time-navigation,
.eb-modal-body .eb-2c-right #storico-slider-container,
.eb-modal-body .eb-2c-right #risparmi-slider-container{ margin:0; width:100%; box-sizing:border-box; }
/* CALENDARIO: [legenda | frecce mese] in alto, [canvas | dettaglio] sotto */
.eb-modal-body #cal-chart-area{ display:grid; grid-template-columns:minmax(0,1fr) 380px;
  column-gap:24px; row-gap:10px; align-items:start; align-content:start; }
.eb-modal-body #cal-chart-area > div:first-child{ grid-column:1; grid-row:1; margin:0; }
.eb-modal-body #cal-chart-area > .eb-cal-cv{ grid-column:1; grid-row:2; min-height:44vh; position:relative; }
.eb-modal-body #cal-chart-area > .eb-cal-cv > canvas{ max-width:100%; }
.eb-modal-body #cal-chart-area > .chart-time-navigation{ grid-column:2; grid-row:1; margin:0; }
.eb-modal-body #calendario-addebiti-touch-hint{ grid-column:2; grid-row:2; }
.eb-modal-body #calendario-addebiti-detail{ grid-column:2; grid-row:2; margin:0; }
/* I riquadri di dettaglio riempiono la colonna destra senza tagliare gli importi */
.eb-modal-body .chart-slider-info,
.eb-modal-body #storico-slider-container,
.eb-modal-body #risparmi-slider-container{ width:100%; box-sizing:border-box; }

/* Ogni voce del dettaglio: nome a sinistra, prezzo a destra sulla STESSA riga.
   Il prezzo non va mai a capo (flex-shrink:0 + nowrap); se il nome è lungo va
   a capo lui, ma il prezzo resta allineato in alto accanto ad esso. */
#reddito-detail-items .rd-item{
  display:flex; justify-content:space-between; align-items:baseline;
  gap:12px; break-inside:avoid; -webkit-column-break-inside:avoid;
}
#reddito-detail-items .rd-item > strong{ white-space:nowrap; flex-shrink:0; }

/* Mini-popup interni ai grafici (dettaglio categoria/mese): più larghi su desktop */
@media (min-width:1025px){
  .chart-detail-panel{ max-width:880px !important; max-height:88vh !important; }

  /* Bottom-sheet dettaglio macro-categoria ("Come gestisco il mio reddito"):
     su desktop diventa un modal CENTRATO e più ampio invece di una card
     stretta appoggiata in basso. */
  #reddito-detail-modal{ align-items:center !important; }
  #reddito-detail-sheet{
    max-width:720px !important;
    border-radius:18px !important;
    max-height:82vh !important;
    padding:24px 30px 30px !important;
  }
  /* La lista voci sfrutta lo spazio orizzontale disponendosi su due colonne */
  #reddito-detail-items{ column-count:2; column-gap:34px; }
  #reddito-detail-total{ text-align:center; }
}
/* "DOVE VANNO I MIEI SOLDI": lista categorie a sinistra, totali a DESTRA */
.eb-modal-body #an-soldi{ display:grid; grid-template-columns:minmax(0,1fr) 360px;
  column-gap:24px; row-gap:8px; align-items:start; align-content:start; }
.eb-modal-body #an-soldi > h3,
.eb-modal-body #an-soldi > .chart-description{ grid-column:1 / -1; }
.eb-modal-body #an-soldi > #spese-famiglia-list{ grid-column:1; }
.eb-modal-body #an-soldi > #distribuzione-famiglia-totale{ grid-column:2; margin-top:0 !important; }
.eb-analisi-empty{ text-align:center; color:var(--text-3); padding:44px 16px; font-size:.9rem; }


@media (min-width:1025px){
  main .container, main .main-content > .container{ max-width:1240px; margin:0 auto; padding:8px 36px 48px; }
}

/* --- Pulsanti azione (riutilizzabili) --- */
.eb-btn{ display:inline-flex; align-items:center; gap:8px; padding:10px 18px; border:none; border-radius:24px;
  font-family:var(--font); font-weight:700; font-size:.85rem; cursor:pointer; white-space:nowrap;
  transition:opacity .15s, box-shadow .15s, background .15s, color .15s; text-decoration:none; }
.eb-btn i{ font-size:.85rem; }
.eb-btn-green{ background:var(--grad-green); color:#fff; box-shadow:0 4px 12px rgba(16,185,129,.28); }
.eb-btn-orange{ background:var(--grad-orange); color:#fff; box-shadow:var(--sh-orange); }
.eb-btn-ghost{ background:#fff; color:var(--text-2); border:1px solid var(--border); }
.eb-btn:hover{ opacity:.92; }
.eb-btn-ghost:hover{ background:var(--bg-subtle); color:var(--text-1); }
.eb-conti-actions{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
@media (max-width:1024px){ .eb-conti-actions{ width:100%; } }

/* Intestazione di pagina: titolo a sinistra, pulsanti a destra.
   .eb-pagehead è flex con wrap: quando la finestra si stringe (tablet, finestra
   affiancata) i pulsanti non ci stanno più accanto al titolo e vanno a capo.
   A quel punto, con la sola justify-content:space-between, restavano incollati
   a SINISTRA: fuori posto e diversi da come si vedono su desktop e telefono.
   margin-left:auto li spinge a destra anche quando sono da soli sulla riga. */
.eb-pagehead > .eb-conti-actions,
.eb-pagehead > .eb-imp-headactions{ margin-left:auto; justify-content:flex-end; }

/* Override robusto: sposta il contenuto a destra della sidebar anche con il vecchio CSS della pagina */
@media (min-width:1025px){
  main.main-content{ margin-left:var(--eb-side-w) !important; }
  main.main-content > .container{ max-width:1240px; margin:0 auto; padding:8px 36px 48px; }
}

/* Rollout menù su tutte le pagine: sposta QUALSIASI <main> a destra della sidebar
   e nasconde il vecchio menù (header + bottom-nav) su desktop. */
@media (min-width:1025px){
  main{ margin-left:var(--eb-side-w) !important; }
  header.v2-header, #v2-drawer, .v2-drawer, .menu-overlay, .v2-bottom-nav, #hamburger{ display:none !important; }
}
