:root {
  --pink: #d6336c;
  --pink-light: #ffe3ec;
  --pink-bar-bg: #f4c9d6;
  --text: #2b2b33;
  --muted: #7a7a85;
  --bg: #fff6f8;
  --card: #ffffff;
  --shadow: 0 4px 16px rgba(214, 51, 108, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px 100px;
}

.hero {
  background: linear-gradient(135deg, var(--pink) 0%, #ff6f91 100%);
  color: white;
  border-radius: 20px;
  padding: 24px 20px;
  box-shadow: var(--shadow);
  text-align: center;
}

.hero-label {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 6px;
}

.hero-total {
  font-size: 40px;
  font-weight: 700;
  margin-bottom: 14px;
}

.hero-bar {
  height: 10px;
  background: rgba(255,255,255,0.35);
  border-radius: 6px;
  overflow: hidden;
}

.hero-bar-fill {
  height: 100%;
  background: white;
  width: 0%;
  transition: width 0.3s ease;
}

.hero-meta {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-top: 8px;
  opacity: 0.95;
}

.edit-total-btn {
  margin-top: 16px;
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
}

.categories {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cat-card {
  background: var(--card);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.cat-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cat-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--pink-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.cat-info {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cat-name {
  font-weight: 600;
  font-size: 15px;
}

.cat-allocated {
  font-weight: 700;
  font-size: 15px;
}

.cat-bar {
  height: 8px;
  background: var(--pink-bar-bg);
  border-radius: 5px;
  margin-top: 12px;
  overflow: hidden;
}

.cat-bar-fill {
  height: 100%;
  background: var(--pink);
  transition: width 0.3s ease;
}

.cat-bar-fill.over {
  background: #e03131;
}

.cat-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 8px;
}

.fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--pink);
  color: white;
  border: none;
  font-size: 28px;
  box-shadow: var(--shadow);
  cursor: pointer;
  max-width: 480px;
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: white;
  width: 100%;
  max-width: 480px;
  border-radius: 20px 20px 0 0;
  padding: 24px 20px 28px;
}

.modal h2 {
  margin: 0 0 16px;
  font-size: 18px;
}

.modal label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin: 12px 0 4px;
}

.modal input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e5e5ea;
  border-radius: 10px;
  font-size: 15px;
}

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

.modal-actions-right {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.btn-primary {
  background: var(--pink);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
}

.btn-ghost {
  background: none;
  border: none;
  color: var(--muted);
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
}

.btn-secondary {
  background: #fff0f0;
  color: #e03131;
  border: none;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
}
