/* Layer 1 — structure + mockup defaults. Tenant tokens (layer 2) and custom CSS (layer 3) override --bp-* except status colours. */

:root,
.bp-root {
	--bp-primary: #4B3FA8;
	--bp-primary-600: #5B4CC7;
	--bp-primary-050: #EFEDFB;
	--bp-bg: #E7EAF2;
	--bp-surface: #FFFFFF;
	--bp-ink: #2C2A4A;
	--bp-ink-2: #4C4A6B;
	--bp-muted: #9AA1C0;
	--bp-faint: #C3C8DD;
	--bp-line: #EDEFF7;
	--bp-cyan: #6ED3E0;
	--bp-cyan-050: #E2F7FA;
	--bp-green: #3FBF95;
	--bp-green-050: #E4F7F1;
	--bp-amber: #F0B54B;
	--bp-amber-050: #FDF3E2;
	--bp-red: #E45C5C;
	--bp-red-050: #FCEAEA;
	--bp-coral: #F58A6F;
	--bp-coral-050: #FDEDE8;
	--bp-font-heading: 'Poppins', ui-sans-serif, -apple-system, 'Segoe UI', Roboto, sans-serif;
	--bp-font-body: 'Poppins', ui-sans-serif, -apple-system, 'Segoe UI', Roboto, sans-serif;
	--bp-radius-sm: 10px;
	--bp-radius: 14px;
	--bp-radius-lg: 18px;
	--bp-radius-xl: 24px;
	--bp-shadow: 0 10px 30px rgba(72, 66, 140, .07);
	--bp-shadow-sm: 0 4px 14px rgba(72, 66, 140, .06);
	--bp-rail: 240px;
}

.bp-root,
.bp-root * {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	padding: 0;
	height: 100%;
}

.bp-root {
	font-family: var(--bp-font-body);
	background: var(--bp-bg);
	color: var(--bp-ink);
	-webkit-font-smoothing: antialiased;
	min-height: 100dvh;
}

.bp-root.bp-app {
	display: grid;
	grid-template-rows: auto 1fr;
	height: 100dvh;
	width: 100%;
	background: var(--bp-surface);
}

.bp-root :focus-visible {
	outline: 2px solid var(--bp-primary-600);
	outline-offset: 2px;
	border-radius: 6px;
}

/* ---------- top bar ---------- */
.bp-top {
	display: grid;
	grid-template-columns: var(--bp-rail) 1fr auto;
	align-items: center;
	gap: 18px;
	padding: 18px 30px 18px 26px;
	border-bottom: 1px solid var(--bp-line);
	background: var(--bp-surface);
	position: relative;
	z-index: 40;
}

.bp-brand {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
}

.bp-brand-mark {
	width: 42px;
	height: 42px;
	border-radius: var(--bp-radius);
	background: linear-gradient(150deg, var(--bp-primary-600), var(--bp-primary));
	display: grid;
	place-items: center;
	box-shadow: 0 6px 16px rgba(75, 63, 168, .35);
	flex: none;
	overflow: hidden;
	color: #fff;
	font-weight: 700;
	font-size: 14px;
	font-family: var(--bp-font-heading);
}

.bp-brand-mark img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.bp-brand-name {
	font-weight: 700;
	font-size: 19px;
	letter-spacing: .16em;
	color: var(--bp-primary);
	font-family: var(--bp-font-heading);
	line-height: 1.1;
}

.bp-brand-sub {
	font-size: 10px;
	letter-spacing: .14em;
	color: var(--bp-faint);
	font-weight: 500;
	margin-top: -2px;
}

.bp-page h1,
.bp-crumb h1 {
	font-size: 20px;
	font-weight: 600;
	margin: 0;
	white-space: nowrap;
	font-family: var(--bp-font-heading);
}

.bp-ctx,
.bp-crumb .bp-ctx {
	font-size: 12.5px;
	color: var(--bp-muted);
}

.bp-tools {
	display: flex;
	align-items: center;
	gap: 12px;
}

.bp-acct {
	display: flex;
	align-items: center;
	gap: 10px;
	background: #F6F7FC;
	border-radius: 12px;
	padding: 8px 13px;
	font-size: 12.5px;
	font-weight: 500;
	color: var(--bp-ink-2);
}

.bp-icon {
	position: relative;
	width: 38px;
	height: 38px;
	border-radius: 12px;
	display: grid;
	place-items: center;
	border: 0;
	background: transparent;
	cursor: pointer;
	color: var(--bp-primary-600);
	padding: 0;
	font: inherit;
}

.bp-icon:hover {
	background: #F3F4FA;
}

.bp-badge {
	position: absolute;
	top: 5px;
	right: 6px;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--bp-coral);
	border: 2px solid #fff;
	display: none;
}

.bp-badge.on {
	display: block;
}

.bp-avatar-btn {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 3px 6px 3px 3px;
	border-radius: 26px;
	border: 0;
	background: transparent;
	cursor: pointer;
	font: inherit;
	color: inherit;
}

.bp-avatar-btn:hover {
	background: #F3F4FA;
}

.bp-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	font-weight: 600;
	font-size: 13px;
	color: #fff;
	flex: none;
	background: linear-gradient(140deg, var(--bp-primary-600), var(--bp-primary));
}

.bp-pop {
	position: absolute;
	top: 66px;
	right: 24px;
	width: 310px;
	background: #fff;
	border-radius: var(--bp-radius-lg);
	box-shadow: 0 20px 46px rgba(60, 55, 120, .18);
	padding: 8px;
	z-index: 60;
	display: none;
}

.bp-pop.open {
	display: block;
}

.bp-pop h4 {
	margin: 8px 10px 6px;
	font-size: 12px;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--bp-muted);
}

.bp-pop-item {
	display: flex;
	gap: 11px;
	padding: 10px;
	border-radius: 12px;
	align-items: flex-start;
	width: 100%;
	text-align: left;
	border: 0;
	background: transparent;
	cursor: pointer;
	font: inherit;
	color: inherit;
}

.bp-pop-item:hover {
	background: #F6F7FC;
}

.bp-pop-item p {
	margin: 0;
	font-size: 12.5px;
	line-height: 1.45;
	color: var(--bp-ink-2);
}

.bp-pop-item span.bp-pop-meta {
	font-size: 11px;
	color: var(--bp-muted);
}

/* ---------- body + rail ---------- */
.bp-body {
	display: grid;
	grid-template-columns: var(--bp-rail) 1fr;
	min-height: 0;
}

.bp-side {
	border-right: 1px solid var(--bp-line);
	padding: 22px 16px;
	display: flex;
	flex-direction: column;
	gap: 2px;
	background: var(--bp-surface);
	min-height: 0;
}

.bp-nav {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.bp-nav-label {
	font-size: 10px;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--bp-faint);
	font-weight: 600;
	margin: 16px 12px 8px;
}

.bp-nav-item {
	display: flex;
	align-items: center;
	gap: 13px;
	padding: 11px 12px;
	border-radius: 13px;
	font-size: 13.5px;
	font-weight: 500;
	color: var(--bp-muted);
	width: 100%;
	text-align: left;
	border: 0;
	background: transparent;
	cursor: pointer;
	font-family: inherit;
	transition: .15s;
}

.bp-nav-item:hover {
	background: #F6F7FC;
	color: var(--bp-ink-2);
}

.bp-nav-item.active {
	background: var(--bp-primary-050);
	color: var(--bp-primary);
	font-weight: 600;
}

.bp-nav-item.active svg {
	stroke: var(--bp-primary);
}

.bp-nav-item .bp-nav-count {
	margin-left: auto;
	font-size: 11px;
	background: var(--bp-red);
	color: #fff;
	border-radius: 20px;
	padding: 1px 7px;
	font-weight: 600;
}

.bp-main {
	padding: 26px 30px 40px;
	overflow: auto;
	background: linear-gradient(180deg, #FCFCFE, #fff);
	min-width: 0;
}

/* ---------- buttons ---------- */
.bp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: var(--bp-primary);
	color: #fff;
	border-radius: 12px;
	padding: 11px 18px;
	font-size: 13px;
	font-weight: 600;
	font-family: inherit;
	border: 0;
	cursor: pointer;
	box-shadow: 0 8px 18px rgba(75, 63, 168, .28);
	transition: .15s;
}

.bp-btn:hover {
	background: var(--bp-primary-600);
}

.bp-btn.sm {
	padding: 9px 14px;
	font-size: 12.5px;
	border-radius: 11px;
}

.bp-btn.ghost {
	background: #fff;
	color: var(--bp-primary);
	box-shadow: inset 0 0 0 1.5px var(--bp-primary-050);
}

.bp-btn.ghost:hover {
	background: var(--bp-primary-050);
}

.bp-btn.quiet {
	background: #F3F4FA;
	color: var(--bp-ink-2);
	box-shadow: none;
}

.bp-btn.full {
	width: 100%;
}

.bp-btn[disabled] {
	opacity: .45;
	pointer-events: none;
	box-shadow: none;
}

/* ---------- cards / type ---------- */
.bp-card {
	background: var(--bp-surface);
	border-radius: 22px;
	box-shadow: var(--bp-shadow);
	padding: 20px;
	margin-bottom: 18px;
}

.bp-card h3 {
	font-size: 15px;
	font-weight: 600;
	margin: 0 0 14px;
	font-family: var(--bp-font-heading);
}

.bp-section-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: 0 0 14px;
	gap: 12px;
}

.bp-section-head h2,
.bp-section-head h3 {
	margin: 0;
}

.bp-grid-2 {
	display: grid;
	grid-template-columns: 1fr 340px;
	gap: 24px;
	align-items: start;
}

.bp-mono {
	font-variant-numeric: tabular-nums;
}

/* ---------- hero / balance ---------- */
.bp-hero {
	position: relative;
	overflow: hidden;
	border-radius: 22px;
	padding: 26px;
	color: #fff;
	background: linear-gradient(140deg, var(--bp-primary-600) 0%, var(--bp-primary) 100%);
	box-shadow: 0 16px 34px rgba(67, 54, 143, .28);
	margin-bottom: 22px;
}

.bp-hero.due {
	background: linear-gradient(140deg, #E4694F 0%, #C4432F 100%);
	box-shadow: 0 16px 34px rgba(196, 67, 47, .26);
}

.bp-hero.ok {
	background: linear-gradient(140deg, #2E9B78 0%, #1E7A5C 100%);
	box-shadow: 0 16px 34px rgba(30, 122, 92, .22);
}

.bp-hero-arcs {
	position: absolute;
	right: -40px;
	bottom: -80px;
	opacity: .4;
	pointer-events: none;
}

.bp-hero-lbl {
	font-size: 13.5px;
	opacity: .85;
	position: relative;
}

.bp-hero-big,
.bp-balance {
	font-size: 44px;
	font-weight: 700;
	letter-spacing: -.02em;
	line-height: 1;
	position: relative;
	font-variant-numeric: tabular-nums;
	margin: 8px 0 6px;
}

.bp-hero-ctx {
	font-size: 13px;
	opacity: .88;
	position: relative;
}

.bp-hero-acts {
	display: flex;
	gap: 10px;
	position: relative;
	margin-top: 20px;
	flex-wrap: wrap;
}

.bp-hero-acts .bp-btn {
	background: #fff;
	color: var(--bp-ink);
	box-shadow: none;
}

.bp-hero-acts .bp-btn.o {
	background: rgba(255, 255, 255, .16);
	color: #fff;
}

.bp-welcome {
	font-size: 13.5px;
	color: var(--bp-ink-2);
	margin: 0 0 16px;
}

.bp-claim {
	background: var(--bp-amber-050);
	border-radius: 14px;
	padding: 14px 16px;
	margin-bottom: 16px;
	font-size: 12.5px;
	color: #B9822A;
	line-height: 1.55;
}

.bp-hint {
	display: flex;
	gap: 12px;
	background: var(--bp-cyan-050);
	border-radius: 14px;
	padding: 14px 16px;
	font-size: 12.5px;
	color: #22707C;
	line-height: 1.55;
	margin-bottom: 18px;
}

.bp-note {
	white-space: pre-wrap;
	margin: 0 0 12px;
	font-size: 13.5px;
	line-height: 1.6;
	color: var(--bp-ink-2);
}

.bp-kv {
	display: flex;
	justify-content: space-between;
	gap: 14px;
	padding: 11px 0;
	border-bottom: 1px solid var(--bp-line);
	font-size: 12.5px;
}

.bp-kv:last-child {
	border-bottom: none;
}

.bp-kv span {
	color: var(--bp-muted);
}

.bp-kv strong {
	font-weight: 600;
}

/* ---------- chips / filters / status ---------- */
.bp-filters {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-bottom: 16px;
}

.bp-chip {
	padding: 8px 14px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 500;
	color: var(--bp-muted);
	background: #F6F7FC;
	border: 0;
	cursor: pointer;
	font-family: inherit;
}

.bp-chip.on {
	background: var(--bp-primary);
	color: #fff;
}

.bp-status,
.bp-chip.gr,
.bp-status.paid {
	display: inline-flex;
	align-items: center;
	font-size: 11px;
	font-weight: 600;
	padding: 5px 10px;
	border-radius: 20px;
	background: var(--bp-green-050);
	color: #1E9773;
}

.bp-status.unpaid,
.bp-chip.co {
	background: var(--bp-coral-050);
	color: #D2603F;
}

.bp-status.pastdue,
.bp-chip.rd {
	background: var(--bp-red-050);
	color: #C93F3F;
}

.bp-status.partial,
.bp-chip.am {
	background: var(--bp-amber-050);
	color: #B9822A;
}

.bp-chip.pri {
	background: var(--bp-primary-050);
	color: var(--bp-primary);
}

.bp-chip.gy {
	background: #F3F4FA;
	color: var(--bp-muted);
}

/* ---------- lists / tables ---------- */
.bp-inv {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 0;
	border-bottom: 1px solid var(--bp-line);
	align-items: flex-start;
}

.bp-inv:last-child {
	border-bottom: 0;
}

.bp-stack {
	display: none;
}

.bp-table-wrap {
	overflow: auto;
}

.bp-table {
	width: 100%;
	border-collapse: collapse;
}

.bp-table thead th {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .05em;
	text-transform: uppercase;
	color: var(--bp-muted);
	text-align: left;
	padding: 12px 14px;
	background: #F8F9FD;
}

.bp-table thead th:first-child {
	border-radius: 12px 0 0 12px;
}

.bp-table thead th:last-child {
	border-radius: 0 12px 12px 0;
}

.bp-table tbody td {
	padding: 14px;
	font-size: 13px;
	border-bottom: 1px solid var(--bp-line);
	color: var(--bp-ink-2);
}

.bp-table tbody tr:last-child td {
	border-bottom: none;
}

.bp-table .bp-num {
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.bp-strong {
	font-weight: 600;
	color: var(--bp-ink);
}

/* ---------- fields ---------- */
.bp-field {
	margin-bottom: 16px;
}

.bp-field label {
	display: block;
	font-size: 11.5px;
	font-weight: 600;
	color: var(--bp-muted);
	margin-bottom: 7px;
}

.bp-root .bp-field input,
.bp-root .bp-field select,
.bp-root .bp-field textarea {
	width: 100%;
	border: 1.5px solid var(--bp-line);
	border-radius: 12px;
	padding: 12px 14px;
	font-size: 16px;
	color: var(--bp-ink);
	outline: none;
	background: #fff;
	font-family: inherit;
	transition: border .15s;
}

.bp-root .bp-field input:focus,
.bp-root .bp-field select:focus,
.bp-root .bp-field textarea:focus {
	border-color: var(--bp-primary-600);
}

.bp-empty,
.bp-skel {
	text-align: center;
	padding: 40px 20px;
	color: var(--bp-muted);
	font-size: 13px;
}

.bp-skel-row {
	height: 16px;
	background: #ECECF3;
	border-radius: 8px;
	margin: 10px 0;
}

.bp-toast {
	position: fixed;
	left: 50%;
	bottom: 34px;
	transform: translate(-50%, 80px);
	opacity: 0;
	background: var(--bp-ink);
	color: #fff;
	padding: 13px 20px;
	border-radius: 14px;
	font-size: 13px;
	z-index: 95;
	box-shadow: 0 16px 34px rgba(30, 28, 60, .3);
	transition: .28s;
	pointer-events: none;
}

.bp-toast.on {
	transform: translate(-50%, 0);
	opacity: 1;
}

.bp-tabs {
	display: none;
}

/* ---------- login ---------- */
.bp-login {
	min-height: 100dvh;
	background: linear-gradient(150deg, #EDEFF6, #DFE3EF);
	display: grid;
	place-items: center;
	padding: 24px;
}

.bp-login-card {
	width: min(920px, 100%);
	background: #fff;
	border-radius: 28px;
	box-shadow: 0 34px 80px rgba(60, 55, 120, .18);
	display: grid;
	grid-template-columns: 1fr 1fr;
	overflow: hidden;
	min-height: 520px;
}

.bp-login-art {
	background: linear-gradient(150deg, var(--bp-primary-600), var(--bp-primary));
	padding: 40px;
	color: #fff;
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	overflow: hidden;
}

.bp-login-art .bp-arcs {
	position: absolute;
	right: -70px;
	bottom: -90px;
	opacity: .45;
}

.bp-login-art .bp-brand-name {
	color: #fff;
}

.bp-login-art .bp-brand-sub {
	color: rgba(255, 255, 255, .6);
}

.bp-login-art .bp-brand-mark {
	background: rgba(255, 255, 255, .18);
	box-shadow: none;
}

.bp-login-art h2 {
	font-size: 26px;
	font-weight: 600;
	margin: 0 0 12px;
	line-height: 1.35;
	position: relative;
	font-family: var(--bp-font-heading);
}

.bp-login-art p {
	font-size: 13.5px;
	opacity: .82;
	line-height: 1.7;
	margin: 0;
	position: relative;
	max-width: 300px;
}

.bp-login-pts {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-top: 22px;
}

.bp-login-pts div {
	display: flex;
	gap: 10px;
	align-items: center;
	font-size: 12.5px;
	opacity: .9;
}

.bp-login-form {
	padding: 44px 42px;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.bp-login-form h3 {
	margin: 0 0 6px;
	font-size: 22px;
	font-weight: 600;
	font-family: var(--bp-font-heading);
}

.bp-login-form .bp-login-sub {
	margin: 0 0 26px;
	font-size: 13px;
	color: var(--bp-muted);
}

.bp-login-extra {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	margin-bottom: 20px;
}

.bp-login-extra a,
.bp-link {
	color: var(--bp-primary);
	font-weight: 600;
	font-size: 12.5px;
	text-decoration: none;
}

.bp-legal {
	font-size: 11px;
	color: var(--bp-muted);
	margin-top: 18px;
}

/* ---------- drawer ---------- */
.bp-dscrim {
	position: fixed;
	inset: 0;
	background: rgba(44, 42, 74, .38);
	opacity: 0;
	pointer-events: none;
	transition: .25s;
	z-index: 84;
}

.bp-dscrim.open {
	opacity: 1;
	pointer-events: auto;
}

.bp-drawer {
	position: fixed;
	top: 0;
	right: 0;
	height: 100dvh;
	width: min(560px, 96vw);
	background: #fff;
	transform: translateX(102%);
	transition: transform .3s cubic-bezier(.2, .8, .2, 1);
	z-index: 85;
	overflow-y: auto;
	box-shadow: -24px 0 70px rgba(45, 40, 95, .22);
}

.bp-drawer.open {
	transform: none;
}

@media (min-width: 900px) {
	.bp-root .bp-field input,
	.bp-root .bp-field select,
	.bp-root .bp-field textarea {
		font-size: 13.5px;
	}
}

@media (max-width: 1240px) {
	.bp-grid-2 {
		grid-template-columns: 1fr;
	}

	.bp-login-card {
		grid-template-columns: 1fr;
	}

	.bp-login-art {
		display: none;
	}
}

@media (max-width: 980px) {
	.bp-top {
		grid-template-columns: auto 1fr auto;
		padding: 14px 16px;
	}

	.bp-brand-name,
	.bp-brand-sub,
	.bp-crumb .bp-ctx,
	.bp-acct {
		display: none;
	}

	.bp-body {
		grid-template-columns: 70px 1fr;
	}

	.bp-side {
		padding: 16px 10px;
	}

	.bp-nav-item span.bp-nav-t,
	.bp-nav-label {
		display: none;
	}

	.bp-nav-item {
		justify-content: center;
		padding: 12px;
	}

	.bp-main {
		padding: 18px 16px 34px;
	}

	.bp-hero-big,
	.bp-balance {
		font-size: 34px;
	}
}

@media (max-width: 720px) {
	.bp-app {
		grid-template-rows: auto 1fr auto;
	}

	.bp-side {
		display: none;
	}

	.bp-body {
		grid-template-columns: 1fr;
	}

	.bp-tabs {
		display: flex;
		background: #fff;
		border-top: 1px solid var(--bp-line);
		padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
	}

	.bp-tabs button {
		flex: 1;
		border: 0;
		background: transparent;
		font: inherit;
		color: var(--bp-muted);
		padding: 10px 4px;
		min-height: 44px;
		cursor: pointer;
	}

	.bp-tabs button.active {
		color: var(--bp-primary);
		font-weight: 600;
	}

	.bp-table-wrap {
		display: none;
	}

	.bp-stack {
		display: block;
	}

	.bp-login {
		padding: 0;
	}

	.bp-login-card {
		border-radius: 0;
		min-height: 100dvh;
		box-shadow: none;
	}

	.bp-login-form {
		padding: 32px 22px;
	}

	.bp-toast {
		bottom: 88px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bp-root,
	.bp-root * {
		animation: none !important;
		transition: none !important;
	}
}
