/* =========================
   1) Fonts
   ========================= */
@font-face {
	font-family: 'Figtree';
	src: url('/assets/fonts/Figtree-Regular.ttf') format('truetype');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Figtree';
	src: url('/assets/fonts/Figtree-Bold.ttf') format('truetype');
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Flight';
	src: url('/assets/fonts/Flight.ttf') format('truetype');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}


/* =========================
   2) Design Tokens
   ========================= */
:root {
	--bg: #f6f7fb;
	--panel: #fff;

	--brand: #30363b;
	--accent: #fffc04;
	--accent2: #506a85;
	--accent3: #8aa4ba;
	--accent4: #a1bed4;
	--accent5: #3B4C5D;

	--text: #30363b;
	--muted: #6b7280;

	--r-sm: 6px;
	--r-md: 12px;
	--r-lg: 16px;

	--shadow: 0 8px 20px rgba(0, 0, 0, .06);
	--topbar-h: 56px;
}


/* =========================
   3) Base + Utilities
   ========================= */
* {
	box-sizing: border-box;
}

html,
body {
	height: 100%;
	margin: 0;
}

body.app {
	font-family: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
	font-size: 16px;
	line-height: 1.5;
	background: var(--bg);
	color: var(--text);
}

a {
	color: var(--accent2);
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

.no-hover-effect:hover {
	color: inherit;
	text-decoration: none;
}

:focus-visible {
	outline: 2px solid var(--accent2);
	outline-offset: 2px;
}

.brand-logo {
	display: block;
	height: auto;
	width: auto;
}

.layout {
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
}

main {
	flex: 1;
}


/* =========================
   Login
   ========================= */
body.login-page {
	margin: 0;
	font-family: var(--font-display, 'Figtree', sans-serif);
	background: linear-gradient(135deg, var(--brand) 0%, var(--accent2) 100%);
	background-image: url("../img/loginscreen.webp");
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	background-attachment: fixed;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100vh;
	color: #333;
}

.login-card {
	max-width: 380px;
	background: var(--panel);
	border-radius: var(--radius-lg, 20px);
	padding: 2.5rem 2rem;
	text-align: center;
	box-shadow:
		0 10px 25px rgba(80, 106, 133, 0.15),
		0 30px 60px rgba(48, 54, 59, 0.25),
		inset 0 0 40px rgba(255, 255, 255, 0.2);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-logo {
	max-width: 180px;
	margin: 0 auto 1rem;
	display: block;
}

h1 {
	font-family: var(--font-display, 'Figtree', sans-serif);
	font-size: 1.3rem;
	margin: 0 0 1rem;
	color: var(--brand);
}

.login-card label {
	display: block;
	font-size: 0.9rem;
	text-align: left;
	margin: 1rem 0 0.25rem 0.5rem;
	color: #555;
}

.login-card input {
	width: 95%;
	padding: 0.7rem 0.9rem;
	border: 1px solid rgba(80, 106, 133, 0.2);
	border-radius: var(--radius-md, 12px);
	font: inherit;
	background: rgba(255, 255, 255, 0.75);
	box-shadow:
		inset 0 2px 6px rgba(80, 106, 133, 0.1),
		0 1px 2px rgba(48, 54, 59, 0.05);
	color: var(--brand);
	transition: all 0.25s ease;
	outline: none;
}

.login-card input:focus {
	border-color: rgba(80, 106, 133, 0.4);
	box-shadow:
		0 0 0 3px rgba(80, 106, 133, 0.15),
		inset 0 2px 8px rgba(80, 106, 133, 0.15);
	background: rgba(255, 255, 255, 0.9);
}

.login-card .btn-primary {
	font-family: var(--font-display, 'Figtree', sans-serif);
	width: 95%;
	margin-top: 1.5rem;
	background: var(--color-accent-2, var(--accent2));
	color: #fff;
	border: none;
	border-radius: var(--radius-md, 12px);
	padding: 0.8rem;
	font-weight: 600;
	cursor: pointer;
}

.login-card .btn-primary:hover {
	background: var(--accent);
	color: var(--brand);
}

button .plane {
	display: inline-block;
	transition: transform 0.5s ease;
}

button:hover .plane {
	transform: translateX(100px);
}

.error-msg {
	background: #fde8e8;
	color: #991b1b;
	padding: 0.75rem;
	border-radius: var(--radius-md, 12px);
	margin-bottom: 1rem;
	font-size: 0.9rem;
	text-align: left;
}

.login-footer {
	margin-top: 1.5rem;
	font-size: 0.8rem;
	color: #777;
}


/* =========================
   Burger / Nav trigger
   ========================= */
.nav-trigger {
	appearance: none;
	background: transparent;
	border: 0;
	padding: 0;
	margin: 0;
	cursor: pointer;
	width: 32px;
	height: 28px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	outline: none;
}

.nav-trigger:focus-visible {
	outline: 2px solid rgba(255, 252, 4, 0.35);
	outline-offset: 3px;
	border-radius: 6px;
}

.burger-lines {
	width: 22px;
	height: 16px;
	display: inline-flex;
	flex-direction: column;
	justify-content: space-between;
}

.burger-lines span {
	display: block;
	height: 3px;
	border-radius: 2px;
	background: var(--accent);
}

.nav-trigger:hover .burger-lines span {
	filter: brightness(1.05);
}

.nav-trigger[aria-expanded="true"] .burger-lines span {
	filter: brightness(1.15);
}


/* =========================
   Navigation Menu
   ========================= */
.nav-menu {
	position: absolute;
	top: var(--topbar-h);
	left: 10px;
	min-width: 240px;
	background: var(--brand);
	color: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
	padding: 10px;
	z-index: 9999;
	opacity: 0;
	transform: translateY(-6px) scale(0.985);
	pointer-events: none;
	visibility: hidden;
	transition:
		opacity 140ms ease,
		transform 160ms ease,
		visibility 0s linear 160ms;
}

.nav-menu.open {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
	visibility: visible;
	transition:
		opacity 140ms ease,
		transform 160ms ease,
		visibility 0s linear 0s;
}

.nav-section-body {
	overflow: hidden;
	max-height: 0;
	opacity: 0;
	transform: translateY(-2px);
	transition:
		max-height 220ms ease,
		opacity 160ms ease,
		transform 180ms ease;
}

.nav-section-body.is-open {
	max-height: 600px;
	opacity: 1;
	transform: translateY(0);
}

.nav-section {
	padding: 4px 4px 2px 4px;
}

.nav-section-title {
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: var(--accent3);
	text-transform: uppercase;
	padding: 6px 8px;
}

.nav-item {
	display: block;
	padding: 8px 10px;
	border-radius: 8px;
	text-decoration: none;
	color: inherit;
	font-size: 0.95rem;
	transition: color 0.15s ease, background-color 0.15s ease;
}

.nav-item i {
	margin-right: 10px;
	color: var(--accent4);
	transition: color 0.15s ease;
}

.nav-item:hover {
	background: #f3f4f6;
	color: var(--brand);
	text-decoration: none;
}

.nav-item:hover i {
	color: var(--brand);
}

.nav-sep {
	height: 1px;
	background: #e5e7eb;
	margin: 6px 4px;
}

.nav-section-toggle {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: transparent;
	border: 0;
	padding: 6px 8px;
	margin: 0;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: inherit;
	text-transform: uppercase;
	cursor: pointer;
	border-radius: 8px;
	transition: color 0.15s ease, background-color 0.15s ease;
}

.nav-section-toggle:hover {
	background: #f3f4f6;
	color: var(--brand);
}

.nav-section-chevron {
	font-size: 0.8rem;
	transition: transform 0.15s ease;
}

.nav-section-toggle[aria-expanded="true"] .nav-section-chevron {
	transform: rotate(180deg);
}

.nav-section-body {
	padding: 2px 0 4px 0;
}

.sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (max-width: 1024px) {
	.nav-menu {
		left: 8px;
		right: 8px;
		min-width: 0;
		max-height: calc(100vh - 80px);
		overflow-y: auto;
		padding-right: 8px;
	}

	.nav-menu::-webkit-scrollbar {
		width: 10px;
	}

	.nav-menu::-webkit-scrollbar-track {
		background: #2a2f33;
		border-radius: 10px;
	}

	.nav-menu::-webkit-scrollbar-thumb {
		background: var(--accent3);
		border-radius: 10px;
		border: 2px solid #2a2f33;
	}

	.nav-menu::-webkit-scrollbar-thumb:hover {
		filter: brightness(1.08);
	}

	.nav-item {
		padding: 10px 12px;
	}

	.nav-section {
		padding: 4px 6px 2px 6px;
	}
}


/* =========================
   Buttons
   ========================= */
.btn {
	display: inline-block;
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	padding: 8px 12px;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	background: #f5f5f5;
	color: var(--brand);
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
	white-space: nowrap;
}

a.btn,
a.btn:hover,
a.btn:focus,
a.btn:active {
	text-decoration: none;
}

.btn:hover {
	background-color: #eaeaea;
}

.btn-primary {
	background-color: var(--accent2);
	color: #fff;
}

.btn-primary:hover {
	background-color: var(--accent);
	color: var(--brand);
}

.btn-danger {
	background: #b91c1c;
	border-color: #b91c1c;
	border: solid 1px;
	color: #fff;
}

.btn-danger:hover {
	background: #991b1b;
	border-color: #991b1b;
}

.btn-danger:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.btn-cancel {
	background: transparent;
	color: #6b7280;
	border: 1px solid var(--accent4);
}

.btn-cancel:hover {
	background: var(--accent4);
	color: #30363b;
}

.btn-cancel:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.btn-ghost {
	background: transparent;
	color: var(--accent2);
	border: none;
}

.btn-ghost:hover {
	color: var(--accent);
	background: rgba(255, 255, 255, 0.05);
}

.btn-mini {
	font-size: 0.8rem;
	padding: 5px 8px;
	border: 1px solid #d1d5db;
	background: var(--panel);
	border-radius: 6px;
	cursor: pointer;
	transition: background-color 0.2s ease, border-color 0.2s ease;
}

.btn-mini:hover {
	background-color: #f3f4f6;
	border-color: #c7cdd3;
}

.btn.is-loading,
.btn.btn-primary.is-loading {
	position: relative;
	pointer-events: none;
	opacity: .85;
}

.btn .spinner {
	display: inline-block;
	width: 16px;
	height: 16px;
	margin-left: 8px;
	border-radius: 50%;
	border: 2px solid currentColor;
	border-top-color: transparent;
	animation: spin .7s linear infinite;
	vertical-align: -3px;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}


/* =========================
   Containers + Common blocks
   ========================= */
.container {
	margin: calc(var(--topbar-h) + 20px) auto 40px;
	padding: 0 16px;
	width: 100%;
}

.page-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: .75rem;
}

.page-head .btn {
	margin-left: auto;
}

.page-title {
	margin: 0 0 16px;
	font-weight: 700;
	font-size: 2rem;
	color: var(--text);
}

.page-header .page-title {
	margin: 0;
}

.page-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 24px;
}

.card {
	background: var(--panel);
	border-radius: var(--r-lg);
	box-shadow: var(--shadow);
	padding: 1rem;
	margin-bottom: 1rem;
}


/* =========================
   Topbar
   ========================= */
.topbar {
	position: fixed;
	left: 0;
	right: 0;
	top: 0;
	height: var(--topbar-h);
	background: var(--brand);
	color: var(--panel);
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 1rem;
	z-index: 10;
}

.topbar-actions {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	position: relative;
}

.whoami {
	color: rgba(255, 255, 255, .85);
	font-size: .95rem;
}

.topbar .topbar-icon-link {
	opacity: .9;
	margin-left: 15px;
	font-size: 1.25rem;
	color: rgba(255, 255, 255, .85);
}

.topbar .topbar-icon-link i {
	font-size: 1.125rem;
}

.topbar .topbar-icon-link:hover {
	opacity: 1;
	color: var(--accent);
}

.logout-icon {
	margin-left: 14px;
	font-size: 20px;
	line-height: 1;
	text-decoration: none;
	color: red;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 8px;
	transition: all 0.15s ease;
}

.logout-icon:hover {
	background: #f3f4f6;
	color: red;
	text-decoration: none;
}


/* =========================
   Tables (generic)
   ========================= */
.table,
#clients-overview {
	width: 100%;
	border-collapse: collapse;
	table-layout: auto;
}

.table {
	border-radius: 12px;
	font-size: .95rem;
}

.table thead {
	background: var(--accent5);
	color: #fff;
}

.table th,
.table td {
	padding: .6rem .8rem;
	border-bottom: 1px solid #e5e7eb;
	text-align: center;
	vertical-align: middle;
}

.table td:first-child {
	text-align: left;
	max-width: 320px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.table tbody tr:hover {
	background: #fafafa;
}

.table-scroll {
	overflow-x: auto;
}

tr.is-clickable {
	cursor: pointer;
}

a.row-link {
	color: inherit;
	text-decoration: none;
	display: inline-block;
	width: 100%;
}


/* =========================
   Organisations / Clients Overview Table
   ========================= */
#clients-overview {
	font-size: .95rem;
}

#clients-overview thead th.sticky-header {
	position: sticky;
	top: 0;
	z-index: 2;
	background: var(--accent5);
	color: #fff;
	font-weight: 700;
	border-bottom: 2px solid #fff;
	padding: .75rem .8rem;
}

#clients-overview th,
#clients-overview td {
	padding: .6rem .8rem;
	border-bottom: 1px solid #e5e7eb;
	text-align: center;
	vertical-align: middle;
	white-space: nowrap;
}

#clients-overview td:first-child,
#clients-overview th:first-child {
	text-align: left;
}

#clients-overview td:first-child {
	max-width: 250px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

#clients-overview td:not(:first-child),
#clients-overview th:not(:first-child) {
	text-align: center;
}

#clients-overview td:nth-last-child(2) {
	white-space: normal;
}

#clients-overview tbody tr:hover {
	background: #fafafa;
	transition: background .2s ease;
}

#clients-overview thead th.is-sortable {
	cursor: pointer;
}

#clients-overview thead th[aria-sort="ascending"]::after {
	content: " ▲";
}

#clients-overview thead th[aria-sort="descending"]::after {
	content: " ▼";
}


/* =========================
   Collapsible table helpers
   ========================= */
.is-hidden-row {
	display: none;
}

.table-more-wrap {
	margin-top: 8px;
	display: flex;
	justify-content: flex-end;
}

.table-more-btn {
	display: inline-block;
	font: inherit;
	padding: .45rem .8rem;
	border-radius: var(--r-md);
	border: 1px solid #e5e7eb;
	background: var(--panel);
	cursor: pointer;
}

.table-more-btn:hover {
	background: #f8fafc;
}


/* =========================
   Page loading overlay
   ========================= */
.page-loading {
	position: fixed;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.12);
	z-index: 9999;
}

.page-loading.is-visible {
	display: flex;
}

.page-loading__card {
	display: flex;
	gap: 10px;
	align-items: center;
	padding: 12px 14px;
	border-radius: 12px;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.08);
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
}

.page-loading__spinner {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	border: 2px solid rgba(0, 0, 0, 0.15);
	border-top-color: rgba(0, 0, 0, 0.55);
	animation: pageSpin .8s linear infinite;
}

.page-loading__text {
	font-size: 0.95rem;
	color: #111827;
	font-weight: 500;
}

@keyframes pageSpin {
	to {
		transform: rotate(360deg);
	}
}


/* =========================
   Search Box
   ========================= */
.table-tools {
	display: flex;
	justify-content: flex-end;
	margin: 6px 0 10px;
}

.search-box {
	position: relative;
	display: inline-flex;
	align-items: center;
	width: 280px;
}

.search-box .table-search {
	width: 100%;
	padding: 10px 12px 10px 36px;
	border: 1px solid #d1d5db;
	border-radius: 10px;
	font: inherit;
	background: var(--panel);
	box-shadow: 0 2px 6px rgba(0, 0, 0, .05);
	transition: all 0.2s ease;
}

.search-box .table-search:focus {
	outline: none;
	border-color: var(--accent2);
	box-shadow: 0 0 0 3px rgba(80, 106, 133, 0.15);
}

.search-icon {
	position: absolute;
	left: 12px;
	width: 18px;
	height: 18px;
	color: #9ca3af;
	pointer-events: none;
}

@media (max-width: 768px) {
	.search-box {
		width: 100%;
	}
}


/* =========================
   Filters + Pagination
   ========================= */
.list-controls {
	justify-content: space-between;
	align-items: flex-start;
	gap: 12px;
	flex-wrap: wrap;
	padding: 12px;
	background: var(--panel);
	border-bottom: 1px solid #e5e7eb;
}

.filters-wrap {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 10px;
	flex: 1 1 auto;
	overflow-x: auto;
	padding-bottom: 15px;
}

.filters-wrap .input {
	height: 36px;
	padding: 8px 10px;
	border-radius: 10px;
	font-size: 0.95rem;
	flex: 0 0 auto;
	width: 159px;
}

.filters-wrap select.input {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	background-image:
		linear-gradient(45deg, transparent 50%, currentColor 50%),
		linear-gradient(135deg, currentColor 50%, transparent 50%),
		linear-gradient(to right, transparent, transparent);
	background-position:
		calc(100% - 18px) 14px,
		calc(100% - 12px) 14px,
		0 0;
	background-size: 6px 6px, 6px 6px, 100% 100%;
	background-repeat: no-repeat;
	padding-right: 28px;
}

.filters-actions {
	display: inline-flex;
	gap: 6px;
	align-items: center;
	flex: 0 0 auto;
}

.filters-actions .btn-icon {
	width: 30px;
	height: 30px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border-radius: 10px;
}

.filters-actions .btn-icon i {
	font-size: 14px;
}

.pagination-wrap {
	display: flex;
	gap: 6px;
	align-items: center;
	justify-content: flex-end;
	flex: 0 0 auto;
}

.pagination-btn {
	min-width: 32px;
	height: 32px;
	text-align: center;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	background: #f9fafb;
	color: var(--text);
	transition: background .2s, border-color .2s, color .2s;
}

.pagination-btn:hover:not(.disabled):not(.is-active) {
	background: #f3f4f6;
	border-color: #9ca3af;
}

.pagination-btn.disabled {
	opacity: .5;
	pointer-events: none;
}

.pagination-btn.is-active {
	background: var(--accent2);
	color: #fff;
	border-color: var(--accent2);
	font-weight: 600;
}

.list-controls.is-sticky {
	position: sticky;
	top: 0;
	z-index: 5;
}

@media (max-width: 1200px) {
	.filters-wrap {
		flex-wrap: wrap;
		overflow-x: visible;
	}
}


/* =========================
   Modal
   ========================= */
.modal-overlay {
	position: fixed;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, .4);
	z-index: 1000;
}

.modal-overlay.is-open {
	display: flex;
}

.no-scroll {
	overflow: hidden;
}

.modal {
	background: var(--panel);
	color: var(--text);
	width: min(1000px, 92vw);
	border-radius: 16px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, .25);
	overflow: hidden;
}

.modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 16px;
	background: var(--panel);
	border-bottom: 1px solid #e5e7eb;
}

.modal-footer {
	display: flex;
	align-items: center;
	flex-direction: row;
	justify-content: flex-end;
	gap: 10px;
	padding: 12px 16px;
	background: var(--panel);
	border-bottom: 1px solid #e5e7eb;
	border-top: 1px solid #e5e7eb;
}

.modal-title {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 700;
}

.modal-close {
	border: 0;
	background: transparent;
	font-size: 1.4rem;
	cursor: pointer;
	line-height: 1;
}

.modal-body {
	padding: 12px 16px;
	max-height: 70vh;
	overflow: auto;
}

.loading,
.modal-empty {
	color: var(--muted);
}

.modal-error {
	color: #991b1b;
	background: #fde8e8;
	padding: .75rem;
	border-radius: 10px;
}


/* =========================
   Forms
   ========================= */
.form-grid {
	display: grid;
	gap: 12px;
}

.form-grid-2 {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
}

@media (max-width: 700px) {
	.form-grid-2 {
		grid-template-columns: 1fr;
	}
}

.fieldset-reset {
	border: 0;
	padding: 0;
	margin: 0;
}

.legend {
	font-weight: 600;
	margin-bottom: 6px;
	color: var(--text);
}

.row-inline {
	display: flex;
	align-items: center;
	gap: 18px;
	margin: 4px 0;
}

.row-inline label {
	display: flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
	font-size: 0.95rem;
}

.field-label {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
	color: var(--text);
}

.overview .field-label {
	color: var(--muted);
	font-size: .85rem;
	font-weight: 700;
}

.input {
	width: 100%;
	display: block;
	padding: 10px 12px;
	border: 1px solid #d1d5db;
	border-radius: 10px;
	background: var(--panel);
	color: var(--text);
	font: inherit;
	font-size: 0.95rem;
	line-height: 1.4;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea.input {
	min-height: 120px;
	resize: vertical;
}

.input:focus,
.input:hover {
	border-color: var(--accent4);
	box-shadow: 0 0 0 3px rgba(80, 106, 133, 0.15);
	outline: none;
}

.input:disabled {
	background: #f9fafb;
	color: #9ca3af;
	cursor: not-allowed;
}

.muted {
	color: var(--muted);
	font-size: 13px;
	margin-top: 2px;
}

.count {
	margin-top: 4px;
	color: var(--muted);
	font-size: 12px;
	text-align: right;
}

.hidden {
	display: none;
}

.status-pill {
	font-family: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
	display: inline-block;
	padding: 4px 10px;
	border-radius: 15px;
	font-size: 0.9rem;
	text-align: center;
}


/* =========================
   KPI Strip
   ========================= */
.kpi-strip {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
	gap: 16px;
	margin-bottom: 1rem;
}

.kpi-tile {
	background: var(--panel);
	border: 1.5px solid #eaecef;
	border-radius: 16px;
	padding: 18px 14px;
	text-align: center;
	box-shadow: var(--shadow);
}

.kpi-tile .val {
	font-size: 1.9rem;
	font-weight: 800;
	line-height: 1;
	color: var(--text);
}

.kpi-tile .label {
	margin-top: 8px;
	color: var(--muted);
	font-weight: 600;
}

@media (hover: hover) {
	.kpi-tile:hover {
		transform: translateY(-1px);
		box-shadow: 0 10px 24px rgba(0, 0, 0, .08);
		transition: .2s ease;
	}
}

.kpi-tile,
.kpi-tile:link,
.kpi-tile:visited,
.kpi-tile:hover,
.kpi-tile:focus,
.kpi-tile:active {
	text-decoration: none;
}


/* =========================
   Notice / alert banners
   ========================= */
.viewing-self-notice {
	background-color: rgba(161, 190, 212, 0.25);
	color: var(--brand);
	padding: 0.75rem 1.25rem;
	border-radius: 10px;
	margin-bottom: 1.5rem;
	border: 1px solid var(--accent4);
	font-size: 0.95rem;
}


/* =========================
   Empty state
   ========================= */
.empty-state {
	padding: 24px 16px;
	text-align: center;
	color: var(--muted);
}

.empty-state h3 {
	margin: 0;
	font-size: 1rem;
	font-weight: 600;
}


/* =========================
   Overview panel + fields
   ========================= */
.overview {
	background: var(--panel);
	border: 1px solid #e6eaef;
	border-radius: 14px;
	padding: 24px;
	box-shadow: 0 4px 14px rgba(0, 0, 0, .04);
	margin-bottom: 15px;
}

.section-title {
	font-family: 'Flight', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
	font-size: 2.5rem;
	font-weight: normal !important;
	margin: 0;
	border-radius: 15px;
}

.overview-header {
	display: flex;
	flex-direction: column;
	gap: .4rem;
	margin-bottom: 1rem;
}

.overview-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 18px 24px;
}

.field {
	min-width: 0;
}

.field.span-2 {
	grid-column: 1 / -1;
}

.field-value {
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	padding: 10px 12px;
	min-height: 38px;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
}

.tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.tag {
	background: #eef3f8;
	border-radius: 8px;
	padding: 3px 10px;
	font-size: .8rem;
	font-weight: 600;
}

.whatwedo-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.whatwedo-tags .tag {
	background: #eef2ff;
	border: 1px solid #c7d2fe;
	color: #3730a3;
	font-weight: 600;
	font-size: .8rem;
	border-radius: 12px;
	padding: 4px 10px;
	line-height: 1;
	white-space: nowrap;
}


/* =========================
   Organisation profile layout
   ========================= */
.org-profile-comments-wrap {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
	gap: 16px;
	align-items: start;
	margin-top: 16px;
}

.org-profile-section,
.comments-section {
	margin-bottom: 0;
}

.org-profile-left-column {
	display: grid;
	gap: 16px;
}

.contacts-section {
	margin-bottom: 0;
}

.contacts-table {
	font-size: 0.9rem;
}

.contacts-table th,
.contacts-table td {
	white-space: nowrap;
}

@media (max-width: 1100px) {
	.org-profile-comments-wrap {
		grid-template-columns: 1fr;
	}
}


/* =========================
   Comments
   ========================= */
.comments-list {
	display: grid;
	gap: 12px;
}

.comment-card {
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 12px 14px;
	background: #fff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.comment-meta {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	color: var(--muted);
	font-size: 0.85rem;
	margin-bottom: 8px;
}

.comment-meta strong {
	color: var(--text);
}

.comment-body {
	white-space: normal;
	line-height: 1.5;
}


/* =========================
   Timeline
   ========================= */
.timeline {
	display: grid;
	gap: 12px;
}

.timeline-group {
	margin-top: 10px;
}

.timeline-group-title {
	font-size: 0.75rem;
	text-transform: uppercase;
	color: var(--muted);
	margin-bottom: 6px;
}

.timeline-item {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	padding: 8px 0;
	border-bottom: 1px solid #f1f5f9;
}

.timeline-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #3b82f6;
	margin-top: 6px;
	flex-shrink: 0;
}

.timeline-content {
	flex: 1;
}

.timeline-title {
	font-weight: 600;
	font-size: 0.9rem;
}

.timeline-meta {
	font-size: 0.8rem;
	color: var(--muted);
}


/* =========================
   Footer
   ========================= */
.footer {
	text-align: center;
	padding: 2px 0;
	background-color: var(--brand);
	color: #fff;
	width: 100%;
	font-size: 14px;
	margin-top: auto;
}

.footer a {
	color: #fff;
	text-decoration: none;
}

.footer a:hover {
	text-decoration: underline;
}


/* =========================
   Dashboard Funnel
   ========================= */
.funnel-dashboard {
	display: grid;
	grid-template-columns: minmax(280px, 520px) 1fr;
	gap: 24px;
	align-items: start;
	margin-top: 20px;
}

.funnel-visual {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
}

.funnel-row {
	position: relative;
	height: 74px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 0 18px;
	color: #fff;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	box-shadow: 0 10px 22px rgba(48, 54, 59, 0.12);
	border: 1px solid rgba(255, 255, 255, 0.35);
	text-decoration: none;
	transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.funnel-row:hover {
	text-decoration: none;
	transform: translateX(2px);
	opacity: 0.95;
}

.funnel-row .funnel-stage {
	font-size: 1.05rem;
}

.funnel-row .funnel-count {
	font-size: 1.5rem;
	font-weight: 900;
	opacity: 0.95;
	letter-spacing: 0.01em;
	text-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
}

.funnel-row .funnel-sep {
	opacity: 0.4;
	font-weight: 400;
	font-size: 1.1rem;
}

.funnel-row.is-active {
	box-shadow:
		0 0 0 3px #fffc04,
		0 6px 24px rgba(0, 0, 0, 0.35);
	transform: scaleX(1.025);
	z-index: 2;
}

.funnel-row.is-active::after {
	content: "";
	position: absolute;
	right: -18px;
	top: 50%;
	transform: translateY(-50%);
	width: 0;
	height: 0;
	border-top: 10px solid transparent;
	border-bottom: 10px solid transparent;
	border-left: 14px solid #fffc04;
	z-index: 3;
}

.funnel-audience {
	width: 100%;
	background: #a1bed4;
	border-radius: 18px 18px 10px 10px;
}

.funnel-awareness {
	width: 82%;
	background: #8aa4ba;
	border-radius: 12px;
}

.funnel-intent {
	width: 66%;
	background: #506a85;
	border-radius: 12px;
}

.funnel-conversation {
	width: 50%;
	background: #3b4c5d;
	border-radius: 12px;
}

.funnel-opportunity {
	width: 36%;
	background: #263847;
	border-radius: 12px 12px 18px 18px;
}

.intent-table-card {
	position: relative;
	margin: 0;
	border: 2px solid #e5e7eb;
	border-radius: var(--r-lg);
}

.intent-table-card.stage-audience  { border-color: #a1bed4; }
.intent-table-card.stage-awareness { border-color: #8aa4ba; }
.intent-table-card.stage-intent    { border-color: #506a85; }
.intent-table-card.stage-conversation { border-color: #3b4c5d; }
.intent-table-card.stage-opportunity  { border-color: #263847; }

.intent-table-card .panel-header {
	margin-bottom: 12px;
}

.intent-table-card h2 {
	margin: 0;
	font-size: 1.2rem;
}

.intent-table-card p {
	margin: 4px 0 0;
	color: var(--muted);
	font-size: 0.9rem;
}

.intent-table {
	font-size: 0.85rem;
}

.intent-table th,
.intent-table td {
	white-space: nowrap;
}

.intent-table td:first-child {
	max-width: 260px;
}

@media (max-width: 900px) {
	.funnel-dashboard {
		grid-template-columns: 1fr;
	}

	.funnel-row {
		height: 64px;
	}

	.funnel-row .funnel-stage {
		font-size: 1rem;
	}
}


/* =========================
   Admin — topbar viewing badge
   ========================= */
.admin-viewing-badge {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	background: rgba(255, 252, 4, 0.12);
	border: 1px solid rgba(255, 252, 4, 0.35);
	border-radius: 20px;
	padding: 3px 10px 3px 8px;
	font-size: 0.85rem;
	font-weight: 600;
	color: #fff;
	white-space: nowrap;
	max-width: 260px;
	overflow: hidden;
	text-overflow: ellipsis;
}

.admin-viewing-label {
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--accent);
	flex-shrink: 0;
}

.admin-badge {
	background: rgba(255, 252, 4, 0.15);
	border: 1px solid rgba(255, 252, 4, 0.4);
	border-radius: 20px;
	padding: 2px 10px;
	font-size: 0.8rem;
	font-weight: 700;
	color: var(--accent);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.topbar-switch-btn {
	border: 1px solid rgba(255, 255, 255, 0.25);
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
	font-size: 0.8rem;
	padding: 4px 10px;
	border-radius: 6px;
	white-space: nowrap;
}

.topbar-switch-btn:hover {
	background: rgba(255, 252, 4, 0.15);
	border-color: rgba(255, 252, 4, 0.5);
	color: var(--accent);
	text-decoration: none;
}

@media (max-width: 600px) {
	.admin-viewing-badge {
		max-width: 120px;
	}
}

/* =========================
   Mobile Responsive
   =========================
   Progressive overrides for tablet and phone viewports.
   Append-only — does not touch any existing desktop rule.
*/

/* ---- Tablet & below (≤1024px) ---- */
@media (max-width: 1024px) {

	.container {
		padding: 0 12px;
		margin: calc(var(--topbar-h) + 16px) auto 32px;
	}

	.section-title {
		font-size: 2rem;
		line-height: 1.1;
	}

	.page-title {
		font-size: 1.6rem;
	}

	.card {
		padding: 0.85rem;
	}

	.overview-grid {
		gap: 14px 18px;
	}

	.rep-section-head {
		flex-wrap: wrap;
	}
}

/* ---- Phone (≤768px) ---- */
@media (max-width: 768px) {

	/* ---------- Topbar ---------- */
	.topbar {
		padding: 0 0.6rem;
	}

	.topbar .brand-logo {
		max-height: 32px;
		width: auto;
	}

	.topbar-actions {
		gap: 6px;
	}

	.whoami {
		font-size: 0.85rem;
		max-width: 110px;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.admin-viewing-badge {
		max-width: 140px;
		font-size: 0.75rem;
		padding: 2px 8px 2px 6px;
	}

	.admin-viewing-label {
		display: none;
	}

	.topbar-switch-btn {
		font-size: 0.7rem;
		padding: 3px 7px;
	}

	.logout-icon {
		width: 32px;
		height: 32px;
		margin-left: 6px;
		font-size: 18px;
	}

	/* ---------- Headings ---------- */
	.section-title {
		font-size: 1.75rem;
	}

	.page-title {
		font-size: 1.35rem;
	}

	/* ---------- Containers ---------- */
	.container {
		padding: 0 10px;
		margin: calc(var(--topbar-h) + 12px) auto 24px;
	}

	.card {
		padding: 0.75rem;
		border-radius: 12px;
	}

	.overview {
		padding: 16px;
		border-radius: 12px;
	}

	/* ---------- Inputs (prevent iOS zoom-on-focus) ---------- */
	.input,
	.table-search,
	.search-box .table-search,
	select.input,
	textarea.input,
	input[type="text"],
	input[type="search"],
	input[type="email"],
	input[type="password"],
	input[type="date"],
	input[type="time"],
	input[type="number"],
	input[type="tel"],
	select,
	textarea {
		font-size: 16px;
	}

	/* ---------- Buttons (bigger tap targets) ---------- */
	.btn {
		padding: 10px 14px;
		font-size: 14px;
	}

	.btn-mini {
		padding: 6px 10px;
		font-size: 0.78rem;
	}

	/* ---------- Tables (generic) ---------- */
	.table,
	#clients-overview {
		font-size: 0.85rem;
	}

	.table th,
	.table td,
	#clients-overview th,
	#clients-overview td {
		padding: 0.5rem 0.55rem;
	}

	.table td:first-child,
	#clients-overview td:first-child {
		max-width: 200px;
	}

	/* ---------- Funnel dashboard — 5-column grid ---------- */
	.funnel-dashboard {
		gap: 14px;
	}

	.funnel-visual {
		display: grid;
		grid-template-columns: repeat(5, 1fr);
		gap: 6px;
		padding: 2px 2px 6px;
		align-items: stretch;
	}

	.funnel-row {
		height: auto;
		min-width: 0;
		padding: 8px 4px;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 2px;
		box-shadow: 0 4px 10px rgba(48, 54, 59, 0.10);
	}

	/* Override the desktop tapered widths so each pill fills its column */
	.funnel-audience,
	.funnel-awareness,
	.funnel-intent,
	.funnel-conversation,
	.funnel-opportunity {
		width: auto;
		border-radius: 12px;
	}

	.funnel-row .funnel-stage {
		font-size: 0.5rem;
		line-height: 1.1;
		letter-spacing: 0.02em;
		text-align: center;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: clip;
		max-width: 100%;
	}

	.funnel-row .funnel-sep {
		display: none;
	}

	.funnel-row .funnel-count {
		font-size: 1.05rem;
		line-height: 1;
		font-weight: 900;
		text-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
	}

	.funnel-row.is-active {
		outline: 2px solid var(--accent);
		outline-offset: 2px;
		transform: none;
	}

	.funnel-row.is-active::after {
		display: none;
	}

	/* ---------- Funnel table — Company Name + Score only ---------- */
	.intent-table th:nth-child(n+3),
	.intent-table td:nth-child(n+3) {
		display: none;
	}

	.intent-table th,
	.intent-table td {
		white-space: normal;
	}

	.intent-table td:first-child {
		max-width: none;
		overflow: visible;
		text-overflow: clip;
		text-align: left;
	}

	.intent-table th:nth-child(2),
	.intent-table td:nth-child(2) {
		width: 70px;
		white-space: nowrap;
	}

	.intent-table {
		font-size: 0.95rem;
	}

	/* ---------- Search box ---------- */
	.search-box {
		width: 100%;
	}

	/* ---------- KPI strip ---------- */
	.kpi-strip {
		grid-template-columns: 1fr 1fr;
		gap: 10px;
	}

	.kpi-tile {
		padding: 12px 10px;
		border-radius: 12px;
	}

	.kpi-tile .val {
		font-size: 1.5rem;
	}

	.kpi-tile .label {
		font-size: 0.8rem;
	}

	/* ---------- Overview grid ---------- */
	.overview-grid {
		grid-template-columns: 1fr;
		gap: 12px;
	}

	/* ---------- Pagination ---------- */
	.pagination-wrap {
		justify-content: center;
	}

	.pagination-btn {
		min-width: 36px;
		height: 36px;
	}

	/* ---------- Dashboard Marketing Calendar widget ---------- */
	.dash-cal-header {
		flex-direction: column;
		align-items: stretch;
		gap: 10px;
	}

	.dash-cal-header-btn {
		align-self: flex-start;
	}

	/* ---------- Modal ---------- */
	.modal {
		width: min(1000px, 96vw);
		border-radius: 12px;
	}

	.modal-header,
	.modal-footer {
		padding: 10px 12px;
	}

	.modal-body {
		padding: 10px 12px;
		max-height: 65vh;
	}

	/* ---------- Forms ---------- */
	.form-grid-2 {
		grid-template-columns: 1fr;
	}

	/* ---------- Reporting ---------- */
	.rep-tile-grid-5,
	.rep-tile-grid-4,
	.rep-tile-grid-2 {
		grid-template-columns: 1fr 1fr;
	}

	.rep-tile-value {
		font-size: 1.25rem;
	}

	.rep-section-head {
		flex-direction: column;
		gap: 6px;
	}

	.rep-section-meta {
		white-space: normal;
	}

	/* ---------- FullCalendar toolbar ---------- */
	.fc .fc-toolbar.fc-header-toolbar {
		flex-direction: column;
		gap: 8px;
		align-items: stretch;
	}

	.fc .fc-toolbar-chunk {
		display: flex;
		justify-content: center;
		gap: 6px;
	}

	.fc .fc-toolbar-title {
		font-size: 1.1rem !important;
		text-align: center;
	}

	/* ---------- Org profile timeline & comments ---------- */
	.timeline-item {
		gap: 8px;
	}

	.timeline-meta {
		font-size: 0.75rem;
	}

	.comment-meta {
		flex-direction: column;
		gap: 2px;
		align-items: flex-start;
	}

	/* ---------- Login card ---------- */
	.login-card {
		width: calc(100% - 24px);
		max-width: 380px;
		padding: 2rem 1.4rem;
	}

	.login-card input,
	.login-card .btn-primary {
		width: 100%;
		box-sizing: border-box;
	}

	body.login-page {
		height: 100dvh;
	}
}

/* ---- Small phone (≤480px) ---- */
@media (max-width: 480px) {

	.section-title {
		font-size: 1.45rem;
	}

	.page-title {
		font-size: 1.2rem;
	}

	.topbar .brand-logo {
		max-height: 28px;
	}

	/* Free up the topbar — hide the username (logout icon stays).
	   Selector keeps the admin badge visible. */
	.whoami:not(.admin-badge) {
		display: none;
	}

	/* KPI strip → single column */
	.kpi-strip {
		grid-template-columns: 1fr;
	}

	.kpi-tile .val {
		font-size: 1.6rem;
	}

	/* Funnel — keep all 5 stages but shrink further */
	.funnel-visual {
		gap: 4px;
	}

	.funnel-row {
		padding: 6px 3px;
	}

	.funnel-row .funnel-stage {
		font-size: 0.4rem;
		letter-spacing: 0;
	}

	.funnel-row .funnel-count {
		font-size: 0.95rem;
	}

	/* Reporting tiles → 1 column */
	.rep-tile-grid-5,
	.rep-tile-grid-4,
	.rep-tile-grid-2 {
		grid-template-columns: 1fr;
	}

	/* Dashboard mini-calendar cells */
	.dash-cal-cell {
		min-height: 56px !important;
		padding: 4px !important;
	}

	.dash-cal-chip {
		font-size: 0.6rem !important;
		padding: 1px 4px !important;
	}
}