/* ===== 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:#dbeafe;
border-color:#93c5fd;
}
.appBottomBar .expenseQuickBtn {
  position: relative;
  padding-left: 34px;
  box-shadow: 0 4px 14px rgba(15,23,42,.08);
}

.appBottomBar .expenseQuickBtn::before {
  content: "+";
  position: absolute;
  left: 11px;
  top: 50%;
  width: 17px;
  height: 17px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}
.appBottomBar .barBtn[data-key="earnings"]    { background:#dcfce7; border-color:#86efac; }
.appBottomBar .barBtn[data-key="liabilities"] { background:#ffedd5; border-color:#fdba74; }
.appBottomBar .barBtn[data-key="commitments"] { background:#ede9fe; border-color:#c4b5fd; }
.appBottomBar .barBtn[data-key="budget"]      { background:#dcfce7; border-color:#86efac; }
.appBottomBar .barBtn[data-key="internal-transfer"] { background:#fef3c7; border-color:#fcd34d; }
.appBottomBar .barBtn[data-key="analysis"]    { background:#e0f2fe; border-color:#7dd3fc; }

/* =========================================================
   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;
  width: 46px;
  min-width: 46px;
  height: 46px;
  min-height: 46px;
  padding: 0;
  background: #fff;
  border: 1px solid #dcdcdc;
  border-radius: 14px;
  margin-right: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.appBottomBar .homeIcon {
  position: relative;
  width: 17px;
  height: 14px;
  margin-top: 5px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 2px;
  box-sizing: border-box;
}

.appBottomBar .homeIcon::before {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  left: 50%;
  top: -7px;
  border-left: 2px solid currentColor;
  border-top: 2px solid currentColor;
  transform: translateX(-50%) rotate(45deg);
  border-radius: 1px;
}
