/* ==========================================================================
   GEOMITAG - ESTILOS DE PANELES DE CONTROL (INMOBILIARIA & ADMINISTRADOR)
   ========================================================================== */

:root {
  --color-primary-dark: #020617;
  --color-primary: #0f172a;
  --color-primary-light: #1e293b;
  --color-accent-gold: #d4a329;
  --color-accent-gold-hover: #b88b1e;
  
  --status-available: #10b981;
  --status-available-bg: #ecfdf5;
  --status-available-border: #6ee7b7;
  
  --status-reserved: #f59e0b;
  --status-reserved-bg: #fffbeb;
  --status-reserved-border: #fcd34d;
  
  --status-sold: #ef4444;
  --status-sold-bg: #fef2f2;
  --status-sold-border: #fca5a5;

  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #0f172a;
  --border-color: #e2e8f0;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --text-white: #ffffff;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
}

/* ==========================================================================
   LAYOUT DEL DASHBOARD (SIDEBAR + MAIN CONTENT)
   ========================================================================== */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

.dashboard-sidebar {
  width: 270px;
  background-color: var(--color-primary);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  box-shadow: 4px 0 15px rgba(0, 0, 0, 0.2);
}

.sidebar-brand {
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.15);
}

.sidebar-brand-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-brand-logo {
  height: 38px;
  width: auto;
  object-fit: contain;
  background: #ffffff;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.sidebar-subbrand-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 6px 12px;
  border-radius: 8px;
}

.sidebar-subbrand-logo {
  height: 22px;
  width: auto;
  object-fit: contain;
}

.sidebar-brand-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #fff;
}

.sidebar-brand-sub {
  font-size: 0.72rem;
  color: var(--color-accent-gold);
  font-weight: 600;
  text-transform: uppercase;
}

.sidebar-menu {
  list-style: none;
  padding: 20px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.sidebar-link i {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
}

.sidebar-link:hover, .sidebar-link.active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.sidebar-link.active {
  background: var(--color-primary);
  border-left: 4px solid var(--color-accent-gold);
  color: #ffffff;
  font-weight: 600;
}

.sidebar-user-box {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-box-info {
  overflow: hidden;
}

.user-box-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.user-box-role {
  font-size: 0.75rem;
  color: var(--color-accent-gold);
  text-transform: uppercase;
}

.btn-sidebar-logout {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: color 0.2s ease;
}

.btn-sidebar-logout:hover {
  color: #ef4444;
}

/* ==========================================================================
   CONTENIDO PRINCIPAL
   ========================================================================== */
.dashboard-main {
  flex: 1;
  margin-left: 270px;
  padding: 30px 40px;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.dashboard-title h1 {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--color-primary-dark);
}

.dashboard-title p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-top: 4px;
}

.dashboard-header-actions {
  display: flex;
  gap: 12px;
}

/* ==========================================================================
   BOTONES
   ========================================================================== */
.btn-dash {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.btn-dash-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-dash-primary:hover {
  background: var(--color-primary-light);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.25);
}

.btn-dash-gold {
  background: var(--color-accent-gold);
  color: #fff;
}

.btn-dash-gold:hover {
  background: var(--color-accent-gold-hover);
}

.btn-dash-outline {
  background: #fff;
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-dash-outline:hover {
  background: #f1f5f9;
}

.btn-dash-danger {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

.btn-dash-danger:hover {
  background: #dc2626;
  color: #fff;
}

/* ==========================================================================
   TARJETAS DE MÉTRICAS (KPIS)
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--bg-card);
  padding: 22px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-card-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.stat-card-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--color-primary-dark);
  margin-top: 4px;
}

.stat-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

.stat-card-icon.blue { background: #eff6ff; color: #3b82f6; }
.stat-card-icon.green { background: #ecfdf5; color: #10b981; }
.stat-card-icon.amber { background: #fffbeb; color: #f59e0b; }
.stat-card-icon.red { background: #fef2f2; color: #ef4444; }
.stat-card-icon.gold { background: #fef8eb; color: var(--color-accent-gold); }

/* ==========================================================================
   TABLA DE PROPIEDADES
   ========================================================================== */
.table-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.table-toolbar {
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  gap: 16px;
  flex-wrap: wrap;
}

.table-search-box {
  display: flex;
  align-items: center;
  background: #f1f5f9;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  gap: 10px;
  width: 300px;
}

.table-search-box input {
  background: transparent;
  border: none;
  outline: none;
  font-size: 0.88rem;
  width: 100%;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.dash-table th {
  background: #f8fafc;
  padding: 14px 20px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.dash-table td {
  padding: 16px 20px;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.dash-table tr:hover {
  background: #fbfcfe;
}

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

.prop-cell-thumb {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: #e2e8f0;
}

.prop-cell-title {
  font-weight: 600;
  color: var(--color-primary-dark);
}

.prop-cell-cat {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Badges de Estatus */
.badge-status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-status.disponible { background: var(--status-available-bg); color: var(--status-available); border: 1px solid var(--status-available-border); }
.badge-status.apartado { background: var(--status-reserved-bg); color: #b45309; border: 1px solid var(--status-reserved-border); }
.badge-status.vendido { background: var(--status-sold-bg); color: var(--status-sold); border: 1px solid var(--status-sold-border); }
.badge-status.activo { background: #ecfdf5; color: #047857; }
.badge-status.suspendido { background: #fef2f2; color: #b91c1c; }

/* Selector rápido de estatus en tabla */
.status-select-inline {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
  cursor: pointer;
  outline: none;
}

/* Acciones en tabla */
.actions-cell {
  display: flex;
  gap: 8px;
}

.btn-icon-action {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  background: #fff;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-icon-action:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.btn-icon-action.delete:hover {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
}

/* ==========================================================================
   ESTILOS DEL EDITOR CON MAPA LEAFLET INTEGRADO (editor.html)
   ========================================================================== */
.editor-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.editor-form-card {
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.form-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.12);
}

/* Mapa del editor */
.editor-map-card {
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  position: sticky;
  top: 24px;
}

.editor-map-toolbar {
  padding: 14px 20px;
  background: var(--color-primary-dark);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.map-tools-btns {
  display: flex;
  gap: 8px;
}

.btn-tool {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-tool:hover, .btn-tool.active {
  background: var(--color-accent-gold);
  color: #000;
}

.editor-map-view {
  height: 520px;
  width: 100%;
}

.editor-map-stats {
  padding: 12px 20px;
  background: #f8fafc;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  font-size: 0.85rem;
  font-weight: 600;
}

.map-stat-highlight {
  color: var(--color-primary);
  font-weight: 700;
}

/* ==========================================================================
   AUTENTICACIÓN (LOGIN & REGISTRO)
   ========================================================================== */
.auth-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #020617 0%, #0f172a 50%, #020617 100%);
  padding: 24px 16px;
}

.auth-card {
  background: #fff;
  width: 100%;
  max-width: 460px;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.auth-header {
  background: var(--color-primary);
  padding: 32px 24px 28px 24px;
  text-align: center;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-brand-logos {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 18px;
}

.auth-logo-primary {
  height: 52px;
  width: auto;
  object-fit: contain;
  background: #ffffff;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

/* Logo Georbi abajo de la ventana de login (Todo blanco con círculo amarillo) */
.auth-footer-branding {
  margin-top: 22px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.auth-georbi-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

.auth-georbi-badge:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(212, 175, 55, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.auth-georbi-logo-img {
  height: 28px;
  width: auto;
  object-fit: contain;
  display: block;
}

.auth-georbi-hover-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.03em;
  transition: color 0.2s ease;
}

.auth-georbi-badge:hover .auth-georbi-hover-label {
  color: #fde047;
}

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
}

.auth-tab {
  flex: 1;
  text-align: center;
  padding: 14px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  background: #f8fafc;
  color: var(--text-muted);
  border: none;
  transition: all 0.2s ease;
}

.auth-tab.active {
  background: #fff;
  color: var(--color-primary);
  border-bottom: 2px solid var(--color-primary);
}

.auth-body {
  padding: 28px;
}

/* ==========================================================================
   RESPONSIVIDAD
   ========================================================================== */
@media (max-width: 1024px) {
  .editor-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .dashboard-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  .dashboard-sidebar.open {
    transform: translateX(0);
  }
  .dashboard-main {
    margin-left: 0;
    padding: 20px;
  }
}

/* ==========================================================================
   ESTILOS DE GESTIÓN DE LOTES (FRACCIONAMIENTO)
   ========================================================================== */
.lot-kpi-chip {
  padding: 4px 10px;
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.lot-kpi-chip.green {
  background: var(--status-available-bg);
  border-color: var(--status-available-border);
  color: var(--status-available);
}
.lot-kpi-chip.amber {
  background: var(--status-reserved-bg);
  border-color: var(--status-reserved-border);
  color: var(--status-reserved);
}
.lot-kpi-chip.red {
  background: var(--status-sold-bg);
  border-color: var(--status-sold-border);
  color: var(--status-sold);
}

.lot-status-select {
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  cursor: pointer;
  outline: none;
}
.lot-status-select.disponible {
  background: var(--status-available-bg);
  color: #065f46;
  border-color: var(--status-available-border);
}
.lot-status-select.apartado {
  background: var(--status-reserved-bg);
  color: #92400e;
  border-color: var(--status-reserved-border);
}
.lot-status-select.vendido {
  background: var(--status-sold-bg);
  color: #991b1b;
  border-color: var(--status-sold-border);
}

.drawing-lot-banner {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 30px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1000;
  font-size: 0.82rem;
  border: 2px solid var(--color-accent-gold);
}

.btn-lot-action {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  color: var(--text-muted);
  transition: all 0.15s ease;
}
.btn-lot-action:hover {
  background: #f1f5f9;
  color: var(--color-primary);
}
.btn-lot-action.delete:hover {
  background: #fef2f2;
  color: #ef4444;
}

/* ==========================================================================
   ESTILOS DE MODALES PARA EL DASHBOARD
   ========================================================================== */
.dash-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.80);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.dash-modal-backdrop.active {
  display: flex;
}

.dash-modal {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid rgba(226, 232, 240, 0.8);
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.dash-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
}

.dash-modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  display: flex;
  align-items: center;
  gap: 10px;
}

.dash-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}
.dash-modal-close:hover {
  background: #e2e8f0;
  color: #ef4444;
}

.dash-modal-body {
  padding: 24px;
}

.dash-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background: #f8fafc;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

/* Badges de estado */
.badge-status.pausado {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #ffedd5;
}

.badge-status.suspendido {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fee2e2;
}

.badge-status.activo {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #d1fae5;
}

/* Botones de acción compactos */
.btn-action-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}
.btn-action-pill.primary {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}
.btn-action-pill.primary:hover {
  background: #dbeafe;
}
.btn-action-pill.warning {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}
.btn-action-pill.warning:hover {
  background: #fef3c7;
}
.btn-action-pill.danger {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}
.btn-action-pill.danger:hover {
  background: #fee2e2;
}
.btn-action-pill.secondary {
  background: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}
.btn-action-pill.secondary:hover {
  background: #e2e8f0;
}

