: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;
}

.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: 8.5rem 1rem 2rem;
  overflow: hidden;
  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 0 1.5rem 1.5rem;
  margin: 0.5rem 0.5rem 0;
}

.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-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-radius: 1rem;
}

.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 rgba(41, 48, 66, 0.16);
  border-radius: 0.85rem;
  padding: 0.55rem 0.8rem;
  background: #f8fafc;
  outline: none;
  font-size: 0.86rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  border: 0 !important;
  border-radius: 999px !important;
  margin-left: 0.25rem;
  padding: 0.45rem 0.8rem !important;
  color: #293042 !important;
  background: transparent !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  color: #fff !important;
  background: linear-gradient(90deg, #f99c4c, #445298) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
  opacity: 0.45 !important;
}

.report-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1100px;
}

.report-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  text-align: left;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
  background: linear-gradient(90deg, #2f315f, #445298);
  padding: 0.95rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.report-table tbody td {
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid rgba(41, 48, 66, 0.08);
  vertical-align: top;
  color: var(--panel-ink);
  background: #fff;
  font-size: 0.88rem;
}

.report-table tbody tr:nth-child(even) td {
  background: #f8fafc;
}

.report-table tbody tr:hover td {
  background: #f1f5ff;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-completo {
  background: rgba(29, 46, 167, 0.12);
  color: #1d2ea7;
}

.badge-pendiente {
  background: rgba(233, 126, 14, 0.12);
  color: #d96b14;
}

.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.48rem 0.8rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
  background: var(--panel-accent);
  box-shadow: 0 10px 18px rgba(68, 82, 152, 0.2);
}

.mini-link:hover {
  filter: brightness(1.03) saturate(1.05);
}

.mini-link.secondary {
  background: linear-gradient(90deg, #293042, #3c4b86);
}

.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) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .asistencias-hero {
    padding-top: 7.8rem;
  }
}

@media (max-width: 640px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .charts-grid {
    grid-template-columns: 1fr;
  }

  .asistencias-hero {
    padding: 7rem 0.75rem 1.25rem;
  }
}
