* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: #101827;
  color: #f1f5f9;
  font-family: Arial, sans-serif;
  padding: 18px;
}

header {
  margin: 15px 0 25px;
}

header h1 {
  color: #22c55e;
  font-size: 30px;
  letter-spacing: 2px;
}

header p {
  color: #94a3b8;
  margin-top: 5px;
}

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.card,
.panel {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 16px;
  padding: 18px;
}

.card p {
  color: #94a3b8;
  font-size: 13px;
  margin-bottom: 10px;
}

.card h2 {
  font-size: 23px;
  overflow-wrap: anywhere;
}

.balance {
  background: #14532d;
  border-color: #166534;
}

.balance p {
  color: #bbf7d0;
}

.panel {
  margin-bottom: 18px;
}

.panel h2 {
  font-size: 18px;
  margin-bottom: 18px;
}

label {
  display: block;
  color: #cbd5e1;
  font-size: 13px;
  margin: 14px 0 7px;
}

input,
select {
  width: 100%;
  padding: 13px;
  border-radius: 10px;
  border: 1px solid #475569;
  background: #0f172a;
  color: white;
  font-size: 15px;
  outline: none;
}

button {
  width: 100%;
  padding: 14px;
  margin-top: 20px;
  border: none;
  border-radius: 10px;
  background: #22c55e;
  color: #052e16;
  font-size: 15px;
  font-weight: bold;
}

button:active {
  opacity: 0.8;
}

#expenseChart {
  display: block;
  max-width: 100%;
  margin: 0 auto 20px;
}

.summary-row,
.history-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #334155;
  font-size: 13px;
}

.summary-row span:last-child,
.history-item strong {
  text-align: right;
  overflow-wrap: anywhere;
}

.history-item small {
  display: block;
  color: #94a3b8;
  margin-top: 5px;
}

.delete-btn {
  width: auto;
  padding: 7px 12px;
  margin-top: 8px;
  background: #7f1d1d;
  color: white;
  font-size: 12px;
}

.empty {
  color: #94a3b8;
  text-align: center;
  padding: 20px 0;
}

.green {
  color: #4ade80;
}

.red {
  color: #f87171;
}

@media (min-width: 600px) {
  body {
    max-width: 700px;
    margin: auto;
  }

  .cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .balance {
    grid-column: span 2;
  }
}

/* ===== MYFINC MONEY ANIMATION ===== */

.money-animation {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(10, 18, 32, 0.96);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease;
}

.money-animation.active {
  opacity: 1;
  visibility: visible;
}

.money-animation h2 {
  color: #4ade80;
  margin-top: 30px;
  font-size: 23px;
}

.money-animation p {
  color: #cbd5e1;
  margin-top: 10px;
  font-size: 14px;
  text-align: center;
}

.money-scene {
  position: relative;
  width: 230px;
  height: 180px;
}

.money-bill {
  position: absolute;
  width: 75px;
  height: 42px;
  background: #4ade80;
  border: 2px solid #166534;
  border-radius: 6px;
  color: #14532d;
  font-weight: bold;
  display: grid;
  place-items: center;
  left: 78px;
  top: 20px;
  z-index: 5;
}

/* AMPLOP */

.envelope {
  position: absolute;
  width: 120px;
  height: 75px;
  left: 55px;
  bottom: 10px;
  overflow: hidden;
}

.envelope-back {
  position: absolute;
  inset: 0;
  background: #d6a75d;
  border-radius: 8px;
}

.envelope-front {
  position: absolute;
  bottom: 0;
  width: 0;
  height: 0;
  border-left: 60px solid transparent;
  border-right: 60px solid transparent;
  border-bottom: 55px solid #b77932;
  z-index: 4;
}

/* DOMPET */

.wallet {
  position: absolute;
  width: 130px;
  height: 85px;
  left: 50px;
  bottom: 5px;
  display: none;
}

.wallet-body {
  position: absolute;
  inset: 15px 0 0;
  background: #2563a6;
  border-radius: 12px;
}

.wallet-flap {
  position: absolute;
  top: 0;
  width: 130px;
  height: 48px;
  background: #3b82c4;
  border-radius: 10px;
  z-index: 3;
}

.wallet-button {
  position: absolute;
  width: 15px;
  height: 15px;
  background: #facc15;
  border-radius: 50%;
  top: 25px;
  right: 15px;
  z-index: 4;
}

/* ANIMASI PENGELUARAN */

.money-animation.expense .envelope {
  display: block;
}

.money-animation.expense .wallet {
  display: none;
}

.money-animation.expense .money-bill {
  animation: moneyOut 1.2s ease forwards;
}

@keyframes moneyOut {
  0% {
    transform: translateY(0) scale(.8);
    opacity: 0;
  }

  30% {
    opacity: 1;
  }

  100% {
    transform: translateY(-85px) scale(1);
    opacity: 1;
  }
}

/* ANIMASI PEMASUKAN */

.money-animation.income .wallet {
  display: block;
}

.money-animation.income .envelope {
  display: none;
}

.money-animation.income .money-bill {
  animation: moneyIn 1.2s ease forwards;
}

@keyframes moneyIn {
  0% {
    transform: translateY(-80px) scale(1);
    opacity: 0;
  }

  30% {
    opacity: 1;
  }

  100% {
    transform: translateY(35px) scale(.3);
    opacity: 0;
  }
}

/* FINANCIAL DASHBOARD */

.financial-dashboard {
  overflow: hidden;
}

.chart-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 15px 0;
}

.chart-filter select {
  padding: 10px;
  border-radius: 8px;
}

.finance-highlight {
  background: #1e293b;
  color: white;
  padding: 18px;
  border-radius: 14px;
  margin-bottom: 20px;
}

.finance-highlight h2 {
  margin: 8px 0;
  font-size: 25px;
}

.finance-highlight p {
  color: #cbd5e1;
  margin: 0;
}

.chart-box {
  margin-top: 22px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.08);
  overflow-x: auto;
}

.chart-box canvas {
  display: block;
  width: 100%;
  min-width: 300px;
  height: auto;
}
/* MONTHLY BUDGET */

.budget-item {
  background: rgba(148, 163, 184, 0.08);
  padding: 15px;
  margin: 14px 0;
  border-radius: 12px;
}

.budget-item h3 {
  margin-bottom: 10px;
}

.budget-item p {
  margin: 6px 0;
  font-size: 14px;
}

.budget-item label {
  display: block;
  margin-top: 12px;
  font-size: 13px;
}

.budget-input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  margin-top: 7px;
  border: 1px solid #64748b;
  border-radius: 8px;
  font-size: 15px;
}

.budget-progress {
  width: 100%;
  height: 10px;
  background: #334155;
  border-radius: 20px;
  overflow: hidden;
  margin: 12px 0;
}

.budget-progress div {
  height: 100%;
  background: #22c55e;
  border-radius: 20px;
  transition: width 0.3s ease;
}

#budgetMonth {
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  margin: 8px 0 15px;
  border-radius: 8px;
}
/* BUDGET WARNING COLORS */

.budget-status {
  font-weight: bold;
  padding: 8px;
  border-radius: 8px;
  margin: 8px 0;
}

.budget-safe {
  color: #16a34a;
  background: rgba(34, 197, 94, 0.12);
}

.budget-caution {
  color: #ca8a04;
  background: rgba(234, 179, 8, 0.12);
}

.budget-warning {
  color: #ea580c;
  background: rgba(249, 115, 22, 0.12);
}

.budget-danger {
  color: #dc2626;
  background: rgba(239, 68, 68, 0.12);
}

.budget-neutral {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.12);
}
.budget-percentage {
  text-align: right;
  font-size: 13px;
  font-weight: bold;
  margin-top: 5px;
}
.budget-percentage {
  text-align: right;
  font-size: 13px;
  font-weight: bold;
  margin-top: 5px;
}
99999
/* KALENDER TRANSAKSI */

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
}

.calendar-header h3 {
  font-size: 16px;
  margin: 0;
  text-align: center;
}

.calendar-header button {
  border: none;
  border-radius: 8px;
  padding: 9px 14px;
  background: #2563eb;
  color: white;
  font-size: 16px;
  cursor: pointer;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  text-align: center;
}

.calendar-day-name {
  font-size: 12px;
  font-weight: bold;
  padding: 8px 0;
  color: #64748b;
}

.calendar-date {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-size: 13px;
  cursor: pointer;
  background: transparent;
}

.calendar-date.has-transaction::after {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #22c55e;
  margin-top: 3px;
}

.calendar-date.selected {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}

.calendar-date.today {
  border: 2px solid #2563eb;
  font-weight: bold;
}

.calendar-empty {
  visibility: hidden;
}

#calendarDetails {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

.calendar-detail-item {
  padding: 10px;
  margin-top: 8px;
  border-radius: 8px;
  background: rgba(128, 128, 128, 0.08);
}

.calendar-income {
  color: #16a34a;
}

.calendar-expense {
  color: #dc2626;
}

/* FIX VISIBILITAS ANGKA KALENDER */
.calendar-date {
  color: #1e293b !important;
  background-color: #ffffff;
  font-weight: 600;
  min-height: 44px;
}

.calendar-date.selected {
  color: #ffffff !important;
  background-color: #2563eb;
}

.calendar-date.today {
  border: 2px solid #2563eb;
}


/* PERBAIKAN TOMBOL TANGGAL KALENDER */
.calendar-grid .calendar-date {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 4px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1e293b !important;
  background: #ffffff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
}

.calendar-grid .calendar-date.selected {
  color: #ffffff !important;
  background: #2563eb;
}

.calendar-grid .calendar-date.today {
  border: 2px solid #2563eb;
}

/* TES PAKSA TAMPILAN ANGKA */
.calendar-grid .calendar-date {
  opacity: 1 !important;
  visibility: visible !important;
  display: flex !important;
  position: relative !important;
  z-index: 10 !important;
  -webkit-text-fill-color: #1e293b !important;
}
9999
/* AUTHENTICATION MYFINC */

.auth-section {
  display: none;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #101827;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  padding: 28px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 18px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.auth-card h1 {
  color: #38bdf8;
  text-align: center;
  margin-bottom: 5px;
}

.auth-card > p {
  color: #94a3b8;
  text-align: center;
}

.auth-card h2 {
  color: white;
  margin: 28px 0 20px;
}

.auth-card label {
  display: block;
  color: #cbd5e1;
  margin: 14px 0 7px;
}

.auth-card input {
  width: 100%;
  padding: 13px;
  background: #0f172a;
  color: white;
  border: 1px solid #475569;
  border-radius: 9px;
  outline: none;
}

.auth-card button {
  width: 100%;
  padding: 13px;
  margin-top: 18px;
  border: none;
  border-radius: 9px;
  background: #0284c7;
  color: white;
  font-weight: bold;
  cursor: pointer;
}

#toggleAuth {
  background: transparent;
  color: #38bdf8;
}

#authMessage {
  font-size: 13px;
  margin-top: 12px;
}
