/* ==========================================================
   PorcoDenaro v1.5.0 - Stile Salvadanaio Smart & Semplice
   Interfaccia chiara con Google Font Icons (Material Symbols)
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;600;700;800;900&family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap');

:root, html, body, [data-theme="light"], [data-theme="dark"] {
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Sfondi e Superfici Chiare */
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --border-color: #e2e8f0;
  
  /* Colori Testo ad Alta Leggibilità */
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;

  /* Accenti Funzionali Amichevoli */
  --green: #059669;
  --green-bg: #ecfdf5;
  --green-border: #a7f3d0;

  --amber: #d97706;
  --amber-bg: #fffbeb;
  --amber-border: #fde68a;

  --rose: #e11d48;
  --rose-bg: #fff1f2;
  --rose-border: #fecdd3;

  --indigo: #4f46e5;
  --indigo-bg: #eef2ff;
  --indigo-border: #c7d2fe;

  /* Palette Viola Moderno per Entrate & Ho Incassato */
  --purple: #7c3aed;
  --purple-light: #8b5cf6;
  --purple-bg: #faf5ff;
  --purple-border: #ddd6fe;

  /* Palette Arancio Caldo per Spese & Ho Speso */
  --warm-orange: #ea580c;
  --warm-orange-light: #f97316;
  --warm-orange-bg: #fff7ed;
  --warm-orange-border: #fed7aa;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 24px -4px rgba(15, 23, 42, 0.07);
  --shadow-card: 0 12px 30px -4px rgba(15, 23, 42, 0.08);

  /* Colori Identità Salvadanaio */
  --salvadanaio-pink: #f43f5e;
  --salvadanaio-piggy: #fda4af;
  --salvadanaio-soft: #fff1f2;

  --transition: all 0.2s ease-out;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main) !important;
  color: var(--text-main) !important;
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  padding-bottom: 90px;
}

.app-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 16px;
}

/* ==========================================================
   HEADER TOP
   ========================================================== */
.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  margin-bottom: 14px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  font-size: 28px;
  line-height: 1;
}

.brand-mascot-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  background: transparent;
  border: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.12));
  animation: floatPiggy 3.2s ease-in-out infinite alternate;
  flex-shrink: 0;
  will-change: transform;
}

.hero-mascot-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 auto 16px auto;
  text-align: center;
}

.hero-mascot-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 14px;
}

.hero-mascot-img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  background: transparent;
  border: none;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.14));
  animation: floatPiggy 2.8s ease-in-out infinite alternate;
  margin: 0 auto;
  will-change: transform;
}

@keyframes floatPiggy {
  0% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-4px) rotate(-1deg); }
  100% { transform: translateY(-7px) rotate(1deg); }
}

.hero-mascot-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.tag-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.status-dot.green { background: #10b981; box-shadow: 0 0 6px rgba(16, 185, 129, 0.6); }
.status-dot.yellow { background: #f59e0b; box-shadow: 0 0 6px rgba(245, 158, 11, 0.6); }
.status-dot.red { background: #ef4444; box-shadow: 0 0 6px rgba(239, 68, 68, 0.6); }

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.user-profile-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.user-profile-btn:hover {
  background: #ffffff;
  border-color: var(--green);
}

/* ==========================================================
   BARRA MESE SEMPLICE
   ========================================================== */
.month-selector-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 6px 14px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.month-label {
  font-weight: 800;
  font-size: 1rem;
  color: var(--text-main);
}

.month-nav-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.month-nav-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

/* ==========================================================
   CARD SALVADANAIO GIGANTE & AMICHEVOLE
   ========================================================== */
.hero-card {
  background: #ffffff;
  border: 2px solid var(--green-border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
  text-align: center;
  position: relative;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  background: var(--green-bg);
  color: var(--green);
  margin-bottom: 10px;
}

.hero-title {
  font-size: 1.15rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.hero-big-number {
  font-size: clamp(3.4rem, 11.5vw, 4.8rem);
  font-weight: 900;
  letter-spacing: -2px;
  color: var(--green);
  line-height: 1.02;
  margin-bottom: 18px;
  text-shadow: 0 4px 20px rgba(16, 185, 129, 0.18);
}

.hero-big-number.negative {
  color: var(--rose);
}

.hero-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 800;
  padding: 6px 18px;
  border-radius: var(--radius-full);
  background: var(--green-bg);
  color: var(--green);
  border: 1.5px solid var(--green-border);
  margin: 4px auto 14px auto;
}

.hero-status-pill.warning {
  background: var(--amber-bg);
  color: var(--amber);
  border-color: var(--amber-border);
}

.hero-status-pill.danger {
  background: var(--rose-bg);
  color: var(--rose);
  border-color: var(--rose-border);
}

/* Due Tessere Chiare di Riepilogo */
.summary-two-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
  text-align: left;
}

.mini-tile {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.mini-tile.income {
  border-left: 4px solid var(--purple);
  background: var(--purple-bg);
}

.mini-tile.income .mini-tile-ico {
  color: var(--purple);
}

.mini-tile.income .mini-tile-val {
  color: var(--purple);
}

.mini-tile.protected {
  border-left: 4px solid var(--warm-orange);
  background: var(--warm-orange-bg);
}

.mini-tile.protected .mini-tile-ico {
  color: var(--warm-orange);
}

.mini-tile.protected .mini-tile-val {
  color: var(--warm-orange);
}

.mini-tile-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.mini-tile-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.mini-tile-sub {
  font-size: 0.72rem;
  color: var(--text-subtle);
  margin-top: 2px;
}

/* ==========================================================
   I DUE GRANDI PULSANTI D'AZIONE ("SMART BUTTONS")
   ========================================================== */
.smart-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.smart-btn {
  border: none;
  border-radius: var(--radius-md);
  padding: 18px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  font-weight: 800;
  font-size: 1rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.smart-btn:hover {
  transform: translateY(-2px);
}

.smart-btn:active {
  transform: scale(0.98);
}

.smart-btn-icon {
  font-size: 24px;
  line-height: 1;
}

.smart-btn.income {
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(109, 40, 217, 0.28);
}

.smart-btn.expense {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(234, 88, 12, 0.28);
}

/* ==========================================================
   SCHEDE CONTENUTO & LISTA MOVIMENTI PULITA
   ========================================================== */
.section-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-head > div:first-child {
  flex: 1;
  min-width: 0;
}

.section-head button,
.section-head .btn-primary,
.section-head .btn-secondary {
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
}

.section-title {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.clean-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.clean-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.clean-item:hover {
  background: #ffffff;
}

.clean-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.clean-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.clean-item-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-main);
}

.clean-item-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.clean-item-val {
  font-weight: 800;
  font-size: 0.95rem;
}

.clean-item-val.income {
  color: var(--green);
}

.clean-item-val.expense {
  color: var(--rose);
}

.clean-item-val.fixed {
  color: var(--indigo);
}

.delete-btn-subtle {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  font-size: 14px;
  margin-left: 8px;
  transition: var(--transition);
}

.delete-btn-subtle:hover {
  color: var(--rose);
}

/* ==========================================================
   CONFIGURATORE SEMPLICE (BOTTONI 1-CLICK)
   ========================================================== */
.tax-simple-box {
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}

.tax-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.tax-btn-choice {
  background: #ffffff;
  border: 1.5px solid var(--border-color);
  color: var(--text-main);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.tax-btn-choice:hover {
  border-color: var(--amber);
  color: var(--amber);
}

.tax-btn-choice.active {
  background: var(--amber);
  color: #ffffff;
  border-color: var(--amber);
}

.tax-config-card {
  background: #ffffff;
  border: 1px solid var(--amber-border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.tax-config-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.tax-badge-rate {
  background: var(--amber-bg);
  color: var(--amber);
  border: 1.5px solid var(--amber-border);
  font-size: 1.15rem;
  font-weight: 800;
  padding: 4px 14px;
  border-radius: var(--radius-full);
}

.tax-slider {
  width: 100%;
  margin: 10px 0 14px 0;
  accent-color: var(--amber);
}

.tax-presets-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.tax-preset-chip {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.tax-preset-chip:hover {
  border-color: var(--amber);
}

.tax-preset-chip.active {
  background: var(--amber);
  color: #ffffff;
  border-color: var(--amber);
}

/* Auth Tabs & Box */
.auth-tabs {
  display: flex;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 4px;
  margin-bottom: 16px;
}

.auth-tab-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.auth-tab-btn.active {
  background: #ffffff;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.auth-alert-msg {
  display: none;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.auth-alert-msg.error {
  display: block;
  background: var(--rose-bg);
  color: var(--rose);
  border: 1px solid var(--rose-border);
}

.auth-alert-msg.success {
  display: block;
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green-border);
}

/* Generic item lists */
.items-list, .clean-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.list-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: all 0.2s ease;
  width: 100%;
  box-sizing: border-box;
  gap: 16px;
}

.list-item-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.item-main-col, .item-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.item-icon-avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.item-icon-avatar .material-symbols-rounded {
  font-size: 22px !important;
}

/* Palette badge per le categorie */
.badge-emerald { background: #ecfdf5; color: #059669; }
.badge-amber   { background: #fffbeb; color: #d97706; }
.badge-orange  { background: #fff7ed; color: #ea580c; }
.badge-rose    { background: #fff1f2; color: #e11d48; }
.badge-blue    { background: #eff6ff; color: #2563eb; }
.badge-purple  { background: #faf5ff; color: #9333ea; }
.badge-indigo  { background: #eef2ff; color: #4f46e5; }
.badge-yellow  { background: #fefce8; color: #ca8a04; }
.badge-gray    { background: #f1f5f9; color: #475569; }

.item-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.item-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.item-meta, .item-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-action-col, .item-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.item-amount {
  font-weight: 800;
  font-size: 1.05rem;
  text-align: right;
  white-space: nowrap;
  margin-right: 2px;
}

.item-amount.daily, .item-amount.expense {
  color: var(--warm-orange);
}

.item-amount.income {
  color: var(--purple);
}

.item-amount.fixed {
  color: var(--indigo);
}

.item-delete-btn, .btn-icon-danger {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: var(--bg-subtle);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  padding: 0;
}

.item-delete-btn .material-symbols-rounded,
.btn-icon-danger .material-symbols-rounded {
  font-size: 18px !important;
}

.item-delete-btn:hover, .btn-icon-danger:hover {
  background: var(--rose-bg);
  color: var(--rose);
  border-color: var(--rose-border);
  transform: scale(1.08);
}

.item-edit-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: var(--purple-bg);
  color: var(--purple);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  padding: 0;
}

.item-edit-btn .material-symbols-rounded {
  font-size: 18px !important;
}

.item-edit-btn:hover {
  background: var(--purple);
  color: #ffffff;
  transform: scale(1.08);
}

/* ==========================================================
   BARRA DI NAVIGAZIONE MOBILE A 3 TASTI FACILI
   ========================================================== */
.bottom-nav-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  padding: 6px 12px 10px 12px;
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.06);
}

.nav-item {
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-width: 68px;
}

.nav-item:hover {
  color: var(--text-main);
}

.nav-item.active {
  color: var(--purple) !important;
  background: var(--purple-bg) !important;
  transform: translateY(-2px);
}

.nav-item.active .nav-icon {
  color: var(--purple) !important;
}

.nav-item[data-tab="settings"].active {
  color: var(--warm-orange) !important;
  background: var(--warm-orange-bg) !important;
  transform: translateY(-2px);
}

.nav-item[data-tab="settings"].active .nav-icon {
  color: var(--warm-orange) !important;
}

.nav-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-item.active .nav-icon {
  transform: scale(1.15);
}

.cute-nav-svg {
  width: 26px;
  height: 26px;
  display: block;
  overflow: visible;
}

/* ==========================================================
   GOOGLE FONT ICONS (MATERIAL SYMBOLS ROUNDED)
   ========================================================== */
.material-symbols-rounded {
  font-family: 'Material Symbols Rounded';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
  user-select: none;
}

.nav-item .material-symbols-rounded {
  font-size: 26px;
  font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 26;
  color: var(--text-muted);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-item:hover .material-symbols-rounded {
  color: var(--text-main);
}

.nav-item.active .material-symbols-rounded {
  font-variation-settings: 'FILL' 1, 'wght' 700, 'GRAD' 0, 'opsz' 26;
  color: var(--green);
  transform: scale(1.12);
}

.sec-ico {
  font-size: 1.3rem !important;
  vertical-align: middle;
  margin-right: 6px;
  color: var(--green);
  display: inline-flex;
  align-items: center;
}

.mini-tile-ico {
  font-size: 1.15rem !important;
  vertical-align: middle;
  margin-right: 4px;
  display: inline-flex;
  align-items: center;
}

.chip-ico {
  font-size: 1.05rem !important;
  vertical-align: middle;
  margin-right: 4px;
  display: inline-flex;
  align-items: center;
}

.btn-inline-ico {
  font-size: 1.15rem !important;
  vertical-align: middle;
  margin-right: 8px;
  display: inline-flex;
  align-items: center;
}

.clean-item-icon.material-symbols-rounded {
  font-size: 1.35rem;
  color: var(--text-main);
}

/* ==========================================================
   MODALI PULITE E SEMPLICI
   ========================================================== */
.modal-backdrop, .modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop.open, .modal-backdrop.active,
.modal-overlay.open, .modal-overlay.active {
  display: flex !important;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-box, .modal-content {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 440px;
  width: 100%;
  padding: 24px 20px;
  box-shadow: var(--shadow-card);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close, .close-modal-btn {
  background: var(--bg-subtle);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 18px;
}

.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-control, .form-input, .form-select {
  width: 100%;
  padding: 12px 14px;
  background: #ffffff;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  transition: var(--transition);
}

.form-control:focus, .form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.form-hint {
  font-size: 0.78rem;
  color: var(--text-subtle);
  margin-top: 4px;
}

.modal-footer, .modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.btn-primary {
  background: var(--green);
  color: #ffffff;
  border: none;
  padding: 12px 20px;
  font-weight: 800;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary:hover {
  background: #047857;
}

.btn-secondary {
  background: var(--bg-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 12px 18px;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: #ffffff;
}

.btn-danger {
  background: #fef2f2;
  color: var(--rose);
  border: 1px solid var(--rose-border);
  padding: 8px 14px;
  font-weight: 700;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-danger:hover {
  background: var(--rose);
  color: #ffffff;
}

/* ==========================================================
   BOX DI CONFERMA CANCELLAZIONE ELEGANTE & PERSONALIZZATO
   ========================================================== */
#confirm-modal {
  z-index: 999999 !important;
}

#confirm-modal.open, #confirm-modal.active {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

#install-modal {
  z-index: 999999 !important;
}

#install-modal.open, #install-modal.active {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.install-modal-box {
  max-width: 440px !important;
  padding: 22px 20px !important;
}

.install-os-tabs {
  display: flex;
  gap: 8px;
  background: var(--bg-subtle);
  padding: 4px;
  border-radius: var(--radius-md);
  margin: 14px 0 16px 0;
}

.install-os-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.84rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.install-os-tab.active {
  background: #ffffff;
  color: var(--purple);
  box-shadow: var(--shadow-sm);
}

.install-step-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.install-step-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #f8fafc;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: left;
}

.install-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--purple-bg);
  color: var(--purple);
  border: 1.5px solid var(--purple-border);
  font-weight: 800;
  font-size: 0.86rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.install-step-body {
  flex: 1;
}

.install-step-title {
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--text-main);
  margin-bottom: 2px;
}

.install-step-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.install-benefits-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-color);
}

.install-benefit-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
}

.install-benefit-tag .material-symbols-rounded {
  font-size: 0.95rem;
  color: var(--purple);
}

/* Floating Install Banner Popup */
.install-floating-banner {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 28px);
  max-width: 480px;
  z-index: 9999;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid var(--purple-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 36px -6px rgba(124, 58, 237, 0.22), 0 4px 12px rgba(15, 23, 42, 0.08);
  padding: 10px 14px;
  animation: slideUpBanner 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpBanner {
  from {
    opacity: 0;
    transform: translate(-50%, 24px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

.install-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.install-banner-icon-box {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--purple-bg);
  border: 1px solid var(--purple-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.install-banner-mascot {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.install-banner-text {
  flex: 1;
  min-width: 0;
}

.install-banner-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.install-banner-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.install-banner-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.install-banner-cta {
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-light) 100%);
  color: #ffffff;
  border: none;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.28);
  transition: transform 0.15s ease;
}

.install-banner-cta:hover {
  transform: translateY(-1px);
}

.install-banner-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease;
}

.install-banner-close:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.confirm-dialog-box {
  max-width: 380px !important;
  text-align: center;
  padding: 28px 22px 22px 22px !important;
  border-radius: var(--radius-lg) !important;
  animation: zoomIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18) !important;
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.confirm-dialog-icon-wrap {
  width: 62px;
  height: 62px;
  background: #fef2f2;
  color: var(--rose);
  border: 1.5px solid var(--rose-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px auto;
  box-shadow: 0 8px 16px rgba(225, 29, 72, 0.12);
}

.confirm-dialog-icon {
  font-size: 32px !important;
}

.confirm-dialog-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
  line-height: 1.25;
}

.confirm-dialog-msg {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 22px;
}

.confirm-dialog-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.confirm-cancel-btn {
  flex: 1;
  padding: 12px 16px !important;
  font-weight: 700;
  border-radius: var(--radius-md) !important;
}

.btn-danger-confirm {
  flex: 1;
  background: var(--rose);
  color: #ffffff;
  border: none;
  padding: 12px 16px;
  font-weight: 800;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.28);
  transition: var(--transition);
}

.btn-danger-confirm:hover {
  background: #be123c;
  transform: translateY(-1px);
}

/* Toast */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: #0f172a;
  color: #ffffff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: var(--shadow-card);
  animation: fadeIn 0.2s ease-out;
}

.empty-state {
  text-align: center;
  padding: 24px 12px;
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* Tab Panes */
.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.2s ease-out;
}

/* ==========================================================
   PAGINA DI LOGIN DEDICATA (FULL-SCREEN VIEW)
   ========================================================== */
.view-login-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.login-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  max-width: 440px;
  width: 100%;
  box-shadow: var(--shadow-card);
  text-align: center;
  position: relative;
}

.login-mascot-img {
  width: 110px;
  height: 110px;
  object-fit: contain;
  margin-bottom: 12px;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.12));
  animation: floatPiggy 2.8s ease-in-out infinite alternate;
  will-change: transform;
}

.login-title {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--text-main);
  line-height: 1.1;
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 22px;
}

.guest-skip-btn {
  background: transparent;
  border: none;
  color: var(--text-subtle);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 18px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.guest-skip-btn:hover {
  color: var(--green);
  background: var(--green-bg);
}

.cute-nav-mascot {
  width: 26px;
  height: 26px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* ==========================================================
   PERFEZIONE MOBILE SCREEN (FINTECH BANKING EXPERIENCE)
   ========================================================== */
@media (max-width: 600px) {
  .app-container {
    padding: 12px 12px 90px 12px;
  }

  .top-header {
    padding: 10px 14px;
    border-radius: var(--radius-md);
  }

  .brand-title {
    font-size: 1.15rem;
  }

  .brand-subtitle {
    font-size: 0.72rem;
  }

  .hero-card {
    padding: 20px 14px;
  }

  .hero-title {
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: 6px;
  }

  .hero-big-number {
    font-size: clamp(3.0rem, 11vw, 3.9rem);
    letter-spacing: -1.2px;
    margin-bottom: 16px;
    line-height: 1.02;
    text-shadow: 0 3px 15px rgba(16, 185, 129, 0.18);
  }

  .summary-two-tiles {
    gap: 8px;
  }

  .mini-tile {
    padding: 10px 12px;
  }

  .mini-tile-val {
    font-size: 1.25rem;
    font-weight: 800;
  }

  .smart-actions-grid {
    gap: 10px;
  }

  .smart-btn {
    padding: 14px 10px;
    font-size: 0.94rem;
  }

  .section-card {
    padding: 16px 12px;
  }

  .section-head {
    gap: 10px;
  }

  .section-head button,
  .section-head .btn-primary,
  .section-head .btn-secondary {
    padding: 7px 12px !important;
    font-size: 0.8rem !important;
    white-space: nowrap !important;
  }

  .section-title {
    font-size: 0.98rem;
  }

  .list-item-card {
    padding: 12px 14px;
    gap: 12px;
  }

  .item-main-col, .item-left {
    gap: 10px;
  }

  .item-action-col, .item-right {
    gap: 12px;
  }

  .item-icon-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .item-icon-avatar .material-symbols-rounded {
    font-size: 20px !important;
  }

  .item-title {
    font-size: 0.88rem;
    line-height: 1.35;
  }

  .item-meta, .item-subtitle {
    font-size: 0.72rem;
  }

  .item-amount {
    font-size: 0.98rem;
    margin-right: 2px;
  }

  .item-delete-btn, .btn-icon-danger {
    width: 34px;
    height: 34px;
  }

  .bottom-nav-bar {
    height: 64px;
    padding-bottom: env(safe-area-inset-bottom, 4px);
  }

  .nav-item {
    padding: 6px 0;
  }

  .nav-label {
    font-size: 0.72rem;
  }
}
