:root {
  --deep-ocean: #001f3f;
  --sea-blue: #0077be;
  --aqua: #00a86b;
  --foam-white: #e0f7fa;
  --sand-gold: #f4d03f;
  --coral-red: #ff6b6b;
  --card-bg: rgba(255, 255, 255, 0.95);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background: linear-gradient(180deg, var(--deep-ocean) 0%, var(--sea-blue) 60%, #004466 100%);
  color: #233;
  min-height: 100vh;
  padding-bottom: 50px;
  position: relative;
  overflow-x: hidden;
}

.bubble-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.bubble {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.25);
  animation: floatBubble 12s ease-in-out infinite;
  backdrop-filter: blur(2px);
}

.bubble-1 { width: 140px; height: 140px; left: -30px; top: 80px; animation-duration: 10s; }
.bubble-2 { width: 90px; height: 90px; right: 10%; top: 20%; animation-duration: 13s; }
.bubble-3 { width: 120px; height: 120px; left: 20%; bottom: 15%; animation-duration: 11s; }
.bubble-4 { width: 70px; height: 70px; right: 5%; bottom: 25%; animation-duration: 9s; }
.bubble-5 { width: 160px; height: 160px; left: 60%; top: 55%; animation-duration: 14s; }

@keyframes floatBubble {
  0%, 100% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.7;
  }
  50% {
    transform: translate3d(20px, -30px, 0) scale(1.08);
    opacity: 0.95;
  }
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: rgba(0, 31, 63, 0.95);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
}

.brand {
  color: var(--foam-white);
  font-size: 1.5rem;
  font-weight: bold;
  text-decoration: none;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 20px;
}

.nav-links a {
  color: var(--foam-white);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--sand-gold);
}

.user-type-selector select {
  padding: 8px 12px;
  border-radius: 20px;
  border: 1px solid var(--sea-blue);
  background: var(--foam-white);
  font-weight: 600;
  cursor: pointer;
}

.container {
  max-width: 1100px;
  margin: 30px auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  margin-bottom: 24px;
  color: white;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.77rem;
  margin-bottom: 8px;
  color: var(--sand-gold);
}

.hero h1 {
  font-size: 1.7rem;
  margin-bottom: 8px;
}

.hero-badge {
  background: rgba(255, 255, 255, 0.18);
  padding: 12px 16px;
  border-radius: 999px;
  font-weight: 700;
  white-space: nowrap;
}

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

.card {
  background: var(--card-bg);
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  border-left: 6px solid var(--sea-blue);
}

.card.income { border-left-color: var(--aqua); }
.card.expense { border-left-color: var(--coral-red); }

.card h3 {
  font-size: 0.85rem;
  color: #666;
  text-transform: uppercase;
}

.card .amount {
  font-size: 1.8rem;
  font-weight: bold;
  margin-top: 5px;
}

.tracker-workspace {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 20px;
}

.form-section,
.list-section,
.analytics-card {
  background: var(--card-bg);
  padding: 25px;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

h2 {
  margin-bottom: 15px;
  color: var(--deep-ocean);
  font-size: 1.2rem;
}

.form-group {
  margin-bottom: 15px;
}

label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  font-size: 0.85rem;
}

input,
select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 0.95rem;
}

.btn-submit,
.ghost-btn {
  padding: 11px 14px;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
}

.btn-submit {
  width: 100%;
  background-color: var(--sea-blue);
  color: white;
}

.btn-submit:hover {
  background-color: var(--deep-ocean);
}

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

.ghost-btn {
  background: #eef7ff;
  color: var(--deep-ocean);
}

.transaction-list {
  list-style: none;
  max-height: 360px;
  overflow-y: auto;
}

.transaction-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid #eee;
  border-left: 4px solid var(--aqua);
  margin-bottom: 8px;
  border-radius: 6px;
  background: #fdfdfd;
}

.transaction-item.expense {
  border-left-color: var(--coral-red);
}

.meta-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
  font-size: 0.78rem;
  color: #6b7280;
}

.chip {
  background: #eaf6ff;
  color: var(--deep-ocean);
  border-radius: 999px;
  padding: 3px 8px;
}

.transaction-action {
  display: flex;
  align-items: center;
  gap: 10px;
}

.income-text {
  color: var(--aqua);
  font-weight: 700;
}

.expense-text {
  color: var(--coral-red);
  font-weight: 700;
}

.delete-btn {
  background: transparent;
  border: none;
  color: var(--coral-red);
  cursor: pointer;
  font-weight: bold;
}

.empty-state {
  padding: 16px;
  color: #64748b;
  text-align: center;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
}

.analytics-grid {
  display: grid;
  gap: 20px;
}

.analytics-card.wide {
  grid-column: 1 / -1;
}

.analytics-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.summary-pill {
  padding: 12px;
  background: #f7fbff;
  border-radius: 12px;
  border: 1px solid #dcefff;
}

.summary-pill strong {
  display: block;
  font-size: 1.1rem;
  margin-top: 4px;
}

.chart-shell {
  background: linear-gradient(135deg, #f8fbff 0%, #eef7ff 100%);
  border-radius: 14px;
  padding: 12px;
  min-height: 200px;
}

.chart-svg {
  width: 100%;
  height: auto;
}

.axis-label {
  font-size: 10px;
  fill: #64748b;
}

.chart-legend {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  color: #475569;
  font-size: 0.85rem;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
}

.table-card {
  overflow-x: auto;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
}

.report-table th,
.report-table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #e5ecf4;
}

.report-table th {
  color: var(--deep-ocean);
}

@media (max-width: 768px) {
  .tracker-workspace {
    grid-template-columns: 1fr;
  }

  .hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .bar-row {
    grid-template-columns: 80px 1fr 50px;
  }
}