/*
 * Tech appointment map — internal dispatch tool.
 *
 * This page loads NO theme CSS (see bbe_map_strip_site_assets), so this file
 * is the whole stylesheet and has to supply its own reset and typography.
 * Brand palette: green #003407, rust #b2400e, body #242424, hairline #e6e4e4.
 */

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

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

body.bbe-map-body {
	display: flex;
	flex-direction: column;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 16px;
	line-height: 1.5;
	color: #242424;
	background: #fff;
	-webkit-font-smoothing: antialiased;
}

/* Password gate, shown before any appointment data exists. */

.bbe-map-lock {
	max-width: 30rem;
	margin: 4rem auto;
	padding: 0 1.25rem;
}

.bbe-map-lock h1 {
	font-size: 1.4rem;
	color: #003407;
	margin: 0 0 0.5rem;
}

.bbe-map-lock p { color: #5c5c5c; font-size: 0.9rem; }

.bbe-map-lock input[type="password"] {
	padding: 0.5rem 0.6rem;
	border: 1px solid #e6e4e4;
	border-radius: 5px;
	font-size: 0.95rem;
}

.bbe-map-lock input[type="submit"] {
	padding: 0.5rem 0.9rem;
	background: #b2400e;
	color: #fff;
	border: 0;
	border-radius: 5px;
	font-weight: 600;
	cursor: pointer;
}

.bbe-map-wrap {
	--bbe-green: #003407;
	--bbe-rust: #b2400e;
	--bbe-ink: #242424;
	--bbe-muted: #5c5c5c;
	--bbe-line: #e6e4e4;
	--bbe-bg: #f5f4ef;
	display: grid;
	grid-template-columns: 320px 1fr;
	gap: 0;
	flex: 1 1 auto;
	min-height: 0;
	border-top: 1px solid var(--bbe-line);
	font-family: inherit;
	color: var(--bbe-ink);
}

/* ---------- sidebar ---------- */

.bbe-map-side {
	overflow-y: auto;
	background: var(--bbe-bg);
	border-right: 1px solid var(--bbe-line);
	padding: 1rem 1rem 3rem;
}

.bbe-map-side h2 {
	font-size: 0.72rem;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--bbe-muted);
	margin: 1.25rem 0 0.5rem;
	font-weight: 700;
}

.bbe-map-side h2:first-child { margin-top: 0; }

.bbe-map-status {
	font-size: 0.78rem;
	line-height: 1.45;
	padding: 0.6rem 0.7rem;
	border-radius: 6px;
	margin-bottom: 1rem;
}

.bbe-map-status.is-live { background: #e8f3ea; border: 1px solid #b9dcc1; color: #17391f; }
.bbe-map-status.is-seed { background: #fdf1e7; border: 1px solid #f0c9a8; color: #6b2f08; }

/* address search */

.bbe-map-search { display: flex; gap: 0.4rem; margin-bottom: 0.5rem; }

.bbe-map-search input {
	flex: 1 1 auto;
	min-width: 0;
	padding: 0.5rem 0.6rem;
	border: 1px solid var(--bbe-line);
	border-radius: 5px;
	font-size: 0.85rem;
	background: #fff;
	color: var(--bbe-ink);
}

.bbe-map-search input:focus {
	outline: 2px solid var(--bbe-rust);
	outline-offset: -1px;
	border-color: var(--bbe-rust);
}

.bbe-map-btn {
	padding: 0.5rem 0.75rem;
	background: var(--bbe-rust);
	color: #fff;
	border: 0;
	border-radius: 5px;
	font-size: 0.85rem;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
}

.bbe-map-btn:hover { background: #8f3309; }
.bbe-map-btn[disabled] { opacity: 0.55; cursor: default; }

.bbe-map-btn-ghost {
	background: transparent;
	color: var(--bbe-muted);
	border: 1px solid var(--bbe-line);
}

.bbe-map-btn-ghost:hover { background: #ece9e1; color: var(--bbe-ink); }

.bbe-map-note {
	font-size: 0.76rem;
	color: var(--bbe-muted);
	line-height: 1.45;
	margin: 0.35rem 0 0;
}

.bbe-map-note.is-error { color: #a01b1b; }

/* filters */

.bbe-map-filters { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.bbe-map-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.3rem 0.6rem;
	border: 1px solid var(--bbe-line);
	border-radius: 999px;
	background: #fff;
	font-size: 0.8rem;
	cursor: pointer;
	color: var(--bbe-ink);
	font-weight: 600;
}

.bbe-map-chip[aria-pressed="false"] { opacity: 0.4; }

.bbe-map-swatch {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-size: 17px;
	font-weight: 800;
	flex: 0 0 32px;
}

/* day list */

.bbe-map-day { margin-bottom: 0.9rem; }

.bbe-map-day-head {
	font-size: 0.82rem;
	font-weight: 700;
	color: var(--bbe-green);
	padding: 0.3rem 0;
	border-bottom: 1px solid var(--bbe-line);
	margin-bottom: 0.35rem;
}

.bbe-map-item {
	display: grid;
	grid-template-columns: 36px minmax(0, 1fr);
	gap: 0.5rem;
	align-items: start;
	width: 100%;
	text-align: left;
	background: none;
	border: 0;
	padding: 0.4rem 0.25rem;
	border-radius: 5px;
	cursor: pointer;
	font-size: 0.82rem;
	line-height: 1.35;
	color: var(--bbe-ink);
}

.bbe-map-item:hover { background: #ece9e1; }
.bbe-map-item.is-active { background: #e3ded1; }

.bbe-map-seq {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	color: #fff;
	font-size: 1rem;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-top: 1px;
}

.bbe-map-item-name { font-weight: 600; }

.bbe-map-item-meta { color: var(--bbe-muted); font-size: 0.76rem; }

.bbe-map-drive {
	color: var(--bbe-rust);
	font-weight: 700;
	font-size: 0.76rem;
}

.bbe-map-empty {
	font-size: 0.82rem;
	color: var(--bbe-muted);
	padding: 0.5rem 0;
}

/* ---------- map ---------- */

.bbe-map-canvas { height: 100%; width: 100%; z-index: 0; background: #e8e5dd; }

/* markers: colour = tech, shape = appointment type */

.bbe-pin {
	background: none;
	border: 0;
}

.bbe-pin-box {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-width: 120px;
	min-height: 58px;
	padding: 6px 8px;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.25;
	color: #fff;
	white-space: nowrap;
	border: 2px solid rgba(255, 255, 255, 0.95);
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
	text-align: center;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Rectangle = heat. Rounded = inspection / spray / respray. */
.bbe-pin-rect { border-radius: 2px; }
.bbe-pin-round { border-radius: 29px; }
.bbe-pin-initial { font-size: 24px; font-weight: 800; min-width: 20px; }
.bbe-pin-date { display: block; }

/* Approximate geocode: dashed border, so nobody trusts the exact position. */
.bbe-pin-approx { border-style: dashed; }

.bbe-pin-sub {
	display: block;
	font-size: 12px;
	font-weight: 600;
	opacity: 0.92;
}

.bbe-pin.is-dim { opacity: 0.25; }

.bbe-pin-origin .bbe-pin-box {
	background: #111;
	border-color: #ffd400;
	border-radius: 3px;
	font-size: 11px;
}

.bbe-map-popup { font-size: 0.82rem; line-height: 1.5; }
.bbe-map-popup strong { display: block; font-size: 0.9rem; margin-bottom: 0.15rem; }
.bbe-map-popup .bbe-map-popup-addr { color: #5c5c5c; }
.bbe-map-popup .bbe-map-drive { display: block; margin-top: 0.3rem; }

.bbe-map-legend {
	font-size: 0.76rem;
	color: var(--bbe-muted);
	line-height: 1.7;
}

.bbe-map-legend-row { display: flex; align-items: center; gap: 0.45rem; }

/*
 * Key.
 *
 * A row per tech showing both of their pins side by side: dark rectangle for a
 * heat treatment, light circle for everything else. Built this way rather than
 * as two generic swatches because the map double-encodes — hue is the tech and
 * shade is the job type — and a single green swatch labelled "heat" invited
 * exactly the wrong reading, that green meant heat rather than Chase.
 */

.bbe-map-legend {
	font-size: 0.78rem;
	color: var(--bbe-muted);
}

.bbe-map-legend-head,
.bbe-map-legend-row {
	display: grid;
	grid-template-columns: 46px 40px minmax(0, 1fr);
	align-items: center;
	gap: 0.5rem;
}

.bbe-map-legend-head {
	font-size: 0.64rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--bbe-muted);
	margin-bottom: 0.3rem;
}

.bbe-map-legend-head span { text-align: center; }

.bbe-map-legend-row { margin-bottom: 0.3rem; }

.bbe-map-legend-label {
	font-weight: 600;
	color: var(--bbe-ink);
	font-size: 0.82rem;
}

.bbe-map-legend-shape {
	border: 2px solid #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
	justify-self: center;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	font-weight: 800;
}

.bbe-map-legend-shape.rect {
	width: 44px;
	height: 32px;
	border-radius: 2px;
}

.bbe-map-legend-shape.round {
	width: 34px;
	height: 34px;
	border-radius: 50%;
}

.bbe-map-legend-note {
	margin: 0.5rem 0 0;
	font-size: 0.74rem;
	line-height: 1.45;
	color: var(--bbe-muted);
}

@media (max-width: 860px) {
	.bbe-map-wrap {
		grid-template-columns: 1fr;
		flex: 0 0 auto;
	}

	.bbe-map-side {
		border-right: 0;
		border-bottom: 1px solid var(--bbe-line);
		max-height: 46vh;
	}

	.bbe-map-canvas { height: 62vh; }
}

/* -------------------------------------------------------------------------
 * Theme overrides.
 *
 * The parent theme styles every <button> with a solid black fill and white
 * text, which swallowed the chips, the list rows and the Plot button. These
 * rules are scoped under .bbe-map-wrap and forced, because the theme's own
 * selectors are more specific than a bare class.
 * ---------------------------------------------------------------------- */

.bbe-map-wrap button.bbe-map-btn {
	background: var(--bbe-rust) !important;
	color: #fff !important;
	border: 0 !important;
	border-radius: 5px !important;
	font-size: 0.85rem !important;
	font-weight: 600 !important;
	padding: 0.5rem 0.75rem !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	box-shadow: none !important;
	min-height: 0 !important;
}

.bbe-map-wrap button.bbe-map-btn:hover { background: #8f3309 !important; }

.bbe-map-wrap button.bbe-map-btn-ghost {
	background: transparent !important;
	color: var(--bbe-muted) !important;
	border: 1px solid var(--bbe-line) !important;
}

.bbe-map-wrap button.bbe-map-btn-ghost:hover {
	background: #ece9e1 !important;
	color: var(--bbe-ink) !important;
}

.bbe-map-wrap button.bbe-map-chip {
	background: #fff !important;
	color: var(--bbe-ink) !important;
	border: 1px solid var(--bbe-line) !important;
	border-radius: 999px !important;
	padding: 0.3rem 0.6rem !important;
	font-size: 0.8rem !important;
	font-weight: 600 !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	box-shadow: none !important;
	min-height: 48px !important;
}

.bbe-map-wrap button.bbe-map-item {
	background: transparent !important;
	color: var(--bbe-ink) !important;
	border: 0 !important;
	border-radius: 5px !important;
	padding: 0.4rem 0.25rem !important;
	font-size: 0.82rem !important;
	font-weight: 400 !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	box-shadow: none !important;
	min-height: 48px !important;
	text-align: left !important;
}

.bbe-map-wrap button.bbe-map-item:hover { background: #ece9e1 !important; }
.bbe-map-wrap button.bbe-map-item.is-active { background: #e3ded1 !important; }

.bbe-map-wrap input[type="text"] {
	background: #fff !important;
	color: var(--bbe-ink) !important;
	border: 1px solid var(--bbe-line) !important;
	border-radius: 5px !important;
	padding: 0.5rem 0.6rem !important;
	font-size: 0.85rem !important;
	margin: 0 !important;
	min-height: 0 !important;
}

/* The theme's h2 rules are large and serif; keep the sidebar labels small. */
.bbe-map-wrap .bbe-map-side h2 {
	font-size: 0.72rem !important;
	line-height: 1.3 !important;
	letter-spacing: 0.09em !important;
	text-transform: uppercase !important;
	color: var(--bbe-muted) !important;
	font-weight: 700 !important;
	margin: 1.25rem 0 0.5rem !important;
	padding: 0 !important;
	border: 0 !important;
}

.bbe-map-wrap .bbe-map-side h2:first-child { margin-top: 0 !important; }

/* Leaflet controls must sit above the theme's sticky header. */
.bbe-map-wrap .leaflet-top { z-index: 400; }

/* -------------------------------------------------------------------------
 * Page header.
 *
 * The template must emit its own <h1>: inc/bbe-h1.php promotes the first <h2>
 * on any page that lacks one, which otherwise turned the "New job address"
 * sidebar label into a 40px page heading.
 * ---------------------------------------------------------------------- */

.bbe-map-head {
	padding: 0.85rem 1.25rem;
	border-bottom: 1px solid #e6e4e4;
	background: #fff;
}

.bbe-map-head h1 {
	font-size: 1.05rem !important;
	line-height: 1.25 !important;
	font-weight: 700 !important;
	color: #003407 !important;
	margin: 0 !important;
	padding: 0 !important;
	letter-spacing: normal !important;
	text-transform: none !important;
}

.bbe-map-head p {
	margin: 0.2rem 0 0 !important;
	font-size: 0.8rem !important;
	color: #5c5c5c !important;
	line-height: 1.4 !important;
}

.bbe-map-hl-link { display:inline-flex; min-height:44px; align-items:center; margin-top:6px; padding:5px 9px; border:1px solid #b2400e; border-radius:6px; color:#b2400e; background:#fff; font-size:14px; font-weight:700; text-decoration:none; }
.bbe-map-item-name { overflow-wrap:break-word; }
