:root {
  --bg: #0e0f10;
  --card: #1a1c1e;
  --card-border: #2a2d30;
  --text: #f2f3f4;
  --muted: #9aa0a6;
  --accent: #8fbf96;
  --accent-dark: #6f9c76;
  --danger: #e08585;
  --income: #8fbf96;
  --expense: #e0a06a;
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

#app {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 16px 100px;
  min-height: 100vh;
}

.screen { display: none; }
.screen.active { display: block; }

.top-title {
  font-size: 22px;
  font-weight: 700;
  margin: 8px 0 18px;
}

.menu-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
}

.menu-row:active { background: #202225; }

.menu-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.menu-icon.finance { background: #3a3020; }
.menu-icon.tasks { background: #203a2e; }
.menu-icon.reminders { background: #2a2436; }
.menu-icon.status { background: #26282a; }

.menu-text { flex: 1; min-width: 0; }
.menu-title { font-size: 16px; font-weight: 600; }
.menu-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-chevron { color: var(--muted); font-size: 18px; }

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.tab {
  flex: 1;
  text-align: center;
  padding: 9px 0;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--card-border);
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}

.tab.active {
  background: var(--accent);
  color: #10231a;
  font-weight: 600;
  border-color: var(--accent);
}

.summary-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
}

.summary-currency {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  margin-bottom: 4px;
}

.summary-row .income { color: var(--income); }
.summary-row .expense { color: var(--expense); }

.summary-balance {
  font-size: 20px;
  font-weight: 700;
  margin-top: 6px;
}

.section-label {
  font-size: 13px;
  color: var(--muted);
  margin: 18px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tx-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
}

.tx-main { min-width: 0; }
.tx-category { font-size: 15px; font-weight: 600; }
.tx-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.tx-amount { font-size: 15px; font-weight: 700; white-space: nowrap; }
.tx-amount.expense { color: var(--expense); }
.tx-amount.income { color: var(--income); }

.empty-hint {
  color: var(--muted);
  text-align: center;
  padding: 30px 10px;
  font-size: 14px;
}

.fab {
  position: fixed;
  right: 20px;
  bottom: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #10231a;
  font-size: 28px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0,0,0,0.4);
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: flex-end;
  z-index: 10;
}

.sheet-backdrop.active { display: flex; }

.sheet {
  background: var(--bg);
  border-radius: 20px 20px 0 0;
  width: 100%;
  padding: 20px 16px 28px;
  max-height: 85vh;
  overflow-y: auto;
}

.sheet-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; }

.kind-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.kind-btn {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--card-border);
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
}

.kind-btn.active.expense { background: var(--expense); color: #2b1a0c; border-color: var(--expense); }
.kind-btn.active.income { background: var(--income); color: #10231a; border-color: var(--income); }

.field-label {
  font-size: 13px;
  color: var(--muted);
  margin: 14px 0 6px;
}

.amount-input, .comment-input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 16px;
}

.category-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-chip {
  padding: 8px 14px;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--card-border);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}

.category-chip.selected {
  background: var(--accent);
  color: #10231a;
  border-color: var(--accent);
  font-weight: 600;
}

.error-banner {
  background: #3a2020;
  color: #f5b5b5;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 12px;
  display: none;
}

.error-banner.active { display: block; }

.task-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
}

.task-checkbox {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--muted);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  margin-top: 1px;
  cursor: pointer;
}

.task-checkbox.done {
  background: var(--accent);
  border-color: var(--accent);
  color: #10231a;
}

.task-main { flex: 1; min-width: 0; }
.task-title { font-size: 15px; }
.task-title.done { color: var(--muted); text-decoration: line-through; }

.task-due {
  font-size: 12px;
  margin-top: 4px;
  color: var(--muted);
}

.task-due.overdue { color: var(--danger); }

.progress-track {
  width: 100%;
  height: 8px;
  background: #26282a;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-fill.warn { background: var(--expense); }
.progress-fill.full { background: var(--danger); }
