:root {
  --bg: #eef2f8;
  --surface-soft: #f7f9fd;
  --line: #dfe6f4;
  --ink: #1f2a44;
  --muted: #697793;
  --brand: #274c9f;
  --brand-2: #1f7a8c;
  --ok: #2ea86d;
  --danger: #da4f4f;
  --warning: #ea9b2d;
  --shadow-soft: 0 10px 24px rgba(24, 49, 103, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Manrope", sans-serif;
  background:
    radial-gradient(circle at 10% -10%, #ffffff 0%, rgba(255, 255, 255, 0.65) 22%, rgba(238, 242, 248, 0.9) 35%, var(--bg) 58%),
    linear-gradient(120deg, #ecf3ff 0%, #effaf9 100%);
  color: var(--ink);
  min-height: 100vh;
}

.left-panel {
  width: 258px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  box-shadow: var(--shadow-soft);
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-chip {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
}

.brand-chip .fa-solid {
  font-size: 30px;
}

.brand-title {
  font-family: "Sora", sans-serif;
  letter-spacing: 0.01em;
}

.menu-link {
  color: #4e5f82;
  font-weight: 700;
  border-radius: 14px;
  transition: 0.2s;
}

.menu-link:hover,
.menu-link.active {
  color: #163467;
  background: #e7efff;
}

.menu-group {
  border: 1px dashed #d9e3f6;
  border-radius: 0.8rem;
  padding: 0.35rem;
  background: #f9fbff;
}

.menu-group-toggle {
  border: 0;
  border-radius: 0.65rem;
  background: transparent;
  color: #324a77;
  transition: background-color 0.2s ease;
}

.menu-group-toggle:hover {
  background: #eef4ff;
}

.menu-group-title {
  color: #324a77;
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: none;
}

.menu-group-caret {
  font-size: 0.72rem;
  color: #4f6390;
  transition: transform 0.2s ease;
}

.menu-group.is-open .menu-group-caret {
  transform: rotate(180deg);
}

.menu-group-panel {
  overflow: hidden;
  max-height: 360px;
  transition: max-height 0.24s ease;
}

.menu-group-panel.is-collapsed {
  max-height: 0;
}

.sidebar-logout-btn {
  border-radius: 0.8rem;
  border: 1px solid #f0c9cf;
  background: linear-gradient(180deg, #fff9fa 0%, #fff2f3 100%);
  color: #a33d4a;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.62rem 0.8rem;
  transition: all 0.22s ease;
}

.sidebar-logout-btn:hover,
.sidebar-logout-btn:focus {
  border-color: #e7aeb6;
  background: linear-gradient(180deg, #fff3f5 0%, #ffe9ec 100%);
  color: #8f3140;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(180, 71, 88, 0.16);
}

.sidebar-logout-btn:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 0.18rem rgba(173, 66, 83, 0.2), 0 8px 18px rgba(180, 71, 88, 0.16);
}

.sidebar-logout-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(173, 66, 83, 0.11);
  font-size: 0.8rem;
}

.surface-card {
  border: 1px solid var(--line);
  border-radius: 1rem;
  box-shadow: var(--shadow-soft);
  background: #fff;
}

.side-note {
  background: linear-gradient(180deg, #ffffff, #f5f9ff);
}

.hero-panel {
  color: #fff;
  border-radius: 1.2rem;
  background: linear-gradient(130deg, #153770 0%, #25508c 52%, #157a8d 100%);
  box-shadow: 0 16px 34px rgba(18, 58, 113, 0.3);
}

.hero-glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.hero-glow-a {
  width: 180px;
  height: 180px;
  right: -50px;
  top: -40px;
  background: rgba(255, 255, 255, 0.12);
}

.hero-glow-b {
  width: 160px;
  height: 160px;
  left: 35%;
  bottom: -55px;
  background: rgba(102, 230, 211, 0.18);
}

.intro-copy {
  max-width: 680px;
  opacity: 0.92;
}

.badge-soft {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e9f3ff;
  letter-spacing: 0.06em;
  padding: 0.45rem 0.7rem;
}

.hero-badge-stack {
  display: grid;
  gap: 0.7rem;
  min-width: 185px;
}

.metric-badge {
  border-radius: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(7, 24, 45, 0.25);
  padding: 0.7rem 0.9rem;
  backdrop-filter: blur(2px);
}

.badge-label {
  display: block;
  font-size: 0.78rem;
  opacity: 0.78;
}

.metric-badge strong {
  font-size: 1.35rem;
  font-weight: 800;
}

.stat-card {
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 26px rgba(29, 63, 133, 0.16);
}

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.i-blue {
  background: #e7efff;
  color: var(--brand);
}

.i-green {
  background: #e7f9ef;
  color: var(--ok);
}

.i-red {
  background: #ffeded;
  color: var(--danger);
}

.i-orange {
  background: #fff4e3;
  color: var(--warning);
}

.i-purple {
  background: #f1ebff;
  color: #6a3fc4;
}

.i-cyan {
  background: #e6f9f8;
  color: #1a8f87;
}

.topbar-date {
  align-self: flex-start;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 0.75rem;
  padding: 0.5rem 0.8rem;
  font-size: 0.88rem;
  font-weight: 600;
  background: rgba(7, 24, 45, 0.25);
}

.date-filter-wrap {
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 0.9rem;
  padding: 0.75rem;
  background: rgba(7, 24, 45, 0.2);
}

.filter-label {
  color: #eaf3ff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.filter-input {
  border-radius: 0.6rem;
  border: 1px solid rgba(216, 229, 255, 0.5);
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.filter-input:focus {
  color: #fff;
  border-color: rgba(199, 223, 255, 0.9);
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 0 0.18rem rgba(174, 207, 255, 0.2);
}

.filter-input::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 0.9;
}

.filter-feedback {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.78rem;
  color: #d4e7ff;
}

.filter-feedback.error {
  color: #ffd7d7;
}

.hero-badge-wide {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.kpi-trend {
  font-size: 0.8rem;
  font-weight: 700;
}

.kpi-trend.up {
  color: var(--ok);
}

.kpi-trend.warn {
  color: #aa6b19;
}

.period-badge {
  font-size: 0.78rem;
  font-weight: 700;
  color: #3f598f;
  background: #edf3ff;
  border: 1px solid #d6e3fb;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
}

.trend-chart-wrap {
  position: relative;
  border: 1px solid #e4ebf8;
  border-radius: 0.9rem;
  padding: 0.6rem 0.6rem 0.8rem;
  background: linear-gradient(180deg, #f7faff, #ffffff);
}

.trend-svg {
  width: 100%;
  height: auto;
  display: block;
}

.trend-area {
  fill: rgba(46, 92, 191, 0.14);
}

.trend-line {
  fill: none;
  stroke: #355fc2;
  stroke-width: 3;
}

.trend-dots circle {
  fill: #355fc2;
  stroke: #fff;
  stroke-width: 2;
}

.trend-values,
.trend-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  text-align: center;
}

.trend-values {
  margin-top: -0.2rem;
  color: #405680;
  font-weight: 700;
  font-size: 0.84rem;
}

.trend-days {
  margin-top: 0.45rem;
  color: #66779a;
  font-size: 0.8rem;
  font-weight: 700;
}

.department-wrap {
  display: grid;
  grid-template-columns: 190px 1fr;
  align-items: center;
  gap: 1.25rem;
}

.department-donut {
  width: 185px;
  height: 185px;
  border-radius: 50%;
  background: conic-gradient(
    #4d63d8 0 34.3%,
    #2f86d8 34.3% 57.2%,
    #37b978 57.2% 74.3%,
    #f1a728 74.3% 85.7%,
    #36bfc5 85.7% 94.3%,
    #c8d3e6 94.3% 100%
  );
  display: grid;
  place-items: center;
  position: relative;
}

.department-donut::after {
  content: "";
  position: absolute;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: #fff;
}

.department-donut > div {
  position: relative;
  z-index: 1;
  text-align: center;
}

.department-donut strong {
  display: block;
  color: #1f2d4a;
  font-size: 1.75rem;
  line-height: 1;
}

.department-donut small {
  color: #66779a;
  font-weight: 700;
}

.department-legend {
  display: grid;
  gap: 0.45rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: #344c79;
}

.legend-item strong {
  margin-left: auto;
  color: #223457;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-dot.c1 { background: #4d63d8; }
.legend-dot.c2 { background: #2f86d8; }
.legend-dot.c3 { background: #37b978; }
.legend-dot.c4 { background: #f1a728; }
.legend-dot.c5 { background: #36bfc5; }
.legend-dot.c6 { background: #c8d3e6; }

.stack-list,
.notice-list {
  display: grid;
  gap: 0.7rem;
}

.stack-item {
  border: 1px solid #e5ecf9;
  border-radius: 0.85rem;
  padding: 0.72rem 0.8rem;
  background: #fafcff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.stack-item.compact {
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

.status-pill {
  background: #fff2d7;
  color: #8a611e;
  border-radius: 999px;
  padding: 0.24rem 0.6rem;
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.soft {
  background: #edf1ff;
  color: #4e61a6;
}

.notice-item {
  border: 1px solid #e5ecf9;
  border-radius: 0.85rem;
  padding: 0.72rem 0.8rem;
  background: #fff;
  display: grid;
  grid-template-columns: 12px 1fr;
  align-items: center;
  gap: 0.65rem;
}

.notice-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.notice-dot.green { background: #2ea86d; }
.notice-dot.blue { background: #2d7cd8; }
.notice-dot.orange { background: #e98e22; }

.table-clean > :not(caption) > * > * {
  padding: 0.75rem 0.85rem;
  border-bottom-color: #ebf0f9;
  vertical-align: middle;
  font-size: 0.9rem;
}

.table-clean thead th {
  background: #f5f8fe;
  color: #6f7f9e;
  text-transform: uppercase;
  font-size: 0.71rem;
  letter-spacing: 0.06em;
  border-bottom: 2px solid var(--line);
}

.tag-soft {
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.26rem 0.7rem;
  display: inline-flex;
  align-items: center;
}

.tag-ok {
  background: #daf6e7;
  color: #17784a;
}

.tag-info {
  background: #dfedf8;
  color: #1f5f8f;
}

.tag-warn {
  background: #fff1da;
  color: #97611a;
}

.timeline-line {
  border-left: 2px solid var(--line);
  padding-left: 1rem;
  margin-left: 0.35rem;
}

.timeline-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 3px solid var(--brand);
  background: #fff;
  position: absolute;
  left: -1.45rem;
  top: 0.25rem;
}

.timeline-dot.success {
  border-color: var(--ok);
}

.text-muted-custom {
  color: var(--muted) !important;
}

.chart-grid {
  display: grid;
  gap: 0.8rem;
}

.bar-item {
  background: linear-gradient(90deg, #f4f8ff 0%, #f7fcfc 100%);
  border: 1px solid #e3ebf8;
  border-radius: 0.8rem;
  padding: 0.7rem 0.85rem;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bar-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--value);
  background: linear-gradient(90deg, rgba(43, 103, 188, 0.2), rgba(42, 172, 153, 0.16));
}

.bar-item span,
.bar-item strong {
  position: relative;
  z-index: 1;
}

.bar-item strong {
  color: #2a3c5e;
}

.dataTables_wrapper .dataTables_filter label,
.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
  color: var(--muted);
  font-size: 0.88rem;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  border-radius: 0.55rem;
  border: 1px solid #ccd7ec;
  padding: 0.35rem 0.6rem;
  background: #fff;
}

.dataTables_wrapper .page-item.active .page-link {
  background: var(--brand);
  border-color: var(--brand);
}

.dataTables_wrapper .page-link {
  color: #264a95;
}

.asistencia-filter-card {
  border: 1px solid #dbe6fb;
  border-radius: 1rem;
  padding: 0.8rem;
  background:
    radial-gradient(circle at 100% 0%, rgba(112, 184, 255, 0.2) 0%, rgba(112, 184, 255, 0.04) 38%, rgba(112, 184, 255, 0) 68%),
    linear-gradient(145deg, #f7fbff 0%, #f4f9f7 100%);
  box-shadow: 0 10px 24px rgba(23, 71, 146, 0.08);
}

.asistencia-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(200px, 1fr)) auto;
  gap: 0.75rem;
  align-items: end;
}

.asistencia-filter-field {
  min-width: 0;
}

.asistencia-filter-label {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #33507e;
}

.asistencia-filter-input {
  border-radius: 0.72rem;
  border: 1px solid #cddbf1;
  background: #ffffff;
  color: #1f2a44;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.asistencia-filter-input:focus {
  border-color: #7ea6e8;
  box-shadow: 0 0 0 0.18rem rgba(60, 120, 210, 0.16);
}

.asistencia-filter-actions {
  flex-wrap: wrap;
}

.asistencia-filter-btn-primary {
  border: 0;
  border-radius: 0.72rem;
  background: linear-gradient(135deg, #2c5fb7 0%, #2b8fb3 100%);
  color: #fff;
  font-weight: 700;
  padding-inline: 1rem;
  box-shadow: 0 8px 18px rgba(34, 98, 175, 0.22);
}

.asistencia-filter-btn-primary:hover,
.asistencia-filter-btn-primary:focus {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 11px 22px rgba(34, 98, 175, 0.28);
}

.asistencia-filter-btn-secondary {
  border-radius: 0.72rem;
  border: 1px solid #c8d7ee;
  background: #fff;
  color: #36507e;
  font-weight: 700;
  padding-inline: 0.95rem;
}

.asistencia-filter-btn-secondary:hover,
.asistencia-filter-btn-secondary:focus {
  border-color: #adc2e6;
  background: #f2f7ff;
  color: #2d456f;
}

.asistencia-filter-meta {
  margin-top: 0.55rem;
}

.asistencia-filter-status {
  color: #4f6589;
  font-size: 0.79rem;
  font-weight: 600;
}

.asistencia-filter-status.is-success {
  color: #1b7a4f;
}

.asistencia-filter-status.is-error {
  color: #b33d3d;
}

.reveal-up {
  animation: riseIn 0.5s ease both;
}

.reveal-up.delay-1 {
  animation-delay: 0.08s;
}

.reveal-up.delay-2 {
  animation-delay: 0.16s;
}

.reveal-up.delay-3 {
  animation-delay: 0.24s;
}

.employee-form-layout {
  border: 1px solid #d7deed;
  border-radius: 0.9rem;
  overflow: hidden;
  background: #fbfcff;
}

.employee-form-section {
  border-top: 1px solid #d7deed;
  padding: 1rem;
  background: #fff;
}

.employee-form-section:first-child {
  border-top: 0;
}

.employee-section-title {
  margin: -1rem -1rem 1rem;
  padding: 0.7rem 1rem;
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 800;
  color: #2f497d;
  background: linear-gradient(90deg, #f3f7ff 0%, #eef6ff 100%);
  border-bottom: 1px solid #d7deed;
}

#modalEmpleado .modal-body {
  background: #f6f8fd;
}

#modalEmpleado .form-label {
  font-weight: 700;
  color: #3a4f77;
  margin-bottom: 0.35rem;
}

#modalEmpleado .form-control,
#modalEmpleado .form-select {
  border-radius: 0.65rem;
  border-color: #ccd7ec;
}

#modalEmpleado .modal-title {
  font-family: "Sora", sans-serif;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.login-page {
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.52), rgba(0, 0, 0, 0.52)),
    url("https://images.unsplash.com/photo-1552664730-d307ca884978?auto=format&fit=crop&w=1800&q=80");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.login-card {
  max-width: 460px;
  border: 1px solid #dce6f6;
  border-radius: 1.1rem;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  box-shadow: 0 20px 44px rgba(24, 49, 103, 0.16);
}

.login-floating .form-control {
  border-radius: 0.75rem;
  border: 1px solid #c9d7ef;
  background: #fbfdff;
  height: calc(3.5rem + 2px);
  padding-right: 3rem;
}

.login-floating .form-control:focus {
  border-color: #6a90da;
  box-shadow: 0 0 0 0.2rem rgba(63, 103, 186, 0.16);
}

.login-floating > label {
  color: #5a6c8d;
  font-weight: 600;
}

.login-submit {
  border-radius: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.login-pass-wrap {
  position: relative;
}

.login-pass-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  color: #5a6c8d;
  text-decoration: none;
  padding: 0.15rem 0.25rem;
  line-height: 1;
}

.login-pass-toggle:hover,
.login-pass-toggle:focus {
  color: #1f4d99;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1199.98px) {
  .hero-badge-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .department-wrap {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .department-legend {
    width: 100%;
  }
}

@media (max-width: 991.98px) {
  .left-panel {
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 767.98px) {
  .hero-panel .display-6 {
    font-size: 1.8rem;
  }

  .hero-badge-stack {
    grid-template-columns: 1fr;
  }

  .table-clean > :not(caption) > * > * {
    font-size: 0.83rem;
    white-space: nowrap;
  }

  .topbar-date {
    width: 100%;
  }

  .date-filter-wrap .btn {
    flex: 1;
  }

  .trend-values {
    font-size: 0.74rem;
  }

  .trend-days {
    font-size: 0.73rem;
  }

  .login-card {
    padding: 1.25rem !important;
  }

  .asistencia-filter-grid {
    grid-template-columns: 1fr;
  }

  .asistencia-filter-actions {
    width: 100%;
  }

  .asistencia-filter-actions .btn {
    flex: 1;
  }
}
