/* ========================================
   MQB CRM — Estilos Principales
   ======================================== */

:root {
  --sidebar-width: 240px;
  --sidebar-collapsed-width: 0px;
}

/* Layout */
#wrapper {
  min-height: 100vh;
}

#sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  align-self: flex-start; /* no estirar con el contenido de la página (#wrapper es flex) */
  position: sticky;
  top: 0;
  transition: width 0.25s ease;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

#sidebar.collapsed {
  width: 0;
  min-width: 0;
}

#page-content-wrapper {
  min-height: 100vh;
  background-color: #f8f9fa;
}

/* Sidebar links */
#sidebar .nav-link {
  border-radius: 8px;
  padding: 8px 12px;
  font-size: .875rem;
  transition: background-color 0.15s;
}

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

#sidebar .nav-link.active {
  font-weight: 600;
}

/* Avatar */
.avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* KPI icons */
.kpi-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Pipeline board */
.pipeline-board .card {
  transition: box-shadow 0.15s;
}

.deal-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,.1) !important;
}

/* Stage dots */
.stage-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #dee2e6;
  margin: 0 auto;
  border: 3px solid #dee2e6;
}
.stage-dot.active {
  background: #0d6efd;
  border-color: #0d6efd;
  box-shadow: 0 0 0 4px rgba(13,110,253,.2);
}
.stage-dot.done {
  background: #198754;
  border-color: #198754;
}

/* Auth page */
.auth-page {
  background-color: #f0f2f5;
}

/* Filas/links clicables (listas, resultados de búsqueda) */
.hover-bg {
  transition: background-color .12s ease;
}
.hover-bg:hover {
  background-color: #f1f3f5;
}

/* Cards */
.card {
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.card-header {
  border-radius: 12px 12px 0 0 !important;
}

/* Tables */
.table th {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 600;
  color: #6c757d;
}

.table td {
  font-size: .875rem;
  padding-top: .6rem;
  padding-bottom: .6rem;
}

/* Badge tweaks */
.badge {
  font-weight: 500;
}

.badge i {
  font-size: .7rem;
}

/* Forms */
.form-control:focus,
.form-select:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 3px rgba(13,110,253,.15);
}

/* Sidebar header */
.sidebar-header {
  min-height: 60px;
}

/* Responsive */
@media (max-width: 768px) {
  #sidebar {
    width: 0;
    min-width: 0;
    position: fixed;
    z-index: 1040;
    height: 100vh;
  }
  #sidebar.open {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
  }
}


/* Contact typeahead (autocompletado de búsqueda de contactos) */
.contact-typeahead-results {
  top: 100%;
  left: 0;
  z-index: 1050;
  max-height: 260px;
  overflow-y: auto;
  background: #fff;
  border-radius: .375rem;
}
