/* --- 1. CONFIG & VARIABLES --- */
:root {
  /* Color Palette - Modern & Clean */
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --secondary: #a5b4fc;

  --bg-body: #f3f4f6;
  --card-bg: #ffffff;

  --text-main: #1f2937;
  --text-sub: #6b7280;
  --border-color: #e5e7eb;

  /* Status Colors */
  --green: #10b981;
  --red: #ef4444;
  --blue: #3b82f6;
  --orange: #f97316;
  --purple: #8b5cf6;

  /* Mode Colors */
  --work-mode: var(--primary);
  --break-mode: var(--green);

  /* Wallet Brand Colors */
  --dana: #118ee9;
  --ovo: #4c3494;
  --gopay: #00aa13;
  --cash: #4b5563;

  /* Effects */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md:
    0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg:
    0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius: 16px;
}

body.dark-mode {
  --bg-body: #111827;
  --card-bg: #1f2937;
  --text-main: #f3f4f6;
  --text-sub: #9ca3af;
  --border-color: #374151;
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

body.dark-mode select {
  background-color: var(--card-bg);
  color: var(--text-main);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
  transition: all 0.2s ease;
}
body {
  background-color: var(--bg-body);
  color: var(--text-main);
  padding: 20px;
  min-height: 100vh;
  -webkit-user-select: none; /* Safari */
  -ms-user-select: none; /* IE 10 and IE 11 */
  user-select: none; /* Standard syntax */
}
.main-container {
  max-width: 1280px;
  margin: 0 auto;
  padding-bottom: 50px;
}

/* --- 2. COMPONENTS --- */
button {
  cursor: pointer;
  border: none;
  font-family: inherit;
}
input,
select,
textarea {
  background: var(--bg-body);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 10px 15px;
  border-radius: 10px;
  width: 100%;
  outline: none;
  font-size: 0.9rem;
}
input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
  background: var(--card-bg);
}

/* Buttons */
.btn-primary {
  background: var(--primary);
  color: white;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 600;
  transition: 0.3s;
}
.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.btn-text-danger {
  background: none;
  color: var(--red);
  font-weight: 600;
  padding: 10px 20px;
}
.btn-text-danger:hover {
  background: rgba(239, 68, 68, 0.1);
  border-radius: 10px;
}
.btn-block {
  width: 100%;
}

/* --- 3. LOGIN & MODAL --- */
.modal-backdrop,
.login-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  /* [FIX] Z-Index tinggi agar di atas header */
  z-index: 99999 !important;
  backdrop-filter: blur(5px); /* Opsional: biar background nge-blur */

  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.login-card {
  background: var(--card-bg);
  width: 100%;
  max-width: 420px;
  border-radius: 20px;
  padding: 30px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  position: relative;
  z-index: 10;
  margin: 0;
}

.modal-content {
  background: var(--card-bg);
  width: 100%;
  max-width: 450px;
  border-radius: 20px;
  padding: 25px;
  box-shadow: var(--shadow-lg);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.close-icon {
  background: none;
  font-size: 1.5rem;
  color: var(--text-sub);
}
.modal-body textarea {
  height: 150px;
  resize: vertical;
}
.modal-body .form-group {
  margin-bottom: 15px;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* --- 4. NEW HEADER MODERN STYLE (V2.0) --- */
.header-modern {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.7); /* Glass Effect Terang */
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 24px;
  padding: 20px 30px;
  margin-bottom: 25px;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
  position: relative;
  z-index: 50;
  gap: 20px;
  transition: all 0.3s ease;
}

body.dark-mode .header-modern {
  background: rgba(30, 41, 59, 0.6); /* Glass Effect Gelap */
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* --- SEKSI KIRI: PROFILE --- */
.header-profile-section {
  display: flex;
  align-items: center;
  gap: 15px;
  flex: 1;
}

.avatar-container {
  position: relative;
  cursor: pointer;
  transition: transform 0.3s;
}
.avatar-container:hover {
  transform: scale(1.05) rotate(5deg);
}

.avatar-hexagon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  border-radius: 18px; /* Squircle */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.level-badge-floating {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-main);
  color: var(--bg-body);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  border: 2px solid var(--card-bg);
}

/* [PERBAIKAN] Style Header Name */
.text-info h1 {
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 2px;

  /* [FIX] Agar teks panjang tidak turun baris */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 250px; /* Batasi lebar */

  background: linear-gradient(90deg, var(--text-main), var(--primary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

@media (max-width: 900px) {
  .text-info h1 {
    font-size: 1.2rem;
    max-width: 100%;
    white-space: normal;
  }
}

.mini-date {
  font-size: 0.75rem;
  color: var(--text-sub);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(16, 185, 129, 0.1);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.7rem;
  color: var(--green);
  font-weight: 700;
  margin-top: 3px;
}
.dot-online {
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
  animation: pulseGreen 2s infinite;
}
@keyframes pulseGreen {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* --- SEKSI TENGAH: STATS (XP & STREAK) --- */
.header-stats-section {
  flex: 1.2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: rgba(0, 0, 0, 0.03); /* Sedikit gelap untuk pemisah */
  padding: 10px 20px;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.05);
}
body.dark-mode .header-stats-section {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.05);
}

.xp-box {
  width: 100%;
}
.xp-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 5px;
  color: var(--text-sub);
}
.xp-val {
  color: var(--primary);
}

.xp-track {
  height: 8px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}
body.dark-mode .xp-track {
  background: rgba(255, 255, 255, 0.1);
}

.xp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #a855f7);
  border-radius: 10px;
  position: relative;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.xp-glow {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 10px;
  background: white;
  opacity: 0.5;
  filter: blur(3px);
  animation: shimmer 2s infinite;
}
@keyframes shimmer {
  0% {
    opacity: 0.1;
  }
  50% {
    opacity: 0.7;
  }
  100% {
    opacity: 0.1;
  }
}

.streak-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  text-align: center;
}
.flame-anim {
  font-size: 1.5rem;
  color: var(--orange);
  margin-bottom: 2px;
  filter: drop-shadow(0 0 5px rgba(249, 115, 22, 0.5));
  animation: burn 1.5s infinite alternate;
}
.streak-num {
  font-weight: 800;
  font-size: 1rem;
  line-height: 1;
  color: var(--text-main);
}
.streak-label {
  font-size: 0.6rem;
  color: var(--text-sub);
  text-transform: uppercase;
}

/* --- SEKSI KANAN: JAM & TOMBOL --- */
.header-action-section {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
  justify-content: flex-end;
}

.digital-clock {
  background: var(--bg-body);
  padding: 8px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.05);
}
.digital-clock span {
  font-family: "Poppins", monospace; /* Monospace agar angka tidak goyang */
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--primary);
  text-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

.action-buttons {
  display: flex;
  gap: 10px;
}

.icon-btn-glass {
  width: 45px;
  height: 45px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-sub);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.icon-btn-glass:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
}

/* --- QUOTE BARU (SLIM & MODERN) --- */
.quote-modern {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  padding: 15px 25px;
  display: flex;
  align-items: center;
  gap: 15px;
  color: white;
  box-shadow: 0 10px 20px -5px rgba(118, 75, 162, 0.4);
  margin-bottom: 30px;
  position: relative;
  overflow: hidden;
}

.quote-modern::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -10%;
  width: 150px;
  height: 150px;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.2) 0%,
    transparent 70%
  );
  border-radius: 50%;
}

.quote-icon {
  font-size: 1.2rem;
  background: rgba(255, 255, 255, 0.2);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}

.quote-text-wrapper {
  flex: 1;
}
.quote-text {
  font-style: italic;
  font-weight: 500;
  font-size: 0.95rem;
  margin: 0;
  line-height: 1.4;
}

.quote-deco {
  font-size: 1.5rem;
  animation: spin 5s linear infinite;
}
@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

/* RESPONSIVE UNTUK HEADER BARU */
@media (max-width: 900px) {
  .header-modern {
    flex-direction: column;
    text-align: center;
    gap: 20px;
    padding: 20px;
  }
  .header-profile-section,
  .header-stats-section,
  .header-action-section {
    width: 100%;
    justify-content: center;
  }
  .header-profile-section {
    flex-direction: column;
  }
  .avatar-container {
    margin-bottom: 10px;
  }
  .header-stats-section {
    padding: 15px;
  }
  .action-buttons {
    justify-content: center;
  }
}

/* --- 5. LAYOUT & CARD (Existing) --- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1.2fr;
  gap: 30px;
  align-items: start;
}
.sidebar-column {
  display: flex;
  flex-direction: column;
  gap: 30px;
}
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 25px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.title-with-icon {
  display: flex;
  align-items: center;
  gap: 12px;
}
.icon-box {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-size: 1.1rem;
}
.icon-box.purple {
  background: var(--primary);
}
.icon-box.blue {
  background: var(--blue);
}
.icon-box.green {
  background: var(--green);
}
.card h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
}

/* --- 6. JADWAL (LIVE STATUS BARU) --- */
.filter-controls-advanced {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}
.filter-controls-advanced select {
  flex: 1;
  font-size: 0.85rem;
  padding: 8px 10px;
}
/* --- PERBAIKAN NAVIGASI HARI (AGAR RAPI & PENDEK) --- */
.nav-pills {
  background: var(--bg-body); /* Warna background */
  padding: 4px 8px; /* Jarak dalam yang lebih tipis */
  border-radius: 50px; /* Membuat kapsul bulat */

  /* INI KUNCINYA AGAR TIDAK PANJANG */
  display: inline-flex; /* Mengikuti lebar konten, bukan lebar layar */
  width: fit-content; /* Lebar pas sesuai isi */
  min-width: 140px; /* Lebar minimal agar tidak terlalu kecil */

  align-items: center;
  justify-content: space-between; /* Jarak merata antara panah dan teks */
  border: 1px solid var(--border-color); /* Tambahan border tipis biar elegan */
  box-shadow: var(--shadow-sm);
  margin-left: auto; /* Opsional: Geser ke kanan jika di desktop */
}

/* Tombol Panah Kiri/Kanan */
.nav-pills button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--card-bg); /* Warna tombol */
  color: var(--text-main);
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: 0.2s;
}

.nav-pills button:hover {
  background: var(--primary);
  color: white;
  transform: scale(1.1);
}

/* Teks Nama Hari (JUMAT, dsb) */
#activeDayName {
  font-weight: 800;
  color: var(--primary);
  padding: 0 10px;
  font-size: 0.85rem;
  text-align: center;
  flex: 1; /* Mengisi ruang di tengah */
  letter-spacing: 1px;
}
/* Mengatur container tombol agar sejajar */
.controls {
  display: flex;
  align-items: center;
  justify-content: flex-end; /* Rata kanan */
  gap: 10px; /* Jarak antara dropdown dan panah hari */
  flex-wrap: wrap; /* Turun ke bawah kalau layar HP sempit */
}

/* Khusus tampilan HP (Layar kecil) */
@media (max-width: 600px) {
  .controls {
    justify-content: center; /* Rata tengah di HP */
    margin-top: 10px;
    width: 100%;
  }

  .nav-pills {
    width: 100%; /* Di HP boleh agak panjang biar mudah dipencet */
    justify-content: space-between;
  }
}
/* --- WIDGET STATUS HIDUP --- */
.live-status-widget {
  background: linear-gradient(90deg, #4f46e5, #8b5cf6, #ec4899);
  background-size: 200% 200%;
  animation: gradientMove 5s ease infinite;
  padding: 12px 20px;
  border-radius: 12px;
  color: white;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
  position: relative;
  overflow: hidden;
}

/* Animasi background bergerak */
@keyframes gradientMove {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.status-icon-box {
  width: 35px;
  height: 35px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(5px);
  font-size: 1.1rem;
  animation: bounceSlow 2s infinite;
}

@keyframes bounceSlow {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

.status-content h4 {
  font-size: 0.75rem;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 2px;
}
.status-content p {
  font-size: 0.95rem;
  font-weight: 700;
}

/* Status: Libur/Kosong (Ganti warna gradient) */
.live-status-widget.status-chill {
  background: linear-gradient(90deg, #10b981, #3b82f6);
}
.live-status-widget.status-busy {
  background: linear-gradient(90deg, #f97316, #ef4444);
}

.table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}
table {
  width: 100%;
  border-collapse: collapse;
}
th {
  text-align: left;
  background: var(--bg-body);
  color: var(--text-sub);
  padding: 12px 15px;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-color);
}
td {
  padding: 15px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
  vertical-align: top;
}
tr:last-child td {
  border-bottom: none;
}
tr.active-row {
  background-color: rgba(99, 102, 241, 0.05);
}
tr.active-row td {
  color: var(--primary);
  font-weight: 600;
}
tr.active-row td:first-child {
  border-left: 4px solid var(--primary);
}

.btn-note {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  padding: 6px 15px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.btn-note:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
}
.btn-note.has-content {
  background: var(--purple);
  color: white;
  box-shadow: 0 2px 5px rgba(139, 92, 246, 0.4);
}

.btn-edit-round {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: var(--bg-body);
  color: var(--text-sub);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.3s;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}
.btn-edit-round:hover {
  background: var(--orange);
  color: white;
  border-color: var(--orange);
  transform: rotate(15deg) scale(1.1);
}

/* --- 7. TO-DO LIST (CHECKBOX EXPLOSION & FUN WORDS) --- */
.progress-circle {
  position: relative;
  width: 40px;
  height: 40px;
}
.progress-circle svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.circle-bg {
  fill: none;
  stroke: var(--border-color);
  stroke-width: 3;
}
.circle {
  fill: none;
  stroke: var(--primary);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dasharray 0.5s ease;
}
#taskProgressText {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--primary);
}

.filter-tabs {
  display: flex;
  gap: 5px;
  background: var(--bg-body);
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 20px;
}
.tab {
  flex: 1;
  padding: 8px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-sub);
  background: transparent;
  transition: 0.2s;
}
.tab.active {
  background: var(--card-bg);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.search-input {
  position: relative;
  margin-bottom: 20px;
}
.search-input i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-sub);
}
.search-input input {
  padding-left: 40px;
}

.add-task-form {
  margin-bottom: 20px;
}
.main-input {
  margin-bottom: 10px;
}
.form-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.task-list {
  list-style: none;
  max-height: 350px;
  overflow-y: auto;
  padding-right: 5px;
}

.task-item {
  background: var(--bg-body);
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-left: 4px solid #ccc;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
  cursor: grab; /* Indikator bisa digeser */
}
.task-item:active {
  cursor: grabbing;
}
.task-item.dragging {
  opacity: 0.5;
  border: 2px dashed var(--primary);
  transform: scale(0.95);
}

.task-item:hover {
  transform: translateY(-3px) translateX(3px);
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
}
.task-item.priority-High {
  border-color: var(--red);
}
.task-item.priority-Medium {
  border-color: var(--orange);
}
.task-item.priority-Low {
  border-color: var(--green);
}

/* --- CHECKBOX DENGAN EFEK LEDAKAN (CONFETTI CSS) --- */
.check-btn {
  width: 28px;
  height: 28px;
  border: 2px solid #d1d5db;
  border-radius: 8px; /* Sedikit rounded box */
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: 0.2s;
  background: white;
  color: transparent;
  flex-shrink: 0;
  margin-right: 15px;
  position: relative;
  z-index: 5;
}

.check-btn:hover {
  border-color: var(--primary);
}

/* Saat dicentang */
.task-item.completed .check-btn {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  animation: jelly 0.5s;
}

/* Animasi Jelly saat klik */
@keyframes jelly {
  0% {
    transform: scale(1, 1);
  }
  30% {
    transform: scale(1.25, 0.75);
  }
  40% {
    transform: scale(0.75, 1.25);
  }
  50% {
    transform: scale(1.15, 0.85);
  }
  65% {
    transform: scale(0.95, 1.05);
  }
  75% {
    transform: scale(1.05, 0.95);
  }
  100% {
    transform: scale(1, 1);
  }
}

/* Confetti Effect (Pseudo-elements) */
.task-item.completed .check-btn::before,
.task-item.completed .check-btn::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
}
.task-item.completed .check-btn::before {
  box-shadow:
    -15px -15px #ff0000,
    15px -15px #00ff00,
    -15px 15px #0000ff,
    15px 15px #ffff00;
  animation: explode 0.6s forwards;
  opacity: 0;
}
.task-item.completed .check-btn::after {
  box-shadow:
    -10px -25px #ff0000,
    25px -10px #00ff00,
    -10px 25px #0000ff,
    25px 10px #ffff00;
  animation: explode 0.6s forwards 0.1s;
  opacity: 0;
}

@keyframes explode {
  0% {
    opacity: 1;
    transform: scale(0);
  }
  100% {
    opacity: 0;
    transform: scale(2.5);
  }
}

.task-item.completed {
  opacity: 0.8;
  background: rgba(99, 102, 241, 0.05);
}

/* --- BADGE KATA-KATA GAUL (FUN WORDS) --- */
.fun-badge {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  margin-left: 8px;
  display: none;
  background: linear-gradient(45deg, #ff512f, #dd2476);
  color: white;
  box-shadow: 0 2px 10px rgba(221, 36, 118, 0.3);
  animation: zoomIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-origin: left center;
}
.task-item.completed .fun-badge {
  display: inline-block;
}
@keyframes zoomIn {
  from {
    transform: scale(0);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.task-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
}
.task-text span {
  font-weight: 500;
  margin-bottom: 4px;
  line-height: 1.3;
  transition: 0.2s;
}
.task-item.completed .task-text span {
  text-decoration: line-through;
  color: var(--text-sub);
}

.task-actions button {
  background: none;
  margin-left: 5px;
  font-size: 1rem;
  color: var(--text-sub);
  opacity: 0.7;
}
.task-actions button:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* --- 8. POMODORO --- */
.pomodoro-card {
  background: linear-gradient(135deg, var(--work-mode), var(--secondary));
  color: white;
  box-shadow: var(--shadow-lg);
  border: none;
  text-align: center;
}
.pomodoro-card .card-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  margin-bottom: 25px;
}
.pomodoro-card h2 {
  color: white;
  font-weight: 600;
}
.pomodoro-card .icon-box {
  background: white;
  color: var(--work-mode);
}

.mode-label {
  background: rgba(0, 0, 0, 0.2);
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
}
.timer-display h1 {
  font-size: 5rem;
  font-weight: 700;
  margin-bottom: 5px;
  line-height: 1;
}
.timer-display p {
  font-size: 1.1rem;
  font-weight: 500;
  opacity: 0.8;
  margin-bottom: 30px;
}
.timer-controls button {
  margin: 0 5px;
}
.pomodoro-card.mode-break {
  background: linear-gradient(135deg, var(--break-mode), #81c784);
}
.pomodoro-card.mode-break .icon-box {
  color: var(--break-mode);
}

.backup-badge {
  width: 10px;
  height: 10px;
  background: var(--red);
  border-radius: 50%;
  position: absolute;
  top: 5px;
  right: 5px;
  transform: translate(50%, -50%);
  display: none;
  z-index: 10;
}
.backup-badge.overdue {
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.3);
  animation: pulseRed 2s infinite;
  display: block;
}
@keyframes pulseRed {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.3);
    opacity: 0.7;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* --- 9. KEUANGAN --- */
.balance-display {
  text-align: right;
}
.balance-display small {
  font-size: 0.7rem;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.balance-display h3 {
  font-size: 1.5rem;
  color: var(--green);
  line-height: 1.2;
}
.chart-section {
  padding-top: 15px;
  margin-bottom: 25px;
  border-top: 1px solid var(--border-color);
}
.chart-section h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 15px;
}
.expense-chart-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.expense-item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: center;
}
.expense-label {
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--text-sub);
}
.expense-value {
  font-size: 0.9rem;
  text-align: right;
  font-weight: 600;
}
.expense-value small {
  font-weight: 500;
  color: var(--text-sub);
}
.expense-bar-bg {
  grid-column: 1 / span 2;
  height: 6px;
  background: var(--bg-body);
  border-radius: 3px;
  overflow: hidden;
}
.expense-bar-fill {
  height: 100%;
  transition: width 0.5s ease;
  border-radius: 3px;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.wallet-label {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 15px;
}
.wallet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 25px;
}
.wallet-card {
  padding: 15px 20px;
  border-radius: 15px;
  color: white;
  position: relative;
  overflow: hidden;
  height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  opacity: 0.8;
  transform: scale(0.98);
  border: 2px solid transparent;
  box-shadow: var(--shadow-md);
  transition: all 0.2s ease;
}
.wallet-card.active {
  opacity: 1;
  transform: scale(1);
  border-color: white;
  z-index: 2;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}
.wallet-card.dana {
  background: var(--dana);
}
.wallet-card.ovo {
  background: var(--ovo);
}
.wallet-card.gopay {
  background: var(--gopay);
}
.wallet-card.cash {
  background: var(--cash);
}
.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 1px;
  position: relative;
  z-index: 2;
}
.card-bottom b {
  font-size: 1.2rem;
  position: relative;
  z-index: 2;
}
.bg-icon {
  position: absolute;
  right: -10px;
  bottom: -15px;
  font-size: 4rem;
  opacity: 0.15;
  transform: rotate(-15deg);
  z-index: 1;
}
.check-icon {
  display: none;
  font-size: 1.1rem;
}
.wallet-card.active .check-icon {
  display: block;
}
.transaction-box {
  background: var(--bg-body);
  padding: 20px;
  border-radius: 15px;
  margin-bottom: 25px;
}
.btn-group {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}
.btn-in,
.btn-out {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  font-weight: 600;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-in {
  background: var(--green);
}
.btn-in:hover {
  background: #059669;
}
.btn-out {
  background: var(--red);
}
.btn-out:hover {
  background: #dc2626;
}
.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
}
.history-controls {
  display: flex;
  gap: 8px;
}
.btn-mini {
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  font-size: 0.8rem;
}
.history-list {
  max-height: 250px;
  overflow-y: auto;
}
.txn-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}
.txn-left b {
  display: block;
  font-size: 0.9rem;
  color: var(--text-main);
}
.txn-left small {
  font-size: 0.75rem;
  color: var(--text-sub);
}
.txn-tag {
  font-size: 0.65rem;
  padding: 2px 6px;
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  margin-left: 5px;
}
.txn-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.txn-right b.in {
  color: var(--green);
}
.txn-right b.out {
  color: var(--red);
}
.delete-txn-btn {
  color: var(--text-sub);
  opacity: 0.5;
  transition: 0.2s;
}
.delete-txn-btn:hover {
  color: var(--red);
  opacity: 1;
  transform: scale(1.1);
}

/* --- 10. TARGET WIDGET --- */
.target-widget {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  padding: 20px;
  border-radius: 15px;
  color: white;
  margin-bottom: 25px;
  cursor: pointer;
  transition: 0.3s;
  position: relative;
  overflow: hidden;
}
.target-widget:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.target-header {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  margin-bottom: 10px;
}
.progress-bar-bg {
  height: 8px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 5px;
}
.progress-bar-fill {
  height: 100%;
  background: white;
  width: 0%;
  transition: 1s;
}
.target-widget small {
  opacity: 0.9;
  font-size: 0.8rem;
}

/* --- 11. LOGIN & MODAL SPECIFICS --- */
.login-header {
  text-align: center;
  margin-bottom: 30px;
}
.icon-pulse {
  font-size: 3rem;
  margin-bottom: 10px;
  animation: pulse 2s infinite;
}
.input-group {
  position: relative;
  margin-bottom: 20px;
}
.input-group i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-sub);
}
.input-group input {
  padding-left: 40px;
}
.checkbox-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 25px;
  font-size: 0.9rem;
  color: var(--text-sub);
}

/* Animations */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}
.fade-in {
  animation: slideDown 0.6s ease-out;
}
.fade-in-up {
  animation: slideDown 0.8s ease-out;
}

/* TOAST */
#toastBox {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 100000 !important; /* [FIX] Notifikasi paling atas */
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}
.toast {
  background: var(--card-bg);
  color: var(--text-main);
  padding: 12px 20px;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 4px solid;
  animation: slideInRight 0.4s ease;
  min-width: 250px;
}
.toast.error {
  border-color: var(--red);
}
.toast.success {
  border-color: var(--green);
}
.toast.error .btn-undo-toast {
  color: var(--red);
}
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
.btn-undo-toast {
  background: none;
  color: var(--primary);
  font-weight: 600;
  padding: 5px 10px;
  margin-left: 10px;
  border-radius: 5px;
  border: 1px solid var(--primary);
  font-size: 0.8rem;
}
.btn-undo-toast:hover {
  background: var(--primary);
  color: white;
}

@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}
.icon-box.red {
  background: var(--red);
}
.urgent-list {
  list-style: none;
  padding: 0;
}
.urgent-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: #fef2f2;
  border: 1px solid #fee2e2;
  border-radius: 10px;
  margin-bottom: 10px;
  color: var(--red);
}
.urgent-item span {
  font-weight: 600;
  font-size: 0.9rem;
}
.urgent-days {
  background: var(--red);
  color: white;
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
}
.deadline-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  margin-right: 5px;
  font-weight: 600;
}
.deadline-far {
  background: #e0f2fe;
  color: var(--blue);
}
.deadline-near {
  background: #ffedd5;
  color: var(--orange);
}
.deadline-urgent {
  background: #fee2e2;
  color: var(--red);
}
.background-shapes {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(
      circle at 10% 20%,
      rgba(99, 102, 241, 0.1) 0%,
      transparent 20%
    ),
    radial-gradient(
      circle at 90% 80%,
      rgba(16, 185, 129, 0.1) 0%,
      transparent 20%
    );
}
.glow {
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
  transition: all 0.3s ease;
}
.glow:hover {
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}
.empty-message {
  text-align: center;
  padding: 30px 10px;
  color: var(--text-sub);
}
.empty-message i {
  font-size: 2.5rem;
  margin-bottom: 10px;
  opacity: 0.3;
  display: block;
}
.empty-message p {
  font-size: 0.9rem;
  font-weight: 500;
}
.divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 20px 0;
  color: var(--text-sub);
  font-size: 0.8rem;
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}
.divider span {
  padding: 0 10px;
}
.btn-google {
  background: white;
  color: #333;
  border: 1px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 500;
  transition: 0.3s;
  padding: 10px;
  border-radius: 10px;
  width: 100%;
  cursor: pointer;
}
.btn-google:hover {
  background: #f8f9fa;
  border-color: #ccc;
}
.btn-google img {
  width: 18px;
  height: 18px;
}
.auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 0.9rem;
  color: var(--text-sub);
}
.auth-switch a {
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.auth-switch a:hover {
  text-decoration: underline;
}
#authErrorMsg {
  color: var(--red);
  font-size: 0.85rem;
  text-align: center;
  margin-top: 15px;
  font-weight: 500;
  min-height: 20px;
}

/* --- STYLE BARU: FOKUS MODE SELECTOR --- */
.mode-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: white;
  padding: 6px 15px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: 0.3s;
  cursor: pointer;
}

.mode-btn:hover {
  background: rgba(255, 255, 255, 0.4);
}

.mode-btn.active {
  background: white;
  color: var(--red); /* Mengikuti warna tema Pomodoro */
  border-color: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* --- DROPDOWN MENU (Styling Override) --- */
.profile-menu {
  position: relative;
}
.dropdown-menu {
  position: absolute;
  right: 0;
  top: 60px;
  width: 220px;
  background: var(--card-bg);
  border-radius: 15px;
  padding: 15px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  display: none;
  z-index: 100;
  animation: slideDown 0.2s ease;
}
.dropdown-menu.active {
  display: block;
}
.dropdown-header {
  text-align: center;
  margin-bottom: 10px;
}
.dropdown-header span {
  font-weight: 700;
  display: block;
  font-size: 1.1rem;
}
.dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 10px 0;
}
.dropdown-menu button {
  width: 100%;
  text-align: left;
  background: none;
  padding: 10px;
  border-radius: 8px;
  color: var(--text-main);
  font-size: 0.9rem;
}
.dropdown-menu button:hover {
  background: var(--bg-body);
}

/* --- ACHIEVEMENTS MODAL STYLE --- */
.achievement-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 5px;
}

.ach-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-body);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

/* Style Terkunci (Locked) */
.ach-item.locked {
  opacity: 0.6;
  filter: grayscale(1);
  background: #e5e7eb; /* Abu-abu */
}
.ach-item.locked .ach-icon {
  background: #ccc;
  color: #666;
  box-shadow: none;
}

/* Style Terbuka (Unlocked) */
.ach-item.unlocked {
  background: var(--card-bg);
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  opacity: 1;
  filter: grayscale(0);
  transform: scale(1);
}
.ach-item.unlocked::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--primary);
}

.ach-icon {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.2rem;
  flex-shrink: 0;

  /* Default Gradient Unlocked */
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: white;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.ach-info {
  flex: 1;
}
.ach-info h4 {
  font-size: 0.95rem;
  margin-bottom: 2px;
  color: var(--text-main);
  font-weight: 700;
}
.ach-info p {
  font-size: 0.75rem;
  color: var(--text-sub);
  margin: 0;
}
.ach-status {
  font-size: 1rem;
  color: var(--green);
}
.ach-status.lock-icon {
  color: var(--text-sub);
  font-size: 0.9rem;
}

/* Dark mode adjustment */
body.dark-mode .ach-item.locked {
  background: #374151;
  border-color: #4b5563;
}

/* ==================================================
   FIX FINAL: SCROLLBAR & ACHIEVEMENT LAYOUT
   ================================================== */

.achievement-grid {
  display: flex;
  flex-direction: column;
  gap: 16px; /* [FIX] Jarak antar kartu lebih renggang */
  max-height: 450px;
  overflow-y: auto;
  padding-right: 12px;
}

.ach-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 16px; /* [FIX] Padding dalam kartu lebih luas */
  border: 1px solid var(--border-color);
  border-radius: 16px;
  background: var(--bg-body);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  min-height: 80px; /* [FIX] Biar tidak gepeng */
}

/* Style Terkunci (Locked) */
.ach-item.locked {
  opacity: 0.6;
  filter: grayscale(1);
  background: #e5e7eb;
}
.ach-item.locked .ach-icon {
  background: #ccc;
  color: #666;
  box-shadow: none;
}

/* Style Terbuka (Unlocked) */
.ach-item.unlocked {
  background: var(--card-bg);
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  opacity: 1;
  filter: grayscale(0);
  transform: scale(1);
}
.ach-item.unlocked::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--primary);
}

.ach-icon {
  width: 50px;
  height: 50px; /* Diperbesar sedikit iconnya */
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: white;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.ach-info {
  flex: 1;
}
.ach-info h4 {
  font-size: 1rem;
  margin-bottom: 5px; /* [FIX] Jarak judul ke deskripsi */
  color: var(--text-main);
  font-weight: 700;
}
.ach-info p {
  font-size: 0.8rem;
  color: var(--text-sub);
  margin: 0;
  line-height: 1.5; /* [FIX] Jarak antar baris teks */
}
.ach-status {
  font-size: 1.2rem;
  color: var(--green);
}
.ach-status.lock-icon {
  color: var(--text-sub);
  font-size: 1rem;
}

/* Dark mode adjustment */
body.dark-mode .ach-item.locked {
  background: #374151;
  border-color: #4b5563;
}

/* --- CUSTOM SCROLLBAR (MODERN & THIN) --- */
.achievement-grid::-webkit-scrollbar {
  width: 6px !important;
}
.achievement-grid::-webkit-scrollbar-track {
  background: transparent !important;
  margin: 10px 0;
}
.achievement-grid::-webkit-scrollbar-thumb {
  background: #cbd5e1 !important;
  border-radius: 10px !important;
}
.achievement-grid::-webkit-scrollbar-thumb:hover {
  background: var(--primary) !important;
}

/* Global Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.3);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}
/* Gaya Tombol Transfer */
.transfer-btn {
  background: #f39c12; /* Warna Oranye berbeda dari tombol simpan */
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 10px;
}

/* Gaya Modal/Pop-up */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

/* GANTI BAGIAN INI DI STYLE.CSS */

.modal-box {
  /* Gunakan variabel tema, JANGAN hardcode warna 'white' */
  background: var(--card-bg);
  color: var(--text-main);

  padding: 25px;
  border-radius: 20px; /* Lebih membulat agar modern */
  width: 90%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  position: relative;
}

/* Pastikan Judul dan Label mengikuti warna teks utama */
.modal-header h3 {
  color: var(--text-main);
  font-weight: 700;
}

.modal-body label {
  color: var(--text-sub); /* Warna agak abu agar elegan */
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 5px;
  display: block;
}

/* Panah di tengah */
.transfer-arrow {
  text-align: center;
  font-size: 1.5rem;
  margin: 15px 0;
  color: var(--primary); /* Warna ungu/biru utama */
  animation: bounceSlow 2s infinite;
}

/* Tombol Close (X) */
.close-btn {
  color: var(--text-sub);
  font-size: 1.5rem;
  cursor: pointer;
  transition: 0.3s;
}
.close-btn:hover {
  color: var(--red);
  transform: rotate(90deg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.transfer-arrow {
  text-align: center;
  font-size: 20px;
  margin: 10px 0;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
}
/* --- FITUR SUBSCRIPTION --- */
.sub-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
}

.total-fixed-cost {
  text-align: center;
  background: linear-gradient(135deg, var(--purple), var(--primary));
  padding: 20px;
  border-radius: 15px;
  color: white;
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
}

.total-fixed-cost h2 {
  font-size: 1.8rem;
  margin-top: 5px;
}

.sub-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-body);
  padding: 12px 15px;
  border-radius: 12px;
  border-left: 4px solid var(--purple);
  margin-bottom: 8px;
}

.sub-info h4 {
  font-size: 0.9rem;
  color: var(--text-main);
  margin-bottom: 2px;
}

.sub-info small {
  font-size: 0.75rem;
  color: var(--text-sub);
}

.sub-cost {
  text-align: right;
}

.sub-cost b {
  display: block;
  color: var(--text-main);
  font-size: 0.9rem;
}

.btn-del-sub {
  background: rgba(239, 68, 68, 0.1);
  color: var(--red);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 10px;
  transition: 0.2s;
}

.btn-del-sub:hover {
  background: var(--red);
  color: white;
}
/* --- SENSOR SALDO (PRIVACY MODE) --- */
.balance-blur {
  filter: blur(6px);
  user-select: none; /* Supaya teks tidak bisa diblok/copy */
  cursor: default;
  transition: filter 0.3s ease;
}

.btn-eye-toggle {
  background: none;
  border: none;
  color: var(--text-sub);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 5px;
  margin-left: 5px;
  transition: 0.2s;
}

.btn-eye-toggle:hover {
  color: var(--primary);
  transform: scale(1.1);
}
/* --- FITUR BARU: WEATHER & STICKY NOTE --- */

/* 1. Weather Widget */
.weather-widget {
  background: var(--bg-body);
  padding: 8px 15px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--text-main);
  box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.05);
  transition: 0.3s;
}
.weather-widget i {
  font-size: 1.2rem;
  color: var(--blue);
}
.weather-widget:hover {
  transform: translateY(-2px);
  background: var(--card-bg);
}

/* 2. Sticky Note Card */
.sticky-card {
  background: #fefce8; /* Warna kuning muda khas sticky note */
  border: 1px solid #fde047;
}
body.dark-mode .sticky-card {
  background: #422006; /* Coklat gelap untuk dark mode */
  border-color: #713f12;
}

#globalStickyNote {
  width: 100%;
  height: 120px;
  background: transparent;
  border: none;
  resize: none;
  font-family: "Poppins", sans-serif; /* Atau font tulisan tangan jika ada */
  font-size: 0.9rem;
  color: var(--text-main);
  outline: none;
  line-height: 1.5;
}
#globalStickyNote::placeholder {
  color: rgba(0, 0, 0, 0.3);
}
body.dark-mode #globalStickyNote::placeholder {
  color: rgba(255, 255, 255, 0.3);
}
/* --- WIDGET CATATAN MELAYANG (FLOATING) --- */
.floating-widget {
  position: fixed;
  bottom: 20px;
  left: 240px; /* Digeser ke kanan agar tidak menumpuk dengan Lo-Fi Radio */
  width: 220px;
  background: var(--card-bg);
  border-radius: 15px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  z-index: 999;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
}

/* Header Widget */
.widget-header-float {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  background: rgba(0, 0, 0, 0.02);
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
}

/* Area Textarea */
.widget-content {
  padding: 0;
  height: 150px; /* Tinggi saat terbuka */
  transition: height 0.3s ease;
}

.widget-content.collapsed {
  height: 0; /* Tinggi saat tertutup */
}

/* Styling Textarea di dalam widget */
#globalStickyNote {
  width: 100%;
  height: 100%;
  border: none;
  background: #fefce8; /* Warna kuning muda */
  padding: 12px;
  resize: none;
  font-size: 0.85rem;
  line-height: 1.4;
  color: #422006;
  border-radius: 0 0 15px 15px;
}
#globalStickyNote:focus {
  box-shadow: none;
  outline: none;
}

/* Dark Mode Adjustment */
body.dark-mode #globalStickyNote {
  background: #2b2b2b;
  color: #e5e5e5;
}

/* Responsif untuk HP */
@media (max-width: 768px) {
  .floating-widget {
    left: 20px;
    bottom: 90px; /* Naik ke atas Lo-Fi Radio jika di HP */
    width: 200px;
  }
}
/* --- FITUR BARU: MOOD TRACKER --- */
/* --- MOOD TRACKER (UPDATED LAYOUT) --- */
.mood-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center; /* Rata tengah */
  padding: 10px 0;
}

.mood-btn {
  font-size: 1.6rem;
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  border-radius: 15px;
  width: 55px;
  height: 55px; /* Sedikit lebih besar */
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mood-btn:hover {
  transform: translateY(-5px) scale(1.1);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* WARNA-WARNI TOMBOL MOOD */
.mood-btn.happy:hover {
  background: #d1fae5;
  border-color: #10b981;
} /* Hijau */
.mood-btn.excited:hover {
  background: #ffedd5;
  border-color: #f97316;
} /* Oranye */
.mood-btn.confident:hover {
  background: #e0f2fe;
  border-color: #0ea5e9;
} /* Biru Langit */
.mood-btn.grateful:hover {
  background: #fce7f3;
  border-color: #db2777;
} /* Pink */
.mood-btn.relaxed:hover {
  background: #ccfbf1;
  border-color: #14b8a6;
} /* Tosca */

.mood-btn.bored:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
} /* Abu */
.mood-btn.confused:hover {
  background: #ede9fe;
  border-color: #8b5cf6;
} /* Ungu */

.mood-btn.tired:hover {
  background: #fee2e2;
  border-color: #ef4444;
} /* Merah Muda */
.mood-btn.sad:hover {
  background: #dbeafe;
  border-color: #2563eb;
} /* Biru Tua */
.mood-btn.anxious:hover {
  background: #fff7ed;
  border-color: #c2410c;
} /* Oranye Gelap */
.mood-btn.sick:hover {
  background: #fef9c3;
  border-color: #eab308;
} /* Kuning */
.mood-btn.angry:hover {
  background: #7f1d1d;
  border-color: #991b1b;
  color: white;
} /* Merah Gelap */
/* --- FITUR BARU: COUNTDOWN WIDGET --- */
.countdown-item {
  background: var(--bg-body);
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-left: 4px solid var(--primary);
}
.cd-info h4 {
  font-size: 0.9rem;
  margin-bottom: 2px;
}
.cd-info small {
  font-size: 0.75rem;
  color: var(--text-sub);
}
.cd-days {
  text-align: center;
  background: var(--card-bg);
  padding: 5px 10px;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  min-width: 60px;
}
.cd-days b {
  display: block;
  font-size: 1.2rem;
  color: var(--primary);
  line-height: 1;
}
.cd-days span {
  font-size: 0.6rem;
  color: var(--text-sub);
  text-transform: uppercase;
}
.btn-del-cd {
  background: none;
  color: var(--text-sub);
  font-size: 0.8rem;
  margin-left: 10px;
  cursor: pointer;
}
.btn-del-cd:hover {
  color: var(--red);
}
/* Tambahan untuk Custom Confirm Modal */
#customConfirmModal .modal-body {
  padding-bottom: 0;
}
#customConfirmModal h3 {
  font-size: 1.2rem;
  font-weight: 700;
}
/* --- STYLE MODAL KONFIRMASI --- */
#customConfirmModal .modal-content {
  border: 1px solid var(--border-color);
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
#customConfirmModal h3 {
  font-size: 1.2rem;
  font-weight: 700;
}
#customConfirmModal .btn-primary:hover {
  background-color: #dc2626; /* Merah lebih gelap saat hover */
}

/* --- GAYA RUNNING TEXT (NOTIFIKASI) - UPDATE FIX --- */

/* 1. Kotak Wadahnya (DIAM, TIDAK BOLEH GERAK) */
.broadcast-container {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid var(--primary);
  border-radius: 12px;
  margin-top: 15px;
  margin-bottom: 15px;
  padding: 10px 15px;
  display: flex;
  align-items: center;
  gap: 15px;
  overflow: hidden; /* Masking biar teks hilang pas lewat batas */
  position: relative;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.1);

  /* ❌ JANGAN ADA animation ATAU padding-left DI SINI! */
}

.broadcast-icon {
  font-weight: 800;
  color: var(--primary);
  white-space: nowrap;
  z-index: 2;
  background: var(--bg-body); /* Supaya teks gak nembus ikon */
  padding-right: 10px;
  box-shadow: 10px 0 10px -5px var(--bg-body); /* Efek fading */
}

.broadcast-wrapper {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
}

/* 2. Teksnya (INI YANG BOLEH GERAK) */
.running-text {
  display: inline-block;
  color: var(--text-main);
  font-weight: 500;
  white-space: nowrap;

  /* ✅ ANIMASI HANYA DI SINI */
  padding-left: 100%; /* Mulai dari luar kanan */
  animation: marquee 15s linear infinite;
}

/* Animasi Keyframes */
@keyframes marquee {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(-100%, 0);
  }
}

.btn-close-broadcast {
  background: none;
  border: none;
  color: var(--text-sub);
  cursor: pointer;
  z-index: 2;
  padding: 5px;
}
.btn-close-broadcast:hover {
  color: var(--red);
}

/* --- SIDEBAR STYLES --- */
.sidebar {
  position: fixed;
  top: 0;
  left: -300px; /* Tersembunyi di kiri */
  width: 280px;
  height: 100%;
  background: var(--card-bg);
  box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
  z-index: 99999; /* Paling atas */
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  padding: 20px;
  border-right: 1px solid var(--border-color);
}

.sidebar.active {
  left: 0;
} /* Muncul saat aktif */

.sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
  z-index: 99998; /* Di bawah sidebar */
  opacity: 0;
  visibility: hidden;
  transition: 0.3s;
}

.sidebar-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-brand {
  font-size: 1.2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
}

.close-sidebar-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-sub);
  cursor: pointer;
  transition: 0.2s;
}
.close-sidebar-btn:hover {
  color: var(--red);
  transform: rotate(90deg);
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
}

.sidebar-group {
  margin-bottom: 20px;
}
.sidebar-group small {
  display: block;
  font-size: 0.75rem;
  color: var(--text-sub);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.sidebar-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-main);
  font-weight: 500;
  margin-bottom: 5px;
}

.sidebar-menu-item:hover {
  background: var(--bg-body);
  transform: translateX(5px);
  color: var(--primary);
}

.menu-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.9rem;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
}

.btn-logout-side {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.1);
  color: var(--red);
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: 0.2s;
}
.btn-logout-side:hover {
  background: var(--red);
  color: white;
}

/* --- SIDEBAR PROFILE CARD STYLES --- */
.sidebar-user-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 10px;
  position: relative;
}

.sidebar-avatar-large {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-size: 2rem;
  margin-bottom: 10px;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
  border: 3px solid var(--card-bg);
}

.sidebar-user-info h4 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-main);
  font-weight: 700;
}

.sidebar-user-info small {
  display: block;
  margin-top: 2px;
  opacity: 0.8;
}
/* --- FIX TAMPILAN MODAL BUDGET (Supaya Jadi 2 Kolom) --- */
.budget-grid-container {
  display: grid;
  grid-template-columns: 1fr 1fr; /* Membagi jadi 2 kolom */
  gap: 12px; /* Jarak antar kolom */
  max-height: 50vh; /* Batasi tinggi (50% layar) */
  overflow-y: auto; /* Muncul scroll jika masih kepanjangan */
  padding-right: 5px;
  margin-bottom: 15px;
}

/* Scrollbar tipis biar cantik */
.budget-grid-container::-webkit-scrollbar {
  width: 4px;
}
.budget-grid-container::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

/* Di HP tetap 1 kolom biar tidak sempit */
@media (max-width: 480px) {
  .budget-grid-container {
    grid-template-columns: 1fr;
  }
}
/* Efek kedip saat diklik dari sidebar */
@keyframes highlightPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(99, 102, 241, 0);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
    border-color: var(--primary);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(99, 102, 241, 0);
  }
}

.highlight-card {
  animation: highlightPulse 0.8s ease;
  border: 2px solid var(--primary) !important;
}

/* --- GLOBAL CHAT STYLES --- */
.chat-card { min-height: 300px; }
.chat-box {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    background: var(--bg-body);
    border-radius: 10px;
    margin-bottom: 10px;
    min-height: 200px;
    max-height: 300px;
    border: 1px solid var(--border-color);
}
.chat-bubble {
    padding: 8px 12px;
    border-radius: 12px;
    margin-bottom: 8px;
    max-width: 85%;
    font-size: 0.85rem;
    position: relative;
    word-wrap: break-word;
}
.chat-left {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
    margin-right: auto;
    float: left;
    clear: both;
}
.chat-right {
    background: rgba(99, 102, 241, 0.2);
    color: var(--text-main);
    align-self: flex-end;
    border-bottom-right-radius: 2px;
    margin-left: auto;
    float: right;
    clear: both;
    text-align: right;
}
.chat-user {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 2px;
    display: block;
}
.chat-input-area { display: flex; gap: 10px; }
.chat-input-area input { flex: 1; }
.btn-send {
    background: var(--primary);
    color: white;
    border: none;
    width: 40px; height: 42px;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s;
    display: flex; align-items: center; justify-content: center;
}
.btn-send:hover { background: var(--primary-dark); }
/* ==================== MODERN CALENDAR UI ==================== */

/* 1. Modal Wrapper */
#calendarModal .modal-content {
  border-radius: 24px; /* Sudut lebih bulat */
  padding: 25px;
  background: var(--card-bg);
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
  border: 1px solid var(--border-color);
  max-width: 480px; /* Ukuran pas tidak terlalu lebar */
}

/* 2. Header Modal (Judul & Tombol) */
#calendarModal .modal-head {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
}

#calendarModal .modal-head h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

/* 3. Kontrol Bulan (Panah Kiri/Kanan) */
.calendar-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  background: var(--bg-body);
  padding: 8px 12px;
  border-radius: 16px; /* Pill shape */
  border: 1px solid var(--border-color);
}

.calendar-controls h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0;
}

.calendar-controls button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--card-bg);
  color: var(--text-sub);
  border: 1px solid var(--border-color);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.calendar-controls button:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: scale(1.1);
}

/* 4. Grid Hari (Sen, Sel, Rab...) */
.calendar-grid-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  margin-bottom: 10px;
}

.calendar-grid-header div {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-sub);
  text-transform: uppercase;
}

/* 5. Grid Tanggal (Angka) */
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px; /* Jarak antar kotak tanggal */
}

.cal-date {
  aspect-ratio: 1 / 1; /* Biar kotak presisi persegi */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center; /* Angka di tengah */
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  background: transparent;
  border: 1px solid transparent;
}

/* Hover Effect */
.cal-date:not(.empty):hover {
  background: var(--bg-body);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

/* Hari Ini (Today) */
.cal-date.today {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
  border: none;
}
.cal-date.today:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
}

/* Tanggal Kosong */
.cal-date.empty {
  cursor: default;
}

/* 6. Indikator Titik (Event Dots) */
.cal-dots {
  display: flex;
  gap: 3px;
  position: absolute;
  bottom: 6px; /* Posisi di bawah angka */
}

.dot-marker {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.dot-task { background-color: var(--blue); box-shadow: 0 0 5px var(--blue); }
.dot-event { background-color: var(--red); box-shadow: 0 0 5px var(--red); }
.dot-custom { background-color: #8b5cf6; box-shadow: 0 0 5px #8b5cf6; } /* Ungu */
.dot-google { background-color: #10b981; box-shadow: 0 0 5px #10b981; } /* Hijau */

/* Khusus Hari Ini, titiknya jadi putih biar kelihatan */
.cal-date.today .dot-marker {
  background-color: white;
  box-shadow: none;
  opacity: 0.8;
}

/* 7. Detail Popup (Yang muncul di bawah saat diklik) */
#calendarDetailBox {
  background: var(--bg-body);
  border-radius: 16px;
  padding: 15px;
  margin-top: 20px;
  border: 1px solid var(--border-color);
  animation: slideDown 0.3s ease;
  position: relative;
}

#calendarDetailBox h5 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 10px;
}

#calEventList {
  list-style: none;
  padding: 0;
  margin: 0;
}

#calEventList li {
  padding: 8px 10px;
  background: var(--card-bg);
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 0.85rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Warna border kiri list item sesuai tipe */
#calEventList li[style*="var(--blue)"] { border-left: 3px solid var(--blue) !important; }
#calEventList li[style*="var(--red)"] { border-left: 3px solid var(--red) !important; }
#calEventList li[style*="#34A853"] { border-left: 3px solid #10b981 !important; } /* Google Hijau */

/* Style Tombol Add & Sync di Header */
.btn-cal-add, .btn-google-sync {
  transition: transform 0.2s;
}
.btn-cal-add:hover, .btn-google-sync:hover {
  transform: translateY(-2px);
}
/* --- STYLE BARU: LEGEND & URGENT --- */

/* 1. Warna Urgent (Oranye) */
.dot-urgent { 
    background-color: #f97316; /* Orange */
    box-shadow: 0 0 5px #f97316;
}

/* 2. Style Tanda Tanya (Legend) */
.calendar-legend-container {
    position: relative;
    cursor: help;
}
.legend-icon {
    color: var(--text-sub);
    font-size: 1.1rem;
    transition: 0.2s;
}
.legend-icon:hover {
    color: var(--primary);
}

/* 3. Tooltip Penjelasan (Muncul saat Hover) */
.legend-tooltip {
    display: none; /* Sembunyi dulu */
    position: absolute;
    top: 25px;
    left: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    width: 200px;
    z-index: 100;
}
.calendar-legend-container:hover .legend-tooltip {
    display: block; /* Muncul pas hover */
    animation: fadeIn 0.2s ease;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    margin-bottom: 6px;
    color: var(--text-main);
}
/* --- TOMBOL TAMBAH (MODERN STYLE) --- */
.btn-add-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.1); /* Merah transparan (sesuai tema countdown) */
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-add-circle:hover {
  background: var(--red);
  color: white;
  transform: scale(1.15) rotate(90deg); /* Efek memutar sedikit saat hover */
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}

.btn-add-circle i {
  font-size: 0.9rem;
  margin-top: 1px; /* Koreksi optik biar pas di tengah */
}
/* =========================================
   RESPONSIVE DESIGN (UPDATE KHUSUS HP)
   ========================================= */

/* 1. Sembunyikan Header Mobile di Laptop */
.mobile-header {
    display: none;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}
.sidebar-backdrop {
    display: none; /* Sembunyi default */
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 998; /* Di bawah sidebar, di atas konten */
    backdrop-filter: blur(3px);
}

/* 2. MEDIA QUERY (KHUSUS LAYAR KECIL / HP) */
@media (max-width: 768px) {

    /* --- LAYOUT UTAMA --- */
    body {
        overflow-x: hidden; /* Cegah geser samping */
    }

    .container {
        grid-template-columns: 1fr; /* Jadi 1 Kolom */
    }

    /* --- SIDEBAR (OFF-CANVAS) --- */
    .sidebar {
        position: fixed;
        left: -280px; /* Sembunyi di kiri */
        top: 0;
        height: 100vh;
        z-index: 999;
        transition: 0.3s ease;
        box-shadow: 5px 0 15px rgba(0,0,0,0.3);
    }
    
    .sidebar.active {
        left: 0; /* Muncul pas aktif */
    }
    
    .sidebar-backdrop.active {
        display: block; /* Muncul background hitam */
    }

    /* --- HEADER MOBILE --- */
    .mobile-header {
        display: flex; /* Munculkan tombol menu */
    }
    
    .btn-menu-mobile {
        background: var(--card-bg);
        border: 1px solid var(--border-color);
        color: var(--text-main);
        width: 40px; height: 40px;
        border-radius: 8px;
        font-size: 1.2rem;
        cursor: pointer;
    }

    /* --- KONTEN UTAMA --- */
    .main-content {
        padding: 15px; /* Padding lebih kecil */
        width: 100%;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    /* --- GRID & KOLOM --- */
    .dashboard-grid {
        grid-template-columns: 1fr; /* Stack vertikal */
        gap: 20px;
    }
    
    .left-column, .right-column {
        width: 100%;
    }

    /* --- KARTU & WIDGET --- */
    .stats-container {
        grid-template-columns: 1fr 1fr; /* Stats jadi 2 kolom di HP */
    }

    .card {
        padding: 15px; /* Padding card dikecilin dikit */
    }

    /* --- TABEL JADWAL (SCROLLABLE) --- */
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto; /* Biar bisa digeser samping */
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 500px; /* Paksa lebar tabel biar nggak gepeng */
    }

    /* --- MODAL (POP-UP) --- */
    .modal-content {
        width: 90%; /* Jangan fix width, pakai persen */
        max-width: 90%;
        padding: 20px;
        margin: 10px;
        max-height: 90vh; /* Biar nggak kepotong kalau panjang */
        overflow-y: auto;
    }

    /* --- KALENDER --- */
    .calendar-days {
        gap: 4px;
    }
    .cal-date {
        font-size: 0.8rem;
        border-radius: 8px;
    }
    .calendar-controls h4 {
        font-size: 0.9rem;
    }

    /* --- WIDGET MUSIK --- */
    #musicWidget {
        width: 90% !important; /* Musik lebar di HP */
        left: 5% !important;
        bottom: 10px !important;
    }
}
/* =========================================
   NOTIFIKASI RAMAH HP (MOBILE TOAST)
   ========================================= */

/* 1. Container Notifikasi (Wadah Utama) */
#toastBox {
    position: fixed;
    top: 20px;            /* Jarak dari atas */
    right: 20px;          /* Default PC: di kanan */
    z-index: 10000;       /* Paling depan, di atas modal/sidebar */
    display: flex;
    flex-direction: column;
    gap: 10px;            /* Jarak antar notifikasi */
}

/* 2. Desain Kotak Notifikasi */
.toast {
    min-width: 250px;
    padding: 12px 20px;
    background: var(--card-bg);
    color: var(--text-main);
    border-radius: 50px;   /* Bentuk Pill/Kapsul biar modern */
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    animation: slideInRight 0.3s ease; /* Animasi masuk dari kanan */
}

/* Warna Ikon Notifikasi */
.toast.success i { color: #10b981; } /* Hijau */
.toast.error i   { color: #ef4444; } /* Merah */
.toast.info i    { color: #3b82f6; } /* Biru */

/* =========================================
   KHUSUS TAMPILAN HP (RESPONSIF)
   ========================================= */
@media (max-width: 768px) {
    
    #toastBox {
        top: 20px;       /* Tetap di atas */
        right: 0;        /* Reset posisi kanan */
        left: 0;         /* Reset posisi kiri */
        width: 100%;     /* Lebar penuh */
        align-items: center; /* Posisi di tengah layar */
        pointer-events: none; /* Biar user tetap bisa klik tombol di belakangnya */
    }

    .toast {
        min-width: auto;
        width: 90%;       /* Lebar notifikasi 90% dari layar HP */
        max-width: 350px; /* Batas maksimal biar nggak kegedean */
        border-radius: 12px; /* Lebih kotak dikit biar muat teks panjang */
        font-size: 0.85rem;
        padding: 12px 15px;
        pointer-events: auto; /* Aktifkan klik notifikasi */
        animation: slideInDown 0.3s ease; /* Ganti animasi: Turun dari atas */
        
        /* Shadow lebih tebal biar kontras */
        box-shadow: 0 10px 30px rgba(0,0,0,0.3);
        background: rgba(30, 41, 59, 0.95); /* Lebih gelap/solid biar tulisan jelas */
    }
}

/* Animasi Masuk (PC) */
@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Animasi Masuk (HP - Turun dari atas) */
@keyframes slideInDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
