/* ── Autocomplete cadete ──────────────────────────────────────── */

/* El .panel base tiene overflow:hidden — sobreescribir para que el
   dropdown absoluto no quede clipeado por el contenedor */
.panel:has(.search-cadete-wrapper),
.panel-filters,
.filters-section:has(.search-cadete-wrapper),
.filters-grid {
  overflow: visible;
}

.search-cadete-wrapper {
  position: relative;
}

.cadete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  z-index: 1000;
  max-height: 280px;
  overflow-y: auto;
}

.cadete-dropdown-item {
  padding: 0.7rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.12s;
}
.cadete-dropdown-item:last-child { border-bottom: none; }
.cadete-dropdown-item:hover { background: var(--bg-primary); }
.cadete-dropdown-item .cdi-nombre {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}
.cadete-dropdown-item .cdi-meta {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ── Ficha del cadete (dashboard) ─────────────────────────────── */
.cadete-ficha {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  flex-wrap: wrap;
}
.cadete-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.cadete-ficha-info { flex: 1; min-width: 0; }
.cadete-ficha-nombre {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}
.cadete-ficha-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.5rem 1.5rem;
}
.cadete-ficha-field label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 0.15rem;
}
.cadete-ficha-field span {
  font-size: 0.88rem;
  color: var(--text-primary);
}
.cadete-ficha-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.2rem;
  padding: 0.2rem 0.4rem;
  line-height: 1;
  border-radius: 4px;
  flex-shrink: 0;
}
.cadete-ficha-close:hover { background: var(--bg-primary); color: var(--text-primary); }

/* ── Dashboard Grid Principal ─────────────────────────────────── */
/* Dashboard Grid Principal */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2rem;
}

/* KPI Grid - Diseno Compacto */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 2rem;
}

/* Responsive */
@media (max-width: 1400px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .movements-panel {
    max-height: 500px;
  }
}

@media (max-width: 768px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
}
