/* =====================================================================
   Timber ERP - UI theme
   Desktop: top-bar admin panel. Mobile (< 992px): app shell with bottom tabs.
   ===================================================================== */
:root {
	--brand: #0f5f4a;
	--brand-600: #0b4d3c;
	--brand-700: #093d30;
	--brand-50: #e8f3ef;
	--brand-100: #cfe7de;
	--accent: #e39b16;
	--accent-50: #fdf3e0;
	--bg: #f2f4f6;
	--surface: #ffffff;
	--surface-2: #f8fafb;
	--text: #1c2530;
	--muted: #6a7686;
	--border: #e2e7ec;
	--danger: #d4433b;
	--success: #1d8a5a;
	--warning: #c98a07;
	--info: #2779bd;
	--radius: 14px;
	--radius-sm: 10px;
	--shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
	--shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 6px 16px rgba(16, 24, 40, .06);
	--shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);
	--topbar-h: 60px;
	--bottomnav-h: 64px;
	--font: "Inter", "Noto Sans Devanagari", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--bs-primary: var(--brand);
	--bs-primary-rgb: 15, 95, 74;
	--bs-link-color: var(--brand);
	--bs-link-color-rgb: 15, 95, 74;
	--bs-link-hover-color: var(--brand-700);
	--bs-body-font-family: var(--font);
	--bs-border-color: var(--border);
}

html { -webkit-text-size-adjust: 100%; }
body {
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: 14px;
	min-height: 100vh;
	-webkit-tap-highlight-color: transparent;
}
a { text-decoration: none; }
.hi { font-family: "Noto Sans Devanagari", var(--font); font-size: .82em; color: var(--muted); font-weight: 500; margin-left: .25rem; }
.btn .hi, .topbar .hi, .badge .hi { color: inherit; opacity: .8; }
.text-muted { color: var(--muted) !important; }
.fw-600 { font-weight: 600; }
.small-xs { font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Bootstrap overrides ---------- */
.btn { border-radius: var(--radius-sm); font-weight: 500; padding: .5rem 1rem; }
.btn-sm { padding: .3rem .7rem; border-radius: 8px; }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-600); --bs-btn-hover-border-color: var(--brand-600);
	--bs-btn-active-bg: var(--brand-700); --bs-btn-active-border-color: var(--brand-700); --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand); }
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand);
	--bs-btn-active-bg: var(--brand-600); --bs-btn-active-border-color: var(--brand-600); }
.btn-accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-accent:hover { background: #c98510; color: #fff; }
.btn-light { background: #fff; border-color: var(--border); }
.btn-soft { background: var(--brand-50); color: var(--brand); border: 0; }
.btn-soft:hover { background: var(--brand-100); color: var(--brand-700); }
.btn-icon { width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.form-control, .form-select { border-radius: var(--radius-sm); border-color: var(--border); padding: .5rem .75rem; font-size: 14px; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(15, 95, 74, .15); }
.form-label { font-weight: 600; font-size: 13px; color: #3b4654; margin-bottom: .3rem; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-text { font-size: 12px; }
.input-group-text { background: var(--surface-2); border-color: var(--border); border-radius: var(--radius-sm); }
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .65rem .75rem; border-bottom-color: var(--border); vertical-align: middle; }
.table thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; background: var(--surface-2); white-space: nowrap; }
.table-hover tbody tr:hover > * { background: #f6faf8; }
.table tfoot td, .table tfoot th { font-weight: 700; background: var(--surface-2); }
.dropdown-menu { border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: .4rem; font-size: 14px; }
.dropdown-item { border-radius: 8px; padding: .5rem .75rem; display: flex; align-items: center; gap: .6rem; }
.dropdown-item i { color: var(--muted); font-size: 1rem; width: 1.1rem; text-align: center; }
.dropdown-item:active, .dropdown-item.active { background: var(--brand-50); color: var(--brand-700); }
.dropdown-item:active i { color: var(--brand); }
.dropdown-header { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--muted); }
.badge { font-weight: 600; }
.badge-soft-success { background: #e3f4ec !important; color: #157347 !important; }
.badge-soft-danger { background: #fde8e7 !important; color: #b02a22 !important; }
.badge-soft-warning { background: #fdf3dc !important; color: #946200 !important; }
.badge-soft-secondary { background: #eceff3 !important; color: #4b5563 !important; }
.badge-soft-primary { background: var(--brand-50) !important; color: var(--brand) !important; }
.badge-soft-info { background: #e5f0fa !important; color: #1f5f96 !important; }
.alert { border-radius: var(--radius-sm); border: 0; }
.modal-content { border: 0; border-radius: 18px; box-shadow: var(--shadow-lg); }
.nav-pills .nav-link { border-radius: 999px; color: var(--muted); font-weight: 500; }
.nav-pills .nav-link.active { background: var(--brand); }

/* ---------- Top bar (desktop) ---------- */
.topbar {
	position: sticky; top: 0; z-index: 1030; height: var(--topbar-h);
	background: linear-gradient(100deg, #0a3a2d 0%, #0f5f4a 60%, #127055 100%);
	color: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
}
.topbar-inner { height: 100%; display: flex; align-items: center; gap: 1rem; padding: 0 1.25rem; }
.brand { display: flex; align-items: center; gap: .6rem; color: #fff; font-weight: 700; font-size: 16px; white-space: nowrap; }
.brand:hover { color: #fff; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); display: inline-flex; align-items: center; justify-content: center;
	color: #fff; font-size: 18px; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .15); flex-shrink: 0; overflow: hidden; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand small { display: block; font-weight: 500; font-size: 11px; opacity: .7; line-height: 1; }
.brand-text { line-height: 1.15; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }

.mainnav { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; }
.mainnav > .dropdown > .nav-top, .mainnav > .nav-top {
	color: rgba(255, 255, 255, .82); padding: .5rem .7rem; border-radius: 10px; display: flex; align-items: center; gap: .4rem;
	font-weight: 500; white-space: nowrap; transition: background .15s, color .15s; border: 0; background: transparent; font-size: 14px;
}
.mainnav .nav-top:hover, .mainnav .show > .nav-top { background: rgba(255, 255, 255, .1); color: #fff; }
.mainnav .nav-top.active { background: rgba(255, 255, 255, .16); color: #fff; box-shadow: inset 0 -2px 0 var(--accent); }
.mainnav .nav-top i { font-size: 15px; }
.mainnav .nav-top.dropdown-toggle::after { border-top-width: .3em; opacity: .6; margin-left: .1rem; }
.mainnav .dropdown-menu { margin-top: 8px !important; min-width: 240px; }
.mainnav .dropdown-menu.mega { min-width: 460px; }
.mainnav .dropdown-menu.mega .mega-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .25rem; }

.top-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.top-actions .btn-new { background: var(--accent); color: #fff; border: 0; border-radius: 10px; font-weight: 600; padding: .45rem .9rem; }
.top-actions .btn-new:hover { background: #c98510; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, .18); color: #fff; display: inline-flex;
	align-items: center; justify-content: center; font-weight: 700; font-size: 13px; border: 2px solid rgba(255, 255, 255, .3); }
.user-btn { display: flex; align-items: center; gap: .5rem; color: #fff; background: transparent; border: 0; padding: .2rem .4rem; border-radius: 10px; }
.user-btn:hover { background: rgba(255, 255, 255, .1); }
.user-btn .meta { text-align: left; line-height: 1.1; }
.user-btn .meta small { opacity: .7; font-size: 11px; display: block; }

/* ---------- Page bar ---------- */
.pagebar { background: var(--surface); border-bottom: 1px solid var(--border); }
.pagebar-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 1.5rem; flex-wrap: wrap; }
.pagebar h1 { font-size: 20px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.pagebar .crumbs { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.pagebar .crumbs a { color: var(--muted); }
.pagebar .crumbs a:hover { color: var(--brand); }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.app-main { padding: 1.25rem 1.5rem 2rem; max-width: 1600px; margin: 0 auto; }

/* ---------- Cards & panels ---------- */
.card { border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); background: var(--surface); }
.card-header { background: transparent; border-bottom: 1px solid var(--border); padding: .9rem 1.1rem; font-weight: 700; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.card-header .card-title { margin: 0; font-size: 15px; font-weight: 700; }
.card-body { padding: 1.1rem; }
.card-footer { background: var(--surface-2); border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius) !important; }
.section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 .75rem; }

.stat { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); padding: 1rem 1.1rem; height: 100%;
	display: flex; gap: .9rem; align-items: center; box-shadow: var(--shadow-sm); color: var(--text); transition: transform .15s, box-shadow .15s; }
a.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: var(--text); }
.stat .ic { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 21px; flex-shrink: 0; }
.stat .lbl { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.stat .val { font-size: 21px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.stat .sub { font-size: 12px; color: var(--muted); }
.ic-green { background: #e3f4ec; color: #157347; }
.ic-amber { background: var(--accent-50); color: #b97800; }
.ic-blue { background: #e5f0fa; color: #1f5f96; }
.ic-red { background: #fde8e7; color: #b02a22; }
.ic-purple { background: #efe9fb; color: #6941c6; }
.ic-teal { background: var(--brand-50); color: var(--brand); }

.quick-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .75rem; }
.qa { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .45rem; padding: 1rem .5rem; border-radius: var(--radius);
	background: var(--surface); border: 1px solid var(--border); color: var(--text); font-weight: 600; font-size: 13px; text-align: center; transition: all .15s; }
.qa i { font-size: 22px; width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center; }
.qa:hover { border-color: var(--brand); color: var(--brand); box-shadow: var(--shadow); }

.filter-bar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem; margin-bottom: 1rem; }
.filter-bar .form-control, .filter-bar .form-select { min-width: 0; }

.list-card { border-radius: var(--radius); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty-state i { font-size: 40px; opacity: .45; display: block; margin-bottom: .5rem; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: .35rem .75rem; font-size: 14px; }
.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { margin: 0; font-weight: 600; }
.totals-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .75rem 1rem; }
.totals-box .row-t { display: flex; justify-content: space-between; padding: .25rem 0; font-variant-numeric: tabular-nums; }
.totals-box .row-t.grand { border-top: 1px dashed var(--border); margin-top: .35rem; padding-top: .6rem; font-size: 18px; font-weight: 800; color: var(--brand-700); }
.amount-due { color: var(--danger); font-weight: 700; }
.amount-ok { color: var(--success); font-weight: 700; }
.cancel-ribbon { background: #fde8e7; color: #b02a22; border-radius: var(--radius-sm); padding: .75rem 1rem; font-weight: 600; }

/* Line items editor */
.items-table td { padding: .4rem .45rem !important; }
.items-table .form-control, .items-table .form-select { padding: .4rem .55rem; }
.items-table .col-qty { width: 110px; }
.items-table .col-rate { width: 120px; }
.items-table .col-amt { width: 130px; }
.items-table .col-x { width: 44px; }
.btn-remove-row { color: var(--danger); background: #fde8e7; border: 0; width: 32px; height: 32px; border-radius: 8px; }
.hint-chip { display: inline-flex; align-items: center; gap: .3rem; font-size: 12px; background: var(--brand-50); color: var(--brand-700); border-radius: 999px; padding: .15rem .6rem; }
.warn-chip { background: var(--accent-50); color: #8a5a00; }
.sticky-submit { position: sticky; bottom: 0; background: rgba(242, 244, 246, .92); backdrop-filter: blur(6px); padding: .75rem 0; z-index: 5; border-top: 1px solid var(--border); margin-top: 1rem; }

/* Tom Select (bootstrap5 theme puts the border on the wrapper) */
.ts-wrapper.form-select, .ts-wrapper.form-control { border-radius: var(--radius-sm); border-color: var(--border); }
.ts-wrapper.form-select.focus, .ts-wrapper.form-control.focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(15, 95, 74, .15); }
.ts-wrapper .ts-control { font-size: 14px; }
.ts-dropdown { border-radius: 12px; box-shadow: var(--shadow-lg); border-color: var(--border); font-size: 14px; }
.ts-dropdown .active { background: var(--brand-50); color: var(--brand-700); }
.ts-dropdown .option small { color: var(--muted); }

/* Toasts */
.toast-stack { position: fixed; top: calc(var(--topbar-h) + 12px); right: 16px; z-index: 1090; display: flex; flex-direction: column; gap: .5rem; max-width: 380px; }
.app-toast { background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); padding: .8rem 1rem; display: flex; gap: .7rem; align-items: flex-start;
	border-left: 4px solid var(--success); animation: toastIn .25s ease-out; font-size: 14px; }
.app-toast.error { border-left-color: var(--danger); }
.app-toast.warning { border-left-color: var(--accent); }
.app-toast i { font-size: 18px; }
.app-toast.success i { color: var(--success); }
.app-toast.error i { color: var(--danger); }
.app-toast.warning i { color: var(--accent); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- Mobile shell ---------- */
.bottomnav, .appbar-back, .more-sheet-grid { display: none; }

@media (max-width: 1699.98px) {
	.user-btn .meta { display: none; }
	.brand-text { max-width: 170px; }
	.mainnav > .dropdown > .nav-top, .mainnav > .nav-top { padding: .5rem .55rem; font-size: 13.5px; }
}
@media (max-width: 1499.98px) {
	.mainnav .nav-top i { display: none; }
	.top-actions .btn-new { padding: .45rem .7rem; }
}
@media (max-width: 1199.98px) {
	.brand-text { display: none; }
	.mainnav > .dropdown > .nav-top, .mainnav > .nav-top { padding: .45rem .45rem; font-size: 13px; }
}

@media (max-width: 991.98px) {
	:root { --topbar-h: 56px; }
	body { padding-bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom)); background: #eef1f4; }
	.topbar { background: var(--brand); padding-top: env(safe-area-inset-top); height: calc(var(--topbar-h) + env(safe-area-inset-top)); }
	.topbar-inner { padding: 0 .5rem 0 .75rem; gap: .5rem; }
	.mainnav, .top-actions .btn-new, .brand-text { display: none !important; }
	.appbar-back { display: inline-flex; color: #fff; font-size: 22px; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 50%; }
	.appbar-back:active { background: rgba(255, 255, 255, .15); }
	.appbar-title { flex: 1; min-width: 0; color: #fff; font-weight: 700; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
	.pagebar h1, .pagebar .crumbs { display: none; }
	.pagebar { background: transparent; border: 0; }
	.pagebar-inner { padding: .6rem .75rem 0; }
	.pagebar-inner:empty, .pagebar-inner.no-actions { display: none; }
	.page-actions { width: 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
	.page-actions::-webkit-scrollbar { display: none; }
	.page-actions .btn { white-space: nowrap; border-radius: 999px; padding: .4rem .9rem; font-size: 13px; }
	.app-main { padding: .75rem .75rem 1.5rem; }
	.card { border-radius: 16px; border: 0; box-shadow: var(--shadow-sm); }
	.card-header { padding: .8rem .9rem; }
	.card-body { padding: .9rem; }
	.stat { border: 0; padding: .85rem; gap: .7rem; }
	.stat .ic { width: 40px; height: 40px; font-size: 18px; border-radius: 11px; }
	.stat .val { font-size: 18px; }
	.filter-bar { border: 0; border-radius: 16px; }
	.kv { grid-template-columns: 110px 1fr; }
	.toast-stack { left: 12px; right: 12px; max-width: none; top: calc(var(--topbar-h) + env(safe-area-inset-top) + 8px); }
	.sticky-submit { bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom)); margin-left: -.75rem; margin-right: -.75rem; padding: .6rem .75rem; }
	.sticky-submit .btn { flex: 1; }

	/* Bottom navigation */
	.bottomnav {
		display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1035; height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom));
		padding-bottom: env(safe-area-inset-bottom); background: #fff; border-top: 1px solid var(--border); box-shadow: 0 -4px 16px rgba(16, 24, 40, .06);
	}
	.bottomnav a, .bottomnav button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
		font-size: 11px; color: var(--muted); font-weight: 600; border: 0; background: transparent; }
	.bottomnav a i, .bottomnav button i { font-size: 21px; line-height: 1; }
	.bottomnav a.active { color: var(--brand); }
	.bottomnav .fab-wrap { position: relative; }
	.bottomnav .fab { flex: 0 0 54px; width: 54px; height: 54px; gap: 0; border-radius: 18px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center;
		margin-top: -26px; box-shadow: 0 6px 16px rgba(227, 155, 22, .45); font-size: 26px; }

	/* Bottom sheets */
	.offcanvas-bottom.sheet { height: auto; max-height: 86vh; border-radius: 22px 22px 0 0; border: 0; padding-bottom: env(safe-area-inset-bottom); }
	.sheet .offcanvas-header { padding: .5rem 1rem 0; flex-direction: column; }
	.sheet .grabber { width: 40px; height: 5px; border-radius: 3px; background: #d5dbe1; margin: .25rem auto .5rem; }
	.more-sheet-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem .25rem; }
	.more-sheet-grid a { display: flex; flex-direction: column; align-items: center; gap: .35rem; font-size: 11.5px; color: var(--text); text-align: center; font-weight: 500; line-height: 1.2; }
	.more-sheet-grid a i { width: 48px; height: 48px; border-radius: 15px; display: flex; align-items: center; justify-content: center; font-size: 21px; }
	.sheet-section { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 1rem 0 .6rem; }


	/* Form screens: hide the tab bar so the save bar sits at the bottom like a native app */
	body:has(.sticky-submit) .bottomnav { display: none; }
	body:has(.sticky-submit) { padding-bottom: env(safe-area-inset-bottom); }
	body:has(.sticky-submit) .sticky-submit { bottom: 0; padding-bottom: calc(.6rem + env(safe-area-inset-bottom)); }
	.sticky-submit .btn { white-space: nowrap; padding-left: .6rem; padding-right: .6rem; }
	.sticky-submit a.btn-light { display: none; }
	.sticky-submit > span.me-auto { display: none; }

	/* Compact quick actions & stats */
	.quick-actions { grid-template-columns: repeat(4, 1fr); gap: .5rem; }
	.qa { padding: .65rem .25rem; font-size: 11px; font-weight: 600; border: 0; box-shadow: var(--shadow-sm); border-radius: 14px; line-height: 1.2; }
	.qa i { width: 40px; height: 40px; font-size: 19px; border-radius: 12px; }
	.stat .lbl { font-size: 10.5px; }
	.stat .sub { font-size: 11px; }
	.table-cards td .td-val { text-align: right; min-width: 0; }

	/* Tables become cards */
	.table-cards thead { display: none; }
	.table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
	.table-cards tr { background: #fff; border-radius: 14px; margin-bottom: .6rem; padding: .7rem .85rem; box-shadow: var(--shadow-sm); position: relative; border: 1px solid var(--border); }
	.table-cards tbody tr:hover > * { background: transparent; }
	.table-cards > :not(caption) > * > * { border: 0; padding: .18rem 0 !important; }
	.table-cards td[data-label] { display: flex; justify-content: space-between; gap: 1rem; text-align: right; }
	.table-cards td[data-label]::before { content: attr(data-label); color: var(--muted); font-weight: 500; text-align: left; font-size: 12.5px; flex-shrink: 0; }
	.table-cards td.td-title { font-size: 15px; font-weight: 700; padding-bottom: .35rem !important; text-align: left; justify-content: flex-start; }
	.table-cards td.td-title::before { display: none; }
	.table-cards td.td-actions { justify-content: flex-end; padding-top: .5rem !important; border-top: 1px dashed var(--border) !important; margin-top: .35rem; }
	.table-cards td.td-actions::before { display: none; }
	.table-cards td:empty { display: none; }
	.table-cards tfoot { display: block; }
	.table-cards tfoot tr { background: var(--brand-50); }
	.card > .table-wrap > .table-cards, .card > .table-cards { padding: .5rem; }
	.card:has(> .table-wrap > .table-cards) { background: transparent; box-shadow: none; }
	.card:has(> .table-wrap > .table-cards) > .card-header { background: #fff; border-radius: 16px; margin-bottom: .5rem; border: 0; }
	.card > .table-wrap > .table-cards { padding: 0; }

	/* Line-item editors stack */
	.items-table thead { display: none; }
	.items-table, .items-table tbody, .items-table tr { display: block; width: 100%; }
	.items-table tr.item-row { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: .65rem; margin-bottom: .6rem; position: relative; }
	.items-table tr.item-row td { display: block; width: auto !important; padding: 0 !important; border: 0; }
	.items-table tr.item-row td.col-item { grid-column: 1 / -1; padding-right: 40px !important; }
	.items-table tr.item-row td.col-x { position: absolute; top: .65rem; right: .65rem; }
	.items-table tr.item-row td[data-label]::before { content: attr(data-label); display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
	.items-table tfoot, .items-table tfoot tr, .items-table tfoot td { display: block; }
	.form-control, .form-select, .ts-control { font-size: 16px !important; } /* avoid iOS zoom */
}

@media (min-width: 992px) {
	.mainnav .dropdown:hover > .dropdown-menu { display: block; }
	.mainnav .dropdown > .dropdown-menu { top: 100%; left: 0; }
	.appbar-title { display: none; }
}

/* ---------- Login ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: #fff; }
.auth-hero { background: linear-gradient(140deg, #082f25 0%, #0f5f4a 55%, #16795d 100%); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-hero::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%;
	background: repeating-radial-gradient(circle, rgba(255, 255, 255, .06) 0 2px, transparent 2px 22px); }
.auth-hero h2 { font-weight: 800; font-size: 34px; letter-spacing: -.02em; max-width: 460px; }
.auth-hero .feat { display: flex; gap: .75rem; align-items: center; margin-bottom: .9rem; opacity: .92; }
.auth-hero .feat i { width: 36px; height: 36px; border-radius: 10px; background: rgba(255, 255, 255, .12); display: flex; align-items: center; justify-content: center; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 2rem; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card .form-control { padding: .7rem .9rem; }
@media (max-width: 991.98px) {
	.auth-wrap { grid-template-columns: 1fr; background: var(--brand); }
	.auth-hero { padding: 2.5rem 1.5rem 4rem; min-height: auto; }
	.auth-hero .feats, .auth-hero .foot { display: none; }
	.auth-hero h2 { font-size: 24px; }
	.auth-form { background: #fff; border-radius: 26px 26px 0 0; margin-top: -2rem; position: relative; z-index: 2; align-items: flex-start; padding: 2rem 1.5rem; }
}

/* ---------- Print helpers ---------- */
@media print {
	.topbar, .pagebar, .bottomnav, .no-print, .toast-stack, .sticky-submit { display: none !important; }
	body { background: #fff; padding: 0; }
	.app-main { padding: 0; }
	.card { border: 0; box-shadow: none; }
}
