/* =========================================================
   PM POSHAN ? mobile-first UI
   ========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Mukta:wght@400;500;600;700&family=Sora:wght@500;600;700&display=swap');

:root {
	--pm-green: #0b6e4f;
	--pm-green-dark: #08553d;
	--pm-green-soft: #e6f4ee;
	--pm-leaf: #1a9a6c;
	--pm-gold: #d4920a;
	--pm-gold-soft: #fff4db;
	--pm-ink: #14261f;
	--pm-muted: #5b6f66;
	--pm-line: #d5e5dc;
	--pm-surface: #ffffff;
	--pm-bg: #eef6f1;
	--pm-danger: #c0392b;
	--pm-radius: 14px;
	--pm-radius-sm: 10px;
	--pm-shadow: 0 8px 24px rgba(11, 110, 79, 0.08);
	--pm-shadow-sm: 0 2px 10px rgba(20, 38, 31, 0.06);
	--pm-sidebar-w: 280px;
	--pm-topbar-h: 58px;
	--pm-bottom-h: 64px;
	--pm-safe-bottom: env(safe-area-inset-bottom, 0px);
	--pm-font: 'Mukta', 'Noto Sans Devanagari', sans-serif;
	--pm-display: 'Sora', 'Mukta', sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	background:
		radial-gradient(1200px 500px at 10% -10%, rgba(26, 154, 108, 0.12), transparent 55%),
		radial-gradient(900px 400px at 100% 0%, rgba(212, 146, 10, 0.10), transparent 50%),
		var(--pm-bg);
	color: var(--pm-ink);
	font-family: var(--pm-font);
	font-size: 16px;
	line-height: 1.45;
	min-height: 100vh;
	min-height: 100dvh;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	touch-action: pan-y;
}

a { color: var(--pm-green); }
a:hover { color: var(--pm-green-dark); text-decoration: none; }

h1, h2, h3, h4, h5, .page-title, .navbar-brand, .brand-title {
	font-family: var(--pm-display);
	letter-spacing: -0.02em;
}

/* ---------- App shell ---------- */
#wrapper {
	min-height: 100vh;
	display: flex;
	position: relative;
}

#sidebar {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 1040;
	width: var(--pm-sidebar-w);
	height: 100vh;
	height: 100dvh;
	background: linear-gradient(180deg, #0a5c42 0%, #083f2f 100%);
	color: #fff;
	transform: translateX(-105%);
	transition: transform .28s ease;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	box-shadow: 8px 0 30px rgba(0, 0, 0, 0.18);
}

#sidebar.open { transform: translateX(0); }

.sidebar-overlay {
	position: fixed;
	inset: 0;
	z-index: 1035;
	background: rgba(10, 30, 22, 0.45);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity .25s ease, visibility .25s ease;
	backdrop-filter: blur(2px);
}

.sidebar-overlay.show {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.sidebar-brand {
	padding: 1.1rem 1.15rem 1rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.12);
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: .75rem;
}

.brand-mark {
	width: 40px;
	height: 40px;
	border-radius: 12px;
	background: linear-gradient(145deg, #1a9a6c, #0b6e4f);
	display: grid;
	place-items: center;
	font-family: var(--pm-display);
	font-weight: 700;
	font-size: .95rem;
	box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
	flex-shrink: 0;
}

.brand-title { font-weight: 700; font-size: 1.05rem; line-height: 1.2; }
.brand-sub { color: rgba(255, 255, 255, 0.68); font-size: .78rem; margin-top: .15rem; }

.sidebar-close {
	background: rgba(255,255,255,.1);
	border: 0;
	color: #fff;
	width: 36px;
	height: 36px;
	border-radius: 10px;
	font-size: 1.25rem;
	line-height: 1;
	flex-shrink: 0;
}

#sidebar .nav { padding: .75rem .7rem 5.5rem; }
#sidebar .nav-link {
	color: rgba(255, 255, 255, 0.88) !important;
	border-radius: 12px;
	margin-bottom: .28rem;
	padding: .72rem .9rem;
	font-weight: 500;
	font-size: .98rem;
	display: flex;
	align-items: center;
	gap: .65rem;
	min-height: 46px;
	transition: background .15s ease, transform .15s ease;
}
#sidebar .nav-link .nav-ico {
	width: 1.35rem;
	text-align: center;
	opacity: .9;
	font-size: 1.05rem;
}
#sidebar .nav-link.active,
#sidebar .nav-link:hover {
	background: rgba(255, 255, 255, 0.12);
	color: #fff !important;
}
#sidebar .nav-link.active {
	background: rgba(255, 255, 255, 0.18);
	box-shadow: inset 3px 0 0 #f0c14b;
}

#page-content {
	flex: 1;
	min-width: 0;
	width: 100%;
	padding-top: var(--pm-topbar-h);
	padding-bottom: calc(var(--pm-bottom-h) + var(--pm-safe-bottom) + 12px);
}

/* ---------- Top bar ---------- */
.app-topbar {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 1030;
	height: var(--pm-topbar-h);
	display: flex;
	align-items: center;
	gap: .65rem;
	padding: 0 .85rem;
	background: rgba(255, 255, 255, 0.92);
	backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--pm-line);
	box-shadow: var(--pm-shadow-sm);
}

.btn-menu-toggle {
	width: 42px;
	height: 42px;
	border-radius: 12px;
	border: 1px solid var(--pm-line);
	background: var(--pm-green-soft);
	color: var(--pm-green-dark);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	flex-shrink: 0;
}
.btn-menu-toggle span {
	display: block;
	width: 18px;
	height: 2px;
	background: currentColor;
	position: relative;
	border-radius: 2px;
}
.btn-menu-toggle span::before,
.btn-menu-toggle span::after {
	content: '';
	position: absolute;
	left: 0;
	width: 18px;
	height: 2px;
	background: currentColor;
	border-radius: 2px;
}
.btn-menu-toggle span::before { top: -6px; }
.btn-menu-toggle span::after { top: 6px; }

.topbar-title {
	flex: 1;
	min-width: 0;
	font-family: var(--pm-display);
	font-weight: 600;
	font-size: 1.05rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.topbar-user {
	max-width: 38vw;
	font-size: .78rem;
	color: var(--pm-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	text-align: right;
	line-height: 1.2;
}

.btn-logout-top {
	border-radius: 10px;
	border: 1px solid #f0c9c5;
	background: #fff5f4;
	color: var(--pm-danger);
	font-size: .82rem;
	font-weight: 600;
	padding: .4rem .65rem;
	white-space: nowrap;
}

/* ---------- Bottom nav (mobile) ---------- */
.app-bottomnav {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 1030;
	height: calc(var(--pm-bottom-h) + var(--pm-safe-bottom));
	padding-bottom: var(--pm-safe-bottom);
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	background: rgba(255, 255, 255, 0.96);
	backdrop-filter: blur(12px);
	border-top: 1px solid var(--pm-line);
	box-shadow: 0 -6px 24px rgba(20, 38, 31, 0.06);
}

.bottom-link {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: .15rem;
	color: var(--pm-muted);
	font-size: .68rem;
	font-weight: 600;
	text-decoration: none !important;
	min-height: var(--pm-bottom-h);
	padding: .35rem .2rem;
	-webkit-tap-highlight-color: transparent;
}
.bottom-link .bico {
	font-size: 1.2rem;
	line-height: 1;
	width: 28px;
	height: 28px;
	display: grid;
	place-items: center;
	border-radius: 10px;
	transition: background .15s ease, color .15s ease;
}
.bottom-link.active { color: var(--pm-green); }
.bottom-link.active .bico {
	background: var(--pm-green-soft);
	color: var(--pm-green-dark);
}

/* ---------- Main content ---------- */
main.app-main {
	padding: .9rem .85rem 1.25rem;
	max-width: 1200px;
}

.page-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: .75rem;
	margin-bottom: 1rem;
	flex-wrap: wrap;
}
.page-head h5,
.page-head .page-title {
	margin: 0;
	font-size: 1.2rem;
	font-weight: 700;
}

/* Cards */
.card {
	border: 1px solid var(--pm-line);
	border-radius: var(--pm-radius);
	background: var(--pm-surface);
	box-shadow: var(--pm-shadow-sm);
}
.card.shadow-sm { box-shadow: var(--pm-shadow-sm) !important; }
.card-header {
	background: transparent;
	border-bottom: 1px solid var(--pm-line);
	border-radius: var(--pm-radius) var(--pm-radius) 0 0 !important;
	font-weight: 600;
	padding: .85rem 1rem;
}
.card-body { padding: 1rem; }

.stat-card {
	border: 1px solid var(--pm-line);
	border-radius: var(--pm-radius);
	background:
		linear-gradient(160deg, #ffffff 0%, var(--pm-green-soft) 140%);
	overflow: hidden;
	position: relative;
}
.stat-card::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 4px;
	background: linear-gradient(180deg, var(--pm-leaf), var(--pm-green));
}
.stat-card .card-body { padding: .95rem 1rem .95rem 1.15rem; }
.stat-card .h3 {
	font-family: var(--pm-display);
	font-weight: 700;
	color: var(--pm-green-dark);
	font-size: 1.65rem;
}

.alert {
	border: 0;
	border-radius: var(--pm-radius-sm);
	font-weight: 500;
}
.alert-info {
	background: #e8f4ff;
	color: #1a4d73;
}
.alert-success {
	background: var(--pm-green-soft);
	color: var(--pm-green-dark);
}
.alert-danger {
	background: #fdecea;
	color: #8c2a22;
}

/* Forms ? large touch targets */
.form-control,
.custom-select,
.select2-container--bootstrap4 .select2-selection--single {
	min-height: 46px !important;
	border-radius: 12px !important;
	border-color: var(--pm-line) !important;
	font-size: 1rem !important;
}
.form-control:focus {
	border-color: var(--pm-leaf) !important;
	box-shadow: 0 0 0 .2rem rgba(11, 110, 79, 0.15) !important;
}
label {
	font-weight: 600;
	font-size: .92rem;
	color: var(--pm-ink);
	margin-bottom: .35rem;
}

.btn {
	border-radius: 12px;
	font-weight: 600;
	min-height: 44px;
	padding: .55rem 1rem;
	letter-spacing: 0.01em;
}
.btn-sm {
	min-height: 36px;
	padding: .35rem .7rem;
	border-radius: 10px;
	font-size: .86rem;
}
.btn-primary {
	background: var(--pm-green);
	border-color: var(--pm-green);
}
.btn-primary:hover,
.btn-primary:focus {
	background: var(--pm-green-dark);
	border-color: var(--pm-green-dark);
}
.btn-success {
	background: var(--pm-leaf);
	border-color: var(--pm-leaf);
}
.btn-success:hover {
	background: var(--pm-green);
	border-color: var(--pm-green);
}
.btn-outline-primary {
	color: var(--pm-green);
	border-color: var(--pm-green);
}
.btn-outline-primary:hover {
	background: var(--pm-green);
	border-color: var(--pm-green);
}
.btn-block-mobile { width: 100%; }

.quick-actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: .65rem;
}
.quick-actions .btn {
	margin: 0 !important;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	white-space: normal;
	line-height: 1.25;
	min-height: 52px;
}

/* Tables */
.table-responsive {
	border-radius: 0 0 var(--pm-radius) var(--pm-radius);
	-webkit-overflow-scrolling: touch;
}
.table {
	margin-bottom: 0;
	font-size: .92rem;
}
.table thead th {
	border-top: 0;
	border-bottom: 1px solid var(--pm-line);
	color: var(--pm-muted);
	font-weight: 700;
	font-size: .8rem;
	text-transform: none;
	white-space: nowrap;
	background: #f7fbf8;
}
.table td { vertical-align: middle; }
.table-hover tbody tr:hover { background: rgba(11, 110, 79, 0.04); }

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
	padding: .65rem .85rem;
	font-size: .88rem;
}
.dataTables_wrapper .dataTables_filter input {
	min-height: 40px;
	border-radius: 10px;
	border: 1px solid var(--pm-line);
	margin-left: .35rem;
	max-width: 48vw;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
	border-radius: 8px !important;
	padding: .35rem .55rem !important;
}

/* ---------- Auth ---------- */
.auth-body {
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	align-items: stretch;
	justify-content: center;
	padding: 0;
	background:
		linear-gradient(165deg, rgba(8, 85, 61, 0.92) 0%, rgba(11, 110, 79, 0.88) 42%, rgba(20, 38, 31, 0.9) 100%),
		radial-gradient(circle at 20% 20%, rgba(240, 193, 75, 0.25), transparent 40%),
		#0b6e4f;
}

.auth-wrap {
	width: 100%;
	max-width: 440px;
	margin: auto;
	padding: 1.25rem 1rem 2rem;
	animation: rise .45s ease both;
}

.auth-card {
	width: 100%;
	border: 0;
	border-radius: 22px;
	overflow: hidden;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
	background: #fff;
}

.auth-hero {
	background:
		linear-gradient(135deg, var(--pm-green) 0%, #0d8a62 55%, #117a58 100%);
	color: #fff;
	padding: 1.5rem 1.35rem 1.25rem;
	position: relative;
	overflow: hidden;
}
.auth-hero::after {
	content: '';
	position: absolute;
	right: -30px;
	top: -30px;
	width: 140px;
	height: 140px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.08);
}
.auth-hero .brand-mark {
	margin-bottom: .85rem;
	width: 48px;
	height: 48px;
	font-size: 1.1rem;
}
.auth-hero h1 {
	font-size: 1.35rem;
	font-weight: 700;
	margin: 0 0 .35rem;
	position: relative;
	z-index: 1;
}
.auth-hero p {
	margin: 0;
	opacity: .85;
	font-size: .92rem;
	position: relative;
	z-index: 1;
}

.auth-card .card-body { padding: 1.35rem 1.25rem 1.5rem; }

.auth-card .btn-primary {
	min-height: 50px;
	font-size: 1.05rem;
	border-radius: 14px;
}

@keyframes rise {
	from { opacity: 0; transform: translateY(16px); }
	to { opacity: 1; transform: translateY(0); }
}

/* Mobile list cards helper (optional class on pages) */
.mobile-stack .btn { margin-bottom: .35rem; }

body.sidebar-open {
	overflow: hidden !important;
	position: fixed;
	width: 100%;
	left: 0;
	right: 0;
	touch-action: none;
}

/* ---------- Desktop ---------- */
@media (min-width: 992px) {
	#sidebar {
		position: sticky;
		transform: none !important;
		flex-shrink: 0;
		height: 100vh;
		height: 100dvh;
	}

	.sidebar-overlay,
	.sidebar-close,
	.app-bottomnav,
	.btn-menu-toggle { display: none !important; }

	.app-topbar {
		position: sticky;
		left: auto;
		right: auto;
		width: auto;
	}

	#page-content {
		padding-top: 0;
		padding-bottom: 0;
		display: flex;
		flex-direction: column;
		min-height: 100vh;
	}

	.app-topbar { position: sticky; top: 0; }

	main.app-main {
		padding: 1.35rem 1.5rem 2rem;
		flex: 1;
	}

	.topbar-user { max-width: none; font-size: .88rem; }
	.topbar-title { font-size: 1.15rem; }

	.quick-actions {
		grid-template-columns: repeat(4, 1fr);
	}

	.btn-block-mobile { width: auto; }
}

@media (min-width: 768px) and (max-width: 991.98px) {
	.quick-actions { grid-template-columns: repeat(2, 1fr); }
}

/* Print */
@media print {
	@page { size: A4 landscape; margin: 5mm; }
	#sidebar,
	.app-topbar,
	.app-bottomnav,
	.sidebar-overlay,
	.d-print-none { display: none !important; }
	#page-content { width: 100%; padding: 0 !important; }
	body { background: #fff; }
	.card { box-shadow: none !important; border: 1px solid #ccc; }
}

.register-sheet { font-size: 13px; }

/* Report tiles */
.report-grid {
	display: grid;
	gap: .75rem;
}
.report-tile {
	display: flex;
	align-items: center;
	gap: .85rem;
	padding: 1rem 1.05rem;
	background: var(--pm-surface);
	border: 1px solid var(--pm-line);
	border-radius: var(--pm-radius);
	box-shadow: var(--pm-shadow-sm);
	color: var(--pm-ink) !important;
	text-decoration: none !important;
	min-height: 64px;
	transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.report-tile:active { transform: scale(0.98); }
.report-tile:hover {
	border-color: var(--pm-leaf);
	box-shadow: var(--pm-shadow);
}
.report-tile .rt-ico {
	width: 42px;
	height: 42px;
	border-radius: 12px;
	background: var(--pm-green-soft);
	color: var(--pm-green-dark);
	display: grid;
	place-items: center;
	font-size: 1.1rem;
	flex-shrink: 0;
}
.report-tile .rt-title {
	flex: 1;
	font-weight: 600;
	font-size: 1.02rem;
}
.report-tile .rt-arrow {
	color: var(--pm-muted);
	font-size: 1.4rem;
	line-height: 1;
}

@media (min-width: 768px) {
	.report-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- Monthly diary (????????) ---------- */
.diary-sheet {
	border: 1px solid var(--pm-line);
	border-radius: var(--pm-radius);
	padding: .85rem;
	box-shadow: var(--pm-shadow-sm);
}
.diary-header { margin-bottom: .85rem; }
.diary-govt { font-weight: 700; font-size: .95rem; color: var(--pm-green-dark); }
.diary-title {
	font-family: var(--pm-display);
	font-size: 1.25rem;
	font-weight: 700;
	margin: .25rem 0 .45rem;
}
.diary-meta {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: .35rem 1.1rem;
	font-size: .9rem;
	color: var(--pm-ink);
}
.diary-scroll {
	overflow: auto;
	-webkit-overflow-scrolling: touch;
	max-width: 100%;
	border: 1px solid var(--pm-line);
	border-radius: 10px;
}
.diary-table {
	width: max-content;
	min-width: 100%;
	border-collapse: collapse;
	font-size: 12px;
	background: #fff;
}
.diary-table th,
.diary-table td {
	border: 1px solid #c5d6cc;
	padding: .28rem .35rem;
	white-space: nowrap;
	vertical-align: middle;
}
.diary-table thead th {
	background: #e7f3ec;
	color: var(--pm-ink);
	font-weight: 700;
	text-align: center;
	position: sticky;
	top: 0;
	z-index: 2;
}
.diary-table th .unit {
	display: block;
	font-weight: 500;
	font-size: 10px;
	color: var(--pm-muted);
}
.diary-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.diary-table .col-menu { min-width: 120px; max-width: 160px; white-space: normal; }
.diary-table .col-item { min-width: 72px; }
.diary-table .col-cash { background: #fff8e8; }
.diary-table .sticky-col {
	position: sticky;
	left: 0;
	background: #fff;
	z-index: 1;
}
.diary-table thead .sticky-col { z-index: 3; background: #e7f3ec; }
.diary-table .col-date { left: 0; min-width: 88px; }
.diary-table .col-day { left: 88px; min-width: 48px; }
.diary-table .row-opening td { background: #f3faf6; }
.diary-table .row-received td { background: #f7faf8; }
.diary-table .row-total td { background: #fff3bf; font-weight: 600; }
.diary-table .row-sunday td { background: #ffe8cc; }
.diary-table .row-empty td { color: #9aa8a1; }
.diary-table .row-sum td { background: #e8f0ff; }
.diary-table .row-closing td { background: #d8f3e4; }
.diary-table .row-opening .sticky-col,
.diary-table .row-received .sticky-col,
.diary-table .row-total .sticky-col,
.diary-table .row-sum .sticky-col,
.diary-table .row-closing .sticky-col,
.diary-table .row-sunday .sticky-col { background: inherit; }

@media print {
	@page { size: A4 landscape; margin: 4mm; }

	.diary-sheet { border: 0; box-shadow: none; padding: 0; }
	.diary-scroll {
		overflow: visible !important;
		border: 0 !important;
		max-width: 100% !important;
		width: 100% !important;
		height: auto !important;
	}
	.diary-header { margin-bottom: 3px !important; }
	.diary-govt { font-size: 9px !important; }
	.diary-title { font-size: 12px !important; margin: 1px 0 !important; }
	.diary-meta { font-size: 8px !important; gap: .15rem .5rem !important; }
	.diary-table {
		width: 100% !important;
		max-width: 100% !important;
		table-layout: fixed !important;
		font-size: 6px !important;
		transform: none !important;
	}
	.diary-table th,
	.diary-table td {
		padding: 1px !important;
		white-space: normal !important;
		word-break: break-word !important;
		overflow-wrap: anywhere !important;
		min-width: 0 !important;
		max-width: none !important;
		line-height: 1.1 !important;
	}
	.diary-table thead th {
		position: static !important;
		font-size: 5.5px !important;
		vertical-align: bottom !important;
		text-align: center;
	}
	.diary-table th .unit { display: none !important; }
	.diary-table thead th.col-item,
	.diary-table thead th.col-cash {
		writing-mode: vertical-rl;
		transform: rotate(180deg);
		padding: 3px 0 !important;
		height: 68px;
		white-space: nowrap !important;
		word-break: normal !important;
	}
	.diary-table .col-menu {
		min-width: 0 !important;
		width: 6.5% !important;
		font-size: 5px !important;
	}
	.diary-table .col-date { width: 4% !important; min-width: 0 !important; }
	.diary-table .col-day { width: 2.5% !important; min-width: 0 !important; }
	.diary-table .sticky-col { position: static !important; left: auto !important; }
	.diary-foot { font-size: 7px !important; margin-top: 3px !important; }

	html, body, #wrapper, #page-content, main.app-main, .print-wrap {
		width: 100% !important;
		max-width: 100% !important;
		overflow: visible !important;
		margin: 0 !important;
		padding: 0 !important;
		background: #fff !important;
	}
	main.app-main { max-width: none !important; }
}

/* Dedicated print layout body (screen preview) */
.diary-print-body .diary-sheet {
	border: 0;
	box-shadow: none;
	padding: 0;
}
.diary-print-body .diary-scroll {
	overflow: auto;
	border: 1px solid #c5d6cc;
}
.diary-print-body .diary-table {
	font-size: 10px;
}
.diary-print-body .diary-table thead th.col-item,
.diary-print-body .diary-table thead th.col-cash {
	writing-mode: vertical-rl;
	transform: rotate(180deg);
	white-space: nowrap;
	height: 90px;
	vertical-align: bottom;
	padding: 4px 2px;
}
.diary-print-body .diary-table th .unit { display: none; }
.diary-print-body .diary-table .col-item,
.diary-print-body .diary-table .col-menu {
	min-width: 0;
}

/* =========================================================
   Mobile App experience ? vertical scroll must work
   ========================================================= */
html {
	overflow-x: clip;
	overflow-y: auto;
	height: auto;
}

body {
	overflow-x: clip;
	overflow-y: auto !important;
	height: auto !important;
	max-width: 100%;
	position: relative;
}

@media (max-width: 991.98px) {
	html, body {
		overflow-y: auto !important;
		height: auto !important;
		min-height: 100%;
		overscroll-behavior-y: auto;
		-webkit-overflow-scrolling: touch;
		-webkit-tap-highlight-color: transparent;
	}

	#wrapper {
		display: block;
		min-height: 0;
		height: auto !important;
		overflow: visible !important;
	}

	#page-content,
	main.app-main {
		overflow: visible !important;
		height: auto !important;
		max-height: none !important;
		max-width: 100%;
	}

	main.app-main {
		padding: .75rem .7rem calc(var(--pm-bottom-h) + var(--pm-safe-bottom) + 20px);
	}

	.app-topbar,
	.app-bottomnav {
		touch-action: manipulation;
	}

	.table-responsive {
		overflow-x: visible !important;
	}
	.app-topbar .btn-logout-top { display: none; }
	.topbar-title { font-size: 1.08rem; }

	.page-head {
		flex-direction: column;
		align-items: stretch;
	}
	.page-head .btn,
	.btn-fab-inline {
		width: 100%;
		justify-content: center;
	}

	.filter-card .card-body { padding: .85rem; }
	.filter-card .form-group { margin-bottom: .75rem; }

	.quick-actions { grid-template-columns: 1fr 1fr; }

	.diary-scroll.d-none { display: none !important; }
}

/* Mobile card lists */
.m-card-list {
	display: flex;
	flex-direction: column;
	gap: .7rem;
}
.m-card {
	background: #fff;
	border: 1px solid var(--pm-line);
	border-radius: 16px;
	padding: .95rem 1rem;
	box-shadow: var(--pm-shadow-sm);
}
.m-card-top {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: .65rem;
	margin-bottom: .65rem;
}
.m-card-title {
	font-weight: 700;
	font-size: 1.02rem;
	line-height: 1.25;
}
.m-card-sub {
	color: var(--pm-muted);
	font-size: .88rem;
	margin-top: .15rem;
}
.m-card-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: .55rem;
}
.m-card-grid-5 { grid-template-columns: 1fr 1fr; }
.m-card-grid > div {
	background: var(--pm-green-soft);
	border-radius: 12px;
	padding: .55rem .65rem;
}
.m-card-grid > div.span-2 { grid-column: 1 / -1; }
.m-card-grid span {
	display: block;
	font-size: .72rem;
	color: var(--pm-muted);
	font-weight: 600;
}
.m-card-grid b {
	font-size: 1rem;
	font-family: var(--pm-display);
	color: var(--pm-green-dark);
}
.m-card-foot {
	margin-top: .55rem;
	font-size: .8rem;
	color: var(--pm-muted);
}
.m-card-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .75rem;
}
.m-card-value {
	font-family: var(--pm-display);
	font-size: 1.1rem;
	color: var(--pm-green-dark);
	white-space: nowrap;
}

.empty-state {
	text-align: center;
	padding: 2rem 1rem;
	color: var(--pm-muted);
	background: #fff;
	border: 1px dashed var(--pm-line);
	border-radius: 16px;
}

.mobile-actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: .55rem;
}
.mobile-actions .btn {
	min-height: 44px;
	margin: 0;
}

/* FAB */
.fab-new {
	position: fixed;
	right: 16px;
	bottom: calc(var(--pm-bottom-h) + var(--pm-safe-bottom) + 14px);
	z-index: 1025;
	width: 56px;
	height: 56px;
	border-radius: 18px;
	background: var(--pm-leaf);
	color: #fff !important;
	font-size: 2rem;
	font-weight: 500;
	display: grid;
	place-items: center;
	box-shadow: 0 10px 24px rgba(11, 110, 79, 0.35);
	text-decoration: none !important;
	line-height: 1;
}

/* Daily calc mobile */
.calc-mobile {
	background: #fff;
	border: 1px solid var(--pm-line);
	border-radius: 14px;
	overflow: hidden;
}
.calc-line {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: .75rem;
	padding: .75rem .9rem;
	border-bottom: 1px solid var(--pm-line);
}
.calc-line:last-child { border-bottom: 0; }
.calc-line-name { font-weight: 600; }
.calc-line-name small { color: var(--pm-muted); font-weight: 500; }
.calc-line-qty {
	font-family: var(--pm-display);
	font-weight: 700;
	color: var(--pm-green-dark);
	white-space: nowrap;
}
.calc-fuel-mobile {
	display: flex;
	justify-content: space-between;
	align-items: center;
	background: var(--pm-gold-soft);
	border-radius: 12px;
	padding: .85rem 1rem;
	font-weight: 600;
}

/* Diary mobile */
.diary-mobile { margin-top: .5rem; }
.diary-mobile .m-block {
	background: #fff;
	border: 1px solid var(--pm-line);
	border-radius: 14px;
	margin-bottom: .75rem;
	overflow: hidden;
}
.diary-mobile .m-block > summary {
	list-style: none;
	padding: .9rem 1rem;
	font-weight: 700;
	cursor: pointer;
	background: var(--pm-green-soft);
}
.diary-mobile .m-block > summary::-webkit-details-marker { display: none; }
.m-stock-list { padding: .35rem .65rem .75rem; }
.m-stock-row {
	padding: .7rem .35rem;
	border-bottom: 1px solid var(--pm-line);
}
.m-stock-row:last-child { border-bottom: 0; }
.m-stock-name { font-weight: 700; margin-bottom: .45rem; }
.m-stock-name small { color: var(--pm-muted); font-weight: 500; }
.m-stock-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: .4rem;
}
.m-stock-grid > div {
	background: #f7fbf8;
	border-radius: 10px;
	padding: .4rem .5rem;
}
.m-stock-grid span {
	display: block;
	font-size: .68rem;
	color: var(--pm-muted);
}
.m-stock-grid b { font-size: .92rem; }
.m-stock-close { grid-column: 1 / -1; background: #d8f3e4 !important; }

.m-summary-bar {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: .55rem;
	margin-bottom: .75rem;
}
.m-summary-bar > div {
	background: linear-gradient(160deg, #fff, var(--pm-green-soft));
	border: 1px solid var(--pm-line);
	border-radius: 14px;
	padding: .8rem .9rem;
}
.m-summary-bar span {
	display: block;
	font-size: .75rem;
	color: var(--pm-muted);
	font-weight: 600;
}
.m-summary-bar strong {
	font-family: var(--pm-display);
	font-size: 1.25rem;
	color: var(--pm-green-dark);
}

.m-day-list { display: flex; flex-direction: column; gap: .55rem; }
.m-day {
	background: #fff;
	border: 1px solid var(--pm-line);
	border-radius: 14px;
	overflow: hidden;
}
.m-day > summary {
	list-style: none;
	display: flex;
	align-items: center;
	gap: .7rem;
	padding: .8rem .85rem;
	cursor: pointer;
}
.m-day > summary::-webkit-details-marker { display: none; }
.m-day.is-sunday { background: #fff4e8; }
.m-day.no-entry { opacity: .72; }
.m-day.has-entry > summary { cursor: pointer; }
.m-day-left {
	width: 44px;
	height: 44px;
	border-radius: 12px;
	background: var(--pm-green-soft);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.m-day-left strong { font-size: 1.05rem; line-height: 1; }
.m-day-left span { font-size: .65rem; color: var(--pm-muted); }
.m-day-mid { flex: 1; min-width: 0; }
.m-day-menu {
	font-weight: 600;
	font-size: .95rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.m-day-stats { font-size: .8rem; color: var(--pm-muted); margin-top: .1rem; }
.m-chev { color: var(--pm-muted); font-size: 1.3rem; }
.m-day-body {
	border-top: 1px solid var(--pm-line);
	padding: .35rem .75rem .75rem;
}
.m-qty-row {
	display: flex;
	justify-content: space-between;
	gap: .75rem;
	padding: .45rem 0;
	border-bottom: 1px solid #eef3f0;
	font-size: .92rem;
}
.m-qty-row:last-child { border-bottom: 0; }
.m-qty-row strong { white-space: nowrap; color: var(--pm-green-dark); }

.masters-tabs .nav-link {
	white-space: nowrap;
	border-radius: 999px;
	background: #fff;
	border: 1px solid var(--pm-line);
	color: var(--pm-ink);
	font-weight: 600;
	padding: .45rem .9rem;
}
.masters-tabs .nav-link.active {
	background: var(--pm-green);
	border-color: var(--pm-green);
	color: #fff;
}

@media (min-width: 992px) {
	.fab-new { display: none !important; }
	.diary-mobile { display: none !important; }
}
