:root {
  --bg: #F3F7F4;
  --bg-soft: #E8F1EC;
  --surface: #FFFFFF;
  --surface-alt: #F7FBF9;
  --text: #15231D;
  --muted: #5F746A;
  --border: #D9E7E0;
  --primary: #1B7F5A;
  --primary-dark: #0F5C40;
  --primary-soft: #E3F3EC;
  --income: #1E8A4C;
  --income-soft: #E5F6EC;
  --expense: #E0554B;
  --expense-soft: #FDEBEC;
  --savings: #2B74D8;
  --savings-soft: #EAF2FF;
  --ikub: #C07A12;
  --ikub-soft: #FFF4DE;
  --warn: #E07A2F;
  --shadow: 0 10px 30px rgba(18, 38, 30, 0.06);
  --shadow-lg: 0 20px 50px rgba(18, 38, 30, 0.12);
  --radius: 20px;
  --radius-sm: 14px;
  --nav-height: 78px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --topbar-bg: rgba(243, 247, 244, 0.82);
  --nav-bg: rgba(255,255,255,0.88);
  --overlay: rgba(15, 23, 20, 0.45);
  --input-bg: #FFFFFF;
  --ring: 0 0 0 4px rgba(27,127,90,0.14);
}
[data-theme="dark"] {
  --bg: #0F1512;
  --bg-soft: #18211D;
  --surface: #17201C;
  --surface-alt: #1D2924;
  --text: #EDF4F1;
  --muted: #9FB0A8;
  --border: #2A3B34;
  --primary: #45B889;
  --primary-dark: #8CE0BE;
  --primary-soft: #1C342B;
  --income: #63CC8B;
  --income-soft: #1A3126;
  --expense: #FF8076;
  --expense-soft: #392423;
  --savings: #75AEFF;
  --savings-soft: #1D2C41;
  --ikub: #F2BE63;
  --ikub-soft: #38301E;
  --warn: #FFB066;
  --shadow: 0 10px 30px rgba(0,0,0,0.28);
  --shadow-lg: 0 24px 60px rgba(0,0,0,0.35);
  --topbar-bg: rgba(15, 21, 18, 0.78);
  --nav-bg: rgba(23, 32, 28, 0.88);
  --overlay: rgba(0,0,0,0.58);
  --input-bg: #141C19;
  --ring: 0 0 0 4px rgba(69,184,137,0.18);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', 'Noto Sans Ethiopic', system-ui, -apple-system, sans-serif;
  background: radial-gradient(1200px 500px at 50% -10%, rgba(27,127,90,0.08), transparent 60%), var(--bg);
  color: var(--text);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background .25s ease, color .25s ease;
}
[data-theme="dark"] body { background: radial-gradient(1200px 500px at 50% -10%, rgba(69,184,137,0.08), transparent 60%), var(--bg); }
button, input, select { font: inherit; }
button { color: inherit; background: none; border: none; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
input, select { width: 100%; }

.app-shell { max-width: 920px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 20px); }

.topbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--topbar-bg);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 65%, transparent);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 14px; gap: 12px; }
.topbar-actions { display: flex; gap: 6px; align-items: center; }
.eyebrow { margin: 0; font-size: 0.76rem; color: var(--muted); font-weight: 600; letter-spacing: .01em; }
.brand { margin: 2px 0 0; font-size: 1.7rem; font-weight: 800; letter-spacing: -0.03em; color: var(--primary-dark); line-height: 1.1; }
.icon-btn {
  width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 14px; color: var(--text); position: relative;
  transition: background .2s ease, transform .2s ease, color .2s ease;
}
.icon-btn:hover { background: color-mix(in srgb, var(--primary) 10%, transparent); color: var(--primary); }
.icon-btn:active { transform: scale(0.96); }
.icon-btn:focus-visible, .nav-btn:focus-visible, .nav-add:focus-visible, .btn:focus-visible, .quick-action:focus-visible, .input:focus-visible, .subtab:focus-visible, .link-btn:focus-visible, .contact-item:focus-visible {
  outline: none; box-shadow: var(--ring);
}
.notif-badge {
  position: absolute; top: 3px; right: 3px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px; background: linear-gradient(135deg, #FF6B61, #E0483E); color: #fff; font-size: 0.66rem; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1; border: 2px solid var(--bg);
  box-shadow: 0 4px 10px rgba(224,72,62,0.35);
}
.notif-badge[hidden] { display: none !important; }

.main-content { padding: 16px 16px 0; }
.view { display: none; }
.view.active { display: block; animation: viewIn .35s cubic-bezier(.2,.8,.2,1); }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.greeting-card {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  padding: 18px 20px; margin-bottom: 16px; background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  border-radius: var(--radius); box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}
.greeting-hello { margin: 0; font-size: 1.15rem; font-weight: 750; letter-spacing: -0.02em; }
.greeting-sub { margin: 4px 0 0; font-size: 0.85rem; color: var(--muted); line-height: 1.5; }
.greeting-emoji { font-size: 2rem; flex-shrink: 0; filter: drop-shadow(0 6px 12px rgba(27,127,90,0.2)); }

.balance-card {
  position: relative; overflow: hidden;
  background: linear-gradient(145deg, #1E9267 0%, #167554 45%, #0E553D 100%);
  color: #fff; border-radius: 28px; padding: 24px;
  box-shadow: 0 20px 40px rgba(27, 127, 90, 0.3); margin-bottom: 24px;
}
.balance-card::before, .balance-card::after {
  content: ''; position: absolute; border-radius: 50%; pointer-events: none;
}
.balance-card::before { width: 220px; height: 220px; right: -60px; top: -80px; background: rgba(255,255,255,0.1); }
.balance-card::after { width: 160px; height: 160px; left: -40px; bottom: -60px; background: rgba(255,255,255,0.06); }
[data-theme="dark"] .balance-card {
  background: linear-gradient(145deg, #24624A 0%, #1A4D3A 45%, #133B2D 100%);
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}
.balance-card-top { position: relative; display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.balance-label { margin: 0; font-size: 0.85rem; opacity: .88; font-weight: 500; letter-spacing: .01em; }
.balance-amount { margin: 8px 0 0; font-size: clamp(2rem, 6vw, 2.8rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; text-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.balance-badge { background: rgba(255,255,255,0.16); padding: 8px 14px; border-radius: 999px; font-size: 0.73rem; font-weight: 700; white-space: nowrap; backdrop-filter: blur(4px); border: 1px solid rgba(255,255,255,0.12); }
.balance-stats { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 22px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.16); }
.stat { min-width: 0; }
.stat-label { display: block; font-size: 0.72rem; opacity: .82; margin-bottom: 5px; font-weight: 500; text-transform: uppercase; letter-spacing: .03em; }
.stat-value { display: block; font-size: 1rem; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 26px 0 14px; }
.section-head h2 { margin: 0; font-size: 1.1rem; font-weight: 750; letter-spacing: -0.02em; }
.muted { color: var(--muted); margin: 3px 0 0; font-size: 0.85rem; }
.small { font-size: 0.78rem; }
.link-btn { color: var(--primary); font-weight: 650; font-size: 0.86rem; padding: 6px 8px; border-radius: 10px; transition: background .2s, color .2s; }
.link-btn:hover { background: var(--primary-soft); }

.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.quick-action {
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 16px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 0.79rem; font-weight: 650;
  box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.quick-action:hover { border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.quick-action:active { transform: translateY(-1px) scale(0.99); }
.qa-icon { width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center; transition: transform .2s ease; }
.quick-action:hover .qa-icon { transform: scale(1.05); }
.expense-bg { background: var(--expense-soft); color: var(--expense); }
.income-bg { background: var(--income-soft); color: var(--income); }
.savings-bg { background: var(--savings-soft); color: var(--savings); }
.ikub-bg { background: var(--ikub-soft); color: var(--ikub); }

.card-list { display: flex; flex-direction: column; gap: 12px; }
.card, .tx-card, .reminder-card, .payment-card, .notif-card {
  background: var(--surface); border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  border-radius: var(--radius); box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.tx-card:hover, .contact-item:hover { border-color: color-mix(in srgb, var(--primary) 25%, var(--border)); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.empty-state {
  padding: 32px 20px; text-align: center; color: var(--muted); background: linear-gradient(180deg, var(--surface), var(--surface-alt));
  border: 1px dashed color-mix(in srgb, var(--primary) 25%, var(--border)); border-radius: var(--radius); font-size: 0.9rem;
}
.empty-state strong { display: block; color: var(--text); margin-bottom: 6px; font-size: 1rem; }

.tx-card { width: 100%; display: flex; align-items: center; gap: 14px; padding: 15px; text-align: left; }
.tx-icon { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; font-size: 1.25rem; flex: 0 0 auto; }
.tx-icon.expense { background: var(--expense-soft); }
.tx-icon.income { background: var(--income-soft); }
.tx-icon.saving { background: var(--savings-soft); }
.tx-body { flex: 1; min-width: 0; }
.tx-title { font-weight: 650; font-size: 0.93rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-meta { margin: 4px 0 0; font-size: 0.77rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-amount { font-weight: 750; font-size: 0.94rem; white-space: nowrap; margin-left: 8px; letter-spacing: -0.01em; }
.tx-amount.expense { color: var(--expense); }
.tx-amount.income { color: var(--income); }
.tx-amount.saving { color: var(--savings); }

.reminder-card, .payment-card, .notif-card { padding: 18px; }
.reminder-top, .payment-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.reminder-title, .payment-title { margin: 0; font-size: 0.96rem; font-weight: 700; letter-spacing: -0.01em; }
.reminder-meta, .payment-meta { margin: 5px 0 0; font-size: 0.81rem; color: var(--muted); line-height: 1.55; }
.pill { display: inline-flex; align-items: center; padding: 6px 11px; border-radius: 999px; font-size: 0.71rem; font-weight: 750; white-space: nowrap; flex: 0 0 auto; letter-spacing: .01em; }
.pill.due { background: var(--ikub-soft); color: var(--ikub); }
.pill.overdue { background: var(--expense-soft); color: var(--expense); }
.pill.paid { background: var(--income-soft); color: var(--income); }
.pill.upcoming { background: var(--primary-soft); color: var(--primary-dark); }

.payment-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border-radius: 14px; font-weight: 700; font-size: 0.88rem; border: 1px solid transparent; transition: all .2s ease; position: relative; overflow: hidden; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.99); }
.btn-primary { background: linear-gradient(135deg, #22946A, #167553); color: #fff; box-shadow: 0 8px 20px rgba(27,127,90,0.25); }
.btn-primary:hover { filter: brightness(1.03); box-shadow: 0 12px 24px rgba(27,127,90,0.32); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-alt); border-color: color-mix(in srgb, var(--primary) 20%, var(--border)); }
.btn-sm { padding: 9px 13px; font-size: 0.8rem; border-radius: 11px; }
.btn-block { width: 100%; margin-top: 12px; }
.danger { color: var(--expense); }

.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.input {
  appearance: none; border: 1px solid var(--border); background: var(--input-bg); color: var(--text);
  border-radius: 14px; padding: 13px 15px; font-size: 0.9rem; line-height: 1.2;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.input:focus { outline: none; border-color: color-mix(in srgb, var(--primary) 50%, var(--border)); box-shadow: var(--ring); }
select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2360756B' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px;
}
[data-theme="dark"] select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239FB0A8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}
.summary-strip { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 14px; }
.summary-chip { padding: 8px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; font-size: 0.76rem; color: var(--muted); box-shadow: 0 1px 2px rgba(0,0,0,0.02); }
.summary-chip strong { color: var(--text); font-weight: 750; }

.subtabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; background: color-mix(in srgb, var(--bg-soft) 80%, var(--bg)); border-radius: 16px; margin-bottom: 16px; border: 1px solid var(--border); }
.subtabs-scroll { display: flex; overflow-x: auto; gap: 6px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.subtabs-scroll::-webkit-scrollbar { display: none; }
.subtabs-scroll .subtab { flex: 0 0 auto; white-space: nowrap; }
.subtab { padding: 10px 14px; border-radius: 12px; font-weight: 650; font-size: 0.87rem; color: var(--muted); transition: all .2s ease; }
.subtab:hover { color: var(--text); }
.subtab.active { background: var(--surface); color: var(--primary-dark); box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.subview { display: none; }
.subview.active { display: block; animation: viewIn .3s ease; }
.info-banner { padding: 15px 16px; border-radius: 16px; background: linear-gradient(135deg, var(--primary-soft), color-mix(in srgb, var(--primary-soft) 50%, var(--surface))); color: var(--text); font-size: 0.85rem; line-height: 1.6; margin-bottom: 14px; border: 1px solid color-mix(in srgb, var(--primary) 10%, transparent); }
.info-banner strong { color: var(--primary-dark); }

.report-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
.report-card, .panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.report-label { display: block; font-size: 0.78rem; color: var(--muted); margin-bottom: 6px; font-weight: 550; }
.report-value { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; }
.report-value.income { color: var(--income); }
.report-value.expense { color: var(--expense); }
.report-value.savings { color: var(--savings); }
.panel { margin-bottom: 14px; }
.panel-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 14px; }
.panel-head h3 { margin: 0; font-size: 0.98rem; font-weight: 750; letter-spacing: -0.01em; }

.breakdown { display: flex; flex-direction: column; gap: 14px; }
.breakdown-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px 12px; align-items: center; }
.breakdown-label { font-size: 0.85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.breakdown-val { font-size: 0.82rem; color: var(--muted); font-weight: 650; }
.breakdown-bar { grid-column: 1 / -1; height: 9px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; }
.breakdown-fill { height: 100%; background: linear-gradient(90deg, var(--primary), #4DC896); border-radius: 999px; transition: width .5s ease; }

.progress-track { height: 12px; background: var(--savings-soft); border-radius: 999px; overflow: hidden; margin-bottom: 10px; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--savings), #7DB5FF); border-radius: 999px; transition: width .5s cubic-bezier(.2,.8,.2,1); }
.encouragement-panel { display: flex; gap: 14px; align-items: flex-start; background: linear-gradient(135deg, var(--primary-soft), color-mix(in srgb, var(--surface) 70%, var(--primary-soft))); border-color: color-mix(in srgb, var(--primary) 12%, var(--border)); }
.encouragement-icon { font-size: 2rem; line-height: 1; filter: drop-shadow(0 4px 8px rgba(27,127,90,0.15)); }
.encouragement-panel h3 { margin: 0 0 4px; font-size: 1rem; font-weight: 750; }
.encouragement-panel p { margin: 0; font-size: 0.86rem; line-height: 1.6; color: var(--muted); }

.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: min(920px, 100%); height: calc(var(--nav-height) + var(--safe-bottom)); padding-bottom: var(--safe-bottom);
  background: var(--nav-bg); backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; padding-left: 8px; padding-right: 8px; z-index: 40;
}
.nav-btn { height: var(--nav-height); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; color: var(--muted); font-size: 0.69rem; font-weight: 650; transition: color .2s, transform .2s; position: relative; }
.nav-btn svg { stroke: currentColor; transition: transform .2s; }
.nav-btn.active { color: var(--primary); }
.nav-btn.active svg { transform: translateY(-1px); }
.nav-btn.active::before { content:''; position:absolute; top:8px; width:32px; height:3px; background:var(--primary); border-radius:999px; }
.nav-btn:active { transform: scale(0.96); }
.nav-add {
  width: 60px; height: 60px; margin: 0 auto 20px; border-radius: 20px;
  background: linear-gradient(145deg, #239A6E, #157251); color: #fff; display: grid; place-items: center;
  box-shadow: 0 12px 28px rgba(27, 127, 90, 0.4), inset 0 1px 0 rgba(255,255,255,0.2);
  transition: transform .2s ease, box-shadow .2s ease, filter .2s;
}
.nav-add:hover { transform: translateY(-2px) scale(1.02); filter: brightness(1.03); box-shadow: 0 16px 32px rgba(27,127,90,0.45); }
.nav-add:active { transform: translateY(0) scale(0.98); }

.modal { position: fixed; inset: 0; z-index: 50; display: none; }
.modal.open { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: var(--overlay); backdrop-filter: blur(4px); animation: fadeIn .2s ease; }
.modal-sheet {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: min(720px, 100%);
  max-height: calc(100dvh - 20px); overflow-y: auto; background: var(--surface);
  border-radius: 28px 28px 0 0; padding: 10px 20px calc(24px + var(--safe-bottom));
  box-shadow: 0 -20px 60px rgba(0,0,0,0.15); animation: sheetUp .32s cubic-bezier(.2,.9,.2,1);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetUp { from { transform: translate(-50%, 24px); opacity: .5; } to { transform: translate(-50%, 0); opacity: 1; } }
.modal-handle { width: 44px; height: 5px; border-radius: 99px; background: color-mix(in srgb, var(--muted) 30%, transparent); margin: 8px auto 12px; cursor: pointer; transition: background .2s ease, transform .2s ease; }
.modal-handle:hover { background: color-mix(in srgb, var(--primary) 50%, transparent); transform: scaleX(1.1); }
.modal-handle:active { transform: scaleX(0.9); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.modal-head h2 { margin: 0; font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; }

.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > span { font-size: 0.83rem; font-weight: 650; color: var(--muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field[hidden] { display: none !important; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: var(--bg-soft); border-radius: 14px; border: 1px solid var(--border); }
.segmented input { position: absolute; opacity: 0; width: 0; height: 0; }
.segmented label { position: relative; }
.segmented span { display: block; text-align: center; padding: 11px 8px; border-radius: 11px; font-size: 0.85rem; font-weight: 700; color: var(--muted); cursor: pointer; transition: all .2s; }
.segmented input:checked + span { background: var(--surface); color: var(--primary-dark); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.segmented input:focus-visible + span { outline: none; box-shadow: var(--ring); }
.form-actions { display: flex; gap: 10px; margin-top: 6px; }
.form-actions .btn { flex: 1; }
.form-actions .btn-ghost { flex: 0 0 auto; }
.settings-note { padding: 14px 16px; background: var(--bg-soft); border-radius: 14px; font-size: 0.83rem; color: var(--muted); line-height: 1.6; border: 1px solid color-mix(in srgb, var(--border) 50%, transparent); }
.settings-note strong { color: var(--text); }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-height) + var(--safe-bottom) + 20px); transform: translateX(-50%) translateY(16px) scale(0.96);
  background: #1E2B26; color: #fff; padding: 14px 20px; border-radius: 14px; font-size: 0.86rem; font-weight: 600;
  box-shadow: 0 12px 30px rgba(0,0,0,0.25); opacity: 0; pointer-events: none; transition: .25s cubic-bezier(.2,.8,.2,1); z-index: 60; max-width: calc(100vw - 32px); text-align: center;
  backdrop-filter: blur(8px);
}
[data-theme="dark"] .toast { background: #EDF4F1; color: #18241F; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }

/* About */
.about-hero { text-align: center; padding: 28px 20px; background: linear-gradient(180deg, var(--primary-soft), var(--surface)); }
.about-logo { width: 92px; height: 92px; object-fit: contain; border-radius: 24px; margin-bottom: 14px; background: #fff; padding: 8px; box-shadow: var(--shadow); }
.about-kicker { margin: 0; font-size: 0.69rem; font-weight: 750; letter-spacing: .08em; color: var(--primary); text-transform: uppercase; }
.about-title { margin: 10px 0 4px; font-size: 1.9rem; font-weight: 800; letter-spacing: -0.03em; }
.about-dev { margin: 0 0 12px; font-weight: 600; color: var(--muted); }
.about-desc { max-width: 560px; margin: 0 auto; line-height: 1.75; color: var(--muted); }
.about-actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.contact-list { display: flex; flex-direction: column; gap: 10px; }
.contact-item { display: flex; align-items: center; gap: 14px; padding: 15px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface-alt); text-decoration: none; color: inherit; transition: all .2s ease; }
.contact-item:hover { border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); transform: translateY(-1px); }
.contact-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--primary-soft); font-size: 1.25rem; flex: 0 0 auto; }
.contact-item strong { display: block; font-size: 0.9rem; margin-bottom: 2px; }
.contact-item span { font-size: 0.83rem; color: var(--muted); word-break: break-word; }

/* Shopping / purchases / debts */
.check-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; }
.check-box { width: 26px; height: 26px; border-radius: 9px; border: 2px solid var(--border); display: grid; place-items: center; flex: 0 0 auto; background: var(--surface); color: transparent; transition: all .2s; }
.check-box.checked { background: var(--primary); border-color: var(--primary); color: #fff; }
.item-bought .tx-title, .item-bought .payment-title { text-decoration: line-through; color: var(--muted); }
.item-bought { opacity: 0.72; }
.mini-progress { height: 9px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; margin-top: 12px; }
.mini-progress > div { height: 100%; background: linear-gradient(90deg, var(--primary), #4DC896); border-radius: 999px; transition: width .4s ease; }
.tag { display: inline-flex; padding: 4px 9px; border-radius: 999px; font-size: 0.69rem; font-weight: 750; background: var(--bg-soft); color: var(--muted); }
.tag.high { background: var(--expense-soft); color: var(--expense); }
.tag.medium { background: var(--ikub-soft); color: var(--ikub); }
.tag.low { background: var(--income-soft); color: var(--income); }

/* Splash */
.hidden { display: none !important; }
.splash-screen { position: fixed; inset: 0; z-index: 100; background: linear-gradient(160deg, #0B4A34, #167553 45%, #1B8A62 100%); display: flex; align-items: center; justify-content: center; padding: 24px; overflow: hidden; }
.splash-screen::before, .splash-screen::after { content:''; position:absolute; border-radius:50%; background:rgba(255,255,255,0.06); }
.splash-screen::before { width:300px; height:300px; top:-80px; right:-80px; }
.splash-screen::after { width:240px; height:240px; bottom:-60px; left:-60px; }
.splash-card { position: relative; width: min(520px, 100%); background: rgba(255,255,255,0.97); color: #18241F; border-radius: 32px; padding: 32px 28px; text-align: center; box-shadow: 0 30px 80px rgba(0,0,0,0.25); animation: splashIn .6s cubic-bezier(.2,.8,.2,1); }
@keyframes splashIn { from { opacity: 0; transform: translateY(20px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
[data-theme="dark"] .splash-card { background: #17201C; color: #EDF4F1; }
.splash-logo { width: 88px; height: 88px; object-fit: contain; border-radius: 22px; background: #fff; padding: 8px; margin-bottom: 14px; box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
.splash-title { margin: 10px 0 8px; font-size: 2.2rem; font-weight: 800; letter-spacing: -0.03em; color: #0F5C40; }
[data-theme="dark"] .splash-title { color: #7AD0AB; }
.splash-sub { margin: 0 0 20px; color: #60756B; line-height: 1.65; font-size: 0.95rem; }
[data-theme="dark"] .splash-sub { color: #9FB0A8; }
.splash-dev { background: linear-gradient(135deg, #EAF5F0, #F3FAF7); border-radius: 18px; padding: 16px; margin-bottom: 20px; display: flex; flex-direction: column; gap: 4px; border: 1px solid rgba(27,127,90,0.08); }
[data-theme="dark"] .splash-dev { background: #1D2924; border-color: #2A3B34; }
.splash-dev strong { font-size: .96rem; }
.splash-dev span { font-size: .85rem; color: #60756B; }
[data-theme="dark"] .splash-dev span { color: #9FB0A8; }

/* Activation purchase polish */
.activation-value { display: grid; gap: 10px; margin-bottom: 4px; }
.activation-value-item { display: flex; gap: 10px; align-items: flex-start; font-size: .85rem; color: var(--muted); line-height: 1.5; }
.activation-value-item .av-icon { width: 28px; height: 28px; border-radius: 9px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex: 0 0 auto; font-size: .85rem; font-weight: 700; }
.activation-value-item strong { color: var(--text); }

/* Micro animations */
.card-list > * { animation: cardIn .35s cubic-bezier(.2,.8,.2,1) both; }
.card-list > *:nth-child(2) { animation-delay: .03s; }
.card-list > *:nth-child(3) { animation-delay: .06s; }
.card-list > *:nth-child(4) { animation-delay: .09s; }
.card-list > *:nth-child(5) { animation-delay: .12s; }
@keyframes cardIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.quick-action { animation: cardIn .4s cubic-bezier(.2,.8,.2,1) both; }
.quick-action:nth-child(2) { animation-delay: .04s; }
.quick-action:nth-child(3) { animation-delay: .08s; }
.quick-action:nth-child(4) { animation-delay: .12s; }

@media (min-width: 700px) {
  .main-content { padding: 24px 24px 0; }
  .topbar-inner { padding: 20px 24px 16px; }
  .modal-sheet { border-radius: 28px; bottom: 20px; max-height: calc(100dvh - 40px); }
  .quick-actions { gap: 14px; }
  /* On wide screens the bottom nav sits after the content instead of covering
     the sample actions in the first viewport. */
  .app-shell { padding-bottom: 0; }
  .bottom-nav { position: static; transform: none; margin: 24px auto 0; border-radius: 18px 18px 0 0; }
}
@media (max-width: 380px) {
  .balance-stats { gap: 8px; }
  .stat-value { font-size: 0.88rem; }
  .quick-action { padding: 14px 4px; font-size: 0.73rem; }
  .qa-icon { width: 40px; height: 40px; border-radius: 13px; }
  .field-row { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr; }
  .balance-amount { font-size: 1.9rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
/* === Reports v2 === */
.report-grid-6 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .report-grid-6 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .report-grid-6 { grid-template-columns: 1fr; } }

.report-card { position: relative; overflow: hidden; transition: transform .2s ease, box-shadow .2s ease; }
.report-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(27,127,90,0.12); }
.report-card.accent-income::before { content:''; position:absolute; top:0; left:0; right:0; height:3px; background:linear-gradient(90deg,var(--income),#5FD9A8); }
.report-card.accent-expense::before { content:''; position:absolute; top:0; left:0; right:0; height:3px; background:linear-gradient(90deg,var(--expense),#FF8A80); }
.report-card.accent-savings::before { content:''; position:absolute; top:0; left:0; right:0; height:3px; background:linear-gradient(90deg,var(--savings),#7DB5FF); }
.report-card.accent-net::before { content:''; position:absolute; top:0; left:0; right:0; height:3px; background:linear-gradient(90deg,var(--primary),#4DC896); }
.report-delta { display:block; font-size:0.72rem; font-weight:650; margin-top:4px; }
.report-delta.up { color: var(--income); }
.report-delta.down { color: var(--expense); }
.report-delta.flat { color: var(--muted); }

.report-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
@media (max-width: 720px) { .report-two-col { grid-template-columns: 1fr; } }

.trend-chart { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding: 8px 0 4px; border-bottom: 1px solid var(--border); }
.trend-bar-group { flex: 1; display: flex; gap: 2px; align-items: flex-end; height: 100%; position: relative; }
.trend-bar { flex: 1; border-radius: 4px 4px 0 0; min-height: 2px; transition: height .6s cubic-bezier(.2,.8,.2,1); cursor: pointer; position: relative; }
.trend-bar.income { background: linear-gradient(180deg, var(--income), rgba(46,158,107,0.35)); }
.trend-bar.expense { background: linear-gradient(180deg, var(--expense), rgba(217,92,92,0.35)); }
.trend-bar.savings { background: linear-gradient(180deg, var(--savings), rgba(74,144,226,0.35)); }
.trend-bar .tip { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: var(--surface); border: 1px solid var(--border); padding: 4px 8px; border-radius: 7px; font-size: 0.7rem; white-space: nowrap; opacity: 0; pointer-events: none; transition: .2s; margin-bottom: 4px; box-shadow: var(--shadow); z-index: 5; }
.trend-bar:hover .tip { opacity: 1; }
.trend-labels { display: flex; gap: 6px; margin-top: 6px; }
.trend-labels span { flex: 1; text-align: center; font-size: 0.62rem; color: var(--muted); font-weight: 550; }
.trend-legend { display: flex; gap: 14px; margin-top: 10px; font-size: 0.78rem; color: var(--muted); }
.trend-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: middle; }
.trend-legend .dot.income { background: var(--income); }
.trend-legend .dot.expense { background: var(--expense); }
.trend-legend .dot.savings { background: var(--savings); }

.tx-mini-list { display: flex; flex-direction: column; gap: 8px; }
.tx-mini-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--bg-soft); border-radius: 10px; border: 1px solid var(--border); transition: .2s; }
.tx-mini-item:hover { background: var(--primary-soft); }
.tx-mini-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-size: 1rem; background: var(--surface); flex-shrink: 0; }
.tx-mini-body { flex: 1; min-width: 0; }
.tx-mini-title { font-size: 0.85rem; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-mini-sub { font-size: 0.72rem; color: var(--muted); }
.tx-mini-amount { font-weight: 750; font-size: 0.88rem; white-space: nowrap; }
.tx-mini-amount.income { color: var(--income); }
.tx-mini-amount.expense { color: var(--expense); }
.tx-mini-amount.saving { color: var(--savings); }

.goal-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
.goal-stats > div { background: var(--bg-soft); padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); }
.goal-stats span { display: block; font-size: 0.7rem; color: var(--muted); margin-bottom: 2px; }
.goal-stats strong { font-size: 0.95rem; font-weight: 750; }

.health-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (max-width: 560px) { .health-grid { grid-template-columns: 1fr; } }
.health-item { background: var(--bg-soft); padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); }
.health-label { font-size: 0.72rem; color: var(--muted); font-weight: 600; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.05em; }
.health-bar { height: 8px; background: var(--border); border-radius: 999px; overflow: hidden; margin-bottom: 6px; }
.health-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), #4DC896); border-radius: 999px; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.health-fill.expense { background: linear-gradient(90deg, var(--expense), #FF8A80); }
.health-val { font-size: 0.95rem; font-weight: 750; }
.health-val.big { font-size: 1.4rem; }

.empty-state { padding: 24px 12px; text-align: center; color: var(--muted); }
