/* ═══════════════════════════════════════════
   积账 Web — Design Tokens
   ═══════════════════════════════════════════ */
:root {
  --primary: #0A1628;
  --primary-light: #1B2D4A;
  --accent: #D4A853;
  --accent-light: #F0D98C;
  --bg: #F2F4F8;
  --surface: #FFFFFF;
  --surface-elevated: #FAFBFD;
  --positive: #2ECC71;
  --negative: #E74C3C;
  --warning: #F39C12;
  --text-primary: #1A1D26;
  --text-secondary: #6B7280;
  --text-tertiary: #9CA3AF;
  --divider: #E5E7EB;
  --border-light: #E8ECF1;
  --input-bg: #F8F9FB;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 14px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-3xl: 24px;
  --shadow-card: 0 8px 24px -4px rgba(10,22,40,0.06);
  --shadow-elevated: 0 12px 32px -6px rgba(10,22,40,0.10);
  --shadow-fab: 0 8px 20px rgba(10,22,40,0.30);
  --nav-height: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ═══════════════════════════════════════════
   Reset & Base
   ═══════════════════════════════════════════ */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'PingFang SC', 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
}
input, button, select, textarea { font-family: inherit; }
button { cursor: pointer; border: none; background: none; }

/* ═══════════════════════════════════════════
   App Layout
   ═══════════════════════════════════════════ */
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}
#page-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* ═══════════════════════════════════════════
   Bottom Navigation
   ═══════════════════════════════════════════ */
#bottom-nav {
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: var(--surface);
  padding: 6px 8px;
  padding-bottom: calc(6px + var(--safe-bottom));
  box-shadow: 0 -4px 20px rgba(0,0,0,0.04);
  flex-shrink: 0;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  gap: 3px;
  -webkit-tap-highlight-color: transparent;
}
.nav-item svg { width: 22px; height: 22px; color: var(--text-tertiary); transition: color 0.2s; }
.nav-item span { font-size: 11px; font-weight: 400; color: var(--text-tertiary); letter-spacing: 0.2px; transition: all 0.2s; }
.nav-item.active {
  background: rgba(10,22,40,0.08);
  padding: 8px 16px;
}
.nav-item.active svg { color: var(--primary); }
.nav-item.active span { color: var(--primary); font-weight: 600; }

/* ═══════════════════════════════════════════
   FAB
   ═══════════════════════════════════════════ */
.fab {
  position: fixed;
  right: 20px;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: white;
  padding: 14px 22px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-fab);
  font-size: 15px;
  font-weight: 600;
  z-index: 100;
  transition: transform 0.2s, opacity 0.2s;
}
.fab:active { transform: scale(0.95); }
.fab svg { width: 20px; height: 20px; }
.fab.hidden { transform: translateY(100px); opacity: 0; pointer-events: none; }

/* ═══════════════════════════════════════════
   Hero Header (Home Page)
   ═══════════════════════════════════════════ */
.hero-header {
  background: linear-gradient(135deg, #0A1628, #1B3A5C);
  padding: 20px 24px 28px;
  color: white;
  border-radius: 0 0 var(--radius-2xl) var(--radius-2xl);
}
.hero-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.hero-topbar h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; }
.hero-topbar-actions { display: flex; gap: 4px; }
.hero-topbar-actions button {
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 4px;
}
.hero-topbar-actions button:active { background: rgba(255,255,255,0.1); }
.hero-topbar-actions button svg { width: 18px; height: 18px; }
.hero-label { font-size: 13px; font-weight: 500; letter-spacing: 1px; color: rgba(255,255,255,0.6); }
.hero-amount { font-size: 34px; font-weight: 700; letter-spacing: -1px; margin: 6px 0 8px; }
.hero-date {
  display: inline-flex;
  padding: 4px 10px;
  background: rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
}

/* ═══════════════════════════════════════════
   Cards
   ═══════════════════════════════════════════ */
.card {
  background: var(--surface);
  border-radius: var(--radius-2xl);
  padding: 20px;
  box-shadow: var(--shadow-card);
}
.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.card-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-icon svg { width: 16px; height: 16px; }
.card-title { font-size: 16px; font-weight: 600; letter-spacing: -0.2px; flex: 1; }
.card-badge {
  font-size: 11px;
  color: var(--text-tertiary);
  background: var(--bg);
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 500;
}

/* ═══════════════════════════════════════════
   Asset List Items
   ═══════════════════════════════════════════ */
.asset-item {
  display: flex;
  align-items: center;
  padding: 7px 0;
  gap: 12px;
}
.asset-color-bar {
  width: 4px;
  height: 28px;
  border-radius: 2px;
  flex-shrink: 0;
}
.asset-name { flex: 1; font-size: 14px; font-weight: 500; }
.asset-value {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.3px;
}
.asset-value.negative { color: var(--negative); }
.asset-item-editable {
  cursor: pointer;
  border-radius: 10px;
  padding: 7px 4px;
  margin: 0 -4px;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.asset-item-editable:active { background: var(--bg); }
.asset-edit-icon { width: 16px; height: 16px; flex-shrink: 0; }
.total-row {
  display: flex;
  align-items: center;
  padding: 4px 0;
}
.total-row .label { flex: 1; font-size: 16px; font-weight: 700; letter-spacing: -0.3px; padding-left: 16px; }
.total-row .value { font-size: 17px; font-weight: 700; color: var(--primary); letter-spacing: -0.3px; }
.divider { height: 1.5px; background: var(--divider); margin: 4px 0; }

/* ═══════════════════════════════════════════
   Empty State
   ═══════════════════════════════════════════ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  text-align: center;
  min-height: 60vh;
}
.empty-icon {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(10,22,40,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}
.empty-icon svg { width: 48px; height: 48px; color: rgba(10,22,40,0.3); }
.empty-title { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; margin-bottom: 8px; }
.empty-subtitle { font-size: 15px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 28px; }

/* ═══════════════════════════════════════════
   Buttons
   ═══════════════════════════════════════════ */
.btn-primary {
  width: 100%;
  padding: 15px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-lg);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.3px;
  border: none;
  transition: opacity 0.2s;
}
.btn-primary:active { opacity: 0.85; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-outline {
  padding: 12px 20px;
  border: 1px solid var(--divider);
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  transition: background 0.2s;
}
.btn-outline:active { background: var(--bg); }

/* ═══════════════════════════════════════════
   Modal / Overlay Pages
   ═══════════════════════════════════════════ */
.modal-container {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg);
  z-index: 200;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transition: transform 0.3s ease;
}
.modal-container.hidden { transform: translateX(100%); pointer-events: none; }
.modal-container.visible { transform: translateX(0); }
.modal-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}
.modal-header .back-btn {
  padding: 8px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}
.modal-header .back-btn:active { background: var(--bg); }
.modal-header .back-btn svg { width: 24px; height: 24px; }
.modal-header h2 { flex: 1; font-size: 18px; font-weight: 700; margin-left: 4px; }
.modal-header .action-btn {
  padding: 6px;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
}
.modal-header .action-btn svg { width: 20px; height: 20px; }

/* ═══════════════════════════════════════════
   Date Selector
   ═══════════════════════════════════════════ */
.date-selector {
  margin: 16px 20px 8px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(10,22,40,0.06), rgba(212,168,83,0.04));
  border: 1px solid rgba(10,22,40,0.15);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.date-selector:active { opacity: 0.8; }
.date-icon {
  width: 28px; height: 28px;
  background: rgba(10,22,40,0.1);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
}
.date-icon svg { width: 16px; height: 16px; color: var(--primary); }
.date-text { flex: 1; font-size: 16px; font-weight: 600; color: var(--primary); letter-spacing: -0.2px; }
.date-chevron { color: rgba(10,22,40,0.5); }
.date-chevron svg { width: 22px; height: 22px; }

/* ═══════════════════════════════════════════
   Type Toggle (Asset / Liability)
   ═══════════════════════════════════════════ */
.type-toggle {
  display: flex;
  gap: 12px;
  padding: 8px 20px;
}
.type-chip {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--divider);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.type-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: var(--shadow-card);
}
.type-chip svg { width: 20px; height: 20px; color: var(--text-tertiary); }
.type-chip.active svg { color: rgba(255,255,255,0.7); }
.type-chip-text h3 { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.type-chip.active .type-chip-text h3 { color: white; }
.type-chip-text p { font-size: 11px; color: var(--text-tertiary); margin-top: 1px; }
.type-chip.active .type-chip-text p { color: rgba(255,255,255,0.6); }

/* ═══════════════════════════════════════════
   Input Row (Add Snapshot)
   ═══════════════════════════════════════════ */
.input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid #F0F1F3;
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  margin-bottom: 10px;
}
.input-row .color-bar {
  width: 4px;
  height: 36px;
  border-radius: 2px;
  flex-shrink: 0;
}
.input-row .cat-name {
  width: 80px;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}
.input-row .cat-name.liability { color: var(--negative); }
.input-row input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  background: var(--input-bg);
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.3px;
  outline: none;
}
.input-row input:focus { box-shadow: 0 0 0 1.5px var(--accent); }
.input-row input::placeholder { color: var(--text-tertiary); font-weight: 400; }
.row-action-btn {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  color: var(--text-tertiary);
  flex-shrink: 0;
  padding: 0;
  transition: all 0.2s;
}
.row-action-btn svg { width: 18px; height: 18px; }
.row-action-btn:active { background: rgba(231,76,60,0.1); color: var(--negative); }

/* ═══════════════════════════════════════════
   Add Category Button
   ═══════════════════════════════════════════ */
.add-cat-btn {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--divider);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin: 12px 0;
  cursor: pointer;
  background: none;
}
.add-cat-btn:active { background: var(--bg); }
.add-cat-btn svg { width: 18px; height: 18px; color: var(--text-tertiary); }

/* ═══════════════════════════════════════════
   Bottom Bar (Add Snapshot)
   ═══════════════════════════════════════════ */
.bottom-bar {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  padding: 16px 20px;
  padding-bottom: calc(16px + var(--safe-bottom));
  box-shadow: 0 -4px 16px rgba(0,0,0,0.04);
}
.bottom-bar .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.bottom-bar .sub-label { font-size: 13px; color: var(--text-tertiary); }
.bottom-bar .sub-value { font-size: 14px; font-weight: 600; }
.bottom-bar .sub-value.positive { color: var(--positive); }
.bottom-bar .sub-value.negative { color: var(--negative); }
.bottom-bar .net-label { font-size: 16px; font-weight: 700; letter-spacing: -0.3px; }
.bottom-bar .net-value { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; color: var(--primary); }
.bottom-bar .net-value.negative { color: var(--negative); }

/* ═══════════════════════════════════════════
   Table Page
   ═══════════════════════════════════════════ */
.table-container {
  margin: 16px;
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { border-collapse: collapse; min-width: 100%; }
.data-table th, .data-table td {
  padding: 12px 10px;
  text-align: right;
  white-space: nowrap;
  font-size: 12px;
  border-bottom: 1px solid #f0f1f3;
}
.data-table th {
  background: var(--primary);
  color: white;
  font-weight: 600;
  font-size: 12px;
  position: sticky;
  top: 0;
  z-index: 2;
}
.data-table th.date-th { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.data-table th.date-th:active { background: var(--primary-light); }
.data-table th:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  z-index: 3;
  min-width: 100px;
}
.data-table td:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  background: var(--surface-elevated);
  z-index: 1;
  font-weight: 500;
  min-width: 100px;
}
.data-table td { font-weight: 500; letter-spacing: -0.3px; }
.data-table td.negative { color: var(--negative); }
.data-table tr.total-row td {
  font-weight: 700;
  color: var(--primary);
  border-top: 1.5px solid rgba(10,22,40,0.2);
  background: rgba(10,22,40,0.03);
}
.data-table tr.total-row td:first-child { background: rgba(10,22,40,0.03); }
.cat-cell { display: flex; align-items: center; gap: 8px; }
.cat-cell .bar { width: 3px; height: 24px; border-radius: 2px; flex-shrink: 0; }

/* Table action bar */
.table-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
}
.table-actions h2 { font-size: 18px; font-weight: 700; }
.table-actions .btns { display: flex; gap: 8px; }
.icon-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(10,22,40,0.06);
}
.icon-btn:active { background: rgba(10,22,40,0.12); }
.icon-btn svg { width: 18px; height: 18px; color: var(--primary); }

/* ═══════════════════════════════════════════
   Charts Page
   ═══════════════════════════════════════════ */
.chart-tabs {
  display: flex;
  background: var(--primary);
  padding: 0 16px;
}
.chart-tab {
  flex: 1;
  padding: 12px 8px;
  text-align: center;
  font-size: 14px;
  font-weight: 400;
  color: rgba(255,255,255,0.7);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.chart-tab.active { color: white; font-weight: 600; border-bottom-color: var(--accent); }
.chart-header {
  background: var(--primary);
  padding: 14px 24px 16px;
  color: white;
}
.chart-header h2 { font-size: 18px; font-weight: 700; }
.time-range {
  display: flex;
  gap: 6px;
  padding: 10px 16px;
  justify-content: center;
}
.time-chip {
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  background: #F1F3F7;
  color: var(--text-primary);
  cursor: pointer;
  border: none;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.2s;
}
.time-chip.active { background: var(--primary); color: white; }
.chart-area { padding: 16px; }
.chart-canvas-wrap { position: relative; height: 220px; }
.chart-canvas-wrap canvas { width: 100% !important; height: 100% !important; }

/* Pie chart legend */
.pie-legend { padding: 0 16px 16px; }
.pie-legend-item {
  display: flex;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f0f1f3;
}
.pie-legend-item:last-child { border: none; }
.pie-dot { width: 12px; height: 12px; border-radius: 50%; margin-right: 10px; flex-shrink: 0; }
.pie-legend-item .name { flex: 1; font-size: 14px; }
.pie-legend-item .val { font-size: 12px; color: var(--text-secondary); }

/* Detail card (chart click) */
.detail-card {
  margin: 8px 16px 16px;
  background: var(--surface-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--divider);
  overflow: hidden;
}
.detail-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: rgba(10,22,40,0.06);
}
.detail-card-header .date { font-weight: 600; color: var(--primary); font-size: 14px; }
.detail-card-header .amount { font-weight: 700; color: var(--primary); font-size: 15px; }
.detail-card-body { padding: 8px 16px; }
.detail-row {
  display: flex;
  align-items: center;
  padding: 8px 0;
  gap: 10px;
  border-bottom: 1px solid #f0f1f3;
}
.detail-row:last-child { border: none; }
.detail-bar { width: 4px; height: 20px; border-radius: 2px; flex-shrink: 0; }
.detail-name { flex: 1; font-size: 13px; }
.detail-value { font-size: 13px; font-weight: 500; }

/* ═══════════════════════════════════════════
   Report Page
   ═══════════════════════════════════════════ */
.report-card {
  margin: 20px;
  padding: 28px;
  background: var(--surface);
  border-radius: var(--radius-3xl);
  box-shadow: var(--shadow-elevated);
}
.report-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}
.report-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, #0A1628, #1B3A5C);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
}
.report-icon svg { width: 22px; height: 22px; color: white; }
.report-title h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; }
.report-title p { font-size: 11px; color: var(--text-tertiary); letter-spacing: 0.5px; }
.report-hero {
  padding: 24px;
  background: linear-gradient(135deg, #0A1628, #1B3A5C);
  border-radius: 18px;
  margin-bottom: 20px;
}
.report-hero .label { font-size: 13px; font-weight: 500; letter-spacing: 1px; color: rgba(255,255,255,0.6); }
.report-hero .amount { font-size: 30px; font-weight: 700; letter-spacing: -1px; color: white; margin-top: 8px; }
.summary-row { display: flex; gap: 12px; margin-bottom: 24px; }
.summary-item {
  flex: 1;
  padding: 16px;
  border-radius: var(--radius-lg);
}
.summary-item.positive { background: rgba(46,204,113,0.06); border: 1px solid rgba(46,204,113,0.1); }
.summary-item.negative { background: rgba(231,76,60,0.06); border: 1px solid rgba(231,76,60,0.1); }
.summary-item .label { font-size: 12px; font-weight: 500; margin-bottom: 8px; }
.summary-item.positive .label { color: var(--positive); }
.summary-item.negative .label { color: var(--negative); }
.summary-item .value { font-size: 16px; font-weight: 700; letter-spacing: -0.3px; }
.summary-item.positive .value { color: var(--positive); }
.summary-item.negative .value { color: var(--negative); }
.report-watermark { text-align: center; color: #d0d0d0; font-size: 11px; letter-spacing: 0.5px; margin-top: 24px; }

/* ═══════════════════════════════════════════
   Dialog
   ═══════════════════════════════════════════ */
.dialog-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.dialog {
  background: var(--surface);
  border-radius: var(--radius-2xl);
  padding: 24px;
  width: 100%;
  max-width: 360px;
  max-height: 80vh;
  overflow-y: auto;
}
.dialog h3 { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.dialog input[type="text"], .dialog textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--input-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  font-size: 14px;
  outline: none;
  margin-bottom: 16px;
}
.dialog input:focus, .dialog textarea:focus { border-color: var(--accent); }
.dialog textarea { resize: vertical; min-height: 120px; }
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}
.dialog-actions button {
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
}
.dialog-actions .cancel { color: var(--text-tertiary); }
.dialog-actions .confirm { background: var(--primary); color: white; }
.dialog-actions .danger { color: var(--negative); }

/* Color picker */
.color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0;
}
.color-dot {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}
.color-dot.selected { border-color: var(--primary); box-shadow: 0 0 8px rgba(0,0,0,0.2); }

/* Liability toggle */
.liability-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--bg);
  margin-bottom: 16px;
}
.liability-toggle.active { background: rgba(231,76,60,0.06); }
.liability-toggle label { font-size: 14px; font-weight: 500; }
.toggle-switch {
  position: relative;
  width: 44px; height: 24px;
  background: #ccc;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.3s;
}
.toggle-switch.on { background: var(--negative); }
.toggle-switch::after {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  background: white;
  border-radius: 50%;
  top: 2px; left: 2px;
  transition: transform 0.3s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch.on::after { transform: translateX(20px); }

/* ═══════════════════════════════════════════
   Category Management
   ═══════════════════════════════════════════ */
.category-item {
  display: flex;
  align-items: center;
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 12px 16px;
  margin-bottom: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.03);
  gap: 12px;
}
.category-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
}
.category-icon svg { width: 20px; height: 20px; }
.category-info { flex: 1; }
.category-info .name { font-size: 15px; font-weight: 600; }
.category-info .name.liability { color: var(--negative); }
.category-info .type { font-size: 12px; color: var(--text-tertiary); }
.category-actions { display: flex; gap: 4px; }
.category-actions button {
  padding: 6px;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
}
.category-actions button:active { background: var(--bg); }
.category-actions button svg { width: 18px; height: 18px; }
.category-actions .delete-btn { color: rgba(231,76,60,0.6); }

/* ═══════════════════════════════════════════
   Feedback Page
   ═══════════════════════════════════════════ */
.feedback-hero {
  padding: 24px;
  background: linear-gradient(135deg, #0A1628, #1B3A5C);
  border-radius: var(--radius-2xl);
  color: white;
  margin-bottom: 24px;
}
.feedback-hero svg { width: 28px; height: 28px; color: rgba(255,255,255,0.7); margin-bottom: 12px; }
.feedback-hero h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; margin-bottom: 6px; }
.feedback-hero p { font-size: 14px; color: rgba(255,255,255,0.7); }
.feedback-types { display: flex; gap: 8px; margin: 12px 0 24px; }
.fb-type {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--divider);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.fb-type.active { background: var(--primary); border-color: var(--primary); color: white; box-shadow: 0 2px 8px rgba(10,22,40,0.2); }
.fb-type svg { width: 20px; height: 20px; color: var(--text-tertiary); }
.fb-type.active svg { color: white; }
.fb-type span { font-size: 11px; font-weight: 500; color: var(--text-secondary); }
.fb-type.active span { color: white; }
.section-label { font-size: 15px; font-weight: 700; letter-spacing: -0.2px; margin-bottom: 10px; }
.section-note { font-size: 12px; color: var(--text-tertiary); margin: -6px 0 10px; }

/* ═══════════════════════════════════════════
   Toast
   ═══════════════════════════════════════════ */
.toast {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  color: white;
  z-index: 500;
  transition: transform 0.3s ease;
  max-width: calc(100vw - 40px);
  text-align: center;
  pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--positive); }
.toast.error { background: var(--negative); }
.toast.info { background: var(--primary); }

/* ═══════════════════════════════════════════
   Chart.js date picker for allocation
   ═══════════════════════════════════════════ */
.alloc-date-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 16px;
  padding: 10px 16px;
  background: rgba(10,22,40,0.06);
  border: 1px solid rgba(10,22,40,0.15);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}
.alloc-date-btn:active { opacity: 0.8; }
.alloc-date-btn svg { width: 16px; height: 16px; }

/* Loading spinner */
.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--divider);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════
   Utilities
   ═══════════════════════════════════════════ */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-4 { margin-top: 4px; }
.mt-6 { margin-top: 6px; }
.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.px-20 { padding-left: 20px; padding-right: 20px; }
.content-pad { padding: 0 20px 100px; }
