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

body {
  min-height: 100vh;
  background: linear-gradient(135deg, #545569, #17028d);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 28px;
  transition: background 0.25s ease, color 0.25s ease;
}

/* Dark mode */
body.dark {
  background: linear-gradient(135deg, #02000c, #000000);
  color: #f5f5f5;
}

/* Dark mode toggle */
.dark-toggle, #dark-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  font-size: 18px;
  padding: 8px 10px;
  border: none;
  border-radius: 12px;
  background: rgba(255,255,255,0.85);
  cursor: pointer;
  z-index: 1200;
}
body.dark .dark-toggle, body.dark #dark-toggle {
  background: rgba(0,0,0,0.45);
  color: #ffffff71;
}

/* Container */
.container.glass {
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(10px);
  border-radius: 18px;
  padding: 28px;
  width: 100%;
  max-width: 960px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
  color: inherit;
}

/* Title */
.container h1 {
  text-align: center;
  margin-bottom: 20px;
  font-size: 26px;
  letter-spacing: 0.2px;
}
.container h3 {
  color: #0984e3;
  font-weight: 700;
}
/* Balance + Goal row */
.balance-goal-row {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

/* Balance ring wrap */
.balance-ring-wrap {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 0 auto;
  flex: 0 0 160px;
}
.balance-ring {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}
#ring-bg {
  fill: none;
  stroke: #dfe6e9;
  stroke-width: 12;
}
.ring-progress {
  fill: none;
  stroke: #0984e3;
  stroke-width: 12;
  stroke-dasharray: 440;
  stroke-dashoffset: 440;
  transition: stroke-dashoffset 0.6s ease;
  stroke-linecap: round;
}
.balance-ring-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
}
.balance-label { font-size: 13px; opacity: 0.85; }
.balance-value { font-size: 20px; font-weight: 700; color: #111; }

/* Goal section */
.goal-section {
  flex: 1;
  min-width: 220px;
  max-width: 640px;
}
.goal-label { font-weight: 700; margin-bottom: 8px; }
.goal-input-row { display: flex; gap: 10px; margin-bottom: 10px; }
.goal-input-row input { flex: 1; padding: 8px; border-radius: 8px; border: 1px solid #cfcfcf; }
.goal-input-row button { padding: 8px 12px; border-radius: 8px; background: #0984e3; border: none; color: white; cursor: pointer; }
.goal-input-row button:hover { background: #2b8bf7; }

.goal-progress-bar-bg { width: 100%; height: 14px; background: #dfe6e9; border-radius: 10px; overflow: hidden; position: relative; }
.goal-progress-bar { height: 100%; width: 0%; background: linear-gradient(90deg,#0984e3,#74b9ff,#00cec9); background-size: 200% 100%; transition: width 0.6s ease; }

/* Progress text */
#goalprogress { margin-top: 8px; font-size: 14px; font-weight: 600; color: #0984e3; }

/* Action buttons */
.action-buttons { display:flex; gap:12px; justify-content:center; margin: 12px 0 18px; }
.btn { padding: 10px 14px; border-radius: 12px; border: none; cursor: pointer; font-weight: 700; }
.btn-income { background: #4b10b9; color: #fff; }
.btn-expense { background: #9b30ff; color: #fff; }

/* Transaction forms */
.transaction-form { background: rgba(255, 255, 255, 0.753); padding: 14px; border-radius: 12px; margin-bottom: 16px; display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.transaction-form h3 { flex-basis:100%; margin-bottom:6px; font-size:16px; }
.transaction-form input, .transaction-form select { padding:8px; border-radius:8px; border:1px solid #e0d6d6; min-width:160px; }
.transaction-form .form-actions { display:flex; gap:8px; margin-left:auto; }
.transaction-form .form-actions .btn { padding:8px 12px; border-radius:8px; }

/* Search & filters */
.search-filter-section { display:flex; gap:10px; margin:14px 0; align-items:center; flex-wrap:wrap; }
.search-filter-section input, .search-filter-section select { padding:8px; border-radius:8px; border:1px solid #d0d0d0; min-width:140px; }
.clear-section {
  text-align: bottom;
  margin: 15px 0;
}

#clear-data {
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  background: #e63946;
  color: white;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.3s;
}

#clear-data:hover {
  background: #d62828;
}

/* Transactions */
.transactions-section h2 { margin-bottom:8px; }
#transaction-timeline { list-style:none; max-height:320px; overflow:auto; padding-right:6px; }
.transaction { display:flex; justify-content:space-between; gap:10px; padding:12px; margin-bottom:10px; border-radius:10px; background: rgba(136, 150, 214, 0.308); align-items:center; transition:transform .15s ease; }
.transaction:hover { transform: translateY(-3px); }
.transaction.income { border-left:5px solid #10b956; }
.transaction.expense { border-left:5px solid #FF3B30; }
.trans-left { display:flex; flex-direction:column; gap:4px; }
.trans-desc { font-weight:700; }
.trans-category { font-size:14px; color:#f3e6e6; background:rgba(0, 0, 0, 0.418); padding:4px 8px; border-radius:999px; display:inline-block; }
.trans-date { font-size:12px; color:#ebd7d7; }
.trans-right { display:flex; align-items:center; gap:10px; }
.trans-amount { font-weight:700; }
.trans-delete { background:#FF3B30; color:#fff; border:none; padding:6px 8px; border-radius:8px; cursor:pointer; }

/* Summary */
.summary { display:flex; gap:12px; justify-content:space-around; margin-top:12px; padding:12px; border-radius:10px; background: rgba(255, 255, 255, 0.363); font-weight:700; }
.summary div { text-align:center; min-width:120px; }

/* Toasts */
#toast-root { position: fixed; top: 18px; right: 18px; z-index:1500; display:flex; flex-direction:column; gap:8px; }
.toast { padding:10px 14px; border-radius:10px; color:#fff; box-shadow:0 6px 18px rgba(0,0,0,0.2); opacity:0; transform:translateY(-6px); transition: all 0.35s ease; }
.toast.show { opacity:1; transform:translateY(0); }
.toast.income { background:#10B981; }
.toast.expense { background:#FF3B30; }
.toast.goal { background:#0984e3; }

/* Responsive */
@media (max-width: 820px) {
  .balance-goal-row { flex-direction:column; align-items:center; gap:14px; }
  .goal-section { width:100%; max-width:520px; text-align:center; }
  .transaction-form { gap:10px; }
  .transaction-form .form-actions { width:100%; justify-content:center; margin-left:0; }
  .search-filter-section { justify-content:center; }
  .summary { flex-direction:column; gap:10px; align-items:stretch; }
}

/* Very small screens */
@media (max-width: 420px) {
  .container.glass { padding:16px; }
  .balance-value { font-size:18px; }
  .transaction-form input, .transaction-form select { min-width:100%; }
}
