/**
 * ====================================================================
 * ESTILOS DE MÓDULOS ESPECÍFICOS (CATÁLOGO, CRM, AGENTES, SUBIDA DE FOTOS, LOGIN)
 * ====================================================================
 */

/* ====================================================================
 * BARRA DE HERRAMIENTAS Y FILTROS AVANZADOS
 * ==================================================================== */
.toolbar-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.search-filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}

.search-input-wrapper {
  position: relative;
  min-width: 260px;
  flex: 1;
}

.search-input-wrapper svg {
  position: absolute;
  left: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.search-input-wrapper input {
  padding-left: 2.6rem;
}

.view-mode-toggle {
  display: flex;
  background-color: var(--bg-hover);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  gap: 0.25rem;
}

.view-btn {
  background: transparent;
  border: none;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.view-btn.active {
  background: var(--bg-surface);
  color: var(--accent);
  box-shadow: var(--shadow-xs);
}

/* ====================================================================
 * CUADRÍCULA DE PROPIEDADES (PROPTECH CARDS)
 * ==================================================================== */
.properties-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.property-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  position: relative;
}

.property-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.property-media {
  position: relative;
  height: 220px;
  background-color: var(--bg-hover);
  overflow: hidden;
}

.property-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.property-card:hover .property-media img {
  transform: scale(1.04);
}

.property-badges-overlay {
  position: absolute;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.property-badge-op {
  padding: 0.35rem 0.75rem;
  background: rgba(15, 43, 72, 0.9);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--radius-sm);
  backdrop-filter: blur(4px);
}

.property-price-tag {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  background: rgba(15, 23, 42, 0.85);
  color: #ffffff;
  font-weight: 800;
  font-size: 1.15rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-md);
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.property-content {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.property-type-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.property-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.property-location {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.83rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.property-location svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.property-features-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.feature-item svg {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.property-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

/* ====================================================================
 * GESTOR DE SUBIDA DE IMÁGENES MULTIPLE CON PREVIEW
 * ==================================================================== */
.image-upload-zone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  text-align: center;
  background: var(--bg-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: 1.25rem;
  position: relative;
}

.image-upload-zone:hover, .image-upload-zone.dragover {
  border-color: var(--accent);
  background: rgba(2, 132, 199, 0.05);
}

.image-upload-zone svg {
  width: 44px;
  height: 44px;
  color: var(--accent);
  margin: 0 auto 0.75rem;
}

.image-upload-zone p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.image-upload-zone span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.image-upload-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.preview-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid var(--border-color);
  background: var(--bg-hover);
}

.preview-thumb.is-primary {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-light);
}

.preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-thumb .primary-indicator {
  position: absolute;
  top: 4px;
  left: 4px;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.preview-thumb .remove-thumb-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

/* ====================================================================
 * VISTA DE AGENTES INMOBILIARIOS
 * ==================================================================== */
.agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.5rem;
}

.agent-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  transition: all var(--transition-fast);
}

.agent-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.agent-avatar-lg {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-full);
  margin-bottom: 1rem;
  border: 3px solid var(--accent);
  overflow: hidden;
  background: var(--bg-hover);
}

.agent-avatar-lg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.agent-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.agent-role {
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.85rem;
}

.agent-stats-row {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding: 0.85rem 0;
  width: 100%;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.25rem;
}

.agent-stat-item {
  display: flex;
  flex-direction: column;
}

.agent-stat-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
}

.agent-stat-lbl {
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.agent-actions-group {
  display: flex;
  gap: 0.65rem;
  width: 100%;
}

.agent-actions-group .btn {
  flex: 1;
}

/* ====================================================================
 * VISTA DE LOGIN CORPORATIVA
 * ==================================================================== */
.login-body-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100vw;
  background: var(--bg-body);
}

.login-hero-side {
  flex: 1;
  background: linear-gradient(135deg, rgba(15, 43, 72, 0.95), rgba(2, 132, 199, 0.85)),
              url('https://images.unsplash.com/photo-1600585154340-be6161a56a0c?auto=format&fit=crop&w=1400&q=80') center/cover no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 4rem;
  color: #ffffff;
  position: relative;
}

.login-hero-content h2 {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}

.login-hero-content p {
  font-size: 1.1rem;
  opacity: 0.85;
  max-width: 480px;
  line-height: 1.6;
}

.login-form-side {
  width: 520px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3.5rem;
  background: var(--bg-surface);
}

.login-box-header {
  margin-bottom: 2.25rem;
}

.login-box-header h1 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.login-box-header p {
  font-size: 0.92rem;
  color: var(--text-secondary);
}

@media (max-width: 900px) {
  .login-hero-side {
    display: none;
  }
  .login-form-side {
    width: 100%;
    padding: 2rem 1.5rem;
  }
}
