:root {
  --brand: #00b2e2; /* Azul KINT */
  --accent: #002b49; /* Texto oscuro */
  --light: #00b2e2; /* Fondo claro del gradiente */
  --logo-h: 20px; /* Alto del logo (desktop) */
}

/* Reset básico */
* {
  box-sizing: border-box;
}

body {
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--accent);
  margin: 0;
}

a {
  color: var(--brand);
  text-decoration: none;
}

/* Fondo */
/* Fondo con gradiente SOLO una vez */
.bg {
  background-image: linear-gradient(180deg, var(--brand), #ffffff 60%);
  background-repeat: no-repeat; /* <- evita repetir */
  background-size: 100% 100vh; /* <- una franja del alto de la pantalla */
  background-attachment: fixed; /* <- opcional: efecto "anclado" */
  background-color: #ffffff; /* lo que sigue después del gradiente es blanco */
}

/* ====== LAYOUT / CONTENEDORES ====== */
.container {
  max-width: 1280px !important; /* Forzar layout ancho global */
  margin: 0 auto;
  padding: 20px;
}

/* Úsala SOLO si quieres admin más ancho: class="container container-wide" */
.container-wide {
  max-width: 1360px !important;
}

.small-card {
  max-width: 420px;
}

/* Header */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

/* Marca */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 24px;
  color: var(--accent);
}
.logo {
  height: var(--logo-h);
  width: auto;
  object-fit: contain;
  display: block;
}
/* Marca en la tarjeta pública del empleado */
.brandmark {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: -4px 0 10px 0; /* un poco hacia arriba y separación del avatar */
}

.logo-sm {
  height: 25px; /* tamaño pequeño y consistente */
  width: auto;
  display: block;
  object-fit: contain;
}

.brandmark-name {
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.2px;
  opacity: 0.9;
  font-size: 14px;
}

/* en móviles, aún más compacto */
@media (max-width: 480px) {
  .logo-sm {
    height: 20px;
  }
  .brandmark-name {
    font-size: 13px;
  }
}

/* ====== TARJETAS / BLOQUES ====== */
.card {
  width: 100%;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  margin-bottom: 28px;
  padding: 20px;
}
/* separación adicional entre tarjetas contiguas */
.card + .card {
  margin-top: 22px;
}

h1 {
  margin: 10px 0 6px 0;
}
h2 {
  margin: 0 0 12px 0;
}

.muted {
  opacity: 0.7;
}
.small {
  font-size: 12px;
}
.mt {
  margin-top: 16px;
}

/* Perfil (cabecera pública) */
.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px;
  margin-bottom: 28px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}
.profile + .card {
  margin-top: 24px;
}

.avatar {
  width: 110px;
  height: 110px;
  border-radius: 9999px;
  object-fit: cover;
  border: 6px solid #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.center {
  text-align: center;
  margin: 16px 0;
}

.list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.list li {
  margin: 6px 0;
}

/* ====== BOTONES E ICONOS ====== */
.btn {
  background: var(--brand);
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.btn:hover {
  opacity: 0.95;
}

.btn-outline {
  background: transparent;
  color: var(--brand);
  border: 1.5px solid var(--brand);
}
.btn-light {
  background: #eef3ff;
  color: #111827;
}
.btn-danger {
  background: #e11d48;
  color: #fff;
}
.btn-text {
  background: transparent;
  color: #111827;
}

/* Contenedor de acciones centrado y compacto */
.actions {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}
/* Botones de acciones (compactos y horizontales) */
.actions .btn {
  height: 36px;
  padding: 8px 12px;
  border-radius: 12px;
  line-height: 1;
  min-width: auto;
}
/* Iconos pequeños y alineados a la izquierda del texto */
.btn .icon,
.actions .btn .icon {
  width: 16px;
  height: 16px;
  display: block;
  flex: 0 0 16px;
}

/* Utilidades tipo flex */
.d-flex {
  display: flex;
}
.ai-center {
  align-items: center;
}
.gap-8 {
  gap: 8px;
}

/* ====== FORM ====== */
input,
select {
  width: 100%;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  margin-bottom: 10px;
}

/* ====== TABLA ====== */
.table {
  overflow-x: auto;
}

.table .tr {
  display: grid;
  grid-template-columns:
    60px /* ID */
    minmax(220px, 2fr) /* Nombre */
    minmax(220px, 1.6fr) /* Puesto */
    minmax(260px, 1.8fr) /* Email */
    minmax(160px, 1.1fr) /* Teléfono */
    minmax(260px, 1.6fr) /* Slug */
    90px /* Status */
    320px; /* Acciones */
  gap: 16px;
  padding: 12px;
  align-items: center;
  border-bottom: 1px solid #eee;
  min-width: 1100px; /* deja respirar la tabla en viewports angostos */
}
.table .tr > div {
  overflow-wrap: anywhere;
}
.table .head {
  font-weight: 600;
  background: #f9fbff;
}
.table .actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ====== GRID (formularios admin) ====== */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.grid .full {
  grid-column: 1 / span 2;
}

/* Grilla 2 columnas centrada; el botón .btn-full ocupa ambas */
.actions-two-up {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 12px;
  justify-content: center; /* centra la grilla */
  justify-items: center; /* botones llenan su celda */
  max-width: 520px; /* ancho visual del bloque de acciones */
  margin: 14px auto 0; /* centrado dentro de la tarjeta */
}
.actions-two-up .btn {
  width: 100%;
  height: 36px;
}
.actions-two-up .btn-full {
  grid-column: 1 / -1;
} /* ancho completo */

/* Asegura que los SVG respeten el tamaño pequeño del contenedor .icon */
.icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ====== RESPONSIVE ====== */
@media (min-width: 1440px) {
  .container {
    max-width: 1360px !important;
  }
}

@media (max-width: 900px) {
  .table .tr {
    grid-template-columns: 40px 1fr 1fr 0.8fr 0.8fr 1fr 60px 1fr;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .grid .full {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  :root {
    --logo-h: 18px;
  }
  .brand {
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .actions {
    gap: 10px;
  }
  .actions .btn {
    height: 34px;
    padding: 7px 10px;
    font-size: 14px;
  }
  .actions .btn .icon {
    width: 14px;
    height: 14px;
  }
}

/* Card clickeable (botón) */
.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s, transform 0.05s;
}
.card-link:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}
.card-link:active {
  transform: translateY(1px);
}

/* Layout interno con icono y flecha */
.map-row {
  display: grid;
  grid-template-columns: 36px 1fr 18px;
  gap: 12px;
  align-items: center;
}
.map-icon svg {
  width: 24px;
  height: 24px;
  color: var(--brand);
}
.map-arrow {
  font-size: 16px;
  opacity: 0.5;
}
.map-cta {
  margin-top: 8px;
  font-weight: 600;
  color: var(--brand);
}

/* Móvil */
@media (max-width: 480px) {
  .map-row {
    grid-template-columns: 28px 1fr 14px;
    gap: 10px;
  }
  .map-icon svg {
    width: 20px;
    height: 20px;
  }
}

/* Card clickeable (botón) */
.card-link {
  display: block;
  text-align: left;
  cursor: pointer;
  border: 0;
  background: #fff;
  color: inherit;
  width: 100%;
}
.card-link:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}
.card-link:active {
  transform: translateY(1px);
}

/* Layout interno con icono y flecha */
.map-row {
  display: grid;
  grid-template-columns: 36px 1fr 18px;
  gap: 12px;
  align-items: center;
}
.map-icon svg {
  width: 24px;
  height: 24px;
  color: var(--brand);
}
.map-arrow {
  font-size: 16px;
  opacity: 0.5;
}
.map-cta {
  margin-top: 8px;
  font-weight: 600;
  color: var(--brand);
}

/* Modal base */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 1000;
}
.modal.show {
  display: block;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: saturate(120%) blur(2px);
}
.modal-dialog {
  position: relative;
  width: min(900px, 92vw);
  margin: 8vh auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #eef2f6;
}
.modal-close {
  background: transparent;
  border: 0;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 6px 8px;
  color: #475569;
}
.modal-close:hover {
  color: #1f2937;
}
.modal-body {
  padding: 0;
}

/* Contenedor del iframe con ratio */
.map-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
}
.map-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Responsive */
@media (max-width: 480px) {
  .map-row {
    grid-template-columns: 28px 1fr 14px;
    gap: 10px;
  }
  .map-icon svg {
    width: 20px;
    height: 20px;
  }
  .modal-dialog {
    width: 96vw;
    margin: 6vh auto;
  }
  .map-embed {
    aspect-ratio: 4 / 3;
  }
}
