@font-face {
	font-family: "DM Sans Variable";
	src: url("/assets/fonts/dm-sans-latin-variable.woff2") format("woff2");
	font-weight: 100 1000;
	font-style: normal;
	font-display: swap;
}

:root {
	--navy: #020122;
	--terracotta: #f4442e;
	--terracotta-strong: #c9341c;
	--white: #ffffff;
	--ink: #111122;
	--muted: #5c5c70;
	--surface: #f4f4f7;
	--surface-alt: #ececf1;
	--border: #e0e0e7;
	--border-strong: #cacad4;
	--green: #147a4b;
	--amber: #8a5a00;
	--blue: #0d4f8b;
	--red: #a11b12;
	--radius: 10px;
	--radius-lg: 18px;
	--shadow-sm: 0 1px 2px rgba(2, 1, 34, 0.05);
	--shadow: 0 18px 50px rgba(2, 1, 34, 0.08);
	--font-sans: "DM Sans Variable", "DM Sans", system-ui, -apple-system,
		"Segoe UI", sans-serif;
	--font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

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

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

body {
	margin: 0;
	color: var(--ink);
	background: var(--surface);
	font-family: var(--font-sans);
	font-size: 16px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

img {
	display: block;
	max-width: 100%;
}

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

button {
	cursor: pointer;
}

a {
	color: inherit;
}

h1,
h2,
h3,
p {
	margin: 0;
}

[hidden] {
	display: none !important;
}

:focus-visible {
	outline: 2px solid var(--terracotta);
	outline-offset: 2px;
}

.visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.eyebrow {
	margin: 0 0 0.55rem;
	color: var(--terracotta-strong);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.eyebrow--light {
	color: rgba(255, 255, 255, 0.6);
}

/* -------------------------------------------------------------------------
   Colour swatches
   ------------------------------------------------------------------------- */

.colour-prussian-blue {
	--swatch: #020122;
}
.colour-fiery-terracotta {
	--swatch: #f4442e;
}
.colour-mauve {
	--swatch: #6b4b3e;
}
.colour-gold {
	--swatch: #dcba55;
}
.colour-deep-green {
	--swatch: #101c14;
}
.colour-electric-green {
	--swatch: #55d62e;
}
.colour-deep-olive {
	--swatch: #25291f;
}
.colour-moss {
	--swatch: #777b50;
}
.colour-deep-blue {
	--swatch: #0d2b45;
}
.colour-bright-blue {
	--swatch: #4fb3e8;
}
.colour-rosewood {
	--swatch: #26171b;
}
.colour-dusty-rose {
	--swatch: #874b54;
}

.swatch {
	display: inline-block;
	background-color: var(--swatch, var(--border));
}

/* -------------------------------------------------------------------------
   Buttons, inputs and shared bits
   ------------------------------------------------------------------------- */

.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.55rem;
	padding: 0.72rem 1.1rem;
	border: 1px solid transparent;
	border-radius: var(--radius);
	background: transparent;
	color: var(--ink);
	font-size: 0.92rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.15s ease, border-color 0.15s ease,
		box-shadow 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}

.button:disabled {
	cursor: not-allowed;
	opacity: 0.5;
}

.button--primary {
	background: var(--terracotta-strong);
	border-color: var(--terracotta-strong);
	color: var(--white);
}

.button--primary:hover:not(:disabled) {
	background: #b02a16;
	border-color: #b02a16;
	box-shadow: 0 8px 18px rgba(201, 52, 28, 0.24);
}

.button--secondary {
	background: var(--navy);
	border-color: var(--navy);
	color: var(--white);
}

.button--secondary:hover:not(:disabled) {
	background: #14133a;
	border-color: #14133a;
}

.button--ghost {
	background: var(--white);
	border-color: var(--border-strong);
	color: var(--ink);
}

.button--ghost:hover:not(:disabled) {
	background: var(--surface);
	border-color: #b1b1c0;
}

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

.button--danger:hover:not(:disabled) {
	background: #fdecea;
	border-color: #f0b9b4;
}

.button--header {
	padding: 0.5rem 0.85rem;
	border-color: rgba(255, 255, 255, 0.22);
	background: rgba(255, 255, 255, 0.08);
	color: var(--white);
	font-size: 0.85rem;
}

.button--header:hover:not(:disabled) {
	background: rgba(255, 255, 255, 0.16);
}

.button--wide {
	width: 100%;
}

.button--small {
	padding: 0.45rem 0.8rem;
	font-size: 0.84rem;
}

.button__spinner {
	display: none;
	width: 0.95rem;
	height: 0.95rem;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: spin 0.7s linear infinite;
}

.button.is-loading .button__spinner {
	display: inline-block;
}

.button.is-loading .button__label {
	opacity: 0.75;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

.spinner {
	display: inline-block;
	width: 1.1rem;
	height: 1.1rem;
	border: 2px solid var(--border-strong);
	border-top-color: var(--terracotta);
	border-radius: 50%;
	animation: spin 0.7s linear infinite;
}

.field {
	display: grid;
	gap: 0.38rem;
	min-width: 0;
}

.field__label {
	color: var(--ink);
	font-size: 0.83rem;
	font-weight: 600;
}

.field--full {
	grid-column: 1 / -1;
}

.input {
	width: 100%;
	min-width: 0;
	padding: 0.76rem 0.88rem;
	border: 1px solid var(--border-strong);
	border-radius: 9px;
	background: var(--white);
	color: var(--ink);
	font-size: 0.92rem;
	line-height: 1.45;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input::placeholder {
	color: #6b6b7d;
}

.input:focus {
	outline: none;
	border-color: var(--terracotta);
	box-shadow: 0 0 0 3px rgba(244, 68, 46, 0.14);
}

textarea.input {
	min-height: 7rem;
	resize: vertical;
}

select.input {
	appearance: none;
	padding-right: 2.4rem;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%235c5c70' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.9rem center;
	background-size: 0.7rem;
}

.alert {
	padding: 0.75rem 0.9rem;
	border: 1px solid transparent;
	border-radius: 9px;
	font-size: 0.88rem;
	line-height: 1.45;
}

.alert--error {
	border-color: #f0b9b4;
	background: #fdecea;
	color: #8a1c13;
}

/* -------------------------------------------------------------------------
   Login
   ------------------------------------------------------------------------- */

.login-page {
	background: var(--surface);
}

.login {
	display: grid;
	grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
	min-height: 100svh;
}

.login__brand {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 3rem;
	overflow: hidden;
	padding: clamp(2rem, 4.5vw, 4.25rem);
	background:
		radial-gradient(
			circle at 88% 8%,
			rgba(244, 68, 46, 0.28),
			transparent 34rem
		),
		radial-gradient(
			circle at 6% 100%,
			rgba(79, 179, 232, 0.14),
			transparent 32rem
		),
		var(--navy);
	color: var(--white);
}

.login__brand::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image: linear-gradient(
			rgba(255, 255, 255, 0.045) 1px,
			transparent 1px
		),
		linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
	background-size: 46px 46px;
	mask-image: radial-gradient(circle at 50% 40%, #000 10%, transparent 75%);
	pointer-events: none;
}

.login__mark,
.login__pitch,
.login__palette {
	position: relative;
	z-index: 1;
}

.login__mark img {
	width: clamp(190px, 20vw, 260px);
	height: auto;
}

.login__pitch {
	max-width: 36rem;
	margin-block: auto;
}

.login__pitch h1 {
	margin: 0 0 1.35rem;
	font-size: clamp(2.6rem, 5.2vw, 4.8rem);
	font-weight: 700;
	letter-spacing: -0.045em;
	line-height: 0.98;
}

.login__pitch h1 span {
	color: var(--terracotta);
}

.login__intro {
	max-width: 31rem;
	color: rgba(255, 255, 255, 0.74);
	font-size: clamp(1rem, 1.4vw, 1.15rem);
	line-height: 1.6;
}

.login__features {
	display: grid;
	gap: 0.7rem;
	margin: 2rem 0 0;
	padding: 0;
	list-style: none;
	font-size: 0.94rem;
	color: rgba(255, 255, 255, 0.8);
}

.login__features li {
	display: flex;
	align-items: flex-start;
	gap: 0.65rem;
}

.login__features li::before {
	content: "";
	flex: none;
	width: 0.42rem;
	height: 0.42rem;
	margin-top: 0.45rem;
	border-radius: 2px;
	background: var(--terracotta);
}

.login__palette {
	display: flex;
	gap: 0.42rem;
	width: 100%;
	max-width: 34rem;
}

.login__palette .swatch {
	flex: 1;
	height: 0.42rem;
	border-radius: 999px;
	opacity: 0.95;
}

.login__panel {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2rem;
	padding: clamp(1.5rem, 4vw, 3.5rem);
	background:
		radial-gradient(
			circle at 100% 0%,
			rgba(244, 68, 46, 0.06),
			transparent 24rem
		),
		var(--surface);
}

.login__card {
	width: 100%;
	max-width: 27rem;
	padding: clamp(1.6rem, 4vw, 2.5rem);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	background: var(--white);
	box-shadow: var(--shadow);
}

.login__card h2 {
	margin: 0;
	font-size: 2rem;
	letter-spacing: -0.035em;
	line-height: 1.1;
}

.login__subtitle {
	margin: 0.55rem 0 1.6rem;
	color: var(--muted);
	font-size: 0.92rem;
}

.login__card .alert {
	margin-bottom: 1.1rem;
}

.login__form {
	display: grid;
	gap: 1.05rem;
}

.password-field {
	position: relative;
	display: block;
}

.password-field .input {
	padding-right: 4.4rem;
}

.password-field__toggle {
	position: absolute;
	top: 50%;
	right: 0.45rem;
	transform: translateY(-50%);
	padding: 0.35rem 0.5rem;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: var(--muted);
	font-size: 0.78rem;
	font-weight: 600;
}

.password-field__toggle:hover {
	background: var(--surface);
	color: var(--ink);
}

.login__hint {
	margin: 1.4rem 0 0;
	color: var(--muted);
	font-size: 0.8rem;
	line-height: 1.5;
}

.login__footer {
	color: var(--muted);
	font-size: 0.78rem;
}

/* -------------------------------------------------------------------------
   App shell
   ------------------------------------------------------------------------- */

.app-header {
	position: sticky;
	top: 0;
	z-index: 30;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.7rem clamp(1rem, 4vw, 2rem);
	background: var(--navy);
	color: var(--white);
	box-shadow: 0 6px 24px rgba(2, 1, 34, 0.16);
}

.app-header__brand {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	text-decoration: none;
}

.app-header__brand img {
	width: 158px;
	height: auto;
}

.app-header__divider {
	width: 1px;
	height: 1.4rem;
	background: rgba(255, 255, 255, 0.22);
}

.app-header__product {
	color: rgba(255, 255, 255, 0.72);
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.app-header__actions {
	display: flex;
	align-items: center;
	gap: 0.85rem;
}

.mode-badge {
	padding: 0.28rem 0.6rem;
	border: 1px solid rgba(220, 186, 85, 0.45);
	border-radius: 999px;
	background: rgba(220, 186, 85, 0.16);
	color: #f0dda0;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

.app-header__user {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.avatar {
	display: grid;
	place-items: center;
	width: 1.9rem;
	height: 1.9rem;
	border-radius: 50%;
	background: var(--terracotta-strong);
	color: var(--white);
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.03em;
}

.app-header__user-name {
	color: rgba(255, 255, 255, 0.85);
	font-size: 0.85rem;
	font-weight: 500;
}

.app-main {
	width: 100%;
	max-width: 1320px;
	margin: 0 auto;
	padding: clamp(1.5rem, 3.5vw, 2.75rem) clamp(1rem, 4vw, 2rem) 4rem;
}

.page-heading {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1.5rem;
}

.page-heading h1 {
	margin: 0;
	font-size: clamp(2rem, 3.2vw, 2.6rem);
	letter-spacing: -0.04em;
	line-height: 1;
}

.page-heading__subtitle {
	margin-top: 0.5rem;
	color: var(--muted);
	font-size: 0.94rem;
}

/* -------------------------------------------------------------------------
   Stats
   ------------------------------------------------------------------------- */

.stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
	gap: 0.75rem;
	margin: 1.6rem 0 1rem;
}

.stat {
	display: grid;
	gap: 0.2rem;
	padding: 0.95rem 1rem;
	border: 1px solid var(--border);
	border-radius: 12px;
	background: var(--white);
	box-shadow: var(--shadow-sm);
	text-align: left;
	transition: border-color 0.15s ease, box-shadow 0.15s ease,
		transform 0.15s ease;
}

button.stat:hover {
	transform: translateY(-1px);
	border-color: var(--border-strong);
	box-shadow: 0 6px 16px rgba(2, 1, 34, 0.07);
}

button.stat.is-active {
	border-color: var(--terracotta);
	box-shadow: 0 0 0 1px var(--terracotta);
}

.stat__value {
	font-size: 1.65rem;
	font-weight: 700;
	letter-spacing: -0.03em;
	line-height: 1.1;
}

.stat__label {
	color: var(--muted);
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.07em;
	text-transform: uppercase;
}

/* -------------------------------------------------------------------------
   Toolbar
   ------------------------------------------------------------------------- */

.toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.6rem;
	margin-bottom: 1rem;
}

.search-field {
	position: relative;
	flex: 1 1 320px;
}

.search-field__icon {
	position: absolute;
	top: 50%;
	left: 0.9rem;
	width: 1.05rem;
	height: 1.05rem;
	transform: translateY(-50%);
	fill: none;
	stroke: var(--muted);
	stroke-width: 2;
	stroke-linecap: round;
	pointer-events: none;
}

.search-field__input {
	padding-left: 2.65rem;
}

.select-field {
	flex: 0 1 auto;
}

.select-field .input {
	min-width: 12rem;
}

/* -------------------------------------------------------------------------
   Leads panel
   ------------------------------------------------------------------------- */

.panel {
	position: relative;
	overflow: hidden;
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	background: var(--white);
	box-shadow: var(--shadow-sm);
}

.panel__loading {
	position: absolute;
	inset: 0;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.65rem;
	background: rgba(255, 255, 255, 0.74);
	color: var(--muted);
	font-size: 0.9rem;
	backdrop-filter: blur(2px);
}

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

.leads-table {
	width: 100%;
	min-width: 840px;
	border-collapse: collapse;
}

.leads-table th {
	padding: 0.85rem 1rem;
	border-bottom: 1px solid var(--border);
	color: var(--muted);
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-align: left;
	text-transform: uppercase;
	white-space: nowrap;
}

.leads-table td {
	padding: 0.9rem 1rem;
	border-bottom: 1px solid var(--border);
	vertical-align: top;
	font-size: 0.9rem;
}

.leads-table tbody tr {
	cursor: pointer;
	transition: background-color 0.12s ease;
}

.leads-table tbody tr:hover {
	background: var(--surface);
}

.leads-table tbody tr:last-child td {
	border-bottom: 0;
}

.leads-table tbody tr:focus-within {
	background: var(--surface);
}

.cell-business {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	min-width: 12rem;
}

.cell-business strong {
	font-size: 0.95rem;
	font-weight: 700;
}

.cell-business span {
	color: var(--muted);
	font-size: 0.8rem;
}

.lead-name-button {
	padding: 0;
	border: 0;
	background: none;
	color: var(--ink);
	font-size: 0.95rem;
	font-weight: 700;
	text-align: left;
}

.lead-name-button:hover {
	color: var(--terracotta-strong);
	text-decoration: underline;
}

.cell-contact {
	display: flex;
	flex-direction: column;
	gap: 0.12rem;
	min-width: 11rem;
}

.cell-contact a {
	color: var(--ink);
	text-decoration: none;
	overflow-wrap: anywhere;
}

.cell-contact a:hover {
	color: var(--terracotta-strong);
	text-decoration: underline;
}

.cell-contact span {
	color: var(--muted);
	font-size: 0.82rem;
}

.cell-trade {
	max-width: 16rem;
}

.cell-trade span {
	display: block;
	margin-top: 0.15rem;
	color: var(--muted);
	font-size: 0.8rem;
	line-height: 1.35;
}

.cell-date {
	color: var(--muted);
	font-size: 0.84rem;
	white-space: nowrap;
}

/* Status pills */

.status-pill {
	display: inline-flex;
	align-items: center;
	gap: 0.38rem;
	padding: 0.24rem 0.58rem;
	border: 1px solid transparent;
	border-radius: 999px;
	font-size: 0.74rem;
	font-weight: 600;
	line-height: 1.35;
	white-space: nowrap;
}

.status-pill::before {
	content: "";
	width: 0.38rem;
	height: 0.38rem;
	border-radius: 50%;
	background: currentColor;
}

.status-pill--pending_payment {
	border-color: #f0d49a;
	background: #fff6df;
	color: var(--amber);
}

.status-pill--paid {
	border-color: #b6e2c9;
	background: #e8f8ef;
	color: var(--green);
}

.status-pill--in_progress {
	border-color: #b9d8f2;
	background: #eaf4fe;
	color: var(--blue);
}

.status-pill--live {
	border-color: #c9c8e6;
	background: #efeffa;
	color: var(--navy);
}

.status-pill--on_hold {
	border-color: #d7d7df;
	background: #f2f2f5;
	color: #55556a;
}

.status-pill--cancelled {
	border-color: #f0b9b4;
	background: #fdecea;
	color: var(--red);
}

/* Mobile cards */

.lead-cards {
	display: none;
}

.lead-card {
	display: block;
	width: 100%;
	padding: 1rem;
	border: 0;
	border-bottom: 1px solid var(--border);
	background: var(--white);
	text-align: left;
	transition: background-color 0.12s ease;
}

.lead-card:last-child {
	border-bottom: 0;
}

.lead-card:hover,
.lead-card:focus-visible {
	background: var(--surface);
}

.lead-card__top {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 0.75rem;
}

.lead-card__business {
	display: block;
	font-size: 0.98rem;
	font-weight: 700;
}

.lead-card__person {
	display: block;
	margin-top: 0.12rem;
	color: var(--muted);
	font-size: 0.82rem;
}

.lead-card__meta {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.25rem 1rem;
	margin-top: 0.65rem;
	color: var(--muted);
	font-size: 0.82rem;
}

.lead-card__contact {
	overflow-wrap: anywhere;
}

/* Empty state and footer */

.empty-state {
	padding: 3.5rem 1.5rem;
	text-align: center;
}

.empty-state__title {
	font-size: 1.05rem;
	font-weight: 700;
}

.empty-state__text {
	margin-top: 0.3rem;
	color: var(--muted);
	font-size: 0.9rem;
}

.panel__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.75rem 1rem;
	border-top: 1px solid var(--border);
	background: #fbfbfc;
}

.panel__count {
	color: var(--muted);
	font-size: 0.82rem;
}

.pagination {
	display: flex;
	gap: 0.4rem;
}

/* -------------------------------------------------------------------------
   Lead dialog
   ------------------------------------------------------------------------- */

.lead-dialog {
	width: min(920px, calc(100vw - 2rem));
	max-height: min(92dvh, 920px);
	padding: 0;
	border: 0;
	border-radius: var(--radius-lg);
	background: var(--white);
	color: var(--ink);
	box-shadow: 0 30px 90px rgba(2, 1, 34, 0.38);
	overflow: hidden;
}

.lead-dialog::backdrop {
	background: rgba(2, 1, 34, 0.62);
	backdrop-filter: blur(3px);
}

.lead-dialog__form {
	display: flex;
	flex-direction: column;
	max-height: min(92dvh, 920px);
}

.lead-dialog__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	padding: 1.2rem 1.5rem;
	background: var(--navy);
	color: var(--white);
}

.lead-dialog__header .eyebrow {
	color: rgba(255, 255, 255, 0.55);
}

.lead-dialog__header h2 {
	margin: 0;
	font-size: clamp(1.35rem, 2.4vw, 1.75rem);
	letter-spacing: -0.03em;
	line-height: 1.15;
}

.lead-dialog__contact {
	margin-top: 0.3rem;
	color: rgba(255, 255, 255, 0.68);
	font-size: 0.86rem;
	overflow-wrap: anywhere;
}

.icon-button {
	display: grid;
	flex: none;
	place-items: center;
	width: 2.3rem;
	height: 2.3rem;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.22);
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.08);
	color: var(--white);
	transition: background-color 0.15s ease;
}

.icon-button:hover {
	background: rgba(255, 255, 255, 0.18);
}

.icon-button svg {
	width: 1rem;
	height: 1rem;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
}

.lead-dialog__body {
	display: grid;
	gap: 1.4rem;
	padding: 1.5rem;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.lead-dialog__summary {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem;
}

.lead-dialog__created {
	color: var(--muted);
	font-size: 0.82rem;
}

.form-section {
	display: grid;
	gap: 1rem;
	padding-top: 1.3rem;
	border-top: 1px solid var(--border);
}

.form-section h3 {
	margin: 0;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.form-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1rem;
}

.quick-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
}

.quick-link {
	display: inline-flex;
	align-items: center;
	padding: 0.36rem 0.7rem;
	border: 1px solid var(--border-strong);
	border-radius: 999px;
	background: var(--surface);
	color: var(--ink);
	font-size: 0.8rem;
	font-weight: 500;
	text-decoration: none;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.quick-link:hover {
	border-color: var(--border-strong);
	background: var(--surface-alt);
}

.quick-link--button {
	font-family: inherit;
}

.colour-field {
	display: flex;
	align-items: center;
	gap: 0.55rem;
}

.colour-field .input {
	flex: 1;
}

.colour-swatch {
	flex: none;
	width: 2.25rem;
	height: 2.25rem;
	border: 1px solid var(--border-strong);
	border-radius: 8px;
}

.meta {
	padding: 1rem;
	border-radius: 10px;
	background: var(--surface);
}

.meta dl {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
	gap: 1rem;
	margin: 0;
}

.meta dt {
	margin-bottom: 0.18rem;
	color: var(--muted);
	font-size: 0.66rem;
	font-weight: 700;
	letter-spacing: 0.07em;
	text-transform: uppercase;
}

.meta dd {
	margin: 0;
	font-size: 0.82rem;
	overflow-wrap: anywhere;
}

.meta__id {
	font-family: var(--font-mono);
	font-size: 0.7rem !important;
}

.lead-dialog__footer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 1rem 1.5rem;
	border-top: 1px solid var(--border);
	background: #fbfbfc;
}

.lead-dialog__footer-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-left: auto;
}

/* -------------------------------------------------------------------------
   Toast
   ------------------------------------------------------------------------- */

.toast {
	position: fixed;
	left: 50%;
	bottom: 1.5rem;
	z-index: 100;
	max-width: calc(100vw - 2rem);
	padding: 0.7rem 1.05rem;
	border-radius: 999px;
	background: var(--navy);
	color: var(--white);
	box-shadow: 0 14px 40px rgba(2, 1, 34, 0.3);
	font-size: 0.88rem;
	text-align: center;
	transform: translateX(-50%);
}

.toast--error {
	background: var(--red);
}

.noscript {
	padding: 2rem;
	text-align: center;
}

/* -------------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------------- */

@media (max-width: 980px) {
	.login {
		grid-template-columns: 1fr;
	}

	.login__brand {
		gap: 1.25rem;
		padding: 1.5rem clamp(1.25rem, 5vw, 2.5rem);
	}

	.login__mark img {
		width: 180px;
	}

	.login__pitch {
		margin-block: 0;
	}

	.login__pitch h1 {
		margin-bottom: 0.8rem;
		font-size: clamp(2rem, 7vw, 3rem);
	}

	.login__features {
		display: none;
	}

	.login__intro {
		max-width: 38rem;
	}

	.login__palette {
		max-width: none;
	}

	.login__panel {
		padding: 2rem 1.25rem 2.5rem;
	}

	.login__card {
		max-width: 30rem;
	}
}

@media (max-width: 860px) {
	.table-wrap {
		display: none;
	}

	.lead-cards {
		display: block;
	}
}

@media (max-width: 700px) {
	.app-header__divider,
	.app-header__product,
	.app-header__user-name {
		display: none;
	}

	.app-header__brand img {
		width: 132px;
	}

	.app-header__actions {
		gap: 0.55rem;
	}

	.page-heading {
		align-items: flex-start;
		flex-direction: column;
		gap: 1rem;
	}

	.stats {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.search-field {
		flex-basis: 100%;
	}

	.select-field {
		flex: 1;
	}

	.select-field .input {
		min-width: 0;
	}

	.toolbar .button {
		flex: 0 1 auto;
	}
}

@media (max-width: 640px) {
	.lead-dialog {
		width: 100vw;
		max-width: none;
		height: 100dvh;
		max-height: none;
		border-radius: 0;
	}

	.lead-dialog__form {
		height: 100dvh;
		max-height: none;
	}

	.lead-dialog__header,
	.lead-dialog__body,
	.lead-dialog__footer {
		padding-inline: 1.1rem;
	}

	.form-grid {
		grid-template-columns: 1fr;
	}

	.field--empty {
		display: none;
	}

	.lead-dialog__footer {
		align-items: stretch;
	}

	.lead-dialog__footer-actions {
		width: 100%;
		margin-left: 0;
	}

	.lead-dialog__footer-actions .button {
		flex: 1;
	}

	#delete-lead {
		width: 100%;
	}

	.panel__footer {
		flex-direction: column;
		align-items: stretch;
	}

	.pagination .button {
		flex: 1;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
	}
}
