:root {
  --primary: #7c3aed;
  --primary-dark: #5b21b6;
  --primary-soft: #f3e8ff;
  --black: #111111;
  --charcoal: #25212f;
  --text-muted: #6b7280;
  --border: #e8e3f0;
  --bg: #f8f7fc;
  --surface: #ffffff;
  --danger: #ef4444;
  --success: #10b981;
  --shadow: 0 18px 45px rgba(39, 22, 67, .08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  font-family: 'Inter', sans-serif;
  color: var(--black);
}
button, input, textarea { font-family: inherit; }
button { border: 0; }

.app-shell {
  width: 100%;
  max-width: 520px;
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: 94px;
  position: relative;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 20px 12px;
}
.eyebrow {
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.page-title { font-size: 27px; font-weight: 800; letter-spacing: -.04em; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 16px;
  background: var(--surface); box-shadow: var(--shadow);
  display: grid; place-items: center; color: var(--charcoal);
}
.icon-btn svg { width: 20px; height: 20px; }
.page-content { padding: 0 18px; }
.view { display: none; animation: fadeIn .22s ease; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.balance-card {
  border-radius: 28px;
  padding: 24px;
  color: #fff;
  background: var(--black);
  box-shadow: 0 22px 55px rgba(91,33,182,.28);
  overflow: hidden;
  position: relative;
}
.balance-card:after {
  content: '';
  position: absolute; width: 180px; height: 180px; border-radius: 50%;
  right: -60px; top: -60px; background: rgba(255,255,255,.11);
}
.muted-white { color: rgba(255,255,255,.68); font-size: 13px; }
.balance-amount { font-size: 32px; font-weight: 800; letter-spacing: -.05em; }
.pill-light { background: rgba(255,255,255,.14); color: #fff; padding: 7px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.balance-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 28px; }
.balance-stats > div { padding: 14px; border-radius: 18px; background: rgba(255,255,255,.1); backdrop-filter: blur(12px); }
.balance-stats strong { font-size: 15px; }

.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 18px 0 20px; }
.quick-card {
  min-height: 82px;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--charcoal);
  display: flex; flex-direction: column; gap: 8px;
  align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.quick-card svg { color: var(--primary); width: 22px; height: 22px; }

.section-head { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 12px; }
.section-head h3 { font-size: 18px; font-weight: 800; margin: 0; letter-spacing: -.03em; }
.section-head span { color: var(--text-muted); font-size: 12px; font-weight: 600; }
.link-btn { background: transparent; color: var(--primary); font-weight: 800; font-size: 13px; }
.glass-card, .preview-card, .search-card, .setting-list {
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(232,227,240,.9);
  border-radius: 24px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.transaction-list { display: flex; flex-direction: column; gap: 12px; }
.transaction-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.tx-icon { width: 44px; height: 44px; border-radius: 16px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: 0 0 44px; }
.tx-content { flex: 1; min-width: 0; }
.tx-content strong { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-content span { color: var(--text-muted); font-size: 12px; }
.tx-amount { font-size: 14px; font-weight: 800; }
.tx-amount.income { color: var(--success); }
.tx-amount.expense { color: var(--danger); }

.ai-card {
  margin-top: 18px;
  padding: 18px;
  border-radius: 24px;
  background: #111;
  color: #fff;
  display: flex;
  gap: 14px;
}
.ai-icon { width: 44px; height: 44px; border-radius: 16px; background: var(--primary); display: grid; place-items: center; flex: 0 0 44px; }
.ai-card h4 { font-size: 15px; font-weight: 800; margin: 0 0 4px; }
.ai-card p { color: rgba(255,255,255,.72); margin: 0; font-size: 13px; line-height: 1.55; }

.segment-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 6px; border-radius: 18px; background: #ede8f7; margin-bottom: 14px; }
.segment { padding: 12px; border-radius: 14px; background: transparent; color: var(--text-muted); font-weight: 800; font-size: 13px; }
.segment.active { background: var(--surface); color: var(--primary); box-shadow: 0 10px 25px rgba(41,20,79,.08); }
.record-panel { display: none; }
.record-panel.active { display: block; }
.form-label { font-weight: 800; font-size: 13px; color: var(--charcoal); }
.app-input { border: 1px solid var(--border); border-radius: 16px; padding: 13px 14px; font-size: 14px; background: #fff; }
.app-input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(124,58,237,.1); }
.primary-btn, .secondary-btn {
  height: 52px; border-radius: 17px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
}
.primary-btn { background: var(--primary); color: #fff; box-shadow: 0 14px 30px rgba(124,58,237,.25); }
.secondary-btn { background: var(--primary-soft); color: var(--primary); }
.primary-btn svg, .secondary-btn svg { width: 18px; height: 18px; }
.voice-card { text-align: center; background: var(--surface); border-radius: 28px; padding: 26px 18px; border: 1px solid var(--border); box-shadow: var(--shadow); }
.mic-orb { width: 94px; height: 94px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--primary); box-shadow: 0 18px 45px rgba(124,58,237,.35); }
.mic-orb.listening { animation: pulse 1s infinite ease-in-out; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.voice-card h3 { font-weight: 800; margin: 0 0 6px; }
.voice-card p { color: var(--text-muted); font-size: 13px; }
.upload-box { min-height: 180px; border: 1.8px dashed #c7b6ea; border-radius: 22px; background: var(--primary-soft); display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center; text-align: center; cursor: pointer; color: var(--primary-dark); padding: 20px; }
.upload-box svg { width: 36px; height: 36px; }
.upload-box span { color: var(--text-muted); font-size: 13px; }
.image-preview { width: 100%; max-height: 260px; object-fit: cover; border-radius: 20px; margin-top: 14px; border: 1px solid var(--border); }
.preview-card { margin-top: 16px; }
.preview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.preview-grid label { font-size: 12px; font-weight: 800; color: var(--text-muted); }
.grid-full { grid-column: 1 / -1; }

.search-card { display: flex; gap: 10px; align-items: center; padding: 14px 16px; }
.search-card input { border: none; outline: none; background: transparent; width: 100%; font-size: 14px; }
.search-card svg { color: var(--text-muted); width: 20px; }
.filter-row { display: flex; gap: 8px; overflow-x: auto; padding: 14px 0 2px; }
.filter-chip { padding: 10px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--border); color: var(--text-muted); font-size: 13px; font-weight: 800; white-space: nowrap; }
.filter-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.insight-hero { border-radius: 28px; padding: 24px; color: #fff; background: var(--black); box-shadow: 0 22px 55px rgba(91,33,182,.25); }
.insight-hero svg { width: 34px; height: 34px; margin-bottom: 18px; }
.insight-hero h2 { font-size: 26px; font-weight: 800; letter-spacing: -.04em; }
.insight-hero p { color: rgba(255,255,255,.75); line-height: 1.6; margin: 0; }
.insight-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.mini-insight { background: #fff; border-radius: 22px; border: 1px solid var(--border); padding: 16px; box-shadow: var(--shadow); }
.mini-insight span { color: var(--text-muted); font-size: 12px; font-weight: 700; }
.mini-insight strong { display: block; font-size: 20px; font-weight: 800; margin-top: 5px; }
.mini-insight p { color: var(--primary); font-size: 13px; font-weight: 800; margin: 4px 0 0; }
.card-title { font-size: 16px; font-weight: 800; }
.clean-list { padding-left: 18px; margin-bottom: 0; color: var(--text-muted); line-height: 1.8; font-size: 14px; }

.profile-card { background: var(--surface); border: 1px solid var(--border); border-radius: 28px; padding: 26px; text-align: center; box-shadow: var(--shadow); margin-top: 8px; }
.avatar { width: 76px; height: 76px; border-radius: 24px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--primary); color: #fff; font-weight: 900; font-size: 30px; }
.profile-card h3 { font-weight: 800; margin: 0; }
.profile-card p { color: var(--text-muted); margin: 6px 0 0; }
.setting-list { margin-top: 16px; padding: 8px; }
.setting-item { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px; }
.setting-item svg { color: var(--primary); width: 20px; }
.setting-item span { flex: 1; font-weight: 700; }
.setting-item strong { color: var(--text-muted); font-size: 12px; }

.bottom-nav { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); width: calc(100% - 28px); max-width: 492px; padding: 10px; border-radius: 26px; background: rgba(255,255,255,.92); backdrop-filter: blur(16px); border: 1px solid rgba(232,227,240,.95); box-shadow: 0 20px 50px rgba(39,22,67,.14); display: grid; grid-template-columns: repeat(5, 1fr); z-index: 50; }
.nav-item { height: 58px; border-radius: 19px; background: transparent; color: #8b8398; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 10.5px; font-weight: 800; }
.nav-item svg { width: 20px; height: 20px; }
.nav-item.active { background: var(--primary-soft); color: var(--primary); }
.toast-wrap { position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%); width: calc(100% - 32px); max-width: 460px; z-index: 70; }
.app-toast { padding: 14px 16px; border-radius: 18px; background: #111; color: #fff; box-shadow: 0 18px 40px rgba(0,0,0,.22); font-size: 13px; font-weight: 700; animation: fadeIn .2s ease; }

@media (min-width: 768px) {
  .app-shell { max-width: 1100px; padding-bottom: 34px; }
  .page-content { padding: 0 26px; }
  .topbar { padding: 28px 28px 14px; }
  #view-home.active { display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; align-items: start; }
  #view-home .balance-card, #view-home .quick-grid, #view-home .section-head, #view-home .glass-card, #view-home .transaction-list, #view-home .ai-card { grid-column: auto; }
  .quick-grid { grid-template-columns: repeat(2, 1fr); margin-top: 0; }
  .bottom-nav { max-width: 620px; }
}

.empty-state {
  padding: 22px;
  text-align: center;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 18px;
}

.filter-card {
  margin-top: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.filter-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.filter-title strong { display: block; font-size: 15px; font-weight: 900; }
.filter-title span { display: block; color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.filter-title svg { color: var(--primary); width: 22px; height: 22px; }
.preset-grid {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.preset-chip {
  white-space: nowrap;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-muted);
  border-radius: 999px;
  padding: 10px 13px;
  font-size: 12px;
  font-weight: 850;
}
.preset-chip.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.custom-date-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.custom-date-grid label,
.history-filter-grid label {
  color: var(--text-muted);
  font-weight: 800;
  font-size: 12px;
}
.custom-date-grid .primary-btn { grid-column: 1 / -1; }
.history-filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.history-filter-grid input:first-child { grid-column: 1 / -1; }
.summary-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}
.mini-stat {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 12px;
  box-shadow: var(--shadow);
  min-height: 74px;
}
.mini-stat span {
  display: block;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 800;
  margin-bottom: 6px;
}
.mini-stat strong {
  color: var(--charcoal);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
  word-break: break-word;
}
@media (max-width: 390px) {
  .summary-mini-grid { grid-template-columns: 1fr; }
}

/* finepedia v4: no-gradient clean responsive theme */
body {
  background: var(--bg) !important;
}
.balance-card {
  background: var(--black) !important;
  box-shadow: 0 18px 42px rgba(17,17,17,.12) !important;
}
.balance-card:after { display: none !important; }
.balance-stats > div {
  background: rgba(255,255,255,.08) !important;
  backdrop-filter: none !important;
  border: 1px solid rgba(255,255,255,.08);
}
.glass-card, .preview-card, .search-card, .setting-list {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
}
.mic-orb {
  background: var(--primary) !important;
  box-shadow: 0 16px 35px rgba(124,58,237,.24) !important;
}
.insight-hero {
  background: var(--black) !important;
  box-shadow: 0 18px 42px rgba(17,17,17,.12) !important;
}
.profile-card {
  background: var(--surface) !important;
}
.primary-btn { box-shadow: 0 12px 24px rgba(124,58,237,.18) !important; }
.quick-card, .transaction-item, .filter-card, .mini-stat, .mini-insight, .voice-card, .profile-card {
  box-shadow: 0 14px 34px rgba(39,22,67,.06) !important;
}

.budget-total-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  border-radius: 24px;
  background: var(--black);
  color: #fff;
  padding: 16px;
  box-shadow: 0 18px 42px rgba(17,17,17,.12);
}
.budget-total-card div {
  min-width: 0;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.08);
}
.budget-total-card span {
  display: block;
  color: rgba(255,255,255,.68);
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 6px;
}
.budget-total-card strong {
  font-size: 13px;
  font-weight: 900;
  word-break: break-word;
}
.budget-form {
  display: grid;
  gap: 10px;
}
.budget-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.budget-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 16px;
  box-shadow: 0 14px 34px rgba(39,22,67,.06);
}
.budget-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.budget-head strong { font-size: 15px; font-weight: 900; }
.budget-head span { color: var(--text-muted); font-size: 12px; font-weight: 700; }
.budget-percent {
  flex: 0 0 auto;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 900;
}
.progress-track {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: #eee9f7;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
  width: 0%;
}
.budget-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}
.budget-meta b { color: var(--charcoal); }

.bottom-nav {
  grid-template-columns: 1fr 1fr 78px 1fr 1fr !important;
  align-items: center;
  padding: 9px 10px !important;
}
.nav-voice {
  width: 68px;
  height: 68px !important;
  margin: -28px auto 0;
  border-radius: 24px !important;
  background: var(--primary) !important;
  color: #fff !important;
  box-shadow: 0 16px 34px rgba(124,58,237,.28);
}
.nav-voice.active {
  background: var(--primary) !important;
  color: #fff !important;
}
.nav-voice svg { width: 24px !important; height: 24px !important; }
.nav-voice span { font-size: 10px; }
.nav-item { min-width: 0; }

@media (max-width: 420px) {
  .page-title { font-size: 24px; }
  .balance-card { padding: 20px; border-radius: 24px; }
  .balance-amount { font-size: 27px; }
  .balance-stats { gap: 10px; margin-top: 20px; }
  .balance-stats > div { padding: 12px; }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .preview-grid, .history-filter-grid, .custom-date-grid { grid-template-columns: 1fr !important; }
  .summary-mini-grid, .insight-grid, .budget-total-card { grid-template-columns: 1fr; }
  .bottom-nav { width: calc(100% - 18px); bottom: 10px; border-radius: 24px; }
  .nav-item span { font-size: 9.5px; }
  .nav-voice { width: 64px; height: 64px !important; }
  .tx-amount { font-size: 12px; }
  .tx-content strong { font-size: 13px; }
  .tx-content span { font-size: 11px; }
}

@media (min-width: 768px) {
  .bottom-nav { max-width: 680px; }
  #view-budget.active, #view-record.active, #view-history.active, #view-insight.active, #view-profile.active {
    max-width: 680px;
    margin: 0 auto;
  }
}


/* finepedia v5 UI patch: purple cards, cleaner cashflow, circular voice shortcut */
.balance-card {
  background: var(--primary) !important;
  box-shadow: 0 18px 42px rgba(124,58,237,.18) !important;
}
.balance-stats > div {
  background: rgba(255,255,255,.12) !important;
  border: 1px solid rgba(255,255,255,.16) !important;
}

.ai-card { display: none !important; }

.cashflow-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 16px;
  box-shadow: 0 14px 34px rgba(39,22,67,.06);
}
.cashflow-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.cashflow-top span {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 2px;
}
.cashflow-top strong {
  display: block;
  color: var(--charcoal);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -.03em;
}
.cashflow-top svg {
  width: 38px;
  height: 38px;
  padding: 9px;
  border-radius: 14px;
  color: var(--primary);
  background: var(--primary-soft);
}
.cashflow-pie-wrap {
  display: grid;
  grid-template-columns: 180px 1fr;
  align-items: center;
  gap: 18px;
  padding-top: 8px;
}
.cashflow-pie {
  width: 180px !important;
  height: 180px !important;
  margin: 0 auto;
  border-radius: 50%;
  overflow: hidden;
}
.cashflow-pie tbody,
.cashflow-pie tr,
.cashflow-pie td {
  border: 0 !important;
}
.cashflow-pie .data {
  font-size: 11px;
  font-weight: 900;
  color: var(--charcoal);
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(124,58,237,.12);
  border-radius: 999px;
  padding: 5px 8px;
  box-shadow: 0 8px 18px rgba(39,22,67,.08);
}
.cashflow-pie-legend {
  display: grid;
  gap: 10px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
}
.legend-item > span {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  flex: 0 0 14px;
}
.legend-item.income > span { background: var(--primary); }
.legend-item.expense > span { background: #C4B5FD; }
.legend-item small {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 800;
  margin-bottom: 2px;
}
.legend-item strong {
  display: block;
  color: var(--charcoal);
  font-size: 13px;
  font-weight: 900;
}

.budget-total-card {
  background: var(--primary) !important;
  box-shadow: 0 18px 42px rgba(124,58,237,.18) !important;
}
.budget-total-card div {
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.16) !important;
}

.insight-hero {
  background: var(--primary) !important;
  box-shadow: 0 18px 42px rgba(124,58,237,.18) !important;
}

.nav-voice {
  width: 64px !important;
  height: 64px !important;
  border-radius: 50% !important;
  margin: -26px auto 0 !important;
  background: var(--primary) !important;
  color: #fff !important;
  box-shadow: 0 16px 34px rgba(124,58,237,.28) !important;
}
.nav-voice.active { border-radius: 50% !important; }
.nav-voice span { display: none; }
.nav-voice svg { width: 25px !important; height: 25px !important; }

#resetHistoryFilter {
  grid-column: 1 / -1;
  width: 168px;
  justify-self: center;
  margin-top: 2px;
}

@media (max-width: 420px) {
  .cashflow-pie-wrap { grid-template-columns: 1fr; }
  .cashflow-card { padding: 14px; border-radius: 23px; }
  .nav-voice { width: 60px !important; height: 60px !important; margin-top: -24px !important; }
}

@media (max-width: 360px) {
  .bottom-nav { grid-template-columns: 1fr 1fr 64px 1fr 1fr !important; }
  .nav-item:not(.nav-voice) svg { width: 18px; height: 18px; }
  .nav-item:not(.nav-voice) span { font-size: 8.8px; }
}

@media (max-width: 520px) {
  .cashflow-pie-wrap {
    grid-template-columns: 1fr;
  }
  .cashflow-pie {
    width: 168px !important;
    height: 168px !important;
  }
}

/* finepedia v7: login, pie colors, insight typography, app info */
.app-locked { filter: blur(10px); pointer-events: none; user-select: none; }
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  padding: 22px;
  background: #f8f7fc;
}
.login-screen.is-hidden { display: none; }
.login-card {
  width: min(100%, 420px);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 28px;
  box-shadow: 0 24px 70px rgba(39,22,67,.12);
  text-align: center;
}
.login-logo {
  width: 76px;
  height: 76px;
  border-radius: 24px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #fff;
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -.05em;
}
.login-card h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -.05em;
  color: var(--black);
}
.login-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
  margin: 10px 0 22px;
}
.pin-input {
  height: 58px;
  text-align: center;
  letter-spacing: .42em;
  font-size: 24px;
  font-weight: 900;
}
.login-hint {
  display: block;
  color: var(--text-muted);
  margin-top: 14px;
  line-height: 1.5;
}

.cashflow-pie .data { color: var(--primary-dark) !important; }
.legend-item.income > span { background: var(--primary-dark) !important; }
.legend-item.expense > span { background: #ffffff !important; border: 1px solid var(--primary-dark); }

.insight-hero .insight-result {
  color: rgba(255,255,255,.88);
  line-height: 1.65;
  margin: 0;
  font-size: 14px;
  white-space: pre-line;
  word-break: break-word;
}
.insight-hero .insight-result p,
.insight-hero .insight-result ul,
.insight-hero .insight-result ol { margin-bottom: 0; }
.clean-list li { margin-bottom: 8px; }
.setting-list .secondary-btn { border-radius: 18px; }

@media (max-width: 390px) {
  .login-card { padding: 22px; border-radius: 26px; }
  .login-card h1 { font-size: 26px; }
  .login-logo { width: 68px; height: 68px; border-radius: 22px; }
}
.insight-result p {
  margin: 0 0 10px;
}
.insight-result p:last-child {
  margin-bottom: 0;
}
.insight-result ul {
  margin: 10px 0 0;
  padding-left: 20px;
}
.insight-result li {
  margin-bottom: 8px;
}

/* finepedia v8: logo asset integration */
.login-logo-img {
  width: 112px;
  height: 112px;
  object-fit: contain;
  display: block;
  margin: 0 auto 18px;
  border-radius: 28px;
  box-shadow: 0 16px 38px rgba(124,58,237,.16);
  background: #050505;
}
.brand-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 13px;
  background: #050505;
  box-shadow: 0 10px 24px rgba(17,17,17,.08);
}
.profile-logo {
  width: 86px;
  height: 86px;
  object-fit: contain;
  border-radius: 24px;
  background: #050505;
  display: block;
  margin: 0 auto 14px;
  box-shadow: 0 16px 38px rgba(124,58,237,.14);
}
@media (max-width: 380px) {
  .brand-logo { width: 38px; height: 38px; border-radius: 11px; }
  .login-logo-img { width: 96px; height: 96px; }
}


/* =========================================================
   FIXED CASHFLOW DONUT PIE - finepedia v10
   ========================================================= */

.cashflow-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.cashflow-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.cashflow-top span {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 2px;
}

.cashflow-top strong {
  display: block;
  color: var(--charcoal);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.cashflow-top svg {
  width: 38px;
  height: 38px;
  padding: 9px;
  border-radius: 14px;
  color: var(--primary);
  background: var(--primary-soft);
}

.cashflow-pie-wrap {
  display: flex !important;
  flex-direction: column !important;
  gap: 18px;
  align-items: stretch;
  padding-top: 6px;
}

.cashflow-pie-legend {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 150px;
  flex: 1 1 0;
  max-width: 220px;
  padding: 11px 14px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid var(--border);
}

.legend-item > span {
  width: 42px;
  height: 12px;
  border-radius: 4px;
  flex: 0 0 42px;
}

.legend-item.income > span {
  background: #4c1d95 !important;
}

.legend-item.expense > span {
  background: #ffffff !important;
  border: 1.5px solid #4c1d95;
}

.legend-item small {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 800;
  margin-bottom: 2px;
}

.legend-item strong {
  display: block;
  color: var(--charcoal);
  font-size: 13px;
  font-weight: 900;
}

.donut-chart-box {
  position: relative;
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  border-radius: 28px;
  background: #f3f4f6;
  display: grid;
  place-items: center;
  padding: 22px;
}

.donut-chart {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background:
    conic-gradient(
      #4c1d95 0deg,
      #4c1d95 var(--income-deg, 0deg),
      #ffffff var(--income-deg, 0deg),
      #ffffff 360deg
    );
  border: 1px solid #e5e7eb;
  position: relative;
  box-shadow:
    inset 0 0 0 1px rgba(76, 29, 149, 0.14),
    0 16px 34px rgba(39, 22, 67, 0.08);
}

.donut-chart::before {
  content: "";
  position: absolute;
  inset: 29%;
  border-radius: 50%;
  background: #f3f4f6;
  z-index: 1;
}

.donut-hole {
  position: absolute;
  inset: 34%;
  border-radius: 50%;
  background: #f3f4f6;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}

.donut-hole strong {
  display: block;
  font-size: 28px;
  font-weight: 900;
  color: #4c1d95;
  line-height: 1;
}

.donut-hole span {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  font-weight: 800;
  color: #6b7280;
}

.donut-label {
  position: absolute;
  z-index: 3;
  font-size: 18px;
  font-weight: 800;
  color: #6b7280;
  line-height: 1;
  pointer-events: none;
}

.income-label {
  left: 18%;
  top: 50%;
  transform: translateY(-50%);
}

.expense-label {
  right: 18%;
  top: 50%;
  transform: translateY(-50%);
}

/* Logo background putih + lebih besar */
.login-logo-img {
  width: 176px !important;
  height: 176px !important;
  object-fit: contain;
  display: block;
  margin: 0 auto 20px;
  padding: 10px;
  border-radius: 32px;
  border: 1px solid var(--border);
  background: #ffffff !important;
  box-shadow: 0 18px 44px rgba(124, 58, 237, 0.10);
}

.brand-logo {
  width: 62px !important;
  height: 62px !important;
  object-fit: contain;
  padding: 5px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: #ffffff !important;
  box-shadow: 0 12px 28px rgba(124, 58, 237, 0.10);
}

.profile-logo {
  width: 128px !important;
  height: 128px !important;
  object-fit: contain;
  padding: 8px;
  border-radius: 28px;
  border: 1px solid var(--border);
  background: #ffffff !important;
  display: block;
  margin: 0 auto 16px;
  box-shadow: 0 18px 42px rgba(124, 58, 237, 0.10);
}

@media (max-width: 520px) {
  .donut-chart-box {
    max-width: 300px;
    padding: 18px;
  }

  .donut-label {
    font-size: 15px;
  }

  .donut-hole strong {
    font-size: 24px;
  }

  .donut-hole span {
    font-size: 10px;
  }
}

@media (max-width: 390px) {
  .brand-logo {
    width: 52px !important;
    height: 52px !important;
  }

  .login-logo-img {
    width: 146px !important;
    height: 146px !important;
    border-radius: 28px;
  }

  .profile-logo {
    width: 110px !important;
    height: 110px !important;
  }

  .legend-item {
    min-width: 100%;
    max-width: none;
  }

  .donut-chart-box {
    max-width: 260px;
    padding: 15px;
  }

  .income-label {
    left: 15%;
  }

  .expense-label {
    right: 15%;
  }
}


/* finepedia v12: login name + dashboard logout */
.login-name-input {
  height: 54px;
  font-size: 15px;
  font-weight: 700;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logout-dashboard-btn {
  color: var(--primary) !important;
}

@media (max-width: 390px) {
  .topbar-actions {
    gap: 6px;
  }

  .topbar-actions .icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 14px;
  }
}
