:root {
  --ink: #17201b;
  --muted: #6f7772;
  --paper: #fbfaf6;
  --card: rgba(255, 255, 255, 0.78);
  --line: rgba(23, 32, 27, 0.12);
  --soft-line: rgba(23, 32, 27, 0.07);
  --sage: #dce7d8;
  --sage-strong: #779472;
  --gold: #c79a48;
  --gold-soft: #f2dfb8;
  --rose: #ecd9cf;
  --shadow: 0 24px 60px rgba(33, 42, 35, 0.13);
  --radius-lg: 34px;
  --radius-md: 24px;
  --radius-sm: 16px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  color-scheme: light;
  font-family: Manrope, sans-serif;
  background:
    radial-gradient(circle at 10% 0%, rgba(236, 217, 207, 0.9), transparent 32rem),
    radial-gradient(circle at 92% 10%, rgba(220, 231, 216, 0.95), transparent 35rem),
    linear-gradient(135deg, #fbfaf6 0%, #f5f2e8 52%, #eef4eb 100%);
  min-height: 100%;
}

body {
  color: var(--ink);
  margin: 0;
  min-height: 100vh;
}

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

button {
  cursor: pointer;
}

.shell {
  margin: 0 auto;
  max-width: 1280px;
  padding: 28px clamp(16px, 4vw, 48px) 56px;
}

.hero {
  align-items: stretch;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) 280px;
  margin-bottom: 22px;
}

.hero__copy,
.summary-card,
.toolbar,
.student-card,
.table-panel,
.program-pill,
.empty-state {
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow);
}

.hero__copy {
  border-radius: var(--radius-lg);
  overflow: hidden;
  padding: clamp(28px, 5vw, 54px);
  position: relative;
}

.hero__copy::after {
  background:
    linear-gradient(90deg, rgba(119, 148, 114, 0.2), transparent),
    repeating-linear-gradient(
      135deg,
      rgba(23, 32, 27, 0.035) 0 1px,
      transparent 1px 16px
    );
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.hero__copy > * {
  position: relative;
  z-index: 1;
}

.eyebrow {
  color: var(--sage-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  margin: 0 0 12px;
  text-transform: uppercase;
}

h1 {
  font-family: Newsreader, serif;
  font-size: clamp(2.45rem, 7vw, 5.6rem);
  font-weight: 650;
  letter-spacing: -0.065em;
  line-height: 0.9;
  margin: 0;
  max-width: 820px;
}

.hero__text {
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.65;
  margin: 22px 0 0;
  max-width: 640px;
}

.summary-card {
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  justify-content: end;
  min-height: 260px;
  padding: 26px;
}

.summary-card__number {
  font-family: Newsreader, serif;
  font-size: 5.8rem;
  letter-spacing: -0.08em;
  line-height: 0.8;
}

.summary-card__label {
  color: var(--ink);
  font-weight: 800;
  margin-top: 14px;
}

.summary-card__hint {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 8px;
}

.toolbar {
  align-items: end;
  border-radius: var(--radius-md);
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(220px, 1fr) minmax(190px, 280px) auto auto;
  margin-bottom: 18px;
  padding: 14px;
}

.search-box,
.filter-box,
.field {
  display: grid;
  gap: 7px;
}

.search-box span,
.filter-box span,
.field span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

input,
select,
textarea {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
  width: 100%;
}

input,
select {
  min-height: 50px;
  padding: 0 15px;
}

textarea {
  line-height: 1.5;
  min-height: 116px;
  padding: 13px 15px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  background: #ffffff;
  border-color: rgba(119, 148, 114, 0.75);
  box-shadow: 0 0 0 4px rgba(119, 148, 114, 0.14);
}

.ghost-button {
  align-items: center;
  background: var(--ink);
  border: 0;
  border-radius: var(--radius-sm);
  color: #fffdf8;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 50px;
  padding: 0 18px;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.ghost-button:hover {
  box-shadow: 0 12px 26px rgba(23, 32, 27, 0.18);
  transform: translateY(-1px);
}

.view-switch {
  background: rgba(23, 32, 27, 0.07);
  border: 1px solid var(--soft-line);
  border-radius: var(--radius-sm);
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 50px;
  padding: 4px;
}

.view-switch__button {
  background: transparent;
  border: 0;
  border-radius: 13px;
  color: var(--muted);
  font-weight: 900;
  padding: 0 14px;
  transition: background 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.view-switch__button.is-active {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 20px rgba(23, 32, 27, 0.1);
  color: var(--ink);
}

.program-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 20px;
}

.program-pill {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  gap: 10px;
  padding: 10px 14px;
}

.program-pill strong {
  background: var(--gold-soft);
  border-radius: 999px;
  color: #684a15;
  min-width: 32px;
  padding: 4px 8px;
  text-align: center;
}

.program-pill span {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.student-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.table-panel {
  border-radius: var(--radius-md);
  margin-top: 18px;
  overflow: hidden;
}

.table-scroll {
  overflow-x: auto;
}

.students-table {
  border-collapse: collapse;
  min-width: 1040px;
  width: 100%;
}

.students-table th,
.students-table td {
  border-bottom: 1px solid var(--soft-line);
  padding: 14px;
  text-align: left;
  vertical-align: top;
}

.students-table th {
  background: rgba(251, 250, 246, 0.82);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  position: sticky;
  text-transform: uppercase;
  top: 0;
  z-index: 2;
}

.students-table tbody tr {
  transition: background 160ms ease;
}

.students-table tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.38);
}

.students-table tbody tr:nth-child(even) {
  background: rgba(220, 231, 216, 0.32);
}

.students-table tbody tr:hover {
  background: rgba(242, 223, 184, 0.34);
}

.students-table tbody tr:focus-within {
  background: rgba(242, 223, 184, 0.52);
  box-shadow: inset 5px 0 0 var(--gold);
}

.students-table td:nth-child(1) {
  width: 142px;
}

.students-table td:nth-child(2) {
  width: 300px;
}

.students-table td:nth-child(3) {
  width: 230px;
}

.students-table td:nth-child(4) {
  width: 150px;
}

.table-input,
.table-notes {
  border-radius: 14px;
}

.table-name {
  line-height: 1.35;
  min-height: 58px;
  overflow-wrap: anywhere;
  resize: vertical;
  white-space: normal;
}

.table-notes {
  min-height: 72px;
}

.program-badge {
  background: rgba(220, 231, 216, 0.82);
  border: 1px solid rgba(119, 148, 114, 0.18);
  border-radius: 999px;
  color: var(--sage-strong);
  display: inline-flex;
  font-size: 0.86rem;
  font-weight: 900;
  line-height: 1.25;
  padding: 9px 12px;
}

.program-badge--teologia {
  background: rgba(207, 235, 214, 0.95);
  border-color: rgba(54, 133, 82, 0.24);
  color: #28613e;
}

.program-badge--liderazgo {
  background: rgba(211, 229, 252, 0.95);
  border-color: rgba(55, 111, 190, 0.24);
  color: #28548f;
}

.program-badge--tsu {
  background: rgba(255, 236, 166, 0.95);
  border-color: rgba(190, 145, 28, 0.26);
  color: #75520a;
}

.program-badge--extension {
  background: rgba(255, 219, 185, 0.96);
  border-color: rgba(210, 111, 36, 0.26);
  color: #8b4616;
}

.student-card {
  animation: rise 420ms ease both;
  border-radius: var(--radius-md);
  display: grid;
  gap: 16px;
  min-width: 0;
  overflow: hidden;
  padding: 14px;
}

.photo-dropzone {
  align-items: center;
  aspect-ratio: 16 / 11;
  background:
    linear-gradient(145deg, rgba(220, 231, 216, 0.88), rgba(242, 223, 184, 0.58)),
    repeating-linear-gradient(
      135deg,
      rgba(23, 32, 27, 0.05) 0 1px,
      transparent 1px 14px
    );
  border: 1px dashed rgba(23, 32, 27, 0.2);
  border-radius: 22px;
  display: flex;
  justify-content: center;
  overflow: hidden;
  position: relative;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.table-photo {
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  min-height: 104px;
  width: 104px;
}

.table-photo .photo-placeholder {
  gap: 3px;
  padding: 8px;
}

.table-photo .photo-placeholder__icon {
  font-size: 1.15rem;
  height: 34px;
  width: 34px;
}

.table-photo .photo-placeholder__title {
  font-size: 0.82rem;
}

.table-photo .photo-placeholder__text {
  font-size: 0.72rem;
}

.table-photo .remove-photo {
  bottom: 7px;
  font-size: 0.68rem;
  padding: 5px 8px;
  right: 7px;
}

.photo-dropzone:hover,
.photo-dropzone:focus-visible,
.photo-dropzone.is-dragging {
  border-color: rgba(119, 148, 114, 0.95);
  box-shadow: inset 0 0 0 4px rgba(119, 148, 114, 0.13);
  outline: none;
}

.photo-dropzone.is-dragging {
  transform: scale(0.985);
}

.photo-preview {
  height: 100%;
  inset: 0;
  object-fit: cover;
  position: absolute;
  width: 100%;
}

.photo-placeholder {
  align-items: center;
  color: rgba(23, 32, 27, 0.68);
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: 18px;
  text-align: center;
}

.photo-placeholder__icon {
  align-items: center;
  background: rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  display: inline-flex;
  font-size: 1.8rem;
  font-weight: 500;
  height: 54px;
  justify-content: center;
  width: 54px;
}

.photo-placeholder__title {
  color: var(--ink);
  font-weight: 900;
}

.photo-placeholder__text {
  font-size: 0.9rem;
}

.remove-photo {
  background: rgba(255, 255, 255, 0.9);
  border: 0;
  border-radius: 999px;
  bottom: 12px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
  padding: 8px 12px;
  position: absolute;
  right: 12px;
}

.student-card__content {
  display: grid;
  gap: 14px;
}

.student-card__header {
  border-bottom: 1px solid var(--soft-line);
  min-height: 100px;
  padding: 0 4px 14px;
}

.student-card h2 {
  font-size: 1.16rem;
  letter-spacing: -0.035em;
  line-height: 1.2;
  margin: 0;
}

.student-card p {
  color: var(--sage-strong);
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.35;
  margin: 10px 0 0;
}

.empty-state {
  border-radius: var(--radius-md);
  color: var(--muted);
  display: grid;
  gap: 14px;
  justify-items: start;
  margin-top: 18px;
  padding: 28px;
}

.empty-state p {
  margin: 0;
}

.sr-only {
  height: 1px;
  margin: -1px;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .hero,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .summary-card {
    min-height: 180px;
  }

  .student-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .view-switch {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .shell {
    padding-bottom: 36px;
  }

  .hero__copy,
  .summary-card {
    border-radius: 28px;
  }

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

  .student-card__header {
    min-height: auto;
  }

  .toolbar {
    align-items: stretch;
  }

  .ghost-button {
    width: 100%;
  }

  .table-panel {
    border-radius: 22px;
  }
}
