/**
 * CONTROL_TRABAJOS — Main Stylesheet
 * Estética Dark Mode / Glassmorphism optimizada para pantallas táctiles de obrador y almacén
 */

:root {
	--bg-dark: #0f172a;
	--bg-card: rgba(30, 41, 59, 0.75);
	--bg-card-hover: rgba(51, 65, 85, 0.85);
	--border-color: rgba(148, 163, 184, 0.15);
	--text-main: #f8fafc;
	--text-muted: #94a3b8;
	--accent-primary: #38bdf8;
	--accent-emerald: #10b981;
	--accent-rose: #f43f5e;
	--accent-amber: #f59e0b;
	--font-family: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
	-webkit-tap-highlight-color: transparent;
	user-select: none;
}

body {
	background: radial-gradient(circle at top right, #1e293b, #0f172a 80%);
	color: var(--text-main);
	font-family: var(--font-family);
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
	overflow-x: hidden;
	overflow-y: auto;
}

/* ==========================================================================
   CABECERA
   ========================================================================== */
.app-header {
	background: rgba(15, 23, 42, 0.85);
	backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--border-color);
	padding: 12px 24px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	z-index: 10;
}

.header-left {
	display: flex;
	align-items: center;
	gap: 16px;
}

.brand-logo-container {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
}

.company-logo {
	max-height: 46px;
	max-width: 210px;
	object-fit: contain;
	border-radius: 8px;
	filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
	transition: transform 0.2s ease;
}

.brand-badge {
	background: linear-gradient(135deg, #0284c7, #38bdf8);
	color: #fff;
	font-weight: 800;
	font-size: 1.1rem;
	padding: 6px 14px;
	border-radius: 10px;
	letter-spacing: 0.5px;
	box-shadow: 0 4px 12px rgba(56, 189, 248, 0.25);
	white-space: nowrap;
}

.zone-info {
	display: flex;
	flex-direction: column;
}

.zone-title {
	font-size: 1.25rem;
	font-weight: 700;
	color: #fff;
	display: flex;
	align-items: center;
	gap: 8px;
}

.zone-title .dot {
	width: 10px;
	height: 10px;
	background: var(--accent-emerald);
	border-radius: 50%;
	box-shadow: 0 0 10px var(--accent-emerald);
	animation: pulseDot 2s infinite;
}

.zone-subtitle {
	font-size: 0.85rem;
	color: var(--text-muted);
}

.header-right {
	display: flex;
	align-items: center;
	gap: 20px;
}

.clock-display {
	text-align: right;
}

.clock-time {
	font-size: 1.6rem;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	color: #fff;
	letter-spacing: 1px;
}

.clock-date {
	font-size: 0.85rem;
	color: var(--text-muted);
	text-transform: capitalize;
}

.btn-install-shortcut {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	background: linear-gradient(135deg, rgba(2, 132, 199, 0.25), rgba(56, 189, 248, 0.25));
	border: 1px solid rgba(56, 189, 248, 0.4);
	color: #e0f2fe;
	text-decoration: none;
	padding: 8px 14px;
	border-radius: 12px;
	font-size: 0.85rem;
	font-weight: 700;
	transition: all 0.2s ease;
	white-space: nowrap;
}

.btn-install-shortcut:active {
	transform: scale(0.94);
	background: linear-gradient(135deg, rgba(2, 132, 199, 0.4), rgba(56, 189, 248, 0.4));
}

.btn-config {
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid var(--border-color);
	color: var(--text-main);
	width: 44px;
	height: 44px;
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.2s ease;
}

.btn-config:active {
	transform: scale(0.92);
	background: rgba(255, 255, 255, 0.18);
}

.btn-exit-app {
	background: rgba(239, 68, 68, 0.15);
	border: 1px solid rgba(239, 68, 68, 0.4);
	color: #fca5a5;
	width: 44px;
	height: 44px;
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.2s ease;
}

.btn-exit-app:active {
	transform: scale(0.92);
	background: rgba(239, 68, 68, 0.35);
	color: #fff;
}

/* Modal de Confirmación de Cierre */
.confirm-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.85);
	backdrop-filter: blur(10px);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1500;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

.confirm-modal-overlay.active {
	opacity: 1;
	pointer-events: auto;
}

.confirm-modal-card {
	width: 90%;
	max-width: 440px;
	background: #1e293b;
	border: 1px solid rgba(239, 68, 68, 0.4);
	border-radius: 24px;
	padding: 30px 26px;
	text-align: center;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
	transform: scale(0.9);
	transition: transform 0.2s ease;
}

.confirm-modal-overlay.active .confirm-modal-card {
	transform: scale(1);
}

.confirm-modal-icon {
	font-size: 3rem;
	margin-bottom: 12px;
}

.confirm-modal-title {
	font-size: 1.4rem;
	font-weight: 800;
	color: #fff;
	margin-bottom: 8px;
}

.confirm-modal-desc {
	font-size: 0.95rem;
	color: var(--text-muted);
	line-height: 1.5;
	margin-bottom: 24px;
}

.confirm-modal-actions {
	display: flex;
	gap: 12px;
}

.btn-secondary {
	flex: 1;
	padding: 14px;
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid var(--border-color);
	color: #fff;
	border-radius: 12px;
	font-weight: 700;
	font-size: 1rem;
	cursor: pointer;
}

.btn-danger {
	flex: 1;
	padding: 14px;
	background: linear-gradient(135deg, #dc2626, #ef4444);
	border: none;
	color: #fff;
	border-radius: 12px;
	font-weight: 700;
	font-size: 1rem;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

.btn-secondary:active,
.btn-danger:active {
	transform: scale(0.96);
}

/* ==========================================================================
   LAYOUT PRINCIPAL (2 COLUMNAS)
   ========================================================================== */
.main-container {
	flex: 1;
	display: grid;
	grid-template-columns: minmax(320px, 400px) 1fr;
	gap: 16px;
	padding: 16px 20px;
	height: calc(100vh - 75px);
	overflow: hidden;
}

@media (max-width: 900px) {
	.app-header {
		padding: 10px 14px;
		flex-wrap: wrap;
		gap: 10px;
	}

	.header-left {
		gap: 10px;
	}

	.company-logo {
		max-height: 38px;
		max-width: 150px;
	}

	.clock-time {
		font-size: 1.25rem;
	}

	.clock-date {
		font-size: 0.75rem;
	}

	.main-container {
		grid-template-columns: 1fr;
		grid-template-rows: auto auto;
		height: auto;
		min-height: calc(100vh - 75px);
		overflow-y: visible;
		padding: 12px;
		gap: 14px;
	}

	.camera-wrapper {
		max-width: 240px;
	}

	.presence-panel {
		min-height: 320px;
		overflow: visible;
	}

	.presence-list {
		overflow-y: visible;
	}
}

@media (max-width: 600px) {
	.app-header {
		padding: 8px 10px;
		justify-content: space-between;
	}

	.header-left {
		gap: 8px;
	}

	.company-logo {
		max-height: 32px;
		max-width: 120px;
	}

	.zone-title {
		font-size: 0.95rem;
	}

	.clock-display {
		display: none;
		/* En móviles muy pequeños, ocultar el reloj para dar prioridad a los botones */
	}

	.header-right {
		gap: 8px;
	}

	.btn-install-shortcut {
		padding: 6px 10px;
		font-size: 0.78rem;
	}

	.btn-config,
	.btn-exit-app {
		width: 38px;
		height: 38px;
		border-radius: 10px;
	}

	.main-container {
		padding: 8px;
		gap: 12px;
	}

	.scanner-panel {
		padding: 12px;
	}

	.camera-wrapper {
		max-width: 200px;
	}

	.worker-card {
		padding: 0.6em 0.75em;
		flex: 1 1 100%;
		min-width: 100%;
	}
}

/* ==========================================================================
   COLUMNA IZQUIERDA: ESCÁNER Y CÁMARA
   ========================================================================== */
.scanner-panel {
	background: var(--bg-card);
	backdrop-filter: blur(16px);
	border: 1px solid var(--border-color);
	border-radius: 20px;
	padding: 16px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	gap: 10px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
	overflow-y: auto;
}

.scanner-header {
	width: 100%;
	text-align: center;
	margin-bottom: 0;
}

.scanner-title {
	font-size: 1.05rem;
	font-weight: 700;
	color: #fff;
	margin-bottom: 2px;
}

.scanner-desc {
	font-size: 0.8rem;
	color: var(--text-muted);
}

.camera-wrapper {
	position: relative;
	width: 100%;
	max-width: min(280px, 42vh);
	max-height: min(280px, 42vh);
	aspect-ratio: 1 / 1;
	border-radius: 18px;
	overflow: hidden;
	background: #000;
	border: 2px solid rgba(56, 189, 248, 0.4);
	box-shadow: 0 0 25px rgba(56, 189, 248, 0.15);
	flex-shrink: 0;
}

#reader {
	width: 100% !important;
	height: 100% !important;
	border: none !important;
}

#reader video {
	width: 100% !important;
	height: 100% !important;
	object-fit: cover !important;
	transform: scaleX(-1);
	/* Efecto espejo natural para cámara frontal */
}

/* Guía visual táctil sobre la cámara */
.camera-overlay {
	position: absolute;
	inset: 0;
	pointer-events: none;
	display: flex;
	align-items: center;
	justify-content: center;
}

.scan-laser {
	width: 80%;
	height: 3px;
	background: linear-gradient(90deg, transparent, #38bdf8, transparent);
	box-shadow: 0 0 12px #38bdf8;
	position: absolute;
	animation: scanAnim 2.2s ease-in-out infinite alternate;
}

.scanner-footer {
	width: 100%;
	margin-top: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
}

.status-badge {
	background: rgba(16, 185, 129, 0.12);
	border: 1px solid rgba(16, 185, 129, 0.3);
	color: var(--accent-emerald);
	padding: 8px 14px;
	border-radius: 12px;
	font-size: 0.88rem;
	font-weight: 600;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	text-align: center;
}

.status-badge.paused {
	background: rgba(245, 158, 11, 0.12);
	border-color: rgba(245, 158, 11, 0.3);
	color: var(--accent-amber);
}

.scanner-hardware-info {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 2px;
	font-size: 0.78rem;
	color: var(--text-muted);
}

.scanner-hardware-info .dot-live {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #10b981;
	box-shadow: 0 0 6px #10b981;
	display: inline-block;
}

/* Botón de Fichaje Manual / Teclado (encima de la leyenda Lector de Tarjetas) */
.btn-manual-fichaje {
	width: 100%;
	margin-bottom: 0;
	padding: 11px 16px;
	background: linear-gradient(135deg, rgba(2, 132, 199, 0.35), rgba(56, 189, 248, 0.2));
	border: 1.5px solid rgba(56, 189, 248, 0.5);
	color: #38bdf8;
	border-radius: 14px;
	font-weight: 700;
	font-size: 0.95rem;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	cursor: pointer;
	flex-shrink: 0;
	transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: 0 4px 14px rgba(56, 189, 248, 0.15);
}

.btn-manual-fichaje:hover {
	background: linear-gradient(135deg, rgba(2, 132, 199, 0.55), rgba(56, 189, 248, 0.35));
	border-color: #38bdf8;
	color: #fff;
	transform: translateY(-1px);
	box-shadow: 0 6px 20px rgba(56, 189, 248, 0.3);
}

.btn-manual-fichaje:active {
	transform: scale(0.98);
}

.btn-manual-icon {
	font-size: 1.25rem;
}

/* ==========================================================================
   MODAL FICHAJE MANUAL (ID / NIF / CÓDIGO)
   ========================================================================== */
.manual-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.85);
	backdrop-filter: blur(12px);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1400;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s ease;
	padding: 16px;
}

.manual-modal-overlay.active {
	opacity: 1;
	pointer-events: auto;
}

.manual-modal-card {
	width: 100%;
	max-width: 440px;
	background: #1e293b;
	border: 1px solid rgba(56, 189, 248, 0.3);
	border-radius: 24px;
	padding: 24px;
	box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 30px rgba(56, 189, 248, 0.15);
	transform: scale(0.92);
	transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
	display: flex;
	flex-direction: column;
}

.manual-modal-overlay.active .manual-modal-card {
	transform: scale(1);
}

.manual-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 14px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--border-color);
}

.manual-header-title {
	display: flex;
	align-items: center;
	gap: 10px;
}

.manual-header-icon {
	font-size: 1.5rem;
}

.manual-header-title h3 {
	font-size: 1.25rem;
	font-weight: 800;
	color: #fff;
}

.manual-btn-close {
	background: transparent;
	border: none;
	color: var(--text-muted);
	font-size: 1.8rem;
	line-height: 1;
	cursor: pointer;
	padding: 4px 8px;
	border-radius: 8px;
	transition: color 0.15s, background 0.15s;
}

.manual-btn-close:hover {
	color: #fff;
	background: rgba(255, 255, 255, 0.1);
}

.manual-instruction {
	font-size: 0.88rem;
	color: var(--text-muted);
	margin-bottom: 14px;
	line-height: 1.4;
}

.manual-input-wrapper {
	position: relative;
	display: flex;
	align-items: center;
	margin-bottom: 14px;
}

.manual-input-icon {
	position: absolute;
	left: 14px;
	font-size: 1.2rem;
	pointer-events: none;
	opacity: 0.6;
}

.manual-input-field {
	width: 100%;
	padding: 14px 44px 14px 44px;
	background: rgba(15, 23, 42, 0.8);
	border: 2px solid rgba(56, 189, 248, 0.3);
	border-radius: 14px;
	color: #fff;
	font-size: 1.3rem;
	font-weight: 700;
	letter-spacing: 1px;
	text-align: center;
	text-transform: uppercase;
	outline: none;
	user-select: text;
	transition: all 0.2s ease;
}

.manual-input-field:focus {
	border-color: #38bdf8;
	box-shadow: 0 0 16px rgba(56, 189, 248, 0.3);
	background: rgba(15, 23, 42, 0.95);
}

.manual-btn-clear {
	position: absolute;
	right: 12px;
	background: rgba(255, 255, 255, 0.1);
	border: none;
	color: var(--text-muted);
	font-size: 1.2rem;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s, color 0.15s;
}

.manual-btn-clear:hover {
	background: rgba(239, 68, 68, 0.3);
	color: #ef4444;
}

.manual-alert-box {
	padding: 10px 14px;
	background: rgba(239, 68, 68, 0.15);
	border: 1px solid rgba(239, 68, 68, 0.4);
	color: #fca5a5;
	border-radius: 10px;
	font-size: 0.85rem;
	margin-bottom: 14px;
	text-align: center;
	line-height: 1.4;
}

/* Teclado numérico táctil */
.touch-keypad {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 8px;
	margin-bottom: 16px;
}

.keypad-btn {
	height: 52px;
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 12px;
	color: #fff;
	font-size: 1.35rem;
	font-weight: 700;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s, transform 0.1s, border-color 0.15s;
}

.keypad-btn:active {
	background: rgba(56, 189, 248, 0.25);
	border-color: #38bdf8;
	transform: scale(0.95);
}

.keypad-btn.keypad-clear {
	background: rgba(239, 68, 68, 0.15);
	border-color: rgba(239, 68, 68, 0.3);
	color: #f87171;
}

.keypad-btn.keypad-backspace {
	background: rgba(245, 158, 11, 0.15);
	border-color: rgba(245, 158, 11, 0.3);
	color: #fbbf24;
}

.manual-actions {
	display: flex;
	gap: 10px;
}

.btn-primary-fichar {
	flex: 2;
	padding: 14px;
	background: linear-gradient(135deg, #059669, #10b981);
	border: none;
	color: #fff;
	border-radius: 12px;
	font-weight: 700;
	font-size: 1.05rem;
	cursor: pointer;
	box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	transition: all 0.2s ease;
}

.btn-primary-fichar:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
}

.btn-primary-fichar:not(:disabled):hover {
	background: linear-gradient(135deg, #047857, #059669);
	box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-primary-fichar:not(:disabled):active {
	transform: scale(0.97);
}

/* ==========================================================================
   COLUMNA DERECHA: TRABAJADORES EN ZONA
   ========================================================================== */
.presence-panel {
	background: var(--bg-card);
	backdrop-filter: blur(16px);
	border: 1px solid var(--border-color);
	border-radius: 20px;
	padding: 16px 20px;
	display: flex;
	flex-direction: column;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
	overflow: hidden;
}

.presence-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 12px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--border-color);
}

.presence-title-group {
	display: flex;
	align-items: center;
	gap: 12px;
}

.presence-title {
	font-size: 1.35rem;
	font-weight: 700;
	color: #fff;
}

.badge-count {
	background: rgba(56, 189, 248, 0.15);
	border: 1px solid rgba(56, 189, 248, 0.4);
	color: var(--accent-primary);
	padding: 4px 12px;
	border-radius: 20px;
	font-weight: 700;
	font-size: 0.95rem;
}

.presence-list {
	--card-scale: 1;
	flex: 1;
	overflow-y: auto;
	overflow-x: hidden;
	display: flex;
	flex-wrap: wrap;
	gap: calc(8px * var(--card-scale));
	padding-right: 4px;
	align-content: start;
	font-size: calc(1rem * var(--card-scale));
	-webkit-overflow-scrolling: touch;
}

/* Personalización del scrollbar (fallback si JS falla) */
.presence-list::-webkit-scrollbar {
	width: 4px;
}

.presence-list::-webkit-scrollbar-track {
	background: transparent;
}

.presence-list::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.15);
	border-radius: 6px;
}

/* Tarjeta de trabajador presente — dimensiones en em para escalar con --card-scale */
.worker-card {
	background: rgba(15, 23, 42, 0.6);
	border: 1px solid var(--border-color);
	border-radius: calc(12px * var(--card-scale, 1));
	padding: 0.7em 0.85em;
	display: flex;
	align-items: center;
	gap: 0.75em;
	transition: all 0.25s ease;
	animation: fadeInCard 0.35s ease forwards;
	flex: 1 1 calc(280px * var(--card-scale, 1));
	min-width: calc(220px * var(--card-scale, 1));
	max-width: 100%;
}

.worker-card:hover {
	background: var(--bg-card-hover);
	border-color: rgba(56, 189, 248, 0.4);
	transform: translateY(-2px);
}

.worker-avatar {
	width: 2.8em;
	height: 2.8em;
	border-radius: 0.7em;
	background: linear-gradient(135deg, #334155, #475569);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 800;
	font-size: 1.1em;
	color: #fff;
	flex-shrink: 0;
	border: 2px solid rgba(255, 255, 255, 0.1);
	overflow: hidden;
}

.worker-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.worker-details {
	flex: 1;
	min-width: 0;
}

.worker-name {
	font-size: 1em;
	font-weight: 700;
	color: #fff;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	margin-bottom: 0.15em;
}

.worker-sub {
	font-size: 0.8em;
	color: var(--text-muted);
	display: flex;
	align-items: center;
	gap: 0.4em;
}

.worker-time {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 4px;
	flex-shrink: 0;
}

.time-entry {
	font-size: 0.78em;
	color: var(--text-muted);
}

.time-accumulated {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 2px;
}

.badge-accum-zone {
	font-size: 0.72em;
	font-weight: 600;
	color: #38bdf8;
	background: rgba(56, 189, 248, 0.12);
	border: 1px solid rgba(56, 189, 248, 0.25);
	padding: 0.1em 0.45em;
	border-radius: 5px;
}

.badge-accum-zone strong {
	font-weight: 800;
	color: #e0f2fe;
}

.badge-accum-day {
	font-size: 0.72em;
	font-weight: 600;
	color: #a78bfa;
	background: rgba(167, 139, 250, 0.12);
	border: 1px solid rgba(167, 139, 250, 0.25);
	padding: 0.1em 0.45em;
	border-radius: 5px;
}

.badge-accum-day strong {
	font-weight: 800;
	color: #ede9fe;
}

/* Estado Vacío */
.empty-state {
	grid-column: 1 / -1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 60px 20px;
	color: var(--text-muted);
	text-align: center;
}

.empty-icon {
	font-size: 3rem;
	margin-bottom: 12px;
	opacity: 0.5;
}

.empty-text {
	font-size: 1.1rem;
	font-weight: 600;
}

/* ==========================================================================
   ANIMACIONES
   ========================================================================== */
@keyframes scanAnim {
	0% {
		top: 10%;
	}

	100% {
		top: 85%;
	}
}

@keyframes pulseDot {

	0%,
	100% {
		transform: scale(1);
		opacity: 1;
	}

	50% {
		transform: scale(1.4);
		opacity: 0.7;
	}
}

@keyframes fadeInCard {
	from {
		opacity: 0;
		transform: translateY(8px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ==========================================================================
   ADAPTACIÓN PARA PANTALLAS EN MODO HORIZONTAL (TABLETS / MÓVILES LANDSCAPE)
   ========================================================================== */
@media (max-height: 820px) and (orientation: landscape) {
	.main-container {
		padding: 10px 16px;
		gap: 14px;
		height: calc(100vh - 65px);
	}

	.scanner-panel {
		padding: 12px;
		gap: 8px;
	}

	.btn-manual-fichaje {
		padding: 8px 14px;
		font-size: 0.9rem;
	}

	.scanner-title {
		font-size: 0.95rem;
	}

	.scanner-desc {
		font-size: 0.75rem;
	}

	.camera-wrapper {
		max-width: min(220px, 36vh);
		max-height: min(220px, 36vh);
	}

	.status-badge {
		padding: 6px 12px;
		font-size: 0.82rem;
	}

	.scanner-hardware-info {
		margin-top: 2px;
		font-size: 0.72rem;
	}
}

/* ==========================================================================
   PANTALLA DE SUSPENSIÓN / AHORRO DE BATERÍA (STANDBY OLED / LCD)
   ========================================================================== */
.sleep-overlay {
	position: fixed;
	inset: 0;
	background: #000000;
	z-index: 2500;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
	cursor: pointer;
	user-select: none;
}

.sleep-overlay.active {
	opacity: 1;
	pointer-events: auto;
}

.sleep-content {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	gap: 16px;
	padding: 24px;
	opacity: 0.38;
	transition: opacity 0.3s ease;
}

.sleep-overlay.active:hover .sleep-content {
	opacity: 0.65;
}

.sleep-logo-box {
	max-height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.sleep-logo {
	max-height: 40px;
	max-width: 180px;
	object-fit: contain;
	filter: grayscale(1) brightness(0.8);
}

.sleep-clock {
	font-size: 3.8rem;
	font-weight: 800;
	color: #ffffff;
	letter-spacing: 2px;
	font-variant-numeric: tabular-nums;
	line-height: 1;
}

.sleep-zone {
	font-size: 1.15rem;
	font-weight: 600;
	color: #94a3b8;
	letter-spacing: 0.5px;
}

.sleep-prompt {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin-top: 14px;
	padding: 10px 22px;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 30px;
	color: #cbd5e1;
	font-size: 0.95rem;
	animation: pulseSleep 3s infinite ease-in-out;
}

.sleep-touch-icon {
	font-size: 1.25rem;
}

@keyframes pulseSleep {
	0%, 100% {
		opacity: 0.4;
		transform: scale(1);
	}
	50% {
		opacity: 0.85;
		transform: scale(1.03);
	}
}