@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

*{
  margin:0;
  padding:0;
  box-sizing:border-box;
}

:root{
  --primary:#38bdf8;
  --primary-dark:#0ea5e9;
  --accent:#818cf8;
  --green:#22c55e;
  --red:#ef4444;

  --bg:#070b17;
  --card:rgba(255,255,255,.05);
  --border:rgba(255,255,255,.08);

  --text:#f8fafc;
  --muted:#94a3b8;
}

body{
  font-family:'Poppins',sans-serif;
  background:#070b17;
  color:var(--text);
  min-height:100vh;
  overflow-x:hidden;
  position:relative;
}

/* =========================
   AURORA BACKGROUND
========================= */

body::before,
body::after{
  content:'';
  position:fixed;
  width:600px;
  height:600px;
  border-radius:50%;
  filter:blur(120px);
  z-index:-2;
}

body::before{
  background:#38bdf8;
  top:-200px;
  left:-200px;
  opacity:.25;
  animation:blob1 18s infinite alternate;
}

body::after{
  background:#818cf8;
  bottom:-200px;
  right:-200px;
  opacity:.25;
  animation:blob2 20s infinite alternate;
}

@keyframes blob1{
  from{
    transform:translate(0,0);
  }
  to{
    transform:translate(120px,-80px);
  }
}

@keyframes blob2{
  from{
    transform:translate(0,0);
  }
  to{
    transform:translate(-120px,80px);
  }
}

/* =========================
   TOPBAR
========================= */

.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;

  padding:25px 40px;

  background:rgba(255,255,255,.03);

  backdrop-filter:blur(20px);

  border-bottom:1px solid var(--border);
}

.brand h1{
  font-size:2rem;
  font-weight:800;

  background:
  linear-gradient(
  135deg,
  #fff,
  var(--primary),
  var(--accent));

  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
}

.brand p{
  color:var(--muted);
  margin-top:6px;
}

.top-actions{
  display:flex;
  align-items:center;
  gap:15px;
}

.clock{
  text-align:right;
}

#clock-time{
  display:block;
  font-size:1.1rem;
  font-weight:700;
}

#clock-date{
  color:var(--muted);
}

#themeBtn{
  width:48px;
  height:48px;
  border-radius:50%;
}

/* =========================
   HERO
========================= */

.hero{
  text-align:center;
  padding:35px 20px;
}

#greeting{
  display:inline-block;

  padding:10px 22px;

  border-radius:50px;

  background:
  rgba(56,189,248,.12);

  border:
  1px solid rgba(56,189,248,.3);

  color:var(--primary);
}

/* =========================
   STATS
========================= */

.stats-grid{
  display:grid;

  grid-template-columns:
  repeat(auto-fit,minmax(220px,1fr));

  gap:20px;

  max-width:1300px;

  margin:auto;

  padding:0 25px;
}

.stat-card{
  background:var(--card);

  backdrop-filter:blur(20px);

  border:1px solid var(--border);

  border-radius:24px;

  padding:25px;

  transition:.35s;

  position:relative;

  overflow:hidden;
}

.stat-card:hover{
  transform:translateY(-8px);
}

.stat-card::before{
  content:'';

  position:absolute;

  top:0;
  left:0;

  width:100%;
  height:4px;
}

.saldo::before{
  background:linear-gradient(90deg,#38bdf8,#818cf8);
}

.income::before{
  background:linear-gradient(90deg,#22c55e,#16a34a);
}

.expense::before{
  background:linear-gradient(90deg,#ef4444,#dc2626);
}

.saving::before{
  background:linear-gradient(90deg,#f59e0b,#fbbf24);
}

.stat-card span{
  font-size:2rem;
}

.stat-card h3{
  margin-top:10px;
  color:var(--muted);
  font-size:.9rem;
}

.stat-card p{
  margin-top:10px;
  font-size:1.8rem;
  font-weight:700;
}

/* =========================
   MAIN GRID
========================= */

.main-grid{
  display:grid;
  grid-template-columns:1fr 1fr;

  gap:25px;

  max-width:1300px;

  margin:30px auto;

  padding:0 25px;
}

.form-card,
.chart-card,
.history-card{
  background:var(--card);

  backdrop-filter:blur(20px);

  border:1px solid var(--border);

  border-radius:24px;

  padding:25px;
}

.form-card h2,
.chart-card h2,
.history-card h2{
  margin-bottom:20px;
}

/* =========================
   FORM
========================= */

input,
select{
  width:100%;

  padding:14px 16px;

  margin-bottom:14px;

  border-radius:14px;

  border:1px solid rgba(255,255,255,.08);

  background:
  rgba(255,255,255,.04);

  color:var(--text);

  font-family:'Poppins';
}

input:focus,
select:focus{
  outline:none;

  border-color:var(--primary);

  box-shadow:
  0 0 0 3px
  rgba(56,189,248,.15);
}

button{
  border:none;

  border-radius:14px;

  padding:14px;

  cursor:pointer;

  color:white;

  font-weight:600;

  background:
  linear-gradient(
  135deg,
  var(--primary),
  var(--primary-dark));

  transition:.3s;
}

button:hover{
  transform:translateY(-2px);
}

/* =========================
   CHART
========================= */

.chart-card{
  display:flex;
  flex-direction:column;
  align-items:center;
}

#financeChart{
  max-width:320px;
  max-height:320px;
}

.progress-box{
  width:100%;
  margin-top:20px;
}

.progress{
  height:12px;

  margin-top:10px;

  border-radius:50px;

  overflow:hidden;

  background:
  rgba(255,255,255,.08);
}

#progressBar{
  height:100%;
  width:0%;

  border-radius:50px;

  background:
  linear-gradient(
  90deg,
  #22c55e,
  #ef4444);

  transition:1s;
}

/* =========================
   HISTORY
========================= */

.history-card{
  max-width:1300px;

  margin:30px auto;

  overflow:hidden;
}

.history-top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:20px;

  margin-bottom:20px;
}

.actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.actions input{
  width:220px;
  margin-bottom:0;
}

.actions select{
  width:auto;
  margin-bottom:0;
}

table{
  width:100%;
  border-collapse:collapse;
}

thead{
  background:
  rgba(56,189,248,.12);
}

th{
  padding:15px;
  text-align:left;
}

td{
  padding:15px;
  border-top:
  1px solid rgba(255,255,255,.06);
}

tbody tr{
  transition:.3s;
}

tbody tr:hover{
  background:
  rgba(255,255,255,.04);
}

/* =========================
   TOAST
========================= */

#toast{
  position:fixed;

  top:20px;
  right:20px;

  background:
  linear-gradient(
  135deg,
  #22c55e,
  #16a34a);

  padding:12px 22px;

  border-radius:12px;

  color:white;

  opacity:0;

  transition:.4s;

  z-index:9999;
}

/* =========================
   MOBILE
========================= */

@media(max-width:900px){

  .topbar{
    flex-direction:column;
    gap:15px;
    text-align:center;
  }

  .main-grid{
    grid-template-columns:1fr;
  }

  .history-top{
    flex-direction:column;
    align-items:stretch;
  }

  .actions{
    flex-direction:column;
  }

  .actions input{
    width:100%;
  }

}

@media(max-width:600px){

  .brand h1{
    font-size:1.4rem;
  }

  .stat-card p{
    font-size:1.3rem;
  }

  table{
    font-size:.85rem;
  }

}
.light-mode{

 body.light-mode{
  --bg: #f8fafc;
  --bg-card: rgba(255,255,255,0.95);
  --border: rgba(0,0,0,0.1);
  --text: #111827;
  --muted: #64748b;

  background: #f1f5f9;
 }
}

/* tombol kembali */
.back-btn{
  display:flex;
  align-items:center;
  justify-content:center;

  padding:12px 18px;

  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.1);

  border-radius:14px;

  text-decoration:none;
  color:#fff;

  font-size:14px;
  font-weight:600;

  transition:.3s ease;
}

.back-btn:hover{
  transform:translateY(-2px);

  background:rgba(56,189,248,.15);

  border-color:#38bdf8;

  box-shadow:0 8px 20px rgba(56,189,248,.25);
}
.back-btn:active{
  transform:translateY(0);
}

  body{
  transition:opacity .3s ease;
}


.top-actions{
  display:flex;
  align-items:center;
  gap:12px;
}

.back-btn{
  text-decoration:none;

  padding:10px 16px;

  border-radius:12px;

  background:rgba(255,255,255,.06);

  border:1px solid rgba(255,255,255,.1);

  color:var(--text);

  font-size:14px;
  font-weight:600;

  transition:.3s;
}

.back-btn:hover{
  transform:translateY(-2px);

  border-color:#38bdf8;

  background:rgba(56,189,248,.12);

  box-shadow:0 8px 20px rgba(56,189,248,.25);
}