/**
 * J3 Leads — Real Estate.
 *
 * Self-contained: there is no base sheet underneath this one, so it carries
 * the layout as well as the palette. Everything is scoped under .j3-wrap so
 * it cannot leak into the rest of wp-admin.
 *
 * The gradient sits on the ground plane only. Panels stay near-flat on
 * purpose — a call sheet is read for hours and a gradient behind body text is
 * exhausting.
 */
.j3-wrap {
	--j3-ink: #0a0506;
	--j3-panel: #16090c;
	--j3-panel-2: #1f0d11;
	--j3-rule: #3a161d;
	--j3-bone: #fdf6f4;
	--j3-mute: #b08e91;
	--j3-dim: #7d5c60;

	/* One red, used at three depths. The bright end is reserved for actions
	   so it never competes with the score meter. */
	--j3-red: #e11d2e;
	--j3-red-deep: #8f0f1c;
	--j3-red-glow: rgba(225, 29, 46, .28);

	--j3-amber: var(--j3-red);
	--j3-accent-deep: var(--j3-red-deep);
	--j3-ring: var(--j3-red-glow);

	--j3-hot: #ff3b30;
	--j3-warm: #ff8a3d;
	--j3-cool: #9aa7b8;
	--j3-green: #34c98a;

	background:
		radial-gradient(120% 90% at 0% 0%, rgba(143, 15, 28, .55) 0%, rgba(10, 5, 6, 0) 58%),
		linear-gradient(160deg, #1a070a 0%, #0a0506 46%, #000 100%);
	color: var(--j3-bone);
}

.j3-wrap .j3-title {
	background: linear-gradient(92deg, #fdf6f4 0%, #f3b7ae 46%, var(--j3-red) 100%);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}

.j3-wrap .j3-panel {
	background: linear-gradient(180deg, var(--j3-panel-2) 0%, var(--j3-panel) 100%);
	border: 1px solid var(--j3-rule);
	border-radius: 14px;
	padding: 20px;
	margin-bottom: 18px;
	box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
}

.j3-wrap .j3-panel__title {
	font-family: "Sora", "Inter", sans-serif;
	font-size: 17px;
	font-weight: 650;
	margin: 0 0 14px;
	letter-spacing: -.01em;
}

.j3-wrap .j3-subhead {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: .14em;
	color: var(--j3-red);
	margin: 22px 0 10px;
	padding-top: 14px;
	border-top: 1px solid var(--j3-rule);
}

/* Buttons ---------------------------------------------------------------- */

.j3-wrap .j3-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 9px 16px;
	border-radius: 9px;
	border: 1px solid var(--j3-rule);
	background: var(--j3-panel-2);
	color: var(--j3-bone);
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: border-color .15s ease, transform .1s ease;
}

.j3-wrap .j3-btn:hover { border-color: var(--j3-red); transform: translateY(-1px); }

.j3-wrap .j3-btn--primary {
	background: linear-gradient(135deg, var(--j3-red) 0%, var(--j3-red-deep) 100%);
	border-color: transparent;
	box-shadow: 0 6px 18px var(--j3-red-glow);
}

.j3-wrap .j3-btn--ghost { background: transparent; color: var(--j3-mute); }

/* Tabs and filters ------------------------------------------------------- */

.j3-wrap .j3-tabs {
	display: flex;
	gap: 4px;
	flex-wrap: wrap;
	border-bottom: 1px solid var(--j3-rule);
	margin: 18px 0;
}

.j3-wrap .j3-tab {
	padding: 10px 16px;
	color: var(--j3-mute);
	text-decoration: none;
	font-size: 13px;
	font-weight: 600;
	border-bottom: 2px solid transparent;
	margin-bottom: -1px;
}

.j3-wrap .j3-tab.is-active { color: var(--j3-bone); border-bottom-color: var(--j3-red); }

.j3-wrap .j3-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	margin-bottom: 16px;
}

.j3-wrap input[type="text"],
.j3-wrap input[type="search"],
.j3-wrap input[type="date"],
.j3-wrap input[type="number"],
.j3-wrap input[type="email"],
.j3-wrap input[type="file"],
.j3-wrap select,
.j3-wrap textarea {
	background: #0d0507;
	border: 1px solid var(--j3-rule);
	border-radius: 9px;
	color: var(--j3-bone);
	padding: 9px 11px;
	font-size: 13px;
	width: 100%;
	max-width: 100%;
}

.j3-wrap .j3-filters input,
.j3-wrap .j3-filters select { width: auto; min-width: 150px; }

.j3-wrap input:focus,
.j3-wrap select:focus,
.j3-wrap textarea:focus {
	outline: none;
	border-color: var(--j3-red);
	box-shadow: 0 0 0 3px var(--j3-red-glow);
}

.j3-wrap .j3-check {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: 13px;
	color: var(--j3-mute);
}

.j3-wrap .j3-check input { width: auto; }

.j3-wrap .j3-field { margin-bottom: 14px; }
.j3-wrap .j3-label { display: block; font-size: 12px; font-weight: 600; color: var(--j3-mute); margin-bottom: 6px; }
.j3-wrap .j3-help { font-size: 11px; color: var(--j3-dim); margin: 5px 0 0; }
.j3-wrap .j3-dim { color: var(--j3-dim); }

.j3-wrap .j3-grid { display: grid; gap: 0 14px; }
.j3-wrap .j3-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.j3-wrap .j3-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.j3-wrap .j3-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Call sheet ------------------------------------------------------------- */

.j3-wrap .j3-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}

.j3-wrap .j3-table th {
	text-align: left;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: .1em;
	color: var(--j3-dim);
	padding: 10px 12px;
	border-bottom: 1px solid var(--j3-rule);
}

.j3-wrap .j3-table td {
	padding: 11px 12px;
	border-bottom: 1px solid rgba(58, 22, 29, .55);
	vertical-align: middle;
}

.j3-wrap .j3-table tr:hover td { background: rgba(225, 29, 46, .06); }

/* A due row gets a red edge rather than a fill: the fill fights the score
   colour, which is the thing you are actually scanning for. */
.j3-wrap .j3-table tr.is-due td:first-child { box-shadow: inset 3px 0 0 var(--j3-red); }

.j3-wrap .j3-link { color: var(--j3-bone); text-decoration: none; font-weight: 600; }
.j3-wrap .j3-link:hover { color: var(--j3-red); }

.j3-wrap .j3-score {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	padding: 5px 8px;
	border-radius: 8px;
	font-weight: 700;
	font-size: 13px;
	font-variant-numeric: tabular-nums;
	background: rgba(255, 255, 255, .05);
	border: 1px solid var(--j3-rule);
}

.j3-wrap .j3-score--hot { background: rgba(255, 59, 48, .18); border-color: var(--j3-hot); color: #ffb4ae; }
.j3-wrap .j3-score--warm { background: rgba(255, 138, 61, .15); border-color: var(--j3-warm); color: #ffcda6; }
.j3-wrap .j3-score--cool { background: rgba(154, 167, 184, .12); border-color: #5c6675; color: #cdd5df; }
.j3-wrap .j3-score--cold { color: var(--j3-dim); }

.j3-wrap .j3-chip {
	display: inline-block;
	padding: 3px 9px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 600;
	background: rgba(255, 255, 255, .05);
	border: 1px solid var(--j3-rule);
	color: var(--j3-mute);
}

.j3-wrap .j3-chip--due { background: var(--j3-red-deep); color: #fff; border-color: transparent; margin-left: 7px; }
.j3-wrap .j3-chip--signal { background: rgba(225, 29, 46, .12); border-color: var(--j3-red-deep); color: #f6b8bd; margin: 0 5px 5px 0; }
.j3-wrap .j3-chip--block { color: var(--j3-dim); border-style: dashed; cursor: help; }

.j3-wrap .j3-dial {
	color: var(--j3-bone);
	font-variant-numeric: tabular-nums;
	text-decoration: none;
	font-weight: 600;
	border-bottom: 1px dotted var(--j3-red);
}

.j3-wrap .j3-dial--big {
	display: block;
	font-size: 26px;
	font-family: "Sora", sans-serif;
	text-align: center;
	padding: 14px;
	margin-bottom: 14px;
	border: 1px solid var(--j3-red-deep);
	border-radius: 12px;
	background: rgba(225, 29, 46, .08);
}

/* Detail layout ---------------------------------------------------------- */

.j3-wrap .j3-detail {
	display: grid;
	grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
	gap: 18px;
	align-items: start;
}

.j3-wrap .j3-scoreline { display: flex; align-items: center; gap: 10px; color: var(--j3-mute); font-size: 12px; margin: 0 0 12px; }
.j3-wrap .j3-signals { margin: 0 0 16px; }
.j3-wrap .j3-actions { display: flex; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--j3-rule); }

/* Coach ------------------------------------------------------------------ */

.j3-wrap .j3-coach { border-color: var(--j3-red-deep); }

.j3-wrap .j3-coach__label {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: .12em;
	color: var(--j3-red);
	margin: 16px 0 6px;
}

/* Spoken lines are set larger than body text on purpose — this is read off
   a screen while someone is talking to you. */
.j3-wrap .j3-quote {
	margin: 0;
	padding: 12px 14px;
	border-left: 3px solid var(--j3-red);
	background: rgba(0, 0, 0, .3);
	border-radius: 0 10px 10px 0;
	font-size: 15px;
	line-height: 1.55;
}

.j3-wrap .j3-list { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.7; }
.j3-wrap .j3-list--warn { color: #ffcda6; }
.j3-wrap .j3-objection { font-style: italic; color: var(--j3-mute); margin: 0 0 10px; }

.j3-wrap .j3-raac { list-style: none; margin: 0; padding: 0; counter-reset: raac; }

.j3-wrap .j3-raac li {
	padding: 9px 0;
	border-bottom: 1px solid rgba(58, 22, 29, .55);
	font-size: 14px;
	line-height: 1.5;
}

.j3-wrap .j3-raac__step {
	display: inline-block;
	min-width: 68px;
	font-size: 10px;
	text-transform: uppercase;
	letter-spacing: .12em;
	color: var(--j3-red);
	font-weight: 700;
}

.j3-wrap .j3-cadence {
	font-size: 12px;
	color: var(--j3-mute);
	font-style: italic;
	margin: 10px 0 0;
}

.j3-wrap .j3-objection-form { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--j3-rule); }
.j3-wrap .j3-objection-form button { margin-top: 10px; }
.j3-wrap .j3-raac-answer { margin-top: 14px; padding: 12px; border: 1px solid var(--j3-red-deep); border-radius: 10px; background: rgba(225, 29, 46, .06); }

/* Timeline, board, scripts ----------------------------------------------- */

.j3-wrap .j3-timeline { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.j3-wrap .j3-timeline li { padding: 9px 0; border-bottom: 1px solid rgba(58, 22, 29, .55); display: flex; gap: 9px; align-items: baseline; flex-wrap: wrap; }
.j3-wrap .j3-timeline__when { color: var(--j3-dim); font-size: 11px; min-width: 88px; }

.j3-wrap .j3-board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 14px; }
.j3-wrap .j3-column { min-width: 210px; flex: 0 0 210px; }

.j3-wrap .j3-column__head {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: .1em;
	color: var(--j3-mute);
	margin: 0 0 10px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.j3-wrap .j3-count { color: var(--j3-red); font-weight: 700; }

.j3-wrap .j3-card {
	display: block;
	padding: 11px;
	margin-bottom: 8px;
	border-radius: 10px;
	border: 1px solid var(--j3-rule);
	background: var(--j3-panel);
	text-decoration: none;
	color: var(--j3-bone);
	font-size: 13px;
}

.j3-wrap .j3-card:hover { border-color: var(--j3-red); }
.j3-wrap .j3-card strong { display: block; margin: 6px 0 2px; }
.j3-wrap .j3-card .j3-dim { font-size: 11px; }

.j3-wrap .j3-script { border-bottom: 1px solid var(--j3-rule); padding: 12px 0; }
.j3-wrap .j3-script summary { cursor: pointer; font-size: 14px; display: flex; gap: 10px; align-items: center; }
.j3-wrap .j3-script textarea { margin: 12px 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.6; }

/* Notices ---------------------------------------------------------------- */

.j3-wrap .j3-notice { border-left: 3px solid var(--j3-green); }
.j3-wrap .j3-notice--warn { border-left-color: var(--j3-warm); }
.j3-wrap .j3-notice p { margin: 0; font-size: 13px; }
.j3-wrap .j3-empty { text-align: center; padding: 40px 20px; }
.j3-wrap .j3-empty h3 { margin: 0 0 8px; font-family: "Sora", sans-serif; }

/* Phone ------------------------------------------------------------------ */

@media (max-width: 960px) {
	.j3-wrap .j3-detail { grid-template-columns: minmax(0, 1fr); }

	/* The coach panel is the reason this screen exists on a phone, so it
	   goes above the record rather than below it. */
	.j3-wrap .j3-detail__side { order: -1; }

	.j3-wrap .j3-grid--2,
	.j3-wrap .j3-grid--3,
	.j3-wrap .j3-grid--4 { grid-template-columns: minmax(0, 1fr); }

	.j3-wrap .j3-callsheet th:nth-child(3),
	.j3-wrap .j3-callsheet td:nth-child(3),
	.j3-wrap .j3-callsheet th:nth-child(4),
	.j3-wrap .j3-callsheet td:nth-child(4) { display: none; }
}


/* Base layout the platform sheet used to provide ------------------------- */

.j3-wrap {
	margin: 0 0 0 -20px;
	padding: 24px 22px 60px;
	min-height: calc(100vh - 32px);
	font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	-webkit-font-smoothing: antialiased;
}

.j3-wrap * { box-sizing: border-box; }

.j3-wrap .j3-header { margin-bottom: 18px; }

.j3-wrap .j3-title {
	font-family: "Sora", "Inter", -apple-system, sans-serif;
	font-size: 28px;
	font-weight: 700;
	letter-spacing: -0.03em;
	margin: 0;
	padding: 0;
}

.j3-wrap .j3-sub {
	color: var(--j3-mute);
	font-size: 13px;
	margin: 4px 0 0;
	max-width: 60ch;
}

.j3-wrap a { color: inherit; }
.j3-wrap h2, .j3-wrap h3, .j3-wrap h4 { color: var(--j3-bone); }
.j3-wrap p { color: var(--j3-bone); }
.j3-wrap .j3-panel > p:first-of-type { margin-top: 0; }

/* Front-end console ------------------------------------------------------ */

/*
 * The console runs inside whatever theme the site uses, so it takes over the
 * full width and paints its own background rather than trusting a theme
 * container to be dark. Scoped to .j3-console so a theme's own pages are
 * untouched.
 */
.j3-console {
	--j3-ink: #0a0506;
	margin: 0;
	padding: 0 0 60px;
	width: 100%;
	max-width: none;
	min-height: 100vh;
}

/*
 * Standalone: our template renders the document, so there is no theme markup
 * to fight and these rules only have to establish the ground plane.
 */
body.j3-console-standalone {
	background: #0a0506;
	margin: 0;
	padding: 0;
	color: #fdf6f4;
	font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	-webkit-font-smoothing: antialiased;
}

body.j3-console-standalone * { box-sizing: border-box; }

body.j3-console-standalone img,
body.j3-console-standalone svg { max-width: 100%; height: auto; }

/*
 * Embedded: the console is inside a theme, so these rules do the minimum
 * needed to stop the theme's page furniture duplicating our own — the theme
 * has already printed a "Call Sheet" heading directly above ours.
 */
body.j3-console-page:not(.j3-console-standalone) .entry-title,
body.j3-console-page:not(.j3-console-standalone) .page-title,
body.j3-console-page:not(.j3-console-standalone) .wp-block-post-title { display: none; }

body.j3-console-page:not(.j3-console-standalone) .entry-content,
body.j3-console-page:not(.j3-console-standalone) .site-content,
body.j3-console-page:not(.j3-console-standalone) .content-area,
body.j3-console-page:not(.j3-console-standalone) main {
	max-width: none;
	margin: 0;
	padding: 0;
}

/* The admin bar is kept — it is the way back to wp-admin — so the sticky
   console bar has to sit under it rather than behind it. */
body.j3-console-page.admin-bar .j3-console__bar { top: 32px; }

@media screen and (max-width: 782px) {
	body.j3-console-page.admin-bar .j3-console__bar { top: 46px; }
}

.j3-console__bar {
	display: flex;
	align-items: center;
	gap: 20px;
	flex-wrap: wrap;
	padding: 14px 24px;
	background: linear-gradient(180deg, rgba(31, 13, 17, .96) 0%, rgba(10, 5, 6, .96) 100%);
	border-bottom: 1px solid var(--j3-rule);
	position: sticky;
	top: 0;
	z-index: 20;
	backdrop-filter: blur(8px);
}

.j3-console__brand {
	display: flex;
	flex-direction: column;
	line-height: 1.15;
	text-decoration: none;
	color: var(--j3-bone);
	font-family: "Sora", "Inter", sans-serif;
}

.j3-console__brand strong { font-size: 17px; letter-spacing: -.02em; }
.j3-console__brand span { font-size: 11px; color: var(--j3-mute); }

.j3-console__nav {
	display: flex;
	gap: 2px;
	flex-wrap: wrap;
	flex: 1 1 auto;
}

.j3-console__link {
	padding: 8px 13px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 600;
	color: var(--j3-mute);
	text-decoration: none;
	white-space: nowrap;
}

.j3-console__link:hover { color: var(--j3-bone); background: rgba(255, 255, 255, .04); }

.j3-console__link.is-active {
	color: var(--j3-bone);
	background: linear-gradient(135deg, var(--j3-red) 0%, var(--j3-red-deep) 100%);
}

.j3-console__out { font-size: 12px; color: var(--j3-dim); text-decoration: none; }
.j3-console__out:hover { color: var(--j3-red); }

/* Everything below the bar gets the page gutter the admin wrap used to. */
.j3-console > *:not(.j3-console__bar) { margin-left: 24px; margin-right: 24px; }
.j3-console .j3-header { padding-top: 24px; }

.j3-console .j3-detail,
.j3-console .j3-board { max-width: 1500px; }

.j3-login { max-width: 420px; margin: 60px auto; }
.j3-login input[type="text"],
.j3-login input[type="password"] { width: 100%; }
.j3-login .login-submit input {
	background: linear-gradient(135deg, var(--j3-red) 0%, var(--j3-red-deep) 100%);
	border: 0;
	color: #fff;
	padding: 10px 18px;
	border-radius: 9px;
	font-weight: 600;
	cursor: pointer;
}
.j3-login label { display: block; font-size: 12px; color: var(--j3-mute); margin-bottom: 6px; }
.j3-login p { margin-bottom: 14px; }

@media (max-width: 782px) {
	.j3-console__bar { gap: 12px; padding: 12px 16px; }
	.j3-console__nav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
	.j3-console > *:not(.j3-console__bar) { margin-left: 14px; margin-right: 14px; }
}

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

.j3-wrap .j3-map {
	height: 520px;
	border-radius: 12px;
	border: 1px solid var(--j3-rule);
	overflow: hidden;
	margin: 14px 0;
	background: #0d0507;
}

/* Leaflet ships a white chrome that looks broken on a dark ground. */
.j3-wrap .leaflet-control-zoom a,
.j3-wrap .leaflet-draw-toolbar a {
	background-color: #1f0d11;
	color: var(--j3-bone);
	border-color: var(--j3-rule);
}

.j3-wrap .leaflet-bar a:hover { background-color: var(--j3-red-deep); }
.j3-wrap .leaflet-control-attribution {
	background: rgba(10, 5, 6, .8);
	color: var(--j3-dim);
	font-size: 10px;
}
.j3-wrap .leaflet-control-attribution a { color: var(--j3-mute); }

/* Tiles are bright by nature; knocking them back keeps the drawn boundary
   and the markers as the thing your eye lands on. */
.j3-wrap .leaflet-tile-pane { filter: brightness(.72) saturate(.75) contrast(1.05); }

.j3-wrap .j3-farm__bar {
	display: flex;
	gap: 10px;
	align-items: center;
	flex-wrap: wrap;
	margin-bottom: 12px;
}

.j3-wrap .j3-farm__bar select { width: auto; min-width: 170px; }

.j3-wrap .j3-farm__status {
	font-size: 13px;
	color: var(--j3-mute);
	min-height: 20px;
	padding: 8px 0;
}

.j3-wrap .j3-farm__status.is-ok { color: #9fe3c2; }
.j3-wrap .j3-farm__status.is-warn { color: #ffcda6; }

/* Address search --------------------------------------------------------- */

.j3-wrap .j3-search { position: relative; max-width: 560px; }

.j3-wrap .j3-suggestions {
	position: absolute;
	z-index: 500;
	left: 0;
	right: 0;
	background: #16090c;
	border: 1px solid var(--j3-rule);
	border-radius: 0 0 10px 10px;
	border-top: 0;
	max-height: 280px;
	overflow-y: auto;
}

.j3-wrap .j3-suggestion {
	display: block;
	width: 100%;
	text-align: left;
	padding: 10px 12px;
	background: none;
	border: 0;
	border-bottom: 1px solid rgba(58, 22, 29, .55);
	color: var(--j3-bone);
	font-size: 13px;
	cursor: pointer;
}

.j3-wrap .j3-suggestion:hover { background: rgba(225, 29, 46, .12); }
.j3-wrap .j3-suggestion:last-child { border-bottom: 0; }

@media (max-width: 782px) {
	.j3-wrap .j3-map { height: 380px; }
	.j3-wrap .j3-farm__bar select,
	.j3-wrap .j3-farm__bar button { width: 100%; }
}

/* Radius control --------------------------------------------------------- */

.j3-wrap .j3-radius {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: var(--j3-mute);
}

.j3-wrap .j3-radius .j3-label { margin: 0; }

.j3-wrap .j3-radius input[type="range"] {
	width: 150px;
	accent-color: var(--j3-red);
	padding: 0;
}

.j3-wrap .j3-radius output {
	font-variant-numeric: tabular-nums;
	color: var(--j3-bone);
	font-weight: 600;
	min-width: 34px;
	text-align: right;
}

.j3-wrap .leaflet-tooltip {
	background: #16090c;
	border: 1px solid var(--j3-rule);
	color: var(--j3-bone);
	font-size: 12px;
}

.j3-wrap .leaflet-tooltip::before { border-top-color: var(--j3-rule); }

.j3-wrap .j3-radius.is-off { opacity: .4; }
.j3-wrap #j3re-street { width: auto; min-width: 190px; }
