/* ===== Bottom Bar (Reusable) ===== */
:root {
  --bottom-bar-height: 98px;
  --bottom-bar-safe-gap: 28px;
  --bottom-bar-reserved-space: calc(
    var(--bottom-bar-height) + var(--bottom-bar-safe-gap) + env(safe-area-inset-bottom)
  );
}

/* Apply only on pages that actually use the bottom bar */
body.has-bottom-bar {
  padding-bottom: var(--bottom-bar-reserved-space) !important;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Bar container */
.appBottomBar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;

  height: var(--bottom-bar-height);
  background: rgba(255,255,255,0.96);
  border-top: 1px solid #e7e7e7;
  z-index: 12000;
  backdrop-filter: blur(6px);

  display: flex;
  align-items: center;

  /* ✅ Symmetry gap like top bar */
  padding: 10px 12px;

  /* ✅ safe-area for iPhone */
  padding-bottom: calc(10px + env(safe-area-inset-bottom));

  box-sizing: border-box;
}

/* Scroll row */
.appBottomBar .barRow {
  display: flex;
  align-items: center;
  gap: 10px;

  /* ✅ keep row padding 0 because container already has padding */
  padding: 0;

  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  width: 100%;

  -webkit-overflow-scrolling: touch;
}

/* Hide scrollbar (still scrollable) */
.appBottomBar .barRow::-webkit-scrollbar { display: none; }
.appBottomBar .barRow { scrollbar-width: none; }

/* Button style */
.appBottomBar .barBtn {
  border: 1px solid #dcdcdc;
  background: #fff;
  padding: 12px 14px;
  border-radius: 14px;
  cursor: pointer;

  font-size: 13px;
  font-weight: 700;
  line-height: 1;

  min-height: 46px;     /* better tap area */
  flex: 0 0 auto;
}

/* Optional: visually indicate current page if you ever show it */
.appBottomBar .barBtn.isActive {
  border-color: #b9c4ff;
  background: #f4f6ff;

}


/* Light pastel themes by button key */
.appBottomBar .barBtn[data-key="expense"]     { background:#eaf3ff; border-color:#cfe3ff; }
.appBottomBar .barBtn[data-key="earnings"]    { background:#eafff3; border-color:#c9f3de; }
.appBottomBar .barBtn[data-key="liabilities"] { background:#fff3ea; border-color:#ffd9bf; }
.appBottomBar .barBtn[data-key="commitments"] { background:#f3eeff; border-color:#dbccff; }
.appBottomBar .barBtn[data-key="budget"]      { background:#eefaf3; border-color:#c8efd8; }
.appBottomBar .barBtn[data-key="internal-transfer"] { background:#fffbe6; border-color:#f3e7b0; }
.appBottomBar .barBtn[data-key="analysis"]    { background:#eef7ff; border-color:#cfe9ff; }

/* =========================================================
   Hard protection: bottom bar text color must not be affected
   by page-level global button rules.
   ========================================================= */

#appBottomBar,
.app-bottom-bar {
  color: #333 !important;   /* replace with the exact index color if different */
}

#appBottomBar button,
#appBottomBar button *,
.app-bottom-bar button,
.app-bottom-bar button * {
  color: inherit !important;
}

/* 🔵 Commit Button Highlight */
.commitPrimaryBtn {
  background: linear-gradient(135deg, #4a6cff, #6f8cff);
  color: #ffffff;
  font-weight: 600;
  border-radius: 10px;
}

/* Active state override */
.commitPrimaryBtn.isActive {
  background: linear-gradient(135deg, #3b5bdb, #5c7cfa);
  color: #ffffff;
}

/* Optional: slight elevation */
.commitPrimaryBtn {
  box-shadow: 0 2px 6px rgba(74,108,255,0.25);
}

/* ── Fixed Home button ── */
.appBottomBar .homeBtn {
  flex: 0 0 auto;
  min-width: 46px;
  min-height: 46px;
  padding: 0;
  font-size: 18px;
  background: #fff;
  border: 1px solid #dcdcdc;
  border-radius: 14px;
  margin-right: 4px;
}
