/* Archivo: css/inicio/gestion-usuarios.css */

/* === ENCABEZADO === */
.gu-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
  min-width: 0;
}

@media (min-width: 640px) {
  .gu-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.gu-header-info {
  min-width: 0;
  flex: 1;
}

.gu-header-info h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.gu-header-info p {
  font-size: 0.8rem;
  color: #64748b;
  margin: 2px 0 0;
}

.gu-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: #0ea5e9;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.gu-btn-primary:hover { background: #0284c7; }
.gu-btn-primary .material-symbols-outlined { font-size: 18px; }

/* === CARRUSEL DE TARJETAS === */
.gu-carousel {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.gu-carousel-viewport {
  overflow: hidden;
  flex: 1;
  min-width: 0;
  width: 0; /* fuerza que flex-basis no se expanda más allá del contenedor */
}

/* Cada página: columna vertical de cards */
.gu-cards-page {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
}

.gu-cards-track {
  display: flex;
  gap: 0;
  transition: transform 0.35s ease;
}

.gu-carousel-btn {
  width: 32px;
  align-self: center;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.gu-carousel-btn:hover:not(:disabled) {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}

.gu-carousel-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.gu-carousel-btn .material-symbols-outlined {
  font-size: 20px;
}

/* === TARJETA DE USUARIO === */
.gu-card {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  border: 1.5px solid #f1f5f9;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  position: relative;
  transition: box-shadow 0.2s;
}

.gu-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

/* Menú 3 puntos */
.gu-menu-wrap {
  position: absolute;
  top: 10px;
  right: 10px;
}

.gu-btn-icon {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 4px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.gu-btn-icon:hover {
  color: #475569;
  background: #f1f5f9;
}

.gu-btn-icon .material-symbols-outlined { font-size: 18px; }

.gu-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 4px;
  width: 150px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.12);
  border: 1px solid #e2e8f0;
  padding: 4px 0;
  z-index: 10;
}

.gu-dropdown.open { display: block; }

.gu-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 14px;
  border: none;
  background: transparent;
  text-align: left;
  font-family: 'Inter', sans-serif;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.gu-dropdown-item .material-symbols-outlined { font-size: 17px; }

.gu-dropdown-item.edit { color: #2563eb; }
.gu-dropdown-item.edit:hover { background: #eff6ff; }
.gu-dropdown-item.delete { color: #ef4444; }
.gu-dropdown-item.delete:hover { background: #fef2f2; }

/* Info del usuario */
.gu-card-body {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.gu-avatar-img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e0f2fe;
  flex-shrink: 0;
}

.gu-avatar-initial {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #e0f2fe;
  color: #0ea5e9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
}

.gu-user-info {
  padding-right: 24px;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}

.gu-user-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gu-user-detail {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.76rem;
  color: #64748b;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gu-user-detail .material-symbols-outlined {
  font-size: 14px;
  flex-shrink: 0;
  color: #94a3b8;
}

/* Footer */
.gu-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}

.gu-badge-rol {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.73rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: #0ea5e9;
  color: #fff;
}

.gu-badge-estado {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.73rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1.5px solid;
}

.gu-badge-estado.activo {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

.gu-badge-estado.inactivo {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #64748b;
}

.gu-badge-estado .material-symbols-outlined,
.gu-badge-rol .material-symbols-outlined { font-size: 14px; }

/* === ESTADO VACÍO === */
.gu-empty {
  text-align: center;
  padding: 48px 20px;
  background: #fff;
  border-radius: 16px;
  border: 1.5px dashed #e2e8f0;
}

.gu-empty .material-symbols-outlined {
  font-size: 42px;
  color: #cbd5e1;
  margin-bottom: 10px;
}

.gu-empty h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 4px;
}

.gu-empty p {
  font-size: 0.84rem;
  color: #94a3b8;
  margin: 0;
}

/* === MODAL OVERLAY === */
.gu-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s;
}

.gu-modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* === MODAL BOX === */
.gu-modal-box {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.14);
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(14px) scale(0.98);
  transition: transform 0.22s, opacity 0.22s;
  opacity: 0;
}

.gu-modal-overlay.active .gu-modal-box {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.gu-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px 18px;
  border-bottom: 1px solid #f1f5f9;
}

.gu-modal-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.gu-modal-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.gu-modal-close:hover { background: #e2e8f0; }
.gu-modal-close .material-symbols-outlined { font-size: 19px; }

.gu-modal-body {
  padding: 22px 24px;
}

/* === FORMULARIO === */
.gu-form-group {
  margin-bottom: 16px;
}

.gu-form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.gu-form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 480px) {
  .gu-form-row { grid-template-columns: 1fr 1fr; }
}

.gu-input-wrap {
  position: relative;
}

.gu-input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  display: flex;
  align-items: center;
}

.gu-input-icon .material-symbols-outlined { font-size: 18px; }

.gu-input {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  color: #1e293b;
  background: #f8fafc;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.gu-input.has-icon { padding-left: 36px; }

.gu-input:focus {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14,165,233,0.1);
  background: #fff;
}

/* === SUBIDA DE FOTO === */
.gu-photo-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}

.gu-photo-preview-wrap {
  position: relative;
  cursor: pointer;
}

.gu-photo-preview {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #e0f2fe;
  display: none;
}

.gu-photo-placeholder {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 3px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  transition: background 0.2s;
}

.gu-photo-placeholder .material-symbols-outlined { font-size: 28px; }

.gu-photo-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  color: #fff;
}

.gu-photo-overlay .material-symbols-outlined { font-size: 22px; }

.gu-photo-preview-wrap:hover .gu-photo-placeholder { background: #e2e8f0; }
.gu-photo-preview-wrap:hover .gu-photo-overlay { opacity: 1; }

.gu-photo-hint {
  font-size: 0.73rem;
  color: #94a3b8;
  margin-top: 6px;
}

/* === FOOTER MODAL === */
.gu-modal-footer {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.gu-modal-footer button { flex: 1; }

.gu-btn-outline {
  padding: 10px 16px;
  background: #f1f5f9;
  color: #64748b;
  border: none;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.gu-btn-outline:hover { background: #e2e8f0; }

.gu-btn-danger {
  padding: 10px 16px;
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.gu-btn-danger:hover { background: #dc2626; }

/* === MODAL CONFIRMAR ELIMINAR === */
.gu-confirm-box {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.14);
  width: 100%;
  max-width: 380px;
  padding: 28px 24px;
  text-align: center;
  transform: translateY(14px) scale(0.98);
  transition: transform 0.22s, opacity 0.22s;
  opacity: 0;
}

.gu-modal-overlay.active .gu-confirm-box {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.gu-confirm-icon {
  width: 60px;
  height: 60px;
  background: #fef2f2;
  color: #ef4444;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}

.gu-confirm-icon .material-symbols-outlined { font-size: 30px; }

.gu-confirm-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 6px;
}

.gu-confirm-text {
  font-size: 0.84rem;
  color: #64748b;
  margin: 0 0 20px;
  line-height: 1.4;
}

.gu-confirm-footer {
  display: flex;
  gap: 10px;
}

.gu-confirm-footer button { flex: 1; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .gu-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
  }

  .gu-header-info {
    min-width: 0;
    flex: 1;
    overflow: hidden;
  }

  .gu-header-info h2 { font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .gu-header-info p { display: none; }

  .gu-btn-primary {
    padding: 7px 14px;
    font-size: 0.8rem;
    gap: 4px;
  }

  .gu-btn-primary .material-symbols-outlined { font-size: 16px; }

  .gu-card { padding: 14px; }

  .gu-card-body { gap: 8px; }

  .gu-avatar-img,
  .gu-avatar-initial {
    width: 36px;
    height: 36px;
  }

  .gu-avatar-initial { font-size: 0.88rem; }

  .gu-user-name { font-size: 0.84rem; }
  .gu-user-detail { font-size: 0.72rem; }
  .gu-user-detail .material-symbols-outlined { font-size: 13px; }

  .gu-badge-rol,
  .gu-badge-estado {
    font-size: 0.7rem;
    padding: 3px 8px;
  }

  .gu-badge-rol .material-symbols-outlined,
  .gu-badge-estado .material-symbols-outlined { font-size: 13px; }

  .gu-menu-wrap { top: 8px; right: 8px; }

  .gu-btn-icon {
    width: 26px;
    height: 26px;
  }

  .gu-btn-icon .material-symbols-outlined { font-size: 17px; }

  .gu-dropdown-item { font-size: 0.78rem; padding: 7px 12px; }
  .gu-dropdown-item .material-symbols-outlined { font-size: 15px; }

  .gu-carousel { gap: 4px; }
  .gu-cards-track { gap: 0; }
  .gu-cards-page { gap: 8px; }

  .gu-carousel-btn {
    width: 26px;
    height: 26px;
  }

  .gu-carousel-btn .material-symbols-outlined { font-size: 18px; }

  .gu-modal-box { max-width: 100%; margin: 0 8px; }

  /* ── Corrección del layout padre (gestion-equipo) ── */
  .gestion-layout {
    display: block !important;
    padding: 0 !important;
    overflow-x: hidden !important;
  }

  .gestion-left,
  .gestion-right {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  #gu-container {
    width: 100% !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
    margin-bottom: 24px !important;
  }

  /* Carrusel: nunca más ancho que la pantalla */
  .gu-carousel,
  .gu-carousel-viewport,
  .gu-cards-track,
  .gu-cards-page,
  .gu-card {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}