:root {
	--bg: #f4f7fd;
	--surface: #ffffff;
	--border: #e3e9f4;
	--text: #1c2536;
	--text-dim: #667085;
	/* Bold, saturated blue as the primary voice of the app — not a muted
	   dark-mode blue. Reserved red for real danger states only. */
	--accent: #2f6fed;
	--accent-strong: #1c54d6;
	--accent-light: #5b8ff9;
	--accent-soft: #2f6fed1f;
	--danger: #dc2626;
	--danger-soft: #dc26261a;
}
* { box-sizing: border-box; }
html, body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.ci-mono { font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; }

/* ---------- Split layout: vibrant blue hero + light form panel ---------- */
.auth-split { min-height: 100vh; display: flex; }
.auth-hero {
	flex: 1 1 46%;
	position: relative;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 64px;
	color: #fff;
	background:
		radial-gradient(640px 480px at 15% 15%, #ffffff26, transparent 60%),
		radial-gradient(560px 480px at 90% 85%, #7db2ff33, transparent 55%),
		linear-gradient(155deg, #1c54d6 0%, #2f6fed 48%, #4f8bff 100%);
}
.auth-hero-deco {
	position: absolute;
	inset: 0;
	background-image: radial-gradient(circle, #ffffff29 1.5px, transparent 1.5px);
	background-size: 26px 26px;
	mask-image: radial-gradient(circle at 30% 40%, #000 0%, transparent 70%);
	pointer-events: none;
}
.hero-mark {
	width: 60px;
	height: 60px;
	border-radius: 14px;
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 28px;
	padding: 9px;
	box-shadow: 0 10px 24px -8px #00000055;
}
.hero-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.hero-brand {
	font-size: 12.5px;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: #dbe9ff;
	margin: 0 0 14px;
}
.auth-hero h2 {
	font-size: 32px;
	font-weight: 700;
	letter-spacing: -.02em;
	line-height: 1.2;
	margin: 0 0 16px;
	max-width: 380px;
}
.auth-hero p.hero-sub {
	font-size: 15px;
	color: #dbe9ff;
	max-width: 360px;
	margin: 0;
	position: relative;
	z-index: 1;
}
.hero-mark, .hero-brand, .auth-hero h2 { position: relative; z-index: 1; }

.auth-form-panel {
	flex: 1 1 54%;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
@media (max-width: 860px) {
	.auth-hero { display: none; }
	.auth-form-panel { flex: 1 1 100%; }
}

.auth-card { width: 400px; max-width: 100%; }
.auth-card-eyebrow {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--accent);
	margin: 0 0 10px;
}
.auth-card h1 {
	font-size: 24px;
	font-weight: 700;
	letter-spacing: -.01em;
	color: var(--text);
	margin: 0 0 8px;
}
.auth-card > p.auth-lede {
	color: var(--text-dim);
	font-size: 14px;
	margin: 0 0 28px;
}

.field { margin-bottom: 18px; }
.field label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: var(--text);
	margin-bottom: 7px;
}
.field-input { position: relative; display: flex; align-items: center; }
.field-input svg {
	position: absolute;
	left: 13px;
	width: 17px;
	height: 17px;
	color: var(--text-dim);
	pointer-events: none;
}
.field-input input {
	width: 100%;
	background: var(--surface);
	border: 1.5px solid var(--border);
	border-radius: 9px;
	color: var(--text);
	font-size: 14.5px;
	padding: 11px 12px 11px 40px;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.field-input input::placeholder { color: #a8b1c2; }
.field-input input:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 4px var(--accent-soft);
}
.field-input:focus-within svg { color: var(--accent); }
.field-input input.has-toggle { padding-right: 42px; }
.toggle-password {
	position: absolute;
	right: 6px;
	background: none;
	border: none;
	padding: 6px;
	cursor: pointer;
	color: var(--text-dim);
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 6px;
}
.toggle-password:hover { color: var(--accent); background: var(--accent-soft); }
.toggle-password svg { width: 18px; height: 18px; }
.toggle-password .icon-eye-off { display: none; }
.toggle-password.is-showing .icon-eye { display: none; }
.toggle-password.is-showing .icon-eye-off { display: block; }

.field-checkbox {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: -6px 0 20px;
	font-size: 13.5px;
	color: var(--text-dim);
	cursor: pointer;
	user-select: none;
}
.field-checkbox input[type="checkbox"] {
	width: 16px;
	height: 16px;
	accent-color: var(--accent);
	cursor: pointer;
}

.btn-primary {
	width: 100%;
	background: linear-gradient(135deg, var(--accent), var(--accent-strong));
	color: #fff;
	border: none;
	border-radius: 9px;
	font-size: 15px;
	font-weight: 650;
	padding: 12.5px 16px;
	cursor: pointer;
	margin-top: 8px;
	box-shadow: 0 12px 24px -10px #2f6fed6b;
	transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.btn-primary:hover { filter: brightness(1.07); box-shadow: 0 16px 30px -10px #2f6fed85; }
.btn-primary:active { transform: translateY(1px); }

.auth-error {
	display: flex;
	align-items: flex-start;
	gap: 9px;
	background: var(--danger-soft);
	border: 1px solid #dc262640;
	color: #b91c1c;
	border-radius: 9px;
	padding: 11px 13px;
	font-size: 13px;
	margin-bottom: 18px;
}
.auth-error svg { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 2px; color: #dc2626; }

.auth-footer {
	text-align: center;
	color: var(--text-dim);
	font-size: 12px;
	margin-top: 24px;
}

/* ---------- Launcher grid ---------- */
.launcher-shell { max-width: 980px; margin: 0 auto; padding: 56px 24px; }
.launcher-header { margin-bottom: 32px; display: flex; align-items: center; gap: 16px; }
.launcher-header .hero-mark {
	width: 48px; height: 48px; border-radius: 12px; margin-bottom: 0; padding: 7px;
	box-shadow: 0 6px 16px -8px #1c25361a;
	border: 1px solid var(--border);
}
.launcher-header h1 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; color: var(--text); margin: 0 0 4px; }
.launcher-header p { color: var(--text-dim); margin: 0; font-size: 14px; }
.launcher-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 16px;
}
.launcher-card {
	display: flex;
	flex-direction: column;
	background: var(--surface);
	border: 1.5px solid var(--border);
	border-radius: 13px;
	overflow: hidden;
	color: var(--text);
	box-shadow: 0 1px 2px #1c25360a;
	transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.launcher-card:hover {
	border-color: var(--accent);
	text-decoration: none;
	transform: translateY(-3px);
	box-shadow: 0 16px 28px -16px #2f6fed40;
}
.launcher-card-shot {
	aspect-ratio: 16 / 10;
	background: var(--bg);
	border-bottom: 1px solid var(--border);
	overflow: hidden;
}
.launcher-card-shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.launcher-card-shot-empty { display: flex; align-items: center; justify-content: center; }
.launcher-card-info { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.launcher-badge {
	flex: 0 0 auto;
	width: 42px;
	height: 42px;
	border-radius: 10px;
	background: var(--accent-soft);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	color: var(--accent-strong);
}
.launcher-card-shot-empty .launcher-badge { width: 52px; height: 52px; font-size: 20px; }
.launcher-card-name { font-weight: 650; color: var(--text); font-size: 14px; }
.launcher-empty { color: var(--text-dim); }

.ci-pill {
	display: inline-block;
	font-size: 11px;
	font-weight: 650;
	letter-spacing: .04em;
	text-transform: uppercase;
	border-radius: 999px;
	padding: 2px 9px;
}
.ci-pill-ok { color: #15803d; background: #15803d1a; border: 1px solid #15803d40; }
.ci-pill-off { color: var(--text-dim); background: #f1f4f9; border: 1px solid var(--border); }

/* ---------- Admin screens: dense tables, not centered cards ---------- */
.admin-shell { max-width: 1080px; margin: 0 auto; padding: 32px 24px 64px; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.admin-topbar h1 { font-size: 20px; font-weight: 700; color: var(--text); margin: 0; }
.admin-nav { display: flex; gap: 4px; margin-bottom: 24px; border-bottom: 1px solid var(--border); }
.admin-nav a { padding: 10px 14px; font-size: 13.5px; font-weight: 600; color: var(--text-dim); border-bottom: 2px solid transparent; }
.admin-nav a:hover { text-decoration: none; color: var(--text); }
.admin-nav a.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.admin-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-bottom: 20px; }
.admin-panel-title { padding: 14px 18px; font-size: 13px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: .03em; border-bottom: 1px solid var(--border); background: #f8fafd; }
table.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.admin-table th { text-align: left; padding: 10px 16px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--text-dim); border-bottom: 1px solid var(--border); }
table.admin-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.admin-table tr:last-child td { border-bottom: none; }
table.admin-table td.actions { text-align: right; white-space: nowrap; }
.admin-flash { border-radius: 9px; padding: 11px 14px; font-size: 13.5px; margin-bottom: 18px; }
.admin-flash-ok { background: #15803d14; border: 1px solid #15803d40; color: #15803d; }
.admin-flash-err { background: var(--danger-soft); border: 1px solid #dc262640; color: #b91c1c; }
.admin-form .field { max-width: 480px; }
.admin-form .field-row { display: flex; gap: 16px; }
.admin-form .field-row .field { flex: 1; }
.btn-secondary {
	display: inline-block;
	background: var(--surface);
	color: var(--text);
	border: 1.5px solid var(--border);
	border-radius: 7px;
	font-size: 13px;
	font-weight: 600;
	padding: 7px 13px;
	cursor: pointer;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn-danger { color: var(--danger); border-color: #dc262640; }
.btn-danger:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.level-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px 16px; padding: 16px 18px; }
.level-grid label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; padding: 5px 0; cursor: pointer; }
.level-grid input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--accent); }
.cutover-banner { border-radius: 10px; padding: 14px 18px; font-size: 14px; font-weight: 600; margin-bottom: 20px; }
.cutover-banner.is-ready { background: #15803d14; border: 1px solid #15803d40; color: #15803d; }
.cutover-banner.is-blocked { background: #b4530914; border: 1px solid #b4530940; color: #b45309; }

/* Impersonation banner (Phase 5) */
.impersonate-banner {
	position: fixed;
	top: 0; left: 0; right: 0;
	background: var(--danger);
	color: #fff;
	text-align: center;
	font-size: 13px;
	font-weight: 600;
	padding: 8px 12px;
	z-index: 999999;
}
.impersonate-banner a { color: #fff; text-decoration: underline; }
