/*
 * Warpfeed's palette, on the same token names as Parsec's so the two read
 * as one product family. tabm-brand.css owns the header bar, the logo and
 * the footer; everything else on the page is here.
 *
 * Three theme states: light, dark, and follow the machine. The absence of
 * data-theme means "follow the machine", so the prefers-color-scheme block
 * is guarded by :root:not([data-theme]) and an explicit choice wins.
 */

:root {
	--bg: #14161a;
	--panel: #1b1e24;
	--panel-2: #22262e;
	--text: #e8eaed;
	--muted: #9aa3af;
	--border: #2d323b;
	--brand: #cc3627;
	--link: #7aa7ff;
	--ok: #3fb950;
	--danger: #f85149;
	--radius: 6px;
	--mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

	--tabm-header-bg: #0f1114;
	--tabm-header-text: #e8eaed;
	/* The brand footer default is tuned for a dark bar and fails AA on a
	   light one; pointing it at --muted follows every theme state. */
	--tabm-footer-text: var(--muted);
}

:root[data-theme='light'] {
	--bg: #f6f7f9;
	--panel: #ffffff;
	--panel-2: #f0f2f5;
	--text: #1b1e24;
	--muted: #5b6472;
	--border: #d8dde4;
	--link: #1f5fd1;
	--ok: #1a7f37;
	--danger: #cf222e;
	--tabm-header-bg: #ffffff;
	--tabm-header-text: #1b1e24;
}

@media (prefers-color-scheme: light) {
	:root:not([data-theme]) {
		--bg: #f6f7f9;
		--panel: #ffffff;
		--panel-2: #f0f2f5;
		--text: #1b1e24;
		--muted: #5b6472;
		--border: #d8dde4;
		--link: #1f5fd1;
		--ok: #1a7f37;
		--danger: #cf222e;
		--tabm-header-bg: #ffffff;
		--tabm-header-text: #1b1e24;
	}
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
	min-height: 100vh; display: flex; flex-direction: column;
	background: var(--bg); color: var(--text);
	font: 14px/1.45 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
main { flex: 1; width: 100%; max-width: 1100px; margin: 20px auto; padding: 0 16px; }
a { color: var(--link); }

/* header: the bar itself is tabm-brand.css; nav and user are ours */
.topbar nav { display: flex; gap: 18px; flex: 1; margin-left: 24px; }
.topbar nav a, .topbar .who { color: var(--tabm-header-text); opacity: 0.7; text-decoration: none; font-size: 14px; }
.topbar nav a:hover, .topbar nav a.on { opacity: 1; }
.topbar .right { display: flex; align-items: center; gap: 14px; }
.topbar button.link { color: var(--tabm-header-text); opacity: 0.7; }
.topbar button.link:hover { opacity: 1; }

.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 16px; margin-bottom: 16px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
td.num { text-align: right; white-space: nowrap; }

input, textarea, select, button { font: inherit; color: inherit; }
input[type=text], input[type=password], textarea {
	background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
	padding: 7px 9px; width: 100%;
}
input:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
textarea { font-family: var(--mono); min-height: 90px; }
button, .btn {
	background: var(--brand); color: #fff; border: 0; border-radius: var(--radius);
	padding: 7px 14px; cursor: pointer; font-weight: 500; text-decoration: none; display: inline-block;
}
button:hover { filter: brightness(1.1); }
button.link { background: none; color: var(--link); padding: 0; font-weight: 400; }
button.danger { background: none; color: var(--danger); padding: 0; font-weight: 400; }

.muted { color: var(--muted); }
.err { color: var(--danger); }
.ok { color: var(--ok); }
.msg { padding: 8px 12px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--brand); margin-bottom: 12px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.crumbs a { text-decoration: none; }
code { font-family: var(--mono); font-size: 12.5px; background: var(--panel-2); padding: 1px 5px; border-radius: 4px; }
form.inline { display: inline; }
label { display: block; margin: 10px 0 4px; color: var(--muted); font-size: 12px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
h3 { margin-top: 0; }

/* the login page, ported from tabm-brand/login-template.html */
body.login-body {
	align-items: center; justify-content: center;
	background: radial-gradient(700px circle at 50% -10%, rgba(204, 54, 39, 0.18), transparent 60%), var(--bg);
}
.login-wrap { width: 100%; max-width: 380px; padding: 24px; }
.login-brand { text-align: center; margin-bottom: 28px; }
.login-brand img { height: 64px; width: auto; display: block; margin: 0 auto 16px; }
.login-brand .eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--brand); margin-bottom: 6px; }
.login-brand h1 { margin: 0; font-size: 24px; color: var(--text); }
.login-brand .tagline { margin-top: 6px; font-size: 13px; color: var(--muted); }
.login-card {
	background: var(--panel); border: 1px solid var(--border); border-top: 3px solid var(--brand);
	border-radius: 10px; padding: 28px 24px;
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.3);
}
.login-card label:first-of-type { margin-top: 0; }
.login-card button { width: 100%; margin-top: 20px; padding: 11px 16px; font-size: 14px; }
/* Sign in with Microsoft, as hub.tabm.xyz draws it: white with the four
   squares in both themes, because that is what Microsoft's own button is. */
.ms-signin {
	width: 100%; padding: 10px 16px; font-size: 14px; display: flex; align-items: center;
	justify-content: center; gap: 10px; background: #fff; color: #1b1f29; border: 1px solid var(--border);
	text-decoration: none; border-radius: 6px; font-weight: 600; box-sizing: border-box;
}
.ms-signin:hover { background: #f3f3f3; text-decoration: none; }
.login-divider { display: flex; align-items: center; gap: 10px; margin: 20px 0; color: var(--muted); font-size: 12px; text-align: center; }
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.login-foot { text-align: center; margin-top: 20px; font-size: 12px; color: var(--muted); }

@media (max-width: 700px) {
	.grid { grid-template-columns: 1fr; }
	td.hide, th.hide { display: none; }
	.topbar { flex-wrap: wrap; }
	.topbar nav { margin-left: 0; order: 3; width: 100%; }
}
