/* -----------------------------------------------------------------------
   Supportal — Hapticos Device Dashboard
   Utilitarian precision aesthetic. Dual-theme.
   ----------------------------------------------------------------------- */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap');

/* -----------------------------------------------------------------------
   Theme: Dark (default)
   ----------------------------------------------------------------------- */

:root {
	--bg: #09090b;
	--surface: #111113;
	--surface-raised: #18181b;
	--surface-hover: #1e1e22;
	--border: rgba(255, 255, 255, 0.06);
	--border-strong: rgba(255, 255, 255, 0.1);
	--text: #fafafa;
	--text-secondary: #a1a1aa;
	--muted: #71717a;
	--accent: #3b82f6;
	--accent-hover: #60a5fa;
	--accent-subtle: rgba(59, 130, 246, 0.08);
	--green: #22c55e;
	--green-subtle: rgba(34, 197, 94, 0.08);
	--red: #ef4444;
	--red-subtle: rgba(239, 68, 68, 0.08);
	--yellow: #eab308;
	--yellow-subtle: rgba(234, 179, 8, 0.08);
	--purple: #a78bfa;
	--purple-subtle: rgba(167, 139, 250, 0.08);
	--orange: #f97316;
	--orange-subtle: rgba(249, 115, 22, 0.08);

	--font: 'IBM Plex Mono', 'Consolas', 'Menlo', monospace;
	--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
	--shadow-md: 0 2px 8px rgba(0, 0, 0, 0.6);
	--shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.7);
	--radius: 3px;

	--header-bg: var(--surface);
	--header-border: var(--border);
	--overlay-bg: rgba(9, 9, 11, 0.85);
	--braille-bg: #0c0c0e;
	--braille-border: rgba(255, 255, 255, 0.05);
	--braille-dot-inactive: rgba(255, 255, 255, 0.06);
	--braille-dot-active: #e4e4e7;
	--braille-dot-glow: rgba(228, 228, 231, 0.15);
	--scrollbar-track: transparent;
	--scrollbar-thumb: rgba(255, 255, 255, 0.08);
	--input-bg: rgba(255, 255, 255, 0.03);
	--btn-text: #fff;
	--table-header-bg: rgba(255, 255, 255, 0.02);
	--table-row-hover: rgba(255, 255, 255, 0.02);
	--table-border: rgba(255, 255, 255, 0.04);
	--accent-line: linear-gradient(90deg, var(--accent) 0%, transparent 100%);
}

/* -----------------------------------------------------------------------
   Theme: Light
   ----------------------------------------------------------------------- */

[data-theme="light"] {
	--bg: #fafafa;
	--surface: #ffffff;
	--surface-raised: #ffffff;
	--surface-hover: #f4f4f5;
	--border: rgba(0, 0, 0, 0.06);
	--border-strong: rgba(0, 0, 0, 0.12);
	--text: #09090b;
	--text-secondary: #52525b;
	--muted: #52525b;
	--accent: #2563eb;
	--accent-hover: #1d4ed8;
	--accent-subtle: rgba(37, 99, 235, 0.05);
	--green: #16a34a;
	--green-subtle: rgba(22, 163, 74, 0.06);
	--red: #dc2626;
	--red-subtle: rgba(220, 38, 38, 0.06);
	--yellow: #ca8a04;
	--yellow-subtle: rgba(202, 138, 4, 0.06);
	--purple: #7c3aed;
	--purple-subtle: rgba(124, 58, 237, 0.06);
	--orange: #ea580c;
	--orange-subtle: rgba(234, 88, 12, 0.06);

	--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
	--shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06);
	--shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);

	--header-bg: var(--surface);
	--header-border: var(--border);
	--overlay-bg: rgba(250, 250, 250, 0.85);
	--braille-bg: #f4f4f5;
	--braille-border: rgba(0, 0, 0, 0.06);
	--braille-dot-inactive: rgba(0, 0, 0, 0.06);
	--braille-dot-active: #18181b;
	--braille-dot-glow: rgba(24, 24, 27, 0.1);
	--scrollbar-track: transparent;
	--scrollbar-thumb: rgba(0, 0, 0, 0.1);
	--input-bg: #f4f4f5;
	--btn-text: #fff;
	--table-header-bg: rgba(0, 0, 0, 0.02);
	--table-row-hover: rgba(0, 0, 0, 0.02);
	--table-border: rgba(0, 0, 0, 0.04);
	--accent-line: linear-gradient(90deg, var(--accent) 0%, transparent 100%);
}

/* -----------------------------------------------------------------------
   Reset & Base
   ----------------------------------------------------------------------- */

*, *::before, *::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html {
	scrollbar-gutter: stable;
}

body {
	font-family: var(--font);
	background: var(--bg);
	color: var(--text);
	font-size: 14px;
	line-height: 1.6;
	min-height: 100vh;
	overflow-y: scroll;
	transition: background 0.3s ease, color 0.2s ease;
	-webkit-font-smoothing: antialiased;
}

/* Accessible focus ring for keyboard navigation */
:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

a {
	color: var(--accent);
	text-decoration: none;
}

a:hover {
	color: var(--accent-hover);
}

code {
	font-family: var(--font);
	font-size: 0.9em;
	background: var(--accent-subtle);
	padding: 1px 4px;
	border-radius: 2px;
}

/* -----------------------------------------------------------------------
   Header
   ----------------------------------------------------------------------- */

.header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 24px;
	height: 48px;
	background: var(--header-bg);
	border-bottom: 1px solid var(--header-border);
	position: relative;
}

/* Accent trace line under header */
.header::after {
	content: '';
	position: absolute;
	bottom: -1px;
	left: 0;
	width: 200px;
	height: 1px;
	background: var(--accent-line);
	opacity: 0.6;
}

.header-brand {
	display: flex;
	align-items: center;
	gap: 12px;
}

.header-brand h1 {
	font-size: 16px;
	font-weight: 600;
	color: var(--text);
	letter-spacing: -0.02em;
}

.header-brand .brand-mark {
	color: var(--accent);
}

.header-brand .brand-sub {
	font-size: 10px;
	color: var(--muted);
	text-transform: uppercase;
	letter-spacing: 2px;
}

.header-brand .brand-version {
	font-size: 10px;
	color: var(--muted);
	opacity: 0.5;
}

.header-actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

/* Theme Toggle */
.theme-toggle {
	background: transparent;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 4px 8px;
	cursor: pointer;
	color: var(--muted);
	font-size: 12px;
	line-height: 1;
	transition: color 0.15s, border-color 0.15s;
	display: flex;
	align-items: center;
	gap: 5px;
}

.theme-toggle:hover {
	border-color: var(--border-strong);
	color: var(--text);
}

.theme-toggle .theme-icon {
	font-size: 13px;
}

.theme-toggle .theme-label {
	font-family: var(--font);
	font-size: 10px;
	text-transform: uppercase;
	letter-spacing: 1px;
}

/* -----------------------------------------------------------------------
   Layout
   ----------------------------------------------------------------------- */

.container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px 24px;
}

.grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin-top: 12px;
}

.grid-full {
	grid-column: 1 / -1;
}

/* -----------------------------------------------------------------------
   Panel
   ----------------------------------------------------------------------- */

.panel {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow: hidden;
	transition: background 0.2s ease, border-color 0.2s ease;
}

.panel-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 14px;
	border-bottom: 1px solid var(--border);
	font-size: 12px;
	color: var(--muted);
	text-transform: uppercase;
	letter-spacing: 0.8px;
	font-weight: 500;
}

.panel-header .panel-badge {
	font-size: 11px;
	padding: 2px 8px;
	border-radius: 2px;
	background: var(--accent-subtle);
	color: var(--accent);
	font-weight: 600;
	letter-spacing: 0;
}

.panel-body {
	padding: 14px;
}

/* -----------------------------------------------------------------------
   Top Row: Braille + Sensors
   ----------------------------------------------------------------------- */

.top-row {
	display: flex;
	gap: 12px;
	margin-top: 12px;
}

.sensor-column {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 160px;
	max-width: 200px;
}

.sensor-item {
	flex: 1;
	text-align: center;
	padding: 8px 10px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	display: flex;
	flex-direction: column;
	justify-content: center;
	transition: background 0.2s ease;
}

.sensor-label {
	font-size: 10px;
	color: var(--muted);
	text-transform: uppercase;
	letter-spacing: 1px;
	margin-bottom: 2px;
}

.sensor-item .temp-value {
	font-size: 18px;
	font-weight: 500;
}

/* -----------------------------------------------------------------------
   Braille Display Grid
   ----------------------------------------------------------------------- */

.braille-grid {
	display: grid;
	grid-template-rows: repeat(4, 1fr);
	gap: 1px;
	background: var(--braille-bg);
	border: 1px solid var(--braille-border);
	border-radius: var(--radius);
	padding: 6px 4px;
	font-family: var(--font);
	position: relative;
	max-width: fit-content;
}

.touch-canvas {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	z-index: 10;
}

.braille-row {
	display: flex;
	gap: 1px;
}

.braille-cell {
	flex: 1;
	min-width: 26px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 28px;
	color: var(--braille-dot-inactive);
	background: transparent;
	border: none;
	border-radius: 1px;
}

.braille-cell.active {
	color: var(--braille-dot-active);
	text-shadow: 0 0 2px var(--braille-dot-glow);
}

.braille-cell.empty {
	color: var(--braille-dot-inactive);
	opacity: 0.4;
}

.braille-latin {
	margin: 4px 4px 0;
	padding: 4px 6px;
	background: var(--braille-bg);
	border: 1px solid var(--braille-border);
	border-radius: 2px;
	color: var(--muted);
	font-size: 11px;
	line-height: 1.4;
	white-space: pre;
	overflow-x: auto;
	min-height: 1.4em;
	max-width: fit-content;
}

.braille-cell.touch-flash {
	background: rgba(239, 68, 68, 0.4) !important;
	color: #fff !important;
	text-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
	transition: background 0.1s ease-in;
}

/* Keystroke echo on keyboard buttons */
.db.echo, .tb.echo, .dp.echo {
	background: var(--accent) !important;
	color: #fff !important;
	transition: background 0.1s ease-in;
}

/* -----------------------------------------------------------------------
   Signal Log
   ----------------------------------------------------------------------- */

.signal-log {
	max-height: 360px;
	overflow-y: auto;
	padding: 4px 0;
}

.signal-log::-webkit-scrollbar { width: 4px; }
.signal-log::-webkit-scrollbar-track { background: transparent; }
.signal-log::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 2px; }

.signal-entry {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 4px 12px;
	border-bottom: 1px solid var(--table-border);
	font-size: 13px;
	line-height: 1.5;
}

.signal-entry:last-child {
	border-bottom: none;
}

.signal-entry-header {
	display: flex;
	align-items: center;
	gap: 8px;
}

.signal-time {
	color: var(--muted);
	font-size: 12px;
	white-space: nowrap;
	min-width: 64px;
}

.signal-type {
	display: inline-block;
	padding: 1px 6px;
	border-radius: 2px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	white-space: nowrap;
	min-width: 80px;
	text-align: center;
}

.signal-detail {
	color: var(--muted);
	font-size: 12px;
	word-break: break-all;
	padding-left: 68px;
	line-height: 1.4;
}

.signal-value {
	color: var(--text-secondary);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	flex: 1;
}

/* Signal type badges — minimal, flat */
.sig-temp { background: var(--orange-subtle); color: var(--orange); }
.sig-display { background: var(--green-subtle); color: var(--green); }
.sig-keystroke { background: var(--accent-subtle); color: var(--accent); }
.sig-launch { background: var(--purple-subtle); color: var(--purple); }
.sig-transport { background: var(--yellow-subtle); color: var(--yellow); }
.sig-close { background: var(--red-subtle); color: var(--red); }
.sig-touch { background: rgba(233, 69, 96, 0.08); color: #e94560; }
.sig-flash { background: var(--yellow-subtle); color: var(--yellow); }
.sig-vibrate, .sig-buzz { background: var(--purple-subtle); color: var(--purple); }
.sig-pressure { background: var(--accent-subtle); color: var(--accent); }
.sig-unknown { background: rgba(113, 113, 122, 0.08); color: var(--muted); }
.sig-gesture { background: var(--purple-subtle); color: var(--purple); }

/* -----------------------------------------------------------------------
   Gesture Log
   ----------------------------------------------------------------------- */

.gesture-log {
	max-height: 220px;
	overflow-y: auto;
	padding: 2px 0;
}

.gesture-log::-webkit-scrollbar { width: 4px; }
.gesture-log::-webkit-scrollbar-track { background: transparent; }
.gesture-log::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 2px; }

.gesture-placeholder {
	color: var(--muted);
	font-size: 13px;
	padding: 14px;
}

.gesture-entry {
	display: flex;
	align-items: baseline;
	gap: 8px;
	padding: 4px 14px;
	border-bottom: 1px solid var(--table-border);
	font-size: 13px;
	animation: gesture-fade 8s ease-out forwards;
}

.gesture-entry:last-child { border-bottom: none; }

.gesture-entry-time {
	color: var(--muted);
	font-size: 12px;
	white-space: nowrap;
	min-width: 56px;
}

.gesture-entry-name {
	color: var(--purple);
	font-weight: 600;
	white-space: nowrap;
}

.gesture-entry-detail {
	color: var(--muted);
	font-size: 12px;
}

@keyframes gesture-fade {
	0%   { opacity: 1; }
	70%  { opacity: 1; }
	100% { opacity: 0.25; }
}

/* -----------------------------------------------------------------------
   Touch Suppression
   ----------------------------------------------------------------------- */

.suppression-status {
	display: flex;
	align-items: center;
	gap: 10px;
}

.suppression-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--muted);
	flex-shrink: 0;
	transition: background 0.3s, box-shadow 0.3s;
}

.suppression-dot.active {
	background: var(--red);
	box-shadow: 0 0 6px rgba(239, 68, 68, 0.5);
	animation: suppression-pulse 1.2s ease-in-out infinite;
}

@keyframes suppression-pulse {
	0%, 100% { box-shadow: 0 0 4px rgba(239, 68, 68, 0.3); }
	50%       { box-shadow: 0 0 10px rgba(239, 68, 68, 0.6); }
}

.suppression-label {
	font-size: 12px;
	color: var(--muted);
	transition: color 0.3s;
}

.suppression-label.active {
	color: var(--red);
	font-weight: 600;
}

/* -----------------------------------------------------------------------
   Temperature
   ----------------------------------------------------------------------- */

.temp-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 8px;
}

.temp-item {
	text-align: center;
	padding: 8px;
	background: var(--input-bg);
	border-radius: var(--radius);
	border: 1px solid var(--border);
}

.temp-label {
	font-size: 9px;
	color: var(--muted);
	text-transform: uppercase;
	letter-spacing: 1px;
	margin-bottom: 2px;
}

.temp-value {
	font-size: 20px;
	font-weight: 500;
	color: var(--text);
}

.temp-value.temp-normal { color: var(--green); }
.temp-value.temp-warm { color: var(--yellow); }
.temp-value.temp-hot { color: var(--red); }

/* -----------------------------------------------------------------------
   Commands & Inputs
   ----------------------------------------------------------------------- */

.cmd-grid {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 8px;
	align-items: center;
}

.cmd-grid label {
	font-size: 10px;
	color: var(--muted);
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.cmd-row {
	display: flex;
	gap: 6px;
	align-items: center;
	margin-bottom: 6px;
}

.cmd-row:last-child {
	margin-bottom: 0;
}

.cmd-input {
	flex: 1;
	background: var(--input-bg);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 6px 10px;
	color: var(--text);
	font-family: var(--font);
	font-size: 13px;
	outline: none;
	transition: border-color 0.15s;
}

.cmd-input:focus {
	border-color: var(--accent);
}

.cmd-input::placeholder {
	color: var(--muted);
	opacity: 0.5;
}

.cmd-btn {
	background: var(--accent);
	color: var(--btn-text);
	border: none;
	border-radius: var(--radius);
	padding: 6px 14px;
	font-family: var(--font);
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
	letter-spacing: 0.3px;
	transition: opacity 0.12s;
}

.cmd-btn:hover { opacity: 0.85; }
.cmd-btn:active { opacity: 0.7; }
.cmd-btn:disabled { opacity: 0.25; cursor: not-allowed; }

.cmd-btn.cmd-danger { background: var(--red); }
.cmd-btn.cmd-green { background: var(--green); }
.cmd-btn.cmd-purple { background: var(--purple); }
.cmd-btn.cmd-orange { background: var(--orange); }

/* -----------------------------------------------------------------------
   Physical Keyboard Layout
   ----------------------------------------------------------------------- */

.kb-layout {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin-bottom: 10px;
}

.t-row {
	display: flex;
	gap: 6px;
	align-items: end;
}

.t-group {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 3px;
	flex: 1;
}

.t-spacer {
	width: 140px;
	flex-shrink: 0;
}

.tb {
	padding: 8px 4px;
	border: 1px solid var(--border-strong);
	border-radius: var(--radius);
	background: var(--surface-raised);
	color: var(--text);
	cursor: pointer;
	font-size: 13px;
	font-weight: 600;
	text-align: center;
	transition: border-color 0.12s, background 0.12s;
	user-select: none;
}

.tb:hover { border-color: var(--accent); }
.tb:active { background: var(--accent); color: #fff; }

.keys-row {
	display: flex;
	gap: 6px;
	align-items: center;
}

.dots-half {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 3px;
	flex: 1;
}

.space-row { margin-top: 3px; }

.db {
	padding: 10px 4px;
	border: 1px solid var(--border-strong);
	border-radius: var(--radius);
	background: var(--surface-raised);
	color: var(--text);
	cursor: pointer;
	font-size: 13px;
	font-weight: 600;
	text-align: center;
	transition: border-color 0.12s, background 0.12s;
	user-select: none;
	min-width: 0;
	overflow: hidden;
}

.db:hover { border-color: var(--accent); }
.db.on { background: var(--red); border-color: var(--red); color: #fff; }

.dpad {
	display: grid;
	grid-template-columns: repeat(3, 42px);
	grid-template-rows: repeat(3, 42px);
	gap: 2px;
	flex-shrink: 0;
}

.dpad .dp {
	border: 1px solid var(--border-strong);
	border-radius: var(--radius);
	background: var(--surface-raised);
	color: var(--text);
	cursor: pointer;
	font-size: 11px;
	font-weight: 600;
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	transition: border-color 0.12s, background 0.12s;
	user-select: none;
}

.dpad .dp:hover { border-color: var(--accent); }
.dpad .dp:active { background: var(--accent); color: #fff; }
.dpad .dp-blank { visibility: hidden; }
.dpad .dp-center { background: var(--border-strong); border-radius: 50%; }

.kb-send {
	flex: 1;
	min-width: 120px;
	padding: 9px 16px;
	background: var(--red);
	color: #fff;
	border: none;
	border-radius: var(--radius);
	cursor: pointer;
	font-family: var(--font);
	font-size: 13px;
	font-weight: 600;
	transition: opacity 0.12s;
}

.kb-send:hover { opacity: 0.85; }

.kb-quick {
	padding: 9px 16px;
	background: var(--accent);
	color: #fff;
	border: none;
	border-radius: var(--radius);
	cursor: pointer;
	font-family: var(--font);
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
	transition: opacity 0.12s;
}

.kb-quick:hover { opacity: 0.85; }
.kb-quick-danger { background: var(--red); }

.kbd-held {
	font-size: 10px;
	color: var(--yellow);
	font-weight: normal;
}

/* -----------------------------------------------------------------------
   Terminal
   ----------------------------------------------------------------------- */

.terminal-container {
	min-height: 300px;
	background: #09090b;
}

.terminal-resize-handle {
	height: 6px;
	cursor: row-resize;
	background: var(--surface);
	border-top: 1px solid var(--border);
	display: flex;
	align-items: center;
	justify-content: center;
}

.terminal-resize-handle::after {
	content: '';
	width: 24px;
	height: 2px;
	background: var(--border-strong);
	border-radius: 1px;
}

/* -----------------------------------------------------------------------
   Device Logs
   ----------------------------------------------------------------------- */

.logs-file-list {
	max-height: 280px;
	overflow-y: auto;
	font-family: var(--font);
	font-size: 13px;
}

.logs-file-list::-webkit-scrollbar { width: 4px; }
.logs-file-list::-webkit-scrollbar-track { background: transparent; }
.logs-file-list::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 2px; }

.logs-placeholder {
	color: var(--muted);
	padding: 20px 14px;
	text-align: center;
	font-size: 13px;
}

.logs-table {
	width: 100%;
	border-collapse: collapse;
}

.logs-table input[type="checkbox"] {
	accent-color: var(--accent);
	cursor: pointer;
	width: 13px;
	height: 13px;
	vertical-align: middle;
}

.logs-table thead th {
	text-align: left;
	padding: 6px 10px;
	font-size: 11px;
	color: var(--muted);
	text-transform: uppercase;
	letter-spacing: 1px;
	border-bottom: 1px solid var(--border);
}

.logs-table tbody td {
	padding: 4px 10px;
	border-bottom: 1px solid var(--table-border);
	color: var(--text);
}

.logs-table tbody tr:hover {
	background: var(--table-row-hover);
}

/* -----------------------------------------------------------------------
   Auth Overlay
   ----------------------------------------------------------------------- */

.auth-overlay {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: var(--overlay-bg);
	z-index: 1000;
	align-items: center;
	justify-content: center;
	backdrop-filter: blur(8px);
}

.auth-overlay.visible {
	display: flex;
}

.auth-box {
	background: var(--surface);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius);
	padding: 32px;
	width: 360px;
	text-align: center;
}

.auth-box h2 {
	font-size: 16px;
	font-weight: 600;
	margin-bottom: 4px;
}

.auth-box p {
	color: var(--muted);
	font-size: 13px;
	margin-bottom: 16px;
}

.auth-box input {
	width: 100%;
	background: var(--input-bg);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 8px 12px;
	color: var(--text);
	font-family: var(--font);
	font-size: 13px;
	margin-bottom: 10px;
	outline: none;
}

.auth-box input:focus {
	border-color: var(--accent);
}

.auth-box button {
	width: 100%;
}

.auth-error {
	color: var(--red);
	font-size: 12px;
	margin-top: 8px;
	display: none;
}

/* -----------------------------------------------------------------------
   Toast Notifications
   ----------------------------------------------------------------------- */

.toast-container {
	position: fixed;
	top: 12px;
	right: 12px;
	z-index: 2000;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.toast {
	background: var(--surface-raised);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 10px 16px;
	font-size: 13px;
	color: var(--text);
	box-shadow: var(--shadow-md);
	animation: toastIn 0.2s ease-out, toastOut 0.2s ease-in 2.8s forwards;
	max-width: 300px;
}

.toast.toast-success { border-left: 2px solid var(--green); }
.toast.toast-error { border-left: 2px solid var(--red); }
.toast.toast-info { border-left: 2px solid var(--accent); }

@keyframes toastIn {
	from { opacity: 0; transform: translateY(-8px); }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
	from { opacity: 1; }
	to { opacity: 0; }
}

/* -----------------------------------------------------------------------
   Status Bar
   ----------------------------------------------------------------------- */

.status-bar {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 6px 14px;
	font-size: 12px;
	color: var(--muted);
	border-top: 1px solid var(--border);
	background: var(--surface);
	letter-spacing: 0.3px;
	transition: background 0.2s ease;
}

.status-item {
	display: flex;
	align-items: center;
	gap: 5px;
}

.status-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	display: inline-block;
}

.status-dot.dot-green { background: var(--green); box-shadow: 0 0 4px rgba(34, 197, 94, 0.4); }
.status-dot.dot-yellow { background: var(--yellow); box-shadow: 0 0 4px rgba(234, 179, 8, 0.4); }
.status-dot.dot-red { background: var(--red); box-shadow: 0 0 4px rgba(239, 68, 68, 0.4); }
.status-dot.dot-gray { background: var(--muted); }

/* -----------------------------------------------------------------------
   Device Table
   ----------------------------------------------------------------------- */

.device-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.device-table thead th {
	text-align: left;
	padding: 10px 14px;
	font-size: 11px;
	color: var(--muted);
	text-transform: uppercase;
	letter-spacing: 1px;
	border-bottom: 1px solid var(--border);
	background: var(--table-header-bg);
	font-weight: 500;
}

.device-table tbody td {
	padding: 10px 14px;
	border-bottom: 1px solid var(--table-border);
	vertical-align: middle;
}

.device-row {
	cursor: pointer;
	transition: background 0.1s;
}

.device-row:hover {
	background: var(--table-row-hover);
}

/* -----------------------------------------------------------------------
   Status Badge
   ----------------------------------------------------------------------- */

.status-badge {
	display: inline-block;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	vertical-align: middle;
	margin-right: 5px;
}

/* -----------------------------------------------------------------------
   Device Header
   ----------------------------------------------------------------------- */

.device-header {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 10px 24px;
	background: var(--surface);
	border-bottom: 1px solid var(--border);
	font-size: 13px;
}

.device-header .device-serial {
	font-size: 15px;
	font-weight: 600;
	color: var(--text);
}

.device-header .device-meta {
	color: var(--muted);
	font-size: 12px;
}

.device-header .device-meta span {
	margin-right: 12px;
}

/* -----------------------------------------------------------------------
   Back Link
   ----------------------------------------------------------------------- */

.back-link {
	color: var(--muted);
	font-size: 13px;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	transition: color 0.1s;
}

.back-link:hover {
	color: var(--accent);
}

/* -----------------------------------------------------------------------
   Disconnected Banner
   ----------------------------------------------------------------------- */

.disconnected-banner {
	display: none;
	background: var(--red-subtle);
	border: 1px solid rgba(239, 68, 68, 0.15);
	border-radius: var(--radius);
	padding: 10px 16px;
	font-size: 13px;
	color: var(--red);
	text-align: center;
	margin-bottom: 12px;
}

.disconnected-banner.visible {
	display: block;
}

/* -----------------------------------------------------------------------
   MCP Config Button
   ----------------------------------------------------------------------- */

.mcp-btn {
	background: transparent;
	color: var(--purple);
	border: 1px solid var(--purple);
	border-radius: var(--radius);
	padding: 5px 12px;
	font-family: var(--font);
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.12s, color 0.12s;
	margin-left: auto;
}

.mcp-btn:hover {
	background: var(--purple);
	color: #fff;
}

/* -----------------------------------------------------------------------
   API Key Section
   ----------------------------------------------------------------------- */

.api-key-section {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 16px;
	padding: 8px 12px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

.api-key-section label {
	font-size: 11px;
	color: var(--muted);
	text-transform: uppercase;
	letter-spacing: 0.8px;
	white-space: nowrap;
	font-weight: 500;
}

.api-key-section input {
	flex: 1;
	background: var(--input-bg);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 6px 10px;
	color: var(--text);
	font-family: var(--font);
	font-size: 13px;
	outline: none;
}

.api-key-section input:focus {
	border-color: var(--accent);
}

/* -----------------------------------------------------------------------
   Utility
   ----------------------------------------------------------------------- */

.text-muted { color: var(--muted); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-yellow { color: var(--yellow); }
.mt-16 { margin-top: 16px; }
.hidden { display: none !important; }

/* -----------------------------------------------------------------------
   Tab Bar
   ----------------------------------------------------------------------- */

.tab-bar {
	display: flex;
	gap: 0;
	margin-bottom: 16px;
	border-bottom: 1px solid var(--border);
}

.tab-btn {
	background: none;
	border: none;
	border-bottom: 1px solid transparent;
	padding: 10px 16px;
	margin-bottom: -1px;
	font-family: var(--font);
	font-size: 12px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.8px;
	color: var(--muted);
	cursor: pointer;
	transition: color 0.12s, border-color 0.12s;
}

.tab-btn:hover {
	color: var(--text);
}

.tab-btn.active {
	color: var(--text);
	border-bottom-color: var(--accent);
}

.tab-content {
	display: none;
}

.tab-content.active {
	display: block;
}

/* -----------------------------------------------------------------------
   Management
   ----------------------------------------------------------------------- */

.mgmt-label {
	font-size: 12px;
	color: var(--muted);
	text-transform: uppercase;
	letter-spacing: 0.8px;
	min-width: 130px;
	white-space: nowrap;
	font-weight: 500;
}

.mgmt-device-list {
	max-height: 400px;
	overflow-y: auto;
}

.mgmt-device-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 12px;
	border-bottom: 1px solid var(--table-border);
	transition: background 0.1s;
}

.mgmt-device-row:last-child { border-bottom: none; }
.mgmt-device-row:hover { background: var(--table-row-hover); }

.mgmt-device-info {
	display: flex;
	flex-direction: column;
	gap: 1px;
}

.mgmt-device-serial {
	font-size: 14px;
	font-weight: 600;
	color: var(--text);
}

.mgmt-device-mac {
	font-size: 12px;
	color: var(--muted);
}

.cmd-btn.cmd-danger-outline {
	background: transparent;
	color: var(--red);
	border: 1px solid rgba(239, 68, 68, 0.3);
	font-size: 12px;
	padding: 4px 12px;
}

.cmd-btn.cmd-danger-outline:hover {
	background: var(--red-subtle);
	border-color: var(--red);
}

.cmd-btn.cmd-warning-outline {
	background: transparent;
	color: var(--yellow);
	border: 1px solid rgba(234, 179, 8, 0.3);
	font-size: 12px;
	padding: 4px 12px;
}

.cmd-btn.cmd-warning-outline:hover {
	background: var(--yellow-subtle);
	border-color: var(--yellow);
}

.cmd-btn.cmd-warning-outline:disabled {
	opacity: 0.3;
	cursor: not-allowed;
}

.mgmt-device-actions {
	display: flex;
	gap: 6px;
	align-items: center;
}

.mac-cell {
	font-size: 12px;
	color: var(--muted);
	letter-spacing: 0.5px;
}

/* -----------------------------------------------------------------------
   Log Type Badges
   ----------------------------------------------------------------------- */

.log-type-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 2px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.log-type-report { background: var(--accent-subtle); color: var(--accent); }
.log-type-capture { background: var(--orange-subtle); color: var(--orange); }
.log-type-unknown { background: rgba(113, 113, 122, 0.08); color: var(--muted); }
