/* =============================================
   GLOBAL STYLES — Reset & Layout Base
   ============================================= */
@import url("variables.css");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-family);
}

html,
body {
  height: 100vh;
  overflow: hidden;
}

body {
  background: var(--color-bg);
  display: flex;
}

/* ---- MAIN CONTENT AREA ---- */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--color-bg-main);
}

/* ---- SNAPSHOT ROW (storico salvataggi) ---- */
.snapshot-row {
  padding: 4px 10px;
  margin: 2px 0;
}

/* ---- SPINNER OVERLAY (sopra tutto) ---- */
.spinner-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(3px);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}
.spinner-overlay.active {
  display: flex;
}
.spinner-overlay .spinner {
  background: white;
  padding: 32px 40px;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.spinner-overlay .spinner i {
  font-size: 40px;
  color: var(--blue);
}
.spinner-overlay .spinner span {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ---- TOP BAR ---- */
.top-bar {
  background: var(--color-bg-cream);
  padding: 12px 28px;
  border-bottom: 1px solid var(--color-bg-cream-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  height: 64px;
}
.top-bar h2 {
  font-weight: 600;
  font-size: 20px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 14px;
}
.top-bar h2 i {
  color: var(--blue);
  font-size: 24px;
}

/* ---- PAGE WRAPPER ---- */
.page-wrapper {
  flex: 1;
  overflow: hidden;
  padding: 16px 20px 20px 20px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--color-bg-cream);
}

/* ---- SEPARATOR ---- */
.separator {
  border: none;
  border-top: 2px solid #e9edf2;
  margin: 8px 0 24px 0;
}

/* ---- ANNO CONTROLS ---- */
.anno-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--color-bg-cream);
  padding: 4px 12px;
  border-radius: 40px;
}
.anno-controls button {
  background: transparent;
  border: none;
  font-size: 18px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 30px;
  transition: 0.1s;
  font-weight: 600;
}
.anno-controls button:hover {
  background: var(--color-bg-cream-border);
  color: var(--text-primary);
}
.anno-controls .anno-label {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 60px;
  text-align: center;
}

/* ---- RIEPILOGO ANNUALE (top-bar) ---- */
.riepilogo-annuale {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  font-weight: 600;
}
.riepilogo-annuale .riep-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0px;
}
.riepilogo-annuale .riep-label {
  font-size: 9px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1;
  margin-bottom: 2px;
}
.riepilogo-annuale .riep-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 14px;
  border-radius: 20px;
  white-space: nowrap;
  line-height: 1.3;
}
.riepilogo-annuale .riep-item.entrate {
  color: var(--green-text);
  background: var(--green-light);
}
.riepilogo-annuale .riep-item.uscite {
  color: var(--red-text);
  background: var(--red-light);
}
.riepilogo-annuale .riep-item.saldo {
  color: var(--green-text);
  background: var(--green-light);
  border: 1px solid var(--green-border);
}
.riepilogo-annuale .riep-item.saldo.negative {
  color: var(--red-text);
  background: var(--red-light);
  border-color: var(--red-border);
}
.riepilogo-annuale .riep-item i {
  font-size: 12px;
}
