/* ===========================================================================
   HCP Management app — base styles shared by every page.
   Tokens are lifted from the Hebert Community Partners design system.
   =========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600&family=Source+Sans+3:wght@400;500;600;700&display=swap');

:root {
	/* Brand */
	--hcp-deep-navy: #081B37;
	--hcp-navy: #183150;
	--hcp-green: #4C6F4B;
	--hcp-soft-green: #819976;

	--navy-500: #2A456C;
	--navy-200: #B6C2D3;
	--navy-100: #E2E8F0;
	--navy-50: #F2F5F9;

	--grey-800: #3D454C;
	--grey-700: #58656F;
	--grey-600: #6E7A83;
	--grey-500: #8C969E;
	--grey-400: #AEB5B9;
	--grey-300: #C9CED1;
	--grey-200: #E1E4E6;
	--grey-150: #EBEDEE;
	--grey-100: #F2F4F5;
	--grey-50: #F8FAFB;
	--white: #fff;

	--status-danger: #9C3B33;
	--status-danger-bg: #F4E0DE;

	--text-strong: var(--hcp-deep-navy);
	--text-body: var(--grey-800);
	--text-muted: var(--grey-700);
	--text-subtle: var(--grey-500);
	--text-on-dark-muted: #AEB9CC;
	--surface-page: #FBFBF9;

	--font-display: 'Cormorant Garamond', Georgia, serif;
	--font-body: 'Source Sans 3', system-ui, -apple-system, sans-serif;

	--radius-sm: 5px;
	--radius-md: 8px;
	--radius-lg: 12px;
	--radius-pill: 999px;

	--shadow-sm: 0 1px 2px rgba(8,27,55,.06), 0 2px 6px rgba(8,27,55,.06);
	--shadow-lg: 0 8px 24px rgba(8,27,55,.10), 0 2px 6px rgba(8,27,55,.06);

	--focus-ring: 0 0 0 3px rgba(24,49,80,.28);
}

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

body {
	margin: 0;
	background: var(--surface-page);
	color: var(--text-body);
	font: 400 16px/1.5 var(--font-body);
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; color: var(--text-strong); font-weight: 600; }
h1 { font-family: var(--font-display); font-size: 34px; line-height: 1.1; }
h2 { font-family: var(--font-display); font-size: 24px; line-height: 1.15; }
p { margin: 0; }
a { color: var(--hcp-navy); text-decoration: none; }
a:hover { color: var(--hcp-green); }
img { display: block; max-width: 100%; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }
[hidden] { display: none !important; }

/* ---- App header ---------------------------------------------------------- */
.app-header {
	position: sticky; top: 0; z-index: 30;
	display: flex; align-items: center; gap: 24px;
	min-height: 64px; padding: 0 20px;
	background: var(--hcp-deep-navy); color: var(--white);
}
.app-brand { display: flex; align-items: center; gap: 12px; }
.app-brand img { height: 28px; width: auto; }
.app-brand span {
	padding-left: 12px; border-left: 1px solid rgba(255,255,255,.16);
	font-family: var(--font-display); font-size: 19px; font-weight: 600;
}
.app-nav ul { display: flex; gap: 2px; margin: 0; padding: 0; list-style: none; }
.app-nav a {
	display: flex; align-items: center; height: 64px; padding: 0 14px;
	font-size: 14px; font-weight: 500; color: var(--text-on-dark-muted);
	border-bottom: 2px solid transparent;
}
.app-nav a:hover { color: var(--white); }
.app-nav a[aria-current="page"] { color: var(--white); font-weight: 600; border-bottom-color: var(--hcp-soft-green); }
.app-user { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--text-on-dark-muted); }
.app-user strong { color: var(--white); font-weight: 600; }
.app-menu-toggle { display: none; }

/* The second row of the menu, inside a group such as Financials or Leasing. */
.app-subnav { padding: 0 20px; background: var(--white); border-bottom: 1px solid var(--grey-200); }
.app-subnav ul { display: flex; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.app-subnav a {
	display: flex; align-items: center; height: 40px; padding: 0 12px;
	font-size: 13px; font-weight: 600; color: var(--grey-700);
	border-bottom: 2px solid transparent;
}
.app-subnav a:hover { color: var(--hcp-deep-navy); }
.app-subnav a[aria-current="page"] { color: var(--hcp-deep-navy); border-bottom-color: var(--hcp-green); }

main { padding: 24px 20px 64px; margin: 0 auto; }

/* ---- Buttons ------------------------------------------------------------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 42px; padding: 0 20px;
	font: 600 14.5px/1 var(--font-body); letter-spacing: .01em;
	border-radius: var(--radius-md); border: 1.5px solid transparent;
	cursor: pointer; white-space: nowrap;
	transition: background 120ms ease, border-color 120ms ease;
}
.btn--primary { background: var(--hcp-deep-navy); border-color: var(--hcp-deep-navy); color: var(--white); }
.btn--primary:hover { background: #102643; border-color: #102643; }
.btn--accent { background: var(--hcp-green); border-color: var(--hcp-green); color: var(--white); }
.btn--accent:hover { background: #3F5C3D; border-color: #3F5C3D; }
.btn--secondary { background: transparent; border-color: var(--grey-400); color: var(--hcp-deep-navy); }
.btn--secondary:hover { background: var(--navy-50); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--status-danger); }
.btn--sm { min-height: 34px; padding: 0 14px; font-size: 13px; }
.btn--lg { min-height: 48px; font-size: 16px; }
.btn--block { width: 100%; }
.btn--on-dark { background: transparent; border-color: rgba(255,255,255,.28); color: var(--white); }
.btn--on-dark:hover { background: rgba(255,255,255,.12); }
.btn__badge {
	display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px;
	background: var(--hcp-deep-navy); border-radius: var(--radius-pill);
	color: var(--white); font-size: 12px; font-variant-numeric: tabular-nums;
}

/* ---- Forms --------------------------------------------------------------- */
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--text-strong); }
input[type="text"], input[type="search"], input[type="number"], input[type="password"], select, textarea {
	width: 100%; min-height: 42px; padding: 9px 12px;
	background: var(--white); border: 1.5px solid var(--grey-300);
	border-radius: var(--radius-md); font: 400 14.5px/1.4 var(--font-body); color: var(--text-body);
}
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--hcp-navy); box-shadow: var(--focus-ring); }
::placeholder { color: var(--text-subtle); }
input[type="checkbox"] { width: 16px; height: 16px; min-height: 0; accent-color: var(--hcp-green); }

/* ---- Surfaces ------------------------------------------------------------ */
.card {
	background: var(--white); border: 1px solid var(--grey-200);
	border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.card__head {
	display: flex; align-items: center; gap: 12px;
	padding: 10px 14px; border-bottom: 1px solid var(--grey-150);
}
.card__head h2, .card__head legend { margin: 0; padding: 0; font: 600 20px/1.15 var(--font-display); color: var(--text-strong); }
.card__head h3 { font: 600 18px/1.15 var(--font-display); }
.card__head .end { margin-left: auto; }
.card__body { padding: 12px 14px 14px; }
.card__note { font-size: 12.5px; color: var(--text-muted); }

/* A green confirmation that sits in the page, such as "Sent to ..." or "Signed ...". */
.note-ok {
	display: block; padding: 8px 10px; border-radius: var(--radius-md);
	background: #E4EBE1; border: 1px solid #C7D2C2;
	font: 600 12.5px/1.35 var(--font-body); color: #3F5C3D;
}
.note-ok:empty { display: none; }
.alert {
	padding: 10px 12px; border-radius: var(--radius-md);
	background: var(--status-danger-bg); border: 1.5px solid #E7C6C2;
	font: 600 14px/1.35 var(--font-body); color: var(--status-danger);
}
.inline-error { font: 600 13.5px/1.3 var(--font-body); color: var(--status-danger); }

/* Dense staff forms: a label over a 36px control (44px on phones). */
.compact label, .compact .labelled { display: grid; gap: 4px; align-content: start; min-width: 0; }
.compact label > span:first-child, .compact .labelled > span:first-child { font: 600 12px/1.2 var(--font-body); color: var(--text-strong); }
.compact input[type="text"], .compact input[type="email"], .compact input[type="number"],
.compact input[type="date"], .compact select {
	width: 100%; height: 36px; min-height: 0; padding: 0 10px;
	border: 1.5px solid var(--grey-300); border-radius: var(--radius-md);
	background: var(--white); font: 400 14px/1.2 var(--font-body); color: var(--text-body);
}
.compact select { padding: 0 8px; }
.compact input[type="number"] { font-variant-numeric: tabular-nums; }

.eyebrow { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--hcp-green); font-weight: 600; }
.muted { color: var(--text-muted); font-size: 13px; }
.pill {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 4px 10px; border-radius: var(--radius-pill);
	font-size: 12px; font-weight: 600; letter-spacing: .01em; white-space: nowrap;
}
.page-message { margin: 0 0 16px; padding: 12px; border-radius: var(--radius-md); font-size: 14px; font-weight: 600; }
.page-message[data-kind="error"] { background: var(--status-danger-bg); border: 1.5px solid #E7C6C2; color: var(--status-danger); }
.page-message[data-kind="ok"] { background: #E4EBE1; border: 1.5px solid #C7D2C2; color: #3F5C3D; }

/* ---- Login --------------------------------------------------------------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--hcp-deep-navy); }
.login-card { width: 100%; max-width: 380px; padding: 28px; background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.login-card img { height: 30px; margin-bottom: 20px; }
.login-card form { display: grid; gap: 14px; margin-top: 18px; }

/* ---- Mobile -------------------------------------------------------------- */
@media (max-width: 900px) {
	.app-header { flex-wrap: wrap; gap: 10px; padding: 10px 14px; min-height: 0; }
	.app-menu-toggle {
		display: grid; place-items: center; order: -1;
		width: 38px; height: 38px; background: rgba(255,255,255,.1);
		border: 0; border-radius: var(--radius-md); cursor: pointer;
	}
	.app-menu-toggle svg { width: 17px; height: 13px; stroke: var(--white); stroke-width: 1.8; fill: none; }
	.app-brand span { font-size: 17px; }
	.app-nav { order: 3; flex-basis: 100%; }
	.app-nav[hidden] { display: none; }
	.app-nav ul { display: grid; padding: 4px 0 8px; border-top: 1px solid rgba(255,255,255,.14); }
	.app-nav a { height: auto; min-height: 46px; padding: 0 10px; border-bottom: 0; border-radius: var(--radius-md); font-size: 15px; }
	.app-nav a[aria-current="page"] { background: rgba(255,255,255,.1); }
	.app-user { margin-left: auto; font-size: 12px; }
	.app-user span { display: none; }
	main { padding: 16px 14px 56px; }
	.app-subnav { padding: 0 14px; }
	.app-subnav a { height: 44px; font-size: 14px; }
	.compact input[type="text"], .compact input[type="email"], .compact input[type="number"],
	.compact input[type="date"], .compact select { height: 44px; font-size: 15px; }
	h1 { font-size: 26px; }
}

/* Save note: one for every staff page (#save-note in base.html) */
#save-note { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; border-radius: var(--radius-pill); background: var(--hcp-deep-navy); color: var(--white); font: 600 13px/1 var(--font-body); box-shadow: 0 8px 24px rgba(8, 27, 55, .22); }
#save-note[hidden] { display: none; }
#save-note[data-failed] { background: var(--status-danger); }
@media (max-width: 900px) { #save-note { left: 12px; right: 12px; bottom: 12px; justify-content: center; min-height: 44px; } }
