:root {
  --forest:#244c72;
  --teal: #306090;
  --paper: #f3f6fb;
  --white: #ffffff;
  --ink: #1c2d3d;
  --muted: #5d6d7c;
  --line: #d9e3f0;
  --pale-teal: #ebf4ff;
  --pale-blue: #edf5ff;
  --coral: #d97752;
  --yellow: #9ed9ff;
  --shadow: 0 10px 28px rgba(13, 59, 115, 0.08);
  --radius: 12px;
}

* {
  box-sizing: border-box;
}
html {
  min-width: 320px;
  scrollbar-color: #bfd1e3 transparent;
}
body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family:
    "DM Sans",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  -webkit-font-smoothing: antialiased;
}
button {
  font: inherit;
  cursor: pointer;
}
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}
.hidden {
  display: none !important;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px clamp(20px, 5vw, 72px);
  color: white;
  background: var(--forest);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(10px);
}
.brand,
.header-button {
  border: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0;
  color: white;
  background: transparent;
  text-align: left;
}
.brand:hover {
  opacity: 0.82;
}
.brand-mark {
  display: grid;
  width: 200px;
  height: 50px;
  place-items: center;
  color: #edf5ff;
  font-family: "Space Grotesk", sans-serif;
  font-size: 18px;
  font-weight: 700;
}
.brand-icon {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.brand strong,
.brand small {
  display: block;
}
.brand strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 18px;
  letter-spacing: 0.02em;
}
.brand small {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 11px;
}



.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}
#currentSection {
  max-width: 360px;
  overflow: hidden;
  color: white;
  font-family: "Space Grotesk", sans-serif;
  font-size: 18px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-indicator {
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  color: #244c72;
  background: #c9f0dd;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.header-button {
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  color: #24405a;
  background: linear-gradient(135deg, #f7fafc, #edf7f6);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
  font-size: 13px;
  font-weight: 700;
  transition: all 0.2s ease;
}
.header-button:hover {
  background: linear-gradient(135deg, #eef5ff, #edfdf8);
  border-color: rgba(143, 176, 255, 0.5);
  transform: translateY(-1px);
}

.workspace {
  min-height: calc(100vh - 130px);
}
.group-selection-screen {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 130px);
  padding: 32px 24px;
  background: #6c829c;
}
.group-selection-content {
  width: min(900px, 95vw);

  padding: 40px;

  background: rgba(13, 59, 115, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);

  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;

  box-shadow:
    0 25px 50px rgba(0, 0, 0, 0.35),
    0 10px 20px rgba(0, 0, 0, 0.2);
}

.group-selection-eyebrow {
  margin: 0 0 10px;
  color: var(--yellow);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.group-selection-content h1 {
  max-width: 600px;
  margin: 0 0 28px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.08;
  color: white;
}
.group-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.group-options-main,
.group-options-aside {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.group-options-divider {
  width: 100%;
  height: 1px;
  margin: 6px 0;
  background: rgba(255, 255, 255, 0.28);
}
.group-options-aside .group-option {
  grid-column: 1;
}
.group-option {
  min-height: 80px;
  padding: 18px 20px;

  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;

  background: rgba(255, 255, 255, 0.08);
  color: white;

  font: inherit;
  font-weight: 700;
  text-align: left;

  transition: all 0.2s ease;
}
.group-option:hover,
.group-option:focus-visible {
  transform: translateY(-3px);

  background: linear-gradient(135deg, var(--teal), var(--forest));

  border-color: transparent;

  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}
.form-title {
  margin: 8px 14px 18px;
  padding: 14px 18px;
  border-left: 5px solid var(--teal);
  border-radius: 8px;
  color: var(--forest);
  background: linear-gradient(90deg, var(--pale-teal), var(--white));
  box-shadow: 0 5px 14px rgba(13, 94, 166, 0.08);
  font-family: "Space Grotesk", sans-serif;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
}
.workspace-layout {
  display: flex;
  align-items: flex-start;
  gap: 20px;

  min-height: calc(100vh - 130px);
  margin: 0;
  padding: 28px 24px;
 background: #6c829c;
}
.contact-footer {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  padding: 12px 20px;
  color: rgba(255, 255, 255, 0.82);
  background: var(--forest);
  font-size: 13px;
  text-align: center;
}
.contact-footer a {
  color: white;
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.contact-footer a:hover {
  color: var(--yellow);
}
.sidebar {
  position: sticky;
  top: 98px;
  width: 270px;
  flex: 0 0 270px;

  padding: 20px;

  background: white;

  border: none;
  border-radius: 20px;

  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}
.sidebar h2 {
  margin: 0 0 12px;
  padding: 12px;

  background: linear-gradient(135deg, var(--forest), var(--teal));
  color: white;

  text-align: center;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);

  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
#formList {
  display: flex;
  flex-direction: column;
  gap: 6px;
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
}

#formList li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;

  padding: 12px 14px;
  border-radius: 14px;

  color: #26384d;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;

  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.55);

  transition:
    background 0.16s,
    transform 0.16s,
    box-shadow 0.16s,
    border-color 0.16s;
}

#formList li span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#formList li:hover {
  background: #f5f9ff;
  border-color: var(--line);
  transform: translateX(6px);
  box-shadow: 0 8px 18px rgba(13, 94, 166, 0.08);
}

#formList li.active {
  color: var(--teal);

  background: linear-gradient(135deg, var(--pale-teal), var(--white));

  border-color: rgba(13, 94, 166, 0.35);

  font-weight: 700;

  box-shadow: 0 8px 18px rgba(13, 94, 166, 0.12);
}

#formList .badge {
  background: var(--teal);
  color: white;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.badge {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  color: white;
  background: var(--coral);
  font-size: 11px;
  font-weight: 700;
}
.secondary-button,
.primary-button,
.btnToggleRow,
.dialog-status-button {
  border-radius: 7px;
  font-weight: 700;
}
.workspace-main {
  min-width: 0;
  flex: 1;
}
#statusBar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-height: 25px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.group-title {
  margin: 0;
  padding: 0 18px;
  color: var(--forest);
  font-family: "Space Grotesk", sans-serif;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
}
#content {
  overflow: hidden;
  padding: 4px;

  background: white;

  border: none;
  border-radius: 20px;

  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);

  animation: enter 0.18s ease-out;
}
.rectifications-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 14px;
}
.rectifications-header .form-title {
  margin: 0;
}
.adminRectificationRow {
  cursor: pointer;
}
.adminRectificationRow:hover {
  background: var(--pale-blue);
}
.rectification-form {
  display: grid;
  gap: 10px;
  max-width: 760px;
  padding: 18px;
}
.rectification-form label {
  color: var(--forest);
  font-weight: 700;
}
.rectification-form input,
.rectification-form select,
.rectification-form textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}
.rectification-form textarea {
  resize: vertical;
}
.table-scroll {
  max-width: 100%;
  max-height: min(65vh, calc(100vh - 180px));
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.empty-state {
  margin: 0;
  padding: 32px 24px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.form-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  text-decoration: none;
  white-space: nowrap;
}
.primary-button {
  padding: 10px 16px;

  border: 1px solid #cfe1ff;
  border-radius: 10px;

  color: #163a5f;

  background: linear-gradient(135deg, #eaf3ff, #dfeeff);

  font-size: 13px;

  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.08);

  transition: all 0.2s ease;
}

.primary-button:hover {
  transform: translateY(-1px);
  border-color: #a9c8ff;
  background: linear-gradient(135deg, #dfeeff, #d9ebff);
}

.secondary-button {
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.08);
  padding: 9px 14px;
  border: 1px solid #cfe1ff;
  color: #163a5f;
  background: linear-gradient(135deg, #eaf3ff, #dfeeff);
  font-size: 13px;
}
.secondary-button:hover {
  border-color: #a9c8ff;
  background: linear-gradient(135deg, #dfeeff, #d9ebff);
  transform: translateY(-1px);
}
.form-link-button {
  border: 1px solid #d8d4ff;
  color: #4338ca;
  background: linear-gradient(135deg, #f8f7ff, #eef4ff);
  box-shadow: 0 3px 8px rgba(99, 102, 241, 0.08);
}
.form-link-button:hover {
  border-color: #a5b4fc;
  background: linear-gradient(135deg, #f2f0ff, #edf6ff);
}
table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  background: white;
  table-layout: auto;
  
}

th,
td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
}
th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);

  background: #f8fafc;

  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
th.sortable {
  cursor: pointer;
}
th.sortable:hover {
  color: var(--forest);
  background: var(--pale-teal);
}
tbody tr {
  cursor: pointer;
  transition: all 0.16s ease;
}
tbody tr:hover {
  background: #f3f6fb;
}
tbody tr.nuevo {
  background: #e3effc;
}

tbody tr:last-child td {
  border-bottom: 0;
}
.btnToggleRow {
  min-width: 106px;

  padding: 7px 10px;

  border: none;
  border-radius: 8px;

  color: var(--forest);

  background: linear-gradient(135deg, var(--pale-teal), var(--white));

  font-size: 11px;

  transition: all 0.2s ease;
}

.btnToggleRow:hover {
  transform: translateY(-1px);
}
.btnToggleRow:hover,
.dialog-status-button:hover {
  background: #d7eaff;
}
.ok,
.error {
  padding: 4px 10px;
  border-radius: 6px;
}
.ok {
  color: #155a96;
  background: #edf5ff;
}
.error {
  color: #bf5b46;
  background: #fff1ef;
  font-weight: 700;
}

#responseDialog {
  width: min(680px, calc(100% - 32px));
  max-height: 78vh;
  padding: 0;
  overflow: hidden;
  border: none;
  border-radius: 24px;
  color: var(--ink);
  background: white;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.18);
}
#responseDialog::backdrop {
  background: rgba(13, 59, 115, 0.52);
  backdrop-filter: blur(3px);
}
#responseDialog[open] {
  animation: dialog-enter 0.18s ease-out;
}
.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #eef5ff, #ffffff);
}
#responseDialogEyebrow {
  margin: 0 0 5px;
  color: var(--forest);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
#responseDialogTitle {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 20px;
}
.dialog-close {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: var(--paper);
  font-size: 24px;
  line-height: 1;
}
.dialog-close:hover {
  background: var(--pale-teal);
  color: var(--ink);
}
#responseDialogContent {
  max-height: calc(78vh - 90px);
  overflow: auto;
  padding: 8px 24px 24px;
}
.dialog-actions {
  display: flex;
  justify-content: flex-start;
}
.dialog-status-button {
  padding: 6px 12px;
  border: 0;
  color: var(--forest);
  background: #e3effc;
  font-size: 12px;
}
.responseField {
  display: grid;
  grid-template-columns: minmax(140px, 0.38fr) 1fr;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.responseField:last-child {
  border-bottom: 0;
}
.responseField dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.responseField dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.55;
}

.btnToggleRow svg {
  width: 18px;
  height: 18px;
}

.btnToggleRow {
  min-width: 42px;
}

.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;

  background:
    linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.45)),
    url("img/CIESOL-1.jpg");

  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.login-card {
  width: min(400px, 90vw);
  padding: 40px 32px;

  background: rgba(13, 59, 115, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);

  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;

  box-shadow:
    0 25px 50px rgba(0, 0, 0, 0.35),
    0 10px 20px rgba(0, 0, 0, 0.2);

  text-align: center;
}

/* Logo */
.login-card::before {
  content: "";
  display: block;

  width: 200px;
  height: 100px;

  margin: 0 auto 24px;

  background-image: url("img/logo-es.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;

  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.25));
}

.login-card h1 {
  margin: 0 0 8px;

  font-family: "Space Grotesk", sans-serif;
  font-size: 26px;
  font-weight: 700;

  color: white;
}

.login-card p.subtitle {
  margin: 0 0 28px;

  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  line-height: 1.5;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;

  margin-bottom: 18px;
  text-align: left;
}

.login-field label {
  color: white;
  font-size: 13px;
  font-weight: 600;
}

.login-field input {
  width: 100%;

  padding: 13px 14px;

  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;

  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);

  font-size: 14px;
  font-family: inherit;

  transition: all 0.2s ease;
}

.login-field input::placeholder {
  color: #6b7280;
}

.login-field input:focus {
  outline: none;

  border-color: var(--teal);

  box-shadow: 0 0 0 3px rgba(13, 94, 166, 0.2);
}

#loginError {
  min-height: 18px;
  margin: 0 0 16px;

  color: #f6d7d0;
  font-size: 13px;
  font-weight: 600;
}

#btnLogin {
  width: 100%;

  padding: 13px 16px;

  border: 0;
  border-radius: 10px;

  background: linear-gradient(135deg, var(--teal), var(--forest));

  color: white;

  font-size: 15px;
  font-weight: 700;

  transition: all 0.2s ease;
}

#btnLogin:hover {
  transform: translateY(-2px);

  background: linear-gradient(135deg, var(--forest), var(--teal));

  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

#btnLogin:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes dialog-enter {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@media (max-width: 900px) {
  .workspace-layout {
    flex-direction: column;
    gap: 12px;
  }
  .sidebar {
    position: static;
    width: 100%;
    flex-basis: auto;
    padding: 14px;
  }
  #formList {
    flex-direction: row;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 4px;
  }
  #formList li {
    flex-shrink: 0;
  }
  #content {
    width: 100%;
  }
}
@media (max-width: 700px) {
  .group-options-main,
  .group-options-aside {
    grid-template-columns: 1fr;
  }
  .group-options-aside .group-option {
    grid-column: 1;
  }
}
@media (max-width: 520px) {
  .workspace-layout {
    padding: 16px 12px;
  }
  #content {
    padding: 2px;
    border-radius: 14px;
  }
  th,
  td {
    padding: 8px 10px;
    font-size: 12px;
  }
  th {
    font-size: 10px;
  }
  #currentSection {
    display: none;
  }
  .header-button {
    padding: 8px 10px;
    font-size: 12px;
  }
  .dialog-header {
    padding: 20px 18px 16px;
  }
  #responseDialogContent {
    padding: 6px 18px 20px;
  }
  .responseField {
    grid-template-columns: 1fr;
    gap: 5px;
    padding: 13px 0;
  }
}
