:root{
  --bg1:#ff9a9e;
  --bg2:#fad0c4;
  --card: rgba(255,255,255,.82);
  --border: rgba(255,255,255,.5);
  --text:#1f2430;
  --muted:#5b6377;
  --accent:#ff5f7e;
  --accent2:#8b5cf6;
  --shadow: 0 14px 40px rgba(20,20,40,.12);
  --radius: 18px;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color:var(--text);
  background: radial-gradient(900px 500px at 15% 10%, rgba(255,255,255,.65), transparent 55%),
              linear-gradient(135deg, var(--bg1), var(--bg2));
  min-height:100vh;
}

.bg-glow{
  position:fixed; inset:-40px;
  background: radial-gradient(700px 360px at 80% 20%, rgba(139,92,246,.25), transparent 60%),
              radial-gradient(650px 360px at 20% 80%, rgba(255,95,126,.22), transparent 60%);
  filter: blur(10px);
  pointer-events:none;
}

.container{
  width:min(920px, 92vw);
  margin: 26px auto 36px;
  position:relative;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:14px;
}

h1{margin:0; font-size:30px; letter-spacing:.2px}
.subtitle{margin:4px 0 0; color:var(--muted)}
.hidden{display:none !important}

.card{
  background: var(--card);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin: 14px 0;
}

label{display:block; font-size:13px; color:var(--muted); margin-bottom:6px}
input, select{
  width:100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid rgba(20,20,40,.12);
  background: rgba(255,255,255,.9);
  outline:none;
}
input:focus, select:focus{
  border-color: rgba(255,95,126,.55);
  box-shadow: 0 0 0 4px rgba(255,95,126,.12);
}

.grid2{display:grid; grid-template-columns: 1fr 1fr; gap:12px}
.grid3{display:grid; grid-template-columns: 1.1fr 1fr 1fr; gap:12px}
@media (max-width:720px){
  .grid2,.grid3{grid-template-columns:1fr}
}

.row{display:flex; align-items:center}
.between{justify-content:space-between}
.gap{gap:10px}

.actions{display:flex; gap:10px; margin-top:12px; flex-wrap:wrap}

.btn{
  border:none;
  border-radius: 14px;
  padding: 11px 14px;
  font-weight: 700;
  cursor:pointer;
  background: linear-gradient(135deg, var(--accent), #ff86a0);
  color:white;
  box-shadow: 0 10px 22px rgba(255,95,126,.22);
}
.btn.secondary{
  background: linear-gradient(135deg, var(--accent2), #a78bfa);
  box-shadow: 0 10px 22px rgba(139,92,246,.18);
}
.btn.ghost{
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(20,20,40,.14);
  box-shadow: none;
}
.btn.mini{padding:9px 10px; border-radius: 12px; font-size: 13px}

.badge{
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,95,126,.12);
  border: 1px solid rgba(255,95,126,.22);
  font-weight: 700;
  font-size: 12px;
}

.muted{color:var(--muted)}
.small{font-size:12px}
.hint{margin:10px 0 0; font-size: 12px; color: var(--muted)}

.stats{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}
@media (max-width:720px){ .stats{grid-template-columns:1fr} }

.stat{
  padding: 12px;
  border-radius: 16px;
  background: rgba(255,255,255,.75);
  border: 1px solid rgba(20,20,40,.08);
}

.label{font-size:12px; color:var(--muted)}
.value{font-size:22px; font-weight:900; margin-top:6px}

.progress{
  height: 10px;
  border-radius: 999px;
  background: rgba(20,20,40,.08);
  overflow:hidden;
  margin-top:10px;
}
.bar{
  height:100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  width:0%;
}

.list{
  list-style:none;
  padding:0;
  margin: 10px 0 0;
}
.list li{
  display:flex;
  justify-content:space-between;
  gap:10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(20,20,40,.06);
  margin-bottom: 8px;
  font-size: 14px;
}
.footer{
  text-align:center;
  color: rgba(30,30,55,.7);
  margin-top: 14px;
  font-size: 12px;
}

.tabs{
  position: sticky;
  top: 10px;
  z-index: 5;

  display: flex;
  gap: 10px;
  padding: 10px;

  border-radius: 16px;
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(255,255,255,.5);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);

  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar{ display:none; }

.tab{
  flex: 0 0 auto;
  white-space: nowrap;
  border: 1px solid rgba(20,20,40,.12);
  background: rgba(255,255,255,.8);
  padding: 10px 12px;
  border-radius: 14px;
  font-weight: 800;
  cursor: pointer;
}

.tab.active{
  border-color: rgba(255,95,126,.45);
  box-shadow: 0 0 0 4px rgba(255,95,126,.10);
}

/* Delete button in history */
.iconbtn{
  border: 1px solid rgba(20,20,40,.12);
  background: rgba(255,255,255,.85);
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 900;
}

/* Desktop behavior: boleh tetep tampil semua biar enak */
@media (min-width: 900px){
  .tabs{ position: static; }
  #tab-dash, #tab-add, #tab-hist { display: block !important; }
  #tab-dash.hidden, #tab-add.hidden, #tab-hist.hidden { display:block !important; }
}

/* biar row bisa shrink dengan benar */
.row.between{
  gap: 10px;
}

/* penting: biar judul ga kepake terlalu banyak */
.row.between h2{
  margin: 0;
  min-width: 0;
}

/* badge email: bisa mengecil + ellipsis */
.badge{
  max-width: 52%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 420px){
  .badge{ max-width: 46%; }
}
