:root {
	--bg: #f3efe6;
	--paper: #fffdf8;
	--ink: #1c1915;
	--muted: #6f675c;
	--line: #e4d9c8;
	--spruce: #1b2822;
	--spruce-2: #294036;
	--orange: #b55212;
	--green: #1d6b45;
	--red: #9d342c;
	--shadow: 0 18px 40px rgba(48, 36, 18, 0.08);
	--radius: 16px;
	--sidebar: 260px;
	--font: "Nirmala UI", "Segoe UI", sans-serif;
	color-scheme: light;
}

* { box-sizing: border-box; }

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

body {
	font-family: var(--font);
	color: var(--ink);
	background: var(--bg);
	line-height: 1.45;
}

html[lang="bn"] body {
	font-family: "Nirmala UI", "Segoe UI", sans-serif;
}

a { color: inherit; }

button, input, select, textarea { font: inherit; color: inherit; }

h1, h2, p { margin: 0; }

.sf-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	border: 0;
}

.sf-skip {
	position: absolute;
	left: 12px;
	top: -40px;
	background: var(--spruce);
	color: white;
	padding: 8px 12px;
	z-index: 50;
}

.sf-skip:focus { top: 12px; }

.sf-mark {
	display: inline-grid;
	place-items: center;
	width: 42px;
	height: 42px;
	border-radius: 12px;
	background: var(--orange);
	color: white;
	font-weight: 750;
	letter-spacing: 0.04em;
	flex: 0 0 auto;
}

.sf-mark-lg { width: 56px; height: 56px; font-size: 20px; }

.sf-kicker {
	color: var(--orange);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.04em;
}

.sf-lead { color: var(--muted); margin: 0 0 16px; }

.sf-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	padding: 0 14px;
	border-radius: 10px;
	border: 1px solid transparent;
	background: var(--orange);
	color: white;
	font-weight: 650;
	text-decoration: none;
	cursor: pointer;
	white-space: nowrap;
}

.sf-btn:hover { filter: brightness(1.05); }

.sf-btn:focus-visible,
.sf-input:focus-visible,
.sf-voice:focus-visible,
.sf-lang a:focus-visible,
.sf-nav a:focus-visible,
.sf-menu:focus-visible {
	outline: 2px solid var(--orange);
	outline-offset: 2px;
}

.sf-btn-ghost {
	background: transparent;
	color: var(--ink);
	border-color: var(--line);
}

.sf-btn-danger { color: var(--red); }

.sf-btn-block { width: 100%; }

.sf-input {
	width: 100%;
	min-height: 42px;
	padding: 8px 12px;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: white;
}

textarea.sf-input { min-height: 84px; resize: vertical; }

.sf-control { position: relative; display: block; }

.sf-control .sf-input { padding-right: 44px; }

.sf-control:not(:has(.sf-voice)) .sf-input { padding-right: 12px; }

.sf-voice {
	position: absolute;
	top: 4px;
	right: 4px;
	width: 34px;
	height: 34px;
	border: 0;
	border-radius: 8px;
	background: #fff4ec;
	color: var(--orange);
	cursor: pointer;
	display: grid;
	place-items: center;
}

.sf-control:not(:has(textarea)) .sf-voice {
	top: 50%;
	transform: translateY(-50%);
}

.sf-voice svg,
.sf-nav svg,
.sf-menu svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.sf-voice.is-listening { background: var(--orange); color: white; }

.sf-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.sf-field label,
.sf-field > span,
.sf-filters .sf-field span { font-size: 13px; font-weight: 650; }

.sf-form {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	gap: 14px;
	align-items: end;
}

.sf-field { grid-column: span 4; }
.sf-field.is-wide { grid-column: span 6; }
.sf-field.is-full { grid-column: span 12; }
.sf-form-actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }

.sf-login {
	min-height: 100vh;
	background:
		radial-gradient(circle at top left, rgba(181, 82, 18, 0.18), transparent 32%),
		var(--bg);
}

.sf-login-wrap {
	min-height: 100vh;
	min-width: 0;
	display: grid;
	grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
}

.sf-login-aside {
	padding: 64px;
	background: var(--spruce);
	color: #f4f7f4;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	gap: 16px;
}

.sf-login-aside h1 { font-size: 48px; line-height: 1.05; }

.sf-login-tagline { font-size: 20px; max-width: 16em; color: #d5e2d8; }

.sf-login-aside ul { list-style: none; padding: 0; margin: 12px 0 0; display: flex; gap: 8px; flex-wrap: wrap; }

.sf-login-aside li {
	border: 1px solid rgba(255, 255, 255, 0.16);
	border-radius: 999px;
	padding: 6px 12px;
	color: #f3e2d4;
}

.sf-login-panel {
	display: grid;
	place-items: center;
	min-width: 0;
	padding: 32px 20px;
}

.sf-login-card {
	width: 100%;
	max-width: 440px;
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: 20px;
	box-shadow: var(--shadow);
	padding: 28px;
}

.sf-login-card h2 { font-size: 32px; margin: 6px 0 8px; }

.sf-login-tools { display: flex; justify-content: flex-end; margin-bottom: 8px; }

.sf-login-form { display: flex; flex-direction: column; align-items: stretch; gap: 14px; }

.sf-login-form .sf-field { grid-column: auto; }

.sf-remember { display: flex; align-items: center; gap: 8px; font-size: 14px; }

.sf-lang { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: white; }

.sf-login-aside + .sf-login-panel .sf-lang,
.sf-topbar .sf-lang { background: transparent; }

.sf-lang a {
	text-decoration: none;
	padding: 6px 10px;
	font-size: 13px;
	font-weight: 700;
}

.sf-lang a.is-active { background: var(--spruce); color: white; }

.sf-notice {
	background: #e7f5ec;
	color: var(--green);
	border-radius: 12px;
	padding: 10px 12px;
	margin-bottom: 14px;
}

.sf-notice.is-error { background: #fdeceb; color: var(--red); }

.sf-app {
	min-height: 100vh;
	display: grid;
	grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

.sf-sidebar {
	background: var(--spruce);
	color: #e7efe9;
	padding: 20px 14px;
	position: sticky;
	top: 0;
	height: 100vh;
	display: flex;
	flex-direction: column;
	gap: 22px;
}

.sf-brand {
	display: flex;
	gap: 10px;
	align-items: center;
	text-decoration: none;
	padding: 0 6px;
}

.sf-brand-text { display: flex; flex-direction: column; min-width: 0; }
.sf-brand-text strong { font-size: 16px; }
.sf-brand-text small { color: #b7c7bc; font-size: 12px; }

.sf-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }

.sf-nav-end { margin-top: auto; }

.sf-nav a {
	display: flex;
	align-items: center;
	gap: 10px;
	text-decoration: none;
	padding: 10px 12px;
	border-radius: 12px;
	color: #d7e4db;
}

.sf-nav a:hover,
.sf-nav a[aria-current="page"] { background: var(--spruce-2); color: white; }

.sf-nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--orange); }

.sf-subnav {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin: 2px 0 6px 18px;
	padding-left: 10px;
	border-left: 1px solid rgba(231, 239, 233, 0.28);
}

.sf-subnav a {
	padding: 8px 10px;
	font-size: 14px;
}

.sf-main { min-width: 0; }

.sf-topbar {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px 22px;
	position: sticky;
	top: 0;
	background: rgba(243, 239, 230, 0.92);
	backdrop-filter: blur(8px);
	z-index: 5;
}

.sf-topbar h1 { font-size: 26px; flex: 1; }

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

.sf-user { color: var(--muted); font-size: 14px; }

.sf-menu {
	display: none;
	width: 40px;
	height: 40px;
	border-radius: 10px;
	border: 1px solid var(--line);
	background: var(--paper);
	cursor: pointer;
	place-items: center;
}

.sf-content { padding: 8px 22px 40px; max-width: 1180px; }

.sf-stats {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
	margin-bottom: 16px;
}

.sf-stat, .sf-card {
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 16px;
}

.sf-stat h2 { font-size: 15px; margin: 4px 0 8px; }

.sf-stat-value {
	font-size: 28px;
	font-variant-numeric: tabular-nums;
	font-weight: 700;
	letter-spacing: -0.03em;
	white-space: nowrap;
}

.sf-stat-value.is-neg { color: var(--red); }

.sf-stat-sub, .sf-stat-hint { color: var(--muted); font-size: 13px; margin-top: 6px; }

.sf-card { margin-bottom: 14px; }

.sf-add-bar { margin: 0 0 14px; }

[hidden] { display: none !important; }

.sf-card h2 { font-size: 18px; margin-bottom: 12px; }

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

.sf-day-total strong { font-variant-numeric: tabular-nums; font-size: 20px; }

.sf-table-wrap { overflow-x: auto; }

.sf-table { width: 100%; border-collapse: collapse; font-size: 14px; }

.sf-table th {
	text-align: left;
	font-size: 12px;
	color: var(--muted);
	font-weight: 700;
	padding: 8px 10px;
	border-bottom: 1px solid var(--line);
}

html[lang="en"] .sf-table th { letter-spacing: 0.04em; text-transform: uppercase; }

.sf-table td {
	padding: 10px;
	border-bottom: 1px solid var(--line);
	vertical-align: middle;
}

.sf-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.sf-note { max-width: 240px; white-space: pre-wrap; color: var(--muted); }

.sf-row-actions { display: flex; justify-content: flex-end; gap: 8px; }

.sf-empty { color: var(--muted); }

.sf-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.sf-section-title { font-size: 20px; margin: 22px 0 6px; }

.sf-filters {
	display: flex;
	align-items: end;
	gap: 10px;
	margin-bottom: 14px;
}

.sf-filters .sf-field { width: 220px; }

.sf-input-amount { width: 130px; }

.sf-pill {
	display: inline-flex;
	align-items: center;
	border-radius: 999px;
	padding: 3px 8px;
	background: #f3e7dc;
	color: var(--muted);
	font-size: 12px;
	font-weight: 700;
}

.sf-pill.is-on { background: #e5f5eb; color: var(--green); }

.sf-check { display: inline-flex; }

.sf-check input { width: 18px; height: 18px; accent-color: var(--orange); }

.sf-serial { width: 64px; color: var(--muted); font-variant-numeric: tabular-nums; }

.sf-row-link {
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.sf-table tr.is-editing td { background: #fff4ec; }

tr[data-pay-row]:not(:has(input:checked)) { color: var(--muted); }

.sf-toast {
	position: fixed;
	right: 16px;
	bottom: 16px;
	background: var(--spruce);
	color: white;
	border-radius: 999px;
	padding: 10px 14px;
	box-shadow: var(--shadow);
	z-index: 40;
}

.sf-toast[hidden] { display: none; }

@media (max-width: 980px) {
	.sf-stats { grid-template-columns: 1fr 1fr; }
	.sf-field, .sf-field.is-wide { grid-column: span 6; }
}

@media (max-width: 860px) {
	.sf-login-wrap { grid-template-columns: minmax(0, 1fr); }
	.sf-login-aside { display: none; }
	.sf-app { grid-template-columns: 1fr; }
	.sf-menu { display: grid; }
	.sf-sidebar {
		position: fixed;
		z-index: 30;
		width: min(84vw, 300px);
		transform: translateX(-105%);
		transition: transform 160ms ease;
	}
	.sf-sidebar.is-open { transform: none; box-shadow: var(--shadow); }
	.sf-topbar { flex-wrap: wrap; padding: 12px; }
	.sf-topbar h1 { font-size: 22px; }
	.sf-topbar-actions { width: 100%; justify-content: flex-end; }
	.sf-user { display: none; }
	.sf-content { padding: 8px 12px 32px; }
	.sf-stat-value { font-size: 22px; }
	.sf-field, .sf-field.is-wide, .sf-field.is-full { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
	.sf-sidebar { transition: none; }
}
