:root {
	--vn-ink: #172033;
	--vn-muted: #697386;
	--vn-line: #e4e8ef;
	--vn-bg: #f5f7fb;
	--vn-card: #ffffff;
	--vn-blue: #2f64e9;
	--vn-blue-dark: #204ec5;
	--vn-blue-soft: #eaf0ff;
	--vn-teal: #138a78;
	--vn-teal-soft: #e7f7f3;
	--vn-danger: #c63f4f;
	--vn-danger-soft: #fff0f2;
	--vn-shadow: 0 12px 36px rgba(26, 39, 72, .08);
}

body.vn-budget-modal-open {
	overflow: hidden;
}

.vn-budget-app,
.vn-budget-login-wrap,
.vn-modal {
	box-sizing: border-box;
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	color: var(--vn-ink);
}

.vn-budget-app *,
.vn-budget-login-wrap *,
.vn-modal * {
	box-sizing: border-box;
}

.vn-budget-app {
	width: min(100% - 28px, 980px);
	margin: 28px auto 64px;
	padding: 0;
}

.vn-budget-app button,
.vn-budget-app input,
.vn-budget-app select,
.vn-budget-login-wrap button,
.vn-budget-login-wrap input,
.vn-budget-login-wrap select,
.vn-modal button,
.vn-modal input,
.vn-modal select {
	font: inherit;
}

.vn-budget-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 24px;
	margin-bottom: 24px;
}

.vn-budget-header h1,
.vn-budget-login-card h1 {
	font-size: clamp(30px, 6vw, 44px);
	line-height: 1.08;
	letter-spacing: -.035em;
	margin: 3px 0 7px;
	color: var(--vn-ink);
}

.vn-eyebrow {
	margin: 0;
	font-size: 12px;
	line-height: 1.3;
	font-weight: 800;
	letter-spacing: .11em;
	text-transform: uppercase;
	color: var(--vn-blue);
}

.vn-period-label,
.vn-muted,
.vn-modal-help {
	margin: 0;
	color: var(--vn-muted);
}

.vn-link-button,
.vn-delete-button,
.vn-undo-form button {
	appearance: none;
	border: 0;
	background: transparent;
	color: var(--vn-muted);
	cursor: pointer;
	font-weight: 700;
	padding: 8px;
}

.vn-link-button:hover,
.vn-delete-button:hover {
	color: var(--vn-danger);
}

.vn-balance-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px;
	margin-bottom: 18px;
}

.vn-balance-card,
.vn-section {
	background: var(--vn-card);
	border: 1px solid var(--vn-line);
	border-radius: 18px;
	box-shadow: var(--vn-shadow);
}

.vn-balance-card {
	padding: 24px;
	overflow: hidden;
}

.vn-card-topline {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 24px;
}

.vn-card-topline h2,
.vn-section h2,
.vn-modal-card h2 {
	font-size: 19px;
	line-height: 1.25;
	letter-spacing: -.015em;
	margin: 0;
	color: var(--vn-ink);
}

.vn-budget-badge {
	white-space: nowrap;
	border-radius: 999px;
	background: var(--vn-blue-soft);
	color: var(--vn-blue-dark);
	font-size: 11px;
	font-weight: 800;
	padding: 6px 9px;
}

.vn-balance-card:nth-child(2) .vn-budget-badge {
	background: var(--vn-teal-soft);
	color: var(--vn-teal);
}

.vn-balance-label {
	margin: 0 0 2px;
	font-size: 13px;
	font-weight: 700;
	color: var(--vn-muted);
}

.vn-balance-amount {
	margin: 0;
	font-size: clamp(34px, 7vw, 52px);
	line-height: 1.1;
	font-weight: 850;
	letter-spacing: -.045em;
	color: var(--vn-ink);
}

.vn-progress {
	height: 8px;
	border-radius: 999px;
	background: #eef1f6;
	margin: 22px 0 11px;
	overflow: hidden;
}

.vn-progress span {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: var(--vn-blue);
}

.vn-balance-card:nth-child(2) .vn-progress span {
	background: var(--vn-teal);
}

.vn-balance-card.is-negative {
	border-color: #f1bdc4;
}

.vn-balance-card.is-negative .vn-balance-amount,
.vn-balance-card.is-negative .vn-balance-label {
	color: var(--vn-danger);
}

.vn-balance-card.is-negative .vn-progress span {
	background: var(--vn-danger);
}

.vn-card-meta {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	font-size: 12px;
	color: var(--vn-muted);
}

.vn-add-button,
.vn-primary-button,
.vn-secondary-button {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 12px;
	font-weight: 800;
	text-decoration: none !important;
	cursor: pointer;
	transition: transform .15s ease, background .15s ease, border-color .15s ease;
}

.vn-add-button {
	width: 100%;
	min-height: 58px;
	gap: 8px;
	margin: 0 0 22px;
	border: 0;
	background: var(--vn-blue);
	box-shadow: 0 10px 24px rgba(47, 100, 233, .23);
	color: #fff;
	font-size: 17px;
}

.vn-add-button span {
	font-size: 24px;
	line-height: 1;
}

.vn-add-button:hover,
.vn-primary-button:hover {
	background: var(--vn-blue-dark);
	transform: translateY(-1px);
}

.vn-primary-button {
	min-height: 46px;
	border: 0;
	background: var(--vn-blue);
	color: #fff;
	padding: 11px 18px;
}

.vn-secondary-button {
	min-height: 40px;
	border: 1px solid var(--vn-line);
	background: #fff;
	color: var(--vn-ink) !important;
	padding: 8px 13px;
}

.vn-secondary-button:hover {
	border-color: #b9c2d1;
	background: #f8f9fb;
}

.vn-section {
	padding: 24px;
	margin: 0 0 20px;
}

.vn-section-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 18px;
}

.vn-section-heading .vn-eyebrow,
.vn-mini-report .vn-eyebrow {
	margin-bottom: 4px;
}

.vn-expense-list {
	border-top: 1px solid var(--vn-line);
}

.vn-expense-row {
	display: grid;
	grid-template-columns: 42px minmax(0, 1fr) auto auto;
	align-items: center;
	gap: 12px;
	min-height: 74px;
	border-bottom: 1px solid var(--vn-line);
	padding: 10px 0;
}

.vn-expense-row:last-child {
	border-bottom: 0;
}

.vn-expense-icon {
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	border-radius: 12px;
	background: var(--vn-blue-soft);
	color: var(--vn-blue-dark);
	font-weight: 850;
}

.vn-expense-icon.is-leah {
	background: var(--vn-teal-soft);
	color: var(--vn-teal);
}

.vn-expense-main,
.vn-expense-side {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.vn-expense-main strong {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.vn-expense-main span,
.vn-expense-side span {
	font-size: 12px;
	color: var(--vn-muted);
}

.vn-expense-side {
	text-align: right;
}

.vn-expense-side strong {
	font-size: 16px;
}

.vn-delete-form {
	margin: 0;
}

.vn-delete-button {
	font-size: 12px;
}

.vn-report-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 20px;
}

.vn-mini-report h2 {
	margin-bottom: 15px;
}

.vn-report-row {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	border-top: 1px solid var(--vn-line);
	padding: 12px 0;
}

.vn-report-row:last-child {
	padding-bottom: 0;
}

.vn-history-table-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.vn-history-table {
	width: 100%;
	min-width: 680px;
	border-collapse: collapse;
	font-size: 13px;
}

.vn-history-table th,
.vn-history-table td {
	border-bottom: 1px solid var(--vn-line);
	padding: 12px 10px;
	text-align: right;
	white-space: nowrap;
}

.vn-history-table th:first-child,
.vn-history-table td:first-child {
	padding-left: 0;
	text-align: left;
}

.vn-history-table th:last-child,
.vn-history-table td:last-child {
	padding-right: 0;
}

.vn-history-table th {
	font-size: 11px;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--vn-muted);
}

.vn-empty-state {
	border: 1px dashed #cbd2de;
	border-radius: 14px;
	background: #fafbfc;
	padding: 28px 18px;
	text-align: center;
}

.vn-empty-state p {
	font-weight: 800;
	margin: 0 0 4px;
}

.vn-empty-state span {
	font-size: 13px;
	color: var(--vn-muted);
}

.vn-notice {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	border: 1px solid;
	border-radius: 12px;
	margin: 0 0 18px;
	padding: 12px 14px;
	font-size: 14px;
	font-weight: 650;
}

.vn-notice-success {
	border-color: #a5dfd3;
	background: var(--vn-teal-soft);
	color: #0b685a;
}

.vn-notice-error,
.vn-notice-warning {
	border-color: #efbdc4;
	background: var(--vn-danger-soft);
	color: #993140;
}

.vn-undo-form {
	margin: 0;
}

.vn-undo-form button {
	color: inherit;
	text-decoration: underline;
}

.vn-budget-login-wrap {
	display: grid;
	place-items: center;
	min-height: min(720px, 78vh);
	width: min(100% - 28px, 520px);
	margin: 28px auto;
}

.vn-budget-login-card {
	width: 100%;
	border: 1px solid var(--vn-line);
	border-radius: 24px;
	background: #fff;
	box-shadow: var(--vn-shadow);
	padding: clamp(26px, 6vw, 44px);
}

.vn-budget-mark {
	display: grid;
	place-items: center;
	width: 52px;
	height: 52px;
	border-radius: 16px;
	background: var(--vn-blue);
	box-shadow: 0 9px 22px rgba(47, 100, 233, .22);
	color: #fff;
	font-weight: 900;
	letter-spacing: -.04em;
	margin-bottom: 20px;
}

.vn-login-intro {
	color: var(--vn-muted);
	margin: 0 0 26px;
}

.vn-login-form,
.vn-expense-form {
	display: flex;
	flex-direction: column;
	gap: 9px;
}

.vn-login-form label,
.vn-expense-form label {
	font-size: 13px;
	font-weight: 800;
	margin-top: 6px;
}

.vn-login-form input,
.vn-login-form select,
.vn-expense-form input,
.vn-expense-form select {
	width: 100%;
	min-height: 48px;
	border: 1px solid #cbd2de;
	border-radius: 10px;
	background: #fff;
	color: var(--vn-ink);
	padding: 10px 12px;
	outline: none;
}

.vn-login-form input:focus,
.vn-login-form select:focus,
.vn-expense-form input:focus,
.vn-expense-form select:focus {
	border-color: var(--vn-blue);
	box-shadow: 0 0 0 3px rgba(47, 100, 233, .14);
}

.vn-login-button {
	width: 100%;
	margin-top: 10px;
}

.vn-modal[hidden] {
	display: none;
}

.vn-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: grid;
	place-items: center;
	padding: 16px;
}

.vn-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(13, 19, 33, .56);
	backdrop-filter: blur(3px);
}

.vn-modal-card {
	position: relative;
	z-index: 1;
	width: min(100%, 480px);
	border-radius: 20px;
	background: #fff;
	box-shadow: 0 26px 70px rgba(8, 14, 29, .28);
	padding: clamp(24px, 6vw, 36px);
}

.vn-modal-card h2 {
	font-size: 26px;
	margin: 4px 0 5px;
}

.vn-modal-help {
	font-size: 13px;
	margin-bottom: 17px;
}

.vn-modal-close {
	position: absolute;
	top: 13px;
	right: 13px;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 50%;
	background: #f1f3f7;
	color: var(--vn-muted);
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}

.vn-money-input {
	display: flex;
	align-items: stretch;
}

.vn-money-input span {
	display: grid;
	place-items: center;
	border: 1px solid #cbd2de;
	border-right: 0;
	border-radius: 10px 0 0 10px;
	background: #f5f7fa;
	color: var(--vn-muted);
	font-weight: 800;
	padding: 0 13px;
}

.vn-money-input input {
	border-radius: 0 10px 10px 0;
}

.vn-modal-actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	margin-top: 18px;
}

@media (max-width: 700px) {
	.vn-budget-app {
		width: min(100% - 20px, 980px);
		margin-top: 18px;
	}

	.vn-balance-grid,
	.vn-report-grid {
		grid-template-columns: 1fr;
		gap: 14px;
	}

	.vn-balance-card,
	.vn-section {
		border-radius: 15px;
		padding: 18px;
	}

	.vn-card-topline {
		margin-bottom: 17px;
	}

	.vn-expense-row {
		grid-template-columns: 38px minmax(0, 1fr) auto;
		gap: 10px;
	}

	.vn-expense-icon {
		width: 38px;
		height: 38px;
	}

	.vn-delete-form {
		grid-column: 2 / -1;
		text-align: right;
		margin-top: -11px;
	}

	.vn-delete-button {
		padding: 2px 0 5px 12px;
	}

	.vn-section-heading {
		align-items: flex-end;
	}
}

@media (max-width: 420px) {
	.vn-budget-header h1 {
		font-size: 31px;
	}

	.vn-balance-amount {
		font-size: 40px;
	}

	.vn-card-meta {
		flex-direction: column;
		gap: 2px;
	}

	.vn-expense-side span {
		max-width: 96px;
		white-space: normal;
	}

	.vn-modal-actions {
		flex-direction: column-reverse;
	}

	.vn-modal-actions .vn-primary-button,
	.vn-modal-actions .vn-secondary-button {
		width: 100%;
	}
}
