/* Native Leads – shared design system: tokens, base, brand, buttons.
   Brand colour #215073 (deep steel blue) with a tonal scale built from it.
   Light is the default look; [data-theme="dark"] switches every token.
   Components only use tokens. Loaded on every screen; dashboard.css and
   site.css build on it. */

:root {
	/* Brand scale, from #215073 */
	--brand-950: #08151f;
	--brand-900: #0d2232;
	--brand-800: #132f45;
	--brand-700: #1a3f5b;
	--brand: #215073;
	--brand-500: #2d6690;
	--brand-400: #4c86b2;
	--brand-300: #82afd2;
	--brand-200: #bcd6ea;
	--brand-100: #e4eff7;
	--brand-50: #f3f8fb;

	--bg: #f4f6f9;
	--bg-glow: rgba(33, 80, 115, 0.07);
	--surface: #ffffff;
	--surface-2: #f6f8fb;
	--surface-hover: #f1f5f9;
	--border: #e5eaf0;
	--border-strong: #d3dbe4;

	--text: #0e1b26;
	--muted: #5a6b7b;
	--faint: #8c99a6;

	--accent: var(--brand);
	--accent-ink: var(--brand);          /* brand-coloured text */
	--accent-soft: rgba(33, 80, 115, 0.08);
	--accent-gradient: linear-gradient(135deg, #2d6690 0%, #215073 50%, #173b57 100%);
	--on-accent: #ffffff;
	--bar: #215073;
	--bar-hover: #2d6690;
	--focus: rgba(33, 80, 115, 0.22);
	--gloss: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0) 60%);

	/* Sidebar is always the deep brand panel, in both modes. */
	--side-bg: linear-gradient(180deg, #1f4c6d 0%, #183d59 45%, #102c41 100%);
	--side-text: #f1f6fa;
	--side-muted: rgba(225, 237, 246, 0.66);
	--side-faint: rgba(225, 237, 246, 0.42);
	--side-line: rgba(255, 255, 255, 0.09);
	--side-hover: rgba(255, 255, 255, 0.07);

	--up: #0f8a5f;
	--down: #c2413b;

	/* CRM delivery states */
	--c-sent: #0f8a5f;     --c-sent-bg: #e3f4ec;
	--c-pending: #a56a06;  --c-pending-bg: #fcf2dd;
	--c-failed: #c2413b;   --c-failed-bg: #fbe9e8;
	--c-off: #5b6878;      --c-off-bg: #edf0f4;

	/* Kept for the illustrative pipeline on the public front page. */
	--s-new: #215073;        --s-new-bg: #e4eff7;
	--s-contacted: #6d28d9;  --s-contacted-bg: #f1eafd;
	--s-qualified: #a16207;  --s-qualified-bg: #fdf3e2;
	--s-converted: #0f8a5f;  --s-converted-bg: #e3f4ec;
	--s-lost: #4b5563;       --s-lost-bg: #eceef1;

	--shadow: 0 1px 2px rgba(14, 27, 38, 0.04), 0 4px 16px rgba(14, 27, 38, 0.04);
	--shadow-lift: 0 2px 4px rgba(14, 27, 38, 0.04), 0 14px 34px rgba(14, 27, 38, 0.08);
	--shadow-pop: 0 28px 70px rgba(13, 34, 50, 0.22);
	--shadow-brand: 0 14px 34px rgba(33, 80, 115, 0.28);

	--font: "Inter", "Tajawal", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--font-display: "Plus Jakarta Sans", "Inter", "Tajawal", system-ui, sans-serif;
	--mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
	--radius: 18px;
	--radius-sm: 12px;
	--control: 42px;

	color-scheme: light;
}

:root[data-theme="dark"] {
	--bg: #08131c;
	--bg-glow: rgba(76, 134, 178, 0.1);
	--surface: #0e1d29;
	--surface-2: #122434;
	--surface-hover: #15293b;
	--border: rgba(130, 175, 210, 0.1);
	--border-strong: rgba(130, 175, 210, 0.2);

	--text: #e9f1f7;
	--muted: #95a9ba;
	--faint: #647a8c;

	--accent: #4c86b2;
	--accent-ink: #8dbadd;
	--accent-soft: rgba(76, 134, 178, 0.14);
	--accent-gradient: linear-gradient(135deg, #3a76a3 0%, #215073 55%, #173b57 100%);
	--bar: #5f97c2;
	--bar-hover: #8dbadd;
	--focus: rgba(76, 134, 178, 0.4);
	--gloss: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0) 60%);

	--side-bg: linear-gradient(180deg, #132f45 0%, #0d2232 55%, #091a27 100%);

	--up: #4ade80;
	--down: #f87171;

	--c-sent: #4ade80;     --c-sent-bg: rgba(74, 222, 128, 0.12);
	--c-pending: #fbbf24;  --c-pending-bg: rgba(251, 191, 36, 0.12);
	--c-failed: #f87171;   --c-failed-bg: rgba(248, 113, 113, 0.13);
	--c-off: #94a3b8;      --c-off-bg: rgba(148, 163, 184, 0.13);

	--s-new: #8dbadd;        --s-new-bg: rgba(76, 134, 178, 0.16);
	--s-contacted: #c4b5fd;  --s-contacted-bg: rgba(167, 139, 250, 0.15);
	--s-qualified: #fcd34d;  --s-qualified-bg: rgba(252, 211, 77, 0.14);
	--s-converted: #4ade80;  --s-converted-bg: rgba(74, 222, 128, 0.13);
	--s-lost: #a3acbd;       --s-lost-bg: rgba(163, 172, 189, 0.14);

	--shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 8px 24px rgba(0, 0, 0, 0.25);
	--shadow-lift: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 16px 40px rgba(0, 0, 0, 0.35);
	--shadow-pop: 0 28px 70px rgba(0, 0, 0, 0.55);
	--shadow-brand: 0 14px 34px rgba(0, 0, 0, 0.35);

	color-scheme: dark;
}

/* ---------- base ---------- */

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

html { -webkit-text-size-adjust: 100%; }

body.native-leads-app {
	margin: 0;
	min-height: 100vh;
	background:
		radial-gradient(1100px 600px at 100% -20%, var(--bg-glow), transparent 60%),
		var(--bg);
	background-attachment: fixed;
	color: var(--text);
	font: 400 14px/1.55 var(--font);
	-webkit-font-smoothing: antialiased;
	font-feature-settings: "cv11", "ss01";
}

.native-leads-app a { color: inherit; text-decoration: none; }
.native-leads-app h1,
.native-leads-app h2,
.native-leads-app h3,
.native-leads-app p { margin: 0; }
.native-leads-app h1,
.native-leads-app h2,
.native-leads-app h3 { font-family: var(--font-display); }
/* UI icons only; SVGs inside post content (.prose) keep their own sizing. */
.native-leads-app svg:where(:not(.prose svg)) { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.native-leads-app :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); }
.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
[hidden] { display: none !important; }

/* ---------- brand ---------- */

.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand__mark {
	width: 36px !important; height: 36px !important; padding: 7px; border-radius: 11px;
	background: var(--accent-gradient); color: #fff; stroke: #fff !important; stroke-width: 2.4 !important;
	box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14) inset, var(--shadow-brand);
}
.brand__mark path { stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
.brand__mark .dot { fill: var(--brand-300); stroke: none; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__text strong { font: 700 16.5px/1.15 var(--font-display); letter-spacing: -0.015em; }
.brand__text small { font-size: 10px; font-weight: 600; color: var(--muted); letter-spacing: 0.14em; text-transform: uppercase; }

/* ---------- buttons & controls ---------- */

.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	height: var(--control); padding: 0 18px;
	border: 1px solid transparent; border-radius: 12px;
	font: 600 13.5px/1 var(--font); letter-spacing: -0.005em; cursor: pointer; white-space: nowrap;
	transition: transform 0.15s, box-shadow 0.15s, background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn svg { width: 16px; height: 16px; }
.btn--primary {
	background: var(--gloss), var(--accent-gradient); color: var(--on-accent) !important;
	box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1) inset, 0 6px 16px rgba(33, 80, 115, 0.25);
}
.btn--primary:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) inset, var(--shadow-brand); }
.btn--ghost { background: var(--surface); border-color: var(--border-strong); color: var(--text); box-shadow: 0 1px 2px rgba(14, 27, 38, 0.04); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent-ink); }
.btn--sm { height: 36px; padding: 0 14px; font-size: 13px; border-radius: 10px; }
.btn--block { width: 100%; height: 48px; font-size: 15px; }

.icon-btn {
	display: inline-grid; place-items: center; width: 38px; height: 38px;
	border: 1px solid var(--border); border-radius: 11px; background: var(--surface);
	color: var(--muted); cursor: pointer; transition: color 0.15s, border-color 0.15s, background-color 0.15s;
}
.icon-btn:hover { color: var(--accent-ink); border-color: var(--accent); background: var(--accent-soft); }

.avatar {
	display: inline-grid; place-items: center; flex: none;
	width: 38px; height: 38px; border-radius: 12px;
	background: linear-gradient(140deg, var(--brand-100), color-mix(in srgb, var(--brand-200) 60%, var(--brand-100)));
	color: var(--brand);
	font: 700 13px/1 var(--font-display); letter-spacing: 0.02em;
}
:root[data-theme="dark"] .avatar { background: var(--accent-soft); color: var(--accent-ink); }
.avatar--sm { width: 32px; height: 32px; font-size: 11.5px; border-radius: 10px; }
.avatar--lg { width: 56px; height: 56px; font-size: 19px; border-radius: 16px; }

/* ---------- badges & trend pills ---------- */

.badge {
	display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 9px; border-radius: 999px;
	font-size: 11.5px; font-weight: 600; white-space: nowrap; letter-spacing: 0.01em;
	color: var(--c-off); background: var(--c-off-bg);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--sent { color: var(--c-sent); background: var(--c-sent-bg); }
.badge--pending { color: var(--c-pending); background: var(--c-pending-bg); }
.badge--failed { color: var(--c-failed); background: var(--c-failed-bg); }
.badge--new { color: var(--s-new); background: var(--s-new-bg); }
.badge--contacted { color: var(--s-contacted); background: var(--s-contacted-bg); }
.badge--qualified { color: var(--s-qualified); background: var(--s-qualified-bg); }
.badge--converted { color: var(--s-converted); background: var(--s-converted-bg); }

.kpi__note { color: var(--faint); }
.trend { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 999px; font-weight: 600; font-size: 11.5px; }
.trend span { font-size: 8px; }
.trend--up { color: var(--up); background: color-mix(in srgb, var(--up) 12%, transparent); }
.trend--down { color: var(--down); background: color-mix(in srgb, var(--down) 12%, transparent); }
.trend--flat { color: var(--muted); background: var(--surface-2); }

/* ---------- theme switch (light is the default) ---------- */

[data-theme-toggle] .i-sun { display: none; }
:root[data-theme="dark"] [data-theme-toggle] .i-moon { display: none; }
:root[data-theme="dark"] [data-theme-toggle] .i-sun { display: block; }

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after { animation: none !important; transition: none !important; }
}
