/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ===== PIN SCREEN ===== */
.pin-screen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: linear-gradient(160deg, #3730a3 0%, #4f46e5 50%, #6d28d9 100%);
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

body.pin-active header,
body.pin-active main {
  filter: blur(6px);
  pointer-events: none;
  user-select: none;
}

.pin-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 32px 24px 40px;
  width: 100%;
  max-width: 360px;
}

.pin-logo {
  font-size: 3rem;
  margin-bottom: 10px;
}

.pin-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
}

.pin-subtitle {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
  margin-top: 6px;
  margin-bottom: 28px;
}

.pin-dots {
  display: flex;
  gap: 14px;
  margin-bottom: 10px;
}

.pin-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.5);
  background: transparent;
  transition: all 0.15s ease;
}

.pin-dot.filled {
  background: #fff;
  border-color: #fff;
  transform: scale(1.1);
}

.pin-error {
  font-size: 0.8rem;
  color: #fca5a5;
  min-height: 20px;
  margin-bottom: 20px;
  text-align: center;
}

@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-8px); }
  40%      { transform: translateX(8px); }
  60%      { transform: translateX(-6px); }
  80%      { transform: translateX(6px); }
}

#pinDots.shake {
  animation: shake 0.5s ease;
}

.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 72px);
  gap: 12px;
}

.pin-key {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.pin-key:active {
  background: rgba(255,255,255,0.35);
  transform: scale(0.93);
}

.pin-key-ok {
  background: rgba(255,255,255,0.9);
  color: #4f46e5;
}

.pin-key-ok:active {
  background: #fff;
}

.pin-key-del {
  background: rgba(255,255,255,0.08);
  font-size: 1.2rem;
}

:root {
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-light: #e0e7ff;
  --success: #10b981;
  --success-light: #d1fae5;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --bg: #f3f4f6;
  --bg-white: #ffffff;
  --border: #e5e7eb;
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow: 0 4px 12px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.16);
  --transition: 0.2s ease;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

/* ===== HEADER ===== */
.app-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 20px 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.app-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.app-subtitle {
  font-size: 0.75rem;
  opacity: 0.8;
  margin-top: 2px;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  padding: 16px;
  padding-bottom: 80px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 20px;
  border-radius: var(--border-radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:active { background: var(--primary-dark); transform: scale(0.98); }

.btn-secondary {
  background: var(--bg);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-secondary:active { background: var(--border); }

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:active { opacity: 0.85; }

.btn-icon {
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}
.btn-icon:active { transform: scale(0.92); background: rgba(255,255,255,0.25); }
.btn-icon.dark {
  background: var(--bg);
  color: var(--text-primary);
}

/* FAB */
.fab {
  position: absolute;
  bottom: 24px;
  right: 16px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 1.8rem;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  z-index: 10;
}
.fab:active { transform: scale(0.92); background: var(--primary-dark); }

/* ===== SUMMARY SECTION ===== */
.summary-section {
  margin-bottom: 20px;
}

.summary-card {
  background: var(--bg-white);
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--primary);
}

.summary-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.summary-amount {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  margin-top: 6px;
}

/* ===== PROJECTS SECTION ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.project-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg);
  padding: 3px 10px;
  border-radius: 20px;
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ===== PROJECT CARD ===== */
.project-card {
  background: var(--bg-white);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
  position: relative;
}
.project-card:active {
  transform: scale(0.99);
  border-color: var(--primary-light);
  box-shadow: var(--shadow);
}

.project-emoji {
  font-size: 2rem;
  width: 48px;
  height: 48px;
  background: var(--primary-light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.project-info {
  flex: 1;
  min-width: 0;
}

.project-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-meta {
  text-align: right;
  flex-shrink: 0;
}

.project-amount {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--danger);
}

.project-tx-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.project-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--transition);
}
.project-card:hover .project-actions {
  opacity: 1;
}

.btn-action {
  background: none;
  border: none;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  line-height: 1;
}
.btn-action:hover { background: var(--bg); }

.project-card-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
}

/* Project Plafon (card) */
.project-plafon-wrap {
  padding: 0 16px 12px;
  border-top: 1px solid var(--border);
}

.project-plafon-track {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}

.project-plafon-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.project-plafon-fill.over {
  background: var(--danger);
}

.project-plafon-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
}

.plafon-sisa-text {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--danger);
}

.plafon-pct-text {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.empty-text {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.empty-subtext {
  font-size: 0.85rem;
  margin-top: 6px;
}

/* ===== MODAL ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(2px);
}

.modal-overlay.active {
  display: flex;
}

.modal-overlay.fullscreen {
  align-items: stretch;
}

.modal {
  background: var(--bg-white);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.25s ease;
}

.modal-fullscreen {
  border-radius: 0;
  max-height: 100vh;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.modal-small {
  max-height: 60vh;
  border-radius: 20px;
  margin: auto;
  max-width: 320px;
}

.modal-overlay.fullscreen .modal {
  border-radius: 0;
}

@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.modal-header.sticky-header {
  position: sticky;
  top: 0;
  background: var(--bg-white);
  z-index: 5;
}

.modal-header .btn-icon {
  background: var(--bg);
  color: var(--text-primary);
  font-size: 1.3rem;
}

.header-center {
  flex: 1;
  text-align: center;
  min-width: 0;
}

.modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

.modal-body.no-padding {
  padding: 0;
}

.modal-footer {
  padding: 12px 16px;
  display: flex;
  gap: 10px;
  border-top: 1px solid var(--border);
}

.modal-footer .btn {
  flex: 1;
}

/* ===== FORM ===== */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--border-radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-white);
  transition: border-color var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-hint {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
}

/* Emoji Picker */
.emoji-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.emoji-option {
  font-size: 1.6rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
  background: var(--bg);
}
.emoji-option:hover { background: var(--primary-light); }
.emoji-option.selected { border-color: var(--primary); background: var(--primary-light); }

/* Type Toggle */
.type-toggle {
  display: flex;
  gap: 8px;
}

.type-btn {
  flex: 1;
  padding: 10px;
  border-radius: var(--border-radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-secondary);
}

.type-btn.active[data-type="pengeluaran"] {
  background: var(--danger-light);
  border-color: var(--danger);
  color: var(--danger);
}

.type-btn.active[data-type="pemasukan"] {
  background: var(--success-light);
  border-color: var(--success);
  color: var(--success);
}

/* ===== PROJECT SUMMARY BAR ===== */
.project-summary-bar {
  display: flex;
  background: var(--primary);
  color: white;
  padding: 14px 16px;
}

.proj-stat {
  flex: 1;
  text-align: center;
  border-right: 1px solid rgba(255,255,255,0.2);
}
.proj-stat:last-child { border-right: none; }

.proj-stat-label {
  font-size: 0.7rem;
  opacity: 0.75;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.proj-stat-value {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 4px;
}

/* ===== PLAFON SECTION ===== */
.plafon-section {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
}

.plafon-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.plafon-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.plafon-value {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-left: 6px;
}

.plafon-pct {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
}

.plafon-progress-track {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.plafon-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--success) 0%, var(--primary) 100%);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.plafon-progress-fill.over {
  background: var(--danger);
}

.plafon-bottom {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}

.plafon-stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.plafon-stat-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.plafon-stat-value {
  font-size: 0.88rem;
  font-weight: 700;
}

.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

/* ===== FILTER BAR ===== */
.filter-bar {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }

.filter-btn {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}
.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* ===== TRANSACTION LIST ===== */
.transaction-list {
  padding: 8px 0 80px;
}

/* Date Group */
.tx-date-group {
  padding: 8px 16px 4px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--bg);
}

/* Transaction Item */
.tx-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-white);
  position: relative;
}

.tx-type-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.tx-type-icon.pengeluaran {
  background: var(--danger-light);
}
.tx-type-icon.pemasukan {
  background: var(--success-light);
}

.tx-info {
  flex: 1;
  min-width: 0;
}

.tx-note {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}

.tx-category {
  font-size: 0.72rem;
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 500;
}

/* ===== CATEGORY CHIPS ===== */
.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}
.cat-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.cat-chip.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.tx-date-small {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.tx-amount {
  font-size: 0.95rem;
  font-weight: 700;
  flex-shrink: 0;
}
.tx-amount.pengeluaran { color: var(--danger); }
.tx-amount.pemasukan { color: var(--success); }

.tx-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--transition);
}
.tx-item:hover .tx-actions { opacity: 1; }
.tx-item:active .tx-actions { opacity: 1; }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1f2937;
  color: white;
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 1000;
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
  max-width: 90%;
  text-align: center;
  white-space: nowrap;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ===== CONFIRM MODAL ===== */
.text-center { text-align: center; }

.confirm-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.confirm-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.confirm-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ===== SCROLLBAR ===== */
.modal-body::-webkit-scrollbar { width: 4px; }
.modal-body::-webkit-scrollbar-track { background: transparent; }
.modal-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ===== TAB BAR ===== */
.tab-bar {
  display: flex;
  background: var(--bg-white);
  border-radius: var(--border-radius);
  padding: 4px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  gap: 4px;
}

.tab-btn {
  flex: 1;
  padding: 10px 12px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 10px;
  transition: all var(--transition);
}
.tab-btn.active {
  background: var(--primary);
  color: white;
}
.tab-btn:not(.active):hover {
  background: var(--bg);
  color: var(--text-secondary);
}

/* ===== DASHBOARD SECTION ===== */
.dashboard-section {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Summary Grid */
.dash-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.dash-sum-card {
  background: var(--bg-white);
  border-radius: var(--border-radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.dash-sum-card.out { border-left: 4px solid var(--danger); }
.dash-sum-card.in  { border-left: 4px solid var(--success); }
.dash-sum-card.net { grid-column: 1 / -1; }
.dash-sum-card.net.pos { border-left: 4px solid var(--primary); }
.dash-sum-card.net.neg { border-left: 4px solid var(--warning); }

.dash-sum-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}
.dash-sum-value {
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 4px;
}
.dash-sum-card.out .dash-sum-value { color: var(--danger); }
.dash-sum-card.in  .dash-sum-value { color: var(--success); }
.dash-sum-card.net.pos .dash-sum-value { color: var(--primary); }
.dash-sum-card.net.neg .dash-sum-value { color: var(--warning); }

/* Dashboard Section blocks */
.dash-section {
  margin-bottom: 16px;
}
.dash-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

/* Category bar chart */
.dash-cat-list {
  background: var(--bg-white);
  border-radius: var(--border-radius);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.dash-cat-row {
  display: grid;
  grid-template-columns: 96px 1fr 108px;
  align-items: center;
  gap: 10px;
}
.dash-cat-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-cat-bar-wrap {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.dash-cat-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}
.dash-cat-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}
.dash-cat-amt {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
}
.dash-cat-pct {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Project cards in dashboard */
.dash-proj-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dash-proj-card {
  background: var(--bg-white);
  border-radius: var(--border-radius);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--transition);
  border: 1.5px solid transparent;
}
.dash-proj-card:active {
  border-color: var(--primary-light);
  transform: scale(0.99);
}
.dash-proj-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dash-proj-emoji {
  font-size: 1.5rem;
  width: 42px;
  height: 42px;
  background: var(--primary-light);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dash-proj-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dash-proj-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-proj-desc {
  font-size: 0.73rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-proj-totals {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex-shrink: 0;
}
.dash-proj-out   { font-size: 0.75rem; color: var(--danger);  font-weight: 600; }
.dash-proj-in    { font-size: 0.75rem; color: var(--success); font-weight: 600; }
.dash-proj-empty { font-size: 0.73rem; color: var(--text-muted); }

.dash-proj-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.dash-proj-cat-badge {
  font-size: 0.72rem;
  padding: 3px 9px;
  border-radius: 12px;
  font-weight: 500;
}

/* Plafon bar in dashboard project card */
.dash-proj-plafon {
  margin-top: 10px;
}
.dash-proj-plafon-track {
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.dash-proj-plafon-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.3s ease;
}
.dash-proj-plafon-fill.over { background: var(--danger); }
.dash-proj-plafon-text {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}

/* ===== RESPONSIVE ===== */
@media (min-width: 480px) {
  body {
    box-shadow: var(--shadow-lg);
    min-height: 100vh;
  }
  .modal-overlay {
    align-items: center;
  }
  .modal {
    border-radius: 20px;
    max-height: 90vh;
  }
  .modal-overlay.fullscreen .modal {
    border-radius: 16px;
    height: 90vh;
    max-width: 480px;
    margin: auto;
  }
}
