/* ================= THEME ================= */
:root {
  --accent: #c9a227;
  --text: #1e293b;
  --muted: #64748b;
}

/* ================= RESET ================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Poppins", sans-serif;
}

/* ================= BODY ================= */
body {
  min-height: 100vh;
  background: linear-gradient(
    180deg,
    #ffffff 10%,
    #e0f2fe 40%,
    #bae6fd 50%,
    #04032B 75%
  );
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 70px;
  overflow-x: hidden; /* CRITICAL */
}

/* ================= TOP BAR ================= */
.top-bar {
  width: 100%;
  display: flex;
  align-items: center;
  background: #ffffffcc;
  padding: 12px 20px;
  position: fixed;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ================= SEARCH ================= */
.search-bar {
  text-align: center;
  margin: 20px;
}

.search-bar input {
  padding: 12px 14px;
  width: 80%;
  max-width: 420px;
  font-size: 14px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  outline: none;
}

/* ================= GRID (FIXED) ================= */
.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)); /* FORCE 4, NO OVERFLOW */
  gap: 12px;
  width: 100%;
  max-width: 100%;
  margin-top: 20px;
  padding: 0 12px;
}

/* Scale up on larger screens */
@media (min-width: 768px) {
  .grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid {
    grid-template-columns: repeat(6, 1fr);
    max-width: 90%;
  }
}

/* ================= ICON BUTTON ================= */
.icon-btn {
  background: #ffffffdd;
  padding: 14px 8px; /* TIGHT */
  border-radius: 16px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.16);
  text-align: center;
  cursor: pointer;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  transition: transform 0.25s ease, box-shadow 0.25s ease;
  overflow: hidden; /* CRITICAL */
}

.icon-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.25);
}

/* ================= ICON ================= */
.icon-btn img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  margin-bottom: 6px;
}

/* ================= LABEL (SINGLE LINE) ================= */
.icon-btn span {
  font-size: 11px;
  font-weight: 500;
  color: var(--text);
  text-align: center;

  white-space: nowrap;       /* NO WRAP */
  overflow: hidden;
  text-overflow: ellipsis;   /* CLEAN CUT */
  max-width: 100%;
}

/* ================= CARD ================= */
.card {
  width: 340px;
  height: 200px;
  border-radius: 22px;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  padding: 22px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

.card .logo {
  font-size: 22px;
  font-weight: 600;
}

.card .number {
  font-size: 18px;
  letter-spacing: 2px;
}

.card .details {
  font-size: 12px;
  color: #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card .balance {
  position: absolute;
  bottom: 12px;
  right: 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

/* ================= BUTTONS ================= */
.buttons {
  margin-top: 40px;
  display: flex;
  gap: 20px;
}

.btn {
  flex: 1;
  padding: 14px;
  border-radius: 16px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  background: linear-gradient(135deg, #facc15, #eab308);
  color: #1e293b;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.btn:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.25);
}

/* ================= FOOTER ================= */
footer {
  margin-top: auto;
  padding: 16px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* ================= OVERLAYS ================= */
#customAuthOverlay,
#customAlertOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* ================= ALERT BOX ================= */
#customAlertBox {
  background: #ffffff;
  padding: 22px 28px;
  border-radius: 16px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

#customAlertBox h2 {
  font-size: 20px;
  color: var(--text);
}

#customAlertBox p {
  margin: 14px 0;
  color: var(--muted);
  font-size: 14px;
}

#customAlertBox button {
  padding: 10px 22px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #facc15, #eab308);
  font-weight: 600;
  cursor: pointer;
}
/* ================= WALLET FLIP ================= */
.wallet-flip {
  perspective: 1200px;
  margin-bottom: 30px;
}

.wallet-inner {
  position: relative;
  width: 340px;
  height: 200px;
  transform-style: preserve-3d;
  transition: transform 0.9s cubic-bezier(.4,.2,.2,1);
}

.wallet-flip.flipped .wallet-inner {
  transform: rotateY(180deg);
}

.wallet-front,
.wallet-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
}

.wallet-back {
  transform: rotateY(180deg);
  background: linear-gradient(135deg, #020617, #1e293b);
}

.chart-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 30px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.08);
  width: 90%;
}

.chart-title {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 15px;
  color: #111827;
}

.bar-chart {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  height: 180px;
  padding: 10px 0;
}

.bar-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 70px;
  margin:10px;
}

.bar-value {
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 6px;
  color: #111827;
}

.bar-outer {
  height: 120px;
  width: 100%;
  background: #e5e7eb;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.bar-inner {
  width: 100%;
  height: 0;
  border-radius: 14px;
  transition: height 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.bar-label {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
}
