:root {
  --panel-bg: #f4f1ec;
  --panel-ink: #293042;
  --panel-muted: #6f7785;
  --panel-line: rgba(41, 48, 66, 0.1);
  --panel-accent: linear-gradient(90deg, #f99c4c, #445298);
  --panel-accent-strong: linear-gradient(90deg, #d96b14, #2c2aa6);
}

body.asistencias-page {
  background:
    radial-gradient(circle at top left, rgba(249, 156, 76, 0.16), transparent 34%),
    radial-gradient(circle at top right, rgba(68, 82, 152, 0.15), transparent 30%),
    linear-gradient(180deg, #fbfaf8 0%, var(--panel-bg) 100%);
  color: var(--panel-ink);
  font-size: 0.94rem;
}

body.auth-locked {
  overflow: hidden;
}

body.auth-locked .asistencias-shell {
  filter: blur(5px) saturate(0.92);
  pointer-events: none;
  user-select: none;
}

.access-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(20, 22, 31, 0.72);
  backdrop-filter: blur(10px);
}

body.auth-locked .access-overlay {
  display: flex;
}

.access-card {
  width: min(100%, 520px);
  border-radius: 1.5rem;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(41, 48, 66, 0.08);
  padding: 1.5rem;
}

.access-card-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.access-kicker {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #445298;
}

.access-card h2 {
  margin-top: 0.25rem;
  font-size: 1.6rem;
  line-height: 1.1;
  color: #293042;
}

.access-badge {
  flex: 0 0 auto;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #f99c4c, #445298);
  color: #fff;
  font-weight: 800;
}

.access-copy {
  color: #5b6476;
  font-size: 0.92rem;
  margin-bottom: 1rem;
}

.access-form {
  display: grid;
  gap: 0.85rem;
}

.access-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 800;
  color: #5b6476;
}

.access-input {
  width: 100%;
  border: 1px solid rgba(41, 48, 66, 0.18);
  border-radius: 0.95rem;
  padding: 0.95rem 1rem;
  font-size: 1rem;
  outline: none;
  background: #f8fafc;
  color: #293042;
}

.access-input:focus {
  border-color: #445298;
  box-shadow: 0 0 0 4px rgba(68, 82, 152, 0.12);
  background: #fff;
}

.access-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.access-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border: 1px solid rgba(68, 82, 152, 0.18);
  border-radius: 999px;
  background: #edf1ff;
  color: #445298;
}

.access-back-btn:hover,
.access-back-btn:focus {
  background: #dfe6ff;
  color: #2c2aa6;
}

.access-back-btn svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.access-error {
  min-height: 1rem;
  margin-top: 0.75rem;
  color: #d12828;
  font-size: 0.82rem;
  font-weight: 700;
}

.access-countdown {
  min-height: 1rem;
  margin-top: 0.35rem;
  color: #445298;
  font-size: 0.82rem;
  font-weight: 800;
}

.access-form.is-blocked .access-input,
.access-form.is-blocked button {
  opacity: 0.65;
  pointer-events: none;
}

.asistencias-shell {
  min-height: 100vh;
}

.asistencias-hero {
  position: relative;
  padding: 5.9rem 1rem 2rem;
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(90deg, rgba(87, 46, 119, 0.96) 0%, rgba(124, 66, 95, 0.92) 34%, rgba(205, 108, 31, 0.94) 100%);
  border-radius: 0;
  margin: 0;
}

.asistencias-network {
  opacity: 0.42;
}

.asistencias-network .hero-network__svg {
  opacity: 0.68;
}

.asistencias-network__lines path {
  stroke: url(#asistencias-network-line-gradient);
  stroke-width: 1.2;
  opacity: 0.48;
  filter: drop-shadow(0 0 4px rgba(87, 243, 255, 0.14));
}

.asistencias-network .hero-network__dots circle {
  opacity: 0.42;
  filter: drop-shadow(0 0 4px rgba(87, 243, 255, 0.22));
}

.asistencias-network .hero-network__dots circle:nth-child(2n) {
  opacity: 0.3;
}

.asistencias-network-icon {
  width: clamp(76px, 6.6vw, 118px);
  height: clamp(76px, 6.6vw, 118px);
  border-color: rgba(255, 255, 255, 0.22);
  opacity: 0.24;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.12);
}

.asistencias-network-icon svg {
  stroke: rgba(255, 255, 255, 0.72);
}

.asistencias-network-icon--analytics {
  left: 5%;
  top: 34%;
  animation-duration: 14s;
}

.asistencias-network-icon--screen {
  right: 5%;
  top: 43%;
  animation-delay: -4s;
  animation-duration: 16s;
}

.asistencias-network-icon--chart {
  left: 48%;
  bottom: 28%;
  animation-delay: -8s;
  animation-duration: 15s;
}

.asistencias-hero:before,
.asistencias-hero:after {
  content: "";
  position: absolute;
  border-radius: 999px;
  filter: blur(18px);
  opacity: 0.55;
  pointer-events: none;
}

.asistencias-hero:before {
  top: 110px;
  left: -120px;
  width: 360px;
  height: 180px;
  background: rgba(255, 255, 255, 0.12);
}

.asistencias-hero:after {
  top: 110px;
  right: -90px;
  width: 360px;
  height: 180px;
  background: rgba(255, 255, 255, 0.08);
}

.asistencias-page .title-section {
  box-shadow: inset 0 -0.28rem 0 #2f3ea0;
}

.asistencias-page .title-section:hover {
  box-shadow: inset 0 -1rem 0 rgba(47, 62, 160, 0.45);
}

.logout-btn {
  border: 0;
  cursor: pointer;
}

body.auth-locked .logout-btn {
  display: none;
}

.panel-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 18px 40px rgba(41, 48, 66, 0.11);
  backdrop-filter: blur(10px);
}

.contact-panel {
  background: rgba(255, 255, 255, 0.985);
  box-shadow: 0 14px 32px rgba(15, 18, 31, 0.22);
  border: 1px solid rgba(41, 48, 66, 0.08);
  color: #293042;
}

.contact-panel-rounded {
  border-radius: 1.35rem;
  overflow: hidden;
}

.contact-panel .filter-label {
  color: #5b6476;
}

.panel-surface {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--panel-line);
  box-shadow: 0 12px 28px rgba(41, 48, 66, 0.08);
}

.panel-surface-rounded {
  border-radius: 1.35rem;
  overflow: hidden;
}

.charts-section {
  border-radius: 1.35rem;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.chart-card {
  background: rgba(255, 255, 255, 0.97);
  padding: 0.9rem;
  box-shadow: 0 12px 28px rgba(41, 48, 66, 0.08);
  border: 1px solid rgba(41, 48, 66, 0.08);
  overflow: hidden;
}

.chart-card .apexcharts-canvas,
.chart-card .apexcharts-svg {
  max-width: 100% !important;
}

.chart-card .apexcharts-title-text {
  font-family: inherit !important;
}

.filter-input {
  width: 100%;
  border: 1px solid rgba(41, 48, 66, 0.15);
  border-radius: 0.85rem;
  padding: 0.78rem 0.95rem;
  background: #f8fafc;
  color: var(--panel-ink);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.filter-input:focus {
  border-color: #445298;
  box-shadow: 0 0 0 4px rgba(68, 82, 152, 0.12);
  background: #fff;
}

.filter-action-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 3rem;
  min-width: 3rem;
  height: 3rem;
  border: 0;
  border-radius: 0.85rem;
  padding: 0;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(41, 48, 66, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

#filtro-asistencias > .flex-1 {
  padding-right: 0.65rem;
}

#filtro-asistencias .filter-input,
#filtro-asistencias .flatpickr-input.form-control.input {
  margin-right: 0.75rem;
}

.filter-action-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.55rem);
  z-index: 5;
  width: max-content;
  max-width: 180px;
  padding: 0.42rem 0.6rem;
  border-radius: 0.35rem;
  background: #293042;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.filter-action-btn::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.28rem);
  z-index: 5;
  border: 5px solid transparent;
  border-top-color: #293042;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.filter-action-btn:hover::after,
.filter-action-btn:hover::before,
.filter-action-btn:focus-visible::after,
.filter-action-btn:focus-visible::before {
  opacity: 1;
  transform: translate(-50%, 0);
}

.filter-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(41, 48, 66, 0.16);
}

.filter-action-btn:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.filter-action-btn-primary {
  background: #445298;
}

.filter-action-btn-secondary {
  background: #7a5d37;
}

.filter-action-icon {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.filter-label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--panel-muted);
  font-weight: 800;
}

.table-wrap {
  overflow: auto;
  border: 1px solid #d8dde8;
  border-radius: 0.35rem;
  background: #fff;
}

.dataTables_wrapper {
  color: var(--panel-ink);
  font-size: 0.86rem;
}

.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
  margin-bottom: 0.9rem;
  color: var(--panel-ink) !important;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  border: 1px solid #b8beca;
  border-radius: 0.25rem;
  padding: 0.42rem 0.55rem;
  background: #fff;
  outline: none;
  font-size: 0.86rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  border: 1px solid #d8dde8 !important;
  border-radius: 0.25rem !important;
  margin-left: 0.25rem;
  padding: 0.38rem 0.7rem !important;
  color: #293042 !important;
  background: #fff !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  color: #293042 !important;
  border-color: #445298 !important;
  background: #eef1ff !important;
  background-image: none !important;
  box-shadow: none !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  color: #293042 !important;
  border-color: #36427e !important;
  background: #e2e7ff !important;
  background-image: none !important;
}

div.dataTables_wrapper div.dataTables_paginate a.paginate_button.current,
div.dataTables_wrapper div.dataTables_paginate a.paginate_button.current:hover {
  color: #293042 !important;
  background: #eef1ff !important;
  background-image: none !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
  opacity: 0.45 !important;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  min-width: 1100px;
  background: #fff;
}

.report-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #293042;
  background: #eef1f6;
  padding: 0.75rem 0.8rem;
  border-bottom: 1px solid #cfd5e1;
  border-right: 1px solid #d8dde8;
}

.report-table tbody td {
  padding: 0.72rem 0.8rem;
  border-bottom: 1px solid #e5e9f0;
  border-right: 1px solid #edf0f5;
  vertical-align: top;
  color: var(--panel-ink);
  background: #fff;
  font-size: 0.85rem;
}

.report-table tbody tr:nth-child(even) td {
  background: #fafbfc;
}

.report-table tbody tr:hover td {
  background: #f4f6fa;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.55rem;
  border-radius: 0.35rem;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-completo {
  background: #eef1f6;
  color: #293042;
}

.badge-pendiente {
  background: #f7efe6;
  color: #7a4d17;
}

.badge-default {
  background: rgba(41, 48, 66, 0.08);
  color: var(--panel-ink);
}

.mini-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.38rem 0.62rem;
  border-radius: 0.35rem;
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
  background: #293042;
  box-shadow: none;
}

.mini-link:hover {
  filter: brightness(1.03) saturate(1.05);
}

.mini-link.secondary {
  background: #293042;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.summary-card {
  border-radius: 1rem;
  padding: 1rem 1.1rem;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(41, 48, 66, 0.08);
  box-shadow: 0 8px 20px rgba(41, 48, 66, 0.08);
}

.summary-card-total {
  border-top: 4px solid #293042;
}

.summary-card-mostrados {
  border-top: 4px solid #445298;
}

.summary-card-entradas {
  border-top: 4px solid #1d2ea7;
}

.summary-card-salidas {
  border-top: 4px solid #d96b14;
}

.summary-value {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.45rem;
  line-height: 1;
  font-weight: 900;
  color: #293042;
}

.summary-label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--panel-muted);
  font-weight: 800;
}

.state-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  margin-right: 0.5rem;
  background: #445298;
}

.asistencias-empty {
  padding: 2rem;
  text-align: center;
  color: var(--panel-muted);
}

@media (max-width: 1024px) {
  .asistencias-network-icon {
    opacity: 0.16;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .asistencias-hero {
    padding-top: 5.4rem;
  }
}

@media (max-width: 640px) {
  .asistencias-network-icon {
    display: none;
  }

  #filtro-asistencias > .flex-1 {
    padding-right: 0;
  }

  #filtro-asistencias .filter-input,
  #filtro-asistencias .flatpickr-input.form-control.input {
    margin-right: 0;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .charts-grid {
    grid-template-columns: 1fr;
  }

  .asistencias-hero {
    padding: 5rem 0.75rem 1.25rem;
  }
}
