
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800;900&display=swap');

:root {
  --ink: #202b3d;
  --muted: #718095;
  --blue: #2863ec;
  --line: #e2e7ef;
  --green: #079c75;
  --shadow: 0 12px 30px rgba(25, 45, 75, .10);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-family: Nunito, Arial, sans-serif;
}

button, input, select, textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

a {
  text-decoration: none;
  color: inherit;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid #8db6ff;
  outline-offset: 3px;
}

.container {
  width: min(1100px, calc(100% - 32px));
  margin-inline: auto;
}

/* HEADER */

.topbar {
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 2px 9px #24385412;
}

.nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 70px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #16429f;
  min-width: 0;
}

.brand-logo {
  display: block;
  object-fit: contain;
  width: 45px;
  height: 45px;
  border-radius: 8px;
  flex-shrink: 0;
}

.brand strong,
.brand small {
  display: block;
  white-space: nowrap;
}

.brand strong {
  font-size: 20px;
  line-height: 1.2;
  font-weight: 900;
}

.brand small {
  font-size: 11px;
  color: #326aef;
  font-weight: 900;
  letter-spacing: .5px;
}

nav {
  display: flex;
  gap: 6px;
}

.nav-link {
  border-radius: 11px;
  padding: 11px 14px;
  font-size: 13px;
  color: #647088;
  font-weight: 900;
}

.nav-link:hover,
.nav-link.active {
  background: #eaf1ff;
  color: var(--blue);
}

/* INICIO */

.patterned {
  min-height: calc(100vh - 135px);
  background-color: #fbfdff;
  background-image: radial-gradient(
    #dce8fa 1px,
    transparent 1px
  );
  background-size: 20px 20px;
  padding: 28px 44px 60px;
}

.intro {
  text-align: center;
}

.hero-banner {
  display: block;
  width: 100%;
  max-width: 860px;
  height: auto;
  margin: 0 auto 28px;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(22, 66, 159, .16);
}

.eyebrow {
  font-size: 11px;
  color: #3066c8;
  font-weight: 900;
  letter-spacing: 1.5px;
  margin: 0 0 6px;
}

h1 {
  font-size: clamp(27px, 3.9vw, 46px);
  margin: 8px 0 11px;
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1.16;
}

h1 span {
  color: var(--blue);
}

.intro > p:not(.eyebrow):not(.note) {
  font-size: 17px;
  color: #576276;
  max-width: 660px;
  margin: 0 auto;
  line-height: 1.55;
}

.levels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin: 28px 0 0;
}

.level {
  position: relative;
  border: 0;
  border-radius: 24px;
  color: white;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 22px #263f6c20;
  transition: transform .2s, box-shadow .2s;
}

.level:hover:not(:disabled) {
  transform: translateY(-4px);
  box-shadow: 0 17px 28px #263f6c33;
}

.level-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1994 / 788;
  object-fit: contain;
  object-position: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.availability {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #1ac968;
  border-radius: 22px;
  padding: 5px 17px;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 2px 8px #00000033;
}

.violet {
  background: linear-gradient(110deg, #9050f5, #bb29de);
}

.rose {
  background: linear-gradient(110deg, #ee4196, #fb3a66);
}

.cyan {
  background: linear-gradient(110deg, #09afcb, #2864ec);
}

.amber {
  background: linear-gradient(110deg, #ff983c, #e77d08);
}

.note {
  text-align: center;
  color: #8b97a8;
  font-size: 12px;
  margin: 22px auto;
  max-width: 660px;
}

.footer {
  text-align: center;
  color: #99a3b1;
  padding: 22px 12px;
  font-size: 12px;
}

/* BOTONES */

.btn {
  border: none;
  color: #fff;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 21px;
  min-height: 47px;
  font-weight: 900;
  gap: 8px;
  transition: filter .2s, transform .2s;
}

.btn:hover {
  filter: brightness(.96);
  transform: translateY(-1px);
}

.btn.blue {
  background: var(--blue);
}

.btn.green {
  background: var(--green);
}

.btn.purple {
  background: #8749f0;
}

.btn.outline {
  background: white;
  border: 1px solid #dbe3ee;
  color: #345fbc;
}

.btn.danger {
  background: #fff2f3;
  border: 1px solid #ffb5bc;
  color: #df2e40;
}

.btn.full {
  width: 100%;
}

.small-btn {
  font-size: 12px;
  min-height: 40px;
}

/* FORMULARIO DE INSCRIPCIÓN */

.content-card {
  padding: 29px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow);
}

.narrow {
  max-width: 725px;
  margin: 18px auto;
}

.centered {
  text-align: center;
}

.muted {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.content-card h2 {
  font-size: 26px;
  margin: 6px 0 5px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
  margin-top: 24px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.form-grid label,
.stack-form label,
.field,
.filters label,
.setting-fields label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-weight: 800;
  color: #4b566a;
  font-size: 13px;
}

input:not([type=checkbox]),
select,
textarea {
  width: 100%;
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid #d5dce6;
  background: #fff;
  color: #28374e;
  border-radius: 10px;
  outline: none;
  font-size: 15px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #4285f4;
  box-shadow: 0 0 0 3px #4285f421;
}

input[readonly] {
  background: #f2f5fa;
  color: #617087;
}

.check-line {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 700;
}

.check-line input {
  accent-color: var(--blue);
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.link-button {
  border: 0;
  background: none;
  color: #5c6b83;
  font-size: 13px;
  font-weight: 900;
  padding: 10px;
}

.link-button:hover {
  text-decoration: underline;
}

/* VENTANAS EMERGENTES */

.dialog {
  border: 0;
  border-radius: 23px;
  background: white;
  box-shadow: 0 22px 65px #0003;
  padding: 0;
  max-width: calc(100vw - 28px);
  width: 510px;
  overflow: hidden;
  color: var(--ink);
}

.dialog::backdrop {
  background: #2229;
  backdrop-filter: blur(4px);
}

.dialog-head {
  padding: 24px;
  color: white;
  text-align: center;
}

.dialog-head h2 {
  margin: 0;
  font-size: 23px;
}

.dialog-head p {
  margin: 3px 0 0;
}

.steps-body {
  padding: 28px 32px 20px;
}

.step {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 22px;
}

.step > b {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #e0edff;
  color: var(--blue);
  font-size: 17px;
  flex-shrink: 0;
}

.step strong {
  font-size: 15px;
}

.step p {
  margin: 1px 0;
  color: #758094;
  font-size: 13px;
  line-height: 1.4;
}

.dialog-actions {
  background: #f8f9fb;
  padding: 18px 24px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}

.validation-dialog {
  width: 450px;
  padding: 30px;
  position: relative;
}

.validation-dialog h2 {
  text-align: center;
  font-size: 23px;
  margin: 4px 0 26px;
}

.close {
  position: absolute;
  right: 17px;
  top: 10px;
  background: transparent;
  border: 0;
  color: #9ba5b4;
  font-size: 29px;
}

.stack-form {
  display: grid;
  gap: 15px;
}

.tiny {
  font-size: 11px;
  color: #9da5b2;
  line-height: 1.5;
  text-align: center;
  margin: 13px 0 0;
}

.error {
  color: #d4334c;
  font-weight: 800;
  font-size: 12px;
  margin: 0;
}

.success-circle {
  border-radius: 50%;
  width: 67px;
  height: 67px;
  background: #dbf8e7;
  color: #0b9b6a;
  display: grid;
  place-items: center;
  margin: 3px auto;
  font-size: 42px;
}

.content-card.centered .btn {
  margin: 10px 5px;
}

/* INICIO DE SESIÓN Y ASISTENCIA */

.mint-body {
  background: #ebfff6;
}

.attendance-main {
  padding: 52px 0;
  min-height: calc(100vh - 150px);
}

.login-card {
  width: min(100%, 475px);
  margin: 20px auto;
  background: white;
  border-radius: 20px;
  box-shadow: 0 17px 27px #202b3d1c;
  padding: 38px 40px;
  text-align: center;
}

.login-card h1 {
  font-size: 24px;
  letter-spacing: 0;
}

.login-card .stack-form {
  margin-top: 27px;
}

.login-card input {
  height: 60px;
  font-size: 18px;
}

.login-card .btn {
  min-height: 58px;
  font-size: 17px;
}

.text-link {
  display: inline-block;
  color: #67758a;
  margin-top: 21px;
}

.lock-icon {
  color: #2d64e8;
  background: #eaf1ff;
  border-radius: 16px;
  font-size: 28px;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin: auto;
}

.attendance-panel {
  background: white;
  max-width: 840px;
  margin: auto;
  border-radius: 27px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.attendance-heading {
  background: #069e79;
  color: white;
  padding: 24px 31px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.attendance-heading h1 {
  font-size: 23px;
  margin: 0;
  letter-spacing: 0;
}

.attendance-heading button {
  border: 0;
  background: #ffffff35;
  color: white;
  border-radius: 7px;
  padding: 11px 15px;
  font-weight: 800;
}

.attendance-content {
  padding: 30px 38px;
}

.search-row {
  display: flex;
  gap: 10px;
}

.search-row input {
  text-align: center;
  letter-spacing: 1px;
  flex: 1;
  font-size: 19px;
  font-weight: 800;
}

.search-row .btn {
  font-size: 16px;
}

.helper {
  margin-top: 18px;
  text-align: center;
}

.event-form {
  max-width: 650px;
  margin: 25px auto 0;
}

.student-highlight {
  border-radius: 13px;
  padding: 17px;
  background: #eff5ff;
  border: 1px solid #d4e4ff;
  color: #2755be;
  margin-bottom: 22px;
}

.student-highlight strong,
.student-highlight span {
  display: block;
}

.student-highlight span {
  font-size: 12px;
  margin-top: 4px;
}

.field {
  margin: 20px 0;
}

.subheading {
  font-size: 16px;
  margin: 20px 0 13px;
}

.attendee-options {
  display: grid;
  gap: 11px;
}

.person {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #dde4ed;
  padding: 13px;
  border-radius: 12px;
  cursor: pointer;
}

.person:hover {
  background: #f8fbff;
}

.person input {
  width: 20px;
  height: 20px;
  accent-color: var(--green);
}

.person strong {
  display: block;
  font-size: 15px;
}

.person small {
  display: block;
  color: #778399;
  font-size: 11px;
  margin-top: 2px;
}

/* PANEL ADMINISTRATIVO */

.admin-body {
  background: #f7f9fc;
}

.admin-main {
  padding: 34px 0;
  min-height: calc(100vh - 150px);
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 0 19px;
}

.dashboard-header h1 {
  font-size: 25px;
  margin: 0;
}

.logout {
  border: 0;
  background: transparent;
  color: #e02c37;
  font-weight: 800;
  font-size: 13px;
}

.tabs {
  display: flex;
  gap: 16px;
  border-bottom: 1px solid #e0e5ec;
  margin-bottom: 30px;
}

.tab {
  background: transparent;
  border: 0;
  border-bottom: 4px solid transparent;
  color: #6e798b;
  padding: 14px 17px;
  font-weight: 900;
  font-size: 13px;
}

.tab.active {
  border-color: #2965ed;
  color: #2965ed;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
}

.level-stat {
  background: white;
  border: 1px solid #edf0f4;
  padding: 18px 14px;
  border-radius: 15px;
  box-shadow: 0 2px 5px #192d4b0c;
}

.stat-top {
  display: flex;
  justify-content: space-between;
  gap: 9px;
  color: #69768b;
  font-size: 12px;
}

.track {
  height: 10px;
  border-radius: 20px;
  background: #dce5f2;
  margin-top: 9px;
  overflow: hidden;
}

.fill {
  height: 100%;
  border-radius: 20px;
  background: #2c64ed;
}

.totals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 20px 0;
}

.totals article {
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
}

.totals small,
.totals strong {
  display: block;
}

.totals small {
  color: #8996a8;
  font-weight: 800;
}

.totals strong {
  font-size: 32px;
}

.section-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 23px;
  margin: 21px 0;
  box-shadow: 0 3px 9px #283a5512;
}

.section-card h2 {
  font-size: 20px;
  margin: 0 0 12px;
}

.card-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.filters {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 13px;
  margin: 20px 0;
}

.filters label {
  font-size: 12px;
}

.filters input,
.filters select {
  font-size: 13px;
}

.table-wrap {
  overflow: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 690px;
  font-size: 12px;
}

th, td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid #e8edf3;
  white-space: nowrap;
}

th {
  background: #f7f9fd;
  color: #728096;
}

td {
  color: #41516a;
}

.empty {
  color: #8c97a9;
  text-align: center;
  padding: 25px;
  font-size: 13px;
}

/* REPORTES */

.report-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.report-card {
  text-align: left;
  border: 1px solid #e8edf2;
  border-radius: 19px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  background: white;
  padding: 24px;
  min-height: 190px;
  box-shadow: 0 2px 3px #182b4010;
}

.report-card:hover {
  border-color: #95b6ff;
  transform: translateY(-2px);
}

.report-card strong {
  font-size: 14px;
}

.report-card small {
  color: #8591a1;
  font-size: 12px;
  line-height: 1.4;
}

.report-icon {
  width: 49px;
  height: 49px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 25px;
}

.pale-blue {
  background: #e3edff;
  color: #2b67eb;
}

.pale-green {
  background: #dbfae7;
  color: #17a959;
}

.pale-purple {
  background: #f1e0ff;
  color: #9b40ed;
}

.pale-mint {
  background: #d2f8e9;
  color: #069f70;
}

/* CONFIGURACIÓN */

.settings-card {
  max-width: 750px;
}

.setting-row {
  border-radius: 14px;
  padding: 15px 17px;
  margin: 14px 0;
  background: #f1ecff;
}

.setting-row.rose {
  background: #fde9f4;
}

.setting-row.cyan {
  background: #d8f9fd;
}

.setting-row.amber {
  background: #fff0d9;
}

.setting-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.setting-label strong {
  font-size: 15px;
}

.setting-fields {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 14px;
  margin-top: 15px;
}

.setting-fields label {
  font-size: 12px;
}

.setting-fields input {
  font-size: 13px;
  background: #fff;
}

.danger-zone {
  border-top: 1px solid #e5e8ef;
  margin-top: 36px;
  padding: 19px 0;
}

.danger-zone h3 {
  color: #ef3245;
  font-size: 14px;
}

.danger-zone p {
  color: #8894a7;
  font-size: 12px;
}

/* NOTIFICACIONES */

.toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  max-width: calc(100% - 44px);
  padding: 14px 18px;
  border-radius: 12px;
  background: #106949;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  opacity: 0;
  transform: translateY(15px);
  transition: .2s;
  pointer-events: none;
  z-index: 100;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  background: #b72f45;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* TABLETS */

@media (max-width: 800px) {
  .brand strong {
    font-size: 15px;
  }

  .brand small {
    font-size: 9px;
  }

  .nav-link {
    font-size: 11px;
    padding: 9px;
  }

  .patterned {
    padding: 22px 18px 40px;
  }

  .stats-grid,
  .report-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .filters {
    grid-template-columns: 1fr 1fr;
  }

  .setting-fields {
    grid-template-columns: 1fr;
  }
}

/* CELULARES */

@media (max-width: 570px) {
  .container {
    width: calc(100% - 22px);
  }

  .nav-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 9px 0;
  }

  .brand-logo {
    width: 36px;
    height: 36px;
  }

  .brand strong {
    font-size: 16px;
  }

  .brand small {
    font-size: 9px;
  }

  nav {
    width: 100%;
    justify-content: center;
    gap: 1px;
  }

  .nav-link {
    padding: 8px 13px;
  }

  .patterned {
    padding: 20px 12px 32px;
  }

  .hero-banner {
    margin-bottom: 20px;
    border-radius: 12px;
  }

  .intro > p:not(.eyebrow):not(.note) {
    font-size: 14px;
  }

  .levels {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .level {
    padding: 0;
  }

  .level-image {
    width: 100%;
    height: auto;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .full {
    grid-column: 1;
  }

  .content-card {
    padding: 19px;
  }

  .dialog {
    width: calc(100% - 22px);
  }

  .steps-body {
    padding: 23px;
  }

  .validation-dialog {
    padding: 23px;
  }

  .login-card {
    padding: 28px 22px;
  }

  .attendance-main,
  .admin-main {
    padding: 23px 0;
  }

  .attendance-heading {
    padding: 20px 18px;
  }

  .attendance-heading h1 {
    font-size: 17px;
  }

  .attendance-content {
    padding: 24px 16px;
  }

  .search-row {
    flex-direction: column;
  }

  .search-row input {
    height: 56px;
  }

  .stats-grid {
    gap: 9px;
  }

  .stat-top {
    font-size: 10px;
  }

  .totals {
    gap: 8px;
  }

  .totals article {
    padding: 13px;
  }

  .totals strong {
    font-size: 24px;
  }

  .totals small {
    font-size: 10px;
  }

  .report-grid {
    gap: 10px;
  }

  .report-card {
    padding: 15px;
    min-height: 180px;
  }

  .tab {
    font-size: 11px;
    padding: 12px 8px;
  }

  .tabs {
    gap: 3px;
  }

  .section-card {
    padding: 16px;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .card-heading {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-header h1 {
    font-size: 21px;
  }

  .setting-label {
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* Integración PHP/MariaDB: filtros dinámicos y estados de vacantes */
.filters{grid-template-columns:minmax(170px,2fr) repeat(3,minmax(130px,1fr));}
.pagination{display:flex;align-items:center;justify-content:center;gap:12px;flex-wrap:wrap;margin-top:20px;color:#68778d;font-size:12px;font-weight:800;}
.pagination button{min-height:38px;padding:8px 14px;}
.level .availability{z-index:3;top:10px;right:10px;}
.level:disabled .level-image{filter:grayscale(.7) brightness(.72);}
.level:disabled .availability{background:#778396;}
#connectionError{max-width:750px;margin:20px auto;padding:16px;border:1px solid #f2a1aa;background:#fff1f3;border-radius:12px;}
@media(max-width:850px){.filters{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:570px){.filters{grid-template-columns:1fr;}}
