/* ============================================================
   Reloj Checador — Estilos
   App UI: dashboard denso, desktop 1280px+, fuente Inter
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --color-primary:     #00A901;
  --color-accent:      #61CE70;
  --color-bg:          #f5f5f5;
  --color-surface:     #ffffff;
  --color-border:      #E5E7EB;
  --color-text:        #111827;
  --color-text-muted:  #6B7280;

  --state-puntual:     #00A901;
  --state-tardanza:    #F59E0B;
  --state-ausente:     #EF4444;
  --state-fuera-turno: #9CA3AF;
  --state-sin-turno:   #D1D5DB;

  --text-xs:   12px;
  --text-sm:   14px;
  --text-base: 16px;
  --text-lg:   18px;
  --text-xl:   24px;
  --text-2xl:  32px;
  --text-3xl:  48px;

  --radius-sm: 6px;
  --radius:    8px;
  --radius-lg: 12px;

  --shadow:    0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,.10);
}

/* ── Reset / Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Inter', sans-serif;
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ── Layout ────────────────────────────────────────────────── */
.layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--color-bg);
}

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--color-border);
}

.brand-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.brand-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.2;
}

.sidebar-nav {
  padding: 8px 0;
  display: flex;
  flex-direction: column;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  border-left: 3px solid transparent;
  transition: color .15s, background .15s;
  border-radius: 0 6px 6px 0;
  margin-right: 8px;
}

.nav-link:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

.nav-link:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}

.nav-link.active {
  border-left-color: var(--color-primary);
  background: #F0FDF4;
  color: var(--color-primary);
}

.nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ── Avatars ───────────────────────────────────────────────── */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
}

.avatar-sm  { width: 32px;  height: 32px;  font-size: 11px; }
.avatar-md  { width: 96px;  height: 96px;  font-size: 28px; }
.avatar-lg  { width: 128px; height: 128px; font-size: 36px; }

img.avatar  { object-fit: cover; display: block; }

/* ── Status badges ─────────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.badge-puntual    { background: rgba(0,169,1,.1);   color: var(--state-puntual); }
.badge-tardanza   { background: rgba(245,158,11,.1); color: var(--state-tardanza); }
.badge-ausente    { background: rgba(239,68,68,.1);  color: var(--state-ausente); }
.badge-fuera_turno { background: rgba(156,163,175,.12); color: var(--state-fuera-turno); }
.badge-sin_turno  { background: rgba(209,213,219,.25); color: var(--color-text-muted); }

/* ── Skeleton loader ───────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, #ececec 25%, #f5f5f5 50%, #ececec 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}

.skeleton-page { padding: 8px 0; display: flex; flex-direction: column; gap: 12px; }
.sk-title { height: 28px; width: 260px; }
.sk-bar   { height: 80px; }
.sk-row   { height: 52px; }

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Toast ─────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
  font-size: var(--text-sm);
  font-weight: 500;
  max-width: 340px;
  animation: toastIn .25s ease;
}

.toast-success { border-left: 4px solid var(--state-puntual); }
.toast-warning { border-left: 4px solid var(--state-tardanza); }
.toast-error   { border-left: 4px solid var(--state-ausente); }

@keyframes toastIn {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ── Connection indicator ──────────────────────────────────── */
.connection-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
}

.conn-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--state-puntual);
  transition: background .3s;
  flex-shrink: 0;
}

.conn-dot.amber { background: var(--state-tardanza); }
.conn-dot.red   { background: var(--state-ausente); }

.conn-banner {
  margin: 0 0 12px;
  padding: 8px 12px;
  background: rgba(245,158,11,.08);
  border: 1px solid rgba(245,158,11,.3);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: #92400E;
  display: flex;
  align-items: center;
  gap: 7px;
}

/* ── Page header ───────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.page-title {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  transition: color .15s, border-color .15s;
}

.btn-back:hover { color: var(--color-text); border-color: #9CA3AF; }

/* ============================================================
   VISTA 2 — Dashboard Global
   ============================================================ */

/* ── Proportion card ───────────────────────────────────────── */
.proportion-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.proportion-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}

.proportion-card-header h2 {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
}

.proportion-card-header .fecha-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.proportion-bar-track {
  height: 12px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  background: var(--color-border);
  cursor: pointer;
}

.proportion-segment {
  height: 100%;
  transition: width .4s ease, opacity .2s;
  cursor: pointer;
}

.proportion-segment:hover { opacity: .85; }
.proportion-segment.filtered { opacity: 1; }
.proportion-segment.dimmed   { opacity: .35; }

.seg-puntual  { background: var(--state-puntual); }
.seg-tardanza { background: var(--state-tardanza); }
.seg-ausente  { background: var(--state-ausente); }

.proportion-legend {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 12px;
}

.legend-main {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.legend-count-big {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--state-puntual);
  line-height: 1;
}

.legend-label-main {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: 4px;
}

.legend-side {
  display: flex;
  gap: 28px;
}

.legend-item {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: background .15s;
}

.legend-item:hover { background: var(--color-bg); }
.legend-item.active-filter { background: var(--color-bg); }

.legend-count {
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1;
}

.legend-count.tardanza-color { color: var(--state-tardanza); }
.legend-count.ausente-color  { color: var(--state-ausente); }

.legend-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
}

.filter-active-banner {
  margin: -12px 0 12px;
  padding: 6px 12px;
  background: rgba(0,0,0,.04);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-clear-filter {
  font-size: var(--text-xs);
  color: var(--color-primary);
  font-weight: 500;
}

/* ── Employee list ─────────────────────────────────────────── */
.list-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

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

.list-header h3 {
  font-size: var(--text-base);
  font-weight: 600;
}

.search-input {
  width: 260px;
  padding: 7px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-family: inherit;
  outline: none;
  background: var(--color-bg);
  color: var(--color-text);
  transition: border-color .15s;
}

.search-input:focus { border-color: var(--color-primary); }
.search-input:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 1px; }
.search-input::placeholder { color: var(--color-text-muted); }

.employee-table {
  width: 100%;
  border-collapse: collapse;
}

.employee-table th {
  text-align: left;
  padding: 10px 16px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--color-border);
  background: #FAFAFA;
}

.emp-row {
  cursor: pointer;
  transition: background .12s;
  border-bottom: 1px solid var(--color-border);
}

.emp-row:last-child { border-bottom: none; }

.emp-row:hover { background: rgba(0,0,0,.025) !important; }

.emp-row td {
  padding: 11px 16px;
  font-size: var(--text-sm);
  vertical-align: middle;
}

.emp-row[data-estado="ausente"]  { background: rgba(239,68,68,.06); }
.emp-row[data-estado="tardanza"] { background: rgba(245,158,11,.06); }

.emp-name { font-weight: 500; }
.emp-dept  { color: var(--color-text-muted); font-size: var(--text-xs); }
.emp-time  { color: var(--color-text-muted); font-size: var(--text-sm); font-variant-numeric: tabular-nums; }

.emp-name-cell { display: flex; align-items: center; gap: 10px; }
.emp-name-info { display: flex; flex-direction: column; }

.pulse-anim { animation: rowPulse .3s ease; }

@keyframes rowPulse {
  0%   { opacity: 1; }
  40%  { opacity: .4; }
  100% { opacity: 1; }
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 24px;
  text-align: center;
  color: var(--color-text-muted);
}

.empty-state-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  color: #9CA3AF;
}
.empty-state-title { font-size: var(--text-base); font-weight: 600; color: var(--color-text); margin-bottom: 6px; }
.empty-state-desc  { font-size: var(--text-sm); }
.empty-state-ok    { font-size: var(--text-sm); color: var(--state-puntual); font-weight: 500; margin-top: 8px; }

/* ============================================================
   VISTA 1 — Perfil de Empleado
   ============================================================ */

.profile-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 860px;
}

.profile-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.profile-card-title {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--color-text-muted);
  margin-bottom: 16px;
}

/* ── Zona 1 — Quién + estado ────────────────────────────────── */
.zona1 {
  display: flex;
  align-items: center;
  gap: 20px;
}

.zona1-info { flex: 1; }

.empleado-nombre {
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 8px;
}

.zona1-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.meta-separator { color: var(--color-border); font-weight: 300; }
.meta-text { font-size: var(--text-sm); color: var(--color-text-muted); }

/* ── Zona 2 — Hoy ───────────────────────────────────────────── */
.zona2-stats {
  display: flex;
  gap: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 16px;
}

.stat-item { display: flex; flex-direction: column; gap: 2px; }
.stat-label { font-size: var(--text-xs); color: var(--color-text-muted); }
.stat-value { font-size: var(--text-base); font-weight: 600; }

.movimientos-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.mov-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
}

.mov-item:last-child { border-bottom: none; }

.mov-time {
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--color-text);
  min-width: 44px;
}

.mov-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-primary);
  flex-shrink: 0;
}

.mov-desc { font-size: var(--text-sm); flex: 1; }
.mov-area { font-size: var(--text-xs); color: var(--color-text-muted); }

.mov-photo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  cursor: pointer;
  transition: opacity .2s;
}

.mov-photo:hover { opacity: .8; }

.empty-movimientos {
  padding: 20px 0;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: 1.6;
}

/* ── Zona 3 — Esta semana ───────────────────────────────────── */
.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.week-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.week-day-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
}

.week-day-label.today { color: var(--color-primary); }

.week-bar-wrap {
  width: 100%;
  height: 56px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.week-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: height .3s ease;
}

.week-bar.puntual  { background: var(--state-puntual); }
.week-bar.tardanza { background: var(--state-tardanza); }
.week-bar.ausente  { background: var(--state-ausente); }
.week-bar.empty    { background: #E5E7EB; height: 4px; }
.week-bar.future   { background: #F3F4F6; height: 4px; }

.week-bar.ausente { background: var(--state-ausente); opacity: .35; }

.week-hours {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

.week-resumen {
  margin-top: 10px;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ── Zona 4 — Mes + alertas WA ──────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.kpi-item { display: flex; flex-direction: column; gap: 4px; }
.kpi-label { font-size: var(--text-xs); color: var(--color-text-muted); }
.kpi-value { font-size: var(--text-lg); font-weight: 700; }
.kpi-sub   { font-size: var(--text-xs); color: var(--color-text-muted); }

.kpi-bar-wrap { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.kpi-bar-track {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--color-border);
  overflow: hidden;
}
.kpi-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--color-primary);
  transition: width .4s ease;
}

.alertas-section-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.alerta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
}

.alerta-item:last-child { border-bottom: none; }

.alerta-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.alerta-tipo {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--state-tardanza);
}

.alerta-tipo.ausencia { color: var(--state-ausente); }

.alerta-fecha { font-size: var(--text-xs); color: var(--color-text-muted); }

.alerta-wa-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  color: var(--state-puntual);
  font-weight: 500;
}

.alerta-preview {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-style: italic;
}

.no-alertas {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  padding: 8px 0;
}

/* ── Lightbox imagen ────────────────────────────────────────── */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  cursor: pointer;
}

.lightbox-img {
  max-width: 80vw;
  max-height: 80vh;
  border-radius: var(--radius);
}

/* ============================================================
   VISTA DISPOSITIVOS
   ============================================================ */

/* ── Botones ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, opacity .15s;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}
.btn-primary:hover { background: #008f01; }

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn-secondary:hover { background: var(--color-bg); }

.btn-danger {
  background: var(--color-surface);
  color: var(--state-ausente);
  border-color: rgba(239,68,68,.3);
}
.btn-danger:hover { background: rgba(239,68,68,.06); }

.btn-sm {
  padding: 5px 10px;
  font-size: var(--text-xs);
}

.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

/* ── Tabla de dispositivos ─────────────────────────────────── */
.devices-table {
  width: 100%;
  border-collapse: collapse;
}

.devices-table th {
  text-align: left;
  padding: 10px 16px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--color-border);
  background: #FAFAFA;
}

.dev-row {
  border-bottom: 1px solid var(--color-border);
  transition: background .12s;
}
.dev-row:last-child { border-bottom: none; }
.dev-row:hover { background: rgba(0,0,0,.02); }

.dev-row td {
  padding: 12px 16px;
  font-size: var(--text-sm);
  vertical-align: middle;
}

.dev-id     { font-weight: 500; font-size: var(--text-xs); color: var(--color-text-muted); }
.dev-area   { font-weight: 500; }
.dev-ip     { font-variant-numeric: tabular-nums; color: var(--color-text-muted); }
.dev-time   { font-size: var(--text-xs); color: var(--color-text-muted); }
.dev-actions { display: flex; gap: 6px; }

.badge-active   { background: rgba(0,169,1,.1);  color: var(--state-puntual);  padding: 2px 8px; border-radius: 10px; font-size: var(--text-xs); font-weight: 500; }
.badge-inactive { background: rgba(156,163,175,.12); color: var(--state-fuera-turno); padding: 2px 8px; border-radius: 10px; font-size: var(--text-xs); font-weight: 500; }

/* ── Tabla de empleados ─────────────────────────────────────── */
.emp-table {
  width: 100%;
  border-collapse: collapse;
}

.emp-table th {
  text-align: left;
  padding: 10px 16px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: .03em;
  border-bottom: 1px solid var(--color-border);
}

.emp-row {
  border-bottom: 1px solid var(--color-border);
  transition: background .12s;
}
.emp-row:last-child { border-bottom: none; }
.emp-row:hover { background: rgba(0,0,0,.02); }

.emp-row td {
  padding: 11px 16px;
  font-size: var(--text-sm);
  vertical-align: middle;
}

.emp-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--color-text);
}
.emp-link:hover .emp-nombre { color: var(--color-primary); }

.emp-nombre  { font-weight: 500; }
.emp-depto   { color: var(--color-text-muted); }
.emp-turno   { color: var(--color-text-muted); font-size: var(--text-xs); }
.emp-hik     { font-variant-numeric: tabular-nums; font-size: var(--text-xs); color: var(--color-text-muted); font-family: monospace; }

/* ── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  width: 440px;
  max-width: 90vw;
  animation: modalIn .2s ease;
}

@keyframes modalIn {
  from { transform: translateY(-12px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

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

.modal-title {
  font-size: var(--text-base);
  font-weight: 600;
}

.modal-close {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 18px;
  transition: background .15s;
}
.modal-close:hover { background: var(--color-bg); }

.modal-body { padding: 20px; }

/* ── Sección de sync en modal empleado ──────────────────────── */
.sync-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.sync-section-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 10px;
}

.sync-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.sync-result-ok {
  color: var(--state-puntual);
  font-size: var(--text-xs);
}

.sync-result-err {
  color: var(--state-ausente);
  font-size: var(--text-xs);
}
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ── Formulario ────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-group:last-child { margin-bottom: 0; }

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  margin-bottom: 5px;
  color: var(--color-text);
}

.form-label .required { color: var(--state-ausente); margin-left: 2px; }

.form-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-family: inherit;
  background: var(--color-surface);
  color: var(--color-text);
  outline: none;
  transition: border-color .15s;
}
.form-input:focus { border-color: var(--color-primary); }
.form-input:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 1px; }
.form-input::placeholder { color: var(--color-text-muted); }
.form-input.error { border-color: var(--state-ausente); }

.form-hint {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* ── Import result ─────────────────────────────────────────── */
.import-result {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  margin-top: 8px;
}
.import-result.success { background: rgba(0,169,1,.08); color: #166534; border: 1px solid rgba(0,169,1,.2); }
.import-result.error   { background: rgba(239,68,68,.06); color: #991B1B; border: 1px solid rgba(239,68,68,.2); }

/* ── Utilities ─────────────────────────────────────────────── */
.text-muted  { color: var(--color-text-muted); }
.text-sm     { font-size: var(--text-sm); }
.font-medium { font-weight: 500; }
.font-bold   { font-weight: 700; }
