:root {
  --azul-noche: #101b4f;
  --azul-grafix: #182760;
  --azul-vivo: #1f6fe5;
  --azul-claro: #4aa3ff;
  --naranja: #f28c18;
  --verde: #2f9d46;
  --rojo: #d92d3a;
  --gris-fondo: #f3f6fb;
  --gris-borde: #dce3ef;
  --gris-texto: #5f6b7a;
  --blanco: #ffffff;
  --sombra-suave: 0 18px 45px rgba(16, 27, 79, 0.12);
  --sombra-boton: 0 12px 28px rgba(31, 111, 229, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--azul-noche);
  background:
    radial-gradient(circle at 8% 14%, rgba(47, 157, 70, 0.12), transparent 18%),
    radial-gradient(circle at 92% 8%, rgba(242, 140, 24, 0.14), transparent 20%),
    radial-gradient(circle at 50% 0%, rgba(31, 111, 229, 0.13), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, #f4f7fc 42%, #eef3fb 100%);
}

/* Franja decorativa tipo portal */
body::before {
  content: "";
  position: fixed;
  inset: 88px 0 auto 0;
  height: 96px;
  background:
    linear-gradient(90deg, rgba(16, 27, 79, 0.95), rgba(24, 39, 96, 0.92)),
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.08) 0,
      rgba(255, 255, 255, 0.08) 2px,
      transparent 2px,
      transparent 14px
    );
  z-index: -2;
}

body::after {
  content: "";
  position: fixed;
  right: -110px;
  top: 110px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(242, 140, 24, 0.18), transparent 62%);
  z-index: -1;
}

/* Topbar */
.topbar {
  width: 100%;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(220, 227, 239, 0.9);
  box-shadow: 0 8px 28px rgba(16, 27, 79, 0.08);
  padding: 18px 46px;
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
}

.topbar-content {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-logo {
  height: 66px;
  width: auto;
  display: block;
  object-fit: contain;
}

.brand-text strong {
  display: block;
  font-size: 23px;
  color: var(--azul-noche);
  letter-spacing: -0.3px;
}

.brand-text span {
  display: block;
  margin-top: 4px;
  color: var(--gris-texto);
  font-size: 14px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Layout principal */
.container {
  width: calc(100% - 72px);
  max-width: 1320px;
  margin: 38px auto 48px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,255,255,0.94));
  border: 1px solid rgba(220, 227, 239, 0.92);
  border-radius: 28px;
  padding: 44px;
  box-shadow: var(--sombra-suave);
  position: relative;
  overflow: hidden;
}

.container::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 9px;
  height: 100%;
  background: linear-gradient(180deg, var(--verde), var(--azul-vivo), var(--naranja));
}

.container::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -90px;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(31, 111, 229, 0.10), transparent 65%);
}

/* Header interno */
.header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 42px;
  position: relative;
  z-index: 1;
}

.header h1 {
  margin: 0;
  font-size: 44px;
  letter-spacing: -1px;
  line-height: 1.1;
  color: var(--azul-noche);
}

.header h1::after {
  content: "";
  display: block;
  width: 76px;
  height: 5px;
  margin-top: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--verde), var(--naranja));
}

.header p {
  margin: 14px 0 0;
  font-size: 18px;
  color: var(--gris-texto);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-box {
  min-width: 290px;
  padding: 18px 18px;
  border-radius: 18px;
  border: 1px solid #dfe6f1;
  background:
    linear-gradient(135deg, #ffffff, #f7faff);
  box-shadow: 0 14px 30px rgba(16, 27, 79, 0.09);
}

.user-box strong {
  display: block;
  margin-bottom: 10px;
  color: var(--azul-noche);
  font-size: 15px;
}

.user-box span {
  font-size: 14px;
  color: #20335f;
  margin-right: 10px;
}

.btn-secundario {
  border: none;
  border-radius: 999px;
  padding: 8px 12px;
  background: #edf4ff;
  color: var(--azul-vivo);
  font-weight: 800;
  cursor: pointer;
}

/* Botones */
.btn-link,
button {
  border: none;
  border-radius: 14px;
  padding: 15px 30px;
  color: white;
  background: linear-gradient(135deg, var(--azul-noche), var(--azul-vivo));
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--sombra-boton);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.btn-link:hover,
button:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(31, 111, 229, 0.34);
  filter: saturate(1.08);
}

button[type="submit"] {
  width: 100%;
  margin-top: 16px;
  font-size: 16px;
}

/* Formulario */
form {
  position: relative;
  z-index: 1;
}

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

label {
  display: block;
  margin-bottom: 9px;
  font-size: 15px;
  font-weight: 900;
  color: var(--azul-noche);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--gris-borde);
  border-radius: 14px;
  background: #ffffff;
  padding: 15px 17px;
  font-size: 16px;
  color: #17233f;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #b9c8df;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--azul-vivo);
  box-shadow: 0 0 0 4px rgba(31, 111, 229, 0.13);
}

input[readonly],
select:disabled {
  background: #f8fafc;
  color: #64748b;
}

textarea {
  min-height: 132px;
  resize: vertical;
}

small {
  color: var(--gris-texto);
  display: block;
  margin-top: 8px;
}

/* Mensajes */
#mensaje,
#mensajeEncuesta {
  margin-top: 16px;
  font-weight: 900;
}

.error {
  color: var(--rojo);
}

.ok {
  color: var(--verde);
}

/* Tabla */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  border-radius: 20px;
  border: 1px solid #dfe6f1;
  background: #ffffff;
  position: relative;
  z-index: 1;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1120px;
}

thead th {
  padding: 15px 12px;
  text-align: left;
  color: white;
  font-size: 14px;
  background: linear-gradient(135deg, var(--azul-noche), var(--azul-vivo));
}

tbody td {
  padding: 15px 12px;
  border-bottom: 1px solid #edf1f7;
  font-size: 14px;
  vertical-align: top;
}

tbody tr:nth-child(even) {
  background: #f8fbff;
}

tbody tr:hover {
  background: #edf6ff;
}

td small {
  color: var(--gris-texto);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 999px;
  background: #eaf2ff;
  color: var(--azul-vivo);
  font-weight: 900;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  min-width: 7px;
  border-radius: 50%;
  background: var(--naranja);
}

/* Encuesta */
.encuesta-card {
  max-width: 780px;
}

.encuesta-card h1 {
  font-size: 42px;
}

/* Ajustes responsive */
@media (max-width: 920px) {
  .topbar {
    padding: 14px 22px;
  }

  .topbar-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .container {
    width: calc(100% - 28px);
    padding: 30px;
    margin-top: 26px;
  }

  .header {
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .user-box,
  .btn-link {
    width: 100%;
  }

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

  .header h1 {
    font-size: 34px;
  }
}

.subtexto {
  max-width: 620px;
  color: var(--gris-texto);
  font-size: 15px !important;
  margin-top: 8px !important;
}

.info-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 10px 0 38px;
  position: relative;
  z-index: 1;
}

.info-card {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  background: linear-gradient(135deg, #ffffff, #f8fbff);
  border: 1px solid #dfe6f1;
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 12px 26px rgba(16, 27, 79, 0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.info-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 34px rgba(16, 27, 79, 0.14);
}

.info-card h3 {
  margin: 0 0 6px;
  color: var(--azul-noche);
  font-size: 17px;
  font-weight: 900;
}

.info-card p {
  margin: 0;
  color: var(--gris-texto);
  font-size: 14px;
  line-height: 1.45;
}

.info-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 15px;
  color: #ffffff;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 18px;
  box-shadow: 0 10px 22px rgba(16, 27, 79, 0.18);
}

.info-icon.verde {
  background: linear-gradient(135deg, var(--verde), #56c873);
}

.info-icon.azul {
  background: linear-gradient(135deg, var(--azul-noche), var(--azul-vivo));
}

.info-icon.naranja {
  background: linear-gradient(135deg, var(--naranja), #ffb347);
}

@media (max-width: 920px) {
  .info-cards {
    grid-template-columns: 1fr;
  }
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.action-buttons .btn-link {
  text-align: center;
  min-width: 150px;
}

.title-with-icon {
  display: flex;
  align-items: center;
  gap: 16px;
  width: fit-content;
}

.title-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(16, 27, 79, 0.16));
}

.title-with-icon h1 {
  margin: 0;
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.action-buttons .btn-link {
  text-align: center;
  min-width: 150px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-data {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  line-height: 1.15;
}

.profile-photo {
  width: 54px;
  height: 54px;
  min-width: 54px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #eaf2ff;
  box-shadow: 0 8px 18px rgba(16, 27, 79, 0.16);
}

.user-box {
  position: relative;
  min-width: 290px;
  padding: 16px 82px 16px 18px;
}

.user-info {
  display: block;
  position: relative;
}

.profile-photo {
  position: absolute;
  top: 4px;
  right: -64px;
  width: 58px;
  height: 58px;
  min-width: 58px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #ffffff;
  box-shadow: 0 10px 22px rgba(16, 27, 79, 0.18);
}

.user-data strong {
  display: block;
  margin: 0;
  font-size: 15px;
}

.user-data span {
  display: block;
  margin: 0;
  font-size: 14px;
}

.user-data .btn-secundario {
  margin-top: 6px;
  padding: 7px 14px;
}

.footer-grafix {
  width: calc(100% - 72px);
  max-width: 1320px;
  margin: 0 auto 28px;
  padding: 18px 24px;
  text-align: center;
  color: #5f6b7a;
  font-size: 13px;
}

.footer-grafix p {
  margin: 4px 0;
}

.footer-grafix p:first-child {
  font-weight: 700;
  color: #101b4f;
}
