/* ===== LAYOUT ===== */
body { font-size: 0.9rem; }

.amount { text-align: right; font-variant-numeric: tabular-nums; }
.amount.entrata { color: #198754; }
.amount.uscita  { color: #dc3545; }

[data-bs-theme="dark"] .amount.entrata { color: #75c98f; }
[data-bs-theme="dark"] .amount.uscita  { color: #f18b8b; }

/* ===== CARDS ===== */
.card-stat {
  border: none;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  transition: transform .15s;
}
[data-bs-theme="dark"] .card-stat { box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.card-stat:hover { transform: translateY(-2px); }
.card-stat .stat-amount {
  font-size: 1.6rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ===== TABELLE ===== */
.table-responsive { -webkit-overflow-scrolling: touch; }
.table th {
  white-space: nowrap;
  font-weight: 600;
  font-size: .8rem;
  text-transform: uppercase;
  color: #6c757d;
}
[data-bs-theme="dark"] .table th { color: #adb5bd; }

/* ===== BADGE TIPO ===== */
.badge-entrata { background-color: #d1e7dd; color: #0f5132; }
.badge-uscita  { background-color: #f8d7da; color: #842029; }
[data-bs-theme="dark"] .badge-entrata { background-color: #0f5132; color: #d1e7dd; }
[data-bs-theme="dark"] .badge-uscita  { background-color: #842029; color: #f8d7da; }

/* ===== BADGE METODO ===== */
.badge-contanti  { background-color: #d1e7dd; color: #0f5132; }
.badge-carta     { background-color: #cfe2ff; color: #084298; }
.badge-bonifico  { background-color: #e2d9f3; color: #432874; }
[data-bs-theme="dark"] .badge-contanti  { background-color: #0f5132; color: #d1e7dd; }
[data-bs-theme="dark"] .badge-carta     { background-color: #084298; color: #cfe2ff; }
[data-bs-theme="dark"] .badge-bonifico  { background-color: #432874; color: #e2d9f3; }

/* ===== COLOR SWATCH ===== */
.color-swatch {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  display: inline-block;
  flex-shrink: 0;
  transition: transform .1s, border-color .1s;
}
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.selected { border-color: #0d6efd; box-shadow: 0 0 0 2px #0d6efd44; }

/* ===== CATEGORY DOT ===== */
.cat-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 5px;
  flex-shrink: 0;
  vertical-align: middle;
}

/* ===== TOUCH FRIENDLY ===== */
.btn-touch { min-height: 44px; min-width: 44px; }
.form-control, .form-select { min-height: 44px; }
.btn-xs {
  padding: .2rem .45rem;
  font-size: .75rem;
  border-radius: .25rem;
  line-height: 1.4;
}

/* ===== NAV ===== */
.nav-link.active { background-color: rgba(255,255,255,.15); border-radius: 6px; }

/* ===== TOAST ===== */
.toast { min-width: 280px; }

/* ===== LOGIN ===== */
#loginPage .card { border: none; border-radius: 16px; }

/* ===== MOBILE ===== */
@media (max-width: 576px) {
  .card-stat .stat-amount { font-size: 1.3rem; }
  .container-fluid { padding-left: .75rem; padding-right: .75rem; }
  .table td, .table th { padding: .4rem .5rem; }
}

/* ===== TOTALS HIDDEN ===== */
.stat-amount.blurred {
  filter: blur(6px);
  user-select: none;
}

/* ===== BOTTOM NAV MOBILE ===== */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 1030;
  background: var(--bs-body-bg);
  border-top: 1px solid var(--bs-border-color);
  display: flex !important;
  justify-content: space-around;
  align-items: stretch;
  padding: 6px 0 env(safe-area-inset-bottom, 0);
  box-shadow: 0 -2px 8px rgba(0,0,0,.12);
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 2px;
  padding: 4px 2px;
  font-size: .65rem;
  color: var(--bs-secondary-color);
  text-decoration: none;
  transition: color .15s;
  min-width: 0;
}
.bottom-nav-item i { font-size: 1.2rem; }
.bottom-nav-item.active { color: var(--bs-primary); }
.bottom-nav-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* ===== FAB ===== */
.fab-btn {
  position: fixed;
  right: 20px;
  bottom: 80px;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--bs-primary);
  color: #fff;
  border: none;
  font-size: 1.4rem;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
  z-index: 1029;
  display: flex !important;
  align-items: center;
  justify-content: center;
  transition: transform .15s, box-shadow .15s;
}
.fab-btn:hover { transform: scale(1.08); box-shadow: 0 6px 16px rgba(0,0,0,.35); }

/* ===== PADDING BOTTOM when mobile nav visible ===== */
@media (max-width: 991px) {
  #appContent { padding-bottom: 80px; }
  .container-fluid { padding-left: .6rem; padding-right: .6rem; }
  .table td, .table th { padding: .35rem .4rem; font-size: .8rem; }
  /* Nascondi colonne meno importanti su mobile */
  .hide-mobile { display: none !important; }
  /* Navbar più compatta */
  #mainNav .navbar-brand { font-size: .95rem; }
}

/* ===== REPORT ===== */
.report-kpi { transition: transform .15s; }
.report-kpi:hover { transform: translateY(-2px); }
