:root {
  --bg-gradient: radial-gradient(circle at 50% 0%, #1e1b4b 0%, #0f172a 60%, #090d16 100%);
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-card: rgba(255, 255, 255, 0.06);
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --accent-glow: #6366f1;
  --accent-purple: #a855f7;
  --accent-success: #10b981;
  --accent-danger: #ef4444;
  --shadow-depth: 0 12px 40px 0 rgba(0, 0, 0, 0.5), inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
  --radius: 20px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--text-main);
  -webkit-tap-highlight-color: transparent;
}

body {
  background: var(--bg-gradient);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}

/* Glassmorphism & 3D Depth Utilities */
.glass-card, .card-glass, .glass-header, .glass-footer {
  background: var(--glass-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-depth);
  border-radius: var(--radius);
}

/* Login Overlay */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 8, 18, 0.85);
  backdrop-filter: blur(12px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  padding: 36px 28px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  height: 150px;
  background: linear-gradient(135deg, var(--accent-glow), var(--accent-purple));
  filter: blur(50px);
  opacity: 0.4;
  z-index: 0;
}

.login-card h2, .login-card p, .login-card .input-group, .login-card button {
  position: relative;
  z-index: 1;
}

.login-card h2 {
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(to right, #818cf8, #e879f9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-card p {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.input-group input, .tx-row input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-group input:focus, .tx-row input:focus {
  border-color: var(--accent-glow);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.3), inset 0 1px 2px rgba(0,0,0,0.5);
  background: rgba(0, 0, 0, 0.4);
}

/* Buttons */
.glow-btn {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  border: none;
  padding: 12px 24px;
  border-radius: 14px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4), inset 0 1px 0 rgba(255,255,255,0.2);
  transition: all 0.2s ease;
}

.glow-btn:active {
  transform: scale(0.97);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}

.small-btn {
  padding: 7px 14px;
  font-size: 0.82rem;
  border-radius: 10px;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  padding: 6px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* App Layout */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 540px;
  margin: 0 auto;
  width: 100%;
}

.glass-header {
  margin: 12px;
  padding: 14px 20px;
  border-radius: 16px;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.15rem;
  font-weight: 700;
  background: linear-gradient(to right, #818cf8, #e879f9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

#display-username {
  color: var(--text-main);
  font-weight: 600;
}

.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px 105px 12px;
  scroll-behavior: smooth;
}

.transaction-wrapper {
  padding: 16px;
}

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

.section-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* Transaction List & Rows */
.transaction-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tx-row {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
  transition: border-color 0.2s;
}

.tx-row:focus-within {
  border-color: rgba(99, 102, 241, 0.4);
}

.tx-row-main {
  display: grid;
  grid-template-columns: 1.1fr 1fr auto;
  gap: 8px;
  align-items: center;
}

.tx-row-sub {
  display: flex;
  gap: 8px;
  align-items: center;
  animation: slideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Nice Custom Checkbox */
.custom-checkbox-container {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  padding: 2px;
}

.custom-checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  height: 26px;
  width: 26px;
  background-color: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.4);
}

.custom-checkbox-container input:checked ~ .checkmark {
  background: linear-gradient(135deg, var(--accent-glow), var(--accent-purple));
  border-color: transparent;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.4);
}

.checkmark:after {
  content: "";
  display: none;
  width: 6px;
  height: 11px;
  border: solid white;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

.custom-checkbox-container input:checked ~ .checkmark:after {
  display: block;
}

.delete-btn {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--accent-danger);
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: background 0.2s;
}

.delete-btn:hover {
  background: rgba(239, 68, 68, 0.25);
}

.row-actions {
  display: flex;
  justify-content: flex-end;
}

/* Footer Summary */
.glass-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 540px;
  margin: 0 auto 12px auto;
  width: calc(100% - 24px);
  padding: 14px 16px;
  z-index: 100;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  text-align: center;
}

.summary-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.summary-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
}

.summary-value {
  font-size: 0.95rem;
  font-weight: 700;
}

.summary-item.highlight .summary-value {
  background: linear-gradient(to right, #818cf8, #e879f9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Custom Toast Alerts */
.custom-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(129, 140, 248, 0.4);
  box-shadow: 0 15px 35px rgba(0,0,0,0.6);
  padding: 10px 22px;
  border-radius: 30px;
  z-index: 2000;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.2px;
  backdrop-filter: blur(10px);
  animation: toastPop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes toastPop {
  from { opacity: 0; transform: translate(-50%, -15px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
