:root {
	--pos-bg: #f2f2f7;
	--pos-card: #ffffff;
	--pos-text: #1c1c1e;
	--pos-muted: #8e8e93;
	--pos-primary: #007aff;
	--pos-danger: #ff3b30;
	--pos-success: #34c759;
	--pos-radius: 16px;
	--pos-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
	--pos-touch-min: 48px;
	--pos-topbar-h: 56px;
}

* {
	box-sizing: border-box;
}

html.pos-kiosk-html,
html {
	height: 100%;
	max-height: 100%;
	overflow: hidden;
}

body.pos-page {
	margin: 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	background: var(--pos-bg);
	color: var(--pos-text);
	-webkit-tap-highlight-color: transparent;
}

/* Kiosk: contenido anclado al viewport, sin scroll de pagina */
body.pos-page-home,
body.pos-pin-page,
body.pos-codigo-pos-page,
body.pos-page-sucursal {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	height: 100dvh;
	max-height: 100dvh;
	overflow: hidden;
	overscroll-behavior: none;
	padding: 0;
}

.pos-kiosk-shell {
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;
	max-height: 100%;
	min-height: 0;
	overflow: hidden;
	padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0)
		env(safe-area-inset-left, 0);
}

.pos-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	background: var(--pos-card);
	box-shadow: var(--pos-shadow);
}

.pos-header h1 {
	margin: 0;
	font-size: 1.35rem;
	font-weight: 600;
}

.pos-muted {
	color: var(--pos-muted);
	margin: 4px 0 0;
}

/* —— Cabecera kiosk: titulo centrado al viewport —— */
.pos-home-topbar {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 6px 12px;
	background: var(--pos-card);
	box-shadow: var(--pos-shadow);
	flex-shrink: 0;
	min-height: 52px;
}

.pos-brand-link,
.pos-topbar-end {
	flex: 1 1 0;
	min-width: 0;
	z-index: 2;
}

.pos-brand-link {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	text-decoration: none;
	color: var(--pos-text);
	justify-content: flex-start;
}

.pos-topbar-end {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 10px;
}

.pos-topbar-center {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: min(72vw, 560px);
	max-width: calc(100% - 24px);
	text-align: center;
	min-width: 0;
	pointer-events: none;
	z-index: 1;
}

.pos-topbar-center .pos-home-title {
	font-size: clamp(1rem, 2.2vw, 1.35rem);
}

.pos-topbar-center .pos-home-sucursal {
	padding: 0;
	margin: 2px 0 0;
	font-size: 0.8rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.pos-logo-mark {
	height: 32px;
	width: auto;
	display: block;
}

.pos-logo-text {
	font-size: 1.35rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	color: var(--pos-primary);
}

.pos-home-title {
	margin: 0;
	font-size: clamp(1.25rem, 2.5vw, 1.65rem);
	font-weight: 600;
	text-align: center;
}

.pos-home-close {
	width: var(--pos-touch-min);
	height: var(--pos-touch-min);
	min-width: var(--pos-touch-min);
	min-height: var(--pos-touch-min);
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 1.75rem;
	line-height: 1;
	text-decoration: none;
	color: var(--pos-muted);
	background: var(--pos-bg);
	transition: background 0.2s ease, color 0.2s ease;
}

.pos-topbar-btn {
	width: var(--pos-touch-min);
	height: var(--pos-touch-min);
	min-width: var(--pos-touch-min);
	min-height: var(--pos-touch-min);
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: none;
	color: var(--pos-muted);
	background: var(--pos-bg);
	transition: background 0.2s ease, color 0.2s ease;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.pos-topbar-btn:active,
.pos-home-close:active {
	background: #e5e5ea;
	color: var(--pos-text);
}

.pos-fullscreen-btn {
	color: var(--pos-text);
	background: rgba(120, 120, 128, 0.12);
	box-shadow: inset 0 0 0 1px rgba(60, 60, 67, 0.08);
}

.pos-fullscreen-btn .pos-fullscreen-icon {
	width: 22px;
	height: 22px;
	display: block;
	flex-shrink: 0;
}

.pos-fullscreen-btn .pos-fullscreen-icon[hidden] {
	display: none;
}

.pos-fullscreen-btn--active {
	color: var(--pos-primary);
	background: rgba(0, 122, 255, 0.14);
	box-shadow: inset 0 0 0 1px rgba(0, 122, 255, 0.28);
}

.pos-fullscreen-btn:active {
	background: rgba(120, 120, 128, 0.22);
}

.pos-fullscreen-btn--active:active {
	background: rgba(0, 122, 255, 0.22);
}

.pos-home-split,
.pos-fichaje-split,
.pos-codigo-pos-split {
	display: grid;
	grid-template-columns: minmax(0, 40%) minmax(0, 60%);
	gap: 8px;
	padding: 6px 8px 8px;
	flex: 1 1 0;
	min-height: 0;
	max-height: 100%;
	width: 100%;
	margin: 0;
	align-items: stretch;
	overflow: hidden;
}

.pos-right-stack {
	display: flex;
	flex-direction: column;
	min-height: 0;
	max-height: 100%;
	overflow: hidden;
	gap: 6px;
}

.pos-keyboard-pane {
	background: var(--pos-card);
	border-radius: var(--pos-radius);
	padding: 8px 10px 10px;
	box-shadow: var(--pos-shadow);
	display: flex;
	flex-direction: column;
	min-height: 0;
	overflow: hidden;
}

.pos-keyboard-hint,
label.pos-keyboard-hint {
	margin: 0 0 4px;
	font-size: clamp(0.85rem, 1.8vmin, 1rem);
	font-weight: 600;
	color: var(--pos-text);
	flex-shrink: 0;
}

.pos-filtro-display {
	flex-shrink: 0;
	min-height: 36px;
	margin-bottom: 6px;
	padding: 6px 10px;
	background: var(--pos-bg);
	border-radius: 10px;
	font-size: clamp(1rem, 2.5vmin, 1.25rem);
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--pos-primary);
	word-break: break-all;
}

input.pos-campo-teclado {
	width: 100%;
	display: block;
	border: none;
	outline: none;
	appearance: none;
	-webkit-appearance: none;
	font-family: inherit;
}

input.pos-campo-teclado:focus-visible {
	outline: 2px solid var(--pos-primary);
	outline-offset: 2px;
}

input.pos-campo-teclado[type="password"],
body.pos-pin-page .pos-pin-display.pos-filtro-display {
	text-transform: none;
	letter-spacing: 0.12em;
}

input.pos-campo-teclado::placeholder {
	color: var(--pos-muted);
	text-transform: none;
	letter-spacing: normal;
	font-weight: 400;
	opacity: 1;
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.pos-pin-form-campo {
	width: 100%;
	margin: 0;
}

.pos-filtro-display:empty::before {
	content: '—';
	color: var(--pos-muted);
	font-weight: 400;
	letter-spacing: 0;
}

.pos-teclado-grid-wrap {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	min-height: 0;
	overflow: hidden;
}

.pos-keyboard-grid {
	display: grid;
	grid-template-columns: repeat(var(--pos-keyboard-columns, 5), minmax(0, 1fr));
	gap: clamp(2px, 0.5vmin, 5px);
	flex: 1 1 0;
	min-height: 0;
	max-height: 100%;
	overflow: hidden;
	align-content: stretch;
	justify-items: center;
}

.pos-keyboard-grid-letras {
	flex: 1 1 0;
	min-height: 0;
	grid-template-rows: repeat(6, minmax(0, 1fr));
	align-content: center;
}

.pos-keyboard-grid-digitos {
	flex: 0 0 auto;
	grid-template-rows: repeat(2, minmax(0, auto));
	margin-top: clamp(4px, 0.8vmin, 8px);
	padding-top: clamp(4px, 0.8vmin, 8px);
	border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.pos-keyboard-grid-digitos-arriba {
	margin-top: 0;
	padding-top: 0;
	border-top: none;
	margin-bottom: clamp(4px, 0.8vmin, 8px);
	padding-bottom: clamp(4px, 0.8vmin, 8px);
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.pos-keyboard-grid-simbolos {
	flex: 0 0 auto;
	grid-template-rows: repeat(2, minmax(0, auto));
	margin-top: clamp(4px, 0.8vmin, 8px);
	padding-top: clamp(4px, 0.8vmin, 8px);
	border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.pos-keyboard-grid-solo-letras {
	flex: 1 1 0;
}

.pos-teclado-grid-wrap-clave .pos-keyboard-grid-letras {
	flex: 1 1 0;
	min-height: 0;
	grid-template-rows: repeat(6, minmax(0, 1fr));
}

.pos-keyboard-grid-numeros {
	grid-template-rows: repeat(2, minmax(0, 1fr));
}

.pos-key-round {
	width: min(100%, 52px);
	height: auto;
	aspect-ratio: 1;
	max-height: none;
	min-height: 0;
	min-width: 0;
	margin: 0 auto;
	justify-self: center;
	align-self: center;
	border-radius: 50%;
	padding: 0;
	font-size: clamp(0.75rem, 1.6vmin, 1rem);
	font-weight: 600;
	background: var(--pos-bg);
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
	touch-action: manipulation;
}

.pos-key-round:active {
	transform: scale(0.96);
	background: #e5e5ea;
}

.pos-keyboard-actions {
	display: flex;
	flex-wrap: nowrap;
	gap: clamp(4px, 1vmin, 8px);
	margin-top: 6px;
	padding-top: 4px;
	flex-shrink: 0;
	justify-content: stretch;
}

.pos-key-action {
	height: clamp(36px, 7vh, 44px);
	min-height: 0;
	max-height: 44px;
	flex: 1 1 0;
	min-width: 0;
	border-radius: 10px;
	font-size: clamp(0.8rem, 1.6vmin, 0.95rem);
	font-weight: 600;
	background: var(--pos-bg);
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
	border: none;
	color: var(--pos-text);
	touch-action: manipulation;
}

.pos-key-wide-action {
	flex: 1.4 1 0;
}

.pos-key-action-ok,
.pos-key-action.pos-key-primary {
	background: var(--pos-primary);
	color: #fff;
}

/* Ultimos fichajes: franja fija arriba a la derecha */
.pos-recientes-pane {
	flex: 0 0 auto;
	max-height: 32%;
	min-height: 0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--pos-card);
	border-radius: var(--pos-radius);
	box-shadow: var(--pos-shadow);
	padding: 6px 8px;
}

.pos-recientes-scroll {
	flex: 1 1 auto;
	min-height: 0;
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
}

.pos-empleado-list-recientes {
	flex-direction: row;
	flex-wrap: nowrap;
	gap: 8px;
	padding-bottom: 4px;
}

.pos-empleado-list-recientes li {
	flex: 0 0 auto;
	width: min(240px, 42vw);
}

.pos-empleado-card-compact {
	min-height: 44px;
	padding: 8px 10px;
}

.pos-empleado-card-compact .pos-avatar {
	width: 36px;
	height: 36px;
	min-width: 36px;
	min-height: 36px;
	font-size: 0.85rem;
}

.pos-empleado-card-compact .pos-empleado-nombre {
	font-size: 0.9rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Lista principal: panel aparte, scroll solo aqui */
.pos-empleados-pane {
	flex: 1 1 0;
	min-height: 0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--pos-card);
	border-radius: var(--pos-radius);
	box-shadow: var(--pos-shadow);
	padding: 6px 8px;
}

.pos-empleados-scroll {
	flex: 1 1 0;
	min-height: 0;
	overflow-x: hidden;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.pos-list-heading {
	margin: 0 0 4px;
	padding-right: 4px;
	font-size: 0.72rem;
	font-weight: 600;
	color: var(--pos-muted);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	flex-shrink: 0;
}

.pos-empleado-chevron {
	flex-shrink: 0;
	font-size: 1.5rem;
	line-height: 1;
	color: #c7c7cc;
	font-weight: 300;
	margin-left: 4px;
}

/* PIN: mismo reparto horizontal que home */
.pos-pin-split {
	grid-template-columns: minmax(0, 36%) minmax(0, 64%);
}

.pos-pin-panel {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: var(--pos-card);
	border-radius: var(--pos-radius);
	box-shadow: var(--pos-shadow);
	padding: 12px;
	min-height: 0;
	overflow: hidden;
}

.pos-pin-form {
	width: 100%;
	max-width: 360px;
}

.pos-pin-display {
	text-align: center;
	font-size: clamp(1.75rem, 5vmin, 2.75rem);
	letter-spacing: 0.35em;
	min-height: var(--pos-touch-min);
	margin: 8px 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.pos-pin-panel .pos-alert {
	width: 100%;
	margin-bottom: 8px;
	padding: 8px 12px;
	font-size: 0.9rem;
}

.pos-panel {
	background: var(--pos-card);
	border-radius: var(--pos-radius);
	padding: 16px;
	box-shadow: var(--pos-shadow);
}

.pos-panel h2 {
	margin: 0 0 12px;
	font-size: 1.1rem;
}

.pos-empleado-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
	max-height: none;
	overflow: visible;
}

.pos-empleado-card {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	background: var(--pos-bg);
	border-radius: 12px;
	text-decoration: none;
	color: inherit;
	min-height: var(--pos-touch-min);
	touch-action: manipulation;
}

.pos-avatar {
	width: 40px;
	height: 40px;
	min-width: 40px;
	min-height: 40px;
	border-radius: 50%;
	background: #d1d1d6;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 600;
	flex-shrink: 0;
}

.pos-empleado-info {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.pos-empleado-nombre {
	flex: 1;
	font-size: 1.05rem;
}

.pos-empleado-hora {
	font-size: 0.9rem;
	color: var(--pos-muted);
	font-weight: 500;
}

.pos-badge {
	font-size: 0.75rem;
	font-weight: 700;
	padding: 4px 8px;
	border-radius: 8px;
}

.pos-badge-in {
	background: rgba(52, 199, 89, 0.15);
	color: var(--pos-success);
}

.pos-badge-out {
	background: rgba(142, 142, 147, 0.15);
	color: var(--pos-muted);
}

.pos-input,
.pos-input-search {
	width: 100%;
	font-size: 1.1rem;
	padding: 14px 16px;
	border: 1px solid #d1d1d6;
	border-radius: 12px;
	margin-bottom: 12px;
}

.pos-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 0 20px;
	border-radius: 12px;
	border: none;
	font-size: 1rem;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
}

.pos-btn-primary {
	background: var(--pos-primary);
	color: #fff;
}

.pos-btn-ghost {
	background: transparent;
	color: var(--pos-primary);
}

.pos-btn-xl {
	width: 100%;
	min-height: 64px;
	font-size: 1.2rem;
	margin: 16px;
	width: calc(100% - 32px);
}

.pos-login-card {
	max-width: 420px;
	margin: 10vh auto;
	padding: 32px 24px;
	background: var(--pos-card);
	border-radius: var(--pos-radius);
	box-shadow: var(--pos-shadow);
}

.pos-brand {
	text-align: center;
	margin: 0 0 8px;
}

.pos-login-brand {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	margin-bottom: 20px;
}

.pos-login-brand img {
	height: 56px;
	width: auto;
}

.pos-login-brand .pos-logo-text {
	font-size: 1.5rem;
}

.pos-form {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.pos-label {
	font-weight: 600;
}

.pos-alert {
	padding: 12px 16px;
	border-radius: 12px;
	margin-bottom: 12px;
}

.pos-alert-error {
	background: rgba(255, 59, 48, 0.12);
	color: var(--pos-danger);
}

.pos-alert-ok {
	background: rgba(52, 199, 89, 0.12);
	color: var(--pos-success);
}

.pos-sucursal-list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.pos-sucursales-scroll {
	flex: 1 1 0;
	min-height: 0;
	overflow-x: hidden;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
}

.pos-sucursal-option {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px;
	background: var(--pos-bg);
	border-radius: 12px;
	margin-bottom: 8px;
	font-size: 1.1rem;
	min-height: 56px;
}

.pos-teclado-container:not(.pos-teclado-grid-wrap) {
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.pos-keyboard-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 8px;
	justify-content: center;
}

.pos-pin-topbar .pos-home-title {
	max-width: 100%;
}

.pos-input-search[readonly] {
	caret-color: transparent;
}

.pos-key {
	min-height: 52px;
	min-width: 48px;
	flex: 1 1 48px;
	max-width: 76px;
	font-size: 1.15rem;
	font-weight: 600;
	border: none;
	border-radius: 12px;
	background: var(--pos-card);
	box-shadow: var(--pos-shadow);
	touch-action: manipulation;
	color: var(--pos-text);
}

.pos-key-wide {
	flex: 2 1 120px;
	max-width: none;
	font-size: 1rem;
	font-weight: 500;
}

.pos-key-primary {
	background: var(--pos-primary);
	color: #fff;
	flex: 1 1 72px;
	max-width: 96px;
}

.pos-key-muted {
	font-size: 0.95rem;
	font-weight: 600;
	max-width: 64px;
}

.pos-fichaje-lineas {
	list-style: none;
	padding: 0;
	margin: 0;
}

.pos-fichaje-lineas li {
	display: flex;
	justify-content: space-between;
	padding: 12px 0;
	border-bottom: 1px solid #e5e5ea;
	font-size: 1.05rem;
}

.pos-fichaje-acceso {
	text-transform: capitalize;
	font-weight: 600;
}

.pos-fichar-actions {
	position: sticky;
	bottom: 0;
	background: var(--pos-bg);
	padding-bottom: 16px;
}
