:root {
  --primary: #22c55e;
  --primary-dark: #16a34a;
  --secondary: #3b82f6;
  --danger: #ef4444;
  --warning: #f59e0b;

  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #111827;
  --gray: #6b7280;
  --border: #e5e7eb;

  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  --radius: 20px;
}

body.dark {
  --bg: #0f172a;
  --card: #1e293b;
  --text: #ffffff;
  --gray: #94a3b8;
  --border: #334155;
}

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

body {
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
}

/* ===================
SIDEBAR
=================== */

.sidebar {
  width: 260px;
  background: var(--card);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  padding: 25px;
  box-shadow: var(--shadow);
  z-index: 100000;
  overflow-y: auto;
}

.logo {
  margin-bottom: 40px;
}

.logo h2 {
  color: var(--primary);
  margin-bottom: 5px;
}

.logo span {
  color: var(--gray);
  font-size: 13px;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.menu-btn {
  border: none;
  background: #f3f4f6;
  padding: 14px;
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  font-size: 15px;
  transition: 0.3s;
}

body.dark .menu-btn {
  background: #334155;
  color: #fff;
}

.menu-btn:hover,
.menu-btn.active {
  background: var(--primary);
  color: white;
}

/* ===================
MAIN
=================== */

.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 30px;
}

/* ===================
TOPBAR
=================== */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

.top-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.top-right{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:nowrap;
}

.topbar h1 {
  font-size: 28px;
}

.topbar p {
  color: var(--gray);
}

.hamburger {
  display: none;
  border: none;
  background: var(--primary);
  color: white;
  width: 45px;
  height: 45px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 20px;
}

#darkModeBtn {
  border: none;
  width: 45px;
  height: 45px;
  border-radius: 12px;
  background: var(--secondary);
  color: white;
  cursor: pointer;
  font-size: 18px;
}

/* ===================
PAGE
=================== */

.page {
  display: none;
}

.page.active {
  display: block;
}

/* ===================
CARDS
=================== */



.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 25px;
  box-shadow: var(--shadow);
  transition: 0.3s;
}

.card:hover {
  transform: translateY(-5px);
}

.card h3 {
  color: var(--gray);
  font-size: 14px;
  margin-bottom: 10px;
}

.card h2 {
  font-size: 28px;
}

.income {
  border-left: 5px solid var(--primary);
}

.expense {
  border-left: 5px solid var(--danger);
}

.saving {
  border-left: 5px solid var(--warning);
}

.saldo {
  border-left: 5px solid var(--secondary);
}

/* ===================
TARGET
=================== */



.target-card {
  background: var(--card);
  padding: 25px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.target-card h3 {
  margin-bottom: 15px;
}

.target-card h2 {
  margin-bottom: 15px;
}

.progress {
  width: 100%;
  height: 12px;
  background: #e5e7eb;
  border-radius: 50px;
  overflow: hidden;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: 0.5s;
}

.target-card p {
  margin-top: 10px;
  font-weight: 600;
}

/* ===================
REKENING
=================== */


.rekening-card {
  background: var(--card);
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
}

.rekening-card span {
  display: block;
  color: var(--gray);
  font-size: 13px;
  margin: 10px 0;
}

.rekening-card h2 {
  color: var(--primary);
}

.rekening-page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.rekening-detail {
  background: var(--card);
  padding: 25px;
  border-radius: var(--radius);
  text-align: center;
  box-shadow: var(--shadow);
}

.rekening-detail p {
  margin-top: 10px;
  font-size: 24px;
  color: var(--primary);
  font-weight: 700;
}

/* ===================
CHART
=================== */

.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.chart-box {
  background: var(--card);
  padding: 25px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.chart-box h3 {
  margin-bottom: 20px;
}

.full-width {
  grid-column: 1/-1;
}

/* ===================
FORM
=================== */

.form-card {
  background: var(--card);
  padding: 30px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 700px;
}

.form-card h2 {
  margin-bottom: 20px;
}

form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

input,
select {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
}

.btn-primary {
  border: none;
  padding: 15px;
  border-radius: 14px;
  background: var(--primary);
  color: white;
  cursor: pointer;
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

/* ===================
LAPORAN
=================== */

.laporan-card {
  background: var(--card);
  padding: 25px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.filter-row {
  display: flex;
  gap: 10px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.laporan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.laporan-grid div {
  background: rgba(0, 0, 0, 0.03);
  padding: 20px;
  border-radius: 14px;
  text-align: center;
}

.laporan-grid p {
  margin-top: 10px;
  font-size: 24px;
  font-weight: 700;
}

/* ===================
WISHLIST
=================== */

.wishlist-list {
  display: grid;
  gap: 15px;
}

.wishlist-item {
  padding: 16px;
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

/* ===================
FAB
=================== */

.fab {
  position: fixed;
  right: 25px;
  bottom: 25px;
  width: 60px;
  height: 60px;
  border: none;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 30px;
  cursor: pointer;
  box-shadow: var(--shadow);
  z-index: 100;
}

.fab-menu {
  position: fixed;
  right: 25px;
  bottom: 95px;
  display: none;
  flex-direction: column;
  gap: 10px;
}

.fab-menu button {
  border: none;
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--card);
  cursor: pointer;
  box-shadow: var(--shadow);
}

/* ===================
OVERLAY
=================== */

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 999;
}

/* ===================
MOBILE
=================== */

@media (max-width: 992px) {
  .sidebar {
    left: -280px;
    transition: 0.3s;
  }

  .sidebar.show {
    left: 0;
  }

  .main-content {
    margin-left: 0;
    padding: 20px;
  }

  .hamburger {
    display: block;
  }

  .overlay.show {
    display: block;
  }

  .chart-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {

  .topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;

  position: sticky;
  top: 0;
  z-index: 999;

  background: var(--bg);
  padding: 15px 0;
  }

  .topbar h1 {
    font-size: 22px;
  }
}


.logout-btn{
  height:45px; /* sama dengan dark mode */
  padding:0 14px;

  border:none;
  border-radius:12px;

  background:linear-gradient(
    135deg,
    #ff4d4d,
    #ff6b6b
  );

  color:#fff;
  font-size:13px;
  font-weight:600;

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

  width:auto; /* lebar otomatis */
  white-space:nowrap; /* jangan turun baris */

  cursor:pointer;
  transition:.3s;
}



/* =========================================
ULTRA RESPONSIVE FINANCE DASHBOARD
========================================= */

html,
body{
  width:100%;
  max-width:100%;
  overflow-x:hidden;
}

.page,
.main-content{
  width:100%;
  max-width:100%;
  overflow-x:hidden;
}

/* DESKTOP */

.swiper-card{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:20px;
  margin-bottom:25px;
}

.swiper-target{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(280px,1fr));
  gap:20px;
  margin-bottom:25px;
}

.swiper-rekening{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:20px;
  margin-bottom:25px;
}

/* TABLET */

@media (max-width:992px){

  .main-content{
    margin-left:0;
    padding:18px;
  }

  .chart-grid{
    grid-template-columns:1fr;
  }

}

/* MOBILE */

@media (max-width:768px){

  .main-content{
    padding:12px;
    padding-top:90px;
  }

  .topbar{
    position:fixed;
    top:0;
    left:0;
    right:0;

    z-index:999;

    display:flex;
    justify-content:space-between;
    align-items:center;

    background:var(--bg);

    padding:12px;

    box-shadow:0 2px 10px rgba(0,0,0,.08);
  }
}

  .topbar h1{
    font-size:20px;
  }

  .topbar p{
    font-size:12px;
  }

  /* FILTER */

  .filter-row{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px;
  }

  .filter-row .btn-primary{
    grid-column:1/-1;
    width:100%;
  }

  /* SWIPE */

  .swiper-card,
  .swiper-target,
  .swiper-rekening{
    display:flex;
    overflow-x:auto;
    overflow-y:hidden;
    gap:14px;
    scroll-snap-type:x mandatory;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
    padding-bottom:10px;
  }

  .swiper-card::-webkit-scrollbar,
  .swiper-target::-webkit-scrollbar,
  .swiper-rekening::-webkit-scrollbar{
    display:none;
  }

  .swiper-card .card{
    flex:0 0 calc(100vw - 40px);
    min-width:calc(100vw - 40px);
    scroll-snap-align:center;
  }

  .swiper-target .target-card{
    flex:0 0 calc(100vw - 40px);
    min-width:calc(100vw - 40px);
    scroll-snap-align:center;
  }

  .swiper-rekening .rekening-card{
    flex:0 0 calc(50vw - 15px);
    min-width:calc(50vw - 15px);
    scroll-snap-align:center;
  }

  /* CHART */

  .chart-grid{
    grid-template-columns:1fr;
    gap:15px;
  }

  .chart-box{
    overflow:hidden;
    padding:18px;
  }

  .chart-box canvas,
  #pieChart,
  #barChart,
  #trendChart{
    width:100% !important;
    max-width:100%;
    height:auto !important;
    max-height:300px;
  }

  /* FORM */

  .form-card{
    width:100%;
    max-width:100%;
    padding:20px;
  }

  input,
  select,
  .btn-primary{
    width:100%;
  }

  /* DETAIL REKENING */

  .rekening-page-grid{
    grid-template-columns:1fr;
  }

  /* FONT */

  .card h2{
    font-size:24px;
  }

  .target-card h2{
    font-size:24px;
  }

  .rekening-card h2{
    font-size:20px;
  }

  /* FAB */

  .fab{
    width:58px;
    height:58px;
    font-size:28px;
  }

}

/* HEADER TETAP */
.top-left,
.top-right{
  flex-shrink:0;
}

.top-right{
  display:flex;
  align-items:center;
  gap:10px;
}

.logout-btn,
#darkModeBtn,
.hamburger{
  position:relative;
  z-index:10000;
}

