/**
 * Tanova agent portal — Phase 10.
 *
 * Front-end, standalone, mobile-first. Agents quote from phones at trade shows
 * and in vehicles, so this is the one surface where small screens are the
 * primary target rather than the fallback.
 *
 * Follows the BEM convention already established in tanova-planner.css
 * (tnvp-block__element--modifier) so the two read as one system.
 */

:root {
	--tnvp-brand: #295552;
	--tnvp-brand-ink: #1d3f3d;
	--tnvp-gold: #9a8319;

	--tnvp-bg: #f5f7f7;
	--tnvp-panel: #fff;
	--tnvp-line: #e3e8e7;
	--tnvp-line-soft: #eef2f1;

	--tnvp-ink: #14201f;
	--tnvp-ink-soft: #5b6b69;
	--tnvp-ink-faint: #8b9a98;

	--tnvp-r: 12px;
	--tnvp-shadow: 0 1px 3px rgba(16, 24, 40, .06);
}

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

body.tnvp-portal {
	margin: 0;
	background: var(--tnvp-bg);
	color: var(--tnvp-ink);
	font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 15px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

/* ── Top bar ──────────────────────────────────────────────────────────── */
.tnvp-bar {
	display: flex; align-items: center; gap: 20px;
	padding: 0 20px; height: 58px;
	background: var(--tnvp-panel); border-bottom: 1px solid var(--tnvp-line);
	position: sticky; top: 0; z-index: 10;
}
.tnvp-bar__brand {
	display: flex; align-items: center; gap: 10px;
	text-decoration: none; color: var(--tnvp-ink); font-weight: 650;
}
.tnvp-bar__brand img { max-height: 30px; max-width: 140px; }
.tnvp-bar__mark {
	width: 30px; height: 30px; border-radius: 9px;
	background: var(--tnvp-brand); color: #fff;
	display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.tnvp-bar__nav { display: flex; gap: 4px; }
.tnvp-bar__nav a {
	padding: 7px 13px; border-radius: 8px; text-decoration: none;
	color: var(--tnvp-ink-soft); font-size: 14px; font-weight: 550;
}
.tnvp-bar__nav a:hover { background: var(--tnvp-line-soft); color: var(--tnvp-brand-ink); }
.tnvp-bar__right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.tnvp-tier {
	font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
	color: var(--tnvp-gold); background: #fdf8e8; border: 1px solid #f0e6c0;
	padding: 3px 9px; border-radius: 999px;
}
.tnvp-signout { font-size: 13px; color: var(--tnvp-ink-faint); text-decoration: none; }
.tnvp-signout:hover { color: var(--tnvp-brand); }

/* ── Layout ───────────────────────────────────────────────────────────── */
.tnvp-main { max-width: 1080px; margin: 0 auto; padding: 28px 20px 60px; }
.tnvp-h1 { font-size: 26px; font-weight: 650; letter-spacing: -.02em; margin: 0 0 22px; }

.tnvp-kpis {
	display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 14px; margin-bottom: 24px;
}
.tnvp-kpi {
	background: var(--tnvp-panel); border: 1px solid var(--tnvp-line);
	border-radius: var(--tnvp-r); padding: 16px 18px; box-shadow: var(--tnvp-shadow);
}
.tnvp-kpi .l {
	display: block; font-size: 11px; font-weight: 600; letter-spacing: .06em;
	text-transform: uppercase; color: var(--tnvp-ink-faint);
}
.tnvp-kpi .v {
	display: block; margin-top: 6px; font-size: 26px; font-weight: 680;
	letter-spacing: -.025em; font-variant-numeric: tabular-nums;
}

.tnvp-panel {
	background: var(--tnvp-panel); border: 1px solid var(--tnvp-line);
	border-radius: var(--tnvp-r); box-shadow: var(--tnvp-shadow); overflow: hidden;
}
.tnvp-panel h2 {
	margin: 0; padding: 15px 18px; font-size: 14px; font-weight: 650;
	border-bottom: 1px solid var(--tnvp-line-soft);
}
.tnvp-empty { padding: 40px 18px; text-align: center; color: var(--tnvp-ink-faint); margin: 0; }

/* ── Table ────────────────────────────────────────────────────────────── */
.tnvp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tnvp-table th {
	text-align: left; padding: 11px 18px; font-size: 11px; font-weight: 700;
	letter-spacing: .06em; text-transform: uppercase; color: var(--tnvp-ink-faint);
	border-bottom: 1px solid var(--tnvp-line);
}
.tnvp-table td { padding: 13px 18px; border-bottom: 1px solid var(--tnvp-line-soft); }
.tnvp-table tr:last-child td { border-bottom: none; }
.tnvp-table .r { text-align: right; font-variant-numeric: tabular-nums; }
.tnvp-link { color: var(--tnvp-brand); font-weight: 550; text-decoration: none; }
.tnvp-link:hover { text-decoration: underline; }

/* Status pills — same semantic ramp as the operator admin. */
.tnvp-pill {
	display: inline-block; font-size: 11px; font-weight: 650;
	padding: 3px 10px; border-radius: 999px; background: var(--tnvp-line-soft); color: var(--tnvp-ink-soft);
}
.tnvp-pill.enquiry     { background: #fef3e6; color: #a6771f; }
.tnvp-pill.quote,
.tnvp-pill.sent        { background: #e9eefb; color: #3858a6; }
.tnvp-pill.provisional { background: #fdf4e3; color: #8a6d1a; }
.tnvp-pill.confirmed,
.tnvp-pill.accepted    { background: #e7f5ec; color: #2f7d52; }
.tnvp-pill.travelling  { background: #e6f2f1; color: #1f6b66; }
.tnvp-pill.completed   { background: #eee;    color: var(--tnvp-ink-soft); }
.tnvp-pill.cancelled,
.tnvp-pill.declined    { background: #fdece9; color: #b0432f; }

/* ── Sign in ──────────────────────────────────────────────────────────── */
.tnvp-auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.tnvp-auth__card {
	width: 100%; max-width: 380px; background: var(--tnvp-panel);
	border: 1px solid var(--tnvp-line); border-radius: 16px;
	padding: 34px 30px; box-shadow: 0 12px 40px -20px rgba(16, 24, 40, .3);
}
.tnvp-auth__card h1 { margin: 0; font-size: 22px; font-weight: 680; letter-spacing: -.02em; }
.tnvp-auth__sub {
	margin: 4px 0 22px; font-size: 12px; font-weight: 600;
	letter-spacing: .1em; text-transform: uppercase; color: var(--tnvp-ink-faint);
}
.tnvp-auth__err {
	background: #fdece9; color: #b0432f; border-radius: 8px;
	padding: 10px 12px; font-size: 13px; margin: 0 0 16px;
}
.tnvp-auth__card label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.tnvp-auth__card input[type=text],
.tnvp-auth__card input[type=password] {
	width: 100%; padding: 11px 13px; margin-bottom: 15px;
	border: 1px solid var(--tnvp-line); border-radius: 9px; font-size: 15px;
	background: #fff; color: var(--tnvp-ink);
}
.tnvp-auth__card input:focus {
	outline: none; border-color: var(--tnvp-brand);
	box-shadow: 0 0 0 3px rgba(41, 85, 82, .14);
}
.tnvp-auth__card input[type=submit] {
	width: 100%; padding: 12px; border: none; border-radius: 9px; cursor: pointer;
	background: var(--tnvp-brand); color: #fff; font-size: 15px; font-weight: 650;
}
.tnvp-auth__card input[type=submit]:hover { background: var(--tnvp-brand-ink); }
.tnvp-auth__card .login-remember { font-weight: 400; font-size: 13px; }
.tnvp-auth__lost {
	display: block; margin-top: 16px; text-align: center;
	font-size: 13px; color: var(--tnvp-ink-faint); text-decoration: none;
}
.tnvp-auth__lost:hover { color: var(--tnvp-brand); }

.tnvp-foot {
	text-align: center; padding: 22px; font-size: 12px; color: var(--tnvp-ink-faint);
}

/* ── Mobile ───────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
	.tnvp-bar { gap: 10px; padding: 0 12px; }
	.tnvp-bar__nav a { padding: 7px 8px; font-size: 13px; }
	.tnvp-tier { display: none; }
	/* Long agency names must truncate, not wrap the bar onto two lines. */
	.tnvp-bar__brand { min-width: 0; }
	.tnvp-bar__brand span:not(.tnvp-bar__mark) {
		overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 34vw;
	}
	.tnvp-signout { white-space: nowrap; }
	.tnvp-main { padding: 20px 14px 50px; }
	.tnvp-h1 { font-size: 21px; }

	/* Tables become stacked cards — a 6-column table is unusable at 360px. */
	.tnvp-table thead { display: none; }
	.tnvp-table, .tnvp-table tbody, .tnvp-table tr, .tnvp-table td { display: block; width: 100%; }
	.tnvp-table tr {
		border-bottom: 1px solid var(--tnvp-line);
		padding: 12px 16px;
	}
	.tnvp-table tr:last-child { border-bottom: none; }
	.tnvp-table td { border: none; padding: 3px 0; }
	.tnvp-table td.r { text-align: left; font-weight: 650; }
}
