/* Claude Apps console - dark theme in the same family as the inventory app's /manage page. */

:root {
	--bg: #12121c;
	--card: #1e1e2e;
	--border: #2a2a3e;
	--text: #e0e0f0;
	--muted: #8a8aa0;
	--accent: #4a9eff;
	--ok: #00e676;
	--warn: #ffbd2e;
	--err: #ff6b6b;
}

* { box-sizing: border-box; }

html { overflow-y: scroll; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.45;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { color: var(--accent); font-family: ui-monospace, Consolas, monospace; font-size: 0.92em; }
h1 { font-size: 1.6em; margin: 0 0 18px; }
h2 { font-size: 1.15em; margin: 0 0 12px; }
.muted { color: var(--muted); }

/* nav */
.topnav {
	display: flex;
	align-items: center;
	gap: 24px;
	padding: 0 24px;
	height: 52px;
	background: var(--card);
	border-bottom: 1px solid var(--border);
}
.topnav .brand { color: var(--text); font-weight: 700; }
.topnav .links { display: flex; gap: 16px; flex: 1; }
.topnav .links a { color: var(--muted); padding: 4px 0; }
.topnav .links a.active, .topnav .links a:hover { color: var(--text); text-decoration: none; }
.topnav .who { display: flex; align-items: center; gap: 12px; }
form.inline { display: inline; margin: 0; }

/* layout */
.wrap { max-width: 960px; margin: 30px auto; padding: 0 16px; }

.card {
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: 10px;
	padding: 18px 22px;
	margin-bottom: 18px;
}
.row {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	padding: 7px 0;
	border-bottom: 1px solid var(--border);
}
.row:last-of-type { border-bottom: none; }
.row .label { color: var(--muted); }
.row .value { font-family: ui-monospace, Consolas, monospace; }

/* buttons + forms */
.btn {
	display: inline-block;
	padding: 9px 20px;
	border: 1px solid var(--accent);
	border-radius: 6px;
	background: var(--accent);
	color: #fff;
	font: inherit;
	cursor: pointer;
}
.btn:hover { filter: brightness(1.1); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-small { padding: 5px 12px; font-size: 0.9em; }
.btn-ghost { background: #2a405b; color: var(--text); border-color: #3a527a; }
.btn-ghost:hover { background: #33507a; }

label { display: block; margin-bottom: 14px; color: var(--muted); font-size: 0.9em; }
input[type="text"], input[type="password"] {
	display: block;
	width: 100%;
	margin-top: 5px;
	padding: 9px 11px;
	border: 1px solid var(--border);
	border-radius: 6px;
	background: var(--bg);
	color: var(--text);
	font: inherit;
	font-size: 1.05em;
}
input:focus { outline: none; border-color: var(--accent); }

.notice { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; font-size: 0.92em; }
.notice-err { color: var(--err); background: rgba(255, 107, 107, 0.1); border: 1px solid rgba(255, 107, 107, 0.3); }
.notice-warn { color: var(--warn); background: rgba(255, 189, 46, 0.12); border: 1px solid rgba(255, 189, 46, 0.35); }

/* login */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box {
	width: 100%;
	max-width: 360px;
	margin: 16px;
	padding: 28px 30px;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: 10px;
}
.login-box h1 { margin-bottom: 2px; }
.login-box p { margin: 0 0 22px; }
.login-box .btn { width: 100%; margin-top: 6px; }

/* app cards */
.h-sub { font-size: 0.55em; font-weight: normal; margin-left: 10px; }
.app-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.app-head h2 { margin: 0; }
.app-desc { margin: 4px 0 10px; font-size: 0.92em; }
.badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 10px;
	font-size: 0.8em;
	font-weight: bold;
	vertical-align: middle;
}
.badge-ok { color: var(--ok); background: rgba(0, 230, 118, 0.1); border: 1px solid rgba(0, 230, 118, 0.2); }
.badge-warn { color: var(--warn); background: rgba(255, 189, 46, 0.12); border: 1px solid rgba(255, 189, 46, 0.35); }
.badge-err { color: var(--err); background: rgba(255, 107, 107, 0.1); border: 1px solid rgba(255, 107, 107, 0.3); }
.badge-dev { color: var(--muted); background: rgba(106, 106, 128, 0.1); border: 1px solid rgba(106, 106, 128, 0.3); }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.output {
	display: none;
	margin: 12px 0 0;
	padding: 12px 14px;
	background: #0a0e0a;
	color: #33cc33;
	border: 1px solid rgba(51, 204, 51, 0.25);
	border-radius: 6px;
	font-family: ui-monospace, Consolas, monospace;
	font-size: 0.85em;
	white-space: pre-wrap;
	max-height: 320px;
	overflow: auto;
}
.output-err { color: var(--err); border-color: rgba(255, 107, 107, 0.3); }

/* logs + secrets pages */
.wrap-wide { max-width: 1200px; }
.crumbs { margin: 0 0 6px; font-size: 0.9em; color: var(--muted); }
.small { font-size: 0.85em; }
.spacer { flex: 1; }
.tabs { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.tab { padding: 6px 14px; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); }
.tab.active { color: var(--text); border-color: var(--accent); text-decoration: none; }
.inline-label { display: inline; margin: 0; }
.logview {
	margin: 0 0 18px;
	padding: 12px 14px;
	background: #0a0e0a;
	color: #b8f0b8;
	border: 1px solid rgba(51, 204, 51, 0.25);
	border-radius: 6px;
	font-family: ui-monospace, Consolas, monospace;
	font-size: 0.82em;
	white-space: pre-wrap;
	word-break: break-all;
	height: 70vh;
	overflow: auto;
}
.logview-err { color: #ffb3b3; border-color: rgba(255, 107, 107, 0.3); }
textarea {
	display: block;
	width: 100%;
	margin-top: 6px;
	padding: 9px 11px;
	border: 1px solid var(--border);
	border-radius: 6px;
	background: var(--bg);
	color: var(--text);
	font-family: ui-monospace, Consolas, monospace;
	font-size: 0.95em;
}
textarea:focus { outline: none; border-color: var(--accent); }
.notice-ok { color: var(--ok); background: rgba(0, 230, 118, 0.08); border: 1px solid rgba(0, 230, 118, 0.25); }

/* add app + remove */
.add-form label { margin-bottom: 10px; }
.add-row { display: flex; gap: 14px; }
.add-row label { flex: 1; }
.btn-danger { background: transparent; color: var(--err); border-color: rgba(255, 107, 107, 0.4); }
.btn-danger:hover { background: rgba(255, 107, 107, 0.1); }

/* model picker */
.js-model-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.js-model-picker { align-items: center; gap: 8px; }
select.js-model-select {
	padding: 5px 8px;
	border: 1px solid var(--border);
	border-radius: 6px;
	background: var(--bg);
	color: var(--text);
	font: inherit;
	font-size: 0.9em;
	max-width: 420px;
}

/* card tints: console = muted blue, add-app = muted green. Same darkness as the rest. */
.card-console { background: #1e2436; border-color: #33405f; }
.card-add { background: #1a221d; border-color: #2c4234; }
.card-add h2 { color: #9fd3ae; }
.rule { border: 0; border-top: 1px solid var(--border); margin: 26px 0; }

/* installed-app card headers only (not the console card, not Add-app) */
.app-card:not(.card-console) h2 {
	border: 1px solid #8d8b8f;
	padding: 5px;
	border-radius: 3px;
	background: #1a1a1a;
}

/* claude cli row */
.js-cli-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* activity page */
table.activity { width: 100%; border-collapse: collapse; font-size: 0.93em; }
table.activity td { padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.activity tr:last-child td { border-bottom: none; }
table.activity .when { color: var(--muted); white-space: nowrap; width: 130px; }
table.activity .who { font-weight: 600; white-space: nowrap; width: 90px; }
table.activity .act-login_failed .what, table.activity .act-login_blocked .what, table.activity .act-denied .what { color: var(--warn); }
table.activity .act-remove_app .what { color: var(--err); }
