/* Klokk · estilos propios del módulo rrhh (cargado después de base.css). */

/* utilidades del módulo */
.rh-min { min-width: 0; }
.badge.rh-nofic { background: var(--surface-3); color: var(--fg-2); flex: none; }
/* listado de empleados: email y distintivo «No ficha» bajo el nombre */
.table .sub.rh-sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.table .sub.rh-sub .badge { font-size: 11px; }

/* Mi zona · panel de control */
.rh-panel .page-head h1 { word-break: break-word; }
.rh-panel .page-head p { margin: 0; }

/* «¿Cuál es tu ficha de empleado?» */
.rh-vincular { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; border-left: 3px solid var(--primary); }
.rh-vincular-ico { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; background: var(--primary-soft); color: var(--primary); }
.rh-vincular-ico svg { width: 18px; height: 18px; }
.rh-vincular > .col { flex: 1 1 260px; }
.rh-vincular-acc { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; margin-left: auto; min-width: 0; max-width: 100%; }
.rh-campo { display: flex; flex-direction: column; gap: 2px; min-width: 0; max-width: 100%; }
.rh-vincular-acc .select { width: auto; max-width: 100%; min-width: 0; }
#rh-mi-ficha { max-width: 320px; }

/* listas del panel */
.rh-sit .badge, .rh-sol .badge { flex: none; }
.rh-sit .rh-clasificar { flex: none; margin-left: -6px; }
.rh-vacio-acc { justify-content: center; }
.rh-sol { flex-wrap: wrap; row-gap: 8px; }
.rh-sol > .col { flex: 1 1 180px; }
.rh-sol-acc { margin-left: auto; flex: none; }
.rh-exentos { padding-top: 4px; }
.rh-exentos .eyebrow { padding: 6px 0 2px; }

/* horas de esta semana */
.rh-horas { gap: 10px; }
.rh-horas-n { flex: 0 1 38%; min-width: 0; }
.rh-horas-v { flex: none; color: var(--fg-2); }
.rh-horas .progress-bar { width: 100%; }

/* accesos rápidos */
.rh-accesos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.rh-acceso { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--fg); font-size: 13px; font-weight: 600; text-decoration: none; }
.rh-acceso:hover { background: var(--surface-2); border-color: var(--primary); }
.rh-acceso-ico { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); }
.rh-acceso-ico svg { width: 16px; height: 16px; }
.rh-acceso-t { min-width: 0; line-height: 1.25; overflow-wrap: break-word; }
/* en la columna lateral (320 px) los accesos van uno por fila para que ningún nombre se parta */
.split-view > .col:last-child .rh-accesos { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 1100px) { .split-view > .col:last-child .rh-accesos { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* avisos con botones (registro de jornada, relación con la empresa): icono, texto y botones en columnas */
.notice.rh-registro, .notice.rh-relacion { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; }
.notice.rh-registro .btn, .notice.rh-relacion .btn { flex: none; }
/* menú «⋮» de relación con la empresa: cada opción en una línea y con su icono */
.menu .item.rh-item-nw { white-space: nowrap; min-width: max-content; }
.menu .item.rh-item-nw > span:first-child { flex: none; display: inline-grid; }

/* en pantallas medianas y móviles los botones del aviso pasan debajo del texto, alineados con él */
@media (max-width: 900px) {
  .notice.rh-registro, .notice.rh-relacion { grid-template-columns: auto minmax(0, 1fr); align-items: start; }
  .notice.rh-registro > :nth-child(n+3), .notice.rh-relacion > :nth-child(n+3) { grid-column: 2; justify-self: start; }
}
@media (max-width: 640px) {
  .rh-panel .rh-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .rh-panel .rh-kpis .kpi { padding: 12px; }
  /* etiquetas en una línea para que las cifras de una misma fila queden a la misma altura */
  .rh-panel .rh-kpis .kpi .label { font-size: 11px; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rh-vincular-acc { margin-left: 0; width: 100%; }
  .rh-campo, .rh-vincular-acc .select, #rh-mi-ficha { flex: 1 1 100%; width: 100%; max-width: 100%; }
  .rh-horas { flex-wrap: wrap; row-gap: 4px; }
  .rh-horas-n { flex: 1 1 60%; }
  .rh-horas > .grow { order: 3; flex: 1 1 100%; }
}

/* Mi zona · vista personal */
.rh-misaus { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.rh-misaus .kpi .label { font-size: 12px; letter-spacing: 0; text-transform: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list[data-vacio]:empty::before { content: attr(data-vacio); color: var(--muted); font-size: 13px; }

/* ============================================================
   Control horario (assets/fichajes.js · modules/rrhh-fichajes.js)
   ============================================================ */
.rh-pestanas { overflow-x: auto; scrollbar-width: thin; }
.rh-pestanas .tabs { flex-wrap: nowrap; white-space: nowrap; }
.rh-geo { width: 14px; display: inline-grid; color: var(--primary); }
.rh-geo svg { width: 14px; height: 14px; }

/* mapa de teselas OpenStreetMap */
.fx-mapa { position: relative; overflow: hidden; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); user-select: none; touch-action: pan-y; }
.fx-mapa.vacio { display: grid; place-items: center; }
.fx-mapa-vacio { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; padding: 16px; text-align: center; position: relative; z-index: 3; pointer-events: none; }
.fx-mapa-vacio svg { width: 18px; height: 18px; }
.fx-mapa-capa { position: absolute; inset: 0; }
.fx-tesela { position: absolute; width: 256px; height: 256px; max-width: none; }
:root[data-theme="dark"] .fx-tesela { filter: brightness(.82) contrast(1.05) saturate(.85); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fx-tesela { filter: brightness(.82) contrast(1.05) saturate(.85); } }
.fx-circulo { position: absolute; border-radius: 50%; border: 2px solid var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); pointer-events: none; }
.fx-lineas { position: absolute; left: 0; top: 0; pointer-events: none; }
.fx-lineas line { stroke: var(--fg); stroke-width: 2; stroke-dasharray: 6 5; opacity: .7; }
.fx-pin { position: absolute; width: 18px; height: 18px; margin: -18px 0 0 -9px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--c); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); z-index: 2; }
.fx-pin-txt { position: absolute; left: 16px; top: -6px; transform: rotate(45deg); transform-origin: left top; background: var(--surface); color: var(--fg); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; font-size: 11px; font-weight: 600; white-space: nowrap; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.fx-mapa-zoom { position: absolute; right: 8px; top: 8px; display: flex; flex-direction: column; gap: 4px; z-index: 4; }
.fx-mapa-zoom button { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--fg); font-size: 16px; line-height: 1; cursor: pointer; }
.fx-mapa-atrib { position: absolute; right: 4px; bottom: 2px; z-index: 4; font-size: 10px; color: var(--muted); background: color-mix(in srgb, var(--surface) 85%, transparent); padding: 0 4px; border-radius: 4px; text-decoration: none; }
.fx-ley { display: inline-flex; align-items: center; gap: 6px; }
.fx-ley::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }

/* ficha de un fichaje */
.fx-cifras { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.fx-cifra { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); min-width: 0; }
.fx-cifra.ok .strong { color: var(--ok); } .fx-cifra.warn .strong { color: var(--warn); }
.fx-tramo { display: flex; flex-direction: column; gap: 8px; }
.fx-tramo + .fx-tramo { border-top: 1px dashed var(--border); padding-top: 10px; }
.fx-marca { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; min-width: 0; }
.fx-hora { font-size: 22px; font-weight: 700; }
.fx-pausa { gap: 8px; flex-wrap: wrap; }
.fx-fila .input, .fx-fila .select { width: auto; }
.fx-switch { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; padding: 6px 0; }
.fx-switch input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--primary); flex: none; }
.fx-num .input { text-align: right; }

/* en directo, por día, incidencias */
.fx-directo { align-items: start; }
.fx-persona { cursor: default; gap: 10px; }
.fx-persona[role="button"] { cursor: pointer; }
.fx-persona[role="button"]:hover, .fx-dia-card:hover { background: var(--surface-2); }
.fx-inc { gap: 10px; }
.fx-inc-ico { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.fx-inc-ico svg { width: 15px; height: 15px; }
.fx-inc-ico.danger { background: var(--danger-soft); color: var(--danger); }
.fx-inc-ico.warn { background: var(--warn-soft); color: var(--warn); }
.fx-dia-titulo { font-size: 15px; margin: 4px 0 0; }
.fx-dia-card { cursor: pointer; display: flex; flex-direction: column; gap: 8px; }
.fx-ent { color: var(--ok); font-weight: 600; } .fx-sal { color: var(--danger); font-weight: 600; }
.fx-geo-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }
.fx-geo-ico svg { width: 16px; height: 16px; }
.fx-gc-res { max-height: 180px; overflow: auto; }
.fx-gc-res .li { text-align: left; white-space: normal; font-size: 13px; }
.fx-gc-trab { max-height: 200px; overflow: auto; gap: 6px; border: 1px solid var(--border); border-radius: 8px; padding: 8px; }
.fx-manual { max-height: 50vh; overflow: auto; }

@media (max-width: 760px) {
  .fx-cifras { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fx-tramo .grid-2 { grid-template-columns: 1fr; }
  .fx-hora { font-size: 18px; }
}
