* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}
body {
	font-family: system-ui, sans-serif;
	background: #1a1a2e;
	color: #eee;
	min-height: 100vh;
	padding: 20px;
}
.container {
	max-width: 1200px;
	margin: 0 auto;
}
h1 {
	text-align: center;
	margin-bottom: 20px;
	color: #00d4ff;
}
.card {
	background: #16213e;
	border-radius: 12px;
	padding: 20px;
	margin-bottom: 20px;
}
.card h2 {
	margin-bottom: 15px;
	font-size: 18px;
	color: #00d4ff;
}
label {
	display: block;
	margin-bottom: 5px;
	font-weight: 500;
	color: #aaa;
}
select,
input[type="text"] {
	width: 100%;
	padding: 10px;
	border: 1px solid #333;
	border-radius: 6px;
	background: #0f3460;
	color: #fff;
	font-size: 14px;
	margin-bottom: 15px;
}
select:focus,
input:focus {
	outline: none;
	border-color: #00d4ff;
}

/* Tabs */
.tabs {
	display: flex;
	gap: 4px;
	margin-bottom: 20px;
	background: #16213e;
	border-radius: 12px;
	padding: 6px;
}
.tab-btn {
	flex: 1;
	padding: 12px 20px;
	border: none;
	border-radius: 8px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	background: transparent;
	color: #888;
	transition:
		background 0.2s,
		color 0.2s;
}
.tab-btn.active {
	background: #0f3460;
	color: #00d4ff;
}
.tab-content {
	display: none;
}
.tab-content.active {
	display: block;
}

/* Manual: Video */
.video-container {
	position: relative;
	width: 100%;
	max-width: 400px;
	margin: 0 auto 15px;
}
#overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	display: block;
	transform: scaleX(-1);
}
video {
	width: 100%;
	border-radius: 8px;
	background: #000;
	display: block;
	transform: scaleX(-1);
}
canvas.hidden-preview {
	display: none;
}
.photo-preview {
	width: 100%;
	max-width: 400px;
	margin: 10px auto;
	border-radius: 8px;
	display: none;
}
#capturedImage {
	max-width: 400px;
	width: 100%;
	border-radius: 8px;
	display: none;
	margin: 10px auto;
}

/* Buttons */
.buttons {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}
button {
	flex: 1;
	min-width: 100px;
	padding: 12px 16px;
	border: none;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition:
		transform 0.1s,
		opacity 0.2s;
}
button:hover {
	transform: scale(1.02);
}
button:active {
	transform: scale(0.98);
}
button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	transform: none;
}
.btn-capture {
	background: #00d4ff;
	color: #000;
}
.btn-enroll {
	background: #00b894;
	color: #000;
}
.btn-verify {
	background: #6c5ce7;
	color: #fff;
}
.btn-verify-spoof {
	background: #a29bfe;
	color: #000;
}
.btn-verify-face {
	background: #fd79a8;
	color: #fff;
}
.btn-check {
	background: #fdcb6e;
	color: #000;
}
.btn-delete {
	background: #d63031;
	color: #fff;
}
.btn-clear {
	background: #555;
	color: #fff;
}
.btn-track {
	background: #0984e3;
	color: #fff;
}
.btn-track.active {
	background: #00b894;
	color: #000;
}
.btn-refresh {
	background: #555;
	color: #fff;
	margin-top: 10px;
}

/* Status & Response */
.status {
	text-align: center;
	padding: 8px;
	border-radius: 6px;
	margin-bottom: 15px;
	font-weight: 500;
}
.status.info {
	background: #0f3460;
	color: #00d4ff;
}
.status.ok {
	background: #00b894;
	color: #000;
}
.status.err {
	background: #d63031;
	color: #fff;
}
.response {
	background: #0a0a1a;
	border: 1px solid #333;
	border-radius: 8px;
	padding: 15px;
	margin-top: 15px;
	font-family: monospace;
	font-size: 13px;
	white-space: pre-wrap;
	word-break: break-all;
	max-height: 300px;
	overflow-y: auto;
}
.response.success {
	border-color: #00b894;
}
.response.error {
	border-color: #d63031;
}

/* RUT list */
.rut-list {
	list-style: none;
	padding: 0;
	margin: 0;
}
.rut-list li {
	padding: 8px 12px;
	border-bottom: 1px solid #333;
	display: flex;
	justify-content: space-between;
	align-items: center;
}
.rut-list li:last-child {
	border-bottom: none;
}
.rut-list .rut-text {
	font-family: monospace;
	font-size: 14px;
}
.rut-list .rut-use {
	background: #00d4ff;
	color: #000;
	border: none;
	border-radius: 4px;
	padding: 4px 8px;
	font-size: 12px;
	cursor: pointer;
	flex: none;
}
.rut-list .rut-use:hover {
	background: #00b894;
}
.rut-empty {
	color: #666;
	font-style: italic;
	text-align: center;
	padding: 20px;
}

/* Gallery */
.gallery-row {
	display: flex;
	gap: 10px;
	align-items: end;
}
.gallery-row select {
	flex: 1;
	margin-bottom: 0;
}
.gallery-row button {
	flex: none;
	min-width: auto;
	padding: 10px 14px;
	margin-bottom: 0;
}
.btn-delete-gallery {
	background: #d63031;
	color: #fff;
}
.gallery-info {
	display: flex;
	gap: 15px;
	margin-top: 10px;
	font-size: 13px;
	color: #aaa;
}
.gallery-info span {
	background: #0f3460;
	padding: 4px 10px;
	border-radius: 4px;
}
.gallery-create-row {
	display: flex;
	gap: 10px;
	margin-top: 10px;
}
.gallery-create-row input {
	flex: 1;
	margin-bottom: 0;
}
.gallery-create-row button {
	flex: none;
	min-width: auto;
	padding: 10px 14px;
	margin-bottom: 0;
}
.btn-create-gallery {
	background: #00b894;
	color: #000;
}

/* Auto-tracking: Cameras grid */
.cameras-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
	gap: 16px;
}
.camera-card {
	background: #0f3460;
	border-radius: 10px;
	padding: 14px;
	border: 2px solid transparent;
	transition: border-color 0.2s;
}
.camera-card.active {
	border-color: #00b894;
}
.camera-card.error {
	border-color: #d63031;
}
.camera-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 10px;
}
.camera-name {
	font-weight: 600;
	font-size: 15px;
	color: #00d4ff;
}
.camera-status {
	font-size: 12px;
	padding: 3px 8px;
	border-radius: 4px;
	background: #1a1a2e;
	color: #aaa;
}
.camera-status.connected {
	background: #00b894;
	color: #000;
}
.camera-status.error {
	background: #d63031;
	color: #fff;
}
.camera-status.tracking {
	background: #0984e3;
	color: #fff;
}
.video-wrapper {
	position: relative;
	width: 100%;
	border-radius: 8px;
	overflow: hidden;
	background: #000;
	margin-bottom: 10px;
}
.video-wrapper video {
	width: 100%;
	display: block;
	transform: scaleX(-1);
}
.video-wrapper canvas.overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	transform: scaleX(-1);
}
.camera-result {
	background: #1a1a2e;
	border-radius: 6px;
	padding: 8px 10px;
	font-size: 12px;
	font-family: monospace;
	min-height: 36px;
	display: flex;
	align-items: center;
	color: #aaa;
}
.camera-result.match {
	color: #00b894;
}
.camera-result.no-match {
	color: #fdcb6e;
}
.camera-actions {
	display: flex;
	gap: 6px;
	margin-top: 8px;
}
.camera-actions button {
	flex: 1;
	padding: 7px 10px;
	border: none;
	border-radius: 6px;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	min-width: auto;
}
.btn-track-toggle {
	background: #0984e3;
	color: #fff;
}
.btn-track-toggle.active {
	background: #00b894;
	color: #000;
}
.global-actions {
	display: flex;
	gap: 10px;
	margin-bottom: 15px;
}
.global-actions button {
	padding: 10px 16px;
	border: none;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	min-width: auto;
}
.btn-start-all {
	background: #00b894;
	color: #000;
}
.btn-stop-all {
	background: #d63031;
	color: #fff;
}
.log-area {
	background: #0a0a1a;
	border: 1px solid #333;
	border-radius: 8px;
	padding: 10px;
	font-family: monospace;
	font-size: 11px;
	max-height: 150px;
	overflow-y: auto;
	margin-top: 10px;
}
.log-entry {
	padding: 2px 0;
	color: #888;
}
.log-entry.match {
	color: #00b894;
}
