/* surf - retro-industrial components
   Beveled panels, chunky shadows, gradient fills, avionics geometry */

/* ==================== PAGE HEADER ==================== */

.page-header {
	margin-bottom: 20px;
	padding: 8px 12px 12px;
	border-bottom: 1px solid var(--bevel-lo);
	position: relative;
	background: var(--bg-2, #10141c);
	border-radius: var(--radius, 4px) var(--radius, 4px) 0 0;
}

/* glowing accent underline */
.page-header::after {
	content: '';
	position: absolute;
	bottom: -1px;
	left: 0;
	width: 60px;
	height: 1px;
	background: var(--accent);
	box-shadow: 0 0 8px var(--accent-dim);
}

.page-title {
	font-family: 'Courier New', monospace;
	font-size: 18px;
	font-weight: 700;
	color: var(--text-bright);
	letter-spacing: 0.5px;
	text-transform: uppercase;
}

.page-subtitle {
	font-size: 11px;
	color: var(--text-dim);
	margin-top: 3px;
	font-family: 'Courier New', monospace;
}

/* ==================== PANELS (old-steam style) ==================== */

.panel {
	background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
	border: 1px solid var(--bevel-lo);
	border-radius: var(--radius);
	box-shadow: var(--shadow-md);
	position: relative;
	overflow: hidden;
}

/* top bevel highlight */
.panel::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 1px;
	background: var(--bevel-hi);
}

.panel-inset {
	background: var(--bg-inset);
	border: 1px solid var(--bevel-lo);
	border-radius: var(--radius);
	box-shadow: var(--shadow-inset);
}

.panel-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 14px;
	border-bottom: 1px solid var(--bevel-lo);
	background: linear-gradient(180deg, var(--overlay-light), transparent);
}

.panel-title {
	font-family: 'Courier New', monospace;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.8px;
	color: var(--text-secondary);
}

.panel-body {
	padding: 14px;
	background: var(--bg-2, #10141c);
	border-radius: 0 0 var(--radius, 4px) var(--radius, 4px);
}

/* ==================== STAT CARDS ==================== */

.stats-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 10px;
	margin-bottom: 20px;
}

.stat-card {
	background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
	border: 1px solid var(--bevel-lo);
	border-radius: var(--radius);
	padding: 14px;
	box-shadow: var(--shadow-sm);
	position: relative;
	overflow: hidden;
}

/* corner tick mark */
.stat-card::before {
	content: '';
	position: absolute;
	top: 4px;
	right: 4px;
	width: 6px;
	height: 6px;
	border-top: 1px solid var(--accent-dim);
	border-right: 1px solid var(--accent-dim);
}

.stat-label {
	font-family: 'Courier New', monospace;
	font-size: 9px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: var(--text-dim);
}

.stat-value {
	font-family: 'Courier New', monospace;
	font-size: 22px;
	font-weight: 700;
	color: var(--text-bright);
	margin-top: 4px;
	text-shadow: 0 0 20px var(--overlay-light-hover);
}

.stat-value.accent { color: var(--accent); text-shadow: 0 0 16px var(--accent-glow); }
.stat-value.ok { color: var(--ok); }
.stat-value.warn { color: var(--warn); }
.stat-value.err { color: var(--err); }

/* ==================== TOGGLE SWITCH ==================== */

.toggle {
	position: relative;
	width: 34px;
	height: 18px;
	flex-shrink: 0;
	cursor: pointer;
}

.toggle input {
	opacity: 0;
	width: 0;
	height: 0;
	position: absolute;
}

.toggle-track {
	position: absolute;
	inset: 0;
	background: var(--bg-inset);
	border: 1px solid var(--bevel-lo);
	border-radius: 9px;
	box-shadow: var(--shadow-inset);
	transition: all var(--speed-fast) var(--ease);
}

.toggle input:checked + .toggle-track {
	background: linear-gradient(180deg, var(--accent), var(--accent2));
	border-color: var(--accent-dim);
	box-shadow: var(--shadow-inset), 0 0 8px var(--accent-glow);
}

.toggle-thumb {
	position: absolute;
	top: 2px;
	left: 2px;
	width: 14px;
	height: 14px;
	background: var(--toggle-thumb);
	border-radius: 50%;
	border: 1px solid var(--toggle-thumb-border);
	box-shadow: var(--toggle-thumb-shadow);
	transition: transform var(--speed-fast) var(--ease);
	pointer-events: none;
}

.toggle input:checked ~ .toggle-thumb {
	transform: translateX(16px);
	background: var(--toggle-thumb-checked);
}

/* ==================== MODULE CARDS ==================== */

.module-list {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.module-card {
	display: flex;
	flex-direction: column;
	padding: 0;
	transition: all var(--speed-fast) var(--ease);
	position: relative;
	background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
	border: 1px solid var(--bevel-lo);
	border-radius: var(--radius);
	box-shadow: var(--shadow-sm);
	margin-bottom: 2px;
}

.module-card:hover {
	background: linear-gradient(180deg, var(--bg-4), var(--bg-3));
	border-color: var(--border);
	box-shadow: var(--shadow-md);
}

.module-card.enabled {
	border-color: var(--border-accent);
	box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--accent-glow);
}

/* LED indicator on enabled modules */
.module-card.enabled::before {
	content: '';
	position: absolute;
	left: -1px;
	top: 6px;
	bottom: 6px;
	width: 3px;
	background: var(--accent);
	box-shadow: 0 0 8px var(--accent-dim), 0 0 16px var(--accent-glow);
	border-radius: 0 2px 2px 0;
}

/* LED dot indicator */
.led {
	display: inline-block;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--text-dim);
	box-shadow: inset 0 1px 2px rgba(0,0,0,0.5);
	transition: all var(--speed-fast);
	flex-shrink: 0;
}
.led.on {
	background: var(--ok);
	box-shadow: 0 0 4px var(--ok), 0 0 8px rgba(0, 214, 143, 0.3), inset 0 -1px 1px rgba(0,0,0,0.2);
}
.led.warn {
	background: var(--warn);
	box-shadow: 0 0 4px var(--warn), 0 0 8px rgba(229, 160, 0, 0.3), inset 0 -1px 1px rgba(0,0,0,0.2);
}
.led.err {
	background: var(--err);
	box-shadow: 0 0 4px var(--err), 0 0 8px rgba(255, 56, 96, 0.3), inset 0 -1px 1px rgba(0,0,0,0.2);
}
.led.accent {
	background: var(--accent);
	box-shadow: 0 0 4px var(--accent), 0 0 8px var(--accent-dim), inset 0 -1px 1px rgba(0,0,0,0.2);
}
.led.pulse {
	animation: ledPulse 2s ease-in-out infinite;
}

/* Risk + perf badges */
.module-badges {
	display: flex;
	gap: 3px;
	align-items: center;
	flex-shrink: 0;
}
.badge-pill {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	padding: 1px 6px;
	border-radius: 8px;
	font-size: 8px;
	font-weight: 600;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	cursor: default;
	position: relative;
}
.badge-pill .led {
	width: 5px;
	height: 5px;
}
.badge-safe {
	color: var(--ok);
	background: var(--ok-bg);
	border: 1px solid rgba(0, 214, 143, 0.15);
}
.badge-risky {
	color: var(--warn);
	background: var(--warn-bg);
	border: 1px solid rgba(229, 160, 0, 0.15);
}
.badge-rage {
	color: var(--err);
	background: var(--err-bg);
	border: 1px solid rgba(255, 56, 96, 0.15);
}
.badge-light {
	color: var(--ok);
	background: var(--ok-bg);
	border: 1px solid rgba(0, 214, 143, 0.1);
}
.badge-medium {
	color: var(--amber);
	background: var(--amber-muted);
	border: 1px solid rgba(229, 160, 0, 0.1);
}
.badge-heavy {
	color: var(--err);
	background: var(--err-bg);
	border: 1px solid rgba(255, 56, 96, 0.1);
}
@keyframes ledPulse {
	0%, 100% { opacity: 0.6; }
	50% { opacity: 1; }
}

.module-info {
	flex: 1;
	min-width: 0;
}

.module-name {
	font-size: 11px;
	font-weight: 600;
	color: var(--text-bright);
	line-height: 1.2;
}

.module-card.enabled .module-name {
	color: var(--accent);
}

.module-desc {
	font-size: 10px;
	color: var(--text-secondary);
	margin-top: 2px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.module-badge {
	font-family: 'Courier New', monospace;
	font-size: 9px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	padding: 2px 7px;
	border-radius: var(--radius);
	background: var(--bg-inset);
	border: 1px solid var(--bevel-lo);
	color: var(--text-dim);
	white-space: nowrap;
	box-shadow: var(--shadow-inset);
}

/* ==================== CATEGORY SECTIONS ==================== */

.category-section {
	margin-bottom: 10px;
}

.category-header {
	font-family: 'Courier New', monospace;
	font-size: 9px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1.2px;
	color: var(--text-dim);
	padding: 0 4px 6px;
	display: flex;
	align-items: center;
	gap: 8px;
}

/* decorative line after category label */
.category-header::after {
	content: '';
	flex: 1;
	height: 1px;
	background: linear-gradient(90deg, var(--bevel-lo), transparent);
}

/* ==================== SETTINGS ==================== */

.setting-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 4px 0;
	border-bottom: 1px solid var(--row-border);
	gap: 8px;
}

.setting-row:last-child {
	border-bottom: none;
}

.setting-label {
	font-size: 11px;
	font-weight: 500;
	color: var(--text-primary);
}

.setting-hint {
	font-size: 9px;
	color: var(--text-dim);
	margin-top: 0;
	display: none; /* hidden by default, show on row hover */
}

.setting-row:hover .setting-hint {
	display: block;
}

.setting-control {
	display: flex;
	align-items: center;
	gap: 8px;
}

/* ==================== INPUTS ==================== */

.input {
	background: var(--bg-1, #0c0f14);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 5px 9px;
	font-size: 12px;
	color: var(--text-primary);
	outline: none;
	box-shadow: var(--shadow-inset);
	transition: border-color var(--speed-fast) var(--ease);
	font-family: 'Courier New', monospace;
}

.input:focus {
	border-color: var(--accent-dim);
	box-shadow: var(--shadow-inset), 0 0 6px var(--accent-glow);
}

.input::placeholder {
	color: var(--text-dim);
}

/* ==================== BUTTONS ==================== */

.btn {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 5px 12px;
	font-family: 'Courier New', monospace;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.3px;
	cursor: pointer;
	user-select: none;
	transition: all var(--speed-fast) var(--ease);

	background: linear-gradient(180deg, var(--bg-4), var(--bg-3));
	border: 1px solid var(--bevel-lo);
	border-radius: var(--radius);
	color: var(--text-secondary);
	box-shadow: var(--shadow-sm);
}

.btn:hover {
	background: linear-gradient(180deg, var(--bg-5), var(--bg-4));
	color: var(--text-bright);
	box-shadow: var(--shadow-md);
}

.btn:active {
	background: linear-gradient(180deg, var(--bg-2), var(--bg-3));
	box-shadow: var(--shadow-inset);
}

.btn-primary {
	background: linear-gradient(180deg, var(--accent), var(--accent2, #0088aa));
	border-color: var(--accent2, #0088aa);
	color: var(--btn-primary-text);
}

.btn-primary:hover {
	background: linear-gradient(180deg, var(--accent-bright), var(--accent));
	color: var(--btn-primary-text);
	box-shadow: var(--shadow-md), 0 0 12px var(--accent-glow);
}

.btn-primary:active {
	background: linear-gradient(180deg, var(--accent2, #0088aa), var(--accent));
}

.btn-danger {
	border-color: var(--btn-danger-border);
	color: var(--err);
}

.btn-danger:hover {
	background: var(--btn-danger-bg);
	border-color: var(--err);
	box-shadow: var(--shadow-md);
}

/* ==================== CONSOLE ==================== */

.console-output {
	background: var(--bg-1, #0c0f14);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 10px 12px;
	font-family: 'Courier New', 'Courier New', monospace;
	font-size: 11px;
	line-height: 1.6;
	color: var(--text-secondary);
	height: calc(100% - 110px);
	min-height: 280px;
	overflow-y: auto;
	white-space: pre-wrap;
	word-break: break-all;
	box-shadow: var(--shadow-inset);

	/* slight phosphor glow effect */
	text-shadow: 0 0 1px var(--text-dim);
}

.console-input-row {
	display: flex;
	gap: 6px;
	margin-top: 10px;
}

.console-input {
	flex: 1;
	background: var(--bg-1, #0c0f14);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 7px 10px;
	font-family: 'Courier New', monospace;
	font-size: 11px;
	color: var(--text-bright);
	outline: none;
	box-shadow: var(--shadow-inset);
	transition: border-color var(--speed-fast) var(--ease);
}

.console-input:focus {
	border-color: var(--accent-dim);
	box-shadow: var(--shadow-inset), 0 0 6px var(--accent-glow);
}

.console-line { }
.console-line.info { color: var(--accent); }
.console-line.success { color: var(--ok); }
.console-line.warning { color: var(--warn); }
.console-line.error { color: var(--err); }

/* ==================== SEARCH BAR ==================== */

.search-bar {
	position: relative;
	margin-bottom: 14px;
}

.search-bar .input {
	width: 100%;
	padding-left: 28px;
}

.search-bar svg {
	position: absolute;
	left: 8px;
	top: 50%;
	transform: translateY(-50%);
	width: 13px;
	height: 13px;
	color: var(--text-dim);
	pointer-events: none;
}

/* ==================== EMPTY STATE ==================== */

.empty-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 40px 20px;
	color: var(--text-dim);
	text-align: center;
	font-family: 'Courier New', monospace;
	font-size: 12px;
}

.empty-state svg {
	width: 36px;
	height: 36px;
	margin-bottom: 12px;
	opacity: 0.2;
}

/* ==================== DECORATIVE ==================== */

.avionics-deco {
	position: absolute;
	pointer-events: none;
}

/* rotating ring animation for dashboard */
@keyframes slowSpin {
	from { transform: rotate(0deg); }
	to { transform: rotate(360deg); }
}

@keyframes pulse {
	0%, 100% { opacity: 0.3; }
	50% { opacity: 0.8; }
}

.deco-ring {
	animation: slowSpin 20s linear infinite;
}

.deco-pulse {
	animation: pulse 3s ease-in-out infinite;
}

/* ==================== TOOLTIP ==================== */

/* Tooltips rendered via JS to avoid overflow clipping */
.surf-tooltip {
	position: fixed;
	padding: 6px 12px;
	background: var(--bg-4);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	border: 1px solid var(--border-accent);
	border-radius: var(--radius-md);
	font-family: 'Courier New', monospace;
	font-size: 10px;
	color: var(--text-bright);
	white-space: nowrap;
	pointer-events: none;
	opacity: 0;
	transform: scale(0.95);
	transition: opacity var(--speed-fast), transform var(--speed-fast);
	box-shadow: var(--shadow-lg);
	z-index: 10000;
}
.surf-tooltip.visible {
	opacity: 1;
	transform: scale(1);
}

/* Module card header + config expansion */
.module-header {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 10px;
	width: 100%;
}
.module-expand-icon {
	font-size: 8px;
	color: var(--text-dim);
	transition: transform 0.15s;
	width: 10px;
	flex-shrink: 0;
}
.module-card.expanded .module-expand-icon {
	transform: rotate(90deg);
}
.module-config-panel {
	padding: 0 10px 0 28px;
	border-top: 1px solid var(--border);
	background: var(--bg-1, #0a0e14);
	max-height: 0;
	overflow: hidden;
	opacity: 0;
	transition: max-height 0.2s ease, opacity 0.15s ease, padding 0.2s ease;
}
.module-card.expanded .module-config-panel {
	max-height: 2000px;
	opacity: 1;
	padding: 4px 10px 6px 28px;
}
.module-config-panel .setting-row {
	padding: 3px 0;
	border-bottom: 1px solid var(--row-border);
}
.module-config-panel .setting-row:last-child { border-bottom: none; }
.module-config-panel .setting-label { font-size: 10px; }
.module-config-panel .setting-hint { font-size: 8px; }
.config-slider { cursor: pointer; }

/* Nav divider */
.nav-divider { margin: 8px 12px; border-top: 1px solid var(--border); opacity: 0.5; }

/* == Custom Color Picker == */
.cp-swatch {
	width: 28px; height: 22px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	cursor: pointer;
	box-shadow: var(--shadow-sm);
	transition: box-shadow var(--speed-fast);
}
.cp-swatch:hover { box-shadow: var(--shadow-md); }
.color-picker-panel {
	position: fixed; z-index: 9999;
	background: var(--bg-2);
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-lg);
	padding: 8px;
	display: flex; flex-direction: column; gap: 6px;
}
.cp-sv { border-radius: var(--radius); cursor: crosshair; display: block; }
.cp-hue { border-radius: 2px; cursor: pointer; display: block; }
.cp-row { display: flex; align-items: center; gap: 6px; }
.cp-hex {
	width: 80px; padding: 3px 6px;
	background: var(--bg-inset); border: 1px solid var(--border);
	border-radius: var(--radius); color: var(--text-primary);
}
.cp-preview {
	width: 22px; height: 22px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

/* == Themed Checkbox (small, inline) == */
input[type="checkbox"]:not(.toggle input) {
	-webkit-appearance: none;
	appearance: none;
	width: 14px; height: 14px;
	background: var(--bg-inset);
	border: 1px solid var(--border);
	border-radius: 2px;
	cursor: pointer;
	vertical-align: middle;
	position: relative;
}
input[type="checkbox"]:checked {
	background: var(--accent);
	border-color: var(--accent);
}
input[type="checkbox"]:checked::after {
	content: '';
	position: absolute;
	left: 3px; top: 0px;
	width: 5px; height: 9px;
	border: solid var(--bg-0);
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

/* == Themed Select == */
select.input, select {
	-webkit-appearance: none;
	appearance: none;
	background: var(--bg-inset);
	color: var(--text-primary);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 4px 24px 4px 8px;
	font-family: Courier New, monospace;
	font-size: 10px;
	cursor: pointer;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23607088'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 8px center;
}
select:focus { border-color: var(--accent); outline: none; }

/* == themed color pickers and sliders == */
input[type="color"] {
	-webkit-appearance: none;
	background: var(--bg-inset);
	border: 1px solid var(--border);
	border-radius: var(--radius, 4px);
	cursor: pointer;
	padding: 2px;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 1px; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 2px; }

input[type="range"] {
	-webkit-appearance: none;
	background: var(--bg-inset);
	border-radius: 3px;
	height: 6px;
	outline: none;
}
input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--accent);
	border: 2px solid var(--bg-3, #161c28);
	cursor: pointer;
	box-shadow: 0 0 4px var(--accent-dim);
}
input[type="range"]::-webkit-slider-thumb:hover {
	box-shadow: 0 0 8px var(--accent-dim);
}

select.input {
	-webkit-appearance: none;
	background: var(--bg-inset);
	color: var(--text-primary);
	border: 1px solid var(--border);
	border-radius: var(--radius, 4px);
	padding: 3px 8px;
	font-family: Courier New, monospace;
	cursor: pointer;
}

/* == list item backgrounds for readability == */
.panel-body > div:nth-child(odd) {
	background: var(--row-stripe);
}
.panel-body > div:hover {
	background: var(--overlay-light-hover);
}

/* == console & editor inset backgrounds == */
.console-output {
	background: var(--accent3, #0a1520) !important;
}
.console-input {
	background: var(--accent3, #0a1520) !important;
}

/* == color picker dark theme override == */
input[type="color"] {
	-webkit-appearance: none;
	appearance: none;
	background: var(--bg-inset) !important;
	border: 1px solid var(--border) !important;
	border-radius: 3px;
	cursor: pointer;
	padding: 2px !important;
	width: 32px !important;
	height: 24px !important;
}
input[type="color"]::-webkit-color-swatch-wrapper {
	padding: 2px;
}
input[type="color"]::-webkit-color-swatch {
	border: none;
	border-radius: 2px;
}

/* == scrollable list containers (hooks, sounds, network, entities) == */
.panel-body[style*="overflow-y"],
div[style*="overflow-y: auto"],
div[style*="overflow-y:auto"] {
	background: var(--bg-2, #10141c);
	border: 1px solid var(--border);
	border-radius: var(--radius, 4px);
	padding: 4px;
}

/* =======================================================
   LAYOUT UTILITIES (replace inline styles in JS)
   ======================================================= */

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-row { display: flex; flex-direction: row; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 2px; }
.gap-4 { gap: 4px; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mb-6 { margin-bottom: 6px; }
.mb-8 { margin-bottom: 8px; }
.p-4 { padding: 4px; }
.p-6 { padding: 6px; }
.p-8 { padding: 8px; }
.shrink-0 { flex-shrink: 0; }
.w-full { width: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mono { font-family: Courier New, 'Courier New', monospace; }
.text-xs { font-size: 9px; }
.text-sm { font-size: 10px; }
.text-base { font-size: 11px; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.uppercase { text-transform: uppercase; }
.tracking { letter-spacing: 0.5px; }

/* text color utilities */
.text-bright { color: var(--text-bright); }
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-dim { color: var(--text-dim); }
.text-accent { color: var(--accent); }
.text-ok { color: var(--ok); }
.text-warn { color: var(--warn); }
.text-err { color: var(--err); }

/* sizing tokens */
.input-sm { width: 80px; }
.input-md { width: 120px; }
.input-lg { width: 200px; }
.min-w-30 { min-width: 30px; }
.min-w-40 { min-width: 40px; }
.min-w-80 { min-width: 80px; }
.max-h-300 { max-height: 300px; }
.max-h-420 { max-height: 420px; }
.max-h-450 { max-height: 450px; }
.overflow-y { overflow-y: auto; }
.cursor-pointer { cursor: pointer; }
.ml-auto { margin-left: auto; }
.no-wrap { white-space: nowrap; }
.bold { font-weight: bold; }
.relative { position: relative; }
.cursor-pointer { cursor: pointer; }
.nowrap { white-space: nowrap; }

/* =======================================================
   INSPECTOR COMPONENTS (hooks, sounds, network, entities)
   ======================================================= */

.list-container {
	font-family: Courier New, monospace;
	font-size: 11px;
	max-height: 500px;
	overflow-y: auto;
	background: var(--bg-2, #10141c);
	border: 1px solid var(--border);
	border-radius: var(--radius, 4px);
	padding: 4px;
}

.list-row {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 3px 6px;
	border-bottom: 1px solid var(--row-border);
	cursor: pointer;
	transition: background var(--speed-fast, 100ms);
}
.list-row:hover { background: var(--bg-hover); }
.list-row:nth-child(odd) { background: var(--row-stripe); }
.list-row:nth-child(odd):hover { background: var(--bg-hover); }
.list-row.selected { background: var(--bg-4, #1c2434); }

.list-group-header {
	color: var(--accent);
	font-weight: bold;
	padding: 4px 6px 2px;
	border-bottom: 1px solid var(--border);
}

/* Color indicator pip */
.color-pip {
	width: 3px;
	height: 14px;
	border-radius: 1px;
	flex-shrink: 0;
}

/* Tab bar (horizontal) */
.tab-bar {
	display: flex;
	gap: 0;
	border-bottom: 1px solid var(--border);
	overflow-x: auto;
}
.tab-btn {
	padding: 6px 14px;
	font-family: Courier New, monospace;
	font-size: 10px;
	background: var(--bg-4);
	color: var(--text-secondary);
	border: 1px solid var(--border);
	border-bottom: 2px solid var(--border);
	border-radius: var(--radius-md) var(--radius-md) 0 0;
	cursor: pointer;
	white-space: nowrap;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: -1px;
}
.tab-btn:hover { background: var(--bg-4); color: var(--text-primary); }
.tab-btn.active {
	background: var(--bg-5);
	color: var(--accent);
	border-bottom-color: var(--bg-5);
	border-top-color: var(--accent);
}

/* Sort buttons */
.sort-btn {
	font-size: 10px;
	padding: 3px 8px;
}

/* Action bar (inline actions for sounds, entities) */
.action-bar {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 6px 10px;
	background: var(--bg-4, #1c2434);
	border: 1px solid var(--border);
	border-radius: var(--radius, 4px);
	margin: 2px 0;
	flex-wrap: wrap;
}

/* Entity detail panel */
.entity-detail {
	width: 240px;
	font-family: Courier New, monospace;
	font-size: 11px;
}
.entity-detail-card {
	background: var(--bg-3, #161c28);
	border: 1px solid var(--border);
	border-radius: var(--radius, 4px);
	padding: 8px;
}
.entity-detail-card .detail-grid {
	display: grid;
	grid-template-columns: 70px 1fr;
	gap: 2px 8px;
	font-size: 10px;
}

/* Stats grid */
.stats-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 8px;
	margin-bottom: 12px;
}

/* Color text helpers */
.text-accent { color: var(--accent); }
.text-ok { color: var(--ok); }
.text-warn { color: var(--warn); }
.text-err { color: var(--err); }
.text-bright { color: var(--text-bright); }
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-dim { color: var(--text-dim); }

/* Fix combobox/select text clipping */
select.input {
	padding: 4px 24px 4px 8px;
	line-height: 1.4;
	min-height: 24px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23607088'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 6px center;
}

/* Opacity helper */
.opacity-50 { opacity: 0.5; }

/* == DASHBOARD STYLES (restored from d8f4f04) == */

/* == stats row == */

/* == DASHBOARD STYLES (restored from d8f4f04) == */

/* == stats row == */
.stats-row { display:flex; gap:10px; margin-bottom:20px; align-items:stretch; }
.stats-cards { display:grid; grid-template-columns:repeat(4, minmax(120px, 1fr)); gap:10px; flex:0 0 auto; }

/* == toolbar == */
.toolbar { display:flex; gap:8px; align-items:center; }

/* == sparkline == */
.spark-card { flex:1; min-width:200px; background:linear-gradient(180deg, var(--bg-3), var(--bg-2)); border:1px solid var(--bevel-lo); border-radius:var(--radius); padding:10px 14px; box-shadow:var(--shadow-sm); position:relative; overflow:hidden; }
.spark-card::before { content:''; position:absolute; top:4px; right:4px; width:6px; height:6px; border-top:1px solid var(--accent-dim); border-right:1px solid var(--accent-dim); }
.spark-label { font-family:'Courier New',monospace; font-size:9px; font-weight:600; text-transform:uppercase; letter-spacing:1px; color:var(--text-dim); margin-bottom:6px; }
.spark-canvas { width:100%; height:40px; }
.spark-legend { margin-top:4px; display:flex; flex-wrap:wrap; }

/* == spoilers == */
.spoiler { background:var(--bg-4); color:transparent; border-radius:var(--radius); cursor:pointer; transition:background var(--speed-fast) var(--ease), color var(--speed-fast) var(--ease); user-select:none; padding:0 2px; font-family:'Courier New',monospace; font-size:11px; }
.spoiler:hover { background:var(--bg-5); }
.spoiler.revealed { background:transparent; color:inherit; user-select:text; cursor:text; }
.spoiler.revealed:hover { color:var(--accent); }
body.spoilers-off .spoiler { background:transparent; color:inherit; user-select:text; cursor:text; }

/* == status dots == */
.online-dot { display:inline-block; width:6px; height:6px; border-radius:50%; margin-right:4px; vertical-align:middle; }
.online-dot.on { background:var(--ok); box-shadow:0 0 4px var(--ok); }
.online-dot.off { background:var(--text-dim); }
.heartbeat-dot { display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:4px; vertical-align:middle; }
.heartbeat-dot.alive { background:var(--ok); box-shadow:0 0 6px var(--ok); }
.heartbeat-dot.dead { background:var(--err); }
.heartbeat-dot.unknown { background:var(--text-dim); }

/* == timeline == */
.timeline { max-height:500px; overflow-y:auto; }
.tl-event { display:flex; gap:8px; padding:4px 0; border-bottom:1px solid var(--row-border); font-size:11px; align-items:flex-start; }
.tl-event:last-child { border-bottom:none; }
.tl-time { color:var(--text-dim); white-space:nowrap; font-family:'Courier New',monospace; font-size:10px; min-width:70px; }
.tl-type { min-width:80px; }
.tl-data { color:var(--text-secondary); word-break:break-all; flex:1; }

/* == DASHBOARD ADDITIONS == */

/* Badges */
.badge-dim { background:var(--bg-3); color:var(--text-secondary); border:1px solid var(--border); }
.badge-yellow { background:rgba(229,160,0,0.15); color:var(--warn); border:1px solid rgba(229,160,0,0.2); }
.badge-accent { background:var(--accent-muted); color:var(--accent); border:1px solid var(--border-accent); }
.badge-green { background:var(--ok-bg); color:var(--ok); border:1px solid rgba(0,214,143,0.2); }
.badge-red { background:var(--err-bg); color:var(--err); border:1px solid rgba(255,56,96,0.2); }

/* Tab body */
.tab-body { display:none; padding:14px; }
.tab-body.active { display:block; }

/* Profile view */
.profile-bar { display:flex; align-items:center; gap:12px; padding:12px 14px; border-bottom:1px solid var(--border); background:linear-gradient(180deg, var(--bg-3), var(--bg-2)); }
.profile-back { cursor:pointer; color:var(--text-dim); font-size:14px; padding:4px 8px; border-radius:var(--radius); transition:all var(--speed-fast) var(--ease); }
.profile-back:hover { color:var(--accent); background:var(--overlay-light); }
.profile-kv { display:flex; flex-wrap:wrap; align-items:center; gap:8px 16px; padding:10px 14px; background:var(--bg-2); border-bottom:1px solid var(--border); }
.profile-meta { display:flex; align-items:center; gap:8px; margin-left:auto; }
.profile-actions { display:flex; align-items:center; gap:8px; margin-left:auto; }
