/* #last edited 2026-06-03T00:46:23+01:00 */

:root {
	--bg: #080b0f;
	--panel: #0f141b;
	--panel-2: #151b23;
	--line: #25313d;
	--text: #edf4f8;
	--muted: #8ea0ad;
	--accent: #3dd6d0;
	--danger: #ff6370;
	--warn: #f0b84a;
	--ok: #5dde8c;
	--shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
	color-scheme: dark;
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	background:
		radial-gradient(circle at 76% 8%, rgba(61, 214, 208, 0.13), transparent 26rem),
		linear-gradient(180deg, #0a0d12 0%, var(--bg) 38rem);
	color: var(--text);
	min-width: 320px;
}

button,
input,
select {
	font: inherit;
}

.topbar {
	display: flex;
	align-items: end;
	justify-content: space-between;
	gap: 2rem;
	padding: 2rem clamp(1rem, 3vw, 2.75rem) 1.2rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	position: sticky;
	top: 0;
	z-index: 10;
	background: rgba(8, 11, 15, 0.88);
	backdrop-filter: blur(18px);
}

h1,
h2,
h3,
p {
	margin: 0;
}

h1 {
	font-size: clamp(1.75rem, 3vw, 3rem);
	letter-spacing: 0;
}

h2 {
	font-size: 1rem;
}

h3 {
	font-size: 0.78rem;
	text-transform: uppercase;
	color: var(--muted);
	letter-spacing: 0.08em;
	margin-bottom: 0.8rem;
}

.eyebrow {
	color: var(--accent);
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	margin-bottom: 0.35rem;
}

.auth-form,
.filters {
	display: flex;
	align-items: end;
	gap: 0.7rem;
	flex-wrap: wrap;
}

label {
	display: grid;
	gap: 0.35rem;
	color: var(--muted);
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

input,
select {
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 7px;
	color: var(--text);
	padding: 0.62rem 0.72rem;
	min-height: 2.42rem;
	outline: none;
}

input:focus,
select:focus {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgba(61, 214, 208, 0.13);
}

button {
	border: 0;
	border-radius: 7px;
	background: var(--accent);
	color: #041011;
	padding: 0.68rem 0.95rem;
	min-height: 2.42rem;
	font-weight: 700;
	cursor: pointer;
}

main {
	padding: 1.2rem clamp(1rem, 3vw, 2.75rem) 3rem;
}

.status-line {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	color: var(--muted);
	font-size: 0.88rem;
	margin-bottom: 1rem;
}

.status-line > div:first-child {
	display: flex;
	align-items: center;
	gap: 0.55rem;
}

.pulse {
	width: 0.58rem;
	height: 0.58rem;
	border-radius: 50%;
	background: var(--warn);
	box-shadow: 0 0 0 rgba(61, 214, 208, 0.5);
}

.pulse.live {
	background: var(--accent);
	animation: pulse 1.8s infinite;
}

@keyframes pulse {
	0% { box-shadow: 0 0 0 0 rgba(61, 214, 208, 0.45); }
	70% { box-shadow: 0 0 0 10px rgba(61, 214, 208, 0); }
	100% { box-shadow: 0 0 0 0 rgba(61, 214, 208, 0); }
}

.kpis {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 1px;
	border: 1px solid var(--line);
	border-radius: 8px;
	overflow: hidden;
	background: var(--line);
	box-shadow: var(--shadow);
	margin-bottom: 1.15rem;
}

.kpi {
	background: rgba(15, 20, 27, 0.94);
	padding: 1.05rem;
	min-height: 6rem;
}

.kpi span {
	display: block;
	color: var(--muted);
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	margin-bottom: 0.7rem;
}

.kpi strong {
	font-size: clamp(1.5rem, 3vw, 2.2rem);
	line-height: 1;
}

.workspace {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(22rem, 30vw);
	gap: 1.1rem;
	align-items: start;
	margin-top: 1.1rem;
}

.primary,
.inspector,
.chart-panel,
.analytics-grid > div {
	background: rgba(15, 20, 27, 0.9);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 8px;
}

.primary,
.inspector {
	padding: 1rem;
	box-shadow: var(--shadow);
}

.section-head {
	display: flex;
	align-items: start;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1rem;
}

.section-head p {
	color: var(--muted);
	font-size: 0.9rem;
	margin-top: 0.28rem;
}

.compact {
	margin-bottom: 0.75rem;
}

.flow-grid,
.analytics-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.85rem;
	margin-bottom: 0.85rem;
}

.chart-panel,
.analytics-grid > div {
	padding: 0.9rem;
}

.bars {
	display: flex;
	align-items: stretch;
	gap: 0.5rem;
	height: 11rem;
	min-height: 11rem;
}

.bar {
	flex: 1 1 3rem;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	gap: 0.38rem;
	color: var(--muted);
	font-size: 0.68rem;
	text-align: center;
	min-width: 0;
}

.bar strong {
	color: var(--text);
	font-size: 0.84rem;
	line-height: 1;
}

.bar span {
	display: block;
	background: linear-gradient(180deg, var(--accent), #1a7778);
	border-radius: 5px 5px 2px 2px;
	min-height: 0.75rem;
	transition: height 240ms ease;
}

.stack-list {
	display: grid;
	gap: 0.55rem;
}

.stack-row {
	display: grid;
	grid-template-columns: minmax(6rem, 1fr) 4rem;
	gap: 0.7rem;
	align-items: center;
	color: var(--muted);
	font-size: 0.84rem;
}

.track {
	height: 0.5rem;
	background: rgba(255, 255, 255, 0.08);
	border-radius: 999px;
	overflow: hidden;
	margin-top: 0.25rem;
}

.track span {
	display: block;
	height: 100%;
	background: var(--accent);
	border-radius: inherit;
	transition: width 220ms ease;
}

.table-wrap {
	overflow: auto;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 8px;
}

table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.85rem;
	min-width: 46rem;
}

th,
td {
	padding: 0.72rem 0.75rem;
	text-align: left;
	border-bottom: 1px solid rgba(255, 255, 255, 0.07);
	vertical-align: top;
}

th {
	color: var(--muted);
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	background: rgba(255, 255, 255, 0.035);
	position: sticky;
	top: 0;
}

tbody tr {
	cursor: pointer;
	transition: background 140ms ease;
}

tbody tr:hover,
tbody tr.selected {
	background: rgba(61, 214, 208, 0.08);
}

.status {
	display: inline-flex;
	border-radius: 999px;
	padding: 0.2rem 0.52rem;
	border: 1px solid rgba(255, 255, 255, 0.12);
	font-size: 0.76rem;
	white-space: nowrap;
}

.status.completed { color: var(--ok); }
.status.failed { color: var(--danger); }
.status.review_required { color: var(--warn); }
.status.processing,
.status.awaiting_script { color: var(--accent); }

.progress {
	width: 7rem;
}

.details {
	display: grid;
	gap: 0.5rem;
	color: var(--muted);
	font-size: 0.86rem;
	margin-bottom: 0.9rem;
}

.details strong {
	color: var(--text);
	font-weight: 700;
}

.empty {
	border: 1px dashed rgba(255, 255, 255, 0.16);
	border-radius: 8px;
	padding: 1rem;
}

.artifact-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
	margin-bottom: 0.8rem;
}

.artifact-list button {
	background: rgba(255, 255, 255, 0.08);
	color: var(--text);
	min-height: auto;
	padding: 0.45rem 0.6rem;
	font-size: 0.78rem;
}

.preview {
	min-height: 18rem;
	max-height: 30rem;
	overflow: auto;
	background: #07090c;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 8px;
	padding: 0.9rem;
	color: #d7e6ec;
	white-space: pre-wrap;
	word-break: break-word;
}

.notice {
	border: 1px solid rgba(240, 184, 74, 0.35);
	color: #f6d58c;
	background: rgba(240, 184, 74, 0.08);
	border-radius: 8px;
	padding: 0.8rem;
	margin-bottom: 0.85rem;
	font-size: 0.88rem;
}

.hidden {
	display: none;
}

.vertical {
	display: grid;
	align-items: stretch;
	margin-bottom: 0.8rem;
}

.mini {
	max-height: 34rem;
}

.mini table {
	min-width: 34rem;
	font-size: 0.78rem;
}

.truncate {
	max-width: 20rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.muted {
	color: var(--muted);
	font-size: 0.78rem;
	margin-top: 0.22rem;
}

@media (max-width: 1100px) {
	.topbar,
	.workspace,
	.section-head {
		display: grid;
	}

	.workspace {
		grid-template-columns: 1fr;
	}

	.kpis,
	.flow-grid,
	.analytics-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 680px) {
	.kpis,
	.flow-grid,
	.analytics-grid {
		grid-template-columns: 1fr;
	}

	.status-line {
		display: grid;
	}

	.auth-form,
	.filters {
		display: grid;
		align-items: stretch;
	}
}
