/* Dompetku – tampilan portal mandiri */

:root {
	--accent: #0f766e;
	--bg: #f3f5f4;
	--card: #ffffff;
	--card-2: #f8faf9;
	--text: #14201d;
	--muted: #66736f;
	--line: #e3e8e6;
	--line-2: #eef1f0;
	--inc: #15803d;
	--exp: #dc2626;
	--warn: #d97706;
	--info: #2563eb;
	--side: #0d1b18;
	--side-text: #c9d5d2;
	--side-muted: #7f918c;
	--radius: 14px;
	--radius-sm: 10px;
	--shadow: 0 1px 2px rgba(16, 24, 22, .04), 0 4px 16px rgba(16, 24, 22, .05);
	--shadow-lg: 0 20px 60px rgba(10, 20, 18, .25);
	--accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
	color-scheme: light;
}

html[data-theme="dark"] {
	--bg: #0b1311;
	--card: #121d1a;
	--card-2: #17241f;
	--text: #e6eeeb;
	--muted: #8fa19c;
	--line: #22322d;
	--line-2: #1a2824;
	--inc: #34d399;
	--exp: #f87171;
	--warn: #fbbf24;
	--info: #60a5fa;
	--side: #08100e;
	--shadow: 0 1px 2px rgba(0, 0, 0, .3);
	--accent-soft: color-mix(in srgb, var(--accent) 22%, transparent);
	color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
	html:not([data-theme="light"]):not([data-theme="dark"]) {
		--bg: #0b1311;
		--card: #121d1a;
		--card-2: #17241f;
		--text: #e6eeeb;
		--muted: #8fa19c;
		--line: #22322d;
		--line-2: #1a2824;
		--inc: #34d399;
		--exp: #f87171;
		--warn: #fbbf24;
		--info: #60a5fa;
		--side: #08100e;
		--shadow: 0 1px 2px rgba(0, 0, 0, .3);
		--accent-soft: color-mix(in srgb, var(--accent) 22%, transparent);
		color-scheme: dark;
	}
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body.dpk {
	font-family: ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
	font-size: 15px;
	line-height: 1.5;
	color: var(--text);
	background: var(--bg);
	-webkit-font-smoothing: antialiased;
	font-variant-numeric: tabular-nums;
}

.dpk a { color: var(--accent); text-decoration: none; }
.dpk a:hover { text-decoration: underline; }
.dpk h1, .dpk h2, .dpk h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
.dpk h3 { font-size: 15px; font-weight: 650; }
.dpk p { margin: 0 0 .6em; }
.dpk code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: var(--line-2); padding: 1px 5px; border-radius: 5px; }
.dpk small { font-size: 12.5px; }

.ic { flex: none; vertical-align: middle; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.block { display: block; }
.center { text-align: center; }
.pad { padding: 24px 8px; }
.grow { flex: 1; min-width: 0; }
.nowrap { white-space: nowrap; }
.pos { color: var(--inc) !important; }
.neg { color: var(--exp) !important; }
.neutral { color: var(--muted); }
.accent { color: var(--accent); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.hp { position: absolute; left: -9999px; }
[hidden] { display: none !important; }

/* ---------- Layout ---------- */

.app { display: flex; min-height: 100vh; }

.sidebar {
	position: sticky;
	top: 0;
	width: 248px;
	height: 100vh;
	flex: none;
	display: flex;
	flex-direction: column;
	background: var(--side);
	color: var(--side-text);
	padding: 18px 14px;
	overflow-y: auto;
	z-index: 40;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 750; font-size: 17px; color: #fff !important; text-decoration: none !important; letter-spacing: -.01em; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--accent); color: #fff; }
.brand.big { font-size: 20px; }
.brand.big .brand-mark { width: 40px; height: 40px; border-radius: 12px; }

.nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.nav-group { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--side-muted); padding: 14px 10px 6px; font-weight: 600; }
.nav-link {
	display: flex; align-items: center; gap: 11px;
	padding: 9px 10px; border-radius: 9px;
	color: var(--side-text) !important; text-decoration: none !important;
	font-weight: 500; font-size: 14.5px;
	transition: background .15s, color .15s;
}
.nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff !important; }
.nav-link.active { background: color-mix(in srgb, var(--accent) 30%, transparent); color: #fff !important; }
.nav-link.active .ic { color: color-mix(in srgb, var(--accent) 40%, #fff); }

.sidebar-foot { border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 12px; margin-top: 12px; }
.me { display: flex; align-items: center; gap: 10px; padding: 6px 8px 10px; min-width: 0; }
.me div { min-width: 0; }
.me strong { display: block; color: #fff; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me small { display: block; color: var(--side-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%; background: color-mix(in srgb, var(--accent) 70%, #fff); color: #fff; font-weight: 700; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
	position: sticky; top: 0; z-index: 30;
	display: flex; align-items: center; gap: 12px;
	padding: 14px 28px;
	background: color-mix(in srgb, var(--bg) 88%, transparent);
	backdrop-filter: saturate(1.4) blur(10px);
	-webkit-backdrop-filter: saturate(1.4) blur(10px);
	border-bottom: 1px solid var(--line);
}
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 20px; font-weight: 700; }
.topbar-title small { color: var(--muted); }
.topbar-actions { display: flex; gap: 8px; }

.content { padding: 24px 28px 48px; max-width: 1320px; width: 100%; display: flex; flex-direction: column; gap: 18px; }

.backdrop { display: none; }
.only-mobile { display: none !important; }

/* ---------- Tombol ---------- */

.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 7px;
	height: 38px; padding: 0 14px;
	border-radius: 10px; border: 1px solid transparent;
	font: inherit; font-size: 14px; font-weight: 600;
	cursor: pointer; white-space: nowrap;
	text-decoration: none !important;
	transition: background .15s, border-color .15s, transform .05s, opacity .15s;
	background: var(--card); color: var(--text);
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .nav-link:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: var(--accent); color: #fff !important; }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: var(--card-2); }
.btn.soft { background: var(--accent-soft); color: var(--accent) !important; }
.btn.soft:hover { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.btn.icon { width: 34px; height: 34px; padding: 0; border-color: transparent; }
.btn.icon.ghost:hover { background: var(--line-2); }
.btn.small { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.block { width: 100%; height: 44px; font-size: 15px; }
.btn.danger { color: var(--exp) !important; }
.btn.danger:hover { background: color-mix(in srgb, var(--exp) 10%, transparent) !important; }
.btn.danger-solid { background: var(--exp); color: #fff; }
.btn.loading { opacity: .6; pointer-events: none; }
.link { font-size: 13px; font-weight: 600; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; font-weight: 600; color: var(--accent); cursor: pointer; }
.strong-link { font-weight: 650; color: var(--text) !important; }
form.inline { display: inline-flex; margin: 0; }

/* ---------- Kartu & grid ---------- */

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head.pad-x { padding: 16px 20px 0; }
.card.flush .card-head { margin-bottom: 8px; }

.grid-main { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: 1 / -1; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.grid-2.wide-gap { gap: 18px; align-items: start; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row-gap { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 10px; }
.stack { display: flex; flex-direction: column; gap: 14px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; margin: 0 0 2px !important; }
.big-number { font-size: 28px; font-weight: 750; letter-spacing: -.02em; }
.big-number small { font-size: 15px; font-weight: 500; }

/* ---------- Hero dashboard ---------- */

.hero {
	display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
	padding: 24px 26px;
	border-radius: 18px;
	color: #fff;
	background:
		radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--accent) 55%, #fff) 0%, transparent 45%),
		linear-gradient(135deg, color-mix(in srgb, var(--accent) 92%, #000) 0%, color-mix(in srgb, var(--accent) 60%, #021) 100%);
	box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 30%, transparent);
}
.hero .eyebrow { color: rgba(255, 255, 255, .8); text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 500; }
.hero-figure { font-size: 36px; font-weight: 800; letter-spacing: -.025em; margin: 2px 0 4px !important; }
.hero .muted { color: rgba(255, 255, 255, .78); font-size: 13.5px; margin: 0; }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hero .btn.soft { background: rgba(255, 255, 255, .16); color: #fff !important; }
.hero .btn.soft:hover { background: rgba(255, 255, 255, .26); }

.onboarding h3 { margin-bottom: 12px; }
.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.steps li { counter-increment: s; }
.steps a { display: block; height: 100%; padding: 14px 14px 14px 52px; border: 1px dashed var(--line); border-radius: 12px; position: relative; color: var(--text) !important; text-decoration: none !important; }
.steps a:hover { border-color: var(--accent); background: var(--accent-soft); }
.steps a::before { content: counter(s); position: absolute; left: 14px; top: 14px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.steps strong { display: block; }
.steps span { color: var(--muted); font-size: 13px; }

/* ---------- Stat ---------- */

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stats.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat { display: flex; flex-direction: column; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; }
.stat-label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
.stat-value { font-size: 22px; font-weight: 750; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-sub { font-size: 12.5px; color: var(--muted); }
.stats.compact .stat { padding: 12px 16px; }
.stats.compact .stat-value { font-size: 18px; }
.link-card { color: var(--text) !important; text-decoration: none !important; transition: border-color .15s; }
.link-card.selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.delta { font-size: 12.5px; font-weight: 600; }
.delta.good { color: var(--inc); }
.delta.bad { color: var(--exp); }

/* ---------- Grafik ---------- */

.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.chart .axis { fill: var(--muted); font-size: 11.5px; font-family: inherit; }
.chart rect { transition: opacity .15s; }
.chart rect:hover { opacity: .78; }

.donut-wrap { display: flex; align-items: center; gap: 18px; }
.donut { width: 150px; height: 150px; flex: none; transform: rotate(0deg); }
.donut circle { transition: stroke-width .15s; }
.donut circle:hover { stroke-width: 6; }
.donut-small { fill: var(--muted); font-size: 3.2px; font-family: inherit; }
.donut-big { fill: var(--text); font-size: 5.4px; font-weight: 750; font-family: inherit; }
.legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.legend li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.legend-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend-val { color: var(--muted); font-weight: 600; }
.legend-inline { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); }
.legend-inline span { display: inline-flex; align-items: center; gap: 6px; }
.legend-inline i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.dot, .cat-dot, .acc-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; margin-right: 8px; vertical-align: middle; }
.legend .dot { margin-right: 0; }

/* ---------- Progres ---------- */

.progress { height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; margin: 6px 0; }
.progress span { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width .5s ease; }
.progress.ok span { background: var(--inc); }
.progress.warn span { background: var(--warn); }
.progress.over span { background: var(--exp); }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--line-2); color: var(--muted); }
.pill.good { background: color-mix(in srgb, var(--inc) 14%, transparent); color: var(--inc); }
.pill.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.pill.bad { background: color-mix(in srgb, var(--exp) 14%, transparent); color: var(--exp); }
.pill.info { background: color-mix(in srgb, var(--info) 14%, transparent); color: var(--info); }
.badge { display: inline-block; background: var(--accent); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 99px; margin-left: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 8px; border-radius: 99px; font-size: 12.5px; font-weight: 600; background: color-mix(in srgb, var(--c) 13%, transparent); color: color-mix(in srgb, var(--c) 80%, var(--text)); }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.note { display: block; color: var(--muted); font-size: 13px; margin-top: 3px; }

/* ---------- Daftar transaksi ---------- */

.tx-list { display: flex; flex-direction: column; }
.tx-btn { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; border-radius: 10px; }
.tx-btn:hover { background: var(--card-2); }
.tx { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-bottom: 1px solid var(--line-2); }
.tx-list > :last-child .tx, .tx-list > .tx:last-child { border-bottom: 0; }
.tx-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); }
.tx-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tx-main strong { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-main small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.amount { font-weight: 700; white-space: nowrap; }

.insights { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.insights li { display: flex; gap: 12px; align-items: flex-start; }
.insights strong { display: block; font-size: 16px; }
.insights small { color: var(--muted); }
.ins-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.ins-warn .ins-icon { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }

.budget-mini, .goal-mini, .acc-mini { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.budget-mini li span { font-size: 14px; }
.acc-mini li { display: flex; align-items: center; gap: 4px; font-size: 14px; }

/* ---------- Tabel ---------- */

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--card-2); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:hover { background: var(--card-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot th { background: var(--card-2); color: var(--text); font-size: 14px; text-transform: none; letter-spacing: 0; border-top: 1px solid var(--line); }
.table .r { text-align: right; }
.table .actions { white-space: nowrap; width: 1%; }
.table .actions > * { vertical-align: middle; }
.is-muted { opacity: .55; }
.w-progress { min-width: 180px; }
.w-share { min-width: 140px; }
.share { display: inline-block; width: 70px; height: 6px; border-radius: 99px; background: var(--line-2); overflow: hidden; margin-right: 8px; vertical-align: middle; }
.share span { display: block; height: 100%; }

.pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 14px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }

/* ---------- Toolbar bulan ---------- */

.month-nav { display: flex; align-items: center; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.month-form { margin: 0; }
.month-label { position: relative; display: block; padding: 0 12px; font-weight: 650; min-width: 140px; text-align: center; cursor: pointer; }
.month-label input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.year-select { border: 0; background: transparent; font: inherit; font-weight: 650; color: var(--text); padding: 6px 8px; cursor: pointer; }
.period-pill { display: inline-flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 99px; padding: 7px 14px; font-weight: 600; }
.period-pill a { font-size: 18px; line-height: 1; color: var(--muted); }

.filters summary { cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 8px; list-style: none; }
.filters summary::-webkit-details-marker { display: none; }
.filters[open] summary { margin-bottom: 14px; }
.filter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.filter-actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }

.tabs { display: inline-flex; background: var(--line-2); border-radius: 10px; padding: 3px; }
.tabs a { padding: 7px 16px; border-radius: 8px; font-weight: 600; color: var(--muted) !important; text-decoration: none !important; }
.tabs a.active { background: var(--card); color: var(--text) !important; box-shadow: var(--shadow); }

/* ---------- Form ---------- */

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.dpk input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
.dpk select {
	width: 100%; height: 42px; padding: 0 12px;
	border: 1px solid var(--line); border-radius: 10px;
	background: var(--card); color: var(--text);
	font: inherit; font-size: 15px;
	transition: border-color .15s, box-shadow .15s;
}
.dpk input[type="file"] { height: auto; padding: 10px; }
.dpk input:focus, .dpk select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.dpk input:disabled { background: var(--line-2); color: var(--muted); }
.input-prefix { position: relative; display: flex; align-items: center; }
.input-prefix em { position: absolute; left: 12px; font-style: normal; color: var(--muted); font-weight: 600; font-size: 14px; pointer-events: none; }
.input-prefix input { padding-left: 42px !important; }
.amount-field input { height: 54px !important; font-size: 24px !important; font-weight: 750; letter-spacing: -.01em; }
.amount-field .input-prefix em { font-size: 16px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }
.calc-total { margin: 0; font-size: 14px; color: var(--muted); }
.calc-total strong { color: var(--text); }
.pw-wrap { position: relative; }
.pw-toggle { position: absolute; right: 6px; top: 6px; height: 30px; width: 34px; border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: 8px; }

.segmented { display: flex; background: var(--line-2); border-radius: 12px; padding: 4px; gap: 4px; }
.segmented label { flex: 1; position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; text-align: center; padding: 8px 6px; border-radius: 9px; font-weight: 600; font-size: 13.5px; color: var(--muted); transition: background .15s, color .15s; }
.segmented input:checked + span { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.segmented .seg-expense input:checked + span { color: var(--exp); }
.segmented .seg-income input:checked + span { color: var(--inc); }
.segmented .seg-transfer input:checked + span { color: var(--info); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { position: relative; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; }
.swatch span { display: block; width: 28px; height: 28px; border-radius: 50%; background: var(--c); border: 3px solid var(--card); box-shadow: 0 0 0 1px var(--line); transition: transform .1s; }
.swatch input:checked + span { box-shadow: 0 0 0 2px var(--c); transform: scale(1.08); }

/* ---------- Dialog ---------- */

.dialog {
	width: min(560px, calc(100vw - 24px));
	max-height: calc(100vh - 40px);
	padding: 0; border: 0; border-radius: 18px;
	background: var(--card); color: var(--text);
	box-shadow: var(--shadow-lg);
}
.dialog.small { width: min(420px, calc(100vw - 24px)); }
.dialog::backdrop { background: rgba(6, 14, 12, .55); backdrop-filter: blur(2px); }
.dialog[open] { animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.dialog-body { display: flex; flex-direction: column; gap: 14px; padding: 20px 22px; margin: 0; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dialog-head h2 { font-size: 18px; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding-top: 6px; }

/* ---------- Flash ---------- */

.flash { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-radius: 12px; font-size: 14px; font-weight: 500; border: 1px solid; transition: opacity .4s; }
.flash.success { background: color-mix(in srgb, var(--inc) 10%, var(--card)); border-color: color-mix(in srgb, var(--inc) 30%, transparent); color: color-mix(in srgb, var(--inc) 75%, var(--text)); }
.flash.error { background: color-mix(in srgb, var(--exp) 10%, var(--card)); border-color: color-mix(in srgb, var(--exp) 30%, transparent); color: color-mix(in srgb, var(--exp) 75%, var(--text)); }
.flash.info { background: color-mix(in srgb, var(--info) 10%, var(--card)); border-color: color-mix(in srgb, var(--info) 30%, transparent); color: color-mix(in srgb, var(--info) 75%, var(--text)); }
.flash.fade { opacity: 0; }
.flash-x { background: none; border: 0; font-size: 20px; line-height: 1; cursor: pointer; color: inherit; opacity: .6; }

/* ---------- Kosong ---------- */

.empty { text-align: center; padding: 36px 16px; max-width: 460px; margin: 0 auto; }
.empty-icon { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.empty h3 { font-size: 17px; margin-bottom: 6px; }
.empty p { color: var(--muted); margin-bottom: 16px; }

/* ---------- Akun ---------- */

.type-strip { display: flex; gap: 10px; flex-wrap: wrap; }
.type-strip span { display: flex; flex-direction: column; padding: 8px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.type-strip small { color: var(--muted); }
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.acc-card {
	position: relative; display: flex; flex-direction: column; gap: 4px;
	padding: 16px 18px; border-radius: var(--radius); background: var(--card);
	border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden;
}
.acc-card::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 4px; background: var(--c); }
.acc-card.is-archived { opacity: .65; }
.acc-top { display: flex; align-items: center; justify-content: space-between; }
.acc-type { font-size: 12px; font-weight: 600; color: color-mix(in srgb, var(--c) 80%, var(--text)); background: color-mix(in srgb, var(--c) 12%, transparent); padding: 2px 9px; border-radius: 99px; }
.acc-actions { display: flex; }
.acc-card h3 { font-size: 16px; margin-top: 6px; }
.acc-balance { font-size: 24px; font-weight: 750; letter-spacing: -.02em; }
.acc-foot { display: flex; justify-content: space-between; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line-2); font-size: 13px; font-weight: 600; }
.acc-card.add { align-items: center; justify-content: center; min-height: 160px; border: 2px dashed var(--line); box-shadow: none; background: transparent; color: var(--muted); cursor: pointer; font: inherit; font-weight: 600; gap: 8px; }
.acc-card.add::before { display: none; }
.acc-card.add:hover { border-color: var(--accent); color: var(--accent); }
.archived-block summary { cursor: pointer; font-weight: 600; color: var(--muted); margin-bottom: 12px; }
.tip { margin: 0; }

/* ---------- Kategori ---------- */

.cat-list { list-style: none; margin: 0; padding: 4px 8px 8px; }
.cat-list li { display: flex; align-items: center; gap: 6px; padding: 9px 12px; border-radius: 10px; }
.cat-list li:hover { background: var(--card-2); }

/* ---------- Anggaran ---------- */

.budget-summary .progress { height: 10px; margin-top: 14px; }
.bs-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.bs-grid small { display: block; color: var(--muted); }
.bs-grid strong { font-size: 18px; font-weight: 750; }
.budget-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.budget-card { display: flex; flex-direction: column; gap: 6px; }
.budget-card h3 { display: flex; align-items: center; }
.budget-figs strong { font-size: 20px; font-weight: 750; margin-right: 6px; }
.row-actions { display: inline-flex; align-items: center; }

/* ---------- Investasi ---------- */

.inv-head { display: flex; flex-direction: column; gap: 16px; border-top: 4px solid var(--c); }
.inv-head h2 { font-size: 22px; margin-top: 8px; }
.inv-head .bs-grid { row-gap: 18px; }
.danger-row { display: flex; justify-content: flex-end; }

/* ---------- Target ---------- */

.goal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.goal-card { display: flex; flex-direction: column; gap: 12px; border-top: 4px solid var(--c); }
.goal-card.is-done { background: color-mix(in srgb, var(--inc) 5%, var(--card)); }
.ring-row { display: flex; align-items: center; gap: 16px; }
.ring {
	--p: 0; width: 84px; height: 84px; flex: none; border-radius: 50%;
	background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--line-2) 0);
	display: grid; place-items: center;
}
.ring span { width: 66px; height: 66px; border-radius: 50%; background: var(--card); display: grid; place-items: center; font-weight: 750; font-size: 16px; }
.goal-saved { font-size: 20px; font-weight: 750; }
.goal-actions { display: flex; align-items: center; gap: 6px; margin-top: auto; }
.logs summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); }
.logs ul { list-style: none; margin: 8px 0 0; padding: 0; font-size: 13px; }
.logs li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line-2); }
.logs li > span:first-child { flex: 1; color: var(--muted); }
.logs .btn.icon { width: 26px; height: 26px; }

/* ---------- Laporan & pengaturan ---------- */

.nw-list { list-style: none; margin: 0; padding: 0; }
.nw-list li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.nw-list li.total { border-bottom: 0; border-top: 2px solid var(--line); font-size: 16px; padding-top: 12px; }
.print-title { display: none; }
.code { background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; overflow-x: auto; margin: 0; }
.hint-list { margin: 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.danger-zone { border-color: color-mix(in srgb, var(--exp) 35%, var(--line)); }
.danger-zone h3 { color: var(--exp); }

/* ---------- Halaman masuk ---------- */

.auth-body { background: var(--bg); }
.auth { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }
.auth-brand {
	position: relative; overflow: hidden;
	display: flex; flex-direction: column; justify-content: center; gap: 22px;
	padding: 56px clamp(28px, 6vw, 80px);
	color: #fff;
	background:
		radial-gradient(90% 70% at 90% 10%, color-mix(in srgb, var(--accent) 50%, #fff) 0%, transparent 50%),
		linear-gradient(160deg, color-mix(in srgb, var(--accent) 90%, #000) 0%, #06110f 100%);
}
.auth-brand h1 { font-size: clamp(26px, 3.2vw, 38px); font-weight: 800; letter-spacing: -.025em; max-width: 520px; }
.auth-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; color: rgba(255, 255, 255, .86); }
.auth-points li { display: flex; align-items: center; gap: 10px; }
.auth-points .ic { color: color-mix(in srgb, var(--accent) 35%, #fff); }
.auth-card-preview { margin-top: 10px; width: min(320px, 100%); padding: 18px 20px; border-radius: 18px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); backdrop-filter: blur(6px); }
.auth-card-preview small { color: rgba(255, 255, 255, .7); }
.auth-card-preview strong { display: block; font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.mini-bars { display: flex; align-items: flex-end; gap: 8px; height: 56px; margin-top: 12px; }
.mini-bars i { flex: 1; border-radius: 5px 5px 2px 2px; background: rgba(255, 255, 255, .55); }
.mini-bars i:last-child { background: #fff; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-box { width: min(420px, 100%); display: flex; flex-direction: column; gap: 12px; }
.auth-box h2 { font-size: 26px; font-weight: 750; }
.auth-box .stack { margin-top: 8px; }
.auth-switch { text-align: center; color: var(--muted); margin-top: 8px !important; }

/* ---------- Tab bar mobile ---------- */

.tabbar {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
	display: none; align-items: center; justify-content: space-around;
	background: var(--card); border-top: 1px solid var(--line);
	padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--muted) !important; text-decoration: none !important; padding: 4px 8px; }
.tabbar a.active { color: var(--accent) !important; }
.fab { width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; margin-top: -26px; box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 45%, transparent); cursor: pointer; }

/* ---------- Responsif ---------- */

@media (max-width: 1180px) {
	.grid-main { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.span-2, .span-3 { grid-column: 1 / -1; }
	.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
	.only-mobile { display: inline-flex !important; }
	.tabbar.only-mobile { display: flex !important; }
	.sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
	body.nav-open .sidebar { transform: none; }
	body.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 39; }
	.topbar { padding: 12px 16px; }
	.content { padding: 16px 16px 96px; gap: 14px; }
	.steps { grid-template-columns: 1fr; }
	.bs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.auth { grid-template-columns: 1fr; }
	.auth-brand { padding: 32px 24px; gap: 14px; }
	.auth-card-preview, .auth-points { display: none; }
	.topbar-actions .btn.primary { display: none; }
}

@media (max-width: 640px) {
	body.dpk { font-size: 14.5px; }
	.grid-main, .grid-2, .grid-3, .grid-2.wide-gap { grid-template-columns: minmax(0, 1fr); }
	.stats, .stats.two { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
	.stat { padding: 12px 14px; }
	.stat-value { font-size: 17px; }
	.hero { padding: 20px; }
	.hero-figure { font-size: 28px; }
	.hide-sm { display: none; }
	.donut-wrap { flex-direction: column; align-items: stretch; }
	.donut { margin: 0 auto; }
	.filter-grid { grid-template-columns: minmax(0, 1fr); }
	.month-label { min-width: 120px; padding: 0 6px; }
	.toolbar { align-items: stretch; }
	.dialog { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto auto 0; border-radius: 18px 18px 0 0; }
	.dialog-body { padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }

	.table.responsive thead { display: none; }
	.table.responsive, .table.responsive tbody, .table.responsive tr, .table.responsive td, .table.responsive tfoot { display: block; width: 100%; }
	.table.responsive tfoot tr { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; }
	.table.responsive tfoot th { padding: 0; border: 0; background: none; }
	.table.responsive tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
	.table.responsive td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0; border: 0; text-align: right; }
	.table.responsive td::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; font-weight: 600; text-align: left; flex: none; }
	.table.responsive td:not([data-label])::before { content: none; }
	.table.responsive td.actions { justify-content: flex-end; width: 100%; padding-top: 6px; }
	.table.responsive td > :not(.chip) { min-width: 0; }
	.w-progress, .w-share { min-width: 0; }
	.w-progress .progress { flex: 1; }
}

/* ---------- Cetak ---------- */

@media print {
	.sidebar, .topbar, .toolbar, .tabbar, .flash, .backdrop, .actions, dialog { display: none !important; }
	body.dpk { background: #fff; color: #000; }
	.content { padding: 0; max-width: none; }
	.card, .stat { box-shadow: none; break-inside: avoid; }
	.print-title { display: block; margin-bottom: 8px; }
	.grid-main { grid-template-columns: repeat(2, 1fr); }
}

/* Daftar transaksi ringkas di HP */
@media (max-width: 640px) {
	.table.responsive.tx-table tbody tr { display: grid !important; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 2px; padding: 12px 14px; }
	.table.responsive.tx-table td { padding: 0 !important; }
	.table.responsive.tx-table td::before { content: none !important; }
	.table.responsive.tx-table td[data-label="Keterangan"] { grid-column: 1; grid-row: 1; display: block !important; text-align: left !important; }
	.table.responsive.tx-table td[data-label="Nominal"] { grid-column: 2; grid-row: 1; justify-content: flex-end !important; }
	.table.responsive.tx-table td[data-label="Tanggal"] { grid-column: 1; grid-row: 2; justify-content: flex-start !important; color: var(--muted); font-size: 12.5px; }
	.table.responsive.tx-table td[data-label="Akun"] { grid-column: 1; grid-row: 3; justify-content: flex-start !important; color: var(--muted); font-size: 12.5px; text-align: left !important; }
	.table.responsive.tx-table td.actions { grid-column: 2; grid-row: 2 / span 2; width: auto !important; padding-top: 0 !important; align-self: end; }
	.table.responsive.tx-table .note { margin-top: 4px; color: var(--text); }
}
