:root {
	--fm-bg: #1a1a1a;
	--fm-sidebar: #161616;
	--fm-main: #1f1f1f;
	--fm-card: #232323;
	--fm-border: #3a3a3a;
	--fm-text: #ececec;
	--fm-muted: #9a9a9a;
	--fm-gold: #c9a96e;
	--fm-gold-dark: #b8944f;
	--fm-solape: #e05252;   /* error: turnos solapados (fijo, no configurable) */
}

* { box-sizing: border-box; }

/* ---------- App a pantalla completa: quita los bordes blancos laterales y el chrome del tema ---------- */
body.fichaje-page { background: var(--fm-bg) !important; margin: 0 !important; padding: 0 !important; }
body.fichaje-page #page,
body.fichaje-page .ast-container,
body.fichaje-page #primary,
body.fichaje-page .ast-row,
body.fichaje-page main#main,
body.fichaje-page article,
body.fichaje-page .entry-content,
body.fichaje-page .ast-article-single {
	max-width: 100% !important;
	width: 100% !important;
	padding: 0 !important;
	margin: 0 !important;
}
body.fichaje-page header,
body.fichaje-page .site-header,
body.fichaje-page .ast-header,
body.fichaje-page .ast-below-header,
body.fichaje-page footer,
body.fichaje-page .site-footer,
body.fichaje-page .ast-footer { display: none !important; }

.fichaje-app {
	display: flex;
	min-height: 100vh;
	background: var(--fm-bg);
	color: var(--fm-text);
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---------- Sidebar ---------- */
.fichaje-sidebar {
	width: 240px;
	background: var(--fm-sidebar);
	border-right: 1px solid var(--fm-border);
	display: flex;
	flex-direction: column;
	flex-shrink: 0;
}
.fichaje-brand {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 18px 16px;
	border-bottom: 1px solid var(--fm-border);
}
.fichaje-brand img { width: 36px; height: 36px; object-fit: contain; }
.fichaje-brand span { color: var(--fm-gold); font-weight: 700; letter-spacing: 1px; font-size: 14px; }
.fichaje-user {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 14px 16px;
	color: var(--fm-muted);
	font-size: 13px;
	border-bottom: 1px solid var(--fm-border);
}
.fichaje-nav { padding: 10px 0; flex: 1; }
.fichaje-navitem {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 18px;
	color: var(--fm-text);
	text-decoration: none;
	font-size: 14px;
	border-left: 3px solid transparent;
}
.fichaje-navitem:hover { background: rgba(255,255,255,0.04); color: var(--fm-gold); }
.fichaje-navitem.active { background: rgba(201,169,110,0.12); border-left-color: var(--fm-gold); color: var(--fm-gold); }
.fichaje-navitem .ico { width: 22px; text-align: center; }
.fichaje-navitem.logout { margin-top: auto; color: var(--fm-muted); border-top: 1px solid var(--fm-border); }

/* ---------- Main ---------- */
.fichaje-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.fichaje-topbar {
	padding: 10px 24px;
	border-bottom: 1px solid var(--fm-border);
	background: var(--fm-main);
}
.fichaje-header-img { height: 34px; object-fit: contain; }
.fichaje-content { padding: 28px 32px; overflow-y: auto; flex: 1; }

.fichaje-content h2 { color: var(--fm-gold); margin: 0 0 18px; font-size: 22px; font-weight: 600; }
.fichaje-content h3 { color: var(--fm-text); margin: 24px 0 12px; font-size: 16px; font-weight: 600; }

/* ---------- Forms ---------- */
.fp-required { color: #d63638; font-weight: 700; }
.fichaje-content label,
.fichaje-filter-form label,
.fichaje-date-form label {
	display: block;
	font-size: 13px;
	color: var(--fm-muted);
	margin-bottom: 12px;
}
.fichaje-content input[type=text],
.fichaje-content input[type=email],
.fichaje-content input[type=password],
.fichaje-content input[type=date],
.fichaje-content input[type=file],
.fichaje-content select,
.fichaje-content textarea,
.fichaje-filter-form input,
.fichaje-filter-form select {
	width: 100%;
	background: var(--fm-card);
	border: 1px solid var(--fm-border);
	color: var(--fm-text);
	padding: 10px 12px;
	border-radius: 6px;
	font-size: 14px;
	margin-top: 4px;
	font-family: inherit;
}
.fichaje-content textarea { min-height: 70px; resize: vertical; }
.fichaje-content input:focus,
.fichaje-content select:focus,
.fichaje-content textarea:focus { outline: none; border-color: var(--fm-gold); }

/* ---------- Buttons ---------- */
.fichaje-btn {
	background: var(--fm-gold);
	color: #1a1a1a;
	border: none;
	padding: 11px 22px;
	border-radius: 6px;
	font-weight: 600;
	font-size: 14px;
	cursor: pointer;
}
.fichaje-btn:hover { background: var(--fm-gold-dark); }
.fichaje-btn.small { padding: 7px 14px; font-size: 13px; }
.fichaje-btn:disabled { opacity: 0.45; cursor: not-allowed; }
/* STEP M3: enlaces-boton deshabilitados (el PDF no existe para un mes futuro). */
.fichaje-btn.disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.fichaje-btn.entrada { background: #5b8c5a; color: #fff; }
.fichaje-btn.salida { background: #a85a5a; color: #fff; }
.fichaje-punch-btns { display: flex; gap: 14px; margin: 16px 0; }

/* ---------- Tables ---------- */
/* overflow:hidden recorta las esquinas redondeadas de las tablas normales, pero
   ROMPE position:sticky en los hijos (el cuadrante necesita la columna Dia fija).
   Se excluye el cuadrante: mantiene su propia estructura sin esquinas redondeadas. */
.fichaje-table:not(.fichaje-cq) {
	width: 100%;
	border-collapse: collapse;
	margin-top: 8px;
	background: var(--fm-card);
	border-radius: 8px;
	overflow: hidden;
}
/* El cuadrante conserva el resto de propiedades, sin overflow. */
.fichaje-table.fichaje-cq {
	width: auto;
	border-collapse: collapse;
	margin-top: 8px;
	background: var(--fm-card);
}
.fichaje-table th, .fichaje-table td {
	padding: 11px 14px;
	text-align: left;
	font-size: 13px;
	border-bottom: 1px solid var(--fm-border);
}
.fichaje-table th { background: #2b2b2b; color: var(--fm-gold); font-weight: 600; }
.fichaje-table th.sortable { cursor: pointer; user-select: none; }
.fichaje-table th.sortable:hover { color: #fff; }
.fichaje-table th .arrow { font-size: 10px; opacity: 0.7; }
/* El cuadrante se excluye: en el, el hover resalta SOLO la celda bajo el cursor
   (.fichaje-cq .cq-cell:hover). En el cuadrante una fila = un turno de TODOS los
   empleados, asi que resaltar la fila entera no aporta nada. */
.fichaje-table:not(.fichaje-cq) tr:hover td { background: rgba(255,255,255,0.03); }
.fichaje-table tr.fichaje-row-in td { background: rgba(91,140,90,0.35) !important; }
.fichaje-table tr.fichaje-row-out td { background: rgba(168,90,90,0.35) !important; }
.fichaje-table tr.fichaje-row-in td:first-child { border-left: 4px solid #5b8c5a !important; }
.fichaje-table tr.fichaje-row-out td:first-child { border-left: 4px solid #a85a5a !important; }
.fichaje-table tr.fichaje-row-in:hover td { background: rgba(91,140,90,0.45) !important; }
.fichaje-table tr.fichaje-row-out:hover td { background: rgba(168,90,90,0.45) !important; }

/* ---------- Badges ---------- */
.badge {
	display: inline-block;
	padding: 2px 9px;
	border-radius: 12px;
	font-size: 11px;
	font-weight: 600;
	text-transform: capitalize;
}
.badge.pending { background: #4a3f1f; color: #e3c87a; }
.badge.approved { background: #1f3a1f; color: #9fe39f; }
.badge.denied { background: #3a1f1f; color: #e39f9f; }
.badge.edited { background: #2a2a4a; color: #a9a9e3; margin-left: 4px; }
.badge.signed { background: #1f3a1f; color: #9fe39f; }

/* ---------- Mensajes ---------- */
.fichaje-msg { padding: 10px 14px; border-radius: 6px; margin: 12px 0; font-size: 13px; }
/* Aviso de solape de turnos (cuadrante del empleado). */
/* Solape: el aviso debe ganar a .fichaje-cq .cq-from/.cq-to y a
   .fichaje-cq.cq-readonly .cq-cell, que tienen la MISMA especificidad (0,3,0)
   y se emiten despues. Se sube la especificidad y se usa !important en el color. */
.fichaje-cq .cq-cell.cq-solape,
.fichaje-cq .cq-cell.cq-solape.cq-from,
.fichaje-cq .cq-cell.cq-solape.cq-to {
	color: var(--fm-solape, #e05252) !important;
	font-weight: 600;
	background: rgba(224,82,82,0.12);
}
.fichaje-cq .cq-cell.cq-solape .cq-in { color: var(--fm-solape, #e05252) !important; font-weight: 600; }

/* Hora de inicio == hora de fin: mismo rojo de error, subrayado para distinguirlo del solape. */
.fichaje-cq .cq-cell.cq-hora-igual,
.fichaje-cq .cq-cell.cq-hora-igual.cq-from,
.fichaje-cq .cq-cell.cq-hora-igual.cq-to {
	color: var(--fm-solape, #e05252) !important;
	font-weight: 600;
	background: rgba(224,82,82,0.12);
	text-decoration: underline wavy;
	text-underline-offset: 3px;
}
/* El texto vive DENTRO del <input>: text-decoration en el <td> no lo alcanza,
   hay que aplicarlo al propio input. */
.fichaje-cq .cq-cell.cq-hora-igual .cq-in {
	color: var(--fm-solape, #e05252) !important;
	font-weight: 600;
	/* Propiedades LONGHAND: el shorthand con var() no se resuelve de forma
	   fiable. Asi funciona en todos los navegadores. */
	text-decoration-line: underline;
	text-decoration-style: wavy;
	text-decoration-color: var(--fm-solape, #e05252);
	text-underline-offset: 3px;
}
.fichaje-hora-igual-aviso {
	padding: 10px 14px; border-radius: 6px; margin: 12px 0 0; font-size: 13px;
	color: var(--fm-solape, #e05252);
	border: 1px dashed var(--fm-solape, #e05252);
	background: rgba(224,82,82,0.10);
}
.fichaje-solape-aviso {
	padding: 10px 14px; border-radius: 6px; margin: 12px 0 0; font-size: 13px;
	color: var(--fm-solape, #d98c3f);
	border: 1px solid var(--fm-solape, #e05252);
	background: rgba(224,82,82,0.10);
}
.fichaje-msg.ok { background: #1f3a1f; color: #9fe39f; }
.fichaje-msg.err { background: #3a1f1f; color: #e39f9f; }

.fichaje-note { color: var(--fm-muted); font-size: 13px; }
.fichaje-force {
	background: #4a3f1f;
	color: #e3c87a;
	padding: 12px 16px;
	border-radius: 6px;
	margin-bottom: 16px;
	font-size: 14px;
}

/* ---------- Filtros y export ---------- */
.fichaje-filter-form {
	display: flex;
	gap: 14px;
	align-items: flex-end;
	flex-wrap: wrap;
	background: var(--fm-card);
	padding: 16px;
	border-radius: 8px;
	margin-bottom: 18px;
}
.fichaje-filter-form label { margin-bottom: 0; min-width: 160px; }
.fichaje-export-btns { margin-bottom: 18px; display: flex; gap: 10px; }

/* ---------- Permisos: campos dinámicos ---------- */
.perm-field { display: block; }

/* ---------- Cuadrantes ---------- */
#fichaje-sched-grid { display: flex; flex-wrap: wrap; margin-top: 16px; }
.sched-day {
	width: 130px;
	background: var(--fm-card);
	border: 1px solid var(--fm-border);
	border-radius: 8px;
	padding: 12px;
	margin: 0 10px 10px 0;
}
.sched-day b { color: var(--fm-gold); display: block; margin-bottom: 8px; }
.sched-day input { width: 100%; margin-bottom: 6px; }

/* ---------- Documentos ---------- */
#fichaje-doc-emps { display: flex; flex-wrap: wrap; gap: 8px 18px; }
#fichaje-doc-emps .chk { display: flex; align-items: center; gap: 6px; width: auto; color: var(--fm-text); }
#fichaje-doc-emps .chk input { width: auto; margin: 0; }
.sign-canvas { border: 1px solid var(--fm-gold); background: #fff; border-radius: 4px; touch-action: none; }

/* ---------- Foto de perfil ---------- */
.fichaje-photo { width: 64px; height: 64px; object-fit: cover; border-radius: 50%; display: block; margin-bottom: 8px; }

/* ---------- Empleados: alta ---------- */
#fichaje-add-emp-form {
	display: flex;
	gap: 14px;
	align-items: flex-end;
	flex-wrap: wrap;
	background: var(--fm-card);
	padding: 16px;
	border-radius: 8px;
	margin-bottom: 18px;
}
#fichaje-add-emp-form label { margin-bottom: 0; min-width: 170px; }

/* ---------- Modal de edición de fichaje ---------- */
.fichaje-modal {
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,0.6);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 9999;
}
.fichaje-modal-box {
	background: var(--fm-card);
	border: 1px solid var(--fm-border);
	border-radius: 10px;
	padding: 24px;
	width: 380px;
	max-width: 94vw;
	max-height: 90vh;
	overflow-y: auto;
}
.fichaje-modal-box h3 { margin: 0 0 16px; color: var(--fm-gold); }
.fichaje-modal-box label { display: block; font-size: 13px; color: var(--fm-muted); margin-bottom: 12px; }
.fichaje-modal-box input, .fichaje-modal-box textarea {
	width: 100%;
	background: var(--fm-main);
	border: 1px solid var(--fm-border);
	color: var(--fm-text);
	padding: 9px 11px;
	border-radius: 6px;
	margin-top: 4px;
	font-family: inherit;
}
.fichaje-modal-box textarea { min-height: 60px; }
.fichaje-modal-box .modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
.fichaje-error { color: var(--fm-error, #d33); font-size: 13px; font-weight: 600; min-height: 1em; margin: 4px 0 2px; }
.fichaje-modal-box.sign-box { width: 560px; }
.fichaje-modal-box.pos-modal-box { width: 900px; max-width: 96vw; }
.fichaje-modal-box.pos-modal-box .pos-wrap { max-height: 60vh; overflow-y: auto; }
.fichaje-modal-box.pos-modal-box .pos-toolbar { margin: 12px 0; }
.pos-instructions { color: var(--fm-table-text); font-size: 13px; margin: 0 0 12px; }
.fichaje-table { width: 100%; }
.sign-preview { position: relative; max-height: 50vh; overflow: auto; border: 1px solid var(--fm-border); border-radius: 6px; background: #fff; margin-bottom: 12px; text-align: center; }
.sign-pdf-canvas { width: 100%; height: auto; display: block; }
.sign-pdf-wrap { position: relative; max-width: 100%; line-height: 0; }
.sign-note { color: var(--fm-muted); font-size: 12px; padding: 10px; margin: 0; }
.sign-pad-label { font-size: 13px; color: var(--fm-muted); margin: 6px 0; }
.sign-canvas { width: 100%; max-width: 400px; height: auto; border: 1px solid var(--fm-border); border-radius: 6px; background: #fff; cursor: crosshair; touch-action: none; display: block; margin: 0 auto; }
.pos-toolbar { display: flex; gap: 8px; margin: 8px 0; }
.pos-wrap { position: relative; display: block; max-width: 100%; overflow: auto; border: 1px solid var(--fm-border); background: #fff; padding: 8px; }
.pos-page { margin-bottom: 14px; }
.pos-page-label { font-size: 12px; color: var(--fm-muted); margin: 4px 0; }
.pos-canvas-wrap { position: relative; display: inline-block; max-width: 100%; line-height: 0; }
.sign-page-label { font-size: 12px; color: var(--fm-muted); margin: 4px 0; text-align: left; }
.pos-canvas { display: block; max-width: 100%; position: relative; z-index: 0; }
.pos-wrap.add-mode { cursor: crosshair; }
#posModal .pos-dot { position: absolute; border: 2px solid #c9a96e; border-radius: 3px; transform: translate(-50%, -50%); background: rgba(201,169,110,.18); color: #5a4a1a; font-size: 10px; line-height: 1; display: flex; align-items: center; justify-content: center; cursor: grab; touch-action: none; box-sizing: border-box; z-index: 50; pointer-events: auto; }
.locked { color: var(--fm-muted); font-size: 12px; }
.pos-dot.static { cursor: default; background: rgba(201,169,110,.45); }
.pos-x { position: absolute; top: -10px; right: -10px; width: 20px; height: 20px; border-radius: 50%; background: #8e3636; color: #fff; font-size: 14px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; line-height: 1; }
.pos-dot .pos-x:hover { background: #a33; }
.fichaje-btn.active { background: var(--fm-gold); color:#111; box-shadow: inset 0 0 0 2px #6b561c; filter: brightness(1.06); }
.pos-dot { touch-action: none; user-select: none; }

.fichaje-audit-list { margin-top: 14px; font-size: 12px; color: var(--fm-muted); border-top: 1px solid var(--fm-border); padding-top: 10px; }
.fichaje-audit-list div { margin-bottom: 6px; }

/* ---------- Página de login ---------- */
.fichaje-login-page .site-header,
.fichaje-login-page .site-footer,
.fichaje-login-page #masthead,
.fichaje-login-page footer { display: none !important; }
.fichaje-login-page .entry-header { display: none !important; }
.fichaje-login-page { background: var(--fm-bg); }
.fichaje-login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.fichaje-login-card {
	background: var(--fm-card);
	border: 1px solid var(--fm-border);
	border-radius: 12px;
	padding: 36px 40px;
	max-width: 380px;
	width: 100%;
	text-align: center;
	box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}
.fichaje-login-logo { width: 64px; height: 64px; object-fit: contain; margin-bottom: 8px; }
.fichaje-login-brand { color: var(--fm-gold); font-family: 'Playfair Display', serif; letter-spacing: 1px; font-size: 20px; margin: 0 0 6px; }
.fichaje-login-header { height: 40px; object-fit: contain; margin-bottom: 22px; }
#fichaje-login-form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
#fichaje-login-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--fm-muted); }
#fichaje-login-form input { background: var(--fm-main); border: 1px solid var(--fm-border); color: var(--fm-text); padding: 10px; border-radius: 6px; font-size: 14px; font-family: inherit; }
#fichaje-login-form input:focus { outline: none; border-color: var(--fm-gold); }
#fichaje-login-error { color: #e39f9f; font-size: 13px; min-height: 18px; }
.fichaje-login-lost { display: inline-block; margin-top: 16px; color: var(--fm-gold); font-size: 13px; text-decoration: none; }
.fichaje-login-lost:hover { text-decoration: underline; }

/* ---------- Responsive: menú hamburguesa en tablet y móvil ---------- */
.fichaje-burger { display: none; }
.fichaje-nav-backdrop { display: none; }

@media (max-width: 1024px) {
	.fichaje-burger {
		display: inline-flex; align-items: center; justify-content: center;
		position: fixed; top: 12px; left: 12px; z-index: 1200;
		width: 44px; height: 44px; border: none; border-radius: 10px; cursor: pointer;
		background: var(--fm-gold); color: #1a1a1a; font-size: 22px; line-height: 1;
		box-shadow: 0 4px 14px rgba(0,0,0,0.45);
	}
	.fichaje-sidebar {
		position: fixed;
		top: 0;
		bottom: 0;
		left: 0;
		width: 240px;
		overflow-y: auto;
		transform: translateX(-100%);
		transition: transform 0.25s ease;
		z-index: 1100;
		box-shadow: 4px 0 20px rgba(0,0,0,0.5);
	}
	.fichaje-sidebar.open { transform: translateX(0); }
	.fichaje-nav-backdrop {
		display: none; position: fixed; inset: 0; z-index: 1050;
		background: rgba(0,0,0,0.55);
	}
	.fichaje-nav-backdrop.open { display: block; }
	.fichaje-main { margin-left: 0; }
	.fichaje-topbar { padding-left: 64px; }
	.fichaje-content { padding: 22px 16px; }
}

@media (max-width: 720px) {
	.fichaje-content { padding: 16px 12px; }
	.fichaje-cal-nav .fichaje-btn { width: 100%; text-align: center; }
	.fichaje-filter-form, #fichaje-add-emp-form { flex-direction: column; align-items: stretch; }
	.fichaje-filter-form label, #fichaje-add-emp-form label { min-width: 0; }
}
.fichaje-username { color: var(--fm-muted); font-size: 14px; margin: 0 0 18px; }
.fichaje-readonly { color: var(--fm-muted); font-size: 14px; margin: 0 0 14px; }
.fichaje-cal-nav { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.fichaje-cal-title { font-weight: 600; min-width: 170px; text-align: center; }
.fichaje-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; max-width: 540px; }
.fichaje-cal-h { text-align: center; font-size: 12px; color: var(--fm-muted); padding: 6px 0; }
.fichaje-cal-cell { min-height: 64px; border: 1px solid var(--fm-border); border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 14px; cursor: pointer; background: var(--fm-card); }
.fichaje-cal-cell.empty { border: none; background: transparent; cursor: default; }
.fichaje-cal-cell.has-punches { background: #7a2e2e; color: #fff; border-color: #a33; font-weight: 600; }
.fichaje-cal-cell.has-punches:hover { background: #8e3636; }
/* Dia con fichajes editados: marca dorada discreta, no compite con has-punches. */
.fichaje-cal-cell.has-edits { box-shadow: inset 0 0 0 2px var(--fm-gold, #c9a96e); }
.fichaje-cal-cell.has-edits::after { content: "\270E"; margin-left: 3px; font-size: 11px; color: var(--fm-gold, #c9a96e); vertical-align: super; }
#fichaje-cal-entries { margin-top: 20px; }
.pos-wrap { position: relative; display: inline-block; max-width: 100%; overflow: auto; }
.pos-canvas { border: 1px solid var(--fm-border); background: #fff; max-width: 100%; }
#sign-pdf-preview .pos-dot { position: absolute; border: 2px solid var(--fm-gold); border-radius: 2px; background: rgba(201,169,110,.25); transform: translate(-50%, -50%); pointer-events: none; }
.sign-canvas { border: 1px solid var(--fm-border); border-radius: 6px; background: #fff; cursor: crosshair; touch-action: none; }
#sign-pdf-preview { position: relative; max-width: 100%; overflow: auto; }
#sign-pdf-preview .pos-dot { position: absolute; border: 2px solid var(--fm-gold); border-radius: 2px; background: rgba(201,169,110,.25); transform: translate(-50%, -50%); pointer-events: none; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 12px; text-transform: capitalize; }
.badge.pending { background: #5a4a1a; color: #f0d9a0; }
.badge.signed { background: #2e5a2e; color: #cfeccf; }
label.chk { display: flex; gap: 8px; align-items: center; font-size: 13px; margin: 8px 0; }

.perm-note { color: #e39f9f; font-size: 12px; margin-top: 4px; max-width: 220px; }
.fichaje-avatar { font-size: 60px; line-height: 1; }
.fichaje-avatar img { width: 78px; height: 78px; border-radius: 50%; object-fit: cover; display: block; }

/* ---------- Notification badges (sidebar icons) ---------- */
.fichaje-navitem .ico-wrap { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 22px; }
.fichaje-navitem .fichaje-badge {
	position: absolute; top: -7px; right: -9px;
	min-width: 15px; height: 15px; padding: 0 4px;
	border-radius: 8px; background: #d64545; color: #fff;
	font-size: 10px; line-height: 15px; text-align: center; font-weight: 700;
}

/* The Astra theme underlines content links (`.ast-single-post .entry-content a`),
   which would also hit the app's own links. Keep the app chrome clean. */
.fichaje-app .fichaje-navitem,
.fichaje-app .fichaje-navitem:hover,
.fichaje-app .fichaje-navitem:focus,
.fichaje-app .fichaje-navitem:visited,
.fichaje-app .fichaje-btn,
.fichaje-app .fichaje-btn:hover,
.fichaje-app .fichaje-btn:focus { text-decoration: none !important; }

/* ---------- Bajas y altas (v2.1.0) ---------- */
.fichaje-app .badge.baja { background: #4a3a1f; color: #e3c87a; }
.fichaje-app .badge.contrato { background: #3a1f1f; color: #e39f9f; }
.fichaje-app .badge.alta { background: #1f3a1f; color: #9fe39f; }
.fichaje-app .badge.cancelled { background: #2f2f2f; color: #b9b9b9; }
.fichaje-app .baja-tag { color: #b9b9b9; font-size: 12px; }
.fichaje-app .baja-cerrada { color: #b9b9b9; font-size: 12px; }
.fichaje-app label.fichaje-check {
	display: inline-flex; align-items: center; gap: 8px;
	font-size: 13px; font-weight: 400; margin: 8px 16px 8px 0;
}
.fichaje-app .fichaje-notice { padding: 12px 16px; border-radius: 6px; margin: 0 0 16px; font-size: 14px; }
.fichaje-app .fichaje-notice.baja { background: #3a2f1a; border-left: 4px solid #c9a96e; color: #f0d9a0; }

/* ---------- Avisos: variantes sobre el tema oscuro (sin colores en linea) ---------- */
.fichaje-app .fichaje-notice.ok {
	background: rgba(91,140,90,0.16); border-left: 4px solid #5b8c5a; color: #d6e8d4;
}
.fichaje-app .fichaje-notice.error {
	background: rgba(224,82,82,0.16); border-left: 4px solid var(--fm-solape); color: #f5cfcf;
}
.fichaje-app .fichaje-notice.warn {
	background: rgba(201,169,110,0.16); border-left: 4px solid var(--fm-gold); color: #f0d9a0;
}
.fichaje-app .fichaje-notice.info {
	background: rgba(255,255,255,0.05); border-left: 4px solid #787c82; color: #cfcfcf;
}

/* ---------- Gestion de inspectores: formularios y acciones ---------- */
.fichaje-inspector-form {
	display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px;
	padding: 16px; margin: 0 0 24px;
	background: var(--fm-card); border: 1px solid var(--fm-border); border-radius: 8px;
}
.fichaje-inspector-form label { display: block; font-size: 13px; color: var(--fm-muted); }
.fichaje-inspector-form input[type="text"] {
	margin-top: 4px; padding: 8px 10px; min-width: 160px;
	background: var(--fm-bg); color: var(--fm-text);
	border: 1px solid var(--fm-border); border-radius: 5px;
}
.fichaje-inspector-form .fichaje-btn { margin-left: auto; }

.fichaje-actions {
	white-space: nowrap;
	display: flex; flex-wrap: nowrap; align-items: center; gap: 8px;
}
.fichaje-actions .fichaje-row-form {
	display: flex; align-items: center; gap: 6px; margin: 0;
}
.fichaje-actions .fichaje-row-form input[type="text"] {
	width: 110px; padding: 6px 8px;
	background: var(--fm-bg); color: var(--fm-text);
	border: 1px solid var(--fm-border); border-radius: 5px;
}
.fichaje-actions label.fichaje-inline-label {
	display: inline-flex; align-items: center; gap: 4px;
	font-size: 12px; color: var(--fm-muted);
}

/* Tabla de inspectores: las columnas de datos se ajustan a su contenido para
   dejar el ancho sobrante a Acciones, que mantiene todos los botones en una
   sola línea (filas más bajas). */
.fichaje-table.fichaje-inspectors { table-layout: auto; }
.fichaje-table.fichaje-inspectors th:nth-child(1),
.fichaje-table.fichaje-inspectors td:nth-child(1),
.fichaje-table.fichaje-inspectors th:nth-child(2),
.fichaje-table.fichaje-inspectors td:nth-child(2),
.fichaje-table.fichaje-inspectors th:nth-child(3),
.fichaje-table.fichaje-inspectors td:nth-child(3),
.fichaje-table.fichaje-inspectors th:nth-child(4),
.fichaje-table.fichaje-inspectors td:nth-child(4),
.fichaje-table.fichaje-inspectors th:nth-child(5),
.fichaje-table.fichaje-inspectors td:nth-child(5) {
	width: 1%; white-space: nowrap;
}
.fichaje-table.fichaje-inspectors td.fichaje-actions { width: auto; }

.fichaje-btn.fichaje-btn-danger {
	background: var(--fm-solape); color: #fff; border: 1px solid var(--fm-solape);
}
.fichaje-btn.fichaje-btn-danger:hover { background: #c23f3f; }

.fichaje-state-ok, .fichaje-state-none { color: #8fbf8d; }
.fichaje-state-expired { color: #f08b8b; }

/* ---------- Tarjeta de datos de acceso de un solo uso ---------- */
.fichaje-reveal {
	padding: 16px 20px; margin: 0 0 24px;
	background: var(--fm-card);
	border: 1px solid var(--fm-gold-dark);
	border-left: 4px solid var(--fm-gold);
	border-radius: 8px;
}
.fichaje-reveal h3 { margin: 0 0 6px; }
.fichaje-reveal-warn { margin: 0 0 12px; color: var(--fm-gold); font-size: 13px; }
.fichaje-reveal-list {
	display: grid; grid-template-columns: max-content 1fr;
	gap: 6px 16px; margin: 0;
}
.fichaje-reveal-list dt { color: var(--fm-muted); font-size: 13px; }
.fichaje-reveal-list dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.fichaje-reveal-list dd code {
	display: inline-block; padding: 4px 8px; font-size: 14px;
	background: var(--fm-bg); color: var(--fm-text);
	border: 1px solid var(--fm-border); border-radius: 4px;
	user-select: all;
}

/* ---------- Inspector: campo email y resultado de envío ---------- */
.fichaje-field-help { display: block; margin-top: 4px; color: var(--fm-muted); font-size: 12px; }
.fichaje-reveal-mail-ok {
	margin: 12px 0 0; padding: 10px 14px; border-radius: 6px; font-size: 14px;
	background: rgba(91,140,90,0.16); border-left: 4px solid #5b8c5a; color: #d6e8d4;
}
.fichaje-reveal-mail-error {
	margin: 12px 0 0; padding: 10px 14px; border-radius: 6px; font-size: 14px;
	background: rgba(224,82,82,0.16); border-left: 4px solid var(--fm-solape); color: #f5cfcf;
}

/* ---------- Inspeccion: detalle de ediciones (inspector) ---------- */
.fichaje-audit summary { cursor: pointer; color: var(--fm-gold, #c9a96e); font-size: 13px; white-space: nowrap; }
.fichaje-audit summary:hover { text-decoration: underline; }
.fichaje-audit-table { margin: 10px 0 0; max-width: 100%; }
.fichaje-audit-table th, .fichaje-audit-table td {
	padding: 4px 8px; font-size: 12px; text-align: left; white-space: nowrap;
}
.fichaje-audit-table th { color: var(--fm-muted, #9a9a9a); font-weight: 600; }
.fichaje-audit .fichaje-note { margin: 8px 0 0; }

/* ---------- Telefono y solo lectura (v2.2.0) ---------- */
.fichaje-ro-notice {
	margin: 0 0 16px;
	padding: 10px 12px;
	border-left: 4px solid #c9a96e;
	background: #3a2f1a;
	color: #f0d9a0;
	font-size: 13px;
	border-radius: 4px;
}
.fichaje-modal-box input:disabled,
.fichaje-modal-box textarea:disabled {
	opacity: .65;
	cursor: not-allowed;
	background: #2a2a2a;
	color: #9a9a9a;
}

/* ---------- Variables extendidas (v2.4.1): menu, tablas y fuentes ---------- */
.fichaje-navitem,
.fichaje-navitem:visited { color: var(--fm-menu-text); }
.fichaje-table td { color: var(--fm-table-text); }
.fichaje-table th { color: var(--fm-muted); }

/* ---------- Controles de zoom de Leaflet (+ / -) ---------- */
/* Son enlaces <a>, asi que heredan el subrayado de los enlaces del tema. */
.leaflet-control-zoom a,
.leaflet-control-zoom a:hover,
.leaflet-control-zoom a:focus,
.leaflet-control-zoom a:visited,
a.leaflet-control-zoom-in,
a.leaflet-control-zoom-out {
	text-decoration: none !important;
	border-bottom: none !important;
}
